-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
199 lines (185 loc) · 11.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<!DOCTYPE html>
<html>
<head>
<title>jfxr</title>
<meta charset="utf-8">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto+Condensed:400,300,700|Chango">
<!-- ref:css style.min.css -->
<link rel="stylesheet" href="style.css">
<!-- endref -->
</head>
<body ng-controller="JfxrCtrl as ctrl" ng-keydown="ctrl.keyDown($event)">
<div id="panic" class="errorbar errorbar-panic"></div>
<div ng-cloak ng-if="ctrl.showSafariWarning" class="errorbar errorbar-warning">
Exporting WAV files is broken on Safari. Saving will open a new tab, which you can still save manually.
| <a href="https://github.com/ttencate/jfxr/issues/18">Details</a>
| <a ng-click="ctrl.showSafariWarning = false; $event.preventDefault()" href="#">Dismiss</a>
</div>
<a class="github" href="https://github.com/ttencate/jfxr" title="Fork me on GitHub"></a>
<div class="main position-relative">
<div class="topbar">
<div class="titlepane column-left">
<h1><a href="http://jfxr.frozenfractal.com">jfxr ~</a></h1>
<p class="credits">by <a href="http://twitter.com/frozenfractal">@frozenfractal</a></p>
</div>
<div class="pane pane-top-right column-right playbackpane">
<canvas width="680" height="43" analyser="ctrl.getFrequencyData()" enabled="ctrl.analyserEnabled" ng-click="ctrl.analyserEnabled = !ctrl.analyserEnabled" class="analyser" ng-class="{'analyser-disabled': !ctrl.analyserEnabled}" title="Click to disable frequency analyser (saves battery)"></canvas>
<label class="shiny autoplay" ng-class="{'shiny-checked': ctrl.autoplay}" title="Play automatically on change">
<input type="checkbox" ng-model="ctrl.autoplay"></input>
<span class="shinycontent">Auto</span>
</label>
<button ng-click="ctrl.togglePlay()" class="shiny playstop" ng-class="{'shiny-checked': ctrl.isPlaying()}" title="{{ctrl.isPlaying() ? 'Stop (space)' : 'Play (space)'}}">
<span class="shinycontent"><span class="playicon"></span></span>
</button>
</div>
</div>
<div class="content">
<div class="pane pane-bottom-left column-left filespane">
<div class="toolbar">
<button class="button button-tool" ng-click="ctrl.openSound()" title="Load sound from file">
<span>Open</span>
</button>
<button class="button button-tool" ng-click="ctrl.saveSound()" title="Save current sound to file">
<span>Save</span>
</button>
<button class="button button-tool" ng-click="ctrl.duplicateSound()" title="Duplicate current sound">
<span>Dup</span>
</button>
<button class="button button-tool offsetparent" ng-click="ctrl.createLink()" title="Create a link to the current sound">
<linkbox for="ctrl.link"></linkbox>
<span>Link</span>
</button>
<button class="button button-tool" ng-click="ctrl.exportSound()" title="Export current sound to WAV">
<span>Export</span>
</button>
</div>
<div class="toolbar">
<label class="button button-createnew" ng-class="{'button-checked': ctrl.createNew}" title="Create a new sound each time you click one of the preset buttons">
<input type="checkbox" ng-model="ctrl.createNew"></input>
<span>Create new sound</span>
</label>
<div class="presets">
<button ng-repeat="preset in ctrl.presets" class="button button-preset" ng-click="ctrl.applyPreset(preset)">
<span>{{preset.name}}</span>
</button>
</div>
</div>
<div class="toolbar">
<button class="button button-preset" ng-click="ctrl.mutate()" title="Slightly change all parameters, except those which are locked">
<span>Mutate</span>
<button class="button" ng-disabled="!ctrl.canUndo()" ng-click="ctrl.undo()" title="Undo the last change to the current sound">
<span>Undo</span>
</button>
</div>
<ul class="history">
<li ng-repeat="sound in ctrl.getSounds()" class="sound" ng-class="{'sound-current': $index == ctrl.currentSoundIndex()}">
<input type="text" class="soundname" ng-model="sound.name" ng-model-options="{updateOn: 'blur'}" ng-keydown="ctrl.soundNameKeyDown($event, sound.name)"></input>
<div class="soundnamesensor" ng-click="ctrl.setCurrentSoundIndex($index)" ng-show="$index != ctrl.currentSoundIndex()"></div>
<button class="iconbutton iconbutton-delete deletebutton" ng-click="ctrl.deleteSound($index)" title="Delete this sound"></button>
</li>
</ul>
<div class="statusbar" ng-switch="ctrl.synth.isRunning()">
<span ng-switch-when="true">Rendering…</span>
<span ng-switch-when="false">Render time: {{ctrl.synth.renderTimeMs}} ms</span>
</div>
</div>
<div class="pane pane-bottom-right column-right mainpane">
<canvas canvas-manager waveshape="ctrl.buffer" class="canvas canvas-waveshape"></canvas>
<div class="parameters vertical-scroll">
<div class="parameters-column">
<h2 class="amplitude">Amplitude</h2>
<canvas canvas-manager draw-amplitude="ctrl.getSound()" class="canvas canvas-small"></canvas>
<float-param sound="ctrl.getSound()" param="attack"></float-param>
<float-param sound="ctrl.getSound()" param="sustain"></float-param>
<float-param sound="ctrl.getSound()" param="sustainPunch"></float-param>
<float-param sound="ctrl.getSound()" param="decay"></float-param>
<float-param sound="ctrl.getSound()" param="tremoloDepth"></float-param>
<float-param sound="ctrl.getSound()" param="tremoloFrequency"></float-param>
<h2 class="pitch">Pitch</h2>
<canvas canvas-manager draw-frequency="ctrl.getSound()" class="canvas canvas-small"></canvas>
<float-param sound="ctrl.getSound()" param="frequency"></float-param>
<float-param sound="ctrl.getSound()" param="frequencySweep"></float-param>
<float-param sound="ctrl.getSound()" param="frequencyDeltaSweep"></float-param>
<float-param sound="ctrl.getSound()" param="vibratoDepth"></float-param>
<float-param sound="ctrl.getSound()" param="vibratoFrequency"></float-param>
<float-param sound="ctrl.getSound()" param="repeatFrequency"></float-param>
<float-param sound="ctrl.getSound()" param="frequencyJump1Onset"></float-param>
<float-param sound="ctrl.getSound()" param="frequencyJump1Amount"></float-param>
<float-param sound="ctrl.getSound()" param="frequencyJump2Onset"></float-param>
<float-param sound="ctrl.getSound()" param="frequencyJump2Amount"></float-param>
</div>
<div class="parameters-column">
<h2 class="tone">Tone</h2>
<custom-param sound="ctrl.getSound()" param="waveform">
<div class="paramcontrol waveforms">
<span ng-model="ctrl.getSound().waveform.value" waveform-button="sine" title="Sine"></span>
<span ng-model="ctrl.getSound().waveform.value" waveform-button="triangle" title="Triangle"></span>
<span ng-model="ctrl.getSound().waveform.value" waveform-button="sawtooth" title="Sawtooth"></span>
<span ng-model="ctrl.getSound().waveform.value" waveform-button="square" title="Square"></span>
<span ng-model="ctrl.getSound().waveform.value" waveform-button="tangent" title="Tangent"></span>
<span ng-model="ctrl.getSound().waveform.value" waveform-button="whistle" title="Whistle"></span>
<span ng-model="ctrl.getSound().waveform.value" waveform-button="breaker" title="Breaker"></span>
<span ng-model="ctrl.getSound().waveform.value" waveform-button="whitenoise" title="White noise"></span>
<span ng-model="ctrl.getSound().waveform.value" waveform-button="pinknoise" title="Pink noise"></span>
<span ng-model="ctrl.getSound().waveform.value" waveform-button="brownnoise" title="Brown noise"></span>
</div>
<div class="customparamvalue">
{{ctrl.getSound().waveform.valueTitle()}}
</div>
</custom-param>
<boolean-param sound="ctrl.getSound()" param="interpolateNoise"></boolean-param>
<float-param sound="ctrl.getSound()" param="squareDuty"></float-param>
<float-param sound="ctrl.getSound()" param="squareDutySweep"></float-param>
<float-param sound="ctrl.getSound()" param="harmonics"></float-param>
<float-param sound="ctrl.getSound()" param="harmonicsFalloff"></float-param>
<h2 class="filters">Filters</h2>
<float-param sound="ctrl.getSound()" param="flangerOffset"></float-param>
<float-param sound="ctrl.getSound()" param="flangerOffsetSweep"></float-param>
<float-param sound="ctrl.getSound()" param="bitCrush"></float-param>
<float-param sound="ctrl.getSound()" param="bitCrushSweep"></float-param>
<float-param sound="ctrl.getSound()" param="lowPassCutoff"></float-param>
<float-param sound="ctrl.getSound()" param="lowPassCutoffSweep"></float-param>
<float-param sound="ctrl.getSound()" param="highPassCutoff"></float-param>
<float-param sound="ctrl.getSound()" param="highPassCutoffSweep"></float-param>
<h2 class="output">Output</h2>
<float-param sound="ctrl.getSound()" param="compression"></float-param>
<boolean-param sound="ctrl.getSound()" param="normalization"></boolean-param>
<float-param sound="ctrl.getSound()" param="amplification"></float-param>
</div>
</div>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.17/angular.min.js"></script>
<script>
var jfxrApp = angular.module('jfxrApp', []);
var jfxr = {};
</script>
<!-- ref:js jfxr.min.js -->
<script src="src/analyser.js"></script>
<script src="src/file.js"></script>
<script src="src/history.js"></script>
<script src="src/main.js"></script>
<script src="src/math.js"></script>
<script src="src/player.js"></script>
<script src="src/presets.js"></script>
<script src="src/random.js"></script>
<script src="src/shims.js"></script>
<script src="src/sound.js"></script>
<script src="src/storage.js"></script>
<script src="src/synth.js"></script>
<script src="src/ui.js"></script>
<script src="src/waveshape.js"></script>
<script src="src/FileSaver.js"></script>
<!-- endref -->
<script>
jfxr.init();
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create','UA-19568648-1','auto');ga('send','pageview');
</script>
</body>
</html>