synthesizer 3.1.0 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/examples/{metronome.rb → audio_input_metronome.rb} +8 -2
- data/examples/{step_editor.rb → audio_input_step_editor.rb} +10 -2
- data/examples/filter_band_pass.rb +73 -0
- data/examples/{lpf.rb → filter_serial.rb} +9 -2
- data/examples/oscillator_pan.rb +70 -0
- data/examples/{formant_vocoder.rb → oscillator_source_formant_vocoder.rb} +10 -3
- data/examples/{formant_vocoder_sweep.rb → oscillator_source_formant_vocoder_sweep.rb} +13 -6
- data/examples/oscillator_sync.rb +71 -0
- data/examples/oscillator_unison.rb +64 -0
- data/examples/oscillator_volume.rb +70 -0
- data/examples/{mono.rb → synth_mono.rb} +10 -2
- data/examples/{poly.rb → synth_poly.rb} +10 -2
- data/{examples → jupyter}/adsr.ipynb +20 -17
- data/jupyter/curves.ipynb +103 -0
- data/jupyter/shapes.ipynb +111 -0
- data/lib/audio_stream/audio_input_metronome.rb +1 -1
- data/lib/synthesizer/amplifier.rb +4 -1
- data/lib/synthesizer/filter/band_pass_filter.rb +3 -3
- data/lib/synthesizer/filter/high_pass_filter.rb +3 -3
- data/lib/synthesizer/filter/high_shelf_filter.rb +4 -4
- data/lib/synthesizer/filter/low_pass_filter.rb +3 -3
- data/lib/synthesizer/filter/low_shelf_filter.rb +4 -4
- data/lib/synthesizer/filter/parallel.rb +2 -2
- data/lib/synthesizer/filter/peaking_filter.rb +5 -5
- data/lib/synthesizer/filter/serial.rb +2 -2
- data/lib/synthesizer/modulation/adsr.rb +37 -35
- data/lib/synthesizer/modulation/curve.rb +3 -0
- data/lib/synthesizer/modulation/glide.rb +9 -8
- data/lib/synthesizer/modulation/lfo.rb +23 -23
- data/lib/synthesizer/modulation_value.rb +5 -5
- data/lib/synthesizer/mono_synth.rb +7 -2
- data/lib/synthesizer/oscillator.rb +11 -9
- data/lib/synthesizer/oscillator_source/base.rb +35 -5
- data/lib/synthesizer/oscillator_source/formant_vocoder.rb +27 -19
- data/lib/synthesizer/oscillator_source/pulse.rb +11 -3
- data/lib/synthesizer/poly_synth.rb +5 -2
- data/lib/synthesizer/processor/high.rb +63 -0
- data/lib/synthesizer/processor/low.rb +59 -0
- data/lib/synthesizer/processor.rb +6 -44
- data/lib/synthesizer/quality.rb +6 -0
- data/lib/synthesizer/shape.rb +4 -4
- data/lib/synthesizer/shape_pos.rb +22 -19
- data/lib/synthesizer/unison.rb +28 -16
- data/lib/synthesizer/version.rb +1 -1
- data/lib/synthesizer.rb +1 -0
- data/samples/cinema.rb +730 -0
- data/samples/cinema_drum.wav +0 -0
- data/samples/daijoubu.rb +811 -0
- data/samples/daijoubu_drum.wav +0 -0
- data/samples/kira_power.rb +987 -0
- data/samples/kira_power_drum.wav +0 -0
- data/synthesizer.gemspec +1 -1
- metadata +32 -18
- data/examples/curves.ipynb +0 -105
- data/examples/shapes.ipynb +0 -116
data/samples/cinema.rb
ADDED
@@ -0,0 +1,730 @@
|
|
1
|
+
$LOAD_PATH << File.dirname(__FILE__) + "/../lib"
|
2
|
+
$LOAD_PATH << File.dirname(__FILE__) + "/../../ruby-audio_stream/lib"
|
3
|
+
|
4
|
+
require 'synthesizer'
|
5
|
+
require 'audio_stream'
|
6
|
+
|
7
|
+
include AudioStream
|
8
|
+
include AudioStream::Fx
|
9
|
+
include Synthesizer
|
10
|
+
|
11
|
+
|
12
|
+
class Cinema
|
13
|
+
def initialize
|
14
|
+
@soundinfo = SoundInfo.new(
|
15
|
+
channels: 2,
|
16
|
+
samplerate: 44100,
|
17
|
+
window_size: 1024,
|
18
|
+
format: RubyAudio::FORMAT_WAV|RubyAudio::FORMAT_PCM_16,
|
19
|
+
bpm: 145.0
|
20
|
+
)
|
21
|
+
|
22
|
+
@default_amp = Amplifier.new(
|
23
|
+
volume: ModulationValue.new(1.0)
|
24
|
+
.add(Modulation::Adsr.new(
|
25
|
+
attack: Rate.sec(0.05),
|
26
|
+
hold: Rate.sec(0.1),
|
27
|
+
decay: Rate.sec(0.4),
|
28
|
+
sustain: 0.8,
|
29
|
+
release: Rate.sec(0.0)
|
30
|
+
), depth: 1.0),
|
31
|
+
)
|
32
|
+
|
33
|
+
@inputs = {
|
34
|
+
dub4: create_dub4,
|
35
|
+
dub8: create_dub8,
|
36
|
+
dub16: create_dub16,
|
37
|
+
dub2: create_dub2,
|
38
|
+
dub4_down: create_dub4_down,
|
39
|
+
dub_tremoro: create_dub_tremoro,
|
40
|
+
vocoder: create_vocoder,
|
41
|
+
bass: create_bass,
|
42
|
+
drum: AudioInput.file(File.dirname(__FILE__)+"/cinema_drum.wav", soundinfo: @soundinfo)
|
43
|
+
}
|
44
|
+
|
45
|
+
#@output = AudioOutput.device(soundinfo: @soundinfo)
|
46
|
+
@output = AudioOutput.file(File.dirname(__FILE__)+"/output_cinema.wav", soundinfo: @soundinfo)
|
47
|
+
end
|
48
|
+
|
49
|
+
def create_dub4
|
50
|
+
lfo1 = Modulation::Lfo.new(
|
51
|
+
shape: Shape::Sine,
|
52
|
+
delay: Rate.sec(0.0),
|
53
|
+
attack: Rate.sec(0.0),
|
54
|
+
attack_curve: Modulation::Curve::EaseIn,
|
55
|
+
phase: 0.0,
|
56
|
+
rate: Rate::SYNC_1_4
|
57
|
+
)
|
58
|
+
|
59
|
+
synth = PolySynth.new(
|
60
|
+
oscillators: [
|
61
|
+
Oscillator.new(
|
62
|
+
source: OscillatorSource::SawtoothSquare.instance,
|
63
|
+
volume: ModulationValue.new(1.0)
|
64
|
+
.add(lfo1, depth: 0.1),
|
65
|
+
sync: ModulationValue.new(12+6.0)
|
66
|
+
.add(lfo1, depth: 6.0),
|
67
|
+
uni_num: 4,
|
68
|
+
uni_detune: 0.03,
|
69
|
+
uni_stereo: 1.0,
|
70
|
+
),
|
71
|
+
Oscillator.new(
|
72
|
+
source: OscillatorSource::FormantVocoder.new(
|
73
|
+
vowels: [:u, :a],
|
74
|
+
pronunciation: ModulationValue.new(0.0)
|
75
|
+
.add(lfo1, depth: 1.0),
|
76
|
+
),
|
77
|
+
volume: ModulationValue.new(1.0)
|
78
|
+
.add(lfo1, depth: 0.1),
|
79
|
+
sync: ModulationValue.new(6.0)
|
80
|
+
.add(lfo1, depth: 6.0),
|
81
|
+
uni_num: 4,
|
82
|
+
uni_detune: 0.03,
|
83
|
+
uni_stereo: -1.0,
|
84
|
+
),
|
85
|
+
],
|
86
|
+
filter: Filter::Serial.new(
|
87
|
+
Filter::BandPassFilter.new(freq: 1000, bandwidth: 4.0),
|
88
|
+
Filter::PeakingFilter.new(
|
89
|
+
freq: ModulationValue.new(20000)
|
90
|
+
.add(lfo1, depth: 19500),
|
91
|
+
bandwidth: 4.0,
|
92
|
+
gain: 10),
|
93
|
+
),
|
94
|
+
amplifier: @default_amp,
|
95
|
+
quality: Quality::HIGH,
|
96
|
+
soundinfo: @soundinfo,
|
97
|
+
)
|
98
|
+
|
99
|
+
se = StepEditor::StGt.new(bpm: @soundinfo.bpm) {|se|
|
100
|
+
se.step(480*4)
|
101
|
+
|
102
|
+
se.note(Note.create(:"F#", 1), gt: 360)
|
103
|
+
se.note(Note.create(:A, 2), st: 480, gt: 360)
|
104
|
+
se.note(Note.create(:"F#", 1), gt: 360)
|
105
|
+
se.note(Note.create(:"F#", 2), st: 480, gt: 360)
|
106
|
+
se.step(480*2)
|
107
|
+
se.step(480*4)
|
108
|
+
|
109
|
+
se.note(Note.create(:"F#", 1), gt: 360)
|
110
|
+
se.note(Note.create(:A, 2), st: 480, gt: 360)
|
111
|
+
se.note(Note.create(:"F#", 1), gt: 360)
|
112
|
+
se.note(Note.create(:"F#", 2), st: 480, gt: 360)
|
113
|
+
se.step(480*2)
|
114
|
+
se.step(480*3)
|
115
|
+
|
116
|
+
se.note(Note.create(:"F#", 1), gt: 240)
|
117
|
+
se.note(Note.create(:E, 2), st: 240, gt: 240)
|
118
|
+
se.note(Note.create(:"F#", 1), gt: 240)
|
119
|
+
se.note(Note.create(:"F#", 2), st: 240, gt: 240)
|
120
|
+
|
121
|
+
se.note(Note.create(:"F#", 1), gt: 360)
|
122
|
+
se.note(Note.create(:A, 2), st: 480, gt: 360)
|
123
|
+
se.note(Note.create(:"F#", 1), gt: 360)
|
124
|
+
se.note(Note.create(:"F#", 2), st: 480, gt: 360)
|
125
|
+
se.step(480*2)
|
126
|
+
se.step(480*4)
|
127
|
+
|
128
|
+
|
129
|
+
se.complete
|
130
|
+
}
|
131
|
+
|
132
|
+
AudioInputStepEditor.new(synth, se)
|
133
|
+
end
|
134
|
+
|
135
|
+
def create_dub8
|
136
|
+
lfo1 = Modulation::Lfo.new(
|
137
|
+
shape: Shape::Sine,
|
138
|
+
delay: Rate.sec(0.0),
|
139
|
+
attack: Rate.sec(0.0),
|
140
|
+
attack_curve: Modulation::Curve::EaseIn,
|
141
|
+
phase: 0.0,
|
142
|
+
rate: Rate::SYNC_1_8
|
143
|
+
)
|
144
|
+
|
145
|
+
synth = PolySynth.new(
|
146
|
+
oscillators: [
|
147
|
+
Oscillator.new(
|
148
|
+
source: OscillatorSource::SawtoothSquare.instance,
|
149
|
+
volume: ModulationValue.new(1.0)
|
150
|
+
.add(lfo1, depth: 1.0),
|
151
|
+
sync: ModulationValue.new(12+6.0)
|
152
|
+
.add(lfo1, depth: 6.0),
|
153
|
+
uni_num: 4,
|
154
|
+
uni_detune: 0.03,
|
155
|
+
uni_stereo: 1.0,
|
156
|
+
),
|
157
|
+
Oscillator.new(
|
158
|
+
source: OscillatorSource::FormantVocoder.new(
|
159
|
+
vowels: [:u, :a],
|
160
|
+
pronunciation: ModulationValue.new(0.0)
|
161
|
+
.add(lfo1, depth: 1.0),
|
162
|
+
),
|
163
|
+
volume: ModulationValue.new(1.0)
|
164
|
+
.add(lfo1, depth: 1.0),
|
165
|
+
tune_semis: 0,
|
166
|
+
sync: ModulationValue.new(6.0)
|
167
|
+
.add(lfo1, depth: 6.0),
|
168
|
+
uni_num: 4,
|
169
|
+
uni_detune: 0.03,
|
170
|
+
uni_stereo: 1.0,
|
171
|
+
),
|
172
|
+
Oscillator.new(
|
173
|
+
source: OscillatorSource::FormantVocoder.new(
|
174
|
+
vowels: [:u, :a],
|
175
|
+
pronunciation: ModulationValue.new(0.0)
|
176
|
+
.add(lfo1, depth: 1.0),
|
177
|
+
),
|
178
|
+
volume: ModulationValue.new(1.0)
|
179
|
+
.add(lfo1, depth: 1.0),
|
180
|
+
tune_semis: -12,
|
181
|
+
sync: ModulationValue.new(12+6.0)
|
182
|
+
.add(lfo1, depth: 6.0),
|
183
|
+
uni_num: 4,
|
184
|
+
uni_detune: 0.03,
|
185
|
+
uni_stereo: -1.0,
|
186
|
+
),
|
187
|
+
],
|
188
|
+
filter: Filter::Serial.new(
|
189
|
+
Filter::BandPassFilter.new(freq: 3000, bandwidth: 4.0),
|
190
|
+
Filter::PeakingFilter.new(
|
191
|
+
freq: ModulationValue.new(20000)
|
192
|
+
.add(lfo1, depth: 19500),
|
193
|
+
bandwidth: 2.0,
|
194
|
+
gain: 10),
|
195
|
+
),
|
196
|
+
amplifier: @default_amp,
|
197
|
+
quality: Quality::HIGH,
|
198
|
+
soundinfo: @soundinfo,
|
199
|
+
)
|
200
|
+
|
201
|
+
se = StepEditor::StGt.new(bpm: @soundinfo.bpm) {|se|
|
202
|
+
se.step(480*4)
|
203
|
+
|
204
|
+
se.step(480*2)
|
205
|
+
se.note(Note.create(:"F#", 4), st: 480*4, gt: 480*4)
|
206
|
+
se.step(480*2)
|
207
|
+
|
208
|
+
se.step(480*4)
|
209
|
+
se.step(480*4)
|
210
|
+
|
211
|
+
se.step(480*2)
|
212
|
+
se.note(Note.create(:"F#", 4), st: 480*4, gt: 480*4)
|
213
|
+
se.step(480*2)
|
214
|
+
|
215
|
+
se.complete
|
216
|
+
}
|
217
|
+
|
218
|
+
AudioInputStepEditor.new(synth, se)
|
219
|
+
end
|
220
|
+
|
221
|
+
def create_dub16
|
222
|
+
lfo1 = Modulation::Lfo.new(
|
223
|
+
shape: Shape::Sine,
|
224
|
+
delay: Rate.sec(0.0),
|
225
|
+
attack: Rate.sec(0.0),
|
226
|
+
attack_curve: Modulation::Curve::EaseIn,
|
227
|
+
phase: 0.0,
|
228
|
+
rate: Rate::SYNC_1_16
|
229
|
+
)
|
230
|
+
|
231
|
+
synth = PolySynth.new(
|
232
|
+
oscillators: [
|
233
|
+
Oscillator.new(
|
234
|
+
source: OscillatorSource::SawtoothSquare.instance,
|
235
|
+
volume: ModulationValue.new(1.0)
|
236
|
+
.add(lfo1, depth: 1.0),
|
237
|
+
sync: ModulationValue.new(12+6.0)
|
238
|
+
.add(lfo1, depth: 6.0),
|
239
|
+
uni_num: 4,
|
240
|
+
uni_detune: 0.03,
|
241
|
+
uni_stereo: 0.6,
|
242
|
+
),
|
243
|
+
Oscillator.new(
|
244
|
+
source: OscillatorSource::FormantVocoder.new(
|
245
|
+
vowels: [:u, :a],
|
246
|
+
pronunciation: ModulationValue.new(0.0)
|
247
|
+
.add(lfo1, depth: 1.0),
|
248
|
+
),
|
249
|
+
volume: ModulationValue.new(1.0)
|
250
|
+
.add(lfo1, depth: 1.0),
|
251
|
+
tune_semis: 0,
|
252
|
+
sync: ModulationValue.new(12+6.0)
|
253
|
+
.add(lfo1, depth: 6.0),
|
254
|
+
uni_num: 4,
|
255
|
+
uni_detune: 0.03,
|
256
|
+
uni_stereo: 0.6,
|
257
|
+
),
|
258
|
+
Oscillator.new(
|
259
|
+
source: OscillatorSource::FormantVocoder.new(
|
260
|
+
vowels: [:u, :a],
|
261
|
+
pronunciation: ModulationValue.new(0.0)
|
262
|
+
.add(lfo1, depth: 1.0),
|
263
|
+
),
|
264
|
+
volume: ModulationValue.new(1.0)
|
265
|
+
.add(lfo1, depth: 1.0),
|
266
|
+
tune_semis: -12,
|
267
|
+
sync: ModulationValue.new(12+6.0)
|
268
|
+
.add(lfo1, depth: 6.0),
|
269
|
+
uni_num: 4,
|
270
|
+
uni_detune: 0.03,
|
271
|
+
uni_stereo: 0.6,
|
272
|
+
),
|
273
|
+
],
|
274
|
+
filter: Filter::Serial.new(
|
275
|
+
Filter::BandPassFilter.new(freq: 3000, bandwidth: 4.0),
|
276
|
+
Filter::PeakingFilter.new(
|
277
|
+
freq: ModulationValue.new(20000)
|
278
|
+
.add(lfo1, depth: 19500),
|
279
|
+
bandwidth: 4.0,
|
280
|
+
gain: 10),
|
281
|
+
),
|
282
|
+
amplifier: @default_amp,
|
283
|
+
quality: Quality::HIGH,
|
284
|
+
soundinfo: @soundinfo,
|
285
|
+
)
|
286
|
+
|
287
|
+
se = StepEditor::StGt.new(bpm: @soundinfo.bpm) {|se|
|
288
|
+
se.step(480*4)
|
289
|
+
|
290
|
+
se.step(480*4)
|
291
|
+
se.step(480*4)
|
292
|
+
|
293
|
+
se.step(480*2)
|
294
|
+
se.note(Note.create(:"F#", 4), st: 480*4, gt: 480*4)
|
295
|
+
se.step(480*2)
|
296
|
+
|
297
|
+
se.complete
|
298
|
+
}
|
299
|
+
|
300
|
+
AudioInputStepEditor.new(synth, se)
|
301
|
+
end
|
302
|
+
|
303
|
+
def create_dub2
|
304
|
+
adsr1 = Modulation::Adsr.new(
|
305
|
+
attack: Rate.sec(0.0),
|
306
|
+
hold: Rate::SYNC_1_16,
|
307
|
+
decay: Rate::SYNC_1_4D,
|
308
|
+
#sustain_curve: Modulation::Curve::EaseOut,
|
309
|
+
sustain_curve: Modulation::Curve::EaseIn,
|
310
|
+
sustain: 0.0,
|
311
|
+
release: Rate.sec(0.0)
|
312
|
+
)
|
313
|
+
|
314
|
+
synth = PolySynth.new(
|
315
|
+
oscillators: [
|
316
|
+
Oscillator.new(
|
317
|
+
source: OscillatorSource::SawtoothSquare.instance,
|
318
|
+
#volume: ModulationValue.new(1.0)
|
319
|
+
# .add(lfo1, depth: 1.0),
|
320
|
+
tune_semis: ModulationValue.new(0.0)
|
321
|
+
.add(adsr1, depth: 1.0),
|
322
|
+
sync: ModulationValue.new(6.0)
|
323
|
+
.add(adsr1, depth: 6.0),
|
324
|
+
),
|
325
|
+
Oscillator.new(
|
326
|
+
source: OscillatorSource::FormantVocoder.new(
|
327
|
+
vowels: [:u, :a],
|
328
|
+
pronunciation: ModulationValue.new(0.0)
|
329
|
+
.add(adsr1, depth: 1.0),
|
330
|
+
),
|
331
|
+
#volume: ModulationValue.new(1.0)
|
332
|
+
# .add(lfo1, depth: 1.0),
|
333
|
+
tune_semis: ModulationValue.new(0.0)
|
334
|
+
.add(adsr1, depth: 1.0),
|
335
|
+
sync: ModulationValue.new(12+6.0)
|
336
|
+
.add(adsr1, depth: 6.0),
|
337
|
+
),
|
338
|
+
],
|
339
|
+
filter: Filter::Serial.new(
|
340
|
+
#Filter::BandPassFilter.new(freq: 1000, bandwidth: 4.0),
|
341
|
+
Filter::PeakingFilter.new(
|
342
|
+
freq: ModulationValue.new(20000)
|
343
|
+
.add(adsr1, depth: 19500),
|
344
|
+
bandwidth: 4.0,
|
345
|
+
gain: 10),
|
346
|
+
),
|
347
|
+
amplifier: @default_amp,
|
348
|
+
quality: Quality::HIGH,
|
349
|
+
soundinfo: @soundinfo,
|
350
|
+
)
|
351
|
+
|
352
|
+
se = StepEditor::StGt.new(bpm: @soundinfo.bpm) {|se|
|
353
|
+
se.step(480*4)
|
354
|
+
|
355
|
+
se.step(480*4)
|
356
|
+
se.step(480*2)
|
357
|
+
se.note(Note.create(:"F#", 1), gt: 480*2)
|
358
|
+
se.note(Note.create(:"F#", 2), st: 480*2, gt: 480*2)
|
359
|
+
|
360
|
+
se.step(480*4)
|
361
|
+
se.step(480*4)
|
362
|
+
|
363
|
+
se.step(480*4)
|
364
|
+
se.step(480*2)
|
365
|
+
se.note(Note.create(:"F#", 1), gt: 480*2)
|
366
|
+
se.note(Note.create(:"F#", 2), st: 480*2, gt: 480*2)
|
367
|
+
|
368
|
+
se.complete
|
369
|
+
}
|
370
|
+
|
371
|
+
AudioInputStepEditor.new(synth, se)
|
372
|
+
end
|
373
|
+
|
374
|
+
def create_dub4_down
|
375
|
+
lfo1 = Modulation::Lfo.new(
|
376
|
+
shape: Shape::Sine,
|
377
|
+
delay: Rate.sec(0.0),
|
378
|
+
attack: Rate.sec(0.0),
|
379
|
+
attack_curve: Modulation::Curve::EaseIn,
|
380
|
+
phase: 0.0,
|
381
|
+
rate: Rate::SYNC_1_128
|
382
|
+
)
|
383
|
+
adsr1 = Modulation::Adsr.new(
|
384
|
+
attack: Rate.sec(0.0),
|
385
|
+
hold: Rate::SYNC_1_16,
|
386
|
+
decay: Rate::SYNC_1_4,
|
387
|
+
sustain_curve: Modulation::Curve::Straight,
|
388
|
+
sustain: 0.0,
|
389
|
+
release: Rate.sec(0.0)
|
390
|
+
)
|
391
|
+
|
392
|
+
synth = PolySynth.new(
|
393
|
+
oscillators: [
|
394
|
+
Oscillator.new(
|
395
|
+
source: OscillatorSource::SawtoothSquare.instance,
|
396
|
+
volume: ModulationValue.new(1.0)
|
397
|
+
.add(lfo1, depth: 1.0),
|
398
|
+
tune_semis: ModulationValue.new(-8.0)
|
399
|
+
.add(adsr1, depth: 8.0),
|
400
|
+
#sync: ModulationValue.new(6.0)
|
401
|
+
# .add(adsr1, depth: 6.0),
|
402
|
+
),
|
403
|
+
Oscillator.new(
|
404
|
+
source: OscillatorSource::FormantVocoder.new(
|
405
|
+
vowels: [:u, :a],
|
406
|
+
pronunciation: ModulationValue.new(0.0)
|
407
|
+
.add(adsr1, depth: 1.0),
|
408
|
+
),
|
409
|
+
volume: ModulationValue.new(1.0)
|
410
|
+
.add(lfo1, depth: 1.0),
|
411
|
+
tune_semis: ModulationValue.new(-8.0)
|
412
|
+
.add(adsr1, depth: 8.0),
|
413
|
+
#sync: ModulationValue.new(12+6.0)
|
414
|
+
# .add(adsr1, depth: 6.0),
|
415
|
+
),
|
416
|
+
],
|
417
|
+
filter: Filter::Serial.new(
|
418
|
+
#Filter::BandPassFilter.new(freq: 1000, bandwidth: 4.0),
|
419
|
+
Filter::PeakingFilter.new(
|
420
|
+
freq: ModulationValue.new(20000)
|
421
|
+
.add(adsr1, depth: 19500),
|
422
|
+
bandwidth: 4.0,
|
423
|
+
gain: 10),
|
424
|
+
),
|
425
|
+
amplifier: @default_amp,
|
426
|
+
quality: Quality::HIGH,
|
427
|
+
soundinfo: @soundinfo,
|
428
|
+
)
|
429
|
+
|
430
|
+
se = StepEditor::StGt.new(bpm: @soundinfo.bpm) {|se|
|
431
|
+
se.step(480*4)
|
432
|
+
|
433
|
+
se.step(480*4)
|
434
|
+
se.step(480*4)
|
435
|
+
se.step(480*4)
|
436
|
+
|
437
|
+
se.step(480*2)
|
438
|
+
#se.note(Note.create(:G, 4), gt: 480)
|
439
|
+
se.note(Note.create(:G, 6), st: 480, gt: 480)
|
440
|
+
se.step(480)
|
441
|
+
|
442
|
+
se.complete
|
443
|
+
}
|
444
|
+
|
445
|
+
AudioInputStepEditor.new(synth, se)
|
446
|
+
end
|
447
|
+
|
448
|
+
def create_dub_tremoro
|
449
|
+
lfo1 = Modulation::Lfo.new(
|
450
|
+
shape: Shape::Sine,
|
451
|
+
delay: Rate.sec(0.0),
|
452
|
+
attack: Rate.sec(0.0),
|
453
|
+
attack_curve: Modulation::Curve::EaseIn,
|
454
|
+
phase: 0.0,
|
455
|
+
rate: Rate::SYNC_1_128
|
456
|
+
)
|
457
|
+
adsr1 = Modulation::Adsr.new(
|
458
|
+
attack: Rate.sec(0.0),
|
459
|
+
hold: Rate::SYNC_1_16,
|
460
|
+
decay: Rate::SYNC_1_4,
|
461
|
+
sustain_curve: Modulation::Curve::Straight,
|
462
|
+
sustain: 0.0,
|
463
|
+
release: Rate.sec(0.0)
|
464
|
+
)
|
465
|
+
|
466
|
+
synth = PolySynth.new(
|
467
|
+
oscillators: [
|
468
|
+
Oscillator.new(
|
469
|
+
source: OscillatorSource::SawtoothSquare.instance,
|
470
|
+
volume: ModulationValue.new(1.0)
|
471
|
+
.add(lfo1, depth: 1.0),
|
472
|
+
sync: 12,
|
473
|
+
),
|
474
|
+
Oscillator.new(
|
475
|
+
source: OscillatorSource::SawtoothSquare.instance,
|
476
|
+
volume: ModulationValue.new(1.0)
|
477
|
+
.add(lfo1, depth: 1.0),
|
478
|
+
tune_semis: -12,
|
479
|
+
sync: 12,
|
480
|
+
),
|
481
|
+
Oscillator.new(
|
482
|
+
source: OscillatorSource::FormantVocoder.new(
|
483
|
+
vowels: [:u, :a],
|
484
|
+
pronunciation: ModulationValue.new(0.0)
|
485
|
+
.add(adsr1, depth: 1.0),
|
486
|
+
),
|
487
|
+
volume: ModulationValue.new(1.0)
|
488
|
+
.add(lfo1, depth: 1.0),
|
489
|
+
#sync: ModulationValue.new(12+6.0)
|
490
|
+
# .add(adsr1, depth: 6.0),
|
491
|
+
),
|
492
|
+
],
|
493
|
+
filter: Filter::Serial.new(
|
494
|
+
#Filter::BandPassFilter.new(freq: 1000, bandwidth: 4.0),
|
495
|
+
Filter::PeakingFilter.new(
|
496
|
+
freq: ModulationValue.new(20000)
|
497
|
+
.add(adsr1, depth: 19500),
|
498
|
+
bandwidth: 4.0,
|
499
|
+
gain: 10),
|
500
|
+
),
|
501
|
+
amplifier: @default_amp,
|
502
|
+
quality: Quality::HIGH,
|
503
|
+
soundinfo: @soundinfo,
|
504
|
+
)
|
505
|
+
|
506
|
+
se = StepEditor::StGt.new(bpm: @soundinfo.bpm) {|se|
|
507
|
+
se.step(480*4)
|
508
|
+
|
509
|
+
se.step(480*4)
|
510
|
+
se.step(480*4)
|
511
|
+
se.step(480*4)
|
512
|
+
se.step(480*4)
|
513
|
+
se.step(480*4)
|
514
|
+
se.step(480*4)
|
515
|
+
|
516
|
+
se.note(Note.create(:"F#", 5), st: 480, gt: 480)
|
517
|
+
se.step(480)
|
518
|
+
se.note(Note.create(:"F#", 5), st: 480, gt: 480)
|
519
|
+
se.step(480)
|
520
|
+
|
521
|
+
se.note(Note.create(:A, 4), st: 480, gt: 480)
|
522
|
+
se.note(Note.create(:"C#", 5), st: 480, gt: 480)
|
523
|
+
se.note(Note.create(:A, 5), st: 480, gt: 480)
|
524
|
+
se.note(Note.create(:"C#", 6), st: 480, gt: 480)
|
525
|
+
|
526
|
+
se.complete
|
527
|
+
}
|
528
|
+
|
529
|
+
AudioInputStepEditor.new(synth, se)
|
530
|
+
end
|
531
|
+
|
532
|
+
def create_vocoder
|
533
|
+
lfo1 = Modulation::Lfo.new(
|
534
|
+
#shape: Shape::Square,
|
535
|
+
shape: Shape::Sine,
|
536
|
+
delay: Rate.sec(0.0),
|
537
|
+
attack: Rate.sec(0.0),
|
538
|
+
attack_curve: Modulation::Curve::EaseIn,
|
539
|
+
phase: 0.0,
|
540
|
+
rate: Rate::SYNC_1_8
|
541
|
+
)
|
542
|
+
|
543
|
+
synth = PolySynth.new(
|
544
|
+
oscillators: [
|
545
|
+
Oscillator.new(
|
546
|
+
source: OscillatorSource::FormantVocoder.new(
|
547
|
+
vowels: [:a, :i],
|
548
|
+
pronunciation: ModulationValue.new(0.5)
|
549
|
+
.add(lfo1, depth: -0.5),
|
550
|
+
),
|
551
|
+
uni_num: 4,
|
552
|
+
uni_detune: 0.1,
|
553
|
+
uni_stereo: 0.4,
|
554
|
+
),
|
555
|
+
Oscillator.new(
|
556
|
+
source: OscillatorSource::FormantVocoder.new(
|
557
|
+
vowels: [:a, :i],
|
558
|
+
pronunciation: ModulationValue.new(0.5)
|
559
|
+
.add(lfo1, depth: -0.5),
|
560
|
+
),
|
561
|
+
tune_semis: -12,
|
562
|
+
uni_num: 4,
|
563
|
+
uni_detune: 0.1,
|
564
|
+
uni_stereo: -0.4,
|
565
|
+
),
|
566
|
+
],
|
567
|
+
filter: Filter::Serial.new(
|
568
|
+
Filter::BandPassFilter.new(freq: 600, bandwidth: 3.0),
|
569
|
+
Filter::PeakingFilter.new(freq: 400, bandwidth: 2.0, gain: 10),
|
570
|
+
),
|
571
|
+
amplifier: @default_amp,
|
572
|
+
quality: Quality::HIGH,
|
573
|
+
soundinfo: @soundinfo,
|
574
|
+
)
|
575
|
+
|
576
|
+
se = StepEditor::StGt.new(bpm: @soundinfo.bpm) {|se|
|
577
|
+
se.step(480*4)
|
578
|
+
|
579
|
+
se.step(480*4)
|
580
|
+
se.step(480*4)
|
581
|
+
se.step(480*4)
|
582
|
+
se.step(480*4)
|
583
|
+
se.step(480*4)
|
584
|
+
se.step(480*4)
|
585
|
+
|
586
|
+
se.step(480)
|
587
|
+
se.note(Note.create(:"F#", 2), st: 480, gt: 480)
|
588
|
+
se.step(480)
|
589
|
+
se.note(Note.create(:"F#", 2), st: 480, gt: 480)
|
590
|
+
|
591
|
+
se.complete
|
592
|
+
}
|
593
|
+
|
594
|
+
AudioInputStepEditor.new(synth, se)
|
595
|
+
end
|
596
|
+
|
597
|
+
def create_bass
|
598
|
+
lfo1 = Modulation::Lfo.new(
|
599
|
+
shape: Shape::Sine,
|
600
|
+
delay: Rate.sec(0.0),
|
601
|
+
attack: Rate.sec(0.0),
|
602
|
+
attack_curve: Modulation::Curve::EaseIn,
|
603
|
+
phase: 0.0,
|
604
|
+
rate: Rate::SYNC_1_4
|
605
|
+
)
|
606
|
+
lfo2 = Modulation::Lfo.new(
|
607
|
+
shape: Shape::Sine,
|
608
|
+
delay: Rate.sec(0.0),
|
609
|
+
attack: Rate.sec(0.0),
|
610
|
+
attack_curve: Modulation::Curve::EaseIn,
|
611
|
+
phase: 0.0,
|
612
|
+
rate: Rate::SYNC_1_128
|
613
|
+
)
|
614
|
+
|
615
|
+
synth = PolySynth.new(
|
616
|
+
oscillators: [
|
617
|
+
Oscillator.new(
|
618
|
+
source: OscillatorSource::SawtoothSquare.instance,
|
619
|
+
volume: ModulationValue.new(1.0)
|
620
|
+
.add(lfo1, depth: 0.7)
|
621
|
+
.add(lfo2, depth: 0.5),
|
622
|
+
sync: 12,
|
623
|
+
),
|
624
|
+
],
|
625
|
+
filter: Filter::Serial.new(
|
626
|
+
Filter::LowPassFilter.new(freq: 200, q: Filter::DEFAULT_Q),
|
627
|
+
),
|
628
|
+
amplifier: @default_amp,
|
629
|
+
soundinfo: @soundinfo,
|
630
|
+
)
|
631
|
+
|
632
|
+
se = StepEditor::StGt.new(bpm: @soundinfo.bpm) {|se|
|
633
|
+
se.step(480*4)
|
634
|
+
|
635
|
+
se.note(Note.create(:A, 1), st: 480, gt: 480)
|
636
|
+
se.note(Note.create(:"F#", 1), st: 480*5, gt: 480*5)
|
637
|
+
se.note(Note.create(:G, 1), st: 480*2, gt: 480*2)
|
638
|
+
|
639
|
+
se.note(Note.create(:A, 1), st: 480, gt: 480)
|
640
|
+
se.note(Note.create(:"F#", 1), st: 480*6, gt: 480*6)
|
641
|
+
se.note(Note.create(:E, 1), st: 240, gt: 240)
|
642
|
+
se.note(Note.create(:"F#", 1), st: 240, gt: 240)
|
643
|
+
|
644
|
+
se.note(Note.create(:A, 1), st: 480, gt: 480)
|
645
|
+
se.note(Note.create(:"F#", 1), st: 480*5, gt: 480*5)
|
646
|
+
se.note(Note.create(:G, 1), st: 480*2, gt: 480*2)
|
647
|
+
|
648
|
+
se.note(Note.create(:"F#", 1), st: 480*2, gt: 480*2)
|
649
|
+
se.note(Note.create(:"F#", 1), st: 480*2, gt: 480*2)
|
650
|
+
|
651
|
+
se.note(Note.create(:A, 1), st: 480, gt: 480)
|
652
|
+
se.note(Note.create(:"C#", 2), st: 480, gt: 480)
|
653
|
+
se.note(Note.create(:A, 2), st: 480, gt: 480)
|
654
|
+
se.note(Note.create(:"C#", 3), st: 480, gt: 480)
|
655
|
+
|
656
|
+
se.complete
|
657
|
+
}
|
658
|
+
|
659
|
+
AudioInputStepEditor.new(synth, se)
|
660
|
+
end
|
661
|
+
|
662
|
+
def mixer
|
663
|
+
low_bus = AudioBus.new
|
664
|
+
high_bus = AudioBus.new
|
665
|
+
master = AudioBus.new
|
666
|
+
|
667
|
+
@inputs[:dub4]
|
668
|
+
.send_to(low_bus, gain: 0.0, pan: 0.0)
|
669
|
+
|
670
|
+
@inputs[:dub8]
|
671
|
+
.send_to(high_bus, gain: 0.0, pan: 0.0)
|
672
|
+
|
673
|
+
@inputs[:dub16]
|
674
|
+
.send_to(high_bus, gain: 0.0, pan: 0.0)
|
675
|
+
|
676
|
+
@inputs[:dub2]
|
677
|
+
.send_to(low_bus, gain: -9.0, pan: 0.0)
|
678
|
+
|
679
|
+
@inputs[:dub4_down]
|
680
|
+
.send_to(high_bus, gain: -5.0, pan: 0.0)
|
681
|
+
|
682
|
+
@inputs[:dub_tremoro]
|
683
|
+
.send_to(high_bus, gain: -9.0, pan: 0.0)
|
684
|
+
|
685
|
+
@inputs[:vocoder]
|
686
|
+
.fx(Compressor.new(threshold: 0.5, ratio: 0.8))
|
687
|
+
.send_to(master, gain: -14.0, pan: 0.0)
|
688
|
+
|
689
|
+
@inputs[:bass]
|
690
|
+
.send_to(master, gain: -30.0, pan: 0.0)
|
691
|
+
|
692
|
+
low_bus
|
693
|
+
.fx(AGain.new(level: -30.0))
|
694
|
+
.fx(Compressor.new(threshold: 0.5, ratio: 0.8))
|
695
|
+
.send_to(master, gain: -2.0)
|
696
|
+
.fx(HighPassFilter.create(@soundinfo, freq: 200, q: 0.2))
|
697
|
+
.fx(SchroederReverb.new(@soundinfo, dry: -100.0, wet: -10.0))
|
698
|
+
.send_to(master, gain: 0.0)
|
699
|
+
.fx(SchroederReverb.new(@soundinfo, dry: -100.0, wet: -10.0))
|
700
|
+
.send_to(master, gain: 0.0)
|
701
|
+
|
702
|
+
high_bus
|
703
|
+
.fx(AGain.new(level: -30.0))
|
704
|
+
.fx(HighShelfFilter.create(@soundinfo, freq: 1700.0, q: 0.5, gain: 0.5))
|
705
|
+
.fx(PeakingFilter.create(@soundinfo, freq: 2200, bandwidth: 2.0, gain: 5))
|
706
|
+
.fx(Compressor.new(threshold: 0.5, ratio: 0.8))
|
707
|
+
.send_to(master, gain: -6.0)
|
708
|
+
.fx(HighPassFilter.create(@soundinfo, freq: 800, q: 0.2))
|
709
|
+
.fx(SchroederReverb.new(@soundinfo, dry: -100.0, wet: -10.0))
|
710
|
+
.send_to(master, gain: -2.0)
|
711
|
+
|
712
|
+
@inputs[:drum]
|
713
|
+
.send_to(master, gain: -1.0)
|
714
|
+
|
715
|
+
master
|
716
|
+
.fx(Compressor.new(threshold: 0.5, ratio: 0.8))
|
717
|
+
.send_to(@output)
|
718
|
+
|
719
|
+
|
720
|
+
conductor = Conductor.new(
|
721
|
+
input: @inputs.values,
|
722
|
+
output: @output
|
723
|
+
)
|
724
|
+
conductor.connect
|
725
|
+
conductor.join
|
726
|
+
end
|
727
|
+
end
|
728
|
+
|
729
|
+
|
730
|
+
Cinema.new.mixer
|
Binary file
|