@@ -23,6 +23,9 @@ import {
23
23
import {
24
24
default as AutomatableClipControlMixin ,
25
25
CONTROL_TYPE_VOLUME ,
26
+ CONTROL_TYPE_LOW_BAND ,
27
+ CONTROL_TYPE_MID_BAND ,
28
+ CONTROL_TYPE_HIGH_BAND ,
26
29
CONTROL_TYPE_PITCH ,
27
30
CONTROL_TYPE_DELAY_WET ,
28
31
CONTROL_TYPE_DELAY_CUTOFF ,
@@ -32,42 +35,63 @@ import {
32
35
33
36
// TODO(CLEANUP): nest under track-clip/controls/gain?
34
37
const TrackVolumeControl = Ember . Object . extend (
35
- AutomatableClipControlMixin ( 'trackVolumeNode.gain' ) , {
38
+ new AutomatableClipControlMixin ( 'trackVolumeNode.gain' ) , {
36
39
37
40
type : CONTROL_TYPE_VOLUME ,
38
41
defaultValue : 1 ,
39
42
} ) ;
40
43
44
+ const TrackLowBandControl = Ember . Object . extend (
45
+ new AutomatableClipControlMixin ( 'lowBandEqNode.filter.gain' ) , {
46
+
47
+ type : CONTROL_TYPE_LOW_BAND ,
48
+ defaultValue : 6 ,
49
+ } ) ;
50
+
51
+ const TrackMidBandControl = Ember . Object . extend (
52
+ new AutomatableClipControlMixin ( 'midBandEqNode.filter.gain' ) , {
53
+
54
+ type : CONTROL_TYPE_MID_BAND ,
55
+ defaultValue : 6 ,
56
+ } ) ;
57
+
58
+ const TrackHighBandControl = Ember . Object . extend (
59
+ new AutomatableClipControlMixin ( 'highBandEqNode.filter.gain' ) , {
60
+
61
+ type : CONTROL_TYPE_HIGH_BAND ,
62
+ defaultValue : 6 ,
63
+ } ) ;
64
+
41
65
const TrackPitchControl = Ember . Object . extend (
42
- AutomatableClipControlMixin ( 'soundtouchNode.pitch' ) , {
66
+ new AutomatableClipControlMixin ( 'soundtouchNode.pitch' ) , {
43
67
44
68
type : CONTROL_TYPE_PITCH ,
45
69
defaultValue : 0 ,
46
70
} ) ;
47
71
48
72
const TrackDelayWetControl = Ember . Object . extend (
49
- AutomatableClipControlMixin ( 'tunaDelayNode.wet.gain' ) , {
73
+ new AutomatableClipControlMixin ( 'tunaDelayNode.wet.gain' ) , {
50
74
51
75
type : CONTROL_TYPE_DELAY_WET ,
52
76
defaultValue : 0 ,
53
77
} ) ;
54
78
55
79
const TrackDelayCutoffControl = Ember . Object . extend (
56
- AutomatableClipControlMixin ( 'tunaDelayNode.filter.frequency' ) , {
80
+ new AutomatableClipControlMixin ( 'tunaDelayNode.filter.frequency' ) , {
57
81
58
82
type : CONTROL_TYPE_DELAY_CUTOFF ,
59
83
defaultValue : 2000 ,
60
84
} ) ;
61
85
62
86
const TrackHighpassFilterCutoffControl = Ember . Object . extend (
63
- AutomatableClipControlMixin ( 'tunaHighpassFilterNode.filter.frequency' ) , {
87
+ new AutomatableClipControlMixin ( 'tunaHighpassFilterNode.filter.frequency' ) , {
64
88
65
89
type : CONTROL_TYPE_FILTER_HIGHPASS_CUTOFF ,
66
90
defaultValue : 20 ,
67
91
} ) ;
68
92
69
93
const TrackLowpassFilterCutoffControl = Ember . Object . extend (
70
- AutomatableClipControlMixin ( 'tunaLowpassFilterNode.filter.frequency' ) , {
94
+ new AutomatableClipControlMixin ( 'tunaLowpassFilterNode.filter.frequency' ) , {
71
95
72
96
type : CONTROL_TYPE_FILTER_LOWPASS_CUTOFF ,
73
97
defaultValue : 22050 ,
@@ -78,7 +102,7 @@ const TrackLowpassFilterCutoffControl = Ember.Object.extend(
78
102
export default Ember . Mixin . create (
79
103
AutomatableClipMixin ,
80
104
PlayableClipMixin ,
81
- ReadinessMixin ( 'isTrackClipReady' ) , {
105
+ new ReadinessMixin ( 'isTrackClipReady' ) , {
82
106
83
107
// required params
84
108
track : null ,
@@ -95,6 +119,9 @@ export default Ember.Mixin.create(
95
119
controls : Ember . computed ( function ( ) {
96
120
return [
97
121
TrackVolumeControl . create ( { clip : this } ) ,
122
+ TrackLowBandControl . create ( { clip : this } ) ,
123
+ TrackMidBandControl . create ( { clip : this } ) ,
124
+ TrackHighBandControl . create ( { clip : this } ) ,
98
125
TrackPitchControl . create ( { clip : this } ) ,
99
126
TrackDelayWetControl . create ( { clip : this } ) ,
100
127
TrackDelayCutoffControl . create ( { clip : this } ) ,
@@ -213,17 +240,32 @@ export default Ember.Mixin.create(
213
240
214
241
trackVolumeNode : computedObject ( GainNode , {
215
242
'audioContext' : 'audioContext' ,
216
- 'outputNode' : 'tunaDelayNode .content' ,
243
+ 'outputNode' : 'lowBandEqNode .content' ,
217
244
} ) ,
218
245
219
- quarterNoteDelayTime : Ember . computed ( 'syncBpm' , function ( ) {
220
- // return bpmToSpb(this.get('syncBpm')) * 1000 * 3 / 4;
221
- return bpmToSpb ( this . get ( 'syncBpm' ) ) * 1000 ;
246
+ lowBandFilterType : 'lowshelf' ,
247
+ lowBandEqNode : computedObject ( TunaFilterNode , {
248
+ 'filterType' : 'lowBandFilterType' ,
249
+ 'frequency' : 70 ,
250
+ 'gain' : 6 ,
251
+ 'audioContext' : 'audioContext' ,
252
+ 'outputNode' : 'midBandEqNode.content' ,
222
253
} ) ,
223
254
224
- tunaDelayNode : computedObject ( TunaDelayNode , {
225
- 'bypass' : 'delayBypass' ,
226
- 'delayTime' : 'quarterNoteDelayTime' ,
255
+ midBandFilterType : 'peaking' ,
256
+ midBandEqNode : computedObject ( TunaFilterNode , {
257
+ 'filterType' : 'midBandFilterType' ,
258
+ 'frequency' : 1000 ,
259
+ 'gain' : 6 ,
260
+ 'audioContext' : 'audioContext' ,
261
+ 'outputNode' : 'highBandEqNode.content' ,
262
+ } ) ,
263
+
264
+ highBandFilterType : 'highshelf' ,
265
+ highBandEqNode : computedObject ( TunaFilterNode , {
266
+ 'filterType' : 'highBandFilterType' ,
267
+ 'frequency' : 13000 ,
268
+ 'gain' : 6 ,
227
269
'audioContext' : 'audioContext' ,
228
270
'outputNode' : 'tunaHighpassFilterNode.content' ,
229
271
} ) ,
@@ -241,6 +283,18 @@ export default Ember.Mixin.create(
241
283
'filterType' : 'lowpassFilterType' ,
242
284
'frequency' : 22050 ,
243
285
'audioContext' : 'audioContext' ,
286
+ 'outputNode' : 'tunaDelayNode.content' ,
287
+ } ) ,
288
+
289
+ quarterNoteDelayTime : Ember . computed ( 'syncBpm' , function ( ) {
290
+ // return bpmToSpb(this.get('syncBpm')) * 1000 * 3 / 4;
291
+ return bpmToSpb ( this . get ( 'syncBpm' ) ) * 1000 ;
292
+ } ) ,
293
+
294
+ tunaDelayNode : computedObject ( TunaDelayNode , {
295
+ 'bypass' : 'delayBypass' ,
296
+ 'delayTime' : 'quarterNoteDelayTime' ,
297
+ 'audioContext' : 'audioContext' ,
244
298
'outputNode' : 'outputNode.content' ,
245
299
} ) ,
246
300
0 commit comments