musicality 0.11.1 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +5 -5
  2. data/.coveralls.yml +1 -0
  3. data/.ruby-version +1 -1
  4. data/.travis.yml +4 -0
  5. data/ChangeLog.md +11 -0
  6. data/README.md +3 -0
  7. data/Rakefile +11 -3
  8. data/lib/musicality/composition/model/rhythm.rb +33 -0
  9. data/lib/musicality/composition/model/rhythm_class.rb +30 -0
  10. data/lib/musicality/composition/sequencing/drum_machine/drum_kit.rb +18 -0
  11. data/lib/musicality/composition/sequencing/drum_machine/drum_machine.rb +59 -0
  12. data/lib/musicality/composition/sequencing/drum_machine/drum_parts.rb +21 -0
  13. data/lib/musicality/composition/sequencing/drum_machine/drum_pattern.rb +66 -0
  14. data/lib/musicality/composition/sequencing/drum_machine/drum_patterns/pop_drum_patterns.rb +146 -0
  15. data/lib/musicality/composition/sequencing/note_array.rb +33 -0
  16. data/lib/musicality/composition/sequencing/note_fifo.rb +73 -0
  17. data/lib/musicality/composition/sequencing/sequenceable.rb +9 -0
  18. data/lib/musicality/composition/sequencing/sequencer.rb +35 -0
  19. data/lib/musicality/errors.rb +2 -2
  20. data/lib/musicality/notation/model/dynamics.rb +2 -2
  21. data/lib/musicality/notation/model/key.rb +42 -91
  22. data/lib/musicality/notation/model/keys.rb +35 -34
  23. data/lib/musicality/notation/model/note.rb +31 -9
  24. data/lib/musicality/notation/model/pitch.rb +2 -2
  25. data/lib/musicality/notation/parsing/convenience_methods.rb +23 -12
  26. data/lib/musicality/notation/parsing/duration_parsing.rb +3 -3
  27. data/lib/musicality/notation/parsing/key_parsing.rb +150 -0
  28. data/lib/musicality/notation/parsing/key_parsing.treetop +37 -0
  29. data/lib/musicality/notation/parsing/meter_parsing.rb +3 -3
  30. data/lib/musicality/notation/parsing/numbers/nonnegative_float_parsing.rb +3 -1
  31. data/lib/musicality/notation/parsing/numbers/nonnegative_integer_parsing.rb +1 -0
  32. data/lib/musicality/notation/parsing/numbers/nonnegative_rational_parsing.rb +1 -1
  33. data/lib/musicality/notation/parsing/numbers/positive_float_parsing.rb +4 -1
  34. data/lib/musicality/notation/parsing/numbers/positive_rational_parsing.rb +1 -1
  35. data/lib/musicality/notation/parsing/parseable.rb +13 -17
  36. data/lib/musicality/notation/parsing/pitch_parsing.rb +7 -0
  37. data/lib/musicality/notation/parsing/segment_parsing.rb +3 -0
  38. data/lib/musicality/performance/conversion/note_sequence_extractor.rb +82 -134
  39. data/lib/musicality/performance/model/note_sequence.rb +22 -3
  40. data/lib/musicality/performance/supercollider/performer.rb +2 -2
  41. data/lib/musicality/performance/supercollider/sc_drum_kits.rb +29 -0
  42. data/lib/musicality/performance/supercollider/synthdefs/bass.rb +211 -0
  43. data/lib/musicality/performance/supercollider/synthdefs/claps.rb +80 -0
  44. data/lib/musicality/performance/supercollider/synthdefs/cymbals.rb +57 -0
  45. data/lib/musicality/performance/supercollider/synthdefs/hihats.rb +67 -0
  46. data/lib/musicality/performance/supercollider/synthdefs/kicks.rb +158 -0
  47. data/lib/musicality/performance/supercollider/synthdefs/mario.rb +49 -0
  48. data/lib/musicality/performance/supercollider/{synthdefs.rb → synthdefs/other.rb} +0 -767
  49. data/lib/musicality/performance/supercollider/synthdefs/pianos.rb +46 -0
  50. data/lib/musicality/performance/supercollider/synthdefs/snares.rb +169 -0
  51. data/lib/musicality/performance/supercollider/synthdefs/toms.rb +25 -0
  52. data/lib/musicality/performance/supercollider/synthdefs/volume.rb +20 -0
  53. data/lib/musicality/pitch_class.rb +1 -1
  54. data/lib/musicality/pitch_classes.rb +3 -5
  55. data/lib/musicality/version.rb +1 -1
  56. data/lib/musicality.rb +25 -1
  57. data/musicality.gemspec +3 -2
  58. data/spec/composition/convenience_methods_spec.rb +8 -8
  59. data/spec/composition/generation/random_rhythm_generator_spec.rb +5 -5
  60. data/spec/composition/model/pitch_class_spec.rb +22 -16
  61. data/spec/composition/model/pitch_classes_spec.rb +5 -5
  62. data/spec/composition/model/rhythm_class_spec.rb +42 -0
  63. data/spec/composition/model/rhythm_spec.rb +43 -0
  64. data/spec/composition/model/scale_class_spec.rb +26 -26
  65. data/spec/composition/model/scale_spec.rb +38 -38
  66. data/spec/composition/sequencing/drum_machine/drum_machine_spec.rb +67 -0
  67. data/spec/composition/sequencing/drum_machine/drum_pattern_spec.rb +58 -0
  68. data/spec/composition/sequencing/note_array_spec.rb +94 -0
  69. data/spec/composition/sequencing/note_fifo_spec.rb +183 -0
  70. data/spec/composition/sequencing/sequencer_spec.rb +76 -0
  71. data/spec/composition/util/adding_sequence_spec.rb +33 -33
  72. data/spec/composition/util/compound_sequence_spec.rb +6 -6
  73. data/spec/composition/util/note_generation_spec.rb +34 -34
  74. data/spec/composition/util/probabilities_spec.rb +7 -7
  75. data/spec/composition/util/random_sampler_spec.rb +3 -3
  76. data/spec/composition/util/repeating_sequence_spec.rb +28 -28
  77. data/spec/musicality_spec.rb +1 -1
  78. data/spec/notation/conversion/change_conversion_spec.rb +87 -87
  79. data/spec/notation/conversion/note_time_converter_spec.rb +22 -22
  80. data/spec/notation/conversion/score_conversion_spec.rb +1 -1
  81. data/spec/notation/conversion/score_converter_spec.rb +31 -31
  82. data/spec/notation/conversion/tempo_conversion_spec.rb +11 -11
  83. data/spec/notation/model/change_spec.rb +80 -80
  84. data/spec/notation/model/key_spec.rb +135 -69
  85. data/spec/notation/model/link_spec.rb +27 -27
  86. data/spec/notation/model/meter_spec.rb +28 -28
  87. data/spec/notation/model/note_spec.rb +68 -47
  88. data/spec/notation/model/part_spec.rb +19 -19
  89. data/spec/notation/model/pitch_spec.rb +69 -68
  90. data/spec/notation/model/score_spec.rb +50 -47
  91. data/spec/notation/parsing/articulation_parsing_spec.rb +4 -4
  92. data/spec/notation/parsing/convenience_methods_spec.rb +49 -10
  93. data/spec/notation/parsing/duration_nodes_spec.rb +13 -13
  94. data/spec/notation/parsing/duration_parsing_spec.rb +10 -10
  95. data/spec/notation/parsing/key_parsing_spec.rb +19 -0
  96. data/spec/notation/parsing/link_nodes_spec.rb +7 -7
  97. data/spec/notation/parsing/link_parsing_spec.rb +4 -4
  98. data/spec/notation/parsing/meter_parsing_spec.rb +5 -5
  99. data/spec/notation/parsing/note_node_spec.rb +19 -19
  100. data/spec/notation/parsing/note_parsing_spec.rb +4 -4
  101. data/spec/notation/parsing/numbers/nonnegative_float_spec.rb +8 -8
  102. data/spec/notation/parsing/numbers/nonnegative_integer_spec.rb +2 -2
  103. data/spec/notation/parsing/numbers/nonnegative_rational_spec.rb +1 -1
  104. data/spec/notation/parsing/numbers/positive_float_spec.rb +8 -8
  105. data/spec/notation/parsing/numbers/positive_integer_spec.rb +6 -6
  106. data/spec/notation/parsing/numbers/positive_rational_spec.rb +6 -6
  107. data/spec/notation/parsing/pitch_node_spec.rb +7 -7
  108. data/spec/notation/parsing/pitch_parsing_spec.rb +2 -2
  109. data/spec/notation/parsing/segment_parsing_spec.rb +3 -3
  110. data/spec/notation/util/function_spec.rb +15 -15
  111. data/spec/notation/util/transition_spec.rb +12 -12
  112. data/spec/notation/util/value_computer_spec.rb +35 -36
  113. data/spec/performance/conversion/glissando_converter_spec.rb +24 -24
  114. data/spec/performance/conversion/note_sequence_extractor_spec.rb +39 -39
  115. data/spec/performance/conversion/portamento_converter_spec.rb +23 -23
  116. data/spec/performance/midi/midi_util_spec.rb +41 -41
  117. data/spec/performance/midi/part_sequencer_spec.rb +10 -10
  118. data/spec/performance/midi/score_sequencer_spec.rb +15 -15
  119. data/spec/performance/midi/score_sequencing_spec.rb +2 -2
  120. data/spec/performance/util/optimization_spec.rb +9 -9
  121. data/spec/printing/note_engraving_spec.rb +16 -16
  122. data/spec/printing/score_engraver_spec.rb +5 -5
  123. data/spec/spec_helper.rb +5 -0
  124. metadata +85 -30
@@ -2,109 +2,6 @@ module Musicality
2
2
  module SuperCollider
3
3
  module SynthDefs
4
4
 
5
- VOLUME_CONTROL = SynthDef.new(name: "volume_control", params: { :in => nil, :out => nil, :control => nil },
6
- body: <<-SCLANG,
7
- var sig = In.ar([in,in+1]) * In.kr(control);
8
- Out.ar(out,sig);
9
- SCLANG
10
- credit: "James Tunnell",
11
- )
12
-
13
- VOLUME_CHANGE = SynthDef.new(name: "volume_change", params: { :vol_bus => nil, :vol => nil, :dur => nil },
14
- body: " Out.kr(vol_bus, Line.kr(In.kr(vol_bus), vol, dur));",
15
- credit: "James Tunnell",
16
- )
17
-
18
- KICK808 = SynthDef.new(name: "kick808", params: { :out => 0 },
19
- body: <<-SCLANG,
20
- var sig = LPF.ar(Ringz.ar(Impulse.ar(0), 60, 1), 500);
21
- var cmp = CompanderD.ar(sig, -20.dbamp, 1, 0.3, 0.003, 0.08);
22
-
23
- cmp = cmp * (10.dbamp);
24
- Out.ar(out, cmp.dup);
25
- SCLANG
26
- source: "https://github.com/acarabott/roundhouse-synth-design-course-2014"
27
- )
28
-
29
- KICK2 = SynthDef.new(name: "kick2", params: { :out => 0 },
30
- body: <<-SCLANG,
31
- var env0, env1, env1m, sig;
32
-
33
- env0 = EnvGen.ar(
34
- Env([0.5, 1, 0.5, 0], [0.005, 0.06, 0.26], [-4, -2, -4]), doneAction:2
35
- );
36
- env1 = EnvGen.ar(Env([110, 59, 29], [0.005, 0.29], [-4, -5]));
37
- env1m = env1.midicps;
38
-
39
- sig = LFPulse.ar(env1m, 0, 0.5, 1, -0.5);
40
- sig = sig + WhiteNoise.ar(1);
41
- sig = LPF.ar(sig, env1m * 1.5, env0);
42
- sig = sig + SinOsc.ar(env1m, 0.5, env0);
43
-
44
- sig = sig * 1.2;
45
- sig = sig.clip2(1);
46
-
47
- Out.ar(out, sig.dup * 0.1);
48
- SCLANG
49
- credit: "Reformatted for the Roundhouse Synth Design course from 08091500Acid309 by otophilia from SuperCollider/examples folder",
50
- source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
51
- )
52
-
53
- SNARE1 = SynthDef.new(name: "snare1", params: { :out => 0, :amp => 0.8 },
54
- body: <<-SCLANG,
55
- var env0, env1, env2, env1m, oscs, noise, sig;
56
-
57
- env0 = EnvGen.ar(Env([0.5, 1, 0.5, 0], [0.005, 0.03, 0.10], [-4, -2, -4]));
58
- env1 = EnvGen.ar(Env([110, 60, 49], [0.005, 0.1], [-4, -5]));
59
- env1m = env1.midicps;
60
- env2 = EnvGen.ar(Env([1, 0.4, 0], [0.05, 0.13], [-2, -2]), doneAction:2);
61
-
62
- oscs = LFPulse.ar(env1m, 0, 0.5, 1, -0.5) +
63
- LFPulse.ar(env1m * 1.6, 0, 0.5, 0.5, -0.25);
64
- oscs = LPF.ar(oscs, env1m * 1.2, env0);
65
- oscs = oscs + SinOsc.ar(env1m, 0.8, env0);
66
-
67
- noise = WhiteNoise.ar(0.2);
68
- noise = HPF.ar(noise, 200, 2);
69
- noise = BPF.ar(noise, 6900, 0.6, 3) + noise;
70
- noise = noise * env2;
71
-
72
- sig = oscs + noise;
73
- sig = sig.clip2(1) * amp;
74
-
75
- Out.ar(out, sig.dup);
76
- SCLANG
77
- source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
78
- )
79
-
80
- CLAP1 = SynthDef.new(name: "clap1", params: { :out => 0, :amp => 0.5 },
81
- body: <<-SCLANG,
82
- var env1, env2, sig, noise1, noise2;
83
-
84
- env1 = EnvGen.ar(Env(
85
- [0, 1, 0, 1, 0, 1, 0, 1, 0],
86
- [0.001, 0.013, 0, 0.01, 0, 0.01, 0, 0.03],
87
- [0, -3, 0, -3, 0, -3, 0, -4]
88
- ));
89
- env2 = EnvGen.ar(Env([0, 1, 0], [0.02, 0.3], [0, -4]), doneAction:2);
90
-
91
- noise1 = WhiteNoise.ar(env1);
92
- noise1 = HPF.ar(noise1, 600);
93
- noise1 = BPF.ar(noise1, 2000, 3);
94
-
95
- noise2 = WhiteNoise.ar(env2);
96
- noise2 = HPF.ar(noise2, 1000);
97
- noise2 = BPF.ar(noise2, 1200, 0.7, 0.7);
98
-
99
- sig = noise1 + noise2;
100
- sig = sig * 2;
101
- sig = sig.softclip * amp;
102
-
103
- Out.ar(out, sig.dup);
104
- SCLANG
105
- source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
106
- )
107
-
108
5
  AXEL = DEFAULT = SynthDef.new(name: "axel", params: { :freq => 440, :lpfreq => 12000, :rq => 0.2, :gate => 1, :out => 0 },
109
6
  body: <<-SCLANG,
110
7
  var chorus = LFNoise2.ar(1).range(0.99, 1.01);
@@ -193,19 +90,6 @@ SCLANG
193
90
  source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
194
91
  )
195
92
 
196
- BASS4 = SynthDef.new(name: "bass4", params: { :out => 0, :gate => 1, :freq => 440 },
197
- body: <<-SCLANG,
198
- var aEnv, fEnv, osc, flt;
199
- aEnv = EnvGen.kr(Env.asr(0, 1, 1), gate, doneAction: 2);
200
- fEnv = EnvGen.kr(Env.perc(0, 3), levelScale: 6000);
201
- osc = Mix([Saw.ar(freq * [1, 1.005]), Pulse.ar(freq / 2, 0.5)]);
202
- flt = LPF.ar(osc, fEnv + 100, aEnv);
203
- Out.ar(out, flt);
204
- SCLANG
205
- credit: "From the Kraftwerk 'Spacelab' example in SuperCollider/examples by jy",
206
- source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
207
- )
208
-
209
93
  ESM = SynthDef.new(name: "esm", params: { :freq => 440, :mix => 0.5, :glide => 0, :cutoff => 20000, :rq => 1, :fdec => 0, :fint => 1,
210
94
  :vel => 1, :fvel => 1, :t_gate => 1, :vdec => 1, :vvel => 0, :od => 0, :mul => 0.1, :pan => 0, :out => 0 },
211
95
  body: <<-SCLANG,
@@ -261,23 +145,6 @@ SCLANG
261
145
  source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
262
146
  )
263
147
 
264
- SNARE2 = SynthDef.new(name: "snare2", params: { :sfreq => 1500, :out => 0 },
265
- body: <<-SCLANG,
266
- var tri = Mix([LFTri.ar([111, 175, 224])]) * 0.5;
267
- var sine = Mix([SinOsc.ar([330, 180])]) * 0.5;
268
- var env = EnvGen.ar(Env.perc(0.01, 0.2), doneAction:2);
269
- var snares = WhiteNoise.ar(1);
270
- var snareEnv = EnvGen.ar(Env.perc(0.01, 0.2));
271
-
272
- snares = HPF.ar(snares, sfreq);
273
- snares = snares * snareEnv;
274
-
275
- Out.ar(out, Mix([tri, sine, snares]) * env);
276
- SCLANG
277
- credit: "Based on Sound on Sound Synth Secrets 35, by Arthur Carabott",
278
- source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
279
- )
280
-
281
148
  PROPHET5_STRINGS = SynthDef.new(name: "prophet5pwmstrings", params: { :out => 0, :freq => 440, :amp => 0.8,
282
149
  :gate => 1, :lforate => 3, :lfowidth => 0.1, :cutoff => 12000, :rq => 0.5, :pan => 0.0 },
283
150
  body: <<-SCLANG,
@@ -368,49 +235,6 @@ EOS
368
235
  source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
369
236
  )
370
237
 
371
- MOOG_BASS = SynthDef.new(name: "moogbass", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
372
- :cutoff => 1000, :gain => 2.0, :lagamount => 0.01, :pan => 0.0 },
373
- body: <<-SCLANG,
374
- var osc, filter, env, filterenv;
375
-
376
- osc = Mix(VarSaw.ar(freq.lag(lagamount)*[1.0,1.001,2.0],Rand(0.0,1.0)!3,Rand(0.5,0.75)!3,0.33));
377
- filterenv = EnvGen.ar(Env.adsr(0.2,0.0,1.0,0.2),gate,doneAction:2);
378
- filter = MoogFF.ar(osc,cutoff*(1.0+(0.5*filterenv)),gain);
379
- env = EnvGen.ar(Env.adsr(0.001,0.3,0.9,0.2),gate,doneAction:2);
380
-
381
- Out.ar(out,Pan2.ar((0.7*filter+(0.3*filter.distort))*env*amp*1.5,pan));
382
- SCLANG
383
- credit: <<-EOS,
384
- Sound recipes from:
385
- Mitchell Sigman (2011) Steal this Sound. Milwaukee, WI: Hal Leonard Books
386
- adapted for SuperCollider and elaborated by Nick Collins (http://www.sussex.ac.uk/Users/nc81/index.html)
387
- under GNU GPL 3 as per SuperCollider license
388
- EOS
389
- source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
390
- )
391
-
392
- MOOG_BASS2 = SynthDef.new(name: "moogbass2", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
393
- :attackTime => 0.2, :fenvamount => 0.5, :cutoff => 1000, :gain => 2.0, :pan => 0.0 },
394
- body: <<-SCLANG,
395
- var osc, filter, env, filterenv;
396
-
397
- //alternative: richer source
398
- osc = Mix(Pulse.ar(freq.lag(0.05)*[1.0,1.001,2.0],Rand(0.45,0.5)!3,0.33));
399
- filterenv = EnvGen.ar(Env.adsr(attackTime,0.0,1.0,0.2),gate,doneAction:2);
400
- filter = MoogFF.ar(osc,cutoff*(1.0+(fenvamount*filterenv)),gain);
401
- env = EnvGen.ar(Env.adsr(0.001,0.3,0.9,0.2),gate,doneAction:2);
402
-
403
- Out.ar(out,Pan2.ar((0.7*filter+(0.3*filter.distort))*env*amp,pan));
404
- SCLANG
405
- credit: <<-EOS,
406
- Sound recipes from:
407
- Mitchell Sigman (2011) Steal this Sound. Milwaukee, WI: Hal Leonard Books
408
- adapted for SuperCollider and elaborated by Nick Collins (http://www.sussex.ac.uk/Users/nc81/index.html)
409
- under GNU GPL 3 as per SuperCollider license
410
- EOS
411
- source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
412
- )
413
-
414
238
  PLASTICKY_STRINGS = SynthDef.new(name: "plastickystrings", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
415
239
  :lforate => 5900, :lfowidth => 0.01, :cutoff => 12000, :rq => 0.5, :pan => 0.0 },
416
240
  body: <<-SCLANG,
@@ -433,63 +257,6 @@ EOS
433
257
  source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
434
258
  )
435
259
 
436
- BASS_FOUNDATION = SynthDef.new(name: "bassfoundation", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
437
- :cutoff => 1000, :rq => 0.5, :pan => 0.0 },
438
- body: <<-SCLANG,
439
- var osc, filter, env, filterenv;
440
-
441
- osc = Saw.ar(freq);
442
- filterenv = EnvGen.ar(Env.adsr(0.0,0.5,0.2,0.2),gate,doneAction:2);
443
- filter = RLPF.ar(osc,cutoff*filterenv+100,rq);
444
- env = EnvGen.ar(Env.adsr(0.01,0.0,0.9,0.05),gate,doneAction:2);
445
-
446
- Out.ar(out,Pan2.ar(filter*env*amp*2,pan));
447
- SCLANG
448
- credit: <<-EOS,
449
- Sound recipes from:
450
- Mitchell Sigman (2011) Steal this Sound. Milwaukee, WI: Hal Leonard Books
451
- adapted for SuperCollider and elaborated by Nick Collins (http://www.sussex.ac.uk/Users/nc81/index.html)
452
- under GNU GPL 3 as per SuperCollider license
453
- EOS
454
- source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
455
- )
456
-
457
- BASS_HIGHEND = SynthDef.new(name: "basshighend", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
458
- :cutoff => 3000, :rq => 0.1, :drive => 2.0, :pan => 0.0 },
459
- body: <<-SCLANG,
460
- var osc, filter, env, filterenv;
461
- var ab;
462
-
463
- //osc = Mix(VarSaw.ar(freq*[0.25,1,1.5],Rand(0.0,1.0)!3,0.9,[0.5,0.4,0.1]));
464
- osc = Mix(Saw.ar(freq*[0.25,1,1.5],[0.5,0.4,0.1]));
465
- //osc = Mix(DPW4Saw.ar(freq*[0.25,1,1.5],[0.5,0.4,0.1]));
466
- filterenv = EnvGen.ar(Env.adsr(0.0,0.5,0.2,0.2),gate,doneAction:2);
467
- filter = RLPF.ar(osc,cutoff*filterenv+100,rq);
468
-
469
- //distortion
470
- //filter = filter.distort.softclip;
471
-
472
- ab = abs(filter);
473
- filter = (filter*(ab + drive)/(filter ** 2 + (drive - 1) * ab + 1));
474
-
475
- //remove low end
476
- filter = BLowShelf.ar(filter,300,1.0,-12);
477
- //dip at 1600Hz
478
- filter = BPeakEQ.ar(filter,1600,1.0,-6);
479
-
480
- env = EnvGen.ar(Env.adsr(0.01,0.0,0.9,0.05),gate,doneAction:2);
481
-
482
- Out.ar(out,Pan2.ar(filter*env*amp*2,pan));
483
- SCLANG
484
- credit: <<-EOS,
485
- Sound recipes from:
486
- Mitchell Sigman (2011) Steal this Sound. Milwaukee, WI: Hal Leonard Books
487
- adapted for SuperCollider and elaborated by Nick Collins (http://www.sussex.ac.uk/Users/nc81/index.html)
488
- under GNU GPL 3 as per SuperCollider license
489
- EOS
490
- source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
491
- )
492
-
493
260
  WINWOOD_LEAD = SynthDef.new(name: "winwoodlead", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
494
261
  :cutoff => 8000, :rq => 0.8, :lfowidth => 0.01, :lforate => 8, :lagamount => 0.01, :pan => 0.0 },
495
262
  body: <<-SCLANG,
@@ -549,27 +316,6 @@ EOS
549
316
  source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
550
317
  )
551
318
 
552
- EIGHTTOEIGHT_KICK = SynthDef.new(name: "eightoeightkick", params: { :out => 0, :freq => 440, :amp => 0.1,
553
- :ringTime => 10.0, :releaseTime => 1.0, :distortion => 0.1, :pan => -0.1 },
554
- body: <<-SCLANG,
555
- var impulse, filter, env;
556
-
557
- impulse = Impulse.ar(0);
558
- filter = Ringz.ar(impulse,XLine.ar(freq,60,0.1),ringTime);
559
- env = EnvGen.ar(Env.perc(0.001,releaseTime),doneAction:2);
560
- filter = (1.0-distortion)*filter + (distortion*(filter.distort));
561
-
562
- Out.ar(out,Pan2.ar(filter*env*amp,pan));
563
- SCLANG
564
- credit: <<-EOS,
565
- Sound recipes from:
566
- Mitchell Sigman (2011) Steal this Sound. Milwaukee, WI: Hal Leonard Books
567
- adapted for SuperCollider and elaborated by Nick Collins (http://www.sussex.ac.uk/Users/nc81/index.html)
568
- under GNU GPL 3 as per SuperCollider license
569
- EOS
570
- source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
571
- )
572
-
573
319
  TONEWHEEL_TWO = SynthDef.new(name: "tonewheeltwo", params: { :out => 0, :freq => 440, :amp => 0.1, :gate => 1,
574
320
  :lforate => 4.85, :lfowidth => 0.1, :cutoff => 5000, :rq => 0.25, :pan => 0.0 },
575
321
  body: <<-SCLANG,
@@ -594,27 +340,6 @@ EOS
594
340
  source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
595
341
  )
596
342
 
597
- EVERYTHING_RHODES = SynthDef.new(name: "everythingrhodes", params: { :out => 0, :freq => 440, :amp => 0.1, :gate => 1,
598
- :lforate => 1.85, :lfowidth => 0.5, :cutoff => 2000, :rq => 0.2, :pan => 0.0 },
599
- body: <<-SCLANG,
600
- var pulse, filter, env;
601
-
602
- pulse = Pulse.ar(freq*[1,33.5.midiratio],[0.2,0.1],[0.7,0.3]);
603
- env = EnvGen.ar(Env.adsr(0.0,1.0,0.8,3.0),gate,doneAction:2);
604
- //keyboard tracking filter cutoff
605
- filter = BLowPass4.ar(pulse,(cutoff*(env.squared))+200+freq,rq);
606
-
607
- Out.ar(out,Pan2.ar(Mix(filter)*env*amp,pan));
608
- SCLANG
609
- credit: <<-EOS,
610
- Sound recipes from:
611
- Mitchell Sigman (2011) Steal this Sound. Milwaukee, WI: Hal Leonard Books
612
- adapted for SuperCollider and elaborated by Nick Collins (http://www.sussex.ac.uk/Users/nc81/index.html)
613
- under GNU GPL 3 as per SuperCollider license
614
- EOS
615
- source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
616
- )
617
-
618
343
  SPACE_THEREMIN = SynthDef.new(name: "spacetheremin", params: { :out => 0, :freq => 440, :amp => 0.1,
619
344
  :gate => 1, :lforate => 6, :lfowidth => 0.5, :cutoff => 4000, :rq => 0.25, :lagTime => 0.1, :pan => 0.0 },
620
345
  body: <<-SCLANG,
@@ -636,28 +361,6 @@ EOS
636
361
  source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
637
362
  )
638
363
 
639
- FAT_VELOCITY_BASS = SynthDef.new(name: "fatvelocitybass", params: { :out => 0, :freq => 440, :amp => 0.5,
640
- :gate => 1, :cutoff => 2000, :rq => 0.15, :lagTime => 0.01, :pan => 0.0 },
641
- body: <<-SCLANG,
642
- var lfo, osc, filter, env;
643
-
644
- var basefreq = ((freq.lag(lagTime).cpsmidi)+[0,11.95,31.03]).midicps;
645
- osc = Saw.ar(basefreq,[0.5,0.4,0.1]); //+PinkNoise.ar(Line.kr(1.0,0,0.03));
646
- env = EnvGen.ar(Env.adsr(0.01,1.0,1.0,0.25),gate,doneAction:2);
647
- filter = BLowPass4.ar(osc,100+((amp.squared)*(freq+cutoff)),rq);
648
-
649
- Out.ar(out,Pan2.ar(Mix(filter)*env*amp*0.8,pan));
650
- SCLANG
651
- credit: <<-EOS,
652
- Sound recipes from:
653
- Mitchell Sigman (2011) Steal this Sound. Milwaukee, WI: Hal Leonard Books
654
- adapted for SuperCollider and elaborated by Nick Collins (http://www.sussex.ac.uk/Users/nc81/index.html)
655
- under GNU GPL 3 as per SuperCollider license
656
- EOS
657
- source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
658
- )
659
-
660
-
661
364
  PMC_ROTALE = SynthDef.new(name: "PMCrotale", params: { :out => 0, :freq => 261, :tone => 3, :art => 1, :amp => 0.8, :pan => 0 },
662
365
  body: <<-SCLANG,
663
366
  var env, mod, sig;
@@ -678,54 +381,6 @@ SCLANG
678
381
  source: "From https://github.com/brunoruviaro/SynthDefs-for-Patterns",
679
382
  )
680
383
 
681
- KICK3 = SynthDef.new(name: "kick3", params: { :out => 0, :punch => 1, :amp => 1 },
682
- body: <<-SCLANG,
683
- var freq = EnvGen.kr(Env([400, 66], [0.08], -3)),
684
- sig = Normalizer.ar(SinOsc.ar(freq, 0.5pi, punch).distort, 1) * amp
685
- * EnvGen.kr(Env([0, 1, 0.8, 0], [0.01, 0.1, 0.2]), doneAction: 2);
686
- Out.ar(out, sig ! 2);
687
- SCLANG
688
- source: "From https://github.com/brunoruviaro/SynthDefs-for-Patterns",
689
- )
690
-
691
- RING_KICK = SynthDef.new(name: "ringkick", params: { :out => 0, :freq => 40, :decay => 0.25, :amp => 1 },
692
- body: <<-SCLANG,
693
- var snd;
694
- snd = Ringz.ar(
695
- in: LPF.ar(
696
- in: Impulse.ar(0),
697
- freq: 1000),
698
- freq: freq,
699
- decaytime: decay,
700
- mul: 7 * amp).tanh.sin*2;
701
- Out.ar(out, snd!2);
702
- SCLANG
703
- source: "From https://github.com/brunoruviaro/SynthDefs-for-Patterns",
704
- )
705
-
706
- BASS1 = SynthDef.new(name: "bass1", params: { :out => 0, :freq => 440, :gate => 1, :amp => 0.5, :slideTime => 0.17, :ffreq => 1100, :width => 0.15, :detune => 1.005, :preamp => 4 },
707
- body: <<-SCLANG,
708
- var sig, env;
709
- env = Env.adsr(0.01, 0.3, 0.4, 0.1);
710
- freq = Lag.kr(freq, slideTime);
711
- sig = Mix(VarSaw.ar([freq, freq * detune], 0, width, preamp)).distort;
712
- sig = sig * amp * EnvGen.kr(env, gate, doneAction: 2);
713
- sig = LPF.ar(sig, ffreq);
714
- Out.ar(out, sig ! 2)
715
- SCLANG
716
- source: "From https://github.com/brunoruviaro/SynthDefs-for-Patterns",
717
- )
718
-
719
- KIK = SynthDef.new(name: "kik", params: { :out => 0, :basefreq => 50, :ratio => 7, :sweeptime => 0.05, :preamp => 1, :amp => 1, :decay1 => 0.3, :decay1L => 0.8, :decay2 => 0.15 },
720
- body: <<-SCLANG,
721
- var fcurve = EnvGen.kr(Env([basefreq * ratio, basefreq], [sweeptime], \exp)),
722
- env = EnvGen.kr(Env([1, decay1L, 0], [decay1, decay2], -4), doneAction: 2),
723
- sig = SinOsc.ar(fcurve, 0.5pi, preamp).distort * env * amp;
724
- Out.ar(out, sig ! 2)
725
- SCLANG
726
- source: "From https://github.com/brunoruviaro/SynthDefs-for-Patterns",
727
- )
728
-
729
384
  KRAFTY_SNR = SynthDef.new(name: "kraftySnr", params: { :out => 0, :amp => 1, :freq => 2000, :rq => 3, :decay => 0.3, :pan => 0 },
730
385
  body: <<-SCLANG,
731
386
  var sig = PinkNoise.ar(amp),
@@ -831,90 +486,6 @@ SCLANG
831
486
  source: "From https://github.com/elosine/synthdefs",
832
487
  )
833
488
 
834
-
835
- DRUM_KICK = SynthDef.new(name: "drum_kick", params: { :out => 0, :freq => 440, :gate => 1, :amp => 0.8, :source => nil,:pan => 0.0 },
836
- body: <<-SCLANG,
837
- var x1, x2, x3;
838
-
839
- x1 = SinOsc.ar(EnvGen.kr(Env.perc(0.0001, 1.5, 1, -200), gate, 1000, 45, doneAction:2), 1, 1);
840
- x2 = ((BPF.ar([GrayNoise.ar(6),GrayNoise.ar(6)],EnvGen.kr(Env.perc(0.001, 0.3, 1, -200), gate, 6000, 70), 1.5)).distort * Line.kr(0.3,0,0.1));
841
- x3 = EnvGen.kr(Env.perc(0.0001, 0.09, amp, 8));
842
- source = Pan2.ar(x1 + x2 * x3, 0);
843
- Out.ar(out, source);
844
- SCLANG
845
- source: "https://github.com/willieavendano/SC-SynthDefs/blob/master/DrumMachines",
846
- )
847
-
848
- CHORD_BASS = SynthDef.new(name: "chord_bass", params: { :out => 0, :amp => 0.5, :sustain => 0.1, :freq => 90, :filtfreq1 => 7000, :filtfreq2 => 1000, :releaseTime => 0.5, :reverb => 0.1,:rq => 0.99 },
849
- body: <<-SCLANG,
850
- var env, sound;
851
- env=EnvGen.ar(Env.perc(releaseTime:releaseTime),doneAction:2);
852
- sound=FreeVerb.ar(RLPF.ar(LFSaw.ar(freq,0,amp),Line.kr(filtfreq1, filtfreq2,0.1),rq), reverb, 0.2, 0.5);
853
- Out.ar(out,Pan2.ar(sound*env, 0.0))
854
- SCLANG
855
- source: "https://github.com/willieavendano/SC-SynthDefs/blob/master/DrumMachines",
856
- )
857
-
858
- MY_BASS = SynthDef.new(name: "my_bass", params: { :out => 0, :amp => 1, :sustain => 0.3, :freq => 90, :filtfreq1 => 7000, :filtfreq2 => 1000, :releaseTime => 0.5, :reverb => 0.3, :rq => 0.99 },
859
- body: <<-SCLANG,
860
- var env, sound;
861
- env=EnvGen.ar(Env.perc(releaseTime:releaseTime),doneAction:2);
862
- sound=FreeVerb.ar(RLPF.ar(LFTri.ar(freq,0,amp*2),Line.kr(filtfreq1, filtfreq2,0.1),rq) ,reverb, 0.2 ,0.5);
863
- Out.ar(out,Pan2.ar(sound*env, 0.0))
864
- SCLANG
865
- source: "https://github.com/willieavendano/SC-SynthDefs/blob/master/DrumMachines",
866
- )
867
-
868
- SOS_SNARE = SynthDef.new(name: "SOSsnare", params: { :out => 0, :decay => 0.12, :drum_mode_level => 0.25, :snare_level => 40, :snare_tightness => 3000, :freq => 405, :amp => 0.8 },
869
- body: <<-SCLANG,
870
- var drum_mode_sin_1, drum_mode_sin_2, drum_mode_pmosc, drum_mode_mix,
871
- drum_mode_env;
872
- var snare_noise, snare_brf_1, snare_brf_2, snare_brf_3, snare_brf_4,
873
- snare_reson;
874
- var snare_env;
875
- var snare_drum_mix;
876
-
877
- drum_mode_env = EnvGen.ar(Env.perc(0.005, decay), 1.0, doneAction: 2);
878
- drum_mode_sin_1 = SinOsc.ar(freq*0.53, 0, drum_mode_env * 0.5);
879
- drum_mode_sin_2 = SinOsc.ar(freq, 0, drum_mode_env * 0.5);
880
- drum_mode_pmosc = PMOsc.ar( Saw.ar(freq*0.85), 184, 0.5/1.3, mul: drum_mode_env*5, add: 0);
881
- drum_mode_mix = Mix.new([drum_mode_sin_1, drum_mode_sin_2, drum_mode_pmosc]) * drum_mode_level;
882
-
883
- // choose either noise source below
884
- // snare_noise = Crackle.ar(2.01, 1);
885
- snare_noise = LFNoise0.ar(20000, 0.1);
886
- snare_env = EnvGen.ar(Env.perc(0.005, decay, curve:-5), 1.0, doneAction: 2);
887
- snare_brf_1 = BRF.ar(in: snare_noise, freq: 8000, mul: 0.5, rq: 0.1);
888
- snare_brf_2 = BRF.ar(in: snare_brf_1, freq: 5000, mul: 0.5, rq: 0.1);
889
- snare_brf_3 = BRF.ar(in: snare_brf_2, freq: 3600, mul: 0.5, rq: 0.1);
890
- snare_brf_4 = BRF.ar(in: snare_brf_3, freq: 2000, mul: snare_env, rq: 0.0001);
891
- snare_reson = Resonz.ar(snare_brf_4, snare_tightness, mul: snare_level) ;
892
- snare_drum_mix = Mix.new([drum_mode_mix, snare_reson]) * 5 * amp;
893
- Out.ar(out, [snare_drum_mix, snare_drum_mix])
894
- SCLANG
895
- credit: "recipe basically from Gordon Reid
896
- http://www.soundonsound.com/sos/Mar02/articles/synthsecrets0302.asp
897
- programmed by Renick Bell, renick_at_gmail.com",
898
- source: "https://github.com/willieavendano/SC-SynthDefs/blob/master/DrumMachines",
899
- )
900
-
901
- CLOSED_HAT = SynthDef.new(name: "closedhat", params: { :out => 0 },
902
- body: <<-SCLANG,
903
- var hatosc, hatenv, hatnoise, hatoutput;
904
-
905
- hatnoise = {LPF.ar(WhiteNoise.ar(1),8000)};
906
-
907
- hatosc = {HPF.ar(hatnoise,2400)};
908
- hatenv = {Line.ar(1, 0, 0.1)};
909
-
910
- hatoutput = (0.5 * hatosc * hatenv);
911
-
912
- Out.ar(out, Pan2.ar(hatoutput, 0));
913
- SCLANG
914
- source: "https://github.com/willieavendano/SC-SynthDefs/blob/master/DrumMachines",
915
- )
916
-
917
-
918
489
  ACID_OTO_309 = SynthDef.new(name: "acid_oto309", params: { :out => 0, :gate => 1, :freq => 440, :amp => 0.1, :pan => 0 },
919
490
  body: <<-SCLANG,
920
491
  var env1, env2, son, pitch;
@@ -948,49 +519,6 @@ SCLANG
948
519
  source: "https://github.com/supercollider-quarks/SynthDefPool",
949
520
  )
950
521
 
951
- CHEAP_PIANO = SynthDef.new(name: "cheappiano", params: { :out => 0, :freq => 440, :amp => 1, :dur => 1, :gate => 1, :pan => 0 },
952
- body: <<-SCLANG,
953
- var sig, in, n = 6, max = 0.04, min = 0.01, delay, pitch, detune, hammer;
954
- freq = freq.cpsmidi;
955
- hammer = Decay2.ar(Impulse.ar(0.001), 0.008, 0.04, LFNoise2.ar([2000,4000].asSpec.map(amp), 0.25));
956
- sig = Mix.ar(Array.fill(3, { arg i;
957
- detune = #[-0.04, 0, 0.03].at(i);
958
- delay = (1/(freq + detune).midicps);
959
- CombL.ar(hammer, delay, delay, 50 * amp)
960
- }) );
961
-
962
- sig = HPF.ar(sig,50) * EnvGen.ar(Env.perc(0.0001,dur, amp * 4, -1), gate: gate, doneAction:2);
963
- Out.ar(out, Pan2.ar(sig, pan));
964
- SCLANG
965
- credit: "based on something posted 2008-06-17 by jeff, based on an old example by james mcc",
966
- source: "https://github.com/supercollider-quarks/SynthDefPool",
967
- )
968
-
969
- CLAP_OTO_309 = SynthDef.new(name: "clap_oto309", params: { :out => 0, :amp => 0.6, :pan => 0 },
970
- body: <<-SCLANG,
971
- var env1, env2, son, noise1, noise2;
972
-
973
- env1 = EnvGen.ar(Env.new([0, 1, 0, 1, 0, 1, 0, 1, 0], [0.001, 0.013, 0, 0.01, 0, 0.01, 0, 0.03], [0, -3, 0, -3, 0, -3, 0, -4]));
974
- env2 = EnvGen.ar(Env.new([0, 1, 0], [0.02, 0.3], [0, -4]), doneAction:2);
975
-
976
- noise1 = WhiteNoise.ar(env1);
977
- noise1 = HPF.ar(noise1, 600);
978
- noise1 = BPF.ar(noise1, 2000, 3);
979
-
980
- noise2 = WhiteNoise.ar(env2);
981
- noise2 = HPF.ar(noise2, 1000);
982
- noise2 = BPF.ar(noise2, 1200, 0.7, 0.7);
983
-
984
- son = noise1 + noise2;
985
- son = son * 2;
986
- son = son.softclip * amp;
987
-
988
- Out.ar(out, Pan2.ar(son, pan));
989
- SCLANG
990
- credit: "from 08091500Acid309 by_otophilia",
991
- source: "https://github.com/supercollider-quarks/SynthDefPool",
992
- )
993
-
994
522
  CS80_LEAD_MH = SynthDef.new(name: "cs80lead_mh", params: { :freq => 880, :amp => 0.5, :att => 0.75, :decay => 0.5,
995
523
  :sus => 0.8, :rel => 1.0, :fatt => 0.75, :fdecay => 0.5, :fsus => 0.8, :frel => 1.0, :cutoff => 200, :pan => 0,
996
524
  :dtune => 0.002, :vibrate => 4, :vibdepth => 0.015, :gate => 1, :ratio => 1,:out => 0 },
@@ -1012,111 +540,6 @@ SCLANG
1012
540
  source: "https://github.com/supercollider-quarks/SynthDefPool",
1013
541
  )
1014
542
 
1015
- CYMBAL_808 = SynthDef.new(name: "cymbal808", params: { :out => 0, :baseFreq => 300, :time => 250, :amp => 0.1 },
1016
- body: <<-SCLANG,
1017
- //var freqs = [baseFreq, baseFreq*1.3420, baseFreq*1.2312, baseFreq*1.6532, baseFreq*1.9523, baseFreq*2.1523];
1018
- //var freqs = [78.6, 140.44, 123.87, 219.4, 787.5, 531.3];
1019
- //var freqs = [205.35, 254.29, 294.03, 304.41, 369.64, 522.71];
1020
- var freqs = [205.35, 304.41, 369.64, 522.71, 540.54, 812.21];
1021
- var signal, pulseEnv;
1022
-
1023
- pulseEnv = EnvGen.ar(Env.new([1.0, 0.6], [time], [-0.5]), timeScale:(1/1000));
1024
- signal = Mix.new(LFPulse.ar(freqs * 4.09));
1025
- signal = (BinaryOpUGen('==', signal, 6.0) * 0.6) + (BinaryOpUGen('==', signal, 2.0) * 0.2) + (BinaryOpUGen('==', signal, 1.0) * 0.9); // XOR
1026
- signal = (signal * pulseEnv) + (Mix.new(LFPulse.ar(freqs, width:0.55)) * 0.9);
1027
- signal = RLPF.ar(signal, 7000, 0.6);
1028
- signal = RHPF.ar(signal, 6800, 1.5);
1029
- signal = RHPF.ar(signal, 6800, 1.5);
1030
- signal = RHPF.ar(signal, 1200, 1.5);
1031
- signal = signal + FreeVerb.ar(signal);
1032
- signal = signal * EnvGen.ar(Env.new([0, 1, 0.4, 0, 0], [2, time, 50, 500], [0, -0.5, 0, -50]), timeScale:(1/1000), doneAction:2);
1033
- signal = [signal, DelayN.ar(signal, 0.005, 0.005)];
1034
- OffsetOut.ar(out, signal*amp ! 2);
1035
- SCLANG
1036
- credit: "Published on sc-users 2007-08-25 by Ryan Brown",
1037
- source: "https://github.com/supercollider-quarks/SynthDefPool",
1038
- )
1039
-
1040
- CYMBALIC_MCLD = SynthDef.new(name: "cymbalic_mcld", params: { :out => 0, :pan => 0, :amp => 0.1 },
1041
- body: <<-SCLANG,
1042
- var lodriver, locutoffenv, hidriver, hicutoffenv, freqs, res, thwack;
1043
-
1044
- locutoffenv = EnvGen.ar(Env.perc(0.5, 5)) * 20000 + 10;
1045
- lodriver = LPF.ar(WhiteNoise.ar(0.1), locutoffenv);
1046
-
1047
- hicutoffenv = 10001 - (EnvGen.ar(Env.perc(1, 3)) * 10000);
1048
- hidriver = HPF.ar(WhiteNoise.ar(0.1), hicutoffenv);
1049
- hidriver = hidriver * EnvGen.ar(Env.perc(1, 2, 0.25));
1050
-
1051
- thwack = EnvGen.ar(Env.perc(0.001,0.001,1));
1052
-
1053
- // This bit will regenerate new freqs every time you evaluate the SynthDef!
1054
- freqs = {exprand(300, 20000)}.dup(100);
1055
-
1056
- res = Ringz.ar(lodriver + hidriver + thwack, freqs).mean;
1057
-
1058
- Out.ar(out, Pan2.ar(((res * 1) + (lodriver * 2) + thwack) * amp, pan));
1059
- SCLANG
1060
- credit: "Based on the example at http://www.mcld.co.uk/cymbalsynthesis/ published 2008 by Dan Stowell",
1061
- source: "https://github.com/supercollider-quarks/SynthDefPool",
1062
- )
1063
-
1064
- KICK_CHIRP = SynthDef.new(name: "kick_chrp", params: { :out => 0, :amp => 1, :pan => 0 },
1065
- body: <<-SCLANG,
1066
- // a kick made using what radio folks would call a "chirp"
1067
- var ampenv, pitchenv;
1068
-
1069
- ampenv = EnvGen.ar(Env.perc(0, 0.2, curve: 0), doneAction: 2);
1070
- pitchenv = EnvGen.ar(Env.perc(0, 0.1, curve: -20).exprange(0, 1000), doneAction: 0);
1071
-
1072
- Out.ar(out, Pan2.ar(SinOsc.ar(pitchenv) * amp, pan));
1073
- SCLANG
1074
- credit: "by dan stowell. public domain",
1075
- source: "https://github.com/supercollider-quarks/SynthDefPool",
1076
- )
1077
-
1078
- KICK_OTO_309 = SynthDef.new(name: "kick_oto309", params: { :out => 0, :amp => 0.1, :pan => 0 },
1079
- body: <<-SCLANG,
1080
- var env0, env1, env1m, son;
1081
-
1082
- env0 = EnvGen.ar(Env.new([0.5, 1, 0.5, 0], [0.005, 0.06, 0.26], [-4, -2, -4]), doneAction:2);
1083
- env1 = EnvGen.ar(Env.new([110, 59, 29], [0.005, 0.29], [-4, -5]));
1084
- env1m = env1.midicps;
1085
-
1086
- son = LFPulse.ar(env1m, 0, 0.5, 1, -0.5);
1087
- son = son + WhiteNoise.ar(1);
1088
- son = LPF.ar(son, env1m*1.5, env0);
1089
- son = son + SinOsc.ar(env1m, 0.5, env0);
1090
-
1091
- son = son * 1.2;
1092
- son = son.clip2(1);
1093
-
1094
- Out.ar(out, Pan2.ar(son * amp));
1095
- SCLANG
1096
- credit: "from 08091500Acid309 by_otophilia",
1097
- source: "https://github.com/supercollider-quarks/SynthDefPool",
1098
- )
1099
-
1100
- ONECLAP = SynthDef.new(name: "oneclap", params: { :out => 0, :amp => 0.1, :filterfreq => 100, :rq => 0.1, :pan => 0 },
1101
- body: <<-SCLANG,
1102
- var env, signal, attack, noise, hpf1, hpf2;
1103
- noise = WhiteNoise.ar(1)+SinOsc.ar([filterfreq/2,filterfreq/2+4 ], pi*0.5, XLine.kr(1,0.01,4));
1104
- //noise = PinkNoise.ar(1)+SinOsc.ar([(filterfreq)*XLine.kr(1,0.01,3), (filterfreq+4)*XLine.kr(1,0.01,3) ], pi*0.5, XLine.kr(1,0.01,4));
1105
- //signal = signal * SinOsc.ar(1,0.75);
1106
- hpf1 = RLPF.ar(noise, filterfreq, rq);
1107
- hpf2 = RHPF.ar(noise, filterfreq/2, rq/4);
1108
- env = EnvGen.kr(Env.perc(0.003, 0.00035));
1109
- signal = (hpf1+hpf2) * env;
1110
- signal = CombC.ar(signal, 0.5, 0.03, 0.031)+CombC.ar(signal, 0.5, 0.03016, 0.06);
1111
- //signal = Decay2.ar(signal, 0.5);
1112
- signal = FreeVerb.ar(signal, 0.23, 0.15, 0.2);
1113
- Out.ar(out, Pan2.ar(signal * amp, pan));
1114
- DetectSilence.ar(signal, doneAction:2);
1115
- SCLANG
1116
- credit: "published on the sc-users list 2009-01-08 by thor",
1117
- source: "https://github.com/supercollider-quarks/SynthDefPool",
1118
- )
1119
-
1120
543
  PING_MH = SynthDef.new(name: "ping_mh", params: { :freq => 440,:amp => 0.2,:dur => 1,:attack => 0.001,:pan => 0,:out => 0 },
1121
544
  body: <<-SCLANG,
1122
545
  var sig,freq2;
@@ -1131,46 +554,6 @@ SCLANG
1131
554
  source: "https://github.com/supercollider-quarks/SynthDefPool",
1132
555
  )
1133
556
 
1134
- SNARE_OTO_309 = SynthDef.new(name: "snare_oto309", params: { :out => 0, :amp => 0.1, :pan => 0 },
1135
- body: <<-SCLANG,
1136
- var env0, env1, env2, env1m, oscs, noise, son;
1137
-
1138
- env0 = EnvGen.ar(Env.new([0.5, 1, 0.5, 0], [0.005, 0.03, 0.10], [-4, -2, -4]));
1139
- env1 = EnvGen.ar(Env.new([110, 60, 49], [0.005, 0.1], [-4, -5]));
1140
- env1m = env1.midicps;
1141
- env2 = EnvGen.ar(Env.new([1, 0.4, 0], [0.05, 0.13], [-2, -2]), doneAction:2);
1142
-
1143
- oscs = LFPulse.ar(env1m, 0, 0.5, 1, -0.5) + LFPulse.ar(env1m * 1.6, 0, 0.5, 0.5, -0.25);
1144
- oscs = LPF.ar(oscs, env1m*1.2, env0);
1145
- oscs = oscs + SinOsc.ar(env1m, 0.8, env0);
1146
-
1147
- noise = WhiteNoise.ar(0.2);
1148
- noise = HPF.ar(noise, 200, 2);
1149
- noise = BPF.ar(noise, 6900, 0.6, 3) + noise;
1150
- noise = noise * env2;
1151
-
1152
- son = oscs + noise;
1153
- son = son.clip2(1) * amp;
1154
-
1155
- Out.ar(out, Pan2.ar(son, pan));
1156
- SCLANG
1157
- credit: "from 08091500Acid309 by_otophilia",
1158
- source: "https://github.com/supercollider-quarks/SynthDefPool",
1159
- )
1160
-
1161
- SNARE_STEIN = SynthDef.new(name: "snare_stein", params: { :out => 0, :amp => 0.1, :pan => 0 },
1162
- body: <<-SCLANG,
1163
- var snare, filtWhite;
1164
-
1165
- filtWhite = LPF.ar(WhiteNoise.ar(1), 7040, 1);
1166
-
1167
- snare = (SinOsc.ar(330,0,0.25) * EnvGen.ar(Env.perc(0.0005,0.055))) + (SinOsc.ar(185,0,0.25) * EnvGen.ar(Env.perc(0.0005,0.075))) + (filtWhite * EnvGen.ar(Env.perc(0.0005,0.2), doneAction: 2) * 0.2) + (HPF.ar(filtWhite, 523, 1) * EnvGen.ar(Env.perc(0.0005,0.183)) * 0.2);
1168
- Out.ar(out, Pan2.ar(snare * amp * 10, pan));
1169
- SCLANG
1170
- credit: "Snare written by Esben Stein, I believe",
1171
- source: "https://github.com/supercollider-quarks/SynthDefPool",
1172
- )
1173
-
1174
557
  SOS_BELL = SynthDef.new(name: "sos_bell", params: { :freq => 440, :out => 0, :amp => 0.1, :pan => 0 },
1175
558
  body: <<-SCLANG,
1176
559
  var son, strike, hum;
@@ -1198,7 +581,6 @@ SCLANG
1198
581
  source: "https://github.com/supercollider-quarks/SynthDefPool",
1199
582
  )
1200
583
 
1201
-
1202
584
  KRGN_GEN_FMDEVIL = SynthDef.new(name: "krgn_gen_fmdevil", params: { :out => 0, :freq => 440, :amp => 1.0, :index => 3, :detune => 1.02, :gate => 1 },
1203
585
  body: <<-SCLANG,
1204
586
  var mod1, mod2, mod3, car, idx, env;
@@ -1214,62 +596,6 @@ SCLANG
1214
596
  source: "https://github.com/mtytel/supersongs/",
1215
597
  )
1216
598
 
1217
- BOOP = SynthDef.new(name: "boop", params: { :out => 0, :dur => 1.0, :amp => 1.0, :freq => 440 },
1218
- body: <<-SCLANG,
1219
- var env, sig;
1220
- env = EnvGen.ar(Env.new([1, 0.1, 0], [0.06, dur - 0.06]), doneAction: 2);
1221
- sig = LFTri.ar([freq * 0.995, freq * 1.005], 0, env * amp);
1222
- Out.ar(out, sig ! 2);
1223
- SCLANG
1224
- source: "https://github.com/mtytel/supersongs/",
1225
- )
1226
-
1227
- MARIO = SynthDef.new(name: "mario", params: { :out => 0, :freq => 440, :length => 0.1, :dur => 0.2 },
1228
- body: <<-SCLANG,
1229
- var snd, amp;
1230
- snd = LFPulse.ar(freq)!2;
1231
- amp = LFTri.ar(freq/50)!2;
1232
- snd = snd * EnvGen.ar(Env.linen(0.001, length * dur, 0.03), doneAction:2);
1233
- OffsetOut.ar(out, snd*amp);
1234
- SCLANG
1235
- source: "https://github.com/mtytel/supersongs/",
1236
- )
1237
-
1238
- MARIO_BASS = SynthDef.new(name: "mariobass", params: { :out => 0, :amp => 1.0, :freq => 440, :length => 0.1, :dur => 0.2 },
1239
- body: <<-SCLANG,
1240
- var snd;
1241
- snd = LFTri.ar(freq)!2;
1242
- snd = snd * EnvGen.ar(Env.linen(0.001, length * dur, 0.03), doneAction:2);
1243
- OffsetOut.ar(out, snd*amp);
1244
- SCLANG
1245
- source: "https://github.com/mtytel/supersongs/",
1246
- )
1247
-
1248
- BEAT = SynthDef.new(name: "beat", params: { :out => 0, :amp => 1.0, :sustain => 0.1, :dur => 0.1 },
1249
- body: <<-SCLANG,
1250
- var snd;
1251
- snd = BrownNoise.ar()!2;
1252
- snd = HPF.ar(snd, 2000);
1253
- snd = snd * EnvGen.ar(Env.linen(0.005, dur * sustain, 0.01), doneAction:2);
1254
- OffsetOut.ar(out, snd*amp);
1255
- SCLANG
1256
- source: "https://github.com/mtytel/supersongs/",
1257
- )
1258
-
1259
- BASS2 = SynthDef.new(name: "bass2", params: { :out => 0, :freq => 440, :gate => 1, :amp => 1.0, :slideTime => 0.17, :ffreq => 1100, :width => 0.15, :detune => 1.005, :preamp => 4, :dur => 0.2, :length => 0.2 },
1260
- body: <<-SCLANG,
1261
- var sig,
1262
- env = Env.adsr(0.01, 0.3, 0.4, 0.1);
1263
- freq = Lag.kr(freq, slideTime);
1264
- sig = Mix(VarSaw.ar([freq, freq * detune], 0, width, preamp)).distort * amp
1265
- * EnvGen.kr(env, gate * dur * length , doneAction: 2);
1266
- sig = LPF.ar(sig, ffreq);
1267
- Out.ar(out, sig ! 2)
1268
- SCLANG
1269
- source: "https://github.com/mtytel/supersongs/",
1270
- )
1271
-
1272
-
1273
599
  DROPLET = SynthDef.new(name: "droplet", params: { :amp => 0.2, :out => 0, :freq => 3000, :dur => 1, :rate => 1 },
1274
600
  body: <<-SCLANG,
1275
601
  /**
@@ -1341,8 +667,6 @@ SCLANG
1341
667
  source: "https://github.com/johncburnett/Matrix",
1342
668
  )
1343
669
 
1344
-
1345
-
1346
670
  POOM = SynthDef.new(name: "poom", params: { :out => 0, :freq => 400, :level => 0.1 },
1347
671
  body: <<-SCLANG,
1348
672
  var env = Env.perc(level: level);
@@ -1366,7 +690,6 @@ SCLANG
1366
690
  source: "https://github.com/philthomson/imp",
1367
691
  )
1368
692
 
1369
-
1370
693
  AEOLIAN_STRINGS = SynthDef.new(name: "aeolian_strings", params: { :out => 0 },
1371
694
  body: <<-SCLANG,
1372
695
  // aeolian strings
@@ -1437,38 +760,6 @@ SCLANG
1437
760
  )
1438
761
 
1439
762
 
1440
- FM_TOM = SynthDef.new(name: "fmtom", params: { :out => 0, :freq => 200, :gate => 1, :vol => 0.5 },
1441
- body: <<-SCLANG,
1442
- var tom = PMOsc.ar(freq, 280, Line.kr(0.0, 12, 1), mul: EnvGen.ar(Env.adsr(0.003,0.2,0,0), gate, levelScale: 0.3, doneAction: 2));
1443
- Out.ar(out, tom * vol ! 2);
1444
- SCLANG
1445
- source: "https://github.com/mattvears/supercollider-stuff",
1446
- )
1447
-
1448
- BASS_303 = SynthDef.new(name: "bass303", params: { :out => 0, :freq => 440, :gate => 1, :lpf => 1000, :res => 0.8, :width => 0.05, :amp => 1, :vol => 0.5 },
1449
- body: <<-SCLANG,
1450
- var sig, env;
1451
- var sig2, env2;
1452
-
1453
- // ghetto 303
1454
- env = Env.adsr(0.05, 2, 0, 0.3, 0.8, -12);
1455
- sig = LFPulse.ar(freq, width: width) + Pulse.ar(freq, width: 0.9);
1456
- sig = sig * EnvGen.ar(env, gate, amp, doneAction: 2);
1457
- sig = RLPF.ar(sig, lpf, res);
1458
-
1459
- env2 = Env.adsr(0.03, 2, 0, 0.3, 0.8, -13);
1460
- sig2 = LFPulse.ar(freq, width: width) + Pulse.ar(freq, width: 0.9);
1461
- sig2 = FreqShift.ar(sig2, 3);
1462
- sig2 = sig2 * EnvGen.ar(env2, gate, amp, doneAction: 2);
1463
- sig2 = RLPF.ar(sig2, lpf, res);
1464
-
1465
-
1466
- Out.ar(out, [sig * vol, sig2 * vol]);
1467
-
1468
- SCLANG
1469
- source: "https://github.com/mattvears/supercollider-stuff",
1470
- )
1471
-
1472
763
  # (
1473
764
  # x = Signal.sineFill(513, [0.5, 0.2, 0.3, 0.0, 0.2]);
1474
765
  # // x.plot;
@@ -1502,44 +793,6 @@ SCLANG
1502
793
  # source: "https://github.com/mattvears/supercollider-stuff",
1503
794
  # )
1504
795
 
1505
- SNARE_909 = SynthDef.new(name: "snare909", params: { :out => 0, :lpFreq => 1000, :vol => 1, :gate => 1 },
1506
- body: <<-SCLANG,
1507
- var sig1, sig2;
1508
- var triEnv;
1509
- var shifted1;
1510
- var shifted2;
1511
- var sinEnv;
1512
- var sin1, sin2;
1513
- var mixed;
1514
- var sig3;
1515
- var noiseEnv;
1516
-
1517
- // tri -> final mixer
1518
- triEnv = Env.adsr(0, 0.4, 0, 0, curve: -4, peakLevel: 0.5);
1519
- sig1 = LFTri.ar(111, 0, 0.5) * EnvGen.kr(triEnv, gate: gate, doneAction: 2);
1520
- shifted1 = FreqShift.ar(sig1, 175);
1521
- shifted2 = FreqShift.ar(sig1, 224);
1522
- sig1 = Mix.new([shifted1, shifted2]);
1523
-
1524
- // sines -> final mixer
1525
- sin1 = SinOsc.ar(330, mul: 0.2);
1526
- sin2 = SinOsc.ar(180, mul: 0.2);
1527
- sinEnv = Env.adsr(0, 0.2, 0, 0);
1528
- sig2 = Mix.new([sin1, sin2]) * EnvGen.kr(sinEnv, gate: gate, doneAction: 2);
1529
-
1530
- // noise -> final mixer
1531
- noiseEnv = Env.adsr(0, 0.3, 0, 0);
1532
- sig3 = LPF.ar(WhiteNoise.ar() * EnvGen.kr(noiseEnv, gate: gate, doneAction: 2), 1000);
1533
- sig3 = HPF.ar(sig3, 600);
1534
-
1535
- mixed = Mix.new([sig1, sig2, sig3]);
1536
- mixed = LPF.ar(mixed, lpFreq) * vol;
1537
- Out.ar(out, mixed ! 2);
1538
- SCLANG
1539
- source: "https://github.com/mattvears/supercollider-stuff",
1540
- )
1541
-
1542
-
1543
796
  HOOVER = SynthDef.new(name: "hoover", params: { :freq => 220, :amp => 0.1, :lgu => 0.1, :lgd => 1, :gate => 1 },
1544
797
  body: <<-SCLANG,
1545
798
  var pwm, mix, env;
@@ -1571,7 +824,6 @@ SCLANG
1571
824
  source: "https://github.com/rukano/scprivatepool",
1572
825
  )
1573
826
 
1574
-
1575
827
  SAWPULSE = SynthDef.new(name: "sawpulse", params: { :out => 0, :freq => 440, :gate => 0.5, :plfofreq => 6, :mw => 0, :ffreq => 2000, :rq => 0.3, :freqlag => 0.05, :amp => 1 },
1576
828
  body: <<-SCLANG,
1577
829
  var sig, plfo, fcurve;
@@ -1618,24 +870,6 @@ SCLANG
1618
870
  source: "https://github.com/bwestergard/supercollider-experiments",
1619
871
  )
1620
872
 
1621
- SNARE3 = SynthDef.new(name: "snare", params: { :amp => 1, :dur => 0.05, :out => 0 },
1622
- body: <<-SCLANG,
1623
- dur = dur * 16;
1624
- Out.ar(out, amp * XLine.ar(2,1/1000,dur) * BPF.ar(PinkNoise.ar(0.8), XLine.ar(20000,1000,dur, doneAction:2), 0.8).dup);
1625
- SCLANG
1626
- source: "https://github.com/bwestergard/supercollider-experiments",
1627
- )
1628
-
1629
- KICK1 = SynthDef.new(name: "kick", params: { :out => 0, :amp => 1, :dur => 0.05 },
1630
- body: <<-SCLANG,
1631
- var tone;
1632
- tone = SinOsc.ar(XLine.ar(800,2,dur*4, mul: 0.2, doneAction:2));
1633
- Out.ar(out, amp * tone.dup * XLine.ar(2,1/1000,dur*4));
1634
- SCLANG
1635
- source: "https://github.com/bwestergard/supercollider-experiments",
1636
- )
1637
-
1638
-
1639
873
  POLY1 = SynthDef.new(name: "poly1", params: { :out => 0, :gate => 1, :freq => 440 },
1640
874
  body: <<-SCLANG,
1641
875
  var aEnv,fEnv,osc1, osc2,flt;
@@ -1649,7 +883,6 @@ SCLANG
1649
883
  source: "https://github.com/k-o-l-e-k-t-i-v/supercollider",
1650
884
  )
1651
885
 
1652
-
1653
886
  end
1654
887
  end
1655
888
  end