├── DF-xx ├── DF-02 for Processing ├── DF-02 for Sonic Pi ├── DF-xx Instructions ├── Euclidian Rhythm Sonic Pi ├── DF-01 for Processing 3 ├── DF-03 for Sonic Pi ├── DF-00 for Sonic Pi └── DF-00 for Processing 3 ├── Live_Coding ├── README.md ├── Cluster ├── See in the Dark ├── Temple ├── 20170713_Live_Coding ├── Echo Chamber ├── What are you waiting for? ├── 20170623_Live_Coding ├── to Egon ├── Parallel Paths ├── Electric Tears └── Emphasis ├── README.md ├── Presets ├── Pad Dirty ├── Readme.md ├── Rhodes1 ├── Rhodes2 ├── Pad Smooth ├── Organ Low ├── String Pad ├── Organ High └── Organ Dirty ├── Limitation Game ├── Generator ├── 14.09.2018 └── 15.0.2018 ├── Beats ├── Industrial ├── Robot ├── Safari └── Electric Tears ├── Rudiments ├── Tubular Bells └── The Man Machine ├── Sound_Effects ├── DTMF Telephone ├── Siren ├── Geiger Counter ├── Airplane engine effect └── Morsecode ├── Ambient ├── Atonal Ambience ├── Harmonic Ambience └── Bouncing Plucks ├── Tutorials ├── Reggae Organ └── Punk Synth ├── Minimal Code - Minimal Music ├── Metronome ├── sync cue demonstration ├── Generated melody with probabilities ├── APC ├── APCkey25_Timing ├── SP-APC_Utility_1.3 ├── SP-APC_Utility_1.4 ├── 20200101_Static ├── 20190922_Time ├── 20191231_EKG ├── 20191231_Pound └── 20191231_Heartbeat ├── Drum Pattern Demo ├── Arduino └── DVCO_Code ├── Microtonal Pads ├── Drums ├── Smallest Drum Machine └── Drum Machine ├── Animat ├── Nova ├── Knife Edge └── Planetarium ├── Sound_In Experiments ├── Rave Machine ├── Acid Test 2 ├── Drum Maker ├── 12-Tone Serialism ├── APC light-pad utilities ├── Generative ├── Generator └── Chaos Theory ├── Stasis ├── Covers ├── Mission Impossible ├── Concerning Hobbits ├── Song of Storms ├── James Bond Theme ├── Love on a real Train ├── Midna's Lament ├── A Walk in the Woods ├── Covenant Dance ├── Airwolf ├── Popcorn ├── Tetris Theme ├── Radioactivity ├── Castlevania - Vampire Hunter ├── Clubbed to Death ├── He's a Pirate └── Supermassive Black Hole ├── Overhead ├── Strawberry Synth ├── Poly Synth v0.2 ├── Sampler v0.5 ├── Mono Synth v0.5 └── Mono Synth v0.3 └── Synths ├── Monophonic Synth 0.9 └── Perc-Synth /DF-xx/DF-02 for Processing: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /DF-xx/DF-02 for Sonic Pi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Live_Coding/README.md: -------------------------------------------------------------------------------- 1 | Here is some of the code from my live coding videos. 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sonic-Pi-Code-Bits 2 | A collection of code for various purposes. 3 | -------------------------------------------------------------------------------- /Presets/Pad Dirty: -------------------------------------------------------------------------------- 1 | define :pad_dirty do |note| 2 | with_fx :compressor do 3 | synth :growl, note: note 4 | synth :growl, note: note + 7, amp: 0.5 5 | synth :growl, note: note + 12, amp: 0.4 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /Presets/Readme.md: -------------------------------------------------------------------------------- 1 | This folder contains preset sounds for Sonic Pi. 2 | 3 | 4 | To use them, copy all code into a SP buffer and run it. You can then use it in your code in another buffer. 5 | 6 | You can also copy individual sounds into your code 7 | -------------------------------------------------------------------------------- /Live_Coding/Cluster: -------------------------------------------------------------------------------- 1 | #Cluster 2 | #root is the lowest note 3 | #range is the number of steps that are played 4 | #spread is the distance between steps 5 | define :cluster do |root, range, spread| 6 | i = 0 7 | range.times do 8 | play (root + i) 9 | i = i+spread 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /Limitation Game/Generator: -------------------------------------------------------------------------------- 1 | #Random Limitations Game 2 | #Coded by Davids Fiddle 3 | x0 = synth_names 4 | x1 = sample_names :drum 5 | x2 = sample_names :bd 6 | x3 = sample_names :sn 7 | 8 | list = x0 + x1 + x2 + x3 9 | #puts list 10 | 11 | use_random_seed 14092018 #Insert the current date or any other seed 12 | puts list.pick(5) 13 | -------------------------------------------------------------------------------- /Beats/Industrial: -------------------------------------------------------------------------------- 1 | #Industrial Beat 2 | #Coded by Davids Fiddle 3 | 4 | use_sample_bpm :loop_industrial 5 | with_fx :compressor do 6 | live_loop :drums do 7 | sample :loop_industrial 8 | sleep 1 9 | end 10 | live_loop :kik do 11 | sample :bd_haus if one_in(2) 12 | sleep 0.125 13 | sample :bd_haus if one_in(4) 14 | sleep 0.125 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /Beats/Robot: -------------------------------------------------------------------------------- 1 | #Robot 2 | #Coded by Davids Fiddle 3 | 4 | low = 60 5 | high = 120 6 | use_bpm 60 7 | 8 | live_loop :beat do 9 | tick 10 | sample :bd_klub 11 | sample (knit :glitch_robot1,3,:glitch_robot2,1).look, 12 | cutoff: (line low,high,steps: 16).mirror.look 13 | sleep 1 14 | end 15 | 16 | in_thread do #control cutoff 17 | sleep 16 18 | low = 90 19 | high = 120 20 | end 21 | -------------------------------------------------------------------------------- /Beats/Safari: -------------------------------------------------------------------------------- 1 | #Safari Beat 2 | #Coded by Davids Fiddle 3 | 4 | use_sample_bpm :loop_safari 5 | with_fx :slicer, phase: 0.5, pulse_width: 0.75 do 6 | live_loop :safari do 7 | sample :loop_safari 8 | sleep 1 9 | end 10 | end 11 | live_loop :hatz do 12 | sample :drum_cymbal_soft, amp: 0.5 if one_in(4) 13 | sleep 0.125 14 | end 15 | live_loop :kik do 16 | sync :safari 17 | sample :bd_haus 18 | end 19 | -------------------------------------------------------------------------------- /Presets/Rhodes1: -------------------------------------------------------------------------------- 1 | define :rhodes1 do |note| 2 | with_fx :compressor do 3 | with_fx :flanger, phase_offset: 0.8, mix: 1 do 4 | synth :sine, note: note, decay: 0.25, sustain_level: 0.8, release: 0.5 5 | end 6 | with_fx :rlpf, cutoff: note + 12 do 7 | use_merged_synth_defaults decay: 0.25, sustain_level: 0.7, release: 0.25, sustain: 0 8 | synth :tri, note: note, amp: 0.5 9 | synth :tri, note: note + 12, amp: 0.7 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /Presets/Rhodes2: -------------------------------------------------------------------------------- 1 | define :rhodes2 do |note| 2 | with_fx :compressor do 3 | with_fx :flanger, phase_offset: 0.8, mix: 1 do 4 | synth :sine, note: note, decay: 0.25, sustain_level: 0.8, release: 0.5 5 | end 6 | with_fx :rlpf, cutoff: note + 19 do 7 | use_merged_synth_defaults decay: 0.25, sustain_level: 0.7, release: 0.25, sustain: 0 8 | synth :saw, note: note + 12, amp: 1 9 | synth :tri, note: note + 12, amp: 0.9 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /DF-xx/DF-xx Instructions: -------------------------------------------------------------------------------- 1 | How to use the DF-xx instruments 2 | 3 | Copy the code 'for Sonic Pi' into an empty buffer in Sonic Pi. 4 | When using multiple instruments, copy them into different buffers. 5 | Copy the code 'for Processing 3' into Processing3. 6 | 7 | You need the OscP5 and ControlP5 Librarys in Processing. 8 | 9 | In Sonic Pi, run the code of all instruments you want to use. 10 | in Processing 3, run the code, this should open the UI window. 11 | 12 | Please report any problems. 13 | -------------------------------------------------------------------------------- /Presets/Pad Smooth: -------------------------------------------------------------------------------- 1 | define :pad_smooth do |note| 2 | use_merged_synth_defaults attack: 0.2 3 | with_fx :hpf, cutoff: note do 4 | with_fx :lpf, cutoff: note + 24 do 5 | with_fx :compressor do 6 | synth :tri, note: note + 0, pan: 0.1 7 | synth :tri, note: note + 12.02, pan: 0.2 8 | synth :saw, note: note + 0.02, pan: -0.1 9 | synth :sine, note: note + 12, pan: -0.2 10 | synth :sine, note: note, pan: 0 11 | end 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /Beats/Electric Tears: -------------------------------------------------------------------------------- 1 | #Electric Tears 2 | #Coded by Davids Fiddle 3 | 4 | use_sample_bpm :loop_electric 5 | with_fx :slicer, pulse_width: 0.75, phase: 0.315, wave: 1, smooth: 0.1 do 6 | live_loop :beat do 7 | sample :loop_electric 8 | sleep 1 9 | end 10 | end 11 | live_loop :hatz do 12 | use_synth_defaults amp: 0.6, sustain: 0, release: 0.05 13 | synth :cnoise, cutoff: 100 if one_in(4) 14 | synth :pnoise, cutoff: 110, decay: 0.01 if one_in(6) 15 | sleep 0.125 16 | end 17 | live_loop :kik do 18 | sync :beat 19 | sample :bd_haus 20 | end 21 | -------------------------------------------------------------------------------- /Rudiments/Tubular Bells: -------------------------------------------------------------------------------- 1 | #Tubular Bells 2 | use_bpm 135 3 | use_tuning :just, :a 4 | riff = (ring :a5,:e5,:b5,:e5,:g5,:a5,:e5,:c6, 5 | :e5,:d6,:e5,:b5,:c6,:e5, 6 | :a5,:e5,:b5,:e5,:g5,:a5,:e5,:c6, 7 | :e5,:d6,:e5,:b5,:c6,:e5,:b5,:e5) 8 | 9 | with_fx :reverb, room: 1 do 10 | live_loop :tubular do 11 | tick 12 | use_synth :pretty_bell 13 | use_synth_defaults sustain: 0, release: 1.5 14 | play riff.look 15 | use_synth :piano 16 | #play riff.look 17 | #play riff.look - 12 18 | sleep 0.5 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /Sound_Effects/DTMF Telephone: -------------------------------------------------------------------------------- 1 | #DTMF Calling 2 | #Coded by Davids Fiddle 3 | 4 | define :dtmf do |number| 5 | numbersx = [1,0,1,2,0,1,2,0,1,2] 6 | numbersy = [3,0,0,0,1,1,1,2,2,2] 7 | x = [1209,1336,1477,1633] 8 | y = [697,770,852,941] 9 | #Play Notes 10 | use_synth :sine 11 | use_synth_defaults release: 0, sustain: 0.1 12 | play hz_to_midi x[numbersx[number]] 13 | play hz_to_midi y[numbersy[number]] 14 | end 15 | 16 | 10.times do 17 | use_synth :sine 18 | use_synth_defaults release: 0, sustain: 0.1 19 | dtmf (ring 0,1,2,3,4,5,6,7,8,9).tick 20 | sleep 0.125 21 | end 22 | -------------------------------------------------------------------------------- /Presets/Organ Low: -------------------------------------------------------------------------------- 1 | define :organ_low do |note| 2 | use_merged_synth_defaults attack: 0.2 3 | with_fx :compressor do 4 | with_fx :reverb, room: 0.7 do 5 | synth :tri, note: note, amp: 1 6 | synth :tri, note: note + 0.02, amp: 1 7 | synth :tri, note: note + 0.01, amp: 0.8 8 | synth :tri, note: note, amp: 0.4 9 | synth :tri, note: note + 12, amp: 0.8 10 | synth :tri, note: note + 12.02, amp: 0.8 11 | end 12 | use_merged_synth_defaults attack: 0.1 13 | synth :sine, note: note, amp: 0.8 14 | synth :sine, note: note + 0.02, amp: 0.8 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /Ambient/Atonal Ambience: -------------------------------------------------------------------------------- 1 | #Atonal Ambience 2 | #Coded by Davids Fiddle 3 | #https://youtu.be/uF8saqnApwI 4 | 5 | 6 | use_random_seed 42 7 | s0 = sample_names :ambi 8 | s1 = sample_names :elec 9 | s2 = sample_names :misc 10 | s3 = sample_names :vinyl 11 | sam = s0 + s1 + s2 + s3 12 | live_loop :aton do 13 | #stop 14 | current = sam.choose 15 | puts "new sample" 16 | (rand_i 5).times do #Repeat? 17 | sample current, rate: (line -10,10,steps: 99).choose / (ring 1,2,3).choose, 18 | amp: (line 0.4,2).choose 19 | sleep (line 0.1,1).choose 20 | end 21 | sleep (line 0.5,1.5).choose 22 | end 23 | -------------------------------------------------------------------------------- /Live_Coding/See in the Dark: -------------------------------------------------------------------------------- 1 | #See in the Dark 2 | use_random_seed 42 3 | use_bpm 90 4 | 5 | live_loop :cluster1 do 6 | synth :dark_ambience, note: [:g2,:gs2,:a2,:as2,:b2].choose, 7 | sustain: [6,7,8,9].choose, 8 | release: [4,6,8].choose, 9 | attack: 2, amp: 0 10 | sleep (range 8,14).choose 11 | end 12 | with_fx :gverb do 13 | live_loop :cluster2 do 14 | synth :dark_ambience, note: [:fs3,:g3,:gs3,:a3,:as3,:b3,:c3].choose, 15 | sustain: [6,7,8].choose, 16 | release: [4,6].choose, 17 | attack: 2, amp: 0, 18 | cutoff: 80 19 | sleep (range 5,10).choose 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /Rudiments/The Man Machine: -------------------------------------------------------------------------------- 1 | #The Man Machine 2 | 3 | use_bpm 86 4 | 5 | 6 | with_fx :echo, phase: 0.25, mix: 0.2 do 7 | live_loop :plips do 8 | sample :elec_plip, rate: 1.1 if (ring 1,1,1,1,1,0,1,1,1,0,1,0,1,1,0,0).tick == 1 9 | sleep 0.25 10 | end 11 | end 12 | 13 | live_loop :snare do 14 | sample :elec_mid_snare, amp: 0.7 if (ring 1,0,1,0,0,0,1,0).tick == 1 15 | sleep 0.5 16 | end 17 | 18 | live_loop :riff do 19 | use_synth :prophet 20 | use_synth_defaults sustain: 0, release: 0.3, amp: 0.8 21 | play (ring :g4,:g5,:g4,:g5,:fs5,:r,:e5,:fs5,:g5,:r,:fs5,:g5,:a5,:r,:r,:r).tick 22 | sleep 0.25 23 | end 24 | -------------------------------------------------------------------------------- /Sound_Effects/Siren: -------------------------------------------------------------------------------- 1 | #Sonic Pi Siren 2 | #Coded by Davids Fiddle 3 | in_thread do 4 | 5 | #Parameters: 6 | pitch0 = :d5 7 | pitch1 = :d6 8 | phase = 4 #in seconds 9 | cycles = 2 10 | cut_do = 1 11 | cut_phase = 0.125 #in seconds 12 | this_synth = :square 13 | with_bpm 60 do 14 | with_fx :slicer, mix: cut_do, phase: cut_phase do 15 | sir = synth this_synth, note: pitch0, note_slide: phase, 16 | sustain: phase * cycles * 2, release: 0 17 | cycles.times do 18 | control sir, note: pitch1 19 | sleep phase 20 | control sir, note: pitch0 21 | sleep phase 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /Live_Coding/Temple: -------------------------------------------------------------------------------- 1 | #Temple 2 | #Coded by Davids Fiddle 3 | 4 | 5 | live_loop :ambi do 6 | tick 7 | use_synth :dark_ambience 8 | play_chord (chord (ring :a3,:d3,:f3).look, (ring :major, :minor).look), 9 | sustain: 1.5, release: 2, amp: 2 10 | sleep 2 11 | end 12 | 13 | live_loop :high do 14 | use_synth :dark_ambience 15 | play (knit :a4,6,:a3,2).choose, sustain: 6, release: 1, amp: 0 16 | sleep 6 17 | end 18 | 19 | with_fx :reverb do 20 | live_loop :player do 21 | use_synth :pluck 22 | play (knit :d4,4,:e4,2,:f4,4,:g4,2,:a4,4).choose, amp: 0, 23 | pan: (knit 0,2,0.1,3,0.2,1).choose 24 | sleep (knit 0.25,4,0.5,6,0.75,3,1,2).choose 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /Sound_Effects/Geiger Counter: -------------------------------------------------------------------------------- 1 | #Geiger Counter 2 | #Coded by Davids Fiddle 3 | 4 | set_volume! 1 5 | radiation_level = 6 #smaller values mean more clicks 6 | 7 | with_fx :bitcrusher, sample_rate: 10000, sample_rate_slide: 5 do |bit| 8 | with_fx :reverb do 9 | live_loop :geiger do 10 | use_synth :pulse 11 | use_synth_defaults sustain: 0, release: 0.05, 12 | amp: (range 0.5,1.2,0.1).choose 13 | play :d6 if one_in(radiation_level) 14 | with_bpm 200 do 15 | sleep 0.1 16 | end 17 | end 18 | live_loop :con_bit do 19 | control bit, sample_rate: (ring 2000,4000,6000,8000,10000).choose 20 | sleep (ring 3,4,4,5,6).choose 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /Tutorials/Reggae Organ: -------------------------------------------------------------------------------- 1 | #Reggae Organ 2 | #Coded by Davids Fiddle 3 | 4 | use_bpm 120 5 | 6 | define :reg_organ do |notes| 7 | use_synth :sine 8 | play_chord notes 9 | use_synth :sine 10 | with_transpose -12 do 11 | play_chord notes, amp: 0.8 12 | end 13 | use_synth :piano 14 | play notes[0], amp: 0.6 15 | end 16 | 17 | with_fx :reverb do 18 | with_fx :wobble, cutoff_min: 70, phase: 5.1, wave: 3, mix: 0.6 do 19 | live_loop :reggae1 do 20 | reg_organ (chord :c5,:major) if (ring 0,1).tick == 1 21 | sleep 1 22 | end 23 | live_loop :reggae2 do 24 | reg_organ (chord :c4,:major) if (ring 0,1,0,1).tick == 1 25 | sleep (ring 0.7,0.3,0.7,0.3).look 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /Minimal Code - Minimal Music: -------------------------------------------------------------------------------- 1 | #Minimal Music with Minimal Code 2 | #by Davids Fiddle 3 | 4 | use_synth :piano 5 | live_loop :a do 6 | play (chord :c3,:minor7, num_octaves: 2).pick(12), pan: 0.3 7 | sleep 0.5 8 | end 9 | live_loop :b do 10 | play (chord :c4,:minor, num_octaves: 2).pick(12), pan: -0.3 11 | sleep 0.5 12 | end 13 | with_fx :reverb do 14 | live_loop :c do 15 | play (chord :c2, :minor7).pick(8), amp: 1.3 16 | sleep 0.75 17 | end 18 | live_loop :d do 19 | play (chord :c5, :m6, num_octaves: 2).pick(24), amp: 0.8 20 | sleep 0.25 21 | end 22 | use_synth :hollow 23 | live_loop :e do 24 | play (ring :c2,:g2,:eb2,:c2,:f2,:c2,:g2,:c2).tick, 25 | sustain: 3, amp: 1.5 26 | sleep 3 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /Presets/String Pad: -------------------------------------------------------------------------------- 1 | define :string_pad do |note| 2 | use_merged_synth_defaults attack: 0.2, vibrato_delay: 1, 3 | vibrato_rate: 6 4 | with_fx :compressor do 5 | with_fx :reverb do 6 | synth :blade, note: note 7 | synth :blade, note: note + 0.005 8 | synth :blade, note: note - 0.005 9 | synth :blade, note: note + 7, amp: 0.5 10 | synth :blade, note: note + 12, amp: 0.6 11 | synth :blade, note: note + 24, amp: 0.2 12 | end 13 | use_merged_synth_defaults attack: 0.1, 14 | vibrato_depth: 0.1, vibrato_delay: 4, vibrato_rate: 1 15 | synth :blade, note: note - 12, amp: 0.5 16 | synth :blade, note: note - 11.995, amp: 0.5 17 | synth :blade, note: note - 12.005, amp: 0.5 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /Live_Coding/20170713_Live_Coding: -------------------------------------------------------------------------------- 1 | #Live Coding Session 13.07.2017 2 | #Coded by Davids Fiddle 3 | 4 | use_bpm 180 5 | 6 | live_loop :heart do 7 | sample :bd_ada, amp: 0 8 | sample :bd_klub, amp: 0 9 | sleep 1 10 | end 11 | 12 | live_loop :machine do 13 | sync :heart 14 | sample :ambi_dark_woosh, rate: (ring 0.5, -0.5).choose, 15 | amp: 1.2 16 | sleep 4 17 | end 18 | 19 | sync :heart 20 | live_loop :thunder do 21 | sample :ambi_choir, rate: 0.4, amp: 0.5 22 | sleep 4 23 | end 24 | 25 | sync :heart 26 | live_loop :arp do 27 | use_synth :dpulse 28 | use_synth_defaults cutoff: 60, amp: 0 29 | play (chord :gb2, '7+5', num_octaves: 3).tick 30 | sleep 0.5 31 | play (chord :gb2, '11', num_octaves: 3).tick 32 | sleep 0.5 33 | end 34 | -------------------------------------------------------------------------------- /Presets/Organ High: -------------------------------------------------------------------------------- 1 | define :organ_high do |note| 2 | use_merged_synth_defaults attack: 0.1 3 | with_fx :reverb, room: 0.7 do 4 | synth :tri, note: note, amp: 1 5 | synth :tri, note: note + 0.02, amp: 1 6 | synth :tri, note: note + 12.01, amp: 0.8 7 | synth :tri, note: note - 12, amp: 0.4 8 | end 9 | with_fx :reverb, room: 0.9 do 10 | synth :saw, note: note + 12, amp: 1 11 | synth :saw, note: note + 19, amp: 0.7 12 | synth :saw, note: note + 24, amp: 0.5 13 | synth :saw, note: note + 12.01, amp: 1 14 | synth :saw, note: note + 19.02, amp: 0.7 15 | synth :saw, note: note + 24.01, amp: 0.5 16 | end 17 | use_merged_synth_defaults attack: 0 18 | synth :tri, note: note + 12, amp: 0.8 19 | synth :tri, note: note + 12.02, amp: 0.8 20 | end 21 | -------------------------------------------------------------------------------- /Limitation Game/14.09.2018: -------------------------------------------------------------------------------- 1 | #Limitation Game Coding 14.09.2018 2 | #by Davids Fiddle 3 | 4 | e0 = 15 5 | e1 = 5 6 | e2 = 17 7 | e3 = 5 8 | e4 = 15 9 | 10 | live_loop :drumsss do 11 | tick 12 | e0 = (line 10,20).choose if one_in(12) 13 | e1 = (line 2,10).choose if one_in(12) 14 | e2 = (line 15,25).choose if one_in(12) 15 | e3 = (line 2,10).choose if one_in(12) 16 | e4 = (line 10,20).choose if one_in(12) 17 | sample :drum_heavy_kick if (spread e0,32).look 18 | sample :bd_zum if (spread e1,32).look 19 | sample :drum_cymbal_closed if (spread e2,32).look 20 | synth :pnoise, sustain: 0, release: 0.2, cutoff: (line 90,110).choose if (spread e3,32).look 21 | synth :noise, release: 0.05, decay: 0.05, sustain_level: 0.6, cutoff: (line 110,120).choose if (spread e4,32).look 22 | sleep 0.125 23 | end 24 | -------------------------------------------------------------------------------- /Ambient/Harmonic Ambience: -------------------------------------------------------------------------------- 1 | #Harmonic Ambience 2 | #Coded by Davids Fiddle 3 | #https://youtu.be/fh4oHnBAKss 4 | 5 | 6 | use_random_seed 12 7 | roots = (ring :d3, :f3) #Chord roots 8 | types = (ring :m13, '7sus4') #Chord types 9 | room = 1 #Time between notes 10 | ceiling = 3 #Maximum chord spread 11 | doors = 16 #Time for chord changes 12 | root = roots[0] 13 | type = types[0] 14 | live_loop :progression do 15 | tick 16 | root = roots.look 17 | type = types.look 18 | sleep doors 19 | end 20 | live_loop :ambi do 21 | use_synth (ring :growl, :hollow, :tech_saws).choose 22 | use_synth_defaults sustain: (line 4,8).choose, 23 | amp: 0.5, 24 | release: (line 0.2,2).choose, 25 | attack: (line 0.2,2).choose 26 | play (chord root, type, num_octaves: ceiling).choose 27 | sleep room 28 | end 29 | -------------------------------------------------------------------------------- /Sound_Effects/Airplane engine effect: -------------------------------------------------------------------------------- 1 | #Airplane Engine sound effect 2 | #Coded by Davids Fiddle 3 | 4 | sus = 3600 #Time in seconds 5 | rpm = 3000 #Rotation speed 6 | puts ph = 1.0 / (rpm / 60) 7 | cut = 90 #Cutoff 8 | rotor = 0.2 #Slice width, higher values are better for slower speeds 9 | mixture = 10 10 | 11 | synth :noise, sustain: sus, cutoff: 60, amp: 0.3 12 | 13 | with_fx :lpf, cutoff: cut, cutoff_slide: 2 do |cut| 14 | with_fx :slicer, phase: ph, phase_slide: 2, pulse_width: rotor, smooth: 0.04 do |motor| 15 | in_thread do 16 | synth :noise, sustain: sus 17 | synth :bnoise, sustain: sus, amp: 0.4 18 | sleep sus 19 | end 20 | end 21 | live_loop :pops do 22 | use_synth :pluck 23 | 16.times do 24 | play :d1,amp: 3, sustain: 0, release: ph*2 if one_in(mixture) 25 | sleep ph 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /Presets/Organ Dirty: -------------------------------------------------------------------------------- 1 | define :organ_dirty do |note| 2 | use_merged_synth_defaults attack: 0.1 3 | with_fx :compressor do 4 | with_fx :reverb, room: 0.3 do 5 | synth :square, note: note, amp: 1 6 | synth :square, note: note - 0.01, amp: 1 7 | synth :saw, note: note + 12, amp: 0.8 8 | synth :saw, note: note - 12, amp: 0.4 9 | end 10 | with_fx :reverb, room: 0.5 do 11 | synth :saw, note: note + 12, amp: 1 12 | synth :saw, note: note + 19, amp: 0.7 13 | synth :saw, note: note + 24, amp: 0.5 14 | synth :saw, note: note + 12.01, amp: 1 15 | synth :saw, note: note + 18.99, amp: 0.7 16 | synth :saw, note: note + 24.01, amp: 0.5 17 | end 18 | use_merged_synth_defaults attack: 0 19 | synth :square, note: note + 12, amp: 0.8 20 | synth :square, note: note + 11.99, amp: 0.8 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /Metronome: -------------------------------------------------------------------------------- 1 | #Metronome 2 | #Coded by Davids Fiddle 3 | 4 | #The BPM to use: 5 | bpm = 120 6 | 7 | #Every element in the list is an eighth note. 8 | #2 is a strong beat, 1 is a normal beat, 0 is silence. 9 | #Remove the # for the list you want. 10 | #If multiple lines are enabled, the last one counts. 11 | #beats = [] 12 | #beats = [2,0,0,0,1,0,0,0] #2/2 13 | #beats = [2,0,1,0] #2/4 14 | #beats = [2,0,1,0,1,0,1,0] #4/4 15 | #beats = [2,1,1,1,1,1,1,1] #8/8 16 | #beats = [2,0,1,0,1,0] #3/4 Classical 17 | #beats = [2,0,0,0,1,0] #3/4 Folk 18 | beats = [2,0,0,1,0,1,0] #7/8 19 | #beats = [2,0,1,0,1,0,1,0,0] #9/8 20 | #beats = [2,0,1,0,1,0,0,1,0,0] #10/8 21 | 22 | 23 | live_loop :metronome do 24 | tick 25 | with_bpm bpm do 26 | sample :elec_plip, amp: 1, rate: 0.8 if beats.ring.look == 1 27 | sample :elec_plip, amp: 2 if beats.ring.look == 2 28 | sleep 0.5 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /sync cue demonstration: -------------------------------------------------------------------------------- 1 | comment do 2 | #The print commands happen at the same time 3 | #Run and stop it a few times. The order in which the print commands happen changes. 4 | live_loop :test0 do 5 | print "t0: " + vt.to_s 6 | sleep 1 7 | end 8 | 9 | live_loop :test1 do 10 | sync :test0 11 | print "t1: " + vt.to_s 12 | end 13 | 14 | live_loop :test2 do 15 | sync :test1 16 | print "t2: " + vt.to_s 17 | end 18 | end 19 | 20 | 21 | uncomment do 22 | #:syn is one behind clock 23 | live_loop :clock do 24 | puts "clock: " + tick.to_s 25 | sleep 1 26 | end 27 | 28 | live_loop :syn do 29 | sync :clock 30 | puts "syn_1: " + tick.to_s #gets called every beat 31 | end 32 | 33 | live_loop :syn_4 do 34 | sync :clock 35 | puts "syn4: " + tick.to_s #only gets called every 5 beats 36 | sleep 4 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /Tutorials/Punk Synth: -------------------------------------------------------------------------------- 1 | #Punk Rock Style 2 | #Coded by Davids Fiddle 3 | 4 | blast = (ring 1,1,1,1,1,1,1,1) 5 | kik = (ring 1,0,0,0,1,0,0,0) 6 | 7 | #Beat: 8 | live_loop :drums do 9 | tick 10 | sample :drum_cymbal_open if (ring 0,0,1,0,0,0,1,0).look == 1 11 | sample :sn_dolf if (ring 1,0,0,1,0,1,0,0).look == 1 12 | sample :drum_bass_hard, amp: 1 if kik.look == 1 13 | sleep 0.25 14 | end 15 | 16 | #Synth 1: 17 | h = 2 18 | q = 1 19 | e = 0.5 20 | s = 0.25 21 | 22 | with_fx :reverb do 23 | live_loop :synth1 do 24 | tick 25 | use_synth :saw 26 | play (knit :d3,4,:e3,4,:c3,4,:a2,4).look 27 | use_synth :sine 28 | play (knit :d4,4,:e4,4,:c4,4,:a3,4).look 29 | sleep (ring e+s,e,s,e).look 30 | end 31 | 32 | live_loop :synth2 do 33 | use_synth :tb303 34 | use_synth_defaults sustain: q+e, release: q 35 | play (ring :d2,:e2,:c2,:a1).tick 36 | sleep h 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /Generated melody with probabilities: -------------------------------------------------------------------------------- 1 | #using scale degrees for smaller numbers 2 | #also makes it easier to change keys 3 | 4 | prob_tables = [ 5 | (ring 1), 6 | (ring 2), 7 | (ring 3), 8 | (ring 4), 9 | (ring 5), 10 | (ring 6), 11 | (ring 7), 12 | (ring 0), 13 | ] 14 | #each ring holds the possible next notes for that scale degree 15 | #this just plays the scale, change this for actual use 16 | 17 | note = 1 18 | root = :c3 19 | key = :major 20 | 21 | live_loop :prob_melody do 22 | #play the note. using the scale function let's you use small numbers 23 | #if you want the melody to go over multiple octaves adapt the num_octaves 24 | play (scale root,key, num_octaves: 1)[note] 25 | #write something new into note 26 | table = prob_tables[note] #table now has the ring of notes that can be played next 27 | note = table.choose #a random note from the table is stored in note 28 | #sleep 29 | sleep 1 30 | end 31 | -------------------------------------------------------------------------------- /Live_Coding/Echo Chamber: -------------------------------------------------------------------------------- 1 | #Echo Chamber 2 | #Coded by Davids Fiddle 3 | 4 | use_bpm 60 5 | 6 | with_fx :reverb do 7 | with_fx :compressor do 8 | with_fx :echo, delay: 0.5, decay: 4 do 9 | live_loop :echoes do 10 | use_synth :tb303 11 | play chord([:a2,:d2,:a3,:d3].choose, 12 | :minor).choose, 13 | cutoff: range(70,110).choose, 14 | amp: 0 15 | sleep [0.25,0.5,0.5,0.75,1,1].choose 16 | end 17 | end 18 | end 19 | 20 | live_loop :bass do 21 | use_synth :hollow 22 | play [:a2, :a1].choose, 23 | sustain: [2.5,3,3.5].choose, 24 | release: [0.25,0.5,0.75,1,1.25].choose, 25 | amp: 0 26 | sleep 4 27 | end 28 | 29 | live_loop :arp do 30 | use_synth :dpulse 31 | play chord([:a3,:d3,:e3].choose, 32 | :minor).choose, 33 | amp: 0, release: 0.1, 34 | sustain: 0.1, attack: 0.025 35 | sleep 0.25 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /APC/APCkey25_Timing: -------------------------------------------------------------------------------- 1 | #This code flashes lights on the apc to visualise timing. Specific to the Akai APCkey25 (but you could adapt it to different hardware.) 2 | live_loop :visual, delay: midi_delay do 3 | tick 4 | use_midi_defaults channel: 1, port: 'apc_key_25' 5 | 6 | midi_note_on 64, (ring 1,0,0,0,0,0,0,0).stretch(4).look 7 | midi_note_on 65, (ring 0,1,0,0,0,0,0,0).stretch(4).look 8 | midi_note_on 66, (ring 0,0,1,0,0,0,0,0).stretch(4).look 9 | midi_note_on 67, (ring 0,0,0,1,0,0,0,0).stretch(4).look 10 | midi_note_on 68, (ring 0,0,0,0,1,0,0,0).stretch(4).look 11 | midi_note_on 69, (ring 0,0,0,0,0,1,0,0).stretch(4).look 12 | midi_note_on 70, (ring 0,0,0,0,0,0,1,0).stretch(4).look 13 | midi_note_on 71, (ring 0,0,0,0,0,0,0,1).stretch(4).look 14 | 15 | midi_note_on 82, (ring 1,0,0,0).look 16 | midi_note_on 83, (ring 0,1,0,0).look 17 | midi_note_on 84, (ring 0,0,1,0).look 18 | midi_note_on 85, (ring 0,0,0,1).look 19 | sleep 1 20 | end 21 | -------------------------------------------------------------------------------- /Live_Coding/What are you waiting for?: -------------------------------------------------------------------------------- 1 | #Live Coding 15.07.2017 2 | #What are you waiting for? 3 | #Coded by Davids Fiddle 4 | 5 | use_bpm 100 6 | 7 | gr = synth :growl, sustain: 3600, note_slide: 2 8 | 9 | live_loop :pad do 10 | control gr, note: :c4, amp: 0.4, pan: (ring -0.2,0,0.2).choose 11 | sleep 4 12 | control gr, note: :d4, pan: (ring -0.2,0,0.2).choose 13 | sleep 4 14 | control gr, note: :e4, pan: (ring -0.2,0,0.2).choose 15 | sleep 4 16 | control gr, note: :d4, pan: (ring -0.2,0,0.2).choose 17 | sleep 4 18 | end 19 | 20 | live_loop :tick_tock do 21 | with_bpm 60 do 22 | if one_in(3) 23 | sample :elec_blip2, amp: 0.3 24 | else 25 | sample :elec_blip, amp: 0.3 26 | end 27 | sleep 1 28 | end 29 | end 30 | 31 | live_loop :noises do 32 | sleep (knit 0,3,0.5,2,1,3,1.5,3).choose 33 | sample :ambi_dark_woosh, amp: 0.2, 34 | rate: (knit -1.5,1,-1,2,-0.5,3,0.5,3,1,2,1.5,1).choose 35 | sleep (knit 0.5,2,1,3,1.5,3).choose 36 | end 37 | -------------------------------------------------------------------------------- /Drum Pattern Demo: -------------------------------------------------------------------------------- 1 | #Drum patterns 2 | #Coded by Davids Fiddle 3 | 4 | 5 | #Samples to use 6 | kick = :drum_bass_hard 7 | snare = :drum_snare_hard 8 | hat = :drum_cymbal_closed 9 | 10 | #Patterns 11 | #Kick: 12 | pat_kick = [ 13 | (bools 1,0,0,0,1,0,0,0), #Section 0 14 | (bools 1,0,0,1,0,1,0,0) #Section 1 15 | ] #Extend to add more sections 16 | #Snare 17 | pat_snare = [ 18 | (bools 0,0,1,0,0,0,1,0), 19 | (bools 0,0,1,0,0,0,1,0) 20 | ] 21 | #Hihat: 22 | pat_hat = [ 23 | (bools 1,1,1,1,1,1,1,1), 24 | (bools 1,1,1,1,1,1,1,1) 25 | ] 26 | #Copy and adapt for more samples 27 | 28 | #Section Pattern: 29 | sections = (ring 0,0,0,1).stretch(8) #stretch should have the pattern length as parameter, otherwise weird things will happen 30 | 31 | live_loop :play_patterns do 32 | tick 33 | sample hat if pat_hat[sections.look].look 34 | sample kick if pat_kick[sections.look].look 35 | sample snare if pat_snare[sections.look].look 36 | sleep 0.25 37 | end 38 | -------------------------------------------------------------------------------- /Live_Coding/20170623_Live_Coding: -------------------------------------------------------------------------------- 1 | #23.06.2017 Live Coding 2 | #by Davids Fiddle 3 | 4 | use_bpm 120 5 | 6 | live_loop :robot do 7 | tick 8 | use_synth :fm 9 | use_synth_defaults divisor: (ring 2,3,4,5).mirror.choose, 10 | depth: 15, sustain: 0, release: 0.25, 11 | amp: 0, pan: (ring 0.2,0.1,0,-0.2,-0.1).choose 12 | play :c6 13 | sleep 0.25 14 | end 15 | 16 | live_loop :drone do 17 | use_synth :blade 18 | play (chord :c2, :minor7, num_octaves: 2).choose, 19 | sustain: 2, release: 3, attack: 0.25, amp: 0 20 | sleep 4 21 | end 22 | 23 | live_loop :hb do 24 | sync :robot 25 | sample :bd_ada, amp: 0 26 | sleep 1 27 | end 28 | 29 | live_loop :beet do 30 | sync :hb 31 | #sample :elec_chime, rate: (knit 1,5,1.5,1,2,3).choose 32 | sleep 0.5 33 | sample :drum_cymbal_closed 34 | sleep 0.5 35 | end 36 | 37 | live_loop :machine do 38 | #with_fx :bitcrusher, bits: 4 do 39 | sample :ambi_haunted_hum, 40 | rate: 0.25, amp: 0 41 | sleep 7 42 | #end 43 | end 44 | -------------------------------------------------------------------------------- /Arduino/DVCO_Code: -------------------------------------------------------------------------------- 1 | //Arduino-DVCO Mk4 2 | //by Davids Fiddle 3 | 4 | 5 | //Pins: 6 | static byte clockPin = 2; 7 | static byte syncPin = 3; 8 | static byte resetPin = 4; 9 | 10 | static byte finePin = 4; 11 | static byte cvPin = 1; 12 | static byte coarsePin = 6; 13 | 14 | //Variables: 15 | float frequency = 440; //Reference frequency. With all control inputs at 0, the clock output will be this frequency 16 | 17 | void setup() { 18 | //Serial.begin(9600); 19 | pinMode(clockPin, OUTPUT); 20 | pinMode(resetPin, OUTPUT); 21 | digitalWrite(resetPin, HIGH); 22 | attachInterrupt(digitalPinToInterrupt(syncPin), sync, RISING); 23 | } 24 | 25 | void loop() { 26 | Serial.println(analogRead(cvPin)); 27 | tone(clockPin, frequency * (analogRead(finePin) / 1024.0 + 1) * pow(2, constrain(analogRead(cvPin) / 102.4, 0, 4)) * pow(2, int(map(analogRead(coarsePin), 0, 1024, 0, 5)))); 28 | } 29 | 30 | void sync() { 31 | digitalWrite(resetPin, LOW); 32 | delayMicroseconds(5); 33 | digitalWrite(resetPin, HIGH); 34 | } 35 | -------------------------------------------------------------------------------- /Microtonal Pads: -------------------------------------------------------------------------------- 1 | #Microtonal Pads 2 | #Coded by Davids Fiddle 3 | 4 | #A microtonal scale 5 | sc = (ring 1,2,3,5,7, 6 | 0.5,1.5,2.5,3.5, 7 | 1/3.0,2/3.0,5/3.0,7/3.0, 8 | 1/5.0,2/5.0,3/5.0,7/5.0, 9 | 1/7.0,2/7.0,3/7.0,5/7.0 10 | ).sort 11 | 12 | live_loop :pads do 13 | sync :tick 14 | tick 15 | use_synth :tri 16 | use_synth_defaults sustain: 4, attack: 1, release: 1.5, 17 | amp: 0.3, divisor: (line 2,4).choose 18 | play hz_to_midi(sc.choose * 440), pan: (line -0.3,0.3).choose 19 | play hz_to_midi(sc.choose * 440), pan: (line -0.3,0.3).choose 20 | play hz_to_midi(sc.choose * 440), pan: (line -0.3,0.3).choose 21 | play hz_to_midi(sc.choose * 440), pan: (line -0.3,0.3).choose 22 | sleep 5.8 23 | end 24 | 25 | live_loop :beat do 26 | with_bpm 85 do 27 | tick 28 | sample :bd_klub, amp: (ring 1,0.8).look if (ring 1,1,0,0,0,0,0,0).look == 1 29 | sleep 0.25 30 | end 31 | end 32 | 33 | live_loop :tick do 34 | #sample :elec_plip, amp: (line 0,1).choose 35 | sleep 0.25 36 | end 37 | -------------------------------------------------------------------------------- /Drums/Smallest Drum Machine: -------------------------------------------------------------------------------- 1 | #Smallest Drum Machine 2 | #With Randomisation 3 | #Coded by Davids Fiddle 4 | 5 | #Patterns: 6 | p_kik = (ring 1,0,0,1,0,3,0,0) 7 | p_sna = (ring 0,0,1,0,0,0,1,0) 8 | p_hat = (ring 1,1,5,5,3,4,5,3) 9 | #For the fill 10 | f_tom = (ring 4,4,4,4,4,4,4,4) 11 | f_kik = (ring 0,3,3,0,3,0,4,4) 12 | f_sna = (ring 5,3,0,5,6,7,0,5) 13 | #Fill state 14 | fill = 0 15 | #BPM: 16 | use_bpm = 60 17 | 18 | live_loop :filler do 19 | sleep 12 20 | fill = 1 21 | puts "filling" #Debug Option 22 | sleep 4 23 | fill = 0 24 | end 25 | 26 | live_loop :drums do 27 | tick 28 | sample :drum_bass_hard if one_in(p_kik.look) 29 | sample :drum_snare_hard if one_in(p_sna.look) 30 | sample (knit :drum_cymbal_closed,5, :drum_cymbal_pedal,1).choose if one_in(p_hat.look) 31 | if fill == 1 32 | sample (ring :drum_tom_hi_hard, :drum_tom_lo_hard, :drum_tom_mid_hard).choose if one_in(f_tom.look) 33 | sample :drum_bass_hard if one_in(f_kik.look) 34 | sample :drum_snare_hard if one_in(f_sna.look) 35 | end 36 | sleep 0.25 37 | end 38 | -------------------------------------------------------------------------------- /Live_Coding/to Egon: -------------------------------------------------------------------------------- 1 | #to Egon 2 | #Coded by Davids Fiddle 3 | 4 | use_random_seed 665 5 | 6 | amp_gozer = 0#1.5 7 | amp_zuul = 0#0.5 8 | amp_vinz = 0#1.1 9 | amp_clortho = 0#0.5 10 | 11 | live_loop :gozer do 12 | use_synth :subpulse 13 | use_synth_defaults amp: amp_gozer, cutoff: 120 14 | play (chord :a2, :sus4, num_octaves: 2).choose 15 | sleep (knit 1,4,0.5,3,0.75,1,0.25,3).choose 16 | end 17 | 18 | with_fx :compressor do 19 | with_fx :panslicer, pan_max: 0.4, pan_min: -0.4, phase: 0.25 do 20 | live_loop :zuul do 21 | use_synth :tech_saws 22 | use_synth_defaults attack: 0.25, decay: 0.25, sustain: 3, 23 | release: 0.5, amp: amp_zuul 24 | play :a2 25 | sleep 4 26 | end 27 | end 28 | end 29 | 30 | live_loop :vinz do 31 | sample :loop_mika, amp: amp_vinz 32 | sleep sample_duration :loop_mika 33 | end 34 | 35 | with_fx :compressor do 36 | live_loop :clortho do 37 | use_synth :hoover 38 | use_synth_defaults sustain: 6, release: 2, amp: amp_clortho, 39 | pan: [-0.2,0,0.2].choose 40 | play :a4 41 | sleep 8 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /Live_Coding/Parallel Paths: -------------------------------------------------------------------------------- 1 | #Live Coding Session 18.07.2017 2 | #Coded by Davids Fiddle 3 | 4 | use_random_seed 3000 5 | use_bpm 100 6 | 7 | live_loop :bass do 8 | use_synth :subpulse 9 | use_synth_defaults sustain: 1.5, 10 | release: 0.75, amp: 1 11 | play (ring :d3, :a2, :bb2, :c3).tick 12 | sleep 2 13 | end 14 | 15 | sync :bass 16 | live_loop :pad do 17 | use_synth :fm 18 | use_synth_defaults sustain: 2, release: 0.5 19 | play (ring :d3, :a2, :bb2, :c3).tick, amp: 1.5 20 | sleep 2 21 | end 22 | 23 | with_fx :echo do 24 | live_loop :kik do 25 | sample :drum_bass_hard 26 | sleep 2 27 | end 28 | end 29 | 30 | sync :kik 31 | with_fx :reverb do 32 | live_loop :melody do 33 | use_synth :chiplead 34 | play (scale :d3, :minor, num_octaves: 2).choose 35 | sleep (knit 0.25,2,0.5,5,0.75,2,1,4,1.5,1) 36 | end 37 | end 38 | 39 | sync :kik 40 | with_fx :reverb do 41 | live_loop :melody2 do 42 | use_synth :chiplead 43 | use_synth_defaults amp: 0.5 44 | play (scale :d3, :minor_pentatonic, num_octaves: 2).choose 45 | sleep (knit 0.5,5,1,4,1.5,1) 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /Live_Coding/Electric Tears: -------------------------------------------------------------------------------- 1 | #Electric Tears 2 | #Coded by Davids Fiddle 3 | 4 | use_sample_bpm :loop_electric 5 | with_fx :slicer,mix: 1, pulse_width: 0.75, phase: 0.315, wave: 1, smooth: 0.1 do 6 | live_loop :beat do 7 | with_fx :reverb do 8 | #sample :loop_electric, amp: 2 9 | sleep 1 10 | end 11 | end 12 | end 13 | live_loop :hatz do 14 | use_synth_defaults amp: 0.4, sustain: 0, release: 0.05 15 | #synth :cnoise, cutoff: 100 if one_in(4) 16 | #synth :pnoise, cutoff: 110, decay: 0.01 if one_in(6) 17 | sleep 0.125 18 | end 19 | live_loop :kik do 20 | sync :beat 21 | #sample :bd_haus 22 | end 23 | 24 | with_fx :reverb do 25 | live_loop :pad_high do 26 | sync :beat 27 | tick 28 | use_synth_defaults note: (ring 92,95,92,99).look, 29 | attack: 0.1, sustain: 0.5, amp: 0.3 30 | #synth :dtri 31 | synth :dsaw 32 | end 33 | 34 | live_loop :bass do 35 | sync :beat 36 | use_synth_defaults amp: 0.5, sustain: 0, release: 0.4 37 | 2.times do 38 | #synth :dsaw, note: 44 39 | #synth :dsaw, note: 32 40 | sleep 0.25 41 | end 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /Live_Coding/Emphasis: -------------------------------------------------------------------------------- 1 | #Emphasis - Pi Jam 2 | #Coded by Davids Fiddle 3 | use_bpm 120 4 | 5 | amp_saw = 0.5 6 | amp_echo = 0 7 | 8 | with_fx :reverb do 9 | live_loop :bd do 10 | sample :bd_tek 11 | sleep 1 12 | sample :bd_tek 13 | sample :drum_snare_soft 14 | sleep 1 15 | end 16 | end 17 | 18 | with_fx :reverb do 19 | with_fx :flanger do 20 | with_fx :slicer, phase: 0.5, phase_offset: 0.5, smooth_up: 0.5 do 21 | live_loop :bass do 22 | use_synth :fm 23 | use_synth_defaults divisor: 1 24 | play_pattern_timed [:g2,:d2,:b2,:c3],[8,8,8,8] 25 | end 26 | end 27 | end 28 | end 29 | 30 | live_loop :drum_echo do 31 | sleep 1 32 | with_fx :hpf do 33 | with_fx :echo do 34 | 2.times do 35 | sample :drum_snare_hard, amp: amp_echo 36 | sleep 2 37 | end 38 | end 39 | end 40 | sleep 3 41 | end 42 | 43 | live_loop :fool do 44 | with_fx :lpf do 45 | with_fx :krush do 46 | with_fx :gverb do 47 | use_synth :blade 48 | use_synth_defaults vibrato_depth: 0, attack: 1, 49 | release: 1.5, amp: amp_saw 50 | sleep 4 51 | play (ring :g2,:d2,:b2,:c3).tick 52 | sleep 4 53 | end 54 | end 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /Animat/Nova: -------------------------------------------------------------------------------- 1 | #Nova 2 | #live coded by Davids Fiddle 3 | 4 | use_bpm 120 5 | 6 | live_loop :kik do 7 | sync :bass 8 | sample :bd_haus, 9 | amp: 1 10 | sleep 1 11 | end 12 | 13 | live_loop :bass do 14 | use_synth :tech_saws 15 | tick 16 | play :e3, amp: (ring 2,1,1).look 17 | sleep 0.5 18 | end 19 | 20 | live_loop :bass2 do 21 | use_synth :tech_saws 22 | tick 23 | 12.times do 24 | play :e3, amp: (ring 1,0.5,0.5).look 25 | sleep 0.5 26 | end 27 | 12.times do 28 | play :d4, amp: (ring 1,0.5,0.5).look 29 | sleep 0.5 30 | end 31 | 12.times do 32 | play :c4, amp: (ring 1,0.5,0.5).look 33 | sleep 0.5 34 | end 35 | 12.times do 36 | play :d4, amp: (ring 1,0.5,0.5).look 37 | sleep 0.5 38 | end 39 | end 40 | 41 | live_loop :hat do 42 | sample :drum_cymbal_closed, 43 | rate: (range 0.5,1,0.1).choose, 44 | amp: 0.8 if one_in(2) 45 | sample :drum_cymbal_closed if one_in(4) 46 | sleep 0.25 47 | end 48 | 49 | live_loop :bla do 50 | sync :bass 51 | tick 52 | use_synth :blade 53 | use_synth_defaults sustain: 3, 54 | amp: 0.8 55 | play (ring :e4,:d4,:c4,:b3, 56 | :e4,:d4,:e4,:f4, 57 | :e4,:d4,:c4,:b3, 58 | :e4,:e4,:e4,:e4).look, amp: 0 59 | play :e4, amp: 0 60 | sleep 3 61 | end 62 | -------------------------------------------------------------------------------- /Sound_In Experiments: -------------------------------------------------------------------------------- 1 | #Voice 2 | uncomment do 3 | with_fx :reverb do 4 | live_loop :input0 do 5 | synth :sound_in, sustain: 0.75, attack: 0.25, release: 0.25 6 | sleep 1 7 | end 8 | end 9 | end 10 | 11 | #Simple Organ 12 | comment do 13 | with_fx :reverb do 14 | with_fx :octaver do 15 | live_loop :input0 do 16 | synth :sound_in, sustain: 0.75, attack: 0.25, release: 0.25 17 | sleep 1 18 | end 19 | end 20 | end 21 | end 22 | 23 | #Organ2 24 | comment do 25 | with_fx :gverb do 26 | with_fx :octaver do 27 | live_loop :input0 do 28 | synth :sound_in, sustain: 0.75, attack: 0.25, release: 0.25 29 | sleep 1 30 | end 31 | end 32 | end 33 | end 34 | 35 | #Agressive Organ 36 | comment do 37 | with_fx :krush do 38 | with_fx :octaver do 39 | live_loop :input0 do 40 | synth :sound_in, sustain: 0.75, attack: 0.25, release: 0.25 41 | sleep 1 42 | end 43 | end 44 | end 45 | end 46 | 47 | #Growling Bass 48 | comment do 49 | with_fx :pitch_shift, pitch: -12 do 50 | with_fx :octaver do 51 | live_loop :input0 do 52 | synth :sound_in, sustain: 0.75, attack: 0.25, release: 0.25 53 | sleep 1 54 | end 55 | end 56 | end 57 | end 58 | -------------------------------------------------------------------------------- /Limitation Game/15.0.2018: -------------------------------------------------------------------------------- 1 | #Limitation Game Coding 15.09.2018 2 | #by Davids Fiddle 3 | 4 | flag = false 5 | use_random_seed 42 6 | 7 | uncomment do 8 | 4.times do 9 | sample :drum_roll, rate: (ring 1,0.95,0.9,0.85).tick 10 | sleep 1 11 | end 12 | end 13 | 14 | live_loop :drums do 15 | stop if flag 16 | use_sample_defaults rate: (line -1,1,steps: 21).choose 17 | sample :drum_bass_hard if one_in(2) 18 | sample :drum_splash_soft if one_in(3) 19 | sample :drum_tom_lo_soft if one_in(3) 20 | sleep (line 2,5).choose 21 | end 22 | 23 | use_synth_defaults sustain: 180, note: 55, slide: 1.5, amp: 0 24 | s0 = synth :tri 25 | s1 = synth :tri 26 | s2 = synth :tri 27 | live_loop :notes do 28 | stop if flag 29 | control s0, amp: (line 0.5,1).choose if one_in(2) 30 | control s1, amp: (line 0.5,1).choose if one_in(2) 31 | control s2, amp: (line 0.5,1).choose if one_in(2) 32 | control s0, pan: (line -0.5,0.5).choose if one_in(2) 33 | control s1, pan: (line -0.5,0.5).choose if one_in(2) 34 | control s2, pan: (line -0.5,0.5).choose if one_in(2) 35 | control s0, note: line(50,60, steps: 50).choose if one_in(2) 36 | control s1, note: line(50,60, steps: 50).choose if one_in(2) 37 | control s2, note: line(50,60, steps: 50).choose if one_in(2) 38 | sleep 2 39 | end 40 | 41 | in_thread do 42 | sleep 180 43 | flag = true 44 | end 45 | -------------------------------------------------------------------------------- /Rave Machine: -------------------------------------------------------------------------------- 1 | #Rave Machine 2 | #Coded by Davids Fiddle 3 | #https://youtu.be/j2gPWf3lBCQ 4 | 5 | use_bpm 160 6 | do_hat = 1 7 | do_bass = 0 8 | 9 | live_loop :controller do 10 | tick 11 | #do_hat = (knit 1,64,0,32,1,32).look 12 | #do_bass = (knit 0,32,1,32,0,16,1,48).look 13 | do_hat = 1 14 | do_bass = 1 15 | sleep 1 16 | end 17 | 18 | with_fx :reverb do 19 | with_fx :compressor, relax_time: 0.03, mix: 0.5 do 20 | live_loop :kick do 21 | tick 22 | sample :bd_tek, amp: 2 23 | sleep (ring 1,1,1,0.5,0.5,1,1,1,1, 24 | 1,1,0.75,0.25,0.5,0.5,1,1,1,1 25 | ).look 26 | end 27 | 28 | live_loop :hat, delay: 0.5 do 29 | tick 30 | sample :glitch_perc1 if do_hat == 1 31 | sample :glitch_perc4 if one_in(8) 32 | sleep 1 33 | end 34 | 35 | with_fx :gverb, mix: 0.5 do 36 | with_fx :rlpf, mix: 0.8 do |bpf| 37 | live_loop :bass do 38 | tick 39 | if do_bass == 1 40 | synth :tech_saws, note: (knit :f2,7,:f3,1).look, 41 | pan: (line -0.3,0.3).mirror.look 42 | end 43 | sleep 1 44 | end 45 | live_loop :con do 46 | tick 47 | control bpf, cutoff: (line 50,90, steps: 16).mirror.look 48 | sleep 1 49 | end 50 | end 51 | end 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /Sound_Effects/Morsecode: -------------------------------------------------------------------------------- 1 | n = :a5 2 | 3 | live_loop :morse do 4 | use_bpm 120 5 | play_morse_text "hello world" 6 | sleep 3 7 | end 8 | 9 | 10 | #Play Morsecode 11 | define :play_morse do |letter, note| 12 | l = 0.6 13 | s = 0.2 14 | times = case letter 15 | when 'a' then [s,l] 16 | when 'b' then [l,s,s,s] 17 | when 'c' then [l,s,l,s] 18 | when 'd' then [l,s,s] 19 | when 'e' then [s] 20 | when 'f' then [s,s,l,s] 21 | when 'g' then [s,l,s] 22 | when 'h' then [s,s,s,s] 23 | when 'i' then [s,s] 24 | when 'j' then [s,s,l,l] 25 | when 'k' then [s,s,l] 26 | when 'l' then [s,l,s,s] 27 | when 'm' then [l,l] 28 | when 'n' then [l,s] 29 | when 'o' then [l,l,l] 30 | when 'p' then [s,l,l,s] 31 | when 'q' then [l,l,s,l] 32 | when 'r' then [s,l,s] 33 | when 's' then [s,s,s] 34 | when 't' then [l] 35 | when 'u' then [s,s,l] 36 | when 'v' then [s,s,s,l] 37 | when 'w' then [s,l,l] 38 | when 'x' then [l,s,s,l] 39 | when 'y' then [l,s,l,l] 40 | when 'z' then [l,l,s,s] 41 | end 42 | play_pattern_timed (knit note, times.length),times 43 | sleep 0.2 44 | end 45 | 46 | define :play_morse_text do |text| 47 | use_synth :blade 48 | use_synth_defaults release: 0.2, amp: 2 49 | for x in (range 0,text.length) do 50 | play_morse text[x],n if text[x] != ' ' 51 | sleep 0.6 if text[x] == ' ' 52 | sleep 0.6 53 | end 54 | end 55 | 56 | -------------------------------------------------------------------------------- /Acid Test 2: -------------------------------------------------------------------------------- 1 | #Acid Test 2 2 | #Coded by Davids Fiddle 3 | #https://youtu.be/zv5RYMwf0Is 4 | 5 | use_bpm 138 6 | 7 | live_loop :kick do 8 | sample :bd_haus, amp: 3 9 | sample :bd_boom 10 | sleep 1 11 | end 12 | 13 | with_fx :slicer, slide: 2, mix: 0.8, pulse_width: 0.4 do |slice| #Using a slicer to create hihats from noise 14 | live_loop :hatz do 15 | sync "/live_loop/kick" 16 | synth :noise, sustain: 0.9, release: 0.2, amp: 0.7 17 | end 18 | live_loop :con_slice do 19 | #Some automation for variety 20 | control slice, pulse_width: (line 0.2,0.4).choose #Keep the pulses short for hihats or long for a ride cymbal 21 | control slice, mix: (line 0.7,0.9).choose #Automating the cymbal wash 22 | sleep 4 23 | end 24 | end 25 | 26 | with_fx :distortion, slide: 4 do |dist| 27 | live_loop :bass do 28 | tick 29 | use_synth_defaults amp: 0.7, sustain: 0.1, release: 0.4, res: 0.93 #High resonance, could be automated as well 30 | synth :tb303, note: (knit :d2,14,:d4,1,:d2,1,:d3,1).look, cutoff: (ring :d3,:d4,:d3,:d5,:d4,:d3).look 31 | #Notice that the riff has 17 steps, the cutoff automation has 6. This adds some variation to the bass sound. 32 | sleep (knit 0.5,13,0.25,2,0.5,2).look 33 | end 34 | live_loop :con_dist do 35 | #Some automation for variety 36 | control dist, distortion: (line 0.5,0.9).choose 37 | sleep 4 38 | end 39 | end 40 | 41 | live_loop :sampler do 42 | sample 'glitch_perc', pick, amp: 2, rate: (line 0.5,1.1, steps: 20).choose 43 | sleep 4 44 | end 45 | -------------------------------------------------------------------------------- /Animat/Knife Edge: -------------------------------------------------------------------------------- 1 | #Knife Edge 2 | #Coded by Davids Fiddle 3 | 4 | use_bpm 120 5 | 6 | with_fx :reverb do 7 | live_loop :shaker do 8 | use_synth_defaults amp: 0 9 | synth :noise, sustain: 0, release: 0.1, cutoff: 100 if one_in(2) 10 | synth :noise, sustain: 0, release: 0.25, cutoff: 80 if one_in(4) 11 | sleep 0.25 12 | end 13 | end 14 | 15 | live_loop :cutter, sync: :kik do 16 | use_synth :tech_saws 17 | 4.times do 18 | c = play :d3, sustain: 3.5, 19 | release: 1, note_slide: 0.25, 20 | amp: 0.7 21 | sleep 2 22 | control c, note: :d4 23 | sleep 2 24 | end 25 | 4.times do 26 | c = play :f3, sustain: 3.5, 27 | release: 1, note_slide: 0.25, 28 | amp: 0.7 29 | sleep 2 30 | control c, note: :f4 31 | sleep 2 32 | end 33 | end 34 | 35 | live_loop :melody do 36 | use_synth :prophet 37 | use_synth_defaults sustain: 0.25, amp: 1 38 | play (scale :d4, :mixolydian).choose 39 | sleep (knit 1,1,0.5,12,0.25,12,0.75,8).shuffle.tick 40 | end 41 | 42 | with_fx :compressor do 43 | live_loop :arp, sync: :shaker do 44 | use_synth :chipbass 45 | use_synth_defaults amp: 1 46 | 32.times do 47 | play (ring :d2,:d3,:d4,:a2,:a3,:r).choose 48 | sleep 0.5 49 | end 50 | 32.times do 51 | play (ring :f2,:f3,:f4,:c3,:c4,:r).choose 52 | sleep 0.5 53 | end 54 | end 55 | 56 | live_loop :kik, sync: :shaker do 57 | sample :bd_haus 58 | sample :sn_dolf if (ring 0,1).tick == 1 59 | sleep 0.25 60 | sample :bd_haus if one_in(10) 61 | sleep 0.25 62 | sleep 0.25 63 | sample :bd_haus if one_in(7) 64 | sleep 0.25 65 | end 66 | end 67 | -------------------------------------------------------------------------------- /Drum Maker: -------------------------------------------------------------------------------- 1 | #Drum Maker 2 | #Coded by Davids Fiddle 3 | #v0.8 4 | 5 | 6 | define :cymbal do 7 | source = 4 #Select the noise source. 8 | dec = 0.1 #Decay time 9 | rel = 0.3 #Release time, slightly randomised 10 | res = 0.9 #Resonance of the lpf 11 | cut1 = 120 #Initial pitch of the cutoff 12 | cut2 = 2 #Amount of cutoff fall 13 | fall = 0.2 #Time for the cutoff fall 14 | bounce = 0.3 #Level between decay and release. 15 | with_fx :rlpf,cutoff: cut1, cutoff_slide: fall, res: res do |f0| 16 | synth (ring :noise,:gnoise,:bnoise,:pnoise,:cnoise)[source], 17 | decay: dec, sustain_level: bounce, sustain: 0, release: (line rel,rel * 1.5).choose 18 | control f0, cutoff: cut1 - cut2 19 | end 20 | end 21 | 22 | define :drum do 23 | #Control values: 24 | wave = 1 #Select the wave type 25 | cut = 90 #Cutoff pitch for the lpf. 40-60 for kick, 60-100 for snare & toms. 26 | pitch = 45 #Initial pitch of the drum. 40-60 for all drums. 27 | tension = 4 #Amount of pitch fall. 20-40 for kick, <10 for snare & toms. 28 | fall = 0.05 #Time for the pitch fall. Should be the same as decay. 29 | dec = 0.1 #Decay time 30 | rel = 0.1 #Release time 31 | bounce = 0.8 #Level between decay and release. 32 | wire = 0.8 #0-1, amount of noise. 0 makes it a kick / tom. 33 | with_fx :rlpf, cutoff: cut, res: 0.55 do 34 | synth (ring :sine, :tri, :saw, :square, :fm)[wave], 35 | note: pitch, release: rel, decay: dec, slide: fall, 36 | sustain_level: bounce 37 | control note: pitch - tension 38 | synth :bnoise, release: rel, amp: wire 39 | end 40 | end 41 | 42 | live_loop :test do 43 | tick 44 | drum 45 | sleep 1 46 | cymbal 47 | sleep 1 48 | end 49 | -------------------------------------------------------------------------------- /12-Tone Serialism: -------------------------------------------------------------------------------- 1 | #12-Tone Serialism 2 | #Coded by Davids Fiddle 3 | 4 | source = (note_range :c4, :c5) 5 | 6 | with_random_seed 334567 do 7 | #This block creates the tone row and it's inverse 8 | notes = source.shuffle 9 | s = notes[0] 10 | rnotes = [s] 11 | #Go through the tonerow and invert it 12 | 12.times do 13 | tick 14 | rnotes[look + 1] = notes[look + 1] - (notes[look + 1] - s)*2 15 | end 16 | #play the tone row or some variation 17 | in_thread do 18 | sl = (ring 0.25,0.5,0.75,1).stretch(24).shuffle 19 | use_synth :piano 20 | 8.times do 21 | #Randomly choose what variation to play 22 | i = rand_i(3) 23 | 12.times do 24 | tick 25 | #Original 26 | play notes.look if i == 0 27 | #Reverse 28 | play notes.reverse.look if i == 1 29 | #Inverse 30 | play rnotes.ring.look if i == 2 31 | #Inverse-Reverse 32 | play rnotes.ring.reverse.look if i == 3 33 | sleep sl.look 34 | end 35 | end 36 | end 37 | comment do #uncomment to play second voice 38 | in_thread do 39 | sl = (ring 0.25,0.5,0.75,1).stretch(24).shuffle 40 | use_synth :piano 41 | 8.times do 42 | #Randomly choose what variation to play 43 | i = rand_i(3) 44 | 12.times do 45 | tick 46 | #Original 47 | play notes.look if i == 0 48 | #Reverse 49 | play notes.reverse.look if i == 1 50 | #Inverse 51 | play rnotes.ring.look if i == 2 52 | #Inverse-Reverse 53 | play rnotes.ring.reverse.look if i == 3 54 | sleep sl.look 55 | end 56 | end 57 | end 58 | end 59 | end 60 | -------------------------------------------------------------------------------- /Ambient/Bouncing Plucks: -------------------------------------------------------------------------------- 1 | #Bounce 2 | #Coded by Davids Fiddle 3 | #https://youtu.be/lOIYGDUVXRo 4 | 5 | use_bpm 42 6 | 7 | root = :d3 8 | 9 | s0 = 0.5 10 | s1 = 0.5 11 | s2 = 0.5 12 | s3 = 0.5 13 | s4 = 0.5 14 | s5 = 0.5 15 | s6 = 0.5 16 | s7 = 0.5 17 | 18 | live_loop :con_knob do 19 | key,val = sync "/midi/apc_key_25/0/1/control_change" 20 | s0 = val / 64.0 + 0.5 if key == 48 21 | s1 = val / 64.0 + 0.5 if key == 49 22 | s2 = val / 64.0 + 0.5 if key == 50 23 | s3 = val / 64.0 + 0.5 if key == 51 24 | s4 = val / 64.0 + 0.5 if key == 52 25 | s5 = val / 64.0 + 0.5 if key == 53 26 | s6 = val / 64.0 + 0.5 if key == 54 27 | s7 = val / 64.0 + 0.5 if key == 55 28 | end 29 | 30 | live_loop :con_root do 31 | key,vel = sync "/midi/apc_key_25/0/2/note_on" 32 | root = key 33 | end 34 | 35 | live_loop :bounce0 do 36 | synth :pluck, 37 | note: (chord root,:minor,num_octaves: 3)[0] 38 | sleep s0 39 | end 40 | live_loop :bounce1 do 41 | synth :pluck, 42 | note: (chord root,:minor,num_octaves: 3)[1] 43 | sleep s1 44 | end 45 | live_loop :bounce2 do 46 | synth :pluck, 47 | note: (chord root,:minor,num_octaves: 3)[2] 48 | sleep s2 49 | end 50 | live_loop :bounce3 do 51 | synth :pluck, 52 | note: (chord root,:minor,num_octaves: 3)[3] 53 | sleep s3 54 | end 55 | live_loop :bounce4 do 56 | synth :pluck, 57 | note: (chord root,:minor,num_octaves: 3)[4] 58 | sleep s4 59 | end 60 | live_loop :bounce5 do 61 | synth :pluck, 62 | note: (chord root,:minor,num_octaves: 3)[5] 63 | sleep s5 64 | end 65 | live_loop :bounce6 do 66 | synth :pluck, 67 | note: (chord root,:minor,num_octaves: 3)[6] 68 | sleep s6 69 | end 70 | live_loop :bounce7 do 71 | synth :pluck, 72 | note: (chord root,:minor,num_octaves: 3)[7] 73 | sleep s7 74 | end 75 | -------------------------------------------------------------------------------- /APC light-pad utilities: -------------------------------------------------------------------------------- 1 | #Utilities for light-up pads on APCs 2 | #https://youtu.be/3vBmxArxQVE 3 | 4 | num_keys = 40 #Adapt to your device 5 | 6 | #Clear the pads 7 | live_loop :apc_clear do 8 | key, val = sync '' 9 | if key == 81 10 | for i in (range 0,num_keys) 11 | midi_note_on i,0,channel: 1 12 | end 13 | end 14 | puts "cleared" 15 | end 16 | 17 | #Display 18 | frame = [1,0,3,0,1,0,3,0, 19 | 0,1,3,1,0,1,3,1, 20 | 3,3,1,3,3,3,1,3, 21 | 0,1,3,1,0,1,3,1, 22 | 1,0,3,0,1,0,3,0] 23 | #Set to 1 for green, 3 for red and 5 for yellow 24 | define :apc_display do |frame| 25 | for i in (range 0,num_keys) 26 | midi_note_on i,frame[i],channel: 1 27 | end 28 | puts "displayed frame" 29 | end 30 | 31 | #Cycle frames 32 | frames = [[1,0,0,0,0,0,0,0, 33 | 1,0,0,1,0,0,0,0, 34 | 1,0,0,1,0,0,0,0, 35 | 1,0,0,1,0,0,0,0, 36 | 1,1,1,1,1,1,1,1], 37 | [0,0,1,1,1,1,0,0, 38 | 0,1,0,0,0,0,1,0, 39 | 1,0,0,0,0,0,0,1, 40 | 1,0,0,0,0,0,0,1, 41 | 1,1,1,1,1,1,1,1]] 42 | #Each of these blocks is a frame 43 | comment do 44 | live_loop :apc_frames do 45 | apc_display frames.ring.tick 46 | sleep 1 #Adapt for FPS 47 | end 48 | end 49 | 50 | #Switch value on button press and switch it on/off 51 | button = 64 #Whatever button you want to use 52 | live_loop :listen_b0 do 53 | key, vel = sync "" #After pressing the button, the name should appear in the lower right window 54 | #'the key, vel =' is nessessary because sync returns two values 55 | if key == button #if the button pressed is the one you wanted 56 | var = (ring 0,1).tick 57 | midi_note_on 58 | end 59 | end 60 | 61 | #Randomly switch the pads 62 | comment do 63 | live_loop :rand_pads do 64 | midi_note_on (range 0,num_keys).choose,(ring 0,1,3,5).choose, channel: 1 65 | sleep 0.1 66 | end 67 | end 68 | -------------------------------------------------------------------------------- /Generative/Generator: -------------------------------------------------------------------------------- 1 | #Generator 2 | #More selfmodulating generative music. 3 | #Coded by Davids Fiddle 4 | 5 | use_random_seed 1867548545 6 | root = :d3 7 | type = '9sus4' 8 | synth = :piano 9 | row1 = [*(chord root, type, num_octaves: 2).take(8)] 10 | row2 = row1 11 | row3 = row1 12 | tim1 = [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5] 13 | tim2 = tim1 14 | tim3 = tim1 15 | mod1 = [0,0,0,0,0,0,0,1] 16 | mod2 = mod1 17 | mod3 = mod1 18 | stop_time = rand_i(60)+60 19 | 20 | 21 | use_bpm 90 22 | 23 | live_loop :metronome do 24 | use_synth synth 25 | play root + 24 26 | sleep 1 27 | if vt > stop_time 28 | stop if one_in(5) 29 | end 30 | end 31 | 32 | live_loop :minimal1 do 33 | use_synth synth 34 | tick 35 | play row1.ring.look, amp: 0.5 36 | if mod1.ring.look == 1 37 | if one_in(3) 38 | mod1 = mod1.shuffle 39 | tim1[rand_i(8)] = (ring 0.5,0.25,0.75,1).choose 40 | row1[rand_i(8)] = (chord root, type, num_octaves: 3).choose 41 | puts row1 42 | end 43 | end 44 | sleep tim1.ring.look 45 | if vt > stop_time 46 | stop if one_in(10) 47 | end 48 | end 49 | 50 | live_loop :minimal2 do 51 | use_synth synth 52 | tick 53 | play row2.ring.look, pan: 0.8, amp: 0.5 54 | if mod2.ring.look == 1 55 | if one_in(3) 56 | mod2 = mod1.shuffle 57 | tim2[rand_i(8)] = (ring 0.5,0.25,0.75,1).choose 58 | row2[rand_i(8)] = (chord root, type, num_octaves: 3).choose 59 | puts row2 60 | end 61 | end 62 | sleep tim2.ring.look 63 | if vt > stop_time 64 | stop if one_in(10) 65 | end 66 | end 67 | 68 | live_loop :minimal3 do 69 | use_synth synth 70 | tick 71 | play row3.ring.look, pan: -0.8, amp: 0.5 72 | if mod3.ring.look == 1 73 | if one_in(3) 74 | mod2 = mod1.shuffle 75 | tim3[rand_i(8)] = (ring 0.5,0.25,0.75,1).choose 76 | row3[rand_i(8)] = (chord root, type, num_octaves: 3).choose 77 | puts row3 78 | end 79 | end 80 | sleep tim3.ring.look 81 | if vt > stop_time 82 | stop if one_in(10) 83 | end 84 | end 85 | -------------------------------------------------------------------------------- /Stasis: -------------------------------------------------------------------------------- 1 | #Stasis 2 | #Coded by Davids Fiddle 3 | #https://youtu.be/JOEtaBEBG7M 4 | 5 | c0 = 0 6 | c1 = 0 7 | c2 = 0 8 | c3 = 0 9 | a0 = 0 10 | a1 = 0 11 | a2 = 0 12 | a3 = 0 13 | use_real_time 14 | root = :a3 15 | harm = (chord root, '7sus4', num_octaves: 2) 16 | 17 | use_synth_defaults sustain: 600, note: root, amp: 0 18 | with_fx :reverb do 19 | #Soft 20 | v0 = synth :tri 21 | v1 = synth :sine 22 | #Hard 23 | v2 = synth :blade 24 | v3 = synth :fm 25 | #Harmonic 26 | v4 = synth :tb303 27 | v5 = synth :tech_saws 28 | #Chaotic 29 | v6 = synth :growl 30 | v7 = synth :dark_ambience 31 | 32 | #Synth Control 33 | live_loop :control_knobs do 34 | key,val = sync "/midi/*/*/*/control_change" 35 | if key == 48 36 | a0 = val / 128.0 37 | elsif key == 49 38 | a1 = val / 128.0 39 | elsif key == 50 40 | a2 = val / 128.0 41 | elsif key == 51 42 | a3 = val / 128.0 43 | elsif key == 52 44 | c0 = val / 128.0 45 | elsif key == 53 46 | c1 = val / 128.0 47 | elsif key == 54 48 | c2 = val / 128.0 49 | elsif key == 55 50 | c3 = val / 128.0 51 | end 52 | control v0, amp: a0 * (1 - c0) 53 | control v1, amp: a0 * c0 54 | control v2, amp: a1 * (1 - c1) 55 | control v3, amp: a1 * c1 56 | control v4, amp: a2 * (1 - c2) 57 | control v5, amp: a2 * c2 58 | control v6, amp: a3 * (1 - c3) 59 | control v7, amp: a3 * c3 60 | end 61 | live_loop :control_pads do 62 | key,vel = sync "/midi/apc_key_25/0/1/note_on" 63 | if key <= 40 64 | control v0, note: harm[key / 8] if key % 8 == 0 65 | control v1, note: harm[key / 8] if key % 8 == 1 66 | control v2, note: harm[key / 8] if key % 8 == 2 67 | control v3, note: harm[key / 8] if key % 8 == 3 68 | control v4, note: harm[key / 8] if key % 8 == 4 69 | control v5, note: harm[key / 8] if key % 8 == 5 70 | control v6, note: harm[key / 8] if key % 8 == 6 71 | control v7, note: harm[key / 8] if key % 8 == 7 72 | end 73 | end 74 | end 75 | -------------------------------------------------------------------------------- /Animat/Planetarium: -------------------------------------------------------------------------------- 1 | #Planetarium 2 | #Coded by Davids Fiddle 3 | use_bpm 120 4 | 5 | fade_d3 = (ring 0)#(ramp *(line 0,0.8, steps: 64)) 6 | fade_drone = (ring 0)#(ramp *(line 0,1, steps: 8)) 7 | fade_mel = (ring 0) 8 | fade_mel2 = (ring 0) 9 | 10 | comment do 11 | in_thread do 12 | sleep 64 13 | cue :mel1 14 | fade_mel = (ramp *(line 0,1, steps: 50)) 15 | sleep 16 16 | cue :mel2 17 | fade_mel2 = (ramp *(line 0,0.7, steps: 50)) 18 | end 19 | end 20 | 21 | with_fx :reverb do 22 | live_loop :d3 do 23 | use_synth :tech_saws 24 | use_synth_defaults amp: fade_d3.look, 25 | sustain: 0.2, release: 0.1 26 | play (ring :e4,:r,:e4,:e4).tick 27 | sleep 0.25 28 | end 29 | end 30 | 31 | 32 | 33 | live_loop :hatz do 34 | sample :drum_cymbal_closed, amp: 1, rate: 2 if one_in(2) 35 | sample :drum_cymbal_closed, amp: 1, rate: 1.5 if one_in(3) 36 | sleep 0.25 37 | end 38 | 39 | live_loop :snare do 40 | sleep 1 41 | sample :sn_dolf 42 | sleep 1 43 | end 44 | 45 | with_fx :compressor do 46 | live_loop :drone do 47 | sync :d3 48 | use_synth :tech_saws 49 | use_synth_defaults sustain: 8, 50 | amp: fade_drone.look 51 | play (ring :e3,:d3,:e3,:b2, 52 | :e3,:d3,:c3,:b2, 53 | :e3,:d3,:e3,:b2, 54 | :e3,:d3,:c3,:a2).tick 55 | sleep 8 56 | end 57 | 58 | live_loop :kik do 59 | sample :bd_haus, amp: 2 60 | sleep 0.5 61 | sample :bd_haus, amp: 2 if one_in(10) 62 | sleep 0.25 63 | sample :bd_haus, amp: 2 if one_in(4) 64 | sleep 0.25 65 | end 66 | end 67 | 68 | with_fx :reverb do 69 | sync :mel1 70 | live_loop :melody do 71 | use_synth :prophet 72 | use_synth_defaults amp: fade_mel.tick 73 | play (scale :e4, :minor, num_octaves: 2).choose 74 | sleep (knit 0.25,2,0.5,5,0.75,2,1,1).choose 75 | end 76 | 77 | sync :mel2 78 | live_loop :melody2 do 79 | use_synth :prophet 80 | use_synth_defaults amp: fade_mel2.tick 81 | play (scale :e3, :minor_pentatonic, num_octaves: 1).choose 82 | sleep (knit 0.25,1,0.5,6,0.75,1,1,3).choose 83 | end 84 | end 85 | -------------------------------------------------------------------------------- /Covers/Mission Impossible: -------------------------------------------------------------------------------- 1 | #Mission Impossible 2 | #Coded by Davids Fiddle 3 | 4 | use_bpm 160 5 | amp_bass = 1 6 | amp_hi = 0.5 7 | amp_kick = 1 8 | amp_melody = 1.2 9 | amp_pad = 0.7 10 | 11 | #Bass 12 | in_thread do 13 | use_synth :chiplead 14 | 24.times do 15 | play_pattern_timed [:a2,:a2,:c3,:d3,:a2,:a2,:g2,:gs2], 16 | [1.5,1.5,1,1,1.5,1.5,1,1], 17 | sustain: 0.5, release: 0.5, amp: amp_bass, pan: 0.51 18 | end 19 | end 20 | 21 | define :wash do 22 | 10.times do 23 | play :a3, release: 0.1, attack: 0.05, sustain: 0.1, amp: amp_hi, pan: 0.49 24 | sleep 0.5 25 | end 26 | end 27 | 28 | define :kick do 29 | sample :drum_bass_hard 30 | sleep 1.5 31 | sample :drum_bass_hard 32 | sleep 1.5 33 | sample :drum_bass_hard 34 | sleep 1 35 | sample :drum_bass_hard 36 | sleep 1 37 | end 38 | 39 | #Drums 40 | in_thread do 41 | use_synth :noise 42 | 24.times do 43 | wash 44 | end 45 | 4.times do 46 | kick 47 | end 48 | 16.times do 49 | wash 50 | end 51 | 4.times do 52 | kick 53 | end 54 | end 55 | 56 | define :melody1 do 57 | play_pattern_timed [:c4,:a3,:e3,:c4,:a3,:ds3, 58 | :c4,:a3,:d3,:c3,:d3], 59 | [0.5,0.5,4,0.5,0.5,4, 60 | 0.5,0.5,4,0.5,0.5], 61 | amp: amp_melody 62 | sleep 4 63 | play_pattern_timed [:c3,:a2,:gs3,:c3,:a2,:g3, 64 | :c3,:a2,:fs3,:f3,:e3], 65 | [0.5,0.5,4,0.5,0.5,4, 66 | 0.5,0.5,4,0.5,0.5], 67 | amp: amp_melody 68 | sleep 4 69 | end 70 | 71 | define :melody2 do 72 | play_pattern_timed [:a2,:a2,:c3,:d3,:a2,:a2,:g2,:gs2], 73 | [1.5,1.5,1,1,1.5,1.5,1,1], 74 | sustain: 0.5, release: 0.5,amp: amp_melody 75 | end 76 | 77 | #Melody 78 | in_thread do 79 | sleep 40 80 | use_synth :blade 81 | 2.times do 82 | melody1 83 | end 84 | 2.times do 85 | melody2 86 | end 87 | 2.times do 88 | melody1 89 | end 90 | 2.times do 91 | melody2 92 | end 93 | end 94 | 95 | #Pad 96 | in_thread do 97 | use_synth :fm 98 | sleep 20 99 | play_pattern_timed [:a3,:a2,:a3,:a2],[5,5,5,5], 100 | amp: amp_pad, cutoff: 100 101 | sleep 100 102 | 4.times do 103 | play_pattern_timed [:a3,:a2,:a3,:a2],[5,5,5,5], 104 | amp: amp_pad, cutoff: 100 105 | end 106 | end 107 | -------------------------------------------------------------------------------- /Overhead: -------------------------------------------------------------------------------- 1 | #Overhead 2 | #Coded by Davids Fiddle 3 | #https://youtu.be/Y2tO3_X4IRA 4 | 5 | time = 240 6 | frequency = 50 7 | 8 | 9 | root = frequency 10 | amps = (line 0.05,0.5) 11 | pans = (line -0.8,0.8,steps: 16) 12 | use_synth :sine 13 | use_synth_defaults sustain: time, slide: 2, note_slide: 8, amp: 0.4, attack: 0.2 14 | 15 | with_fx :echo, pre_amp: 0.6 do 16 | with_fx :compressor do 17 | s1 = play hz_to_midi root * 1 18 | s2 = play hz_to_midi root * 2 19 | s3 = play hz_to_midi root * 3 20 | s4 = play hz_to_midi root * 4 21 | s5 = play hz_to_midi root * 5 22 | s6 = play hz_to_midi root * 6 23 | s7 = play hz_to_midi root * 7 24 | s8 = play hz_to_midi root * 8 25 | s9 = play hz_to_midi root * 9 26 | s10 = play hz_to_midi root * 10 27 | s11 = play hz_to_midi root * 11 28 | s12 = play hz_to_midi root * 12 29 | 30 | 31 | live_loop :con do 32 | control s1, amp: amps.choose, pan: pans.choose 33 | control s2, amp: amps.choose, pan: pans.choose 34 | control s3, amp: amps.choose, pan: pans.choose 35 | control s4, amp: amps.choose, pan: pans.choose 36 | control s5, amp: amps.choose, pan: pans.choose 37 | control s6, amp: amps.choose, pan: pans.choose 38 | control s7, amp: amps.choose, pan: pans.choose 39 | control s8, amp: amps.choose, pan: pans.choose 40 | control s9, amp: amps.choose, pan: pans.choose 41 | control s10, amp: amps.choose, pan: pans.choose 42 | control s11, amp: amps.choose, pan: pans.choose 43 | control s12, amp: amps.choose, pan: pans.choose 44 | sleep 2 45 | end 46 | 47 | live_loop :con_root do 48 | root = (range frequency,frequency * 2).choose 49 | control s1, note: (hz_to_midi root * 1) 50 | control s2, note: (hz_to_midi root * 2) 51 | control s3, note: (hz_to_midi root * 3) 52 | control s4, note: (hz_to_midi root * 4) 53 | control s5, note: (hz_to_midi root * 5) 54 | control s6, note: (hz_to_midi root * 6) 55 | control s7, note: (hz_to_midi root * 7) 56 | control s8, note: (hz_to_midi root * 8) 57 | control s9, note: (hz_to_midi root * 9) 58 | control s10, note: (hz_to_midi root * 8) 59 | control s11, note: (hz_to_midi root * 9) 60 | control s12, note: (hz_to_midi root * 9) 61 | sleep 8 62 | end 63 | end 64 | end 65 | -------------------------------------------------------------------------------- /Strawberry Synth/Poly Synth v0.2: -------------------------------------------------------------------------------- 1 | #Polyphonic Synth for the Strawberry Synth project 2 | # 3 | #can play 4 keys at the same time, doesn't accept new keys while 4 are pressed 4 | 5 | 6 | #Voice blocks for 4x polyphony 7 | #Can be extended 8 | live_loop :p0 do 9 | use_real_time 10 | key, vel = sync 'p0_on' #listens to the sync from the distributing loop 11 | v0 = synth :saw, note: key, sustain: 360 #creates the new synth 12 | sync 'p0_off' 13 | kill v0 14 | end 15 | live_loop :p1 do 16 | use_real_time 17 | key, vel = sync 'p1_on' 18 | v0 = synth :saw, note: key, sustain: 360 19 | sync 'p1_off' 20 | kill v0 21 | end 22 | live_loop :p2 do 23 | use_real_time 24 | key, vel = sync 'p2_on' 25 | v0 = synth :saw, note: key, sustain: 360 26 | sync 'p2_off' 27 | kill v0 28 | end 29 | live_loop :p3 do 30 | use_real_time 31 | key, vel = sync 'p3_on' 32 | v0 = synth :saw, note: key, sustain: 360 33 | sync 'p3_off' 34 | kill v0 35 | end 36 | 37 | current = [0,0,0,0] #this list stores the currently played note in the corresponding voice. 0 means the voice is inactive 38 | live_loop :distrib_on, delay: 1 do 39 | #distributing loop for note_on events 40 | #looks up the current list and sends cues to the voice loops 41 | use_real_time 42 | key, vel = sync "/midi/apc_key_25_midi_1/1/2/note_on" 43 | if current[0] == 0 44 | cue 'p0_on', key, vel #sends the cue with the key to play 45 | current[0] = key #updates the current list 46 | elsif current[1] == 0 47 | cue 'p1_on', key, vel 48 | current[1] = key 49 | elsif current[2] == 0 50 | cue 'p2_on', key, vel 51 | current[2] = key 52 | elsif current[3] == 0 53 | cue 'p3_on', key, vel 54 | current[3] = key 55 | end 56 | end 57 | 58 | live_loop :distrib_off do 59 | #listens to note_off events 60 | key, vel = sync "/midi/apc_key_25_midi_1/1/2/note_off" 61 | if current[0] == key 62 | cue 'p0_off' 63 | current[0] = 0 #resets the current list so this voice can be used again 64 | elsif current[1] == key 65 | cue 'p1_off' 66 | current[1] = 0 67 | elsif current[2] == key 68 | cue 'p2_off' 69 | current[2] = 0 70 | elsif current[3] == key 71 | cue 'p3_off' 72 | current[3] = 0 73 | end 74 | end 75 | 76 | 77 | ################ 78 | #To Do: 79 | #real time!!! 80 | #multiple synth calls per voice for more sound options 81 | #preset system 82 | #cleanup, comments 83 | #make it easier to change midi devices 84 | ################ 85 | -------------------------------------------------------------------------------- /Strawberry Synth/Sampler v0.5: -------------------------------------------------------------------------------- 1 | #Sampler for the Strawberry Synth Project 2 | #Coded by Davids Fiddle 3 | #v0.5 4 | 5 | use_debug false 6 | 7 | #Variables 8 | #Adresses of the midi device used for this synth 9 | io_midi_on = "/midi/apc_key_25_midi_1/1/1/note_on" 10 | io_midi_buttons = "/midi/apc_key_25_midi_1/1/1/note_on" 11 | io_button_b0 = 82 12 | io_button_b1 = 83 13 | io_button_b2 = 84 14 | io_button_b3 = 85 15 | io_button_b4 = 86 16 | #Sample banks: 17 | use_bank = 0 18 | #The sample banks 19 | banks = [[], 20 | [], 21 | [], 22 | [], 23 | []] 24 | types = [[0,0,0,0,0,0,0,0, 25 | 0,0,0,0,0,0,0,0, 26 | 0,0,0,0,0,0,0,0, 27 | 0,0,0,0,0,0,0,0, 28 | 0,0,0,0,0,0,0,0,], 29 | [0,0,0,0,0,0,0,0, 30 | 0,0,0,0,0,0,0,0, 31 | 0,0,0,0,0,0,0,0, 32 | 0,0,0,0,0,0,0,0, 33 | 0,0,0,0,0,0,0,0,], 34 | [0,0,0,0,0,0,0,0, 35 | 0,0,0,0,0,0,0,0, 36 | 0,0,0,0,0,0,0,0, 37 | 0,0,0,0,0,0,0,0, 38 | 0,0,0,0,0,0,0,0,], 39 | [0,0,0,0,0,0,0,0, 40 | 0,0,0,0,0,0,0,0, 41 | 0,0,0,0,0,0,0,0, 42 | 0,0,0,0,0,0,0,0, 43 | 0,0,0,0,0,0,0,0,], 44 | [0,0,0,0,0,0,0,0, 45 | 0,0,0,0,0,0,0,0, 46 | 0,0,0,0,0,0,0,0, 47 | 0,0,0,0,0,0,0,0, 48 | 0,0,0,0,0,0,0,0,]] 49 | 50 | #set the button lights 51 | define :light_b do |key| 52 | midi_note_on io_button_b0,0,channel: 1 53 | midi_note_on io_button_b1,0,channel: 1 54 | midi_note_on io_button_b2,0,channel: 1 55 | midi_note_on io_button_b3,0,channel: 1 56 | midi_note_on io_button_b4,0,channel: 1 57 | midi_note_on key, 1,channel: 1 58 | end 59 | 60 | #loop for reading the buttons 61 | live_loop :get_bank do 62 | key, vel = sync io_midi_buttons 63 | if key == io_button_b0 64 | use_bank = 0 65 | light_b, io_button_b0 66 | elsif key == io_button_b1 67 | use_bank = 1 68 | light_b, io_button_b1 69 | elsif key == io_button_b2 70 | use_bank = 2 71 | light_b, io_button_b2 72 | elsif key == io_button_b3 73 | use_bank = 3 74 | light_b, io_button_b3 75 | elsif key == io_button_b4 76 | use_bank = 4 77 | light_b, io_button_b4 78 | end 79 | light_p 80 | end 81 | 82 | #set the lights for the pads 83 | define :light_p do 84 | i = 0 85 | for l in types[use_bank] 86 | midi_note_on i,l,channel: 1 87 | i = i + 1 88 | end 89 | end 90 | 91 | #loop to trigger the samples 92 | live_loop :trigger do 93 | key, vel = sync io_midi_on 94 | sample banks[use_bank][key] 95 | end 96 | -------------------------------------------------------------------------------- /Covers/Concerning Hobbits: -------------------------------------------------------------------------------- 1 | #Concerning Hobbits - Lord of the Rings 2 | #Coded by Davids Fiddle 3 | 4 | use_bpm 84 5 | 6 | w = 4 7 | dh = 3 8 | h = 2 9 | dq = 1.5 10 | q = 1 11 | de = 0.75 12 | e = 0.5 13 | s = 0.25 14 | 15 | #Bass 16 | in_thread do 17 | use_synth :chipbass 18 | use_synth_defaults pan: 0.1 19 | play_pattern_timed [:d2,:r,:a2,:r,:d3,:r,:a2,:r,:d2,:r,:a2,:r,:d3,:r], 20 | [e,e,e,e,e,e,e,e,e,e,e,e,e,dq] 21 | 2.times do 22 | play_pattern_timed [:d3,:d3,:g2,:d3,:a2],[w,w,w,h,h] 23 | end 24 | play_pattern_timed [:d2,:r,:a2,:r,:d3,:r,:a2,:r,:d2,:r,:a2,:r,:d3,:r,:a2,:r], 25 | [e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e] 26 | play_pattern_timed [:d3,:a2,:b2,:d2,:a2,:d2,:g2,:a2,:b2,:b2,:b2,:g2,:d3,:a2,:d3],[w,w,w,h,h,w,h,h,w,w,w,w,h,h,w] 27 | end 28 | 29 | #Cbl 30 | define :arp do |root, type| 31 | 4.times do 32 | play (chord root, type).tick 33 | sleep e 34 | end 35 | end 36 | 37 | in_thread do 38 | with_fx :reverb do 39 | use_synth :pluck 40 | use_synth_defaults amp: 1.4 41 | sleep 12*w 42 | arp :d3, :major 43 | arp :d3, :major 44 | arp :a3, :major 45 | arp :a3, :major 46 | arp :b3, :minor 47 | arp :b3, :minor 48 | arp :d3, :major 49 | arp :a3, :major 50 | arp :d3, :major 51 | arp :d3, :major 52 | arp :g3, :major 53 | arp :a3, :major 54 | arp :b3, :minor 55 | arp :b3, :minor 56 | arp :b3, :minor 57 | arp :b3, :minor 58 | arp :b3, :minor 59 | arp :b3, :minor 60 | arp :g3, :major 61 | arp :g3, :major 62 | arp :d3, :major 63 | arp :a3, :major 64 | end 65 | end 66 | 67 | #Flute 68 | in_thread do 69 | use_synth :chiplead 70 | use_synth_defaults pan: 0.2, amp: 0.8 71 | play_pattern_timed [:r,:r,:r,:d4,:e4,:fs4,:a4,:fs4,:e4,:d4,:e4,:d4,:fs4,:a4,:b4,:d5,:cs5,:a4,:fs4,:g4,:fs4,:e4,:d4,:e4,:fs4,:a4,:fs4,:e4,:d4,:e4,:d4,:fs4,:a4,:b4,:a4,:fs4,:a4,:fs4,:e4,:d4,:r,:r], 72 | [w,h,dq,s,s,q,q,e,e,de,s,dh,e,e,q,q,q,q,dq,s,s,dq,s,s,q,q,e,e,de,s,dh,e,e,dq,e,q,q,h,h,q,dh] 73 | sleep 6*w 74 | play_pattern_timed [:b3,:r,:b3,:cs4,:d4,:d4,:e4,:fs4], 75 | [dh,q,s,s,dh,s,s,dh], amp: 0.7 76 | end 77 | 78 | #Lead 79 | in_thread do 80 | use_synth :blade 81 | use_synth_defaults pan: -0.2, amp: 0.9 82 | sleep 2*w 83 | 2.times do 84 | play_pattern_timed [:d3,:d3,:g2,:d3,:a2],[w,w,w,h,h] 85 | end 86 | sleep 2*w 87 | use_synth_defaults amp: 1.5 88 | play_pattern_timed [:d4,:e4,:fs4,:r,:fs4,:r,:fs4,:a4,:e4,:d4,:e4,:r,:a3,:b3,:cs4,:r,:cs4,:r,:d4,:r,:b3,:fs3,:r,:a3,:e3,:r], 89 | [s,s,e,e,e,dq,e,e,e,e,e,h,s,s,e,e,e,e,e,e,e,e,q,e,e,dq] 90 | play_pattern_timed [:d4,:e4,:fs4,:r,:fs4,:r,:a4,:fs4,:e4,:r,:d4,:e4,:cs4,:r,:d4,:cs4], 91 | [s,s,e,e,e,dq,e,e,e,e,e,e,e,e,s,s] 92 | play_pattern_timed [:b3,:r,:b3,:cs4,:d4,:d4,:e4,:fs4], 93 | [dh,q,s,s,dh,s,s,dh] 94 | play_pattern_timed [:r,:b4,:cs5,:d5,:cs5,:a4,:fs4,:e4,:d4], 95 | [e,s,s,h,q,q,h,h,w] 96 | end 97 | -------------------------------------------------------------------------------- /Generative/Chaos Theory: -------------------------------------------------------------------------------- 1 | #Chaos Theory 2 | #Coded by Davids Fiddle 3 | 4 | bpm = 60 5 | use_random_seed 123 6 | list_i = synth_names 7 | list_s = scale_names 8 | stop_time = rand_i(60)+60 9 | f0 = 1 10 | f1 = 1 11 | f2 = 1 12 | 13 | n0 = 60 14 | s0 = :major 15 | r0 = 60 16 | o0 = 1 17 | i0 = :saw 18 | a0 = 0.8 19 | 20 | n1 = 60 21 | s1 = :major 22 | r1 = 60 23 | o1 = 1 24 | i1 = :saw 25 | a1 = 1 26 | 27 | n2 = 60 28 | s2 = :major 29 | r2 = 60 30 | o2 = 1 31 | i2 = :saw 32 | a2 = 1.2 33 | 34 | live_loop :clock do 35 | with_bpm bpm do 36 | tick 37 | cue 'c',look 38 | sleep 0.25 39 | end 40 | stop if f0+f1+f2 == 0 41 | end 42 | 43 | live_loop :mod do 44 | sync "/cue/c" 45 | #Modulate the synths used 46 | if one_in(n0) 47 | i1 = list_i.choose 48 | end 49 | if one_in(n1) 50 | i2 = list_i.choose 51 | end 52 | if one_in(n1) 53 | i0 = list_i.choose 54 | end 55 | #Modulate the range 56 | if one_in(o2) 57 | o0 = (ring 1,2,3)[o1] 58 | r0 = (range 12,80).choose 59 | end 60 | if one_in(o0) 61 | o1 = (ring 1,2,3)[o2] 62 | r1 = (range 12,80).choose 63 | end 64 | if one_in(o1) 65 | o2 = (ring 1,2,3)[o0] 66 | r2 = (range 12,80).choose 67 | end 68 | #Modulate the scales 69 | if one_in(n0) 70 | s1 = list_s.choose 71 | end 72 | if one_in(n1) 73 | s2 = list_s.choose 74 | end 75 | if one_in(n2) 76 | s0 = list_s.choose 77 | end 78 | #Modulate the volume 79 | if one_in(o2) 80 | a0 = a1 / a0 81 | end 82 | if one_in(o0) 83 | a0 = a2 / a1 84 | end 85 | if one_in(o1) 86 | a0 = a0 / a2 87 | end 88 | #Modulate the speed 89 | if one_in(r0 / 2) 90 | bpm = bpm * (range 1,2,step: 0.05).choose 91 | end 92 | if one_in(r1 / 2) 93 | bpm = bpm * (range 0.5,1,step: 0.05).choose 94 | end 95 | if one_in(r2 / 2) 96 | bpm = (range 10,240,step: 2).choose 97 | end 98 | end 99 | 100 | live_loop :v0 do 101 | sync "/cue/c" 102 | sleep (ring 0,0.125,0.25)[o1] 103 | use_synth i0 104 | use_synth_defaults amp: a0, cutoff: r1 105 | n0 = (ring *(scale r0,s0,num_octaves: o0),:r,:r).choose 106 | play n0 107 | if vt > stop_time 108 | f0 = 0 109 | stop if one_in(10) 110 | end 111 | end 112 | live_loop :v1 do 113 | sync "/cue/c" 114 | sleep (ring 0,0.125,0.25)[o2] 115 | use_synth i1 116 | use_synth_defaults amp: a1, cutoff: r2 117 | n1 = (ring *(scale r1,s1,num_octaves: o1),:r,:r).choose 118 | play n1 119 | if vt > stop_time 120 | f1 = 0 121 | stop if one_in(10) 122 | end 123 | end 124 | live_loop :v2 do 125 | sync "/cue/c" 126 | sleep (ring 0,0.125,0.25)[o0] 127 | use_synth i2 128 | use_synth_defaults amp: a2, cutoff: r0 129 | n2 = (ring *(scale r2,s2,num_octaves: o2),:r,:r).choose 130 | play n2 131 | if vt > stop_time 132 | f2 = 0 133 | stop if one_in(10) 134 | end 135 | end 136 | -------------------------------------------------------------------------------- /APC/SP-APC_Utility_1.3: -------------------------------------------------------------------------------- 1 | #APC Utility 2 | #by Davids Fiddle 3 | #v1.3 4 | 5 | 6 | #APC Utility BEGIN 7 | #Globals: 8 | use_sched_ahead_time 0.2 #Balance between playability and stability 9 | controller_device = 'apc_key_25' #Port of the controller device. Must be specified to ensure SP sends the light messages only to the controller device and not to other connected midi devices. 10 | midi_delay = 0.22 #Timing adjustment for MIDI-Synths 11 | loop_delay = 0.1 12 | #States of the tracks: 13 | states = [0,0,0,0,0,0,0,0, 14 | 0,0,0,0,0,0,0,0, 15 | 0,0,0,0,0,0,0,0, 16 | 0,0,0,0,0,0,0,0, 17 | 0,0,0,0,0,0,0,0 18 | ] 19 | #This list represents the pad matrix. If your controller has more pads, you'll have to extend it to use the other pads. 20 | num_pads = 40 #number of pads. Adapt to your device. 21 | #0 means nothing will happen (disabled) 22 | #1 means green (active) 23 | #3 means red (inactive) 24 | #5 means toggle off (yellow), will switch to 7(also green) 25 | #7 means toggle off (green), will switch to 5(yellow) 26 | toggle = (ring 0,3,0,1,0,7,0,5) #For switching the lights 27 | #MIDI-CC: 28 | knob_adr = [48,49,50,51,52,53,54,55] #Adresses for the knobs 29 | knob0 = 0 #Values of the knobs 30 | knob1 = 0 31 | knob2 = 0 32 | knob3 = 0 33 | knob4 = 0 34 | knob5 = 0 35 | knob6 = 0 36 | knob7 = 0 37 | define :all_lights do 38 | #Updates all lights 39 | use_midi_defaults port: controller_device 40 | for x in (range 0,num_pads) 41 | midi_note_on x, states[x] 42 | end 43 | end #:all_lights 44 | define :all_off do 45 | #Turns all lights off 46 | use_midi_defaults port: controller_device 47 | for i in (range 0,num_pads) 48 | midi_note_on i,0 49 | end 50 | end #:all_off 51 | all_off 52 | sleep 0.1 53 | live_loop :midi_control do 54 | key,vel = sync "/midi/apc_key_25/0/1/note_on" #Wait for midi messages 55 | if key < num_pads #Ignore messages 'out of bounds' 56 | states[key] = toggle[states[key]] #Update the track values 57 | midi_note_on key, states[key] #Update the track lights 58 | cue 'event', key #Disabled for performance, enable if you need it. 59 | end 60 | end #:midi_control 61 | live_loop :midi_cc do 62 | key,val = sync "/midi/apc_key_25/0/1/control_change" #Wait for midi messages 63 | case key 64 | when knob_adr[0] 65 | cue 'knob0', val 66 | knob0 = val 67 | when knob_adr[1] 68 | cue 'knob1', val 69 | knob1 = val 70 | when knob_adr[2] 71 | cue 'knob2', val 72 | knob2 = val 73 | when knob_adr[3] 74 | cue 'knob3', val 75 | knob3 = val 76 | when knob_adr[4] 77 | cue 'knob4', val 78 | knob4 = val 79 | when knob_adr[5] 80 | cue 'knob5', val 81 | knob5 = val 82 | when knob_adr[6] 83 | cue 'knob6', val 84 | knob6 = val 85 | when knob_adr[7] 86 | cue 'knob7', val 87 | knob7 = val 88 | end 89 | #Cues are sent per knob to avoid multiple listening loops syncing possibly 100 times in a second 90 | end #:midi_cc 91 | all_lights #initialise the lights 92 | use_bpm 60 #BPM for the piece 93 | sleep 0.1 94 | #APC_Utility END 95 | -------------------------------------------------------------------------------- /DF-xx/Euclidian Rhythm Sonic Pi: -------------------------------------------------------------------------------- 1 | #Euclidian Rhythm Mk3 2 | #Coded by Davids Fiddle 3 | #v1.0 4 | 5 | #To Do: 6 | 7 | #Globals: 8 | b = 0 #Sample bank index 9 | banks = [[:drum_bass_hard,:drum_snare_hard,:drum_tom_mid_hard,:drum_cymbal_closed,:drum_cymbal_open], 10 | [:drum_heavy_kick,:drum_snare_hard,:drum_tom_mid_hard,:drum_cymbal_closed,:drum_cymbal_open], 11 | [:elec_soft_kick,:elec_mid_snare,:elec_fuzz_tom,:drum_cymbal_closed,:elec_cymbal], 12 | [:bd_haus,:sn_dolf,:perc_snap2,:drum_cymbal_soft,:drum_cymbal_hard], 13 | [:bd_haus,:sn_dolf,:drum_tom_mid_hard,:drum_cymbal_closed,:drum_cymbal_open], 14 | [:bd_klub,:sn_zome,:perc_snap,:drum_cymbal_closed,:drum_cymbal_open]] 15 | #Run on startup: 16 | defonce :init do #Setting the initial values, needs changing 17 | set '/osc/er_x0', [2] 18 | set '/osc/er_y0', [8] 19 | set '/osc/er_z0', [0] 20 | set '/osc/er_r0', [1] 21 | set '/osc/er_x1', [2] 22 | set '/osc/er_y1', [8] 23 | set '/osc/er_z1', [2] 24 | set '/osc/er_r1', [1] 25 | set '/osc/er_x2', [0] 26 | set '/osc/er_y2', [8] 27 | set '/osc/er_z2', [0] 28 | set '/osc/er_r2', [1] 29 | set '/osc/er_x3', [0] 30 | set '/osc/er_y3', [8] 31 | set '/osc/er_z3', [0] 32 | set '/osc/er_r3', [1] 33 | set '/osc/er_x4', [0] 34 | set '/osc/er_y4', [8] 35 | set '/osc/er_z4', [0] 36 | set '/osc/er_r4', [1] 37 | set '/osc/er_bpm', [60] 38 | set '/osc/er_bank', [0] 39 | end 40 | 41 | live_loop :banks do 42 | b = (sync '/osc/er_bank')[0] #Load the current sample bank 43 | end 44 | 45 | with_fx :level do |amp| #Master Volume 46 | with_fx :reverb do |verb| #Reverb effect, the mix can be controlled 47 | with_fx :lpf, cutoff: 130 do |lpf| #Lowpass effect, the cutoff can be controlled 48 | live_loop :euler do 49 | tick #One tick at the start of the loop to avoid confusion 50 | cue '/osc/er_clock', look #Cue for additional code 51 | sample banks[b][0], rate: (get '/osc/er_r0')[0] if (spread (get '/osc/er_x0')[0] ,(get '/osc/er_y0')[0] )[look - (get '/osc/er_z0')[0] ] 52 | sample banks[b][1], rate: (get '/osc/er_r1')[0] if (spread (get '/osc/er_x1')[0] ,(get '/osc/er_y1')[0] )[look - (get '/osc/er_z1')[0] ] 53 | sample banks[b][2], rate: (get '/osc/er_r2')[0] if (spread (get '/osc/er_x2')[0] ,(get '/osc/er_y2')[0] )[look - (get '/osc/er_z2')[0] ] 54 | sample banks[b][3], rate: (get '/osc/er_r3')[0] if (spread (get '/osc/er_x3')[0] ,(get '/osc/er_y3')[0] )[look - (get '/osc/er_z3')[0] ] 55 | sample banks[b][4], rate: (get '/osc/er_r4')[0] if (spread (get '/osc/er_x4')[0] ,(get '/osc/er_y4')[0] )[look - (get '/osc/er_z4')[0] ] 56 | with_bpm (get '/osc/er_bpm')[0] do 57 | sleep 0.25 #Sleep for an eighth note at the current bpm 58 | end #:euler 59 | end 60 | #Loops to control the effects 61 | live_loop :get_cut do 62 | control lpf, cutoff: (sync '/osc/er_cut')[0] 63 | end #:get_cut 64 | end #:lpf 65 | live_loop :get_verb do 66 | control verb, mix: (sync '/osc/er_verb')[0] 67 | end #:get_verb 68 | end #:reverb 69 | live_loop :get_amp do 70 | control amp, amp: (sync '/osc/er_amp')[0] 71 | end #:get_amp 72 | end #:level 73 | #EOF 74 | -------------------------------------------------------------------------------- /Drums/Drum Machine: -------------------------------------------------------------------------------- 1 | #Drum Machine 2 | #Coded by Davids Fiddle 3 | 4 | #How to use: 5 | #amp_x sets the volume of the piece, use 0 to turn the piece off 6 | #also keep the values under 5 to avoid compression and clipping 7 | # 8 | #trigger_x is a ring that has 1 for 'hit' and 0 for 'dont' 9 | #2 is used for 'soft' hits, except for the hihat 10 | # 11 | #unit_x controls the note length 12 | 13 | #This is Measures / Minute, not Beats 14 | use_bpm 25 # 4/4 with 120BPM => a value of 30 15 | 16 | whole = 1 17 | dotted_half = 0.75 18 | half = 0.5 19 | dotted_quarter = 0.375 20 | quarter = 0.25 21 | eighth = 0.125 22 | sixteenth = 0.0625 23 | 24 | 25 | #Controls the metronome 26 | amp_blip = 0 27 | unit_blip = quarter 28 | note_blip = :g6 29 | 30 | #Controls the kickdrum 31 | amp_kik = 1 32 | trigger_kik = [1,0,1,0].ring 33 | unit_kik = quarter 34 | 35 | #Controls the snare 36 | amp_snare = 1 37 | trigger_snare = [0,1,0,1].ring 38 | unit_snare = quarter 39 | 40 | #Controls the hihat 41 | amp_hihat = 1.5 42 | trigger_hihat = [5,5,5,5,5,5,5,5].ring 43 | # 1...5 <=> hard, soft, pedal, open, closed 44 | unit_hihat = eighth 45 | 46 | #Controls the low tom 47 | amp_tomlo = 0 48 | trigger_tomlo = [0,0,1,0,0,0,0,0].ring 49 | unit_tomlo = eighth 50 | 51 | #Controls the mid tom 52 | amp_tommid = 0 53 | trigger_tommid = [0,1,0,0].ring 54 | unit_tommid = quarter 55 | 56 | #Controls the hi tom 57 | amp_tomhi = 0 58 | trigger_tomhi = [0,1,0,0,0,0,0,0].ring 59 | unit_tomhi = eighth 60 | 61 | #Code starts here! 62 | live_loop :blip do 63 | play note_blip, attack: 0, decay: 0, sustain: 0, release: 0.125, amp: amp_blip 64 | sleep unit_blip 65 | end 66 | 67 | live_loop :kik do 68 | tick 69 | sample :drum_bass_hard, amp: amp_kik if trigger_kik.look == 1 70 | sample :drum_bass_soft, amp: amp_kik if trigger_kik.look == 2 71 | sleep unit_kik 72 | end 73 | 74 | live_loop :snare do 75 | tick 76 | sample :drum_snare_hard, amp: amp_snare if trigger_snare.look == 1 77 | sample :drum_snare_soft, amp: amp_snare if trigger_snare.look == 2 78 | sleep unit_snare 79 | end 80 | 81 | live_loop :hihat do 82 | tick 83 | sample :drum_cymbal_hard, amp: amp_hihat if trigger_hihat.look == 1 84 | sample :drum_cymbal_soft, amp: amp_hihat if trigger_hihat.look == 2 85 | sample :drum_cymbal_pedal, amp: amp_hihat if trigger_hihat.look == 3 86 | sample :drum_cymbal_open, amp: amp_hihat if trigger_hihat.look == 4 87 | sample :drum_cymbal_closed, amp: amp_hihat if trigger_hihat.look == 5 88 | sleep unit_hihat 89 | end 90 | 91 | live_loop :tomhi do 92 | tick 93 | sample :drum_tom_hi_hard, amp: amp_tomhi if trigger_tomhi.look == 1 94 | sample :drum_tom_hi_soft, amp: amp_tomhi if trigger_tomhi.look == 2 95 | sleep unit_tomhi 96 | end 97 | 98 | live_loop :tomlo do 99 | tick 100 | sample :drum_tom_lo_hard, amp: amp_tomlo if trigger_tomlo.look == 1 101 | sample :drum_tom_lo_soft, amp: amp_tomlo if trigger_tomlo.look == 2 102 | sleep unit_tomlo 103 | end 104 | 105 | 106 | live_loop :tommid do 107 | tick 108 | sample :drum_tom_mid_hard, amp: amp_tommid if trigger_tommid.look == 1 109 | sample :drum_tom_mid_soft, amp: amp_tommid if trigger_tommid.look == 2 110 | sleep unit_tommid 111 | end 112 | -------------------------------------------------------------------------------- /Covers/Song of Storms: -------------------------------------------------------------------------------- 1 | #Legend of Zelda 2 | #Song of Storms 3 | #Coded by Davids Fiddle 4 | 5 | use_bpm 120 6 | 7 | #Melody 8 | melody = [:d4,:f4,:d5,:d4,:f4,:d5,:e5,:f5,:e5,:f5,:e5,:c5,:a4,:a4,:d4,:f4,:g4,:a4,:a4,:d4,:f4,:g4,:e4] 9 | times = [0.5,0.5,2,0.5,0.5,2,1.5,0.5,0.5,0.5,0.5,0.5,2,1,1,0.5,0.5,3,1,1,0.5,0.5,3] 10 | in_thread do 11 | use_synth :chiplead 12 | 2.times do 13 | 2.times do 14 | 15 | sleep 1 16 | play :d4 17 | play :f4 18 | play :a4 19 | sleep 1 20 | play :d4 21 | play :f4 22 | play :a4 23 | sleep 1 24 | 25 | sleep 0.5 26 | play :e4 27 | sleep 0.5 28 | play :g4, release: 1.5 29 | play :b4, release: 1.5 30 | sleep 2 31 | 32 | sleep 1 33 | play :f4 34 | play :a4 35 | play :c5 36 | sleep 1 37 | play :f4 38 | play :a4 39 | play :c5 40 | sleep 1 41 | 42 | sleep 0.5 43 | play :e4 44 | sleep 0.5 45 | play :g4, release: 1.5 46 | play :b4, release: 1.5 47 | sleep 2 48 | 49 | end 50 | 2.times do 51 | play_pattern_timed melody, times 52 | end 53 | end 54 | #ending chord 55 | play :d3, release: 1.5 56 | play :fs3, release: 1.5 57 | play :a3, release: 1.5 58 | play :d4, release: 1.5 59 | play :a4, release: 1.5 60 | end 61 | 62 | 63 | #Harmony 64 | in_thread do 65 | use_synth :chipbass 66 | with_fx :reverb do 67 | 2.times do 68 | 2.times do 69 | play_pattern_timed [:d3, :e3, :f3, :e3], [3,3,3,3] 70 | end 71 | 72 | 2.times do 73 | 74 | play :d3 75 | sleep 1 76 | play :f3 77 | play :a3 78 | sleep 1 79 | play :f3 80 | play :a3 81 | sleep 1 82 | 83 | play :e3 84 | sleep 1 85 | play :g3 86 | play :b3 87 | sleep 1 88 | play :g3 89 | play :b3 90 | sleep 1 91 | 92 | play :f3 93 | sleep 1 94 | play :a3 95 | play :c4 96 | sleep 1 97 | play :a3 98 | play :c4 99 | sleep 1 100 | 101 | play :e3 102 | sleep 1 103 | play :g3 104 | play :b3 105 | sleep 1 106 | play :g3 107 | play :b3 108 | sleep 1 109 | 110 | play :bb2 111 | sleep 1 112 | play :d3 113 | play :f3 114 | sleep 1 115 | play :d3 116 | play :f3 117 | sleep 1 118 | 119 | play :f2 120 | sleep 1 121 | play :a2 122 | play :c3 123 | sleep 1 124 | play :a2 125 | play :c3 126 | sleep 1 127 | 128 | play :bb2 129 | sleep 1 130 | play :d3 131 | play :f3 132 | sleep 1 133 | play :d3 134 | play :f3 135 | sleep 1 136 | 137 | play :a2 138 | sleep 1 139 | play :db3 140 | play :e3 141 | sleep 1 142 | play :db3 143 | play :e3 144 | sleep 1 145 | end 146 | end 147 | end 148 | #ending chord 149 | play :d2, release: 1.5 150 | end 151 | -------------------------------------------------------------------------------- /APC/SP-APC_Utility_1.4: -------------------------------------------------------------------------------- 1 | #APC Utility 2 | #by Davids Fiddle 3 | #v1.4 4 | 5 | #APC Utility BEGIN 6 | #Globals: 7 | use_sched_ahead_time 0.2 #Balance between playability and stability 8 | midi_delay = 0.1 #Timing adjustment for MIDI-Synths 9 | loop_delay = 0 #Timing adjustment for SP-live_loops 10 | #States of the tracks: 11 | states = [0,0,0,0,0,0,0,0, 12 | 0,0,0,0,0,0,0,0, 13 | 0,0,0,1,0,0,0,0, 14 | 0,0,0,0,0,0,0,0, 15 | 0,0,0,0,0,0,0,0 16 | ] 17 | #This list represents the pad matrix. If your controller has more pads, you'll have to extend it to use the other pads. 18 | #0 means nothing will happen (disabled) 19 | #1 means green (active) 20 | #3 means red (inactive) 21 | #5 means toggle off (yellow), will switch to 7(also green) 22 | #7 means toggle off (green), will switch to 5(yellow) 23 | toggle = (ring 0,3,0,1,0,7,0,5) #For switching the lights 24 | #MIDI-CC: 25 | knob_adr = [48,49,50,51,52,53,54,55] #Adresses for the knobs 26 | knob0 = 0 #Values of the knobs 27 | knob1 = 0 28 | knob2 = 0 29 | knob3 = 0 30 | knob4 = 0 31 | knob5 = 0 32 | knob6 = 0 33 | knob7 = 0 34 | #These two functions handle the light pads on the APC. Change the port and channel to work with your device. 35 | num_pads = 40 #number of pads. Adapt to your device. 36 | define :all_lights do 37 | #Updates all lights 38 | use_midi_defaults port: 'apc_key_25', channel: 1 39 | for x in (range 0,num_pads) 40 | midi_note_on x, states[x] 41 | end 42 | end #:all_lights 43 | define :all_off do 44 | #Turns all lights off 45 | use_midi_defaults port: 'apc_key_25', channel: 1 46 | for i in (range 0,num_pads) 47 | midi_note_on i,0 48 | end 49 | end #:all_off 50 | all_off 51 | sleep 0.1 52 | live_loop :midi_control do 53 | key,vel = sync "/midi:apc_key_25:0:1/note_on" #Wait for midi messages 54 | if key < num_pads #Ignore messages 'out of bounds' 55 | states[key] = toggle[states[key]] #Update the track values 56 | midi_note_on key, states[key] #Update the track lights 57 | cue 'event', key #Disabled for performance, enable if you need it. 58 | end 59 | end #:midi_control 60 | live_loop :midi_cc do 61 | key,val = sync "/midi:apc_key_25:0:1/control_change" #Wait for midi messages 62 | case key 63 | when knob_adr[0] 64 | cue 'knob0', val 65 | knob0 = val 66 | when knob_adr[1] 67 | cue 'knob1', val 68 | knob1 = val 69 | when knob_adr[2] 70 | cue 'knob2', val 71 | knob2 = val 72 | when knob_adr[3] 73 | cue 'knob3', val 74 | knob3 = val 75 | when knob_adr[4] 76 | cue 'knob4', val 77 | knob4 = val 78 | when knob_adr[5] 79 | cue 'knob5', val 80 | knob5 = val 81 | when knob_adr[6] 82 | cue 'knob6', val 83 | knob6 = val 84 | when knob_adr[7] 85 | cue 'knob7', val 86 | knob7 = val 87 | end 88 | #Cues are sent per knob to avoid multiple listening loops syncing possibly 128 times in a short time 89 | end #:midi_cc 90 | all_lights #initialise the lights 91 | use_bpm 60 #BPM for the piece 92 | sleep 0.1 93 | #APC_Utility END 94 | 95 | 96 | #Example for an 'internal' loop: 97 | live_loop :loop_example, delay: rt(loop_delay) do 98 | #Do stuff 99 | sleep 1 100 | end 101 | #Example for a MIDI loop: 102 | live_loop :midi_example, delay: rt(midi_delay) do 103 | #Do stuff 104 | sleep 1 105 | end 106 | #rt(delay) so the delay is independant from the BPM 107 | -------------------------------------------------------------------------------- /Covers/James Bond Theme: -------------------------------------------------------------------------------- 1 | #James Bond Theme 2 | #Coded by Davids Fiddle 3 | 4 | 5 | #220 BPM 6 | use_bpm 220 7 | 8 | w = 4 9 | dh = 3 10 | h = 2 11 | dq = 1.5 12 | q = 1 13 | e = 0.5 14 | 15 | #Drums 16 | in_thread do 17 | 48.times do 18 | sleep h 19 | sample :drum_cymbal_closed 20 | sleep h 21 | end 22 | 2.times do 23 | sample :drum_cymbal_closed 24 | sleep dq 25 | sample :drum_cymbal_closed 26 | sleep h 27 | sample :drum_bass_hard 28 | sleep e+h 29 | end 30 | 2.times do 31 | sample :drum_cymbal_closed 32 | sleep dq 33 | end 34 | sample :drum_cymbal_closed 35 | sleep q 36 | 40.times do 37 | sleep 2 38 | sample :drum_cymbal_closed 39 | sleep 2 40 | end 41 | 2.times do 42 | sample :drum_cymbal_closed 43 | sleep dq 44 | sample :drum_cymbal_closed 45 | sleep h 46 | sample :drum_bass_hard 47 | sleep e+h 48 | end 49 | 2.times do 50 | sample :drum_cymbal_closed 51 | sleep dq 52 | end 53 | sample :drum_cymbal_closed 54 | sleep q 55 | end 56 | 57 | 58 | #Bass 59 | in_thread do 60 | use_synth :blade 61 | use_synth_defaults amp: 0.8 62 | 12.times do 63 | play_pattern_timed [:b2,:b2,:c3,:c3,:cs3,:cs3,:c3,:c3],[dh,q,dh,q,dh,q,dh,q], release: 0.1 64 | end 65 | play_pattern_timed [:b2,:b2,:r,:b3,:r,:b2,:b2,:r,:b3,:r,:b2,:b2,:r],[dq,dq,e,h,e,dq,dq,e,h,e,dq,dq,q], release: 0.1 66 | 10.times do 67 | play_pattern_timed [:b2,:b2,:c3,:c3,:cs3,:cs3,:c3,:c3],[dh,q,dh,q,dh,q,dh,q], release: 0.1 68 | end 69 | play_pattern_timed [:b2,:b2,:r,:b3,:r,:b2,:b2,:r,:b3,:r,:b2,:b2,:r],[dq,dq,e,h,e,dq,dq,e,h,e,dq,dq,q], release: 0.1 70 | end 71 | 72 | #Left Hand 73 | in_thread do 74 | use_synth :chipbass 75 | use_synth_defaults pan: 0.2 76 | sleep 8*w 77 | 3.times do 78 | play_pattern_timed [:b2,:c3,:cs3,:c3],[w,w,w,w] 79 | end 80 | sleep 4*w 81 | sleep 24*w 82 | play_pattern_timed [:r,:r,:r,:b2,:r,:r,:r,:r,:b2,:r,:r],[h,q,e,h,e,h,q,e,h,e,w] 83 | sleep 8*w 84 | 3.times do 85 | play_pattern_timed [:b2,:c3,:cs3,:c3],[w,w,w,w] 86 | end 87 | sleep 4*w 88 | 4.times do 89 | play_pattern_timed [:b2,:c3,:cs3,:c3],[w,w,w,w] 90 | end 91 | use_synth :hoover 92 | play_pattern_timed [:r,:r,:r,:b2,:r,:r,:r,:r,:b2,:r,:r],[h,q,e,h,e,h,q,e,h,e,w] 93 | end 94 | 95 | #Right Hand 96 | in_thread do 97 | use_synth :chiplead 98 | use_synth_defaults pam: -0.2, amp: 1.5 99 | sleep 8*w 100 | play_pattern_timed [:e3,:fs3,:fs3,:fs3,:fs3,:e3,:e3,:e3,:e3,:g3,:g3,:g3,:g3,:fs3,:fs3,:fs3],[q,e,e,q,h,q,q,q,q,e,e,q,h,q,q,q] 101 | play_pattern_timed [:e3,:fs3,:fs3,:fs3,:fs3,:e3,:e3,:e3,:e3,:g3,:g3,:g3,:g3,:fs3,:f3,:e3],[q,e,e,q,h,q,q,q,q,e,e,q,h,q,q,q] 102 | play_pattern_timed [:eb4,:d4,:b3,:a3,:b3,:r],[q,dh+h,q,q,w,w] 103 | sleep 4*w 104 | 2.times do 105 | play_pattern_timed [:e3,:g3,:r,:eb4,:d4,:g3,:bb3,:b3,:r,:g3,:fs3,:b2,:e3,:cs3],[q,q,q,q,dh,q,q,dh,dh,h,w,q,q,q+w+w] 106 | end 107 | sleep 8*w 108 | play_pattern_timed [:b3,:b3,:r,:r,:b3,:b3,:r,:r,:b3,:a3,:r,:g3,:fs3,:e3],[dq,dq,q,h,dq,dq,q,h,e,e,e,e,q,q] 109 | sleep 8*w 110 | play_pattern_timed [:e3,:fs3,:fs3,:fs3,:fs3,:e3,:e3,:e3,:e3,:g3,:g3,:g3,:g3,:fs3,:fs3,:fs3],[q,e,e,q,h,q,q,q,q,e,e,q,h,q,q,q] 111 | play_pattern_timed [:e3,:fs3,:fs3,:fs3,:fs3,:e3,:e3,:e3,:e3,:g3,:g3,:g3,:g3,:fs3,:f3,:e3],[q,e,e,q,h,q,q,q,q,e,e,q,h,q,q,q] 112 | play_pattern_timed [:eb4,:d4,:b3,:a3,:b3,:r],[q,dh+h,q,q,w,w] 113 | sleep 4*w 114 | 2.times do 115 | play_pattern_timed [:e3,:g3,:r,:eb4,:d4,:g3,:bb3,:b3,:r,:g3,:fs3,:b2,:e3,:cs3],[q,q,q,q,dh,q,q,dh,dh,h,w,q,q,q+w+w] 116 | end 117 | play_pattern_timed [:b3,:b3,:r,:b3,:b3,:r,:b3,:a3,:r,:g3,:fs3,:e3],[dq,dq,dh,dq,dq,dh,e,e,e,e,q,q] 118 | end 119 | -------------------------------------------------------------------------------- /APC/20200101_Static: -------------------------------------------------------------------------------- 1 | #20200101_Static 2 | #by Davids Fiddle 3 | 4 | 5 | 6 | #APC Utility BEGIN 7 | #Globals: 8 | #use_bpm 80 #BPM for the piece 9 | use_sample_bpm :guit_em9 10 | use_sched_ahead_time 0.2 #Balance between playability and stability 11 | #States of the tracks: 12 | states = [1,0,0,3,1,0,0,0, 13 | 0,0,0,3,1,0,0,0, 14 | 0,0,0,3,1,0,0,0, 15 | 0,0,0,3,0,0,0,0, 16 | 0,0,0,0,0,0,0,0 17 | ] 18 | #0 means nothing will happen (disabled) 19 | #1 means green (active) 20 | #3 means red (inactive) 21 | #5 means toggle off (yellow), will switch to 7(also green) 22 | #7 means toggle off (green), will switch to 5(yellow) 23 | toggle = (ring 0,3,0,1,0,7,0,5) #For switching the lights 24 | knobs = [48,49,50,51,52,53,54,55] #Adresses for the knobs 25 | knob0 = 0 26 | knob1 = 0 27 | knob2 = 0 28 | knob3 = 0 29 | knob4 = 0 30 | knob5 = 0 31 | knob6 = 0 32 | knob7 = 0 33 | define :all_lights do 34 | #Updates all lights 35 | for x in (range 0,40) 36 | midi_note_on x, states[x] 37 | end 38 | end #:all_lights 39 | define :all_off do 40 | #Turns all lights off 41 | for i in (range 0,87) 42 | midi_note_on i,0 43 | end 44 | end #:all_off 45 | all_off 46 | sleep 0.1 47 | live_loop :midi_control do 48 | key,vel = sync "/midi/apc_key_25/0/1/note_on" #Wait for midi messages 49 | if key < 40 #Ignore messages 'out of bounds' 50 | states[key] = toggle[states[key]] #Update the track values 51 | midi_note_on key, states[key] #Update the track lights 52 | cue 'event', key 53 | end 54 | end #:midi_control 55 | live_loop :midi_cc do 56 | key,val = sync "/midi/apc_key_25/0/1/control_change" #Wait for midi messages 57 | case key 58 | when knobs[0] 59 | cue 'knob0', val 60 | knob0 = val 61 | when knobs[1] 62 | cue 'knob1', val 63 | knob1 = val 64 | when knobs[2] 65 | cue 'knob2', val 66 | knob2 = val 67 | when knobs[3] 68 | cue 'knob3', val 69 | knob3 = val 70 | when knobs[4] 71 | cue 'knob4', val 72 | knob4 = val 73 | when knobs[5] 74 | cue 'knob5', val 75 | knob5 = val 76 | when knobs[6] 77 | cue 'knob6', val 78 | knob6 = val 79 | when knobs[7] 80 | cue 'knob7', val 81 | knob7 = val 82 | end 83 | #Cues are sent per knob to avoid multiple listening loops syncing possibly 100 times in a second 84 | end #:midi_cc 85 | all_lights #initialise the lights 86 | sleep 0.1 87 | #APC_Utility END 88 | 89 | 90 | 91 | 92 | s_tape = "F:/Samples/tape deck" 93 | s_work = "F:/Samples/workshop" 94 | 95 | with_fx :reverb, room: 0.8, damp: 0.2 do 96 | with_fx :compressor do 97 | with_fx :flanger, mix: 0.5 do 98 | with_fx :reverb, room: 0.8, damp: 0.4 do 99 | live_loop :percussion do 100 | tick 101 | use_sample_defaults amp: 0.7 102 | sample 'ambi', choose, rate: rrand(-1.5,1.5) if one_in(3) && states[27] == 1 103 | sample 'perc', choose, rate: rrand(-1.5,1.5) if one_in(2) && states[19] == 1 104 | sample s_tape, choose, rate: rrand(-2,2) if one_in(3) && states[3] == 1 105 | sample s_work, choose, onset: choose, rate: rrand(-1.5,1.5) if one_in(3) && states[11] == 1 106 | sleep 0.25 107 | end #:percussion 108 | 109 | live_loop :ambi do 110 | tick 111 | sample :bd_haus, rate: 0.75 if states[0] == 1 112 | sample :guit_em9 if states[4] == 1 113 | sample :guit_em9, rate: (ring 0.5,-0.5).choose if states[12] == 1 114 | sample :guit_e_slide, rate: (ring 1,0.5,0.25,-0.25,-0.5,-1).choose if states[20] == 1 115 | sleep 1 116 | end #:ambi 117 | end #:reverb 118 | end #:flanger 119 | end #:compressor 120 | end #:reverb 121 | -------------------------------------------------------------------------------- /APC/20190922_Time: -------------------------------------------------------------------------------- 1 | #20190922_Time 2 | #by Davids Fiddle 3 | 4 | 5 | #APC Utility BEGIN 6 | #Globals: 7 | use_bpm 60 #BPM for the piece 8 | use_sched_ahead_time 0.2 #Balance between playability and stability 9 | #States of the tracks: 10 | states = [1,0,3,3,0,1,0,0, 11 | 0,3,3,0,0,3,0,0, 12 | 0,3,0,3,0,0,0,0, 13 | 0,0,0,0,0,0,0,0, 14 | 0,0,0,0,0,5,0,0 15 | ] 16 | #0 means nothing will happen (disabled) 17 | #1 means green (active) 18 | #3 means red (inactive) 19 | #5 means toggle, will switch to 7(also green) 20 | toggle = (ring 0,3,0,1,0,7,0,5) #For switching the lights 21 | knobs = [48,49,50,51,52,53,54,55] #Adresses for the knobs 22 | knob0 = 0 23 | knob1 = 0 24 | knob2 = 0 25 | knob3 = 0 26 | knob4 = 0 27 | knob5 = 0 28 | knob6 = 0 29 | knob7 = 0 30 | define :all_lights do 31 | #Updates all lights 32 | for x in (range 0,40) 33 | midi_note_on x, states[x] 34 | end 35 | end #:all_lights 36 | define :all_off do 37 | #Turns all lights off 38 | for i in (range 0,87) 39 | midi_note_on i,0 40 | end 41 | end #:all_off 42 | all_off 43 | sleep 0.1 44 | live_loop :midi_control do 45 | key,vel = sync "/midi/apc_key_25/0/1/note_on" #Wait for midi messages 46 | if key < 40 #Ignore messages 'out of bounds' 47 | states[key] = toggle[states[key]] #Update the track values 48 | midi_note_on key, states[key] #Update the track lights 49 | cue 'event', key 50 | end 51 | end #:midi_control 52 | live_loop :midi_cc do 53 | key,val = sync "/midi/apc_key_25/0/1/control_change" #Wait for midi messages 54 | case key 55 | when knobs[0] 56 | cue 'knob0', val 57 | when knobs[1] 58 | cue 'knob1', val 59 | when knobs[2] 60 | cue 'knob2', val 61 | when knobs[3] 62 | cue 'knob3', val 63 | when knobs[4] 64 | cue 'knob4', val 65 | when knobs[5] 66 | cue 'knob5', val 67 | when knobs[6] 68 | cue 'knob6', val 69 | when knobs[7] 70 | cue 'knob7', val 71 | end 72 | #Cues are sent per knob to avoid multiple listening loops syncing possibly 100 times in a second 73 | end #:midi_cc 74 | all_lights #initialise the lights 75 | sleep 0.1 76 | #APC_Utility END 77 | 78 | 79 | live_loop :tick_tock do 80 | use_synth :fm 81 | use_synth_defaults amp: 0.5, sustain: 0, release: 0.5, divisor: 4, depth: 0.5 82 | play :f5 if states[3] == 1 83 | sleep 1 84 | end #:tick_tock 85 | 86 | with_fx :echo, phase: 1/4.0, decay: 4, mix: 0.5 do 87 | live_loop :snare do 88 | sample :sn_generic, amp: 0.3 if states[9] == 1 89 | sleep 2 90 | end 91 | end 92 | 93 | live_loop :bass do 94 | tick 95 | use_synth_defaults sustain: 3, release: 2, 96 | amp: 0.5 97 | use_merged_synth_defaults note: :f3 + (ring 0).look if states[37] == 5 98 | use_merged_synth_defaults note: :f3 + (ring 0,0,3,-2).stretch(2).look if states[37] == 7 99 | synth :hollow if states[5] == 1 100 | synth :growl if states[13] == 1 101 | sleep 4 102 | end 103 | 104 | live_loop :perc do 105 | tick 106 | use_sample_defaults amp: 0.5 107 | if (bools *(knit 0,4,0,8,0,4,1,4,0,12)).look && (bools 0,1,0,0).look && states[17] == 1 108 | with_fx :slicer, probability: 0.6, prob_pos: 0.3, wave: 0, smooth: 1/8.0, phase: 1/4.0 do 109 | sample :ambi_sauna, rate: 2.0 110 | end 111 | end 112 | sample :perc_bell2, rate: 1/4.0 if (bools 1,0,0,0).look && (bools *(knit 0,8,1,4,0,8,0,16)).look && states[19] == 1 113 | sample :perc_swoosh, rate: -1/2.0 if (bools 1,0,0,0).look && (bools *(knit 0,4,1,4,0,8)).look && states[10] == 1 114 | sample :drum_splash_hard, rate: 1/3.0 if (bools 0,0,1,0).look && (bools *(knit 0,12,1,4,0,16)).look && states[2] == 1 115 | sample :bd_haus, amp: 0.8 if (bools 1,0,0,0,0,0,0,0).look && states[0] == 1 116 | sleep 0.25 117 | end 118 | -------------------------------------------------------------------------------- /Synths/Monophonic Synth 0.9: -------------------------------------------------------------------------------- 1 | #Monophonic Synth 2 | #Coded by Davids Fiddle 3 | #v0.9 4 | 5 | #A monophonic instrument with five synth voices and one noise channel 6 | 7 | #To Do: 8 | #Testing! 9 | #Look for a cool and nerdy name 10 | 11 | #Midi adress to use. 12 | #To specify a device or channel. 13 | midi_on = "/midi/*/*/2/note_on" 14 | midi_off = "/midi/*/*/2/note_off" 15 | #Synth Variables: 16 | #Amplitude of the voices 17 | amp0 = 1 18 | amp1 = 1 19 | amp2 = 1 20 | amp3 = 0.8 21 | amp4 = 0.6 22 | ampn = 0 23 | #Transposition of the voices in semitones, float for fine tuning. 24 | trans0 = 0 25 | trans1 = 0.1 26 | trans2 = 0.2 27 | trans3 = -0.1 28 | trans4 = 0 29 | transn = 12 30 | #Synth sources to use for the voices. Can be any supported synth, including externals. 31 | synth0 = :saw 32 | synth1 = :saw 33 | synth2 = :saw 34 | synth3 = :tri 35 | synth4 = :square 36 | synthn = :noise #Noise channel 37 | #Values for all synth voices 38 | att = 0.1 #Attack time in seconds 39 | dec = 0.2 #Decay time -- || -- 40 | l_sus = 0.7 #Relative amplitude after decay time 41 | pwd = 0.2 #Pulse width for the :pulse synth 42 | res = 0.99 #Resonance for some synths 43 | 44 | #Loops for handling the note_on & note_off events. 45 | #They send an internal message to the synth voice to communicate the key value and if it was a key press or release. 46 | live_loop :on do 47 | key,vel = sync midi_on 48 | cue 'event', 1, key 49 | end #:on 50 | live_loop :off do 51 | key,vel = sync midi_off 52 | cue 'event', 0, key 53 | end #:off 54 | 55 | #Initialising the synth voices 56 | v0 = () 57 | v1 = () 58 | v2 = () 59 | v3 = () 60 | v4 = () 61 | vn = () 62 | with_fx :compressor, mix: 1 do #To avoid clipping. Turn the mix to 0 of you don't want it. 63 | #The main synth loop 64 | live_loop :voice do 65 | #Don't use timing guarantees. 66 | use_real_time 67 | #Listening to the cue coming from the in/out loops 68 | state,key = sync 'event' 69 | #puts state #Debug Option 70 | #State == 1 means a key was pressed. 71 | if state == 1 72 | #puts 'on' #Debug Option 73 | #Kill the playing synth. 74 | #If there isn't one, this step is skipped. 75 | kill v0 76 | kill v1 77 | kill v2 78 | kill v3 79 | kill v4 80 | kill vn 81 | #Look for the last key press and take its note value. 82 | #This counters a timing problem where hitting keys in short intervals lead to 'sticky keys'(the note would keep playing because of a race condition between a sync and the current_note variable.) 83 | note,v = get "/midi/apc_key_25/0/2/note_on" 84 | #Set the values that influence all voices. 85 | use_synth_defaults sustain: 300, sustain_level: l_sus, attack: att, decay: dec, pulse_width: pwd, res: res 86 | #Call the individual voices with a synth source, a transpose value and an amp value 87 | v0 = synth synth0, note: note + trans0, amp: amp0 88 | v1 = synth synth1, note: note + trans1, amp: amp1 89 | v2 = synth synth2, note: note + trans2, amp: amp2 90 | v3 = synth synth3, note: note + trans3, amp: amp3 91 | v4 = synth synth4, note: note + trans4, amp: amp4 92 | vn = synth synthn, cutoff: note + transn, amp: ampn 93 | #Remember the currently played note. Using the timestate for this eliminates a race condition. 94 | set 'current', note 95 | #State == 0 means a key was released. 96 | elsif state == 0 97 | #Read the currently played note from the timestate. 98 | note = get 'current' 99 | #Check if the released key is the current note. 100 | if key == note 101 | #puts 'off' #Debug Option 102 | #Kill the playing synths. 103 | kill v0 104 | kill v1 105 | kill v2 106 | kill v3 107 | kill v4 108 | kill vn 109 | end 110 | end 111 | end #:voice 112 | end #:compressor 113 | -------------------------------------------------------------------------------- /Covers/Love on a real Train: -------------------------------------------------------------------------------- 1 | #Love on a real train 2 | #Cover by Davids Fiddle 3 | 4 | fadeIn1 = (ramp *(line 0,1,steps: 16 * 8)) 5 | fadeIn2 = (ramp *(line 0,1,steps: 16 * 4)) 6 | use_bpm 104 7 | 8 | padSection = true 9 | fin = false 10 | 11 | in_thread do #Control Sections 12 | sleep 128 13 | padSection = false 14 | sleep 64 15 | padSection = true 16 | sleep 64 17 | fin = true 18 | end 19 | 20 | with_fx :reverb, room: 0.4 do 21 | in_thread do #Intro Pad 22 | sample :bass_thick_c, pitch: 5, amp: 1, 23 | window_size: 0.5, rate: 0.5, 24 | time_dis: 0.1, 25 | sustain: sample_duration(:bass_thick_c) * 2 - 2, release: 2 26 | end 27 | 28 | with_fx :ixi_techno, cutoff_min: 90, res: 0.7, phase: 16, mix: 0, slide: 8 do |ixi| 29 | live_loop :riff, delay: 8 do 30 | stop if fin 31 | tick 32 | use_synth :dsaw 33 | use_synth_defaults sustain: 0.2, 34 | release: 0.8, amp: fadeIn1.look * 0.6 35 | play (ring :f4,:r,:eb4,:r,:f4,:r,:c4,:f4,:r,:f4,:r,:eb4,:bb3,:r,:c4,:r).look 36 | sleep 0.25 37 | end 38 | in_thread do #Control Ixi 39 | sleep 64 40 | control ixi, mix: 0.2 41 | 42 | end 43 | end 44 | 45 | with_fx :level, amp: 0, slide: 4 do |padLevel| 46 | live_loop :pad1 do 47 | use_synth :prophet 48 | if padSection 49 | tick 50 | use_synth_defaults attack: 0.1, sustain: 16, release: 1, 51 | cutoff: :f5, res: 0.4 52 | play :f2, amp: 0.7 53 | play :c3, amp: 0.5 54 | play :f4, amp: 0.5 55 | sleep 16 56 | else 57 | use_synth_defaults sustain: 3.5, release: 1, 58 | cutoff: :f5, res: 0.4 59 | 4.times do 60 | tick 61 | play :f2 62 | sleep 4 63 | end 64 | 12.times do 65 | tick 66 | play (ring :cs3,:ds3,:f3,:f3).look 67 | play (ring :as3,:c3,:f3,:f3).look 68 | sleep 4 69 | end 70 | end 71 | end 72 | in_thread do #Control pad amp 73 | control padLevel, amp: 1 74 | sleep 256 75 | control padLevel, amp: 0.75 76 | sleep 4 77 | control padLevel, amp: 0.5 78 | sleep 4 79 | control padLevel, amp: 0.25 80 | sleep 4 81 | control padLevel, amp: 0 82 | end 83 | end 84 | end 85 | 86 | with_fx :reverb, room: 0.6 do 87 | live_loop :plucks1, delay: 32 do 88 | stop if fin 89 | tick 90 | use_merged_synth_defaults amp: fadeIn2.look * (line 0.6,0.8).choose, 91 | coef: (line 0.1,0.3,steps: 24).mirror.look 92 | 4.times do 93 | if(padSection) 94 | synth :pluck, note: :f4 95 | synth :pluck, note: :c5 96 | synth :pluck, note: :f5 97 | end 98 | sleep 0.25 99 | end 100 | end 101 | with_fx :level, amp: 0, slide: 8 do |pl2| 102 | live_loop :plucks2 do 103 | tick 104 | use_synth :pluck 105 | use_synth_defaults coef: 0.2, 106 | amp: 1 107 | play (ring :f4,:g4,:gs4,:bb4,:r,:g4,:gs4,:r).look 108 | play (ring :f4,:g4,:gs4,:bb4,:r,:g4,:gs4,:r).look + 12 109 | sleep 0.5 110 | end 111 | in_thread do #Control Pluck2 112 | sleep 128 113 | control pl2, amp: 1 114 | sleep 64 115 | control pl2, amp: 0 116 | sleep 64 117 | control pl2, amp: 1 118 | sleep 8 119 | control pl2, amp: 0 120 | end 121 | end 122 | end 123 | 124 | live_loop :fanfare, delay: 32 do 125 | stop if fin 126 | s = synth :blade, note: :f3, slide: 0.5, sustain: 1, release: 2 127 | control s, note: (knit :c4,6,:eb4,4,:bb4,1,:f5,3).choose 128 | sleep (ring 16,16,16,24,24,32).choose 129 | end 130 | 131 | live_loop :cymbals, delay: 128 do 132 | stop if fin 133 | tick 134 | on (ring 1,0,1,1).look do 135 | synth :noise, sustain: 0, 136 | release: 0.2 + (line -0.05, 0.05).choose, 137 | amp: (line 0.5,1).choose * 0.6 * fadeIn2.look 138 | end 139 | sleep 0.25 140 | end 141 | -------------------------------------------------------------------------------- /Covers/Midna's Lament: -------------------------------------------------------------------------------- 1 | #Midna's Lament 2 | #Legend Of Zelda: Twilight Princess 3 | #Coded by Davids Fiddle 4 | 5 | dh = 3 6 | h = 2 7 | dq = 1.5 8 | q = 1 9 | e = 0.5 10 | s = 0.25 11 | 12 | use_bpm 120 13 | 14 | #Arpeggio 15 | define :intro do 16 | 3.times do 17 | play_pattern_timed [:d2,:e2,:f2,:a2,:c3,:e3], 18 | [e,e,e,e,e,e,e,e] 19 | end 20 | play_pattern_timed [:g3,:e3,:c3,:a2,:f2,:e2], 21 | [e,e,e,e,e,e,e,e] 22 | end 23 | 24 | define :b5 do 25 | 4.times do 26 | play_pattern_timed [:d2,:e2,:f2,:a2,:c3,:e3], 27 | [e,e,e,e,e,e,e,e] 28 | end 29 | end 30 | 31 | define :b9 do 32 | 4.times do 33 | play_pattern_timed [:d2,:e2,:f2,:a2,:b2,:e3], 34 | [e,e,e,e,e,e,e,e] 35 | end 36 | end 37 | 38 | define :main do 39 | 2.times do 40 | b5 41 | b9 42 | end 43 | end 44 | 45 | define :b21 do 46 | 2.times do 47 | play_pattern_timed [:d2,:e2,:f2,:a2,:c3,:e3], 48 | [e,e,e,e,e,e] 49 | end 50 | end 51 | 52 | define :b23 do 53 | 2.times do 54 | play_pattern_timed [:eb2,:f2,:g2,:bb2,:d3,:f3], 55 | [e,e,e,e,e,e] 56 | end 57 | end 58 | 59 | define :b25 do 60 | 2.times do 61 | play_pattern_timed [:ab1,:c2,:eb2,:g2,:bb2,:d3], 62 | [e,e,e,e,e,e] 63 | end 64 | end 65 | 66 | define :b27 do 67 | 2.times do 68 | play_pattern_timed [:a1,:db2,:e2,:a2,:db3,:e3], 69 | [e,e,e,e,e,e] 70 | end 71 | end 72 | 73 | define :b45 do 74 | 2.times do 75 | play_pattern_timed [:a1,:e2,:f2,:a2,:c3,:e3], 76 | [e,e,e,e,e,e] 77 | end 78 | end 79 | 80 | define :b47 do 81 | 2.times do 82 | play_pattern_timed [:g1,:d2,:e2,:g2,:b2,:c3], 83 | [e,e,e,e,e,e] 84 | end 85 | end 86 | 87 | define :b49 do 88 | 2.times do 89 | play_pattern_timed [:f1,:c2,:d2,:f2,:a2,:c3], 90 | [e,e,e,e,e,e] 91 | end 92 | end 93 | 94 | define :b51 do 95 | 2.times do 96 | play_pattern_timed [:e1,:b1,:c2,:e2,:g2,:b2], 97 | [e,e,e,e,e,e] 98 | end 99 | end 100 | 101 | define :b53 do 102 | 2.times do 103 | play_pattern_timed [:g1,:c2,:d2,:f2,:a2,:c3], 104 | [e,e,e,e,e,e] 105 | end 106 | end 107 | 108 | define :b55 do 109 | 2.times do 110 | play_pattern_timed [:gs1,:c2,:d2,:fs2,:a2,:c3], 111 | [e,e,e,e,e,e] 112 | end 113 | end 114 | 115 | define :b57 do 116 | 2.times do 117 | play_pattern_timed [:a1,:d2,:e2,:g2,:b2,:d3], 118 | [e,e,e,e,e,e] 119 | end 120 | end 121 | 122 | in_thread do 123 | with_fx :reverb, room: 0.7, damp: 0 do 124 | use_synth :piano 125 | use_synth_defaults sustain: s, 126 | amp: 0.8, pan: -0.2 127 | intro 128 | main 129 | b21 130 | b23 131 | b25 132 | b27 133 | main 134 | b45 135 | b47 136 | b49 137 | b51 138 | b53 139 | b55 140 | b57 141 | intro 142 | play :d2 143 | end 144 | end 145 | 146 | 147 | #Lead 148 | define :rMain do 149 | play_pattern_timed [:a3,:f4,:e4,:c4,:b3,:a3,:g3,:b3], 150 | [h,q,h,q,h,e,e,dh] 151 | play_pattern_timed [:r,:d4,:a4,:e4,:d4,:a4,:e4,:r,:r], 152 | [dh,e,e,q,e,e,q,h,dh] 153 | play_pattern_timed [:a3,:f4,:e4,:c4,:b3,:a3,:g3,:b3], 154 | [h,q,h,q,h,e,e,dh] 155 | play_pattern_timed [:r,:r,:f4,:c5,:g4,:f4,:e4,:r,:r], 156 | [dh,q,e,e,e,e,q,h,dh] 157 | end 158 | 159 | in_thread do 160 | with_fx :reverb, room: 0.7 do 161 | use_synth :piano 162 | use_synth_defaults amp: 1.2 163 | sleep 4*3 164 | rMain 165 | play_pattern_timed [:a4,:eb4,:bb4,:a4,:f4], 166 | [dh+dh,dq,dq,dq,dq] 167 | play_pattern_timed [:g4,:f4,:g4,:e4], 168 | [dh+h,e,e,dh+dh] 169 | rMain 170 | use_synth :blade 171 | play_pattern_timed [:c4,:e4,:d4,:g3,:f3,:e4,:d4,:e3,:r], 172 | [h,q,dq,dq,dh+h,q,dq,dq,dh] 173 | use_synth :piano 174 | play_pattern_timed [:r,:g3,:d4,:a3,:g3,:d4,:a3,:r], 175 | [q,e,e,q,e,e,q,q] 176 | use_synth :blade 177 | play_pattern_timed [:r,:g3,:d4,:a3,:r,:r,:a3,:e4,:b3,:a3,:e4,:b3,:r,:r,:c4,:g4,:d4,:c4,:b3], 178 | [q,e,e,q,dh,q,e,e,q,e,e,q,q,q,e,e,e,e,q] 179 | end 180 | end 181 | -------------------------------------------------------------------------------- /APC/20191231_EKG: -------------------------------------------------------------------------------- 1 | #20191231_EKG 2 | #by Davids Fiddle 3 | 4 | 5 | 6 | #APC Utility BEGIN 7 | #Globals: 8 | use_bpm 104 #BPM for the piece 9 | use_sched_ahead_time 0.2 #Balance between playability and stability 10 | #States of the tracks: 11 | states = [3,3,3,0,1,1,0,0, 12 | 0,0,3,0,0,0,0,0, 13 | 0,0,0,0,0,0,0,0, 14 | 1,0,0,0,0,0,0,0, 15 | 0,0,0,0,0,0,0,0 16 | ] 17 | #0 means nothing will happen (disabled) 18 | #1 means green (active) 19 | #3 means red (inactive) 20 | #5 means toggle off (yellow), will switch to 7(also green) 21 | #7 means toggle off (green), will switch to 5(yellow) 22 | toggle = (ring 0,3,0,1,0,7,0,5) #For switching the lights 23 | knobs = [48,49,50,51,52,53,54,55] #Adresses for the knobs 24 | knob0 = 0 25 | knob1 = 0 26 | knob2 = 0 27 | knob3 = 0 28 | knob4 = 0 29 | knob5 = 0 30 | knob6 = 0 31 | knob7 = 0 32 | define :all_lights do 33 | #Updates all lights 34 | for x in (range 0,40) 35 | midi_note_on x, states[x] 36 | end 37 | end #:all_lights 38 | define :all_off do 39 | #Turns all lights off 40 | for i in (range 0,87) 41 | midi_note_on i,0 42 | end 43 | end #:all_off 44 | all_off 45 | sleep 0.1 46 | live_loop :midi_control do 47 | key,vel = sync "/midi/apc_key_25/0/1/note_on" #Wait for midi messages 48 | if key < 40 #Ignore messages 'out of bounds' 49 | states[key] = toggle[states[key]] #Update the track values 50 | midi_note_on key, states[key] #Update the track lights 51 | cue 'event', key 52 | end 53 | end #:midi_control 54 | live_loop :midi_cc do 55 | key,val = sync "/midi/apc_key_25/0/1/control_change" #Wait for midi messages 56 | case key 57 | when knobs[0] 58 | cue 'knob0', val 59 | knob0 = val 60 | when knobs[1] 61 | cue 'knob1', val 62 | knob1 = val 63 | when knobs[2] 64 | cue 'knob2', val 65 | knob2 = val 66 | when knobs[3] 67 | cue 'knob3', val 68 | knob3 = val 69 | when knobs[4] 70 | cue 'knob4', val 71 | knob4 = val 72 | when knobs[5] 73 | cue 'knob5', val 74 | knob5 = val 75 | when knobs[6] 76 | cue 'knob6', val 77 | knob6 = val 78 | when knobs[7] 79 | cue 'knob7', val 80 | knob7 = val 81 | end 82 | #Cues are sent per knob to avoid multiple listening loops syncing possibly 100 times in a second 83 | end #:midi_cc 84 | all_lights #initialise the lights 85 | sleep 0.1 86 | #APC_Utility END 87 | 88 | 89 | 90 | 91 | with_fx :reverb do 92 | with_fx :reverb do 93 | live_loop :beeps do 94 | tick 95 | play 82, sustain: 0, release: 0.3 if states[24] == 1 96 | sleep 2 97 | end #:beeps 98 | end #:reverb 99 | 100 | times_bass = (ring 6,2,8) 101 | live_loop :bass do 102 | tick 103 | use_synth :fm 104 | play (ring :eb3,:f3,:g3).look, amp: 0.8, attack: 0.1, sustain: times_bass.look - 1, release: 1 if states[4] == 1 105 | sleep times_bass.look 106 | end #:bass 107 | 108 | live_loop :chords do 109 | tick 110 | use_synth :hollow 111 | use_synth_defaults sustain: times_bass.look - 1, release: (ring 2,2.5,3).choose, attack: (ring 0,0.1,0.2).choose 112 | if states[5] == 1 113 | play_chord (chord_degree (ring 6,7,1).look, :g3, :minor, (ring 3,4).choose).repeat(2).drop(rand_i(3)).drop_last(rand_i(3)) 114 | play_chord (chord_degree (ring 6,7,1).look, :g4, :minor, (ring 3,4).choose).repeat(2).drop(rand_i(3)).drop_last(rand_i(3)) 115 | end 116 | sleep times_bass.look 117 | end #:chords 118 | 119 | live_loop :drums do 120 | tick 121 | use_sample_defaults amp: 0.7 122 | sample :drum_splash_soft if rand() < (ring 0.05,0,0.05,0,0.1,0,0,0.1).look && states[10] == 1 123 | sample :drum_cymbal_soft, sustain: 0, release: 0.2 if rand() < (ring 0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5).look && states[2] == 1 124 | sample :drum_snare_soft if rand() < (ring 0.1,0,0.3,0.05,0.7,0.05,0,0.2).look && states[1] == 1 125 | sample :drum_bass_soft if rand() < (ring 0.95,0.05,0.05,0.3,0.1,0.2,0.05).look && states[0] == 1 126 | sleep 0.25 127 | end #:drums 128 | end #:reverb 129 | -------------------------------------------------------------------------------- /Covers/A Walk in the Woods: -------------------------------------------------------------------------------- 1 | #Halo CE - A Walk in the Woods 2 | #Coded by Davids Fiddle 3 | 4 | use_bpm 72 5 | 6 | #Mixer: 7 | amp_melody1 = 1.5 8 | amp_melody2 = 1.5 9 | amp_bass = 1.5 10 | amp_snare = 0.7 11 | amp_hihat = 0.8 12 | amp_kick = 1.1 13 | amp_pedal = 1 14 | 15 | s = 0.25 16 | e = 0.5 17 | q = 1 18 | dq = 1.5 19 | h = 2 20 | f = 4 21 | 22 | define :bass1 do 23 | play_pattern_timed [:d2,:d2],[s,s], sustain: 0, amp: amp_bass/2, release: q, attack_level: 1.2, coef: 0.7 24 | sleep q 25 | play_pattern_timed [:d2,:d2,:c3,:d2,:d2], 26 | [h,s,s,s,s], sustain: 0, amp: amp_bass/2, release: q, attack_level: 1.2, coef: 0.7 27 | sleep q 28 | play_pattern_timed [:d2,:d2,:c3,:d3], 29 | [dq+s,s,s,s], sustain: 0, amp: amp_bass/2, release: q, attack_level: 1.2, coef: 0.7 30 | end 31 | 32 | define :bass2 do 33 | play_pattern_timed [:d2,:c3,:d2,:d3,:d2,:d2,:d2,:d2,:c3,:d2,:d3,:d2,:c3,:d2], 34 | [e,s,s,s,s,s,e,s,s,s,s,s,s,s], sustain: 0, amp: amp_bass/2, release: q, attack_level: 1.2, coef: 0.7 35 | end 36 | 37 | #Bass 38 | in_thread do 39 | with_fx :reverb do 40 | use_synth :beep 41 | 2.times do 42 | bass1 43 | end 44 | 4.times do 45 | bass2 46 | end 47 | play :d2, sustain: h, release: f+h 48 | sleep 2*f 49 | 2.times do 50 | bass1 51 | end 52 | 4.times do 53 | bass2 54 | end 55 | sleep 2*f 56 | 2.times do 57 | bass1 58 | end 59 | 4.times do 60 | bass2 61 | end 62 | end 63 | end 64 | in_thread do 65 | use_synth :fm 66 | 2.times do 67 | bass1 68 | end 69 | 4.times do 70 | bass2 71 | end 72 | play :d2, sustain: h, release: f+h 73 | sleep 2*f 74 | 2.times do 75 | bass1 76 | end 77 | 4.times do 78 | bass2 79 | end 80 | sleep 2*f 81 | 2.times do 82 | bass1 83 | end 84 | 4.times do 85 | bass2 86 | end 87 | end 88 | 89 | #Pedal 90 | in_thread do 91 | sleep 8*f 92 | 20.times do 93 | 4.times do 94 | sample :drum_cymbal_pedal, amp: amp_pedal 95 | sleep q 96 | end 97 | end 98 | end 99 | 100 | #Kick 101 | in_thread do 102 | sleep 8*f 103 | 20.times do 104 | sample :drum_bass_hard, amp: amp_kick 105 | sleep 3*e 106 | sample :drum_bass_hard, amp: amp_kick 107 | sleep 5*e 108 | end 109 | end 110 | 111 | #Snare 112 | in_thread do 113 | sleep 10*f 114 | 18.times do 115 | sleep q 116 | sample :drum_snare_hard, amp: amp_snare 117 | sleep h 118 | sample :drum_snare_hard, amp: amp_snare 119 | sleep q 120 | end 121 | end 122 | 123 | #Hihat 124 | in_thread do 125 | sleep 10*f 126 | #with_fx :ring_mod do 127 | 18.times do 128 | sleep 3*e 129 | sample :drum_cymbal_soft, amp: amp_hihat 130 | sleep s 131 | sample :drum_cymbal_soft, amp: amp_hihat 132 | sleep 3*e+s 133 | sample :drum_cymbal_soft, amp: amp_hihat 134 | sleep s 135 | sample :drum_cymbal_soft, amp: amp_hihat 136 | sleep s 137 | end 138 | #end 139 | end 140 | 141 | #Melody1 142 | in_thread do 143 | use_synth :hollow 144 | 2.times do 145 | play_pattern_timed [:fs3,:g3,:fs3,:f3,:e3,:d3,:d3,:d3,:d3,:d3], 146 | [e,e,e,e+h,e,q,h+e,dq,h+e,f], amp: amp_melody1, pan: 0.3 147 | end 148 | sleep 2*f 149 | 2.times do 150 | play_pattern_timed [:fs3,:g3,:fs3,:f3,:e3,:d3,:d3,:d3,:d3,:d3], 151 | [e,e,e,e+h,e,q,h+e,dq,h+e,f], amp: amp_melody1, pan: 0.3 152 | end 153 | sleep 2*f 154 | 2.times do 155 | play_pattern_timed [:fs3,:g3,:fs3,:f3,:e3,:d3,:d3,:d3,:d3,:d3], 156 | [e,e,e,e+h,e,q,h+e,dq,h+e,f], amp: amp_melody1, pan: 0.3 157 | end 158 | 159 | end 160 | 161 | #Melody2 162 | in_thread do 163 | use_synth :hollow 164 | 2.times do 165 | play_pattern_timed [:d3,:d3,:d3,:d3,:c3,:b2,:b2,:a2,:as2,:b2], 166 | [e,e,e,e+h,e,q,h+e,dq,h+e,f], amp: amp_melody2, pan: -0.3 167 | end 168 | sleep 2*f 169 | 2.times do 170 | play_pattern_timed [:d3,:d3,:d3,:d3,:c3,:b2,:b2,:a2,:as2,:b2], 171 | [e,e,e,e+h,e,q,h+e,dq,h+e,f], amp: amp_melody2, pan: -0.3 172 | end 173 | sleep 2*f 174 | 2.times do 175 | play_pattern_timed [:d3,:d3,:d3,:d3,:c3,:b2,:b2,:a2,:as2,:b2], 176 | [e,e,e,e+h,e,q,h+e,dq,h+e,f], amp: amp_melody2, pan: -0.3 177 | end 178 | end 179 | -------------------------------------------------------------------------------- /APC/20191231_Pound: -------------------------------------------------------------------------------- 1 | #20191231_Pound 2 | #by Davids Fiddle 3 | 4 | 5 | 6 | #APC Utility BEGIN 7 | #Globals: 8 | use_bpm 120 #BPM for the piece 9 | use_sched_ahead_time 0.2 #Balance between playability and stability 10 | #States of the tracks: 11 | states = [3,1,1,3,3,0,0,0, 12 | 1,0,1,0,3,0,0,0, 13 | 0,0,0,0,0,0,0,0, 14 | 0,0,0,0,0,0,0,0, 15 | 0,0,0,0,5,0,0,0 16 | ] 17 | #0 means nothing will happen (disabled) 18 | #1 means green (active) 19 | #3 means red (inactive) 20 | #5 means toggle off (yellow), will switch to 7(also green) 21 | #7 means toggle off (green), will switch to 5(yellow) 22 | toggle = (ring 0,3,0,1,0,7,0,5) #For switching the lights 23 | knobs = [48,49,50,51,52,53,54,55] #Adresses for the knobs 24 | knob0 = 0 25 | knob1 = 0 26 | knob2 = 0 27 | knob3 = 0 28 | knob4 = 0 29 | knob5 = 0 30 | knob6 = 0 31 | knob7 = 0 32 | define :all_lights do 33 | #Updates all lights 34 | for x in (range 0,40) 35 | midi_note_on x, states[x] 36 | end 37 | end #:all_lights 38 | define :all_off do 39 | #Turns all lights off 40 | for i in (range 0,87) 41 | midi_note_on i,0 42 | end 43 | end #:all_off 44 | all_off 45 | sleep 0.1 46 | live_loop :midi_control do 47 | key,vel = sync "/midi/apc_key_25/0/1/note_on" #Wait for midi messages 48 | if key < 40 #Ignore messages 'out of bounds' 49 | states[key] = toggle[states[key]] #Update the track values 50 | midi_note_on key, states[key] #Update the track lights 51 | cue 'event', key 52 | end 53 | end #:midi_control 54 | live_loop :midi_cc do 55 | key,val = sync "/midi/apc_key_25/0/1/control_change" #Wait for midi messages 56 | case key 57 | when knobs[0] 58 | cue 'knob0', val 59 | knob0 = val 60 | when knobs[1] 61 | cue 'knob1', val 62 | knob1 = val 63 | when knobs[2] 64 | cue 'knob2', val 65 | knob2 = val 66 | when knobs[3] 67 | cue 'knob3', val 68 | knob3 = val 69 | when knobs[4] 70 | cue 'knob4', val 71 | knob4 = val 72 | when knobs[5] 73 | cue 'knob5', val 74 | knob5 = val 75 | when knobs[6] 76 | cue 'knob6', val 77 | knob6 = val 78 | when knobs[7] 79 | cue 'knob7', val 80 | knob7 = val 81 | end 82 | #Cues are sent per knob to avoid multiple listening loops syncing possibly 100 times in a second 83 | end #:midi_cc 84 | all_lights #initialise the lights 85 | sleep 0.1 86 | #APC_Utility END 87 | 88 | 89 | 90 | 91 | set_mixer_control! lpf: 0 92 | 93 | with_fx :reverb, room: 0.3 do 94 | with_fx :compressor, relax_time: 0.03 do 95 | live_loop :drums do 96 | tick 97 | sample :drum_bass_hard, amp: 1.2 if (bools 1,0,0,0).look && states[0] == 1 98 | sample :bd_haus if (bools 1,0,0,0).look && states[8] == 1 99 | sample :sn_dolf if (bools 0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0).look && states[1] == 1 100 | sample :drum_cymbal_closed, amp: (ring 0.8,0.9,1).choose, 101 | rate: (ring 1,1.01,1.02).choose if (bools 0,0,1,1).look && states[2] == 1 102 | sample :drum_cymbal_soft, amp: (ring 0.8,0.9,1).choose, 103 | release: (ring 0.1,0.1,0.2).look, sustain: 0, 104 | rate: (ring 1,1.01,1.02).choose if (bools 1,1,0,0).look && states[10] == 1 105 | sleep 0.25 106 | end #:drums 107 | end #:compressor 108 | 109 | live_loop :piano do 110 | tick 111 | use_synth :tri 112 | use_synth_defaults amp: 0.3 113 | if states[36] == 7 114 | play (ring *(knit :a4,5,:b4,1).repeat(3),*(knit :a4,5,:g4,1)).look if states[4] == 1 115 | play (ring *(knit :c5,5,:d5,1).repeat(3),*(knit :c5,5,:b4,1)).look if states[12] == 1 116 | elsif states[36] == 5 117 | play :a4 if states[4] == 1 118 | play :c5 if states[12] == 1 119 | end 120 | sleep (knit 0.75,4,0.5,2).look 121 | end #:piano 122 | 123 | with_fx :slicer, phase: 1/4.0, mix: 1, smooth: 0.1, amp_min: 0.2 do 124 | live_loop :bass do 125 | tick 126 | use_synth_defaults sustain: 0.8, release: 0.5, cutoff: (line :a5,:a7, steps: 16).look 127 | synth :prophet, note: :a2 if states[3] == 1 128 | sleep 1 129 | end #:bass 130 | end #:slicer 131 | end #:reverb 132 | 133 | live_loop :global do 134 | sync "/cue/knob0" 135 | set_mixer_control! lpf: knob0 136 | end 137 | -------------------------------------------------------------------------------- /Covers/Covenant Dance: -------------------------------------------------------------------------------- 1 | #Halo CE 2 | #Covenant Dance 3 | #Coded by Davids Fiddle 4 | 5 | use_bpm 180 6 | #1st Voice 7 | in_thread do 8 | use_synth :blade 9 | with_fx :reverb do 10 | sleep 12 11 | play :e3, release: 4, sustain: 2 12 | play :g3, release: 4, sustain: 2 13 | sleep 6 14 | play :e3, release: 4, sustain: 2 15 | play :a3, release: 4, sustain: 2 16 | sleep 6 17 | play :fs3, release: 4, sustain: 2 18 | play :b3, release: 4, sustain: 2 19 | sleep 6 20 | play :fs3, release: 4, sustain: 2 21 | play :cs4, release: 4, sustain: 2 22 | sleep 6 23 | play :e3, release: 4, sustain: 2 24 | play :b3, release: 4, sustain: 2 25 | sleep 6 26 | play :e3, release: 4, sustain: 2 27 | play :cs4, release: 4, sustain: 2 28 | sleep 6 29 | play :fs3, release: 4, sustain: 2 30 | play :d4, release: 4, sustain: 2 31 | sleep 6 32 | play :e3, release: 4, sustain: 25 33 | play :cs4, release: 4, sustain: 25 34 | play :e4, release: 4, sustain: 25 35 | sleep 30 36 | 37 | sleep 6*8 38 | with_fx :reverb, phase: 1 do 39 | play :b3, release: 4, sustain: 8 40 | sleep 12 41 | play :c4, release: 4, sustain: 2 42 | play :g4, release: 4, sustain: 2 43 | sleep 6 44 | play :b3, release: 2, sustain: 1 45 | play :fs4, release: 2, sustain: 1 46 | sleep 3 47 | play :g3, release: 2, sustain: 1 48 | play :d4, release: 2, sustain: 1 49 | sleep 3 50 | play :b3, release: 4, sustain: 8 51 | sleep 12 52 | play :c4, release: 4, sustain: 2 53 | play :g4, release: 4, sustain: 2 54 | sleep 6 55 | play :b3, release: 2, sustain: 1 56 | play :fs4, release: 2, sustain: 1 57 | sleep 3 58 | play :g3, release: 2, sustain: 1 59 | play :d4, release: 2, sustain: 1 60 | sleep 3 61 | play :b3, release: 4, sustain: 8 62 | sleep 12 63 | play :c4, release: 4, sustain: 2 64 | play :g4, release: 4, sustain: 2 65 | sleep 6 66 | play :b3, release: 4, sustain: 2 67 | play :fs4, release: 4, sustain: 2 68 | sleep 6 69 | end 70 | play :e3, release: 4, sustain: 2 71 | play :g3, release: 4, sustain: 2 72 | sleep 6 73 | play :e3, release: 4, sustain: 2 74 | play :a3, release: 4, sustain: 2 75 | sleep 6 76 | play :fs3, release: 4, sustain: 2 77 | play :b3, release: 4, sustain: 2 78 | sleep 6 79 | play :fs3, release: 4, sustain: 2 80 | play :cs4, release: 4, sustain: 2 81 | sleep 6 82 | play :e3, release: 4, sustain: 2 83 | play :b3, release: 4, sustain: 2 84 | sleep 6 85 | play :e3, release: 4, sustain: 2 86 | play :cs4, release: 4, sustain: 2 87 | sleep 6 88 | play :fs3, release: 4, sustain: 2 89 | play :d4, release: 4, sustain: 2 90 | sleep 6 91 | play :e3, release: 4, sustain: 30 92 | play :cs4, release: 4, sustain: 30 93 | play :e4, release: 4, sustain: 30 94 | sleep 30 95 | end 96 | end 97 | 98 | #2nd Voice 99 | in_thread do 100 | with_fx :reverb do 101 | use_synth :fm 102 | use_synth_defaults sustain: 0.5, release: 0.5 103 | sleep 12*7 104 | 8.times do 105 | 3.times do 106 | play_pattern_timed [:e2,:e3,:e2,:b2,:e3],[1,0.5,0.5,0.5,0.5] 107 | end 108 | play_pattern_timed [:g3,:fs3,:d3],[1,1,1] 109 | 3.times do 110 | play_pattern_timed [:e2,:e3,:e2,:b2,:e3],[1,0.5,0.5,0.5,0.5] 111 | end 112 | play_pattern_timed [:a3,:g3,:d3],[1,1,1] 113 | end 114 | end 115 | end 116 | 117 | #Beat 118 | in_thread do 119 | 7.times do 120 | 4.times do 121 | sleep 1.5 122 | sample :bd_haus, amp: 1.1 123 | sleep 1.5 124 | end 125 | end 126 | end 127 | in_thread do 128 | 7.times do 129 | 2.times do 130 | sample :bd_sone, amp: 1.5 131 | sleep 2.5 132 | sample :bd_sone, amp: 1.5 133 | sleep 3.5 134 | end 135 | end 136 | sleep 6*8 137 | 6.times do 138 | 2.times do 139 | sample :drum_bass_hard#, amp: 1.5 140 | sleep 3 141 | sample :drum_bass_hard#, amp: 1.5 142 | sleep 3 143 | end 144 | end 145 | end 146 | in_thread do 147 | 7.times do 148 | 24.times do 149 | sample :bd_zum, amp: 0.2 150 | sleep 0.5 151 | end 152 | end 153 | sleep 6*12 154 | 4.times do 155 | 24.times do 156 | sample :bd_zum, amp: 0.2 157 | sleep 0.5 158 | end 159 | end 160 | end 161 | -------------------------------------------------------------------------------- /Covers/Airwolf: -------------------------------------------------------------------------------- 1 | #Airwolf Theme 2 | #Coded by Davids Fiddle 3 | 4 | use_bpm 103 5 | 6 | h = 2 7 | dq = 1.5 8 | q = 1 9 | de = 0.75 10 | e = 0.5 11 | ds = 0.375 12 | s = 0.25 13 | 14 | #Arp 15 | in_thread do 16 | use_synth :pulse 17 | use_synth_defaults amp: 0.6, attack: 0, sustain: 0.15, release: 0.2 18 | 10.times do 19 | play_pattern_timed [:a3,:c4,:e4,:a4,:c5,:g4,:a4,:e4,:g4,:e4,:g4,:a4], [s,s,s,s,s,s,s,s,s,s,s,s] 20 | end 21 | 6.times do 22 | with_transpose 3 do 23 | play_pattern_timed [:a3,:c4,:e4,:a4,:c5,:g4,:a4,:e4,:g4,:e4,:g4,:a4], [s,s,s,s,s,s,s,s,s,s,s,s] 24 | end 25 | end 26 | 6.times do 27 | play_pattern_timed [:a3,:c4,:e4,:a4,:c5,:g4,:a4,:e4,:g4,:e4,:g4,:a4], [s,s,s,s,s,s,s,s,s,s,s,s] 28 | end 29 | 6.times do 30 | with_transpose 3 do 31 | play_pattern_timed [:a3,:c4,:e4,:a4,:c5,:g4,:a4,:e4,:g4,:e4,:g4,:a4], [s,s,s,s,s,s,s,s,s,s,s,s] 32 | end 33 | end 34 | 6.times do 35 | play_pattern_timed [:a3,:c4,:e4,:a4,:c5,:g4,:a4,:e4,:g4,:e4,:g4,:a4], [s,s,s,s,s,s,s,s,s,s,s,s] 36 | end 37 | end 38 | 39 | #Beat 40 | in_thread do 41 | 10.times do 42 | 4.times do 43 | sample :bd_haus 44 | sleep 0.75 45 | end 46 | end 47 | 4.times do 48 | 6.times do 49 | 4.times do 50 | sample :bd_haus 51 | sleep 0.75 52 | end 53 | end 54 | end 55 | end 56 | 57 | #Bass 58 | in_thread do 59 | with_fx :reverb do 60 | with_fx :lpf do 61 | use_synth :pluck 62 | use_synth_defaults amp: 1.2 63 | sleep 6 64 | 8.times do 65 | 12.times do 66 | play :a2 67 | sleep s 68 | end 69 | end 70 | 6.times do 71 | with_transpose 3 do 72 | 12.times do 73 | play :a2 74 | sleep s 75 | end 76 | end 77 | end 78 | 6.times do 79 | 12.times do 80 | play :a2 81 | sleep s 82 | end 83 | end 84 | 6.times do 85 | with_transpose 3 do 86 | 12.times do 87 | play :a2 88 | sleep s 89 | end 90 | end 91 | end 92 | 6.times do 93 | 12.times do 94 | play :a2 95 | sleep s 96 | end 97 | end 98 | end 99 | end 100 | end 101 | 102 | with_fx :hpf do 103 | #Melody 104 | in_thread do 105 | with_fx :compressor do 106 | use_synth :saw 107 | use_synth_defaults amp: 1.5, pan: 0.2 108 | sleep 12 109 | 2.times do 110 | 2.times do 111 | play_pattern_timed [:a4,:c5,:e5,:g5,:a5,:c6,:b5,:g5,:a5,:c6,:b5,:g5,:a5,:g5,:b5,:e5,:d5,:c5,:d5,:b4], 112 | [de,s,s,s,de,s,s,s,de,s,s,s,de,e,s,de,de,e,s,de] 113 | end 114 | with_transpose 3 do 115 | play_pattern_timed [:a4,:c5,:e5,:g5,:a5,:c6,:b5,:g5,:a5,:c6,:b5,:g5,:a5,:g5,:b5,:e5,:d5,:c5,:d5,:b4], 116 | [de,s,s,s,de,s,s,s,de,s,s,s,de,e,s,de,de,e,s,de] 117 | play_pattern_timed [:a4,:c5,:e5,:g5,:a5,:c6,:b5,:g5,:a5,:c6,:b5,:g5,:a5,:c6,:e6,:g6,:a6,:r], 118 | [de,s,s,s,de,s,s,s,de,s,s,s,de,s,s,s,h,q] 119 | end 120 | end 121 | end 122 | end 123 | #Melody double 124 | in_thread do 125 | with_fx :compressor do 126 | with_transpose -12 do 127 | use_synth :saw 128 | use_synth_defaults amp: 1.3, pan: -0.2 129 | sleep 12 130 | 2.times do 131 | 2.times do 132 | play_pattern_timed [:a4,:c5,:e5,:g5,:a5,:c6,:b5,:g5,:a5,:c6,:b5,:g5,:a5,:g5,:b5,:e5,:d5,:c5,:d5,:b4], 133 | [de,s,s,s,de,s,s,s,de,s,s,s,de,e,s,de,de,e,s,de] 134 | end 135 | with_transpose 3 do 136 | play_pattern_timed [:a4,:c5,:e5,:g5,:a5,:c6,:b5,:g5,:a5,:c6,:b5,:g5,:a5,:g5,:b5,:e5,:d5,:c5,:d5,:b4], 137 | [de,s,s,s,de,s,s,s,de,s,s,s,de,e,s,de,de,e,s,de] 138 | play_pattern_timed [:a4,:c5,:e5,:g5,:a5,:c6,:b5,:g5,:a5,:c6,:b5,:g5,:a5,:c6,:e6,:g6,:a6,:r], 139 | [de,s,s,s,de,s,s,s,de,s,s,s,de,s,s,s,h,q] 140 | end 141 | end 142 | end 143 | end 144 | end 145 | end 146 | 147 | #Pad 148 | in_thread do 149 | with_fx :panslicer, smooth: 3, phase: 4, pan_min: -0.3, pan_max: 0.3 do 150 | use_synth :fm 151 | use_synth_defaults attack: 0.2, sustain: 18 152 | sleep 12 153 | sleep 18 154 | 2.times do 155 | play :c4 156 | sleep 18 157 | play :a3 158 | sleep 18 159 | end 160 | end 161 | end 162 | -------------------------------------------------------------------------------- /Covers/Popcorn: -------------------------------------------------------------------------------- 1 | #Popcorn 2 | #Coded by Davids Fiddle 3 | 4 | 5 | use_bpm 260 6 | 7 | #Arpeggio 8 | in_thread do 9 | with_fx :bitcrusher do 10 | sleep 8 11 | #in G 12 | 4.times do 13 | use_synth :fm 14 | play_pattern_timed [:g3,:g4,:d4,:g3,:g4,:d4,:g3,:g4,:d4,:g3,:bb3,:d4,:g4],[1,0.5,0.5,1,0.5,0.5,1,0.5,0.5,0.5,0.5,0.5,0.5] 15 | end 16 | 4.times do 17 | 2.times do 18 | play_pattern_timed [:g3,:g4,:d4,:g3,:g4,:d4,:g3,:g4,:d4,:g3,:bb3,:d4,:g4],[1,0.5,0.5,1,0.5,0.5,1,0.5,0.5,0.5,0.5,0.5,0.5] 19 | end 20 | play_pattern_timed [:g3,:g4,:d4,:g3,:bb3,:d4,:g4],[1,0.5,0.5,0.5,0.5,0.5,0.5] 21 | play_pattern_timed [:f3,:f4,:c4,:f3,:a3,:c4,:f4],[1,0.5,0.5,0.5,0.5,0.5,0.5] 22 | play_pattern_timed [:eb3,:eb4,:bb3,:eb3,:g3,:eb4,:g4],[1,0.5,0.5,0.5,0.5,0.5,0.5] 23 | play_pattern_timed [:g3,:g4,:d4,:g3,:bb3,:d4,:g4],[1,0.5,0.5,0.5,0.5,0.5,0.5] 24 | end 25 | #in D 26 | 2.times do 27 | 2.times do 28 | play_pattern_timed [:bb3,:bb4,:f4,:bb3,:bb4,:f4,:bb3,:bb4,:f4,:bb3,:d4,:f4,:bb4],[1,0.5,0.5,1,0.5,0.5,1,0.5,0.5,0.5,0.5,0.5,0.5] 29 | end 30 | play_pattern_timed [:d4,:d5,:a4,:d4,:f4,:a4,:d5],[1,0.5,0.5,0.5,0.5,0.5,0.5] 31 | play_pattern_timed [:c4,:c5,:g4,:c4,:e4,:g4,:c5],[1,0.5,0.5,0.5,0.5,0.5,0.5] 32 | play_pattern_timed [:bb3,:bb4,:f4,:bb3,:d4,:f4,:bb4],[1,0.5,0.5,0.5,0.5,0.5,0.5] 33 | play_pattern_timed [:bb3,:bb4,:f4,:bb3,:d4,:f4,:bb4],[1,0.5,0.5,0.5,0.5,0.5,0.5] 34 | end 35 | #in G 36 | 6.times do 37 | 2.times do 38 | play_pattern_timed [:g3,:g4,:d4,:g3,:g4,:d4,:g3,:g4,:d4,:g3,:bb3,:d4,:g4],[1,0.5,0.5,1,0.5,0.5,1,0.5,0.5,0.5,0.5,0.5,0.5] 39 | end 40 | play_pattern_timed [:g3,:g4,:d4,:g3,:bb3,:d4,:g4],[1,0.5,0.5,0.5,0.5,0.5,0.5] 41 | play_pattern_timed [:f3,:f4,:c4,:f3,:a3,:c4,:f4],[1,0.5,0.5,0.5,0.5,0.5,0.5] 42 | play_pattern_timed [:eb3,:eb4,:bb3,:eb3,:g3,:eb4,:g4],[1,0.5,0.5,0.5,0.5,0.5,0.5] 43 | play_pattern_timed [:g3,:g4,:d4,:g3,:bb3,:d4,:g4],[1,0.5,0.5,0.5,0.5,0.5,0.5] 44 | end 45 | end 46 | end 47 | 48 | #Pad 1 49 | in_thread do 50 | use_synth :blade 51 | s = play :g5, sustain: 168, amp: 0, amp_slide: 2 52 | sleep 2 53 | control s, amp: 1 #Fade In 54 | sleep 38 55 | 4.times do 56 | sleep 20 57 | control s, note: :f5 58 | sleep 4 59 | control s, note: :eb5 60 | sleep 4 61 | control s, note: :g5 62 | sleep 4 63 | end 64 | end 65 | 66 | #Pad 2 67 | in_thread do 68 | use_synth :saw 69 | sleep 8 70 | sleep 32 71 | sleep 64 72 | #in G 73 | p = play :g4, sustain: 220+64, amp: 0.7 74 | 2.times do 75 | sleep 15 76 | control p, note: :a4 77 | sleep 1 78 | control p, note: :bb4 79 | sleep 4 80 | control p, note: :a4 81 | sleep 4 82 | control p, note: :g4 83 | sleep 8 84 | end 85 | #in D 86 | control p, note: :d5 87 | 2.times do 88 | sleep 7 89 | control p, note: :c5 90 | sleep 1 91 | control p, note: :d5 92 | sleep 2 93 | control p, note: :bb4 94 | sleep 4 95 | control p, note: :d5 96 | sleep 1 97 | control p, note: :e5 98 | sleep 1 99 | control p, note: :d5 100 | sleep 4 101 | control p, note: :c5 102 | sleep 4 103 | control p, note: :d5 104 | sleep 8 105 | end 106 | control p, note: :g4 107 | #in G 108 | 6.times do 109 | sleep 15 110 | control p, note: :a4 111 | sleep 1 112 | control p, note: :bb4 113 | sleep 4 114 | control p, note: :a4 115 | sleep 4 116 | control p, note: :g4 117 | sleep 8 118 | end 119 | end 120 | 121 | #Blip-Melody 122 | in_thread do 123 | use_synth :chiplead 124 | sleep 8 125 | sleep 30 126 | #in G 127 | 4.times do 128 | 2.times do 129 | play_pattern_timed [:g4,:f4,:g4,:d4,:bb3,:d4,:g3],[1,1,1,1,1,1,2] 130 | end 131 | play_pattern_timed [:g4,:a4,:bb4,:a4,:bb4,:g4,:a4,:g4,:a4,:f4,:g4,:f4,:g4,:eb4,:g4],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,2] 132 | end 133 | #in D 134 | 2.times do 135 | 2.times do 136 | play_pattern_timed [:d5,:c5,:d5,:bb4,:f4,:bb4,:d4],[1,1,1,1,1,1,2] 137 | end 138 | play_pattern_timed [:d5,:e5,:f5,:e5,:f5,:d5,:e5,:d5,:e5,:c5,:d5,:c5,:d5,:bb4,:d5],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,2] 139 | end 140 | #in G 141 | 6.times do 142 | 2.times do 143 | play_pattern_timed [:g4,:f4,:g4,:d4,:bb3,:d4,:g3],[1,1,1,1,1,1,2] 144 | end 145 | play_pattern_timed [:g4,:a4,:bb4,:a4,:bb4,:g4,:a4,:g4,:a4,:f4,:g4,:f4,:g4,:eb4,:g4],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,2] 146 | end 147 | sleep 2 148 | end 149 | -------------------------------------------------------------------------------- /Covers/Tetris Theme: -------------------------------------------------------------------------------- 1 | #Tetris Theme 2 | #Coded by Davids Fiddle 3 | / 4 | __ __ 5 | | | | | 6 | | | | |__ 7 | __| | |_____| 8 | | |__| 9 | | | __ 10 | | | __| |__ __ 11 | | |___|________| | 12 | |__|________|______| 13 | 14 | / 15 | use_bpm 140 16 | 17 | w = 4 18 | h = 2 19 | dq = 1.5 20 | q = 1 21 | e = 0.5 22 | s = 0.25 23 | 24 | #Perc 25 | define :b1 do 26 | 4.times do 27 | sleep e 28 | sample :drum_snare_soft 29 | sleep e 30 | end 31 | end 32 | define :b2 do 33 | 2.times do 34 | sleep e 35 | sample :drum_snare_soft 36 | sleep e 37 | end 38 | sleep e 39 | 2.times do 40 | sample :drum_snare_soft 41 | sleep s 42 | end 43 | sleep e 44 | sample :drum_snare_soft 45 | sleep e 46 | end 47 | define :b3 do 48 | 2.times do 49 | sleep e 50 | sample :drum_snare_soft 51 | sleep e 52 | end 53 | sleep e 54 | 3.times do 55 | sample :drum_snare_hard 56 | sleep e 57 | end 58 | end 59 | 60 | in_thread do 61 | 2.times do 62 | 8.times do 63 | b1 64 | b2 65 | end 66 | 4.times do 67 | b1 68 | b3 69 | end 70 | end 71 | 8.times do 72 | b1 73 | b2 74 | end 75 | end 76 | 77 | #Bass 78 | in_thread do 79 | use_synth :chipbass 80 | #use_synth_defaults release: q 81 | 2.times do 82 | 2.times do 83 | play_pattern_timed [:r,:e2,:r,:e2,:r,:e2,:r,:e2],[e,e,e,e,e,e,e,e] 84 | play_pattern_timed [:r,:a2,:r,:a2,:r,:a2,:r,:a2],[e,e,e,e,e,e,e,e] 85 | play_pattern_timed [:r,:e2,:r,:e2,:r,:e2,:r,:b2],[e,e,e,e,e,e,e,e] 86 | play_pattern_timed [:r,:a2,:r,:a2,:r,:a2,:b2,:c3],[e,e,e,e,e,e,e,e] 87 | play_pattern_timed [:r,:d2,:r,:d2,:r,:d2,:r,:e2],[e,e,e,e,e,e,e,e] 88 | play_pattern_timed [:r,:a2,:r,:a2,:r,:a2,:r,:c3],[e,e,e,e,e,e,e,e] 89 | play_pattern_timed [:r,:b2,:r,:b2,:r,:c3,:r,:b2],[e,e,e,e,e,e,e,e] 90 | play_pattern_timed [:r,:a2,:r,:a2,:r,:a2,:r],[e,e,e,e,e,q,e] 91 | end 92 | 2.times do 93 | 3.times do 94 | 4.times do 95 | play_pattern_timed [:a2,:a3],[e,e] 96 | end 97 | end 98 | 4.times do 99 | play_pattern_timed [:e2,:e3],[e,e] 100 | end 101 | end 102 | end 103 | 2.times do 104 | play_pattern_timed [:r,:e2,:r,:e2,:r,:e2,:r,:e2],[e,e,e,e,e,e,e,e] 105 | play_pattern_timed [:r,:a2,:r,:a2,:r,:a2,:r,:a2],[e,e,e,e,e,e,e,e] 106 | play_pattern_timed [:r,:e2,:r,:e2,:r,:e2,:r,:b2],[e,e,e,e,e,e,e,e] 107 | play_pattern_timed [:r,:a2,:r,:a2,:r,:a2,:b2,:c3],[e,e,e,e,e,e,e,e] 108 | play_pattern_timed [:r,:d2,:r,:d2,:r,:d2,:r,:e2],[e,e,e,e,e,e,e,e] 109 | play_pattern_timed [:r,:a2,:r,:a2,:r,:a2,:r,:c3],[e,e,e,e,e,e,e,e] 110 | play_pattern_timed [:r,:b2,:r,:b2,:r,:c3,:r,:b2],[e,e,e,e,e,e,e,e] 111 | play_pattern_timed [:r,:a2,:r,:a2,:r,:a2,:r],[e,e,e,e,e,q,e] 112 | end 113 | end 114 | 115 | define :chorus do 116 | use_synth_defaults sustain: dq, release: e, attack: e, amp: 1.5 117 | play :a3 118 | play :c4 119 | play :e4 120 | sleep h 121 | play :c4 122 | play :e4 123 | sleep h 124 | play :g3 125 | play :b3 126 | play :d4 127 | sleep h 128 | play :b3 129 | play :d4 130 | sleep h 131 | play :e3 132 | play :a3 133 | play :c4 134 | sleep h 135 | play :e3 136 | play :a3 137 | sleep h 138 | use_synth_defaults sustain: h, release: q, attack: q, amp: 1.5 139 | play :e3 140 | play :gs3 141 | play :b3 142 | sleep w 143 | use_synth_defaults sustain: dq, release: e, attack: e, amp: 1.5 144 | play :a3 145 | play :c4 146 | play :e4 147 | sleep h 148 | play :c4 149 | play :e4 150 | sleep h 151 | play :g3 152 | play :b3 153 | play :d4 154 | sleep h 155 | play :b3 156 | play :d4 157 | sleep h 158 | use_synth_defaults sustain: e, release: e, amp: 1.5 159 | play :c4 160 | sleep q 161 | play :e4 162 | sleep q 163 | play :a4, sustain: dq 164 | sleep h 165 | play :gs4, sustain: h 166 | sleep w 167 | end 168 | define :main_melody do 169 | use_synth_defaults release: dq, amp: 1.5 170 | 2.times do #main melody 171 | play_pattern_timed [:e4,:b3,:c4,:d4,:c4,:b3,:a3,:a3,:c4,:e4,:d4,:c4,:b3,:r,:c4,:d4,:e4,:c4,:a3,:a3,:r],[q,e,e,q,e,e,q,e,e,q,e,e,q,e,e,q,q,q,q,q,q] 172 | play_pattern_timed [:r,:d4,:f4,:a4,:g4,:f4,:e4,:r,:c4,:e4,:d4,:c4,:b3,:c4,:d4,:e4,:c4,:a3,:a3,:r],[e,q,e,q,e,e,q,e,e,q,e,e,dq,e,q,q,q,q,q,q] 173 | end 174 | end 175 | #Melody 176 | in_thread do 177 | use_synth :chiplead 178 | main_melody 179 | chorus 180 | main_melody 181 | chorus 182 | main_melody 183 | end 184 | -------------------------------------------------------------------------------- /Covers/Radioactivity: -------------------------------------------------------------------------------- 1 | #Radioactivity - Kraftwerk 2 | #Coded by Davids Fiddle 3 | 4 | use_bpm 120 5 | 6 | h = 2 7 | q = 1 8 | e = 0.5 9 | s = 0.25 10 | 11 | #Uncomment this to sing the lyrics yourself 12 | comment do 13 | live_loop :in do 14 | with_fx :reverb do 15 | with_fx :ring_mod do 16 | synth :sound_in, amp: 3 17 | sleep 1 18 | end 19 | end 20 | end 21 | end 22 | 23 | 24 | #Beat 25 | define :eight do 26 | 8.times do 27 | sample :drum_cymbal_closed, hpf: 90 28 | sleep e 29 | end 30 | end 31 | define :dada do 32 | sample :drum_snare_soft 33 | sleep q 34 | sample :drum_snare_soft 35 | sleep q 36 | with_fx :reverb do 37 | sample :drum_cymbal_closed, amp: 2 38 | sleep h 39 | end 40 | end 41 | 42 | in_thread do 43 | 20.times do 44 | eight 45 | end 46 | 24.times do 47 | dada 48 | end 49 | 8.times do 50 | eight 51 | end 52 | 12.times do 53 | dada 54 | end 55 | end 56 | 57 | #FX 58 | in_thread do 59 | sleep 14*4 60 | make_noise 61 | sleep 2*4 62 | make_noise 63 | sleep 8*4 64 | 4.times do 65 | cue :radio 66 | sleep 4*4 67 | end 68 | sleep 2*4 69 | make_noise 70 | sleep 2*4 71 | make_noise 72 | sleep 8*4 73 | cue :radio 74 | end 75 | 76 | #Bass 77 | define :bs_a do 78 | play_pattern_timed [:a2,:a2,:a2,:a2,:a2,:a2,:a2,:a2], 79 | [e,e,e,e,e,e,e,e] 80 | end 81 | define :bs_f do 82 | play_pattern_timed [:f2,:f2,:f2,:f2,:f2,:f2,:f2,:f2], 83 | [e,e,e,e,e,e,e,e] 84 | end 85 | 86 | in_thread do 87 | use_synth :dpulse 88 | use_synth_defaults sustain: 0.2, release: 0.2, 89 | amp: 0.5 90 | sleep 4*4 91 | 8.times do 92 | bs_a 93 | end 94 | 6.times do 95 | 4.times do 96 | bs_a 97 | end 98 | 4.times do 99 | bs_f 100 | end 101 | end 102 | 4.times do 103 | bs_a 104 | end 105 | end 106 | 107 | #Pad 108 | in_thread do 109 | use_synth :dark_ambience 110 | use_synth_defaults 111 | sleep 2*4 112 | pad = play :a3, sustain: 18*4 113 | sleep 14*4 114 | control pad, note: :f3 115 | sleep 8*4 116 | pad = play :a3, sustain: 24*4 117 | sleep 4*4 118 | control pad, note: :f3 119 | sleep 4*4 120 | control pad, note: :a3 121 | sleep 4*4 122 | control pad, note: :f3 123 | sleep 4*4 124 | control pad, note: :f3 125 | sleep 4*4 126 | control pad, note: :a3 127 | sleep 4*4 128 | control pad, note: :f3 129 | end 130 | 131 | #Lead 132 | define :lead_a do 133 | sleep 4 134 | sleep 3.5 135 | play_pattern_timed [:e3,:a3,:a3,:g3,:a3,:e3,:a3,:c4,:b3,:a3,:r], 136 | [e,q,e,e,e,q,e,q,e,h,e] 137 | end 138 | define :lead_f do 139 | sleep 4 140 | sleep 3.5 141 | play_pattern_timed [:c3,:f3,:f3,:e3,:f3,:c3,:f3,:a3,:g3,:f3,:r], 142 | [e,q,e,e,e,q,e,q,e,h,e] 143 | end 144 | with_fx :reverb do 145 | with_fx :flanger do 146 | in_thread do 147 | use_synth :piano 148 | use_synth_defaults 149 | sleep 10*4 150 | 2.times do 151 | lead_a 152 | lead_f 153 | end 154 | sleep 16*4 155 | 2.times do 156 | lead_a 157 | lead_f 158 | end 159 | end 160 | end 161 | end 162 | 163 | #Play Morsecode 164 | define :play_morse do |letter, note| 165 | l = 0.6 166 | s = 0.2 167 | times = case letter 168 | when 'a' then [s,l] 169 | when 'b' then [l,s,s,s] 170 | when 'c' then [l,s,l,s] 171 | when 'd' then [l,s,s] 172 | when 'e' then [s] 173 | when 'f' then [s,s,l,s] 174 | when 'g' then [e,l,s] 175 | when 'h' then [s,s,s,s] 176 | when 'i' then [s,s] 177 | when 'j' then [s,e,l,l] 178 | when 'k' then [e,s,l] 179 | when 'l' then [s,l,s,s] 180 | when 'm' then [l,l] 181 | when 'n' then [l,s] 182 | when 'o' then [l,l,l] 183 | when 'p' then [s,l,l,s] 184 | when 'q' then [l,l,s,l] 185 | when 'r' then [s,l,s] 186 | when 's' then [s,s,s] 187 | when 't' then [l] 188 | when 'u' then [s,s,l] 189 | when 'v' then [s,s,s,l] 190 | when 'w' then [s,l,l] 191 | when 'x' then [l,s,s,l] 192 | when 'y' then [l,s,l,l] 193 | when 'z' then [l,l,s,s] 194 | end 195 | play_pattern_timed (knit note, times.length),times 196 | sleep 0.2 197 | end 198 | 199 | define :play_morse_text do |text| 200 | use_synth :beep 201 | use_synth_defaults release: 0.2 202 | for x in (range 0,text.length) do 203 | play_morse text[x],:a5 204 | sleep 0.6 205 | end 206 | end 207 | 208 | in_thread do 209 | loop do 210 | sync :radio 211 | play_morse_text "radioactivity" 212 | end 213 | end 214 | 215 | define :make_noise do 216 | noise = synth :noise, sustain: 0.5, 217 | release: 7.5, cutoff: 120, 218 | cutoff_slide: 6, amp: 0.5 219 | sleep 3 220 | control noise, cutoff: 70 221 | sleep 5 222 | end 223 | -------------------------------------------------------------------------------- /DF-xx/DF-01 for Processing 3: -------------------------------------------------------------------------------- 1 | #DF-01 Arpeggigator 2 | #Coded by Davids Fiddle 3 | 4 | do_sync = :e 5 | live_loop :get_sync do 6 | val = sync '/01_sync' 7 | do_sync = :h if val[0] == 0 8 | do_sync = :q if val[0] == 1 9 | do_sync = :e if val[0] == 2 10 | do_sync = :s if val[0] == 3 11 | end 12 | mode = 1 13 | live_loop :get_mode do 14 | val = sync '/01_mode' 15 | mode = val[0] 16 | end 17 | root = :c3 18 | live_loop :get_root do 19 | val = sync '/01_root' 20 | root = val[0] 21 | end 22 | type = :major 23 | live_loop :get_type do 24 | val = sync '/01_type' 25 | type = :major if val[0] == 0 26 | type = :minor if val[0] == 1 27 | type = :augmented if val[0] == 2 28 | type = :diminished if val[0] == 3 29 | type = :major7 if val[0] == 4 30 | type = :minor7 if val[0] == 5 31 | type = :sus2 if val[0] == 6 32 | type = :sus4 if val[0] == 7 33 | end 34 | length = 8 35 | live_loop :get_length do 36 | val = sync '/01_length' 37 | length = 8 if val[0] == 0 38 | length = 16 if val[0] == 1 39 | end 40 | n0 = 60 41 | n1 = 60 42 | n2 = 60 43 | n3 = 60 44 | n4 = 60 45 | n5 = 60 46 | n6 = 60 47 | n7 = 60 48 | n8 = 60 49 | n9 = 60 50 | n10 = 60 51 | n11 = 60 52 | n12 = 60 53 | n13 = 60 54 | n14 = 60 55 | n15 = 60 56 | live_loop :get_n0 do 57 | val = sync '/01_n0' 58 | n0 = val[0] 59 | end 60 | live_loop :get_n1 do 61 | val = sync '/01_n1' 62 | n1 = val[0] 63 | end 64 | live_loop :get_n2 do 65 | val = sync '/01_n2' 66 | n2 = val[0] 67 | end 68 | live_loop :get_n3 do 69 | val = sync '/01_n3' 70 | n3 = val[0] 71 | end 72 | live_loop :get_n4 do 73 | val = sync '/01_n4' 74 | n4 = val[0] 75 | end 76 | live_loop :get_n5 do 77 | val = sync '/01_n5' 78 | n5 = val[0] 79 | end 80 | live_loop :get_n6 do 81 | val = sync '/01_n6' 82 | n6 = val[0] 83 | end 84 | live_loop :get_n7 do 85 | val = sync '/01_n7' 86 | n7 = val[0] 87 | end 88 | live_loop :get_n8 do 89 | val = sync '/01_n8' 90 | n8 = val[0] 91 | end 92 | live_loop :get_n9 do 93 | val = sync '/01_n9' 94 | n9 = val[0] 95 | end 96 | live_loop :get_n10 do 97 | val = sync '/01_n10' 98 | n10 = val[0] 99 | end 100 | live_loop :get_n12 do 101 | val = sync '/01_n12' 102 | n12 = val[0] 103 | end 104 | live_loop :get_n13 do 105 | val = sync '/01_n13' 106 | n13 = val[0] 107 | end 108 | live_loop :get_n14 do 109 | val = sync '/01_n14' 110 | n14 = val[0] 111 | end 112 | live_loop :get_n15 do 113 | val = sync '/01_n15' 114 | n15 = val[0] 115 | end 116 | 117 | att = 0 118 | live_loop :get_att do 119 | val = sync '/01_att' 120 | att = val[0] 121 | end 122 | sus = 0 123 | live_loop :get_sus do 124 | val = sync '/01_sus' 125 | sus = val[0] 126 | end 127 | rel = 0.25 128 | live_loop :get_rel do 129 | val = sync '/01_rel' 130 | rel = val[0] 131 | end 132 | vol = 1 133 | live_loop :get_vol do 134 | val = sync '/01_vol' 135 | vol = val[0] 136 | end 137 | do_synth = :beep 138 | live_loop :get_synth do 139 | val = sync '/01_synth' 140 | do_synth = :beep if val[0] == 0 141 | do_synth = :blade if val[0] == 1 142 | do_synth = :prophet if val[0] == 2 143 | do_synth = :tb303 if val[0] == 3 144 | do_synth = :hoover if val[0] == 4 145 | do_synth = :growl if val[0] == 5 146 | do_synth = :tech_saws if val[0] == 6 147 | do_synth = :piano if val[0] == 7 148 | do_synth = :pluck if val[0] == 8 149 | do_synth = :pretty_bell if val[0] == 9 150 | end 151 | do_bpm = 120 152 | live_loop :get_bpm do 153 | val = sync '/01_bpm' 154 | do_bpm = val[0] 155 | end 156 | 157 | #This is a clock divider 158 | c_s = 0 159 | c_e = 0 160 | c_q = 0 161 | c_h = 0 162 | live_loop :clock do 163 | with_bpm do_bpm do 164 | cue :h, c_h 165 | c_h = c_h + 1 166 | cue :q, c_q 167 | c_q = c_q + 1 168 | cue :e, c_e 169 | c_e = c_e + 1 170 | cue :s, c_s 171 | c_s = c_s + 1 172 | sleep 0.25 173 | cue :s, c_s 174 | c_s = c_s + 1 175 | sleep 0.25 176 | cue :e, c_e 177 | c_e = c_e + 1 178 | cue :s, c_s 179 | c_s = c_s + 1 180 | sleep 0.25 181 | cue :s, c_s 182 | c_s = c_s + 1 183 | sleep 0.25 184 | cue :q, c_q 185 | c_q = c_q + 1 186 | cue :e, c_e 187 | c_e = c_e + 1 188 | cue :s, c_s 189 | c_s = c_s + 1 190 | sleep 0.25 191 | cue :s, c_s 192 | c_s = c_s + 1 193 | sleep 0.25 194 | cue :e, c_e 195 | c_e = c_e + 1 196 | cue :s, c_s 197 | c_s = c_s + 1 198 | sleep 0.25 199 | cue :s, c_s 200 | c_s = c_s + 1 201 | sleep 0.25 202 | end 203 | end 204 | 205 | 206 | live_loop :arp do 207 | use_synth do_synth 208 | use_synth_defaults attack: att, sustain: sus, release: rel, amp: vol 209 | val = sync do_sync 210 | play (ring n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15).take(length)[val[0]] if mode == 0 211 | play (chord root, type, num_octaves: 6).take(length)[val[0]] if mode == 1 212 | end 213 | -------------------------------------------------------------------------------- /APC/20191231_Heartbeat: -------------------------------------------------------------------------------- 1 | #20191231_Heartbeat 2 | #by Davids Fiddle 3 | 4 | 5 | 6 | #APC Utility BEGIN 7 | #Globals: 8 | use_bpm 60 #BPM for the piece 9 | use_sched_ahead_time 0.2 #Balance between playability and stability 10 | #States of the tracks: 11 | states = [3,0,3,0,3,0,3,0, 12 | 0,3,3,0,0,0,0,0, 13 | 0,3,3,0,0,0,0,0, 14 | 1,0,0,0,0,0,0,0, 15 | 0,0,0,0,0,0,0,0 16 | ] 17 | #0 means nothing will happen (disabled) 18 | #1 means green (active) 19 | #3 means red (inactive) 20 | #5 means toggle off (yellow), will switch to 7(also green) 21 | #7 means toggle off (green), will switch to 5(yellow) 22 | toggle = (ring 0,3,0,1,0,7,0,5) #For switching the lights 23 | knobs = [48,49,50,51,52,53,54,55] #Adresses for the knobs 24 | knob0 = 0 25 | knob1 = 0 26 | knob2 = 0 27 | knob3 = 0 28 | knob4 = 0 29 | knob5 = 0 30 | knob6 = 0 31 | knob7 = 0 32 | define :all_lights do 33 | #Updates all lights 34 | for x in (range 0,40) 35 | midi_note_on x, states[x] 36 | end 37 | end #:all_lights 38 | define :all_off do 39 | #Turns all lights off 40 | for i in (range 0,87) 41 | midi_note_on i,0 42 | end 43 | end #:all_off 44 | all_off 45 | sleep 0.1 46 | live_loop :midi_control do 47 | key,vel = sync "/midi/apc_key_25/0/1/note_on" #Wait for midi messages 48 | if key < 40 #Ignore messages 'out of bounds' 49 | states[key] = toggle[states[key]] #Update the track values 50 | midi_note_on key, states[key] #Update the track lights 51 | cue 'event', key 52 | end 53 | end #:midi_control 54 | live_loop :midi_cc do 55 | key,val = sync "/midi/apc_key_25/0/1/control_change" #Wait for midi messages 56 | case key 57 | when knobs[0] 58 | cue 'knob0', val 59 | knob0 = val 60 | when knobs[1] 61 | cue 'knob1', val 62 | knob1 = val 63 | when knobs[2] 64 | cue 'knob2', val 65 | knob2 = val 66 | when knobs[3] 67 | cue 'knob3', val 68 | knob3 = val 69 | when knobs[4] 70 | cue 'knob4', val 71 | knob4 = val 72 | when knobs[5] 73 | cue 'knob5', val 74 | knob5 = val 75 | when knobs[6] 76 | cue 'knob6', val 77 | knob6 = val 78 | when knobs[7] 79 | cue 'knob7', val 80 | knob7 = val 81 | end 82 | #Cues are sent per knob to avoid multiple listening loops syncing possibly 100 times in a second 83 | end #:midi_cc 84 | all_lights #initialise the lights 85 | sleep 0.1 86 | #APC_Utility END 87 | 88 | 89 | with_fx :reverb do 90 | with_fx :compressor do 91 | with_fx :distortion, distort: 0 do |dist| 92 | with_fx :echo, mix: 0.2, decay: 1 do 93 | live_loop :heartbleed do 94 | tick 95 | if states[24] == 1 96 | play :f1, amp: 1.5 97 | play :f2, amp: 1.5 98 | end 99 | sleep 1 100 | end #:heartbleed 101 | end #:echo 102 | live_loop :con_dist do 103 | val = sync "/cue/knob0" 104 | control dist, distort: val[0] / 172.0 105 | end 106 | end #:distortion 107 | 108 | 109 | notes = (ring :f2,:c3,:f3,:bb3,:c4,:eb4,:f4,:bb4,:c5,:eb5,:f5) 110 | live_loop :breath do 111 | tick 112 | use_synth :hollow 113 | use_synth_defaults attack: 2, sustain: 4, release: 2 114 | play_chord notes.pick(5) if states[4] == 1 115 | sleep 4 116 | end #:breath 117 | 118 | riff = (scale :f3, :minor_pentatonic, num_octaves: 2).pick(16) 119 | live_loop :riff do 120 | tick 121 | use_synth :prophet 122 | play riff.look + (ring 0,0,12,0,0,0,0).look if states[6] == 1 && rand_i(128) < knob1 123 | 124 | sleep 0.25 125 | end #:riff 126 | 127 | with_fx :echo, phase: 2.0/4, mix: 0.2 do |echo| 128 | live_loop :percussion do 129 | tick 130 | use_sample_defaults amp: 0.5 131 | 132 | 133 | sample :bass_dnb_f if rand() < 0.1 && states[0] == 1 134 | sample 'glitch', choose, pan: rrand(-0.3,0.3), 135 | rate: rrand(-1.5,1.5) if rand() < 0.1 && states[2] == 1 136 | sample :loop_industrial, onset: choose, pan: rrand(-0.3,0.3), 137 | rate: rrand(-1.5,1.5) if rand() < 0.1 && states[10] == 1 138 | sample 'perc', choose, pan: rrand(-0.3,0.3), 139 | rate: rrand(-1.5,1.5) if rand() < 0.1 && states[18] == 1 140 | sample :loop_electric, onset: choose, pan: rrand(-0.3,0.3), 141 | rate: rrand(-1.5,1.5) if rand() < 0.1 && states[9] == 1 142 | sample :loop_tabla, onset: choose, pan: rrand(-0.3,0.3), 143 | rate: rrand(-1.5,1.5) if rand() < 0.1 && states[17] == 1 144 | sleep (ring 0.25, 0.5).choose 145 | end #:percussion 146 | live_loop :con_echo do 147 | sync "/cue/knob2" 148 | control echo, phase: 2.0 / (knob2 / 8) 149 | end 150 | end #:echo 151 | end #:compressor 152 | end #:reverb 153 | -------------------------------------------------------------------------------- /Covers/Castlevania - Vampire Hunter: -------------------------------------------------------------------------------- 1 | #Castlevania - Vampire Killer 2 | #Coded by Davids Fiddle 3 | 4 | #Timing: 5 | use_bpm 120 6 | h = 2 #Half 7 | q = 1 #Quarter 8 | e = 0.5 #... 9 | s = 0.25 #... 10 | 11 | #Bass 12 | with_fx :level, amp: 1, amp_slide: 32 do |amp_bass| 13 | in_thread do 14 | use_synth :chipbass 15 | 3.times do 16 | #Verse 17 | 2.times do 18 | play_pattern_timed [:d3,:d3,:d3,:d3,:r,:r,:d3,:d3,:r,:r,:d3,:d3,:d3,:d3],[e,s,s,s,s,s,s,s,s,s,e,s,s,s] 19 | play_pattern_timed [:bb2,:bb2,:bb2,:bb3,:r,:r,:r,:c3,:c3,:c4,:c3,:c3,:c3,:c3,:c3],[e,s,s,s,s,s,s,s,s,s,s,s,s,s,s] 20 | end 21 | 2.times do 22 | play_pattern_timed [:d3,:d3,:d3,:d3,:r,:r,:d3,:d3,:r,:r,:d3,:d3,:d3,:d3],[e,s,s,s,s,s,s,s,s,s,e,s,s,s] 23 | play_pattern_timed [:bb2,:bb2,:bb2,:bb3,:r,:r,:r,:c3,:c3,:c4,:r,:c4,:r,:c4],[e,s,s,s,s,s,s,e,s,s,s,s,s,s] 24 | end 25 | #Chorus 26 | play_pattern_timed [:cs3,:d3,:e3,:d3,:cs3,:d3,:e3,:a3],[h,h,h,h,h,h,h,h] 27 | #Break 28 | 2.times do 29 | play_pattern_timed [:d3,:d3,:r,:d3,:c3,:d3,:r,:r,:bb2,:bb2,:r,:c3,:c3,:r],[e,e,s,s,e,e,e,q,e,e,q,e,e,q] 30 | end 31 | end 32 | #Verse 33 | 2.times do 34 | play_pattern_timed [:d3,:d3,:d3,:d3,:r,:r,:d3,:d3,:r,:r,:d3,:d3,:d3,:d3],[e,s,s,s,s,s,s,s,s,s,e,s,s,s] 35 | play_pattern_timed [:bb2,:bb2,:bb2,:bb3,:r,:r,:r,:c3,:c3,:c4,:c3,:c3,:c3,:c3,:c3],[e,s,s,s,s,s,s,s,s,s,s,s,s,s,s] 36 | end 37 | 2.times do 38 | play_pattern_timed [:d3,:d3,:d3,:d3,:r,:r,:d3,:d3,:r,:r,:d3,:d3,:d3,:d3],[e,s,s,s,s,s,s,s,s,s,e,s,s,s] 39 | play_pattern_timed [:bb2,:bb2,:bb2,:bb3,:r,:r,:r,:c3,:c3,:c4,:r,:c4,:r,:c4],[e,s,s,s,s,s,s,e,s,s,s,s,s,s] 40 | end 41 | end 42 | #Control the level FX for fadeout 43 | in_thread do 44 | sleep 32+16+16 45 | sleep 32+16+16 46 | sleep 32+16+16 47 | control amp_bass, amp: 0 48 | end 49 | end 50 | 51 | #Beat 52 | with_fx :level, amp: 1, amp_slide: 32 do |amp_beat| 53 | in_thread do 54 | use_synth :cnoise 55 | use_synth_defaults sustain: 0.05, release: 0.15 56 | 3.times do 57 | 8.times do 58 | play_pattern_timed [1,1,1,1,:r,:r,1,1,:r,:r,1,1,1,1],[e,s,s,s,s,s,s,s,s,s,e,s,s,s] 59 | end 60 | 4.times do 61 | play_pattern_timed [1,1,1,1,1,:r,:r,1,1,1,1,1,:r,:r,],[e,s,s,s,s,s,s,e,s,s,s,s,s,s] 62 | end 63 | 4.times do 64 | play_pattern_timed [1,1,1,:r,:r,:r,:r,1,:r,1,:r],[e,s,s,s,s,s,s,e,e,e,e] 65 | end 66 | end 67 | 8.times do 68 | play_pattern_timed [1,1,1,1,:r,:r,1,1,:r,:r,1,1,1,1],[e,s,s,s,s,s,s,s,s,s,e,s,s,s] 69 | end 70 | end 71 | #Control the level FX for fadeout 72 | in_thread do 73 | sleep 32+16+16 74 | sleep 32+16+16 75 | sleep 32+16+16 76 | control amp_beat, amp: 0 77 | end 78 | end 79 | 80 | #Lead 81 | with_fx :level, amp: 1, amp_slide: 32 do |amp_lead| 82 | with_fx :reverb do 83 | in_thread do 84 | use_synth :chiplead 85 | 3.times do 86 | #Verse 87 | play_pattern_timed [:d5,:d5,:r,:c5,:b4,:r,:d4,:e4,:f4,:g4,:a4,:d4,:a4,:g4,:c5,:r],[s,s,s,e,q,s,e+s,s,s,s,e+s,e+s,e,s,e+s,q] 88 | play_pattern_timed [:d5,:d5,:r,:c5,:b4,:r,:d4,:e4,:f4,:g4,:a4,:d4,:a4,:g4,:c4,:r],[s,s,s,e,q,s,e+s,s,s,s,e+s,e+s,e,s,e+s,q] 89 | 2.times do 90 | play_pattern_timed [:r,:d5,:a5,:gs5,:a5,:gs5,:f5,:r,:a5,:g5,:d5,:r,:a5,:gs5,:a5,:gs5,:a5,:g5,:f5,:f5,:e5,:d5],[e,e+s,e+s,s,s,s,s,q,e,s,s,s,s,s,s,s,s,s,e,s,s,s] 91 | end 92 | #Chorus 93 | play_pattern_timed [:cs5,:e5,:bb5,:a5,:f5,:d5,:cs5,:e5,:bb5,:a5,:f5,:r],[e+s,e+s,e,e+s,e+s,e,e+s,e+s,e,e+s,q,s] 94 | play_pattern_timed [:cs5,:e5,:bb5,:a5,:f5,:d5,:cs5,:e5,:bb5,:a5,:b6,:cs6],[e+s,e+s,e,e+s,e+s,e,e+s,e+s,e,e+s,e+s,e] 95 | #Break 96 | 2.times do 97 | play_pattern_timed [:d6,:d5,:r,:r,:r,:bb4,:d5,:r,:c5,:a4],[e,e,q,h,q,e,e,q,e,e] 98 | end 99 | end 100 | #Verse 101 | play_pattern_timed [:d5,:d5,:r,:c5,:b4,:r,:d4,:e4,:f4,:g4,:a4,:d4,:a4,:g4,:c5,:r],[s,s,s,e,q,s,e+s,s,s,s,e+s,e+s,e,s,e+s,q] 102 | play_pattern_timed [:d5,:d5,:r,:c5,:b4,:r,:d4,:e4,:f4,:g4,:a4,:d4,:a4,:g4,:c4,:r],[s,s,s,e,q,s,e+s,s,s,s,e+s,e+s,e,s,e+s,q] 103 | 2.times do 104 | play_pattern_timed [:r,:d5,:a5,:gs5,:a5,:gs5,:f5,:r,:a5,:g5,:d5,:r,:a5,:gs5,:a5,:gs5,:a5,:g5,:f5,:f5,:e5,:d5],[e,e+s,e+s,s,s,s,s,q,e,s,s,s,s,s,s,s,s,s,e,s,s,s] 105 | end 106 | end 107 | end 108 | in_thread do 109 | sleep 32+16+16 110 | sleep 32+16+16 111 | sleep 32+16+16 112 | control amp_lead, amp: 0 113 | end 114 | end 115 | 116 | #Pad 117 | in_thread do 118 | use_synth :blade 119 | use_synth_defaults amp: 0.5 120 | sleep 32+16+16 121 | 2.times do 122 | 4.times do 123 | play_pattern_timed [:d3,:d3,:bb2,:c3],[h,h,h,h] 124 | end 125 | play_pattern_timed [:cs3,:d3,:e3,:d3,:cs3,:d3,:e3,:a3],[h,h,h,h,h,h,h,h] 126 | 2.times do 127 | play_pattern_timed [:d3,:d3,:bb2,:c3],[h,h,h,h] 128 | end 129 | end 130 | end 131 | -------------------------------------------------------------------------------- /Synths/Perc-Synth: -------------------------------------------------------------------------------- 1 | #Percussive Synth 2 | #Coded by Davids Fiddle 3 | #v0.9 4 | 5 | #To Do: 6 | #More Testing! 7 | #Comments & Documentation 1.0 8 | 9 | #Midi adress to use. 10 | #To specify a device or channel. 11 | midi_on = "/midi/*/*/2/note_on" 12 | #Variables for voices: 13 | #Transposition for the voices 14 | trans0 = 0 15 | trans1 = 12 16 | trans2 = 0 17 | trans3 = 12 18 | #Volume for the voices 19 | amp0 = 1 20 | amp1 = 1 21 | amp2 = 0.7 22 | amp3 = 0.5 23 | #Synth for the voices 24 | syn0 = :piano 25 | syn1 = :piano 26 | syn2 = :piano 27 | syn3 = :piano 28 | #Release time for the other synths 29 | #Update is in the FX loop 30 | rel = 1 31 | att = 0 32 | #Preset Types, 1 for piano,3 for pluck, 5 for synth, -1 for empty 33 | presets = [1,5,5,1,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,] 34 | midi_note_on 0,presets[0] + 1,channel: 1 35 | #Reset the lights on the APC 36 | define :lights do 37 | for x in (range 0,16) #Adapt to your APC 38 | #midi_note_on x,0,channel: 1 39 | midi_note_on x,presets[x],channel: 1 40 | end 41 | end #:lights 42 | lights 43 | 44 | #Preset Section 45 | live_loop :presets do 46 | key,vel = sync "/midi/apc_key_25/0/1/note_on" 47 | if key << 40 48 | lights 49 | #Every key triggers a different preset 50 | if key == 0 51 | puts "Initial Piano" 52 | trans0 = 0 53 | trans1 = 12 54 | trans2 = 0 55 | trans3 = 12 56 | amp0 = 1 57 | amp1 = 1 58 | amp2 = 0.7 59 | amp3 = 0.5 60 | syn0 = :piano 61 | syn1 = :piano 62 | syn2 = :piano 63 | syn3 = :piano 64 | elsif key == 1 65 | puts "Synth 1" 66 | trans0 = 0 67 | trans1 = 12 68 | trans2 = 0 69 | trans3 = 12 70 | amp0 = 1 71 | amp1 = 1 72 | amp2 = 0.7 73 | amp3 = 0.5 74 | syn0 = :saw 75 | syn1 = :saw 76 | syn2 = :saw 77 | syn3 = :tri 78 | elsif key == 2 79 | puts "Synth 2" 80 | trans0 = 0 81 | trans1 = 7 82 | trans2 = 12 83 | trans3 = 0 84 | amp0 = 1 85 | amp1 = 0.5 86 | amp2 = 0.7 87 | amp3 = 1 88 | syn0 = :saw 89 | syn1 = :saw 90 | syn2 = :saw 91 | syn3 = :tri 92 | elsif key == 3 93 | puts "Big Piano" 94 | trans0 = 0 95 | trans1 = 12 96 | trans2 = 7 97 | trans3 = 12 98 | amp0 = 1 99 | amp1 = 1 100 | amp2 = 0.7 101 | amp3 = 0.5 102 | syn0 = :piano 103 | syn1 = :piano 104 | syn2 = :piano 105 | syn3 = :piano 106 | elsif key == 4 107 | puts "Basic Pluck" 108 | trans0 = 0 109 | trans1 = 12 110 | trans2 = 7 111 | trans3 = 12 112 | amp0 = 1 113 | amp1 = 1 114 | amp2 = 0.7 115 | amp3 = 0.5 116 | syn0 = :pluck 117 | syn1 = :pluck 118 | syn2 = :pluck 119 | syn3 = :pluck 120 | elsif key == 5 121 | #puts "Empty" 122 | elsif key == 6 123 | #puts "Empty" 124 | elsif key == 7 125 | #puts "Empty" 126 | elsif key == 8 127 | #puts "Empty" 128 | elsif key == 9 129 | #puts "Empty" 130 | elsif key == 10 131 | #puts "Empty" 132 | elsif key == 11 133 | #puts "Empty" 134 | elsif key == 12 135 | #puts "Empty" 136 | elsif key == 13 137 | #puts "Empty" 138 | elsif key == 14 139 | #puts "Empty" 140 | elsif key == 15 141 | #puts "Empty" 142 | end 143 | sleep 0.1 144 | midi_note_on key,presets[key] + 1,channel: 1 145 | end 146 | end #:presets 147 | 148 | #FX Section 149 | with_fx :reverb, mix: 0, room: 0.9922 do |verb| 150 | with_fx :echo, mix: 0, phase: 2.0344, decay: 8 do |echo| 151 | with_fx :ixi_techno, mix: 0, phase: 7.9875 do |tech| 152 | #This loop handles the fx controls 153 | live_loop :con_fx do 154 | use_real_time 155 | key,val = sync "/midi/*/*/*/control_change" 156 | if key == 52 157 | control echo, mix: val / 128.0 158 | elsif key == 53 159 | control echo, phase: val / 64.0 + 0.05 160 | elsif key == 54 161 | control verb, mix: val / 128.0 162 | elsif key == 55 163 | control echo, room: val / 128.0 164 | elsif key == 48 165 | att = val / 256.0 166 | elsif key == 49 167 | rel = val / 128.0 168 | elsif key == 50 169 | control tech, mix: val / 128.0 170 | elsif key == 51 171 | control tech, phase: val / 16.0 + 0.05 172 | end 173 | end #:con_fx 174 | live_loop :voices do 175 | use_synth_defaults sustain: 0, release: rel, attack: att 176 | use_real_time 177 | key,vel = sync midi_on #Listen for any MIDI-on message 178 | if vel != 0 179 | synth syn0, note: key + trans0, amp: amp0 180 | synth syn1, note: key + trans1, amp: amp1 181 | synth syn2, note: key + trans2, amp: amp2 182 | synth syn3, note: key + trans3, amp: amp3 183 | end 184 | end #:voices 185 | end #:ixi_techno 186 | end #:echo 187 | end #:reverb 188 | -------------------------------------------------------------------------------- /Covers/Clubbed to Death: -------------------------------------------------------------------------------- 1 | #Clubbed to Death - Matrix 2 | #Coded by Davids Fiddle 3 | 4 | use_bpm 104 5 | 6 | w = 4 7 | dh = 3 8 | h = 2 9 | dq = 1.5 10 | q = 1 11 | e = 0.5 12 | s = 0.25 13 | t = 0.125 14 | 15 | amp_bass = 1.3 16 | amp_cello = 1 17 | amp_oboe = 0.8 18 | amp_piano = 1.3 19 | amp_vln = 1.4 20 | amp_hilo = 0.4 21 | 22 | speed = 0.7 23 | 24 | 25 | define :drums do 26 | 2.times do 27 | sample :drum_bass_hard 28 | sleep e 29 | end 30 | sample :drum_snare_hard 31 | sleep e+q 32 | sample :drum_bass_hard 33 | sleep s 34 | sample :drum_bass_hard 35 | sleep s 36 | sample :drum_snare_hard 37 | sleep q 38 | end 39 | 40 | define :hihat do 41 | 16.times do 42 | sample :drum_cymbal_pedal, cutoff: 100, amp: 0.8 43 | sleep s 44 | end 45 | end 46 | 47 | define :bass_riff do 48 | use_synth :blade 49 | use_synth_defaults attack: s, decay: s, sustain: h+q+e, 50 | release: e, amp: amp_bass 51 | play_pattern_timed [:g1,:a1,:bb1,:c2],[w,w,w,w] 52 | end 53 | 54 | define :bass_intro do 55 | use_bpm_mul speed 56 | use_synth :blade 57 | play_pattern_timed [:g1,:a1,:bb1,:c2,:eb2,:d2,:f2],[h,h,h,h,w,h,h] 58 | end 59 | 60 | define :cello_riff do 61 | use_synth :blade 62 | use_synth_defaults attack: s, decay: s, sustain: h+q+e, 63 | release: e, amp: amp_cello 64 | play_pattern_timed [:g2,:g2,:g2,:g2],[w,w,w,w] 65 | end 66 | 67 | define :cello_intro do 68 | use_bpm_mul speed 69 | use_synth :blade 70 | use_synth_defaults #amp: amp_vln 71 | play_pattern_timed [:r,:bb2,:g2,:c3,:a2,:r,:d3,:bb2,:bb2,:a2,:c3],[q,e,e,q,q,q,e,e,q,e,e] 72 | play_pattern_timed [:r,:bb2,:d3,:g3,:c3,:bb2,:a2],[q,e,e,q,q,h,h] 73 | end 74 | 75 | 76 | define :oboe do 77 | use_synth :prophet 78 | use_synth_defaults cutoff: 80, amp: amp_oboe 79 | 2.times do 80 | play_pattern_timed [:bb4,:a4,:ab4,:g4],[t,t,t,t] 81 | sleep h+q+e 82 | sleep w 83 | end 84 | end 85 | 86 | define :piano do 87 | with_fx :reverb do 88 | use_synth :piano 89 | use_synth_defaults amp: amp_piano 90 | play_pattern_timed [:r,:d4,:g4,:d4,:bb4,:a4,:g4],[e,e,e,e,q,e,e] 91 | end 92 | end 93 | 94 | define :violin_high do 95 | use_synth :blade 96 | use_synth_defaults amp: amp_vln 97 | play_pattern_timed [:bb4,:a4,:g4,:bb4,:a4,:g4,:c5],[w+h+q+e,s,s,h+q+e,s,s,w] 98 | end 99 | 100 | define :violin_quarters do 101 | use_synth :blade 102 | use_synth_defaults amp: amp_vln 103 | play_pattern [:g4,:g4,:g4,:g4] 104 | end 105 | 106 | define :violin_slow do 107 | use_synth :blade 108 | use_synth_defaults amp: amp_vln 109 | play_pattern_timed [:g3,:bb3,:a3,:c4],[dh,q,w,w+w] 110 | end 111 | 112 | define :violin_intro do 113 | use_bpm_mul speed 114 | use_synth :blade 115 | use_synth_defaults #amp: amp_vln 116 | play_pattern_timed [:r,:bb3,:g3,:c4,:a3,:r,:d4,:bb3,:bb3,:a3,:c4],[q,e,e,q,q,q,e,e,q,e,e] 117 | play_pattern_timed [:r,:bb3,:d4,:g4,:c4,:bb3,:a3],[q,e,e,q,q,h,h] 118 | end 119 | 120 | define :hilo do 121 | use_synth :chiplead 122 | use_synth_defaults amp: amp_hilo 123 | sleep h 124 | hi = play :g4, sustain: h, note_slide: s 125 | control hi, note: :g5 126 | sleep q 127 | control hi, note: :g4 128 | sleep q 129 | sleep w 130 | end 131 | 132 | #Intros 133 | in_thread do 134 | bass_intro 135 | end 136 | in_thread do 137 | cello_intro 138 | end 139 | in_thread do 140 | violin_intro 141 | end 142 | 143 | #Bass 144 | in_thread do 145 | use_synth_defaults pan: 0.1 146 | sleep 6*w 147 | 16.times do 148 | bass_riff 149 | end 150 | end 151 | 152 | #Cello 153 | in_thread do 154 | use_synth_defaults pan: -0.1 155 | sleep 6*w 156 | sleep 2*4*w 157 | with_fx :flanger, phase: 8 do 158 | 8.times do 159 | cello_riff 160 | end 161 | end 162 | end 163 | 164 | #Violin 165 | in_thread do 166 | use_synth_defaults pan: 0.1 167 | sleep 6*w 168 | sleep 6*4*w 169 | 4.times do 170 | violin_high 171 | end 172 | 4.times do 173 | 4.times do 174 | violin_quarters 175 | end 176 | end 177 | 2.times do 178 | violin_slow 179 | end 180 | end 181 | 182 | #Drums 183 | in_thread do 184 | sleep 6*w 185 | 16.times do 186 | 4.times do 187 | drums 188 | end 189 | end 190 | end 191 | 192 | #Hihat 193 | in_thread do 194 | sleep 6*w 195 | 16.times do 196 | 4.times do 197 | hihat 198 | end 199 | end 200 | end 201 | 202 | #Oboe 203 | in_thread do 204 | use_synth_defaults pan: 0.1 205 | with_fx :compressor do 206 | with_fx :reverb, room: 0.9 do 207 | sleep 6*w 208 | sleep 4*w 209 | 13.times do 210 | oboe 211 | end 212 | end 213 | end 214 | end 215 | 216 | #Hilo 217 | in_thread do 218 | use_synth_defaults pan: -0.1 219 | sleep 6*w 220 | sleep 4*4*w 221 | with_fx :compressor do 222 | 6.times do 223 | 2.times do 224 | hilo 225 | end 226 | end 227 | end 228 | end 229 | 230 | #Piano 231 | in_thread do 232 | use_synth_defaults pan: 0.1 233 | sleep 6*w 234 | sleep 11*4*w 235 | with_fx :reverb do 236 | 5.times do 237 | 4.times do 238 | piano 239 | end 240 | end 241 | end 242 | end 243 | -------------------------------------------------------------------------------- /DF-xx/DF-03 for Sonic Pi: -------------------------------------------------------------------------------- 1 | #DF-03 Machine 2 | #Coded by Davids Fiddle 3 | #v1.2 4 | 5 | this_note = 60 6 | this_vol = 1 7 | this_bpm = 60 8 | att = 0 9 | dec = 0 10 | sus = 0 11 | rel = 1 12 | mode = 0 13 | this_synth = :beep 14 | use_bpm 60 15 | 16 | #Love_loops to receive the ADSR, volume, mode and source values 17 | live_loop :get_note do 18 | val = sync '/osc/03_note' 19 | this_note = val[0] 20 | end 21 | live_loop :get_vol do 22 | val = sync '/osc/03_vol' 23 | this_vol = val[0] 24 | end 25 | live_loop :get_bpm do 26 | val = sync '/osc/03_bpm' 27 | this_bpm = val[0] 28 | end 29 | live_loop :get_att do 30 | val = sync '/osc/03_att' 31 | att = val[0] 32 | end 33 | live_loop :get_dec do 34 | val = sync '/osc/03_dec' 35 | dec = val[0] 36 | end 37 | live_loop :get_sus do 38 | val = sync '/osc/03_sus' 39 | sus = val[0] 40 | end 41 | live_loop :get_rel do 42 | val = sync '/osc/03_rel' 43 | rel = val[0] 44 | end 45 | live_loop :get_mode do 46 | val = sync '/osc/03_mode' 47 | mode = val[0] 48 | end 49 | live_loop :get_synth do 50 | val = sync '/osc/03_synth' 51 | this_synth = :beep if val[0] == 0 52 | this_synth = :pulse if val[0] == 1 53 | this_synth = :blade if val[0] == 2 54 | this_synth = :square if val[0] == 3 55 | this_synth = :tri if val[0] == 4 56 | this_synth = :saw if val[0] == 5 57 | this_synth = :prophet if val[0] == 6 58 | this_synth = :tb303 if val[0] == 7 59 | this_synth = :noise if val[0] == 8 60 | this_synth = :bnoise if val[0] == 9 61 | end 62 | live_loop :get_mode do 63 | val = sync '/osc/03_mode' 64 | mode = val[0] 65 | end 66 | 67 | with_fx :reverb, mix: 0, mix_slide: 1, room: 0.6, room_slide: 1 do |re| 68 | with_fx :ixi_techno, mix: 0, mix_slide: 1, phase: 8, phase_slide: 1, cutoff_max: 120, cutoff_max_slide: 1, cutoff_min: 60, cutoff_min_slide: 1 do |ix| 69 | with_fx :bitcrusher, mix: 0, mix_slide: 1, bits: 16, bits_slide: 1 do |bc| 70 | with_fx :octaver, mix: 0, mix_slide: 1 do |oc| 71 | with_fx :ring_mod, mix: 0, mix_slide: 1, freq: 30, freq_slide: 2 do |rm| 72 | #Live_loops for the sources: 73 | #BPM: 74 | live_loop :tick_tock do 75 | sync :tick_tock2 76 | cue :beat3 77 | use_synth this_synth 78 | use_synth_defaults sustain_level: 0.75, attack: att, decay: dec, sustain: sus, release: rel 79 | with_bpm this_bpm do 80 | play this_note, amp: this_vol if mode == 0 81 | sleep 1 82 | end 83 | end 84 | #2*BPM 85 | live_loop :tick_tock2 do 86 | use_synth this_synth 87 | use_synth_defaults sustain_level: 0.75, attack: att, decay: dec, sustain: sus, release: rel 88 | with_bpm this_bpm do 89 | play this_note, amp: this_vol if mode == 3 90 | sleep 0.5 91 | end 92 | end 93 | #Random 94 | live_loop :radom do 95 | use_synth this_synth 96 | use_synth_defaults sustain_level: 0.75, attack: att, decay: dec, sustain: sus, release: rel 97 | with_bpm this_bpm do 98 | play this_note, amp: this_vol if mode == 2 99 | sleep (range 0.2,2,0.2).choose 100 | end 101 | end 102 | #Manual 103 | live_loop :manual do 104 | sync '/osc/03_manu' 105 | use_synth this_synth 106 | play this_note, amp: this_vol 107 | end 108 | #Live_loops for recieving the Osc messages 109 | live_loop :get_oc_mix do 110 | val = sync '/osc/03_oc_mix' 111 | control oc, mix: val[0] if val[0] <= 1 112 | end 113 | live_loop :get_rm_mix do 114 | val = sync '/osc/03_rm_mix' 115 | control rm, mix: val[0] if val[0] <= 1 116 | end 117 | live_loop :get_rm_freq do 118 | val = sync '/osc/03_rm_freq' 119 | control rm, freq: val[0] 120 | end 121 | live_loop :get_bc_mix do 122 | val = sync '/osc/03_bc_mix' 123 | control bc, mix: val[0] if val[0] <= 1 124 | end 125 | live_loop :get_bc_bits do 126 | val = sync '/osc/03_bc_bits' 127 | control bc, bits: val[0] 128 | end 129 | live_loop :get_ix_mix do 130 | val = sync '/osc/03_ix_mix' 131 | control ix, mix: val[0] if val[0] <= 1 132 | end 133 | live_loop :get_ix_phase do 134 | val = sync '/osc/03_ix_phase' 135 | control ix, phase: val[0] 136 | end 137 | live_loop :get_ix_min do 138 | val = sync '/osc/03_ix_min' 139 | control ix, cutoff_min: val[0] 140 | end 141 | live_loop :get_ix_max do 142 | val = sync '/osc/03_ix_max' 143 | control ix, cutoff_max: val[0] 144 | end 145 | live_loop :get_re_mix do 146 | val = sync '/osc/03_re_mix' 147 | control re, mix: val[0] if val[0] <= 1 148 | end 149 | live_loop :get_re_room do 150 | val = sync '/osc/03_re_room' 151 | control re, room: val[0] 152 | end 153 | end 154 | end 155 | end 156 | end 157 | end 158 | -------------------------------------------------------------------------------- /Strawberry Synth/Mono Synth v0.5: -------------------------------------------------------------------------------- 1 | #Monophonic Synth for the Strawberry Synth Project 2 | #Coded by Davids Fiddle 3 | #v0.5 4 | 5 | use_debug false 6 | 7 | #Variables 8 | current = 0 9 | #Adresses of the midi device used for this synth 10 | io_midi_on = "/midi/apc_key_25_midi_1/1/2/note_on" 11 | io_midi_off = "/midi/apc_key_25_midi_1/1/2/note_off" 12 | io_midi_knob = "/midi/apc_key_25_midi_1/1/1/control_change" 13 | io_midi_buttons = "/midi/apc_key_25_midi_1/1/1/note_on" 14 | io_knob_lpf = 51 15 | io_knob_hpf = 55 16 | io_knob_res = 50 17 | io_knob_att = 48 18 | io_knob_rel = 49 19 | io_knob_slide = 54 20 | #Synth voice settings 21 | att = 0 22 | rel = 0.1 23 | tslide = 0 24 | #synth_defaults 25 | dep = 1 #for :fm 26 | div = 2 #for :fm 27 | res = 0.8 #resonance, for multiple synths 28 | pwm = 0.5 #pulse width 29 | #sound source to use 30 | syn0 = :tri 31 | syn1 = :tri 32 | syn2 = :tri 33 | #transposition from the pressed key 34 | trans0 = 0 35 | trans1 = 0 36 | trans2 = 0 37 | #fine detune 38 | det0 = 0 39 | det1 = 0 40 | det2 = 0 41 | #volume of the source 42 | amp0 = 1 43 | amp1 = 1 44 | amp2 = 1 45 | #FX settings 46 | lpf_cut = 127 47 | hpf_cut = 0 48 | 49 | #reading attack/release/slide times 50 | live_loop :get_ar do 51 | key, val sync io_midi_knob 52 | if key == io_knob_att 53 | att = val / 64.0 54 | elsif key == io_knob_rel 55 | rel = val / 64.0 56 | elsif key == io_knob_slide 57 | tslide = val / 32.0 58 | end 59 | end 60 | 61 | #Synthesis starts here: 62 | with_fx :rlpf, cutoff: 127, cutoff_slide: 0.1, res: 0.5, res_slide: 0.1 do |lpf| 63 | with_fx :rhpf, cutoff: 0, cutoff_slide: 0.1, res: 0.5, res_slide: 0.1 do |hpf| 64 | #FX controls 65 | live_loop :con_filter do 66 | key, val sync io_midi_knob 67 | if key == io_knob_lpf 68 | control lpf, cutoff: val #input = midi note 69 | elsif key == io_knob_hpf 70 | control hpf, cutoff: val #input = midi note 71 | elsif key == io_knob_res 72 | control lpf, res: val / 127.1 #mapped to 0<=res<1 73 | control hpf, res: val / 127.1 #mapped to 0<=res<1 74 | end 75 | end 76 | 77 | #Voice loop 78 | live_loop :voice do 79 | use_real_time #should remove latency 80 | key, vel = sync 'voice_on' 81 | use_synth_defaults depth: dep, divisor: div, res: res #pulse width? 82 | v0 = synth syn0, note: note: (ramp *(ring :r,*(range 1,127),:r))[key + trans0] + (det0 / 100.0), sustain: 360, amp: amp0, attack: att, amp_slide: rel, note_slide: tslide 83 | v1 = synth syn1, note: note: (ramp *(ring :r,*(range 1,127),:r))[key + trans1] + (det2 / 100.0), sustain: 360, amp: amp1, attack: att, amp_slide: rel, note_slide: tslide 84 | v2 = synth syn2, note: note: (ramp *(ring :r,*(range 1,127),:r))[key + trans2] + (det1 / 100.0), sustain: 360, amp: amp2, attack: att, amp_slide: rel, note_slide: tslide 85 | key sync 'voice_change' 86 | if key == -1 87 | kill v0 88 | kill v1 89 | kill v2 90 | else 91 | control v0, note: (ramp *(ring :r,*(range 1,127),:r))[key + trans0] + (det0 / 100.0) 92 | control v1, note: (ramp *(ring :r,*(range 1,127),:r))[key + trans1] + (det1 / 100.0) 93 | control v2, note: (ramp *(ring :r,*(range 1,127),:r))[key + trans2] + (det2 / 100.0) 94 | end 95 | end 96 | 97 | live_loop :key_on do 98 | key, vel = sync io_midi_on 99 | if key == current 100 | cue 'voice_on', key, vel 101 | else 102 | cue 'voice_change', key, vel 103 | end 104 | end 105 | live_loop :key_off do 106 | key, vel = sync io_midi_off 107 | cue 'voice_change', key, -1 if key == current 108 | end 109 | 110 | end#Filter end 111 | end 112 | 113 | #Preset listener: 114 | 115 | live_loop :look_preset do 116 | key, vel = sync io_midi_buttons 117 | #Trigger presets when a button is pressed and reset lights. The preset defs activate the lights. 118 | #Lights will flash if a preset is not filled 119 | reset_preset_lights 120 | preset0 if key == 81 121 | preset1 if key == 64 122 | preset2 if key == 65 123 | preset3 if key == 66 124 | preset4 if key == 67 125 | preset5 if key == 68 126 | preset6 if key == 69 127 | preset7 if key == 70 128 | preset7 if key == 71 129 | 130 | end 131 | 132 | #reset the lights on the presets 133 | define :reset_preset_lights do 134 | #one call for every button that is used for presets 135 | midi_note_on 64,0,channel: 1 136 | midi_note_on 65,0,channel: 1 137 | midi_note_on 66,0,channel: 1 138 | midi_note_on 67,0,channel: 1 139 | midi_note_on 68,0,channel: 1 140 | midi_note_on 69,0,channel: 1 141 | midi_note_on 70,0,channel: 1 142 | midi_note_on 71,0,channel: 1 143 | midi_note_on 81,0,channel: 1 144 | end 145 | 146 | #Definitions for all presets 147 | define :preset0 do 148 | midi_note_on 81,1,channel: 1 149 | puts "00-Raw" #Name of this Preset 150 | #attack/release times 151 | att = 0 152 | rel = 0 153 | dep = 1 #for :fm 154 | div = 2 #for :fm 155 | res = 0.8 #resonance, for multiple synths 156 | pwm = 0.5 #pulse width 157 | #sound source to use 158 | syn0 = :tri 159 | syn1 = :tri 160 | syn2 = :tri 161 | #transposition from the pressed key 162 | trans0 = 0 163 | trans1 = 0 164 | trans2 = 0 165 | #fine detune 166 | det0 = 0 167 | det1 = 0 168 | det2 = 0 169 | #volume of the source 170 | amp0 = 1 171 | amp1 = 1 172 | amp2 = 1 173 | end 174 | define :preset1 do 175 | midi_note_on 64,2,channel: 1 176 | puts "01-FM" #Name of this Preset 177 | #attack/release times 178 | att = 0 179 | rel = 0.1 180 | dep = 1 #for :fm 181 | div = 2 #for :fm 182 | res = 0.8 #resonance, for multiple synths 183 | pwm = 0.5 #pulse width 184 | #sound source to use 185 | syn0 = :fm 186 | syn1 = :fm 187 | syn2 = :fm 188 | #transposition from the pressed key 189 | trans0 = 0 190 | trans1 = 0 191 | trans2 = 12 192 | #fine detune 193 | det0 = 0 194 | det1 = -2 195 | det2 = 0 196 | #volume of the source 197 | amp0 = 1 198 | amp1 = 1 199 | amp2 = 0.8 200 | end 201 | define :preset2 do 202 | midi_note_on 65,2,channel: 1 203 | puts "02-Empty" #Name of this Preset 204 | end 205 | define :preset3 do 206 | midi_note_on 66,2,channel: 1 207 | puts "03-Empty" #Name of this Preset 208 | end 209 | define :preset4 do 210 | midi_note_on 67,2,channel: 1 211 | puts "04-Empty" #Name of this Preset 212 | end 213 | define :preset5 do 214 | midi_note_on 68,2,channel: 1 215 | puts "05-Empty" #Name of this Preset 216 | end 217 | define :preset6 do 218 | midi_note_on 69,2,channel: 1 219 | puts "06-Empty" #Name of this Preset 220 | end 221 | define :preset7 do 222 | midi_note_on 70,2,channel: 1 223 | puts "07-Empty" #Name of this Preset 224 | end 225 | define :preset8 do 226 | midi_note_on 71,2,channel: 1 227 | puts "08-Empty" #Name of this Preset 228 | end 229 | -------------------------------------------------------------------------------- /DF-xx/DF-00 for Sonic Pi: -------------------------------------------------------------------------------- 1 | #DF-00 Drum Machine 2 | #Coded by Davids Fiddle 3 | #Inspired by Mehackit 4 | #v1.0 5 | 6 | #globals: 7 | #volume 8 | amp_kik = 1 9 | amp_hihat = 1 10 | amp_snare = 1 11 | amp_tom = 1 12 | amp_misc = 1 13 | #patterns 14 | #0=silence, 1=normal, 2...=special 15 | pat_kik = [0] 16 | pat_hihat = [0] 17 | pat_snare = [0] 18 | pat_tom = [0] 19 | pat_misc = [0] 20 | #FX 21 | speed = 60 22 | verb_mix = 0 23 | verb_room = 0.6 24 | #samples 25 | sample_kik = :drum_bass_hard 26 | sample_hihat1 = :drum_cymbal_pedal 27 | sample_hihat2 = :drum_cymbal_closed 28 | sample_snare = :drum_snare_hard 29 | sample_tom1 = :drum_tom_lo_hard 30 | sample_tom2 = :drum_tom_mid_hard 31 | sample_tom3 = :drum_tom_hi_hard 32 | sample_misc1 = :drum_cowbell 33 | sample_misc2 = :drum_splash_hard 34 | sample_misc3 = :vinyl_scratch 35 | sample_misc4 = :perc_swash 36 | 37 | #get OSC messages 38 | #volume 39 | live_loop :get_amp_kik do 40 | val = sync "/00_amp_kik" 41 | amp_kik = val[0] 42 | end 43 | live_loop :get_amp_hihat do 44 | val = sync "/00_amp_hihat" 45 | amp_hihat = val[0] 46 | end 47 | live_loop :get_amp_snare do 48 | val = sync "/00_amp_snare" 49 | amp_snare = val[0] 50 | end 51 | live_loop :get_amp_tom do 52 | val = sync "/00_amp_tom" 53 | amp_tom = val[0] 54 | end 55 | live_loop :get_amp_misc do 56 | val = sync "/00_amp_misc" 57 | amp_misc = val[0] 58 | end 59 | #patterns 60 | live_loop :get_pat_kik do 61 | val = sync "/00_pat_kik" 62 | pat_kik = [0,0,0,0,0,0,0,0] if val[0] == 0 63 | pat_kik = [1,0,0,0,1,0,0,0] if val[0] == 1 64 | pat_kik = [1,0,0,1,1,0,0,0] if val[0] == 2 65 | pat_kik = [1,0,0,0,1,1,0,0] if val[0] == 3 66 | pat_kik = [1,0,1,0,1,0,1,0] if val[0] == 4 67 | pat_kik = [1,0,1,0,0,0,1,0] if val[0] == 5 68 | pat_kik = [1,1,1,1,1,1,1,1] if val[0] == 6 69 | end 70 | live_loop :get_pat_hihat do 71 | val = sync "/00_pat_hihat" 72 | pat_hihat = [0,0,0,0,0,0,0,0] if val[0] == 0 73 | pat_hihat = [1,1,1,1,1,1,1,1] if val[0] == 1 74 | pat_hihat = [1,1,2,1,1,1,0,1] if val[0] == 2 75 | pat_hihat = [1,2,1,1,1,2,1,1] if val[0] == 3 76 | pat_hihat = [1,2,1,2,1,2,1,2] if val[0] == 4 77 | pat_hihat = [1,1,2,1,1,1,2,1] if val[0] == 5 78 | pat_hihat = [1,2,1,0,1,2,1,0] if val[0] == 6 79 | end 80 | live_loop :get_pat_snare do 81 | val = sync "/00_pat_snare" 82 | pat_snare = [0,0,0,0,0,0,0,0] if val[0] == 0 83 | pat_snare = [0,0,1,0,0,0,1,0] if val[0] == 1 84 | pat_snare = [0,0,1,0,0,1,1,0] if val[0] == 2 85 | pat_snare = [0,0,1,0,0,1,0,1] if val[0] == 3 86 | pat_snare = [0,1,0,1,0,1,0,1] if val[0] == 4 87 | pat_snare = [0,0,1,0,1,0,0,0] if val[0] == 5 88 | pat_snare = [1,1,1,1,1,1,1,1] if val[0] == 6 89 | end 90 | live_loop :get_pat_tom do 91 | val = sync "/00_pat_tom" 92 | pat_tom = [0,0,0,0,0,0,0,0] if val[0] == 0 93 | pat_tom = [0,0,1,2,0,0,0,0] if val[0] == 1 94 | pat_tom = [0,0,0,0,3,1,0,0] if val[0] == 2 95 | pat_tom = [0,0,1,0,0,2,3,0] if val[0] == 3 96 | pat_tom = [1,2,0,0,0,3,0,1] if val[0] == 4 97 | pat_tom = [0,0,0,1,0,0,0,2] if val[0] == 5 98 | pat_tom = [0,0,0,3,0,2,0,1] if val[0] == 6 99 | pat_tom = [0,3,0,2,0,1,0,0] if val[0] == 7 100 | end 101 | live_loop :get_pat_misc do 102 | val = sync "/00_pat_misc" 103 | pat_misc = [0,0,0,0,0,0,0,0] if val[0] == 0 104 | pat_misc = [0,2,0,0,0,0,0,0] if val[0] == 1 105 | pat_misc = [0,2,0,0,0,2,0,0] if val[0] == 2 106 | pat_misc = [0,1,1,0,1,1,0,0] if val[0] == 3 107 | pat_misc = [3,3,0,0,0,0,0,0] if val[0] == 4 108 | pat_misc = [0,4,0,0,0,4,4,0] if val[0] == 5 109 | pat_misc = [0,4,0,0,0,2,4,0] if val[0] == 6 110 | pat_misc = [0,4,0,2,0,0,1,0] if val[0] == 7 111 | end 112 | #FX 113 | live_loop :get_speed do 114 | val = sync "/00_speed" 115 | speed = val[0] 116 | end 117 | #samples 118 | live_loop :get_sam_kik do 119 | val = sync "/00_sam_kik" 120 | sample_kik = :drum_bass_hard if val[0] == 0 121 | sample_kik = :bd_ada if val[0] == 1 122 | sample_kik = :bd_haus if val[0] == 2 123 | sample_kik = :bd_sone if val[0] == 3 124 | end 125 | live_loop :get_sam_hihat1 do 126 | val = sync "/00_sam_hihat1" 127 | sample_hihat1 = :drum_cymbal_pedal if val[0] == 0 128 | sample_hihat1 = :drum_cymbal_closed if val[0] == 1 129 | end 130 | live_loop :get_sam_hihat2 do 131 | val = sync "/00_sam_hihat2" 132 | sample_hihat2 = :drum_cymbal_closed if val[0] == 0 133 | sample_hihat2 = :drum_cymbal_open if val[0] == 1 134 | end 135 | live_loop :get_sam_snare do 136 | val = sync "/00_sam_snare" 137 | sample_snare = :drum_snare_hard if val[0] == 0 138 | sample_snare = :sn_dub if val[0] == 1 139 | sample_snare = :sn_dolf if val[0] == 2 140 | sample_snare = :sn_zome if val[0] == 3 141 | end 142 | 143 | 144 | 145 | #Heartbeat 146 | live_loop :beat do 147 | with_bpm speed do 148 | cue :heartbeat 149 | sleep 0.5 150 | end 151 | end 152 | 153 | #play 154 | with_fx :reverb, mix: 0, mix_slide: 1, room: 0.6, room_slide: 1 do |effect| 155 | 156 | #kik 157 | live_loop :do_kik do 158 | #sync stuff 159 | sync_bpm :heartbeat 160 | tick 161 | #samples 162 | sample sample_kik, amp: amp_kik if pat_kik.ring.look == 1 163 | end 164 | 165 | #hihat 166 | live_loop :do_hihat do 167 | #sync stuff 168 | sync_bpm :heartbeat 169 | tick 170 | #samples 171 | sample sample_hihat1, amp: amp_hihat if pat_hihat.ring.look == 1 172 | sample sample_hihat2, amp: amp_hihat if pat_hihat.ring.look == 2 173 | end 174 | 175 | #snare 176 | live_loop :do_snare do 177 | #sync stuff 178 | sync_bpm :heartbeat 179 | tick 180 | #samples 181 | sample sample_snare, amp: amp_snare if pat_snare.ring.look == 1 182 | end 183 | 184 | #tom 185 | live_loop :do_tom do 186 | #sync stuff 187 | sync_bpm :heartbeat 188 | tick 189 | #samples 190 | sample sample_tom1, amp: amp_tom if pat_tom.ring.look == 1 191 | sample sample_tom2, amp: amp_tom if pat_tom.ring.look == 2 192 | sample sample_tom3, amp: amp_tom if pat_tom.ring.look == 3 193 | end 194 | 195 | #misc 196 | live_loop :do_misc do 197 | #sync stuff 198 | sync_bpm :heartbeat 199 | tick 200 | #samples 201 | sample sample_misc1, amp: amp_misc if pat_misc.ring.look == 1 202 | sample sample_misc2, amp: amp_misc if pat_misc.ring.look == 2 203 | sample sample_misc3, amp: amp_misc if pat_misc.ring.look == 3 204 | sample sample_misc4, amp: amp_misc if pat_misc.ring.look == 4 205 | end 206 | 207 | #get for fx-control has to be inside the fx 208 | live_loop :get_verb_mix do 209 | val = sync "/00_verb_mix" 210 | verb_mix = val[0] 211 | control effect, mix: verb_mix 212 | end 213 | live_loop :get_verb_room do 214 | val = sync "/00_verb_room" 215 | verb_room = val[0] 216 | control effect, room: verb_room 217 | end 218 | end 219 | -------------------------------------------------------------------------------- /Strawberry Synth/Mono Synth v0.3: -------------------------------------------------------------------------------- 1 | #Strawberry Synth v0.3 2 | #State 05.11.2017 3 | #Coded by Davids Fiddle 4 | 5 | #Midi device, channel 6 | sync_adress_key_on = "/midi/apc_key_25_midi_1/1/2/note_on" 7 | sync_adress_key_off = "/midi/apc_key_25_midi_1/1/2/note_off" 8 | sync_adress_key_filter = "/midi/apc_key_25_midi_1/1/1/control_change" 9 | 10 | #settings for synthesis 11 | slide = 0 12 | runP0 = 0 #marker if this block is running 13 | trans0 = 0 #transposition of this oscillator 14 | trans1 = 0 15 | trans2 = 0 16 | det0 = 0 #detune in cent of this oscillator 17 | det1 = 0 18 | det2 = 0 19 | vol0 = 1 #volume of this oscillator 20 | vol1 = 1 21 | vol2 = 1 22 | syn0 = :saw #synth used for this oscillator 23 | syn1 = :saw 24 | syn2 = :saw 25 | 26 | 27 | ######################## 28 | #Key Section starts here 29 | ######################## 30 | 31 | #Filters for Keys 32 | with_fx :rhpf, cutoff: 0, cutoff_slide: 0 do |hp| 33 | with_fx :rlpf, cutoff: 120, cutoff_slide: 0 do |lp| 34 | #controling the filters 35 | live_loop :con_lp do 36 | key, val = sync sync_adress_key_filter 37 | control lp, cutoff: val if key == 51 #The MIDI CC that controls the low pass 38 | end 39 | live_loop :con_hp do 40 | key, val = sync sync_adress_key_filter 41 | control hp, cutoff: val if key == 55 #The MIDI CC that controls the high pass 42 | end 43 | #Synthesis starts here 44 | live_loop :p0 do 45 | note, vel = sync sync_adress_key_on 46 | use_synth_defaults sustain: 3600, note_slide: slide 47 | runP0 = 1 48 | use_cent_tuning det0 49 | v00 = synth syn0, note: (ramp *(ring :r,*(range 1,127),:r))[note + trans0], amp: vol0 50 | use_cent_tuning det1 51 | v01 = synth syn1, note: (ramp *(ring :r,*(range 1,127),:r))[note + trans1], amp: vol1 52 | use_cent_tuning det2 53 | v02 = synth syn2, note: (ramp *(ring :r,*(range 1,127),:r))[note + trans2], amp: vol2 54 | 55 | while runP0 == 1 56 | key, type = sync "note_change" #Listening to an internal message to be able to react to two different events 57 | #kil, val = sync sync_adress_key_off #old method without slide 58 | kill v00 if key == note && type == 0 59 | kill v01 if key == note && type == 0 60 | kill v02 if key == note && type == 0 61 | runP0 = 0 if key == note && type == 0 62 | control v00, note: (ramp *(ring :r,*(range 1,127),:r))[key + trans0] if key != note && type == 1 63 | control v01, note: (ramp *(ring :r,*(range 1,127),:r))[key + trans1] if key != note && type == 1 64 | control v02, note: (ramp *(ring :r,*(range 1,127),:r))[key + trans2] if key != note && type == 1 65 | note = key if key != note && type == 1 66 | end 67 | #kill v00 68 | #kill v01 69 | #kill v02 70 | end 71 | end 72 | end 73 | 74 | live_loop :con_slide do 75 | key, val = sync sync_adress_key_filter 76 | slide = val / 60.0 if key == 52 #The MIDI CC that controls the high pass 77 | end 78 | 79 | 80 | live_loop :look_slide do 81 | #looks for a new key press and sends it to the synth section 82 | #used to slide between notes 83 | key, val = sync sync_adress_key_on 84 | cue "note_change", key, 1 85 | end 86 | 87 | live_loop :look_off do 88 | #looks for a key release and sends it to the synth section 89 | key, val = sync sync_adress_key_off 90 | cue "note_change", key, 0 91 | end 92 | 93 | live_loop :p1_presets do 94 | i,v = sync "/midi/apc_key_25_midi_1/1/1/note_on" 95 | #calls presets when the key is pressed 96 | #to change settings 97 | preset10 if i == 64 98 | preset11 if i == 65 99 | preset12 if i == 66 100 | preset13 if i == 67 101 | preset14 if i == 68 102 | preset15 if i == 69 103 | preset16 if i == 70 104 | preset17 if i == 71 105 | preset_null if i == 81 106 | end 107 | 108 | #Preset area beginns here 109 | 110 | define :preset_lights_off do 111 | #turn all lights off 112 | midi_note_on 64,0,channel: 1 113 | midi_note_on 65,0,channel: 1 114 | midi_note_on 66,0,channel: 1 115 | midi_note_on 67,0,channel: 1 116 | midi_note_on 68,0,channel: 1 117 | midi_note_on 69,0,channel: 1 118 | midi_note_on 70,0,channel: 1 119 | midi_note_on 71,0,channel: 1 120 | end 121 | 122 | define :preset10 do 123 | #Slot 0 124 | #manage lights 125 | preset_lights_off 126 | midi_note_on 64,1,channel: 1 127 | #set values 128 | trans0 = 0 129 | trans1 = 0 130 | trans2 = -12 131 | det0 = 0 132 | det1 = 3 133 | det2 = -2 134 | vol0 = 1 135 | vol1 = 0.7 136 | vol2 = 0.5 137 | syn0 = :saw 138 | syn1 = :saw 139 | syn2 = :saw 140 | end 141 | define :preset11 do 142 | #Slot 1 143 | #manage lights 144 | preset_lights_off 145 | midi_note_on 65,1,channel: 1 146 | #set values 147 | trans0 = 0 148 | trans1 = -12 149 | trans2 = -12 150 | det0 = 0 151 | det1 = 3 152 | det2 = -2 153 | vol0 = 1 154 | vol1 = 0.7 155 | vol2 = 0.5 156 | syn0 = :saw 157 | syn1 = :saw 158 | syn2 = :saw 159 | end 160 | define :preset12 do 161 | #Slot 2 162 | #manage lights 163 | preset_lights_off 164 | midi_note_on 66,1,channel: 1 165 | #set values 166 | trans0 = 0 167 | trans1 = 7 168 | trans2 = -12 169 | det0 = 0 170 | det1 = 0 171 | det2 = -2 172 | vol0 = 1 173 | vol1 = 0.5 174 | vol2 = 0.5 175 | syn0 = :saw 176 | syn1 = :tri 177 | syn2 = :saw 178 | end 179 | define :preset13 do 180 | #Slot 3 181 | #manage lights 182 | preset_lights_off 183 | midi_note_on 67,2,channel: 1 184 | end 185 | define :preset14 do 186 | #Slot 4 187 | #manage lights 188 | preset_lights_off 189 | midi_note_on 68,1,channel: 1 190 | 191 | trans0 = 0 192 | trans1 = 0.02 193 | trans2 = -11.98 194 | det0 = 0 195 | det1 = 0 196 | det2 = 0 197 | vol0 = 1 198 | vol1 = 0.7 199 | vol2 = 0.5 200 | syn0 = :saw 201 | syn1 = :saw 202 | syn2 = :saw 203 | end 204 | define :preset15 do 205 | #Slot 5 206 | #manage lights 207 | preset_lights_off 208 | midi_note_on 69,2,channel: 1 209 | end 210 | define :preset16 do 211 | #Slot 6 212 | #manage lights 213 | preset_lights_off 214 | midi_note_on 70,2,channel: 1 215 | end 216 | define :preset17 do 217 | #Slot 7 218 | #manage lights 219 | preset_lights_off 220 | midi_note_on 71,2,channel: 1 221 | end 222 | define :preset_null do 223 | #Restore initial settings for 224 | #Keys 225 | preset_lights_off 226 | trans0 = 0 #transposition of this oscillator 227 | trans1 = 0 228 | trans2 = 0 229 | det0 = 0 #detune in cent of this oscillator 230 | det1 = 0 231 | det2 = 0 232 | vol0 = 1 #volume of this oscillator 233 | vol1 = 1 234 | vol2 = 1 235 | syn0 = :saw #synth used for this oscillator 236 | syn1 = :saw 237 | syn2 = :saw 238 | / 239 | #Bass 240 | b_syn0, b_syn1 = :saw 241 | b_det0, b_det1 = 0 242 | b_trans0, b_trans1 = 0 243 | b_vol0, b_vol1 = 1 244 | / 245 | end 246 | -------------------------------------------------------------------------------- /Covers/He's a Pirate: -------------------------------------------------------------------------------- 1 | #He's a Pirate 2 | #Coded by Davids Fiddle 3 | 4 | use_bpm 100 5 | 6 | amp_piano = 0.7 7 | amp_bass = 0.5 8 | amp_melody = 0.9 9 | 10 | cutoff_bass = 80 11 | 12 | e = 0.25 13 | q = 0.5 14 | dq = 0.75 15 | h = 1 16 | dh = 1.5 17 | 18 | #Melody 19 | in_thread do 20 | use_synth :saw 21 | 3.times do 22 | play_pattern_timed [:d3,:d3,:d3,:d3,:d3,:d3,:d3,:d3,:d3], 23 | [q,e,q,e,q,e,e,e,e], amp: amp_melody, sustain: 0 24 | end 25 | play_pattern_timed [:d3,:d3,:d3,:d3,:d3,:d3,:d3], 26 | [q,e,q,e,q,e,e], amp: amp_melody, sustain: 0 27 | end 28 | in_thread do 29 | use_synth :saw 30 | sleep 6 31 | play_pattern_timed [:a3,:a3,:a3,:a3,:a3,:a3,:a3,:a3,:a3], 32 | [q,e,q,e,q,e,e,e,e], amp: amp_melody, sustain: 0 33 | play_pattern_timed [:a3,:a3,:a3,:a3,:a3,:a3,:a3], 34 | [q,e,q,e,q,e,e], amp: amp_melody, sustain: 0 35 | 2.times do 36 | 2.times do 37 | play_pattern_timed [:a3,:c4,:d4,:d4,:d4,:e4,:f4,:f4,:f4,:g4,:e4,:e4,:d4,:c4,:d4], 38 | [e,e,q,q,e,e,q,q,e,e,q,q,e,e,h], amp: amp_melody, sustain: 0 39 | end 40 | play_pattern_timed [:a3,:c4,:d4,:d4,:d4,:f4,:g4,:g4,:g4,:a4,:bb4,:bb4,:a4,:g4,:a4,:d4,:d4,:e4,:f4,:f4,:f4,:g4,:a4,:d4,:d4,:f4,:e4,:d4,:c4,:d4], 41 | [e,e,q,q,e,e,q,q,e,e,q,q,e,e,e,dq,e,e,q,e,e,q,q,q,e,e,q,q,q,h], amp: amp_melody, sustain: 0 42 | end 43 | sleep q 44 | play_pattern_timed [:a4,:bb4,:a4,:a4,:a4,:a4,:g4,:g4,:f4,:e4,:f4,:e4,:d4,:a4,:bb4,:a4,:a4,:c5,:a4,:g4,:g4,:f4,:e4,:f4,:e4,:d4], 45 | [dh,dh,q,q,q,e,h+e,dh,dh,q,q,q,dh,dh,dh,q,q,q,e,h+e,dh,dh,q,q,q,dh], amp: amp_melody, sustain: 0 46 | end 47 | 48 | #Acc 49 | define :dmin do 50 | use_synth :piano 51 | play :d3, sustain: q, release: e, sustain: q, amp: amp_piano 52 | play :f3, sustain: q, release: e, sustain: q, amp: amp_piano 53 | play :a3, sustain: q, release: e, sustain: q, amp: amp_piano 54 | end 55 | define :bbmaj do 56 | use_synth :piano 57 | play :d3, sustain: q, release: e, sustain: q, amp: amp_piano 58 | play :f3, sustain: q, release: e, sustain: q, amp: amp_piano 59 | play :bb3, sustain: q, release: e, sustain: q, amp: amp_piano 60 | end 61 | define :amin do 62 | use_synth :piano 63 | play :c3, sustain: q, release: e, sustain: q, amp: amp_piano 64 | play :e3, sustain: q, release: e, sustain: q, amp: amp_piano 65 | play :a3, sustain: q, release: e, sustain: q, amp: amp_piano 66 | end 67 | define :fmaj do 68 | use_synth :piano 69 | play :c3, sustain: q, release: e, sustain: q, amp: amp_piano 70 | play :f3, sustain: q, release: e, sustain: q, amp: amp_piano 71 | play :a3, sustain: q, release: e, sustain: q, amp: amp_piano 72 | end 73 | define :cmaj do 74 | use_synth :piano 75 | play :c3, sustain: q, release: e, sustain: q, amp: amp_piano 76 | play :e3, sustain: q, release: e, sustain: q, amp: amp_piano 77 | play :g3, sustain: q, release: e, sustain: q, amp: amp_piano 78 | end 79 | define :gmin do 80 | use_synth :piano 81 | play :d3, sustain: q, release: e, sustain: q, amp: amp_piano 82 | play :g3, sustain: q, release: e, sustain: q, amp: amp_piano 83 | play :bb3, sustain: q, release: e, sustain: q, amp: amp_piano 84 | end 85 | 86 | in_thread do 87 | use_synth :fm 88 | sleep 2*dh 89 | play :d3, sustain: 2*h 90 | sleep 2*dh 91 | play :d3, sustain: 2*h 92 | sleep 2*dh 93 | play :d3, sustain: 2*h 94 | play :d2, sustain: 2*h 95 | sleep 2*dh 96 | with_fx :reverb do 97 | 2.times do 98 | dmin 99 | sleep dq 100 | dmin 101 | sleep dq 102 | bbmaj 103 | sleep dq 104 | bbmaj 105 | sleep dq 106 | amin 107 | sleep dq 108 | amin 109 | sleep dq 110 | dmin 111 | sleep dq 112 | dmin 113 | sleep dq 114 | bbmaj 115 | sleep dq 116 | bbmaj 117 | sleep dq 118 | fmaj 119 | sleep dq 120 | fmaj 121 | sleep dq 122 | cmaj 123 | sleep dq 124 | cmaj 125 | sleep dq 126 | dmin 127 | sleep dq 128 | dmin 129 | sleep dq 130 | dmin 131 | sleep dq 132 | dmin 133 | sleep dq 134 | cmaj 135 | sleep dq 136 | cmaj 137 | sleep dq 138 | gmin 139 | sleep dq 140 | gmin 141 | sleep dq 142 | dmin 143 | sleep dq 144 | dmin 145 | sleep dq 146 | dmin 147 | sleep dq 148 | dmin 149 | sleep dq 150 | dmin 151 | sleep dq 152 | dmin 153 | sleep dq 154 | cmaj 155 | sleep dq 156 | cmaj 157 | sleep dq 158 | dmin 159 | sleep dq 160 | dmin 161 | sleep dq 162 | end 163 | 2.times do 164 | use_synth :piano 165 | play :d3, amp: amp_piano, sustain: h 166 | play :a3, amp: amp_piano, sustain: h 167 | sleep dh 168 | play :d3, amp: amp_piano, sustain: h 169 | play :f3, amp: amp_piano, sustain: h 170 | sleep dh 171 | play :c3, amp: amp_piano, sustain: q 172 | play :f3, amp: amp_piano, sustain: q 173 | sleep h 174 | play :c3, amp: amp_piano, sustain: e 175 | play :f3, amp: amp_piano, sustain: e 176 | sleep q 177 | play :c3, amp: amp_piano, sustain: e 178 | play :f3, amp: amp_piano, sustain: e 179 | sleep e 180 | play :c3, amp: amp_piano, sustain: h 181 | play :g3, amp: amp_piano, sustain: h 182 | sleep h+e 183 | play :c3, amp: amp_piano, sustain: h 184 | play :g3, amp: amp_piano, sustain: h 185 | sleep dh 186 | play :d3, amp: amp_piano, sustain: h 187 | play :f3, amp: amp_piano, sustain: h 188 | sleep dh 189 | play :c3, amp: amp_piano, sustain: h 190 | sleep dh 191 | play :d3, amp: amp_piano, sustain: h 192 | sleep dh 193 | end 194 | end 195 | end 196 | 197 | #Bass 198 | in_thread do 199 | use_synth :chiplead 200 | with_fx :octaver do 201 | sleep dh*4 202 | play :d2, sustain: h, amp: amp_bass, cutoff: cutoff_bass 203 | sleep dh*2 204 | play :d2, sustain: h, amp: amp_bass, cutoff: cutoff_bass 205 | sleep dh*2 206 | 2.times do 207 | play_pattern_timed [:d3,:d3,:bb2,:bb2,:a2,:a2,:d3,:d3,:bb2,:bb2,:f2,:f2,:a2,:a2,:d3,:d3,:d3,:d3,:c3,:c3,:bb2,:bb2,:bb2,:c3,:d3,:d3,:d3,:d3,:d3,:C3,:c3,:d3,:d3], 208 | [q,h,q,h,q,h,q,h,q,h,q,h,q,h,q,h,q,h,q,h,q,q,e,e,dh,q,h,q,h,q,h,q,h], 209 | sustain: q, amp: amp_bass, cutoff: cutoff_bass 210 | end 211 | play_pattern_timed [:d3,:d3,:d3,:d3,:d3,:bb2,:bb2,:bb2,:bb2,:bb2,:f2,:f2,:f2,:f2,:f2,:c3,:c3,:c3,:c3,:c3,:c3,:c3,:c3,:d3,:d3,:d3,:d3,:d3,:c3,:c3,:c3,:c3,:c3,:d3,:d3,:d3,:d3,:d3], 212 | [q,e,e,e,e,q,e,e,e,e,q,e,e,e,e,q,q,q,q,e,e,e,e,q,e,e,e,e,q,e,e,e,e,q,e,e,e,e], 213 | sustain: e, amp: amp_bass, cutoff: cutoff_bass 214 | play_pattern_timed [:d3,:d3,:d3,:d3,:d3,:bb2,:bb2,:bb2,:bb2,:bb2,:f2,:f2,:f2,:f2,:f2,:c3,:c3,:c3,:c3,:c3,:c3,:c3,:c3,:d3,:d3,:d3,:d3,:d3,:c3,:c3,:c3,:c3,:c3,:d3], 215 | [q,e,e,e,e,q,e,e,e,e,q,e,e,e,e,q,q,q,q,e,e,e,e,q,e,e,e,e,q,e,e,e,e,dh], 216 | sustain: e, amp: amp_bass, cutoff: cutoff_bass 217 | end 218 | end 219 | -------------------------------------------------------------------------------- /Covers/Supermassive Black Hole: -------------------------------------------------------------------------------- 1 | #Supermassive Black Hole - Muse 2 | #Coded by Davids Fiddle 3 | 4 | 5 | use_bpm 120 6 | 7 | w = 4 8 | dh = 3 9 | h = 2 10 | dq = 1.5 11 | q = 1 12 | e = 0.5 13 | s = 0.25 14 | 15 | #Shaker 16 | uncomment do 17 | define :sh do 18 | play_pattern_timed [:a3,:a3,:a3,:a3,:a3,:a3,:a3,:a3,:a3], 19 | [e,s,s,e,e,e,e,e] 20 | end 21 | 22 | define :sh_intro do 23 | 8.times do 24 | sh 25 | end 26 | end 27 | 28 | define :sh_riff do 29 | 8.times do 30 | sh 31 | end 32 | end 33 | 34 | define :sh_verse do 35 | 8.times do 36 | sh 37 | end 38 | end 39 | 40 | define :sh_chorus do 41 | 15.times do 42 | sh 43 | end 44 | sleep 4 45 | end 46 | 47 | in_thread do 48 | use_synth :noise 49 | use_synth_defaults sustain: 0.025, release: 0.1, attack: 0.025, 50 | cutoff: 105, amp: 0.8 51 | sh_intro 52 | sh_riff 53 | sh_verse 54 | sh_chorus 55 | sh_verse 56 | sh_chorus 57 | sh_intro 58 | sh_verse 59 | sh_chorus 60 | sh_intro 61 | end 62 | end 63 | 64 | #Drums 65 | define :dr_4bar do 66 | 3.times do 67 | sample :drum_bass_hard 68 | sleep q 69 | sample :drum_snare_hard 70 | sleep e 71 | sample :drum_bass_hard 72 | sleep dq 73 | sample :drum_snare_hard 74 | sleep q 75 | end 76 | sleep e 77 | sample :drum_bass_hard 78 | sleep e 79 | sample :drum_snare_hard 80 | sleep e 81 | sample :drum_bass_hard 82 | sleep dq 83 | sample :drum_snare_hard 84 | sleep q 85 | end 86 | 87 | in_thread do 88 | 26.times do 89 | dr_4bar 90 | end 91 | end 92 | 93 | #Bass 94 | define :bs_intro do 95 | 4.times do 96 | play :e2, sustain: q, release: e 97 | sleep 2*w 98 | end 99 | end 100 | 101 | define :bs_riff do 102 | play_pattern_timed [:e2,:e2,:g2,:e2,:e2,:a2,:a2,:a2], 103 | [e,e,e,e,e,e,e,e] 104 | play_pattern_timed [:e2,:e2,:g2,:e2,:e2,:a2,:a2,:g2], 105 | [e,e,e,e,e,e,e,e] 106 | play_pattern_timed [:e2,:e2,:g2,:e2,:e2,:a2,:a2,:a2], 107 | [e,e,e,e,e,e,e,e] 108 | play_pattern_timed [:e2,:e2,:g2,:e2,:e2,:a2,:a2,:b2], 109 | [e,e,e,e,e,e,e,e] 110 | play_pattern_timed [:e2,:e2,:g2,:e2,:e2,:a2,:a2,:a2], 111 | [e,e,e,e,e,e,e,e] 112 | play_pattern_timed [:e2,:e2,:g2,:e2,:e2,:a2,:a2,:g2], 113 | [e,e,e,e,e,e,e,e] 114 | play_pattern_timed [:e2,:e2,:g2,:e2,:e2,:a2,:a2,:a2], 115 | [e,e,e,e,e,e,e,e] 116 | play_pattern_timed [:e2,:e2,:g2,:e2,:r],[e,e,e,e,h] 117 | end 118 | 119 | define :bs_verse do 120 | bs_intro 121 | end 122 | 123 | define :bs_chorus do 124 | 2.times do 125 | play_pattern_timed [:a2,:a2,:a3,:a2,:a2,:a3,:a3,:gs3], 126 | [e,e,e,e,e,e,e,e] 127 | play_pattern_timed [:g2,:g2,:g3,:g2,:g2,:a2,:a2,:as2], 128 | [e,e,e,e,e,e,e,e] 129 | play_pattern_timed [:b2,:b2,:b3,:b2,:b2,:as3,:a3,:g3], 130 | [e,e,e,e,e,e,e,e] 131 | play_pattern_timed [:e2,:e2,:e2,:fs2,:fs2,:g2,:g2,:gs2], 132 | [e,e,e,e,e,e,e,e] 133 | play_pattern_timed [:a2,:a2,:a3,:a2,:a2,:a3,:a3,:gs3], 134 | [e,e,e,e,e,e,e,e] 135 | play_pattern_timed [:g2,:g2,:g3,:g2,:g2,:a2,:a2,:as2,], 136 | [e,e,e,e,e,e,e,e] 137 | play_pattern_timed [:b2,:b2,:b3,:b2,:b2,:as3,:a3,:g3], 138 | [e,e,e,e,e,e,e,e] 139 | play_pattern_timed [:r,:b3,:b3,:as3,:a3,:g3,:g3,:fs3], 140 | [e,e,e,e,e,e,e,e] 141 | end 142 | end 143 | 144 | define :bs_solo do 145 | bs_riff 146 | end 147 | 148 | in_thread do 149 | use_synth :fm 150 | use_synth_defaults release: s, sustain: e, amp: 2, pan: 0.2 151 | with_fx :distortion do 152 | bs_intro 153 | bs_riff 154 | bs_verse 155 | bs_chorus 156 | bs_verse 157 | bs_chorus 158 | bs_intro 159 | bs_solo 160 | bs_chorus 161 | bs_intro 162 | end 163 | end 164 | 165 | #Guitar 166 | define :gt_intro do 167 | 3.times do 168 | play_pattern_timed [:e3,:g3,:e3,:e3,:e3,:g3,:e3,:r,:e3], 169 | [dq,q,q,e,q,e,e,e,dq] 170 | end 171 | play_pattern_timed [:e3,:g3,:e3,:e3,:e3,:g3,:e3,:as3,:a3,:g3], 172 | [dq,q,q,e,q,e,e,e,e,q] 173 | end 174 | 175 | define :gt_riff do 176 | play_pattern_timed [:e3,:e3,:g3,:e3,:e3,:a3,:a3,:a3], 177 | [e,e,e,e,e,e,e,e] 178 | play_pattern_timed [:e3,:e3,:g3,:e3,:e3,:a3,:a3,:g3], 179 | [e,e,e,e,e,e,e,e] 180 | play_pattern_timed [:e3,:e3,:g3,:e3,:e3,:a3,:a3,:a3], 181 | [e,e,e,e,e,e,e,e] 182 | play_pattern_timed [:e3,:e3,:g3,:e3,:e3,:a3,:a3,:b3], 183 | [e,e,e,e,e,e,e,e] 184 | play_pattern_timed [:e3,:e3,:g3,:e3,:e3,:a3,:a3,:a3], 185 | [e,e,e,e,e,e,e,e] 186 | play_pattern_timed [:e3,:e3,:g3,:e3,:e3,:a3,:a3,:g3], 187 | [e,e,e,e,e,e,e,e] 188 | play_pattern_timed [:e3,:e3,:g3,:e3,:e3,:a3,:a3,:a3], 189 | [e,e,e,e,e,e,e,e] 190 | play_pattern_timed [:e3,:e3,:g3,:e3,:r],[e,e,e,e,h] 191 | end 192 | 193 | define :gt_verse do 194 | gt_intro 195 | end 196 | 197 | define :gt_chorus do 198 | 2.times do 199 | play_pattern_timed [:a3,:a3,:a4,:a3,:a3,:a4,:a4,:gs4], 200 | [e,e,e,e,e,e,e,e] 201 | play_pattern_timed [:g3,:g3,:g4,:g3,:g3,:a3,:a3,:as3,], 202 | [e,e,e,e,e,e,e,e] 203 | play_pattern_timed [:b3,:b3,:b4,:b3,:b3,:as4,:a4,:g4], 204 | [e,e,e,e,e,e,e,e] 205 | play_pattern_timed [:e3,:e3,:e4,:fs3,:fs3,:g3,:g3,:gs3], 206 | [e,e,e,e,e,e,e,e] 207 | play_pattern_timed [:a3,:a3,:a4,:a3,:a3,:a4,:a4,:gs4], 208 | [e,e,e,e,e,e,e,e] 209 | play_pattern_timed [:g3,:g3,:g4,:g3,:g3,:a3,:a3,:as3,], 210 | [e,e,e,e,e,e,e,e] 211 | play_pattern_timed [:b3,:b3,:b4,:b3,:b3,:as4,:a4,:g4], 212 | [e,e,e,e,e,e,e,e] 213 | play_pattern_timed [:r,:b4,:b4,:as4,:a4,:g4,:g4,:fs4], 214 | [e,e,e,e,e,e,e,e] 215 | end 216 | end 217 | 218 | define :gt_solo do 219 | with_fx :bitcrusher do 220 | gt_intro 221 | end 222 | end 223 | 224 | in_thread do 225 | use_synth :blade 226 | use_synth_defaults amp: 0.5, pan: -0.2 227 | with_fx :reverb do 228 | with_fx :rhpf, cutoff: 70 do 229 | with_fx :distortion, distort: 0.7 do 230 | gt_intro 231 | gt_riff 232 | gt_verse 233 | gt_chorus 234 | gt_verse 235 | gt_chorus 236 | gt_intro 237 | gt_solo 238 | gt_chorus 239 | gt_intro 240 | end 241 | end 242 | end 243 | end 244 | 245 | #Voice 246 | define :vc_intro do 247 | sleep 8*w 248 | end 249 | 250 | define :vc_riff do 251 | sleep 8*w 252 | end 253 | 254 | define :vc_verse do 255 | 2.times do 256 | play_pattern_timed [:r,:b3,:a3,:a3,:g3,:a3,:g3,:b3,:a3,:a3,:g3,], 257 | [q,e,e,e,e,e,e,q,e,q,dq] 258 | play_pattern_timed [:r,:b3,:a3,:a3,:g3,:a3,:g3,:b3,:d4,:b3], 259 | [q,e,e,e,e,e,e,q,e,h+e] 260 | end 261 | end 262 | 263 | define :vc_chorus do 264 | 2.times do 265 | play_pattern_timed [:a3,:gs3,:g3,:fs3,:e3,:fs3,:e3,:r,:g3,:e3,:r], 266 | [h+q+e,e,w,dq,e,e,e,e,q,h,dq] 267 | end 268 | play_pattern_timed [:a3,:a3,:a3,:a3,:a3,:gs3,:g3,:g3,:g3,:g3,:g3,:fs3], 269 | [q,q,e,e,e,e,e,q,q,e,e,e] 270 | play_pattern_timed [:fs3,:fs3,:fs3,:fs3,:e3,:fs3,:e3,:g3,:e3,:fs3,:g3,:gs3], 271 | [e,e,q,e,e,e,e,e,q,q,q,e] 272 | play_pattern_timed [:a3,:a3,:a3,:a3,:a3,:gs3,:g3,:g3,:g3,:g3,:g3,:fs3], 273 | [q,q,e,e,e,e,e,q,q,e,e,e] 274 | play_pattern_timed [:fs3,:fs3,:fs3,:fs3,:e3,:fs3,:e3,:r],[e,e,q,e,e,e,e,w] 275 | end 276 | 277 | define :vc_solo do 278 | sleep 8*w 279 | end 280 | 281 | define :vc_interlude do 282 | with_fx :distortion do 283 | 4.times do 284 | sleep w 285 | play :e3, sustain: dh, release: e, amp: 0.5 286 | sleep w 287 | end 288 | end 289 | end 290 | 291 | in_thread do 292 | use_synth :saw 293 | use_synth_defaults amp: 1.5 294 | vc_intro 295 | vc_riff 296 | vc_verse 297 | vc_chorus 298 | vc_verse 299 | vc_chorus 300 | vc_interlude 301 | vc_solo 302 | vc_chorus 303 | vc_intro 304 | end 305 | -------------------------------------------------------------------------------- /DF-xx/DF-00 for Processing 3: -------------------------------------------------------------------------------- 1 | //DF-00 Drum Machine 2 | //Coded by Davids Fiddle 3 | //Inspired by Mehackit 4 | //v1.0 5 | 6 | 7 | import oscP5.*; //Needs oscP5 and controlP5 libraries 8 | import netP5.*; 9 | import controlP5.*; 10 | 11 | OscP5 oscP5; //Communication 12 | NetAddress sonicPi; //where the messages go 13 | ControlP5 cp5; //Interface 14 | 15 | boolean enableComms = true; 16 | PFont pfont12, pfont20; 17 | 18 | void setup() { 19 | 20 | size(1000, 600, P3D); //set up window 21 | smooth(); 22 | //Network adress to communicate with Sonic Pi 23 | oscP5 = new OscP5(this, 8000); 24 | sonicPi = new NetAddress("127.0.0.1", 4559); 25 | //Creating Fonts 26 | pfont20 = createFont("Georgia", 20, true); 27 | pfont12 = createFont("Georgia", 12, true); 28 | 29 | createUI(); 30 | enableComms = true; 31 | } 32 | 33 | //Methods for sending key/value to Sonic Pi 34 | void sendOsc(String name, int value) { 35 | OscMessage toSend = new OscMessage("/" + name); 36 | toSend.add((int)value); 37 | oscP5.send(toSend, sonicPi); 38 | } 39 | void sendOsc(String name, float value) { 40 | OscMessage toSend = new OscMessage("/" + name); 41 | toSend.add((float)value); 42 | oscP5.send(toSend, sonicPi); 43 | } 44 | 45 | //fill in the Background 46 | void draw() { 47 | background(30); 48 | drawBackground(); 49 | } 50 | 51 | //Draw all lines 52 | void drawBackground() { 53 | fill(0); 54 | 55 | stroke(255); 56 | line(100, 0, 100, 600); 57 | line(0, 100, 1000, 100); 58 | line(300, 0, 300, 100); 59 | line(800, 0, 800, 100); 60 | 61 | stroke(100); 62 | line(0,200,1000,200); 63 | line(0,300,1000,300); 64 | line(0,400,1000,400); 65 | line(0,500,1000,500); 66 | } 67 | 68 | void createUI() { 69 | //Initialising Fonts 70 | ControlFont fontl = new ControlFont(pfont20); 71 | ControlFont fonts = new ControlFont(pfont12); 72 | 73 | //create canvas for the controls 74 | cp5 = new ControlP5(this); 75 | 76 | //Labels 77 | cp5.addTextlabel("title").setText("DF-00 Drum Machine \nby Davids Fiddle").setPosition(325, 25).setFont(fontl); 78 | cp5.addTextlabel("thanks").setText("Running with Sonic Pi\nby Sam Aaron\nand Processing 3\nby Ben Fry and Casey Reas").setPosition(825, 25).setFont(fonts); 79 | cp5.addTextlabel("Version").setText("v1.0").setPosition(750, 75).setFont(fonts); 80 | 81 | //Speed control 82 | cp5.addKnob("speed").setRange(50, 220).setValue(90).setPosition(25, 25).setRadius(25).setDragDirection(Knob.HORIZONTAL).setLabel("Speed").setDecimalPrecision(0).setFont(fonts); 83 | 84 | //Global reverb 85 | cp5.addKnob("verbMix").setRange(0, 1).setValue(0).setPosition(125, 25).setRadius(25).setDragDirection(Knob.HORIZONTAL).setLabel("Reverb").setDecimalPrecision(2).setFont(fonts); 86 | cp5.addKnob("verbRoom").setRange(0, 1).setValue(0.6).setPosition(225, 25).setRadius(25).setDragDirection(Knob.HORIZONTAL).setLabel("Room").setDecimalPrecision(2).setFont(fonts); 87 | 88 | //Volume knobs 89 | cp5.addKnob("volKik").setRange(0, 2.0).setValue(1.0).setPosition(25, 125).setRadius(25).setDragDirection(Knob.HORIZONTAL).setLabel("Kick").setDecimalPrecision(1).setFont(fonts); 90 | cp5.addKnob("volHihat").setRange(0, 2.0).setValue(1.0).setPosition(25, 225).setRadius(25).setDragDirection(Knob.HORIZONTAL).setLabel("Hihat").setDecimalPrecision(1).setFont(fonts); 91 | cp5.addKnob("volSnare").setRange(0, 2.0).setValue(1.0).setPosition(25, 325).setRadius(25).setDragDirection(Knob.HORIZONTAL).setLabel("Snare").setDecimalPrecision(1).setFont(fonts); 92 | cp5.addKnob("volToms").setRange(0, 2.0).setValue(1.0).setPosition(25, 425).setRadius(25).setDragDirection(Knob.HORIZONTAL).setLabel("Toms").setDecimalPrecision(1).setFont(fonts); 93 | cp5.addKnob("volMisc").setRange(0, 2.0).setValue(1.0).setPosition(25, 525).setRadius(25).setDragDirection(Knob.HORIZONTAL).setLabel("Misc").setDecimalPrecision(1).setFont(fonts); 94 | 95 | //Sample selectors 96 | cp5.addRadioButton("kikSample").setPosition(850, 125).setItemsPerRow(2).setItemWidth(75).setItemHeight(25) 97 | .addItem("Acoustic", 0).addItem("Ada", 1).addItem("Haus", 2).addItem("Sone", 3).align(CENTER, CENTER) 98 | .activate(0).setNoneSelectedAllowed(false); 99 | 100 | cp5.addRadioButton("hihatSample1").setPosition(850, 225).setItemsPerRow(2).setItemWidth(75).setItemHeight(25) 101 | .addItem("Pedal", 0).addItem("Closed", 1).align(CENTER, CENTER) 102 | .activate(0).setNoneSelectedAllowed(false); 103 | cp5.addRadioButton("hihatSample2").setPosition(850, 250).setItemsPerRow(2).setItemWidth(75).setItemHeight(25) 104 | .addItem("Closed ", 0).addItem("Open", 1).align(CENTER, CENTER) 105 | .activate(0).setNoneSelectedAllowed(false); 106 | 107 | cp5.addRadioButton("snareSample").setPosition(850, 325).setItemsPerRow(2).setItemWidth(75).setItemHeight(25) 108 | .addItem("Snare", 0).addItem("Dub", 1).addItem("Dolf", 2).addItem("Zome", 3).align(CENTER, CENTER) 109 | .activate(0).setNoneSelectedAllowed(false); 110 | 111 | //Pattern selectors 112 | cp5.addRadioButton("kikPattern").setPosition(125, 125).setItemsPerRow(8).setItemWidth(100).setItemHeight(50) 113 | .addItem("kik Off", 0).addItem("kik 1", 1).addItem("kik 2", 2).addItem("kik 3", 3).addItem("kik 4", 4).addItem("kik 5", 5).addItem("kik 6", 6).align(CENTER, CENTER) 114 | .activate(0).setNoneSelectedAllowed(false); 115 | 116 | cp5.addRadioButton("hihatPattern").setPosition(125, 225).setItemsPerRow(8).setItemWidth(100).setItemHeight(50) 117 | .addItem("hihat Off", 0).addItem("hihat 1", 1).addItem("hihat 2", 2).addItem("hihat 3", 3).addItem("hihat 4", 4).addItem("hihat 5", 5).addItem("hihat 6", 6).align(CENTER, CENTER) 118 | .activate(0).setNoneSelectedAllowed(false); 119 | 120 | cp5.addRadioButton("snarePattern").setPosition(125, 325).setItemsPerRow(8).setItemWidth(100).setItemHeight(50) 121 | .addItem("snare Off", 0).addItem("snare 1", 1).addItem("snare 2", 2).addItem("snare 3", 3).addItem("snare 4", 4).addItem("snare 5", 5).addItem("snare 6", 6).align(CENTER, CENTER) 122 | .activate(0).setNoneSelectedAllowed(false); 123 | 124 | cp5.addRadioButton("tomPattern").setPosition(125, 425).setItemsPerRow(8).setItemWidth(100).setItemHeight(50) 125 | .addItem("tom Off", 0).addItem("tom 1", 1).addItem("tom 2", 2).addItem("tom 3", 3).addItem("tom 4", 4).addItem("tom 5", 5).addItem("tom 6", 6).addItem("tom 7", 7).align(CENTER, CENTER) 126 | .activate(0).setNoneSelectedAllowed(false); 127 | 128 | cp5.addRadioButton("miscPattern").setPosition(125, 525).setItemsPerRow(8).setItemWidth(100).setItemHeight(50) 129 | .addItem("misc Off", 0).addItem("misc 1", 1).addItem("misc 2", 2).addItem("misc 3", 3).addItem("misc 4", 4).addItem("misc 5", 5).addItem("misc 6", 6).addItem("misc 7", 7).align(CENTER, CENTER) 130 | .activate(0).setNoneSelectedAllowed(false); 131 | } 132 | 133 | 134 | //Sending osc-messages 135 | 136 | //Samples 137 | void kikSample(int Value) { 138 | sendOsc("00_sam_kik", Value); 139 | } 140 | void hihatSample1(int Value) { 141 | sendOsc("00_sam_hihat1", Value); 142 | } 143 | void hihatSample2(int Value) { 144 | sendOsc("00_sam_hihat2", Value); 145 | } 146 | void snareSample(int Value) { 147 | sendOsc("00_sam_snare", Value); 148 | } 149 | 150 | //Speed 151 | void speed(float Value) { 152 | sendOsc("00_speed", Value); 153 | } 154 | 155 | //Reverb 156 | void verbMix(float Value) { 157 | sendOsc("00_verb_mix", Value); 158 | } 159 | void verbRoom(float Value) { 160 | sendOsc("00_verb_room", Value); 161 | } 162 | 163 | //Volume 164 | void volKik(float Value) { 165 | sendOsc("00_amp_kik", Value); 166 | } 167 | void volHihat(float Value) { 168 | sendOsc("00_amp_hihat", Value); 169 | } 170 | void volSnare(float Value) { 171 | sendOsc("00_amp_snare", Value); 172 | } 173 | void volTom(float Value) { 174 | sendOsc("00_amp_tom", Value); 175 | } 176 | void volMisc(float Value) { 177 | sendOsc("00_amp_misc", Value); 178 | } 179 | 180 | //pattern selector 181 | void kikPattern(int Value) { 182 | sendOsc("00_pat_kik", Value); 183 | } 184 | void hihatPattern(int Value) { 185 | sendOsc("00_pat_hihat", Value); 186 | } 187 | void snarePattern(int Value) { 188 | sendOsc("00_pat_snare", Value); 189 | } 190 | void tomPattern(int Value) { 191 | sendOsc("00_pat_tom", Value); 192 | } 193 | void miscPattern(int Value) { 194 | sendOsc("00_pat_misc", Value); 195 | } 196 | --------------------------------------------------------------------------------