├── README.md ├── destination ├── bang │ ├── 0.rb │ ├── 1.rb │ ├── 2.rb │ └── Readme.md ├── dark_sea_horses │ ├── 0.rb │ ├── 1.rb │ └── Readme.md ├── div │ ├── Readme.md │ └── integer.rb ├── do │ ├── 0.rb │ ├── 1.rb │ ├── 3.rb │ └── Readme.md ├── filter │ └── 0.rb ├── frozen? │ ├── 0.rb │ └── Readme.md ├── instance_eval │ ├── 0.rb │ ├── 1.rb │ ├── 2.rb │ ├── 3.rb │ └── Readme.md ├── live │ ├── drums2.spi │ ├── init.spi │ ├── kick.spi │ ├── melody.spi │ ├── perc.spi │ ├── scratch.spi │ ├── skitter.spi │ ├── softer.spi │ └── softer2.spi ├── map │ ├── 0.rb │ ├── 1.rb │ ├── 2.rb │ ├── 3.rb │ ├── 4.rb │ ├── Readme.md │ └── graphics.rb ├── method_missing │ ├── Readme.md │ ├── experiments.rb │ ├── more_experiments.rb │ ├── percussion.rb │ ├── performances │ │ ├── 1.rb │ │ ├── bass.rb │ │ ├── coach_way.rb │ │ ├── darker.rb │ │ ├── drums.rb │ │ ├── hard_composition.rb │ │ ├── hollow.rb │ │ ├── melody.rb │ │ ├── percussion.rb │ │ ├── practical.rb │ │ └── progressions.rb │ ├── post_performance.rb │ └── where_are_you.rb ├── nil │ ├── Readme.md │ ├── buffer0.rb │ ├── buffer1.rb │ ├── buffer2.rb │ ├── buffer3.rb │ ├── buffer4.rb │ └── buffer5.rb ├── practice │ ├── 32_drum_experiments.rb │ ├── 5th_octave.rb │ ├── 90bpm.rb │ ├── 9ths.rb │ ├── ambi06.rb │ ├── ambi07.rb │ ├── ambi08.rb │ ├── ambi09.rb │ ├── ambi10.rb │ ├── ambi11.rb │ ├── ambient 2.rb │ ├── ambient.rb │ ├── ambient3.rb │ ├── ambient5.rb │ ├── ambinet4.rb │ ├── apeg_improv.rb │ ├── bass │ ├── beats │ │ ├── Readme.md │ │ ├── broken_house_beat.rb │ │ ├── minimal_house.rb │ │ └── sub_zero_minimal_techno.rb │ ├── bows.rb │ ├── chiptune.rb │ ├── dark_sea_horses.rb │ ├── dark_sea_horses2.rb │ ├── dark_sea_horses_visuals.rb │ ├── dark_sea_horses_visuals2.rb │ ├── das_end2.rb │ ├── das_ende_der_welt.rb │ ├── degrees_seq.rb │ ├── downtempo.rb │ ├── drum_play.rb │ ├── drum_theory.rb │ ├── drum_thoughts.rb │ ├── dsh.rb │ ├── dsh2.rb │ ├── experiments.rb │ ├── harmony_voicing.rb │ ├── harp.rb │ ├── hoover.rb │ ├── kreuzberg.rb │ ├── london.rb │ ├── loop_practice │ ├── map_experiements.rb │ ├── minor_dust.rb │ ├── minor_play.rb │ ├── mitte.rb │ ├── neukoeln.rb │ ├── organ.rb │ ├── organ_slicing.rb │ ├── organs.rb │ ├── play.rb │ ├── prenzlberg.rb │ ├── random.rb │ ├── sample_db.rb │ ├── sephia.rb │ ├── single_sample.rb │ ├── slicing.rb │ ├── sliding_melody.rb │ ├── techno.rb │ ├── tiergarten.rb │ ├── vertex_wrangling.rb │ ├── voicing.rb │ ├── wedding.rb │ ├── whale_songs.rb │ ├── wierd_floating_voices.rb │ └── wobble_glitch.rb ├── reduce │ └── 0.rb ├── space │ ├── Invalidenfriedhof.rb │ ├── end_der_welt.rb │ ├── falmouth.rb │ ├── frühjahr.rb │ └── yarra_river.rb ├── strawberry │ └── 0.rb ├── take │ └── performance.rb └── warm_up.rb ├── lib ├── composition.rb ├── drums.rb ├── dsp.rb ├── experiments.rb ├── instruments.rb ├── log.rb ├── monkey.rb ├── piano.rb ├── sample_instruments.rb ├── samples.rb ├── shaderview.rb ├── soprano.rb ├── support.rb └── unity.rb └── lights ├── bits.vert ├── fractal.glsl ├── map.glsl ├── nil.glsl ├── sphere.vert └── wave.glsl /README.md: -------------------------------------------------------------------------------- 1 | ![screenshot 2015-07-31 20 18 47](https://cloud.githubusercontent.com/assets/9792/9014283/c705fb8e-37c1-11e5-8e14-2e7d07adbb77.png) 2 | ``` 3 | 4 | \:o/ π=- π=- 5 | █ π=- π π=- π=- 6 | .||. π=- π=- π=- 7 | ``` 8 | 9 | ## Experimental musical source code 10 | 11 | Code that makes noises and sounds with Sonic Pi http://sonic-pi.net 12 | 13 | ### Tracks 14 | 15 | Tracks which are code and code which are tracks. 16 | 17 | [[nil]](https://github.com/repl-electric/live-coding-space/tree/master/destination/nil).[map](https://github.com/repl-electric/live-coding-space/tree/master/destination/map)(&:[frozen?](https://github.com/repl-electric/live-coding-space/tree/master/destination/frozen%3F)).each [do](https://github.com/repl-electric/live-coding-space/tree/master/destination/do) [!!!!](https://github.com/repl-electric/live-coding-space/tree/master/destination/bang)true.[instance_eval](https://github.com/repl-electric/live-coding-space/tree/master/destination/instance_eval){ [1/2](https://github.com/repl-electric/live-coding-space/blob/master/destination/div/integer.rb) } 18 | end 19 | 20 | ``` 21 | d[-_-]b 22 | /█\ 23 | .Π. 24 | ``` 25 | 26 | ## Visuals 27 | 28 | Visuals are generated using ShaderView: https://github.com/josephwilk/shaderview 29 | 30 | Source: https://github.com/repl-electric/live-coding-space/tree/master/lights 31 | 32 | 33 | ## Material 34 | 35 | Recordings on: 36 | * http://soundcloud.com/repl-electric 37 | * http://livecoding.tv/josephwilk 38 | * http://www.repl-electric.com 39 | 40 | ## License 41 | 42 | Copyright © 2014-present Joseph Wilk 43 | 44 | Distributed under the Eclipse Public License, the same as Clojure. 45 | 46 | ![](http://67.media.tumblr.com/tumblr_lyas7nflhJ1qk2qd1.png) 47 | & Cambridge, UK 48 | -------------------------------------------------------------------------------- /destination/bang/1.rb: -------------------------------------------------------------------------------- 1 | set_volume! 1.0 2 | 3 | use_bpm 60 4 | 5 | set_mixer_control! hpf: 40, lpf: 60, lpf_slide: 16, hpf_slide: 16 6 | 7 | live_loop :other do 8 | # sample ChillD[/.*_loop/, 10], amp: 1.0 9 | #sample Dust[/f#m/,1] 10 | #sample Dust[/f#m/,2], amp: 8.0 11 | #sample Dust[/f#m/,0], amp: 8.0 12 | 13 | 14 | sleep 16 15 | end 16 | 17 | live_loop :kickit do 18 | # sync :beat 19 | #with_fx(:krush, pre_amp: 10) do |r_fx| 20 | with_fx :slicer, phase: 2.0, invert_wave: 1, wave: 1, smooth: 0.2 do 21 | sample ChillD[/drum_loop/, 10], beat_stretch: 8.0, amp: 2.0 22 | end 23 | 24 | #end 25 | #sample Dust[/f#m/,1], beat_stretch: 8.0, amp: 2.0 26 | 27 | #sample Corrupt[/loop/,8], amp: 8.0, beat_stretch: 8.0, pan: 0.25 28 | #sample Corrupt[/loop/,8], amp: 8.0, beat_stretch: 8.0, pan: -0.25 29 | 30 | with_fx(:echo, decay: 8.0, phase: (ring 1.0,2.0).tick(:phase)) do |r_fx| 31 | #sample Dust[/f#m/,/whale/].tick(:s), amp: 2.0, cutoff: 100 32 | end 33 | 34 | 35 | with_fx(:slicer, phase: 0.25, probability: 0, wave: 1) do 36 | # sample Dust[/f#m/,1], beat_stretch: 8.0, amp: 2.0 37 | end 38 | sleep 8.0 39 | end 40 | 41 | live_loop :next do 42 | sample Corrupt[/kick/,[1,1]].tick(:sample), cutoff: 120, amp: 1.8 43 | # sample Corrupt[/drum_loop/,10], beat_stretch: 2.0 44 | 45 | # sync :kick 46 | #sample Fraz[/loop/, 3], beat_stretch: 8.0, amp: 1.0 47 | # sample Fraz[/loop/, 3], beat_stretch: 2.0, amp: 2.0 48 | # sample Corrupt[/loop/,8], beat_stretch: 4.0 49 | #sample Corrupt[/loop/,8], beat_stretch: 2.0 50 | 51 | sleep 2 52 | #with_fx(:slicer, phase: 0.25*2, probability: 0) do 53 | sample Corrupt[/drum_loop/,10], beat_stretch: 8.0 54 | sample Corrupt[/drum_loop/,10], beat_stretch: 16.0 55 | 56 | #end 57 | sample Corrupt[/kick/,[1,1]].tick(:sample), cutoff: rrand(80,100), amp: 1.8 58 | 59 | # sample Fraz[/loop/, 3], beat_stretch: 2.0, amp: 1.0 60 | sleep 2 61 | end 62 | 63 | live_loop :dark do 64 | #use_synth :dark_sea_horn 65 | # play :fs3, decay: 0.01, attack: 0.001, amp: 1.0, cutoff: 70, attack: 0.001 66 | #sample Organ[/g#0/,0], amp: 4.0 67 | 68 | # with_fx :krush do 69 | with_fx(:slicer, phase: 0.25*2, wave: 0, amp: 8.0) do 70 | sample Organ[/f#0/,0], amp: 2.0 71 | end 72 | 73 | with_fx(:slicer, phase: 0.25*4, invert_wave: 1.0, wave: 0, amp: 8.0) do 74 | sample Organ[/f#1/,0], amp: 2.0 75 | end 76 | 77 | #sample Corrupt[/acoustic guitar/, /f#m/], amp: 4.0 78 | 79 | # with_fx :krush, pre_amp: 0.5 do 80 | # with_fx(:slicer, phase: 0.25, wave: 1, amp: 8.0) do 81 | sample Organ[/a3/,0], amp: 2.0 82 | sample Organ[/c#3_/,0], amp: 2.0 83 | # sample Organ[/_b3_/,0], amp: 4.0 84 | # end 85 | # end 86 | 87 | with_fx(:slicer, phase: 0.25*2, wave: 0, amp: 8.0) do 88 | # sample Organ[/c#2/,0], amp: 4.0 89 | end 90 | # end 91 | 92 | sleep 8 93 | end 94 | 95 | live_loop :break do 96 | #sample Corrupt[/f#/,[0,0]].tick(:sample), cutoff: 130, amp: 1.0 97 | sleep 8 98 | end 99 | 100 | live_loop :nextlevel do 101 | sleep 16 102 | #sample Fraz[/kick/, 0], amp: 4.0 103 | #sample Fraz[/coil/, /c#m/, 0], rate: 1.0, amp: 1.0, cutoff: 80 104 | sleep 16 105 | end 106 | 107 | live_loop :apeg, auto_cue: false do 108 | #sync :next 109 | #with_fx :reverb, room: 1, reps: 4 do |fx| 110 | use_synth :plucked 111 | use_random_seed (knit 100,4, 300,4).tick 112 | ns = (scale :fs3, :minor, num_octaves: 4).drop(0).take(3) 113 | #sample Dust[/kick/, 0], amp: 1.0 114 | # with_fx :krush, mix: 0.1, distort: 0.4 do 115 | _=nil 116 | 16.times do 117 | #sample Ether[/noise/, 4..8].tick(:sample), cutoff: 130, amp: 4.0 if spread(3,8).tick 118 | #sample Ether[/snare/, [4,4]].tick(:sample), cutoff: 130, amp: 1.0 if spread(7,11).look 119 | 120 | play (knit :fs3,4,_,4).tick(:gjhf) 121 | 122 | with_transpose((knit 0,0,12,1).tick(:r)) do 123 | play (knit ns.choose,1, _,0).tick(:notes), blip_rate: 10.9, 124 | delay_coef: 0.01, delay_time: 0.01, room: 200.0, attack: 0.0001, amp: 0.5, cutoff: 100 125 | end 126 | #control fx, damp: rand, mix: rand 127 | sleep 0.125*(ring 1,1).tick(:s) 128 | # end 129 | end 130 | # end 131 | end 132 | _=nil 133 | live_loop :bass do 134 | sync :kick 135 | 32.times{ 136 | with_synth :prophet do 137 | # play (ring 138 | # :fs1, _, :Fs1, _, :Fs1, :fs1, :FS1,:fs1, 139 | 140 | # :fs5, :Fs5, :Fs1, _, :Fs1, _, :FS1, _, 141 | play (knit :fs2,1,:a2,7, _,(32-4)*0).tick(:zass), 142 | # ).tick(:zass), 143 | decay: (ring 0.1,0.25,0.1,0.1).tick(:j), 144 | release: 0.1, amp: 4.0, attack: 0.001, detune: 12, 145 | cutoff: 75 146 | end 147 | sleep 0.25 148 | } 149 | 150 | end 151 | -------------------------------------------------------------------------------- /destination/bang/2.rb: -------------------------------------------------------------------------------- 1 | ["samples","instruments","experiments", "log", "shaderview"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"}; _=nil 2 | 3 | 4 | with_fx(:reverb, room: 0.8, mix: 0.9, damp: 0.5) do |r_fx| 5 | live_loop :warm_up do 6 | # sample Corrupt[/acoustic guitar/, /fx/].tick, cutoff: 75, amp: 1.5, beat_stretch: 8.0 7 | #sync :organ 8 | with_fx(:slicer, phase: 0.25*2, probability: 0) do 9 | 10 | with_synth :dark_sea_horn do 11 | play :fs2, cutoff: 80, decay: 8.1, amp: 0.6 12 | end 13 | end 14 | 15 | sleep 8 16 | end 17 | end 18 | shader :iWave, 0.5 19 | #--Log of activity----------------------------------------> 20 | 21 | #The code here creates and controls the sounds you are hearing. 22 | 23 | live_loop :Matz do 24 | with_fx :reverb, room: 0.5 do 25 | with_fx(:pitch_shift, mix: 0.8, window_size: 0.1, pitch_dis: 0.05) do 26 | with_fx(:flanger, feedback: 0.8, decay: 0.5,mix: 0.4) do |r_fx| 27 | sample Words[/guy/], amp: 0.0 28 | end 29 | end 30 | end 31 | sleep 32 32 | end 33 | 34 | live_loop :heart do 35 | sync :organ 36 | #New samples to play with... 37 | with_fx(:krush, mix: 0.4) do |r_fx| 38 | #sample Organic[/kick/,2], cutoff: 80, amp: 1.0 39 | end 40 | 41 | sample ChillD[/drum_loop/,10], cutoff: 60, amp: 0.5, beat_stretch: 8.0 42 | 43 | #sample Organic[/drum_loops/,0],amp: 1.0 44 | 45 | 46 | 47 | # sample Dust[/f#m/,1], cutoff: 45, amp: 0.2, beat_stretch: 8.0 48 | # sleep 2 49 | 50 | #New set of samples.... no idea what we will find in here..... 51 | sleep 8 52 | end 53 | 54 | live_loop :perc do 55 | with_fx(:krush, mix: 0.1) do |r_fx| 56 | with_fx(:slicer, phase: 0.25, probability: 0) do 57 | sample Organic[/loop/,/perc/, 2], cutoff: 75, 58 | beat_stretch: 16.0, amp: 1.0 59 | end 60 | end 61 | sleep 16 62 | end 63 | 64 | live_loop :breath do 65 | with_fx(:reverb, room: 1.0, mix: 0.8, damp: 0.5) do |r_fx| 66 | # sync :organ 67 | sleep 16+4 68 | sample Fraz[/coil/,/c#/,0], cutoff: 60, amp: 0.8, rate: 0.5 69 | sleep 16-4 70 | end 71 | end 72 | 73 | 74 | live_loop :fx do 75 | 76 | sync :organ 77 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 78 | synth :dsaw, note: :Fs1, cutoff: 40, amp: 0.1, decay: 16, detune: 12 79 | synth :prophet, note: :Fs1, cutoff: 40, amp: 0.1, decay: 16, detune: 12 80 | end 81 | 82 | sample Organic[/f#/,/strings/,0], cutoff: 50, amp: 1.0, beat_stretch: 16 83 | sleep 16 84 | end 85 | 86 | #This is the Leeds organ. Its lovely... 87 | live_loop :organ do 88 | synth :hollow, note: :e3, attack: 1.0, decay: 4.0 89 | slices = [1,2,4].shuffle 90 | notes = [[/f#1/, /a1/, /c#1/], 91 | [/a1/, /c#1/, /_e1_/], 92 | [/c#1/, /_e1_/, /g#1/]].choose 93 | 94 | #notes = [/f#2/, /g#1/, /b1/] 95 | 96 | sample Organ[/f#0/,[0,0]].tick(:sample), cutoff: 100, amp: 2.0 97 | with_fx(:slicer, phase: 0.25*slices[0], probability: 0) do 98 | sample Organ[notes[0],[0,0]].tick(:sample), cutoff: 100, amp: 3.0 99 | end 100 | 101 | with_fx :echo, phase: 0.25*2 do 102 | #sample Instruments[/violin/, /fs4_1|a4_1|cs4_1/].tick, amp: 1, attack: 0.5 103 | end 104 | 105 | with_fx :echo, decay: 8.0 do 106 | with_fx(:distortion, mix: 0.1, distort: 0.2) do |r_fx| 107 | with_fx :reverb, room: 1.0 do 108 | sample Instruments[/cello/, /pianissimo_arco/, /fs2_1|a2_1|cs2_1/].tick, amp: 8 109 | end 110 | end 111 | end 112 | 113 | 114 | with_fx(:echo, phase: 0.25*2, decay: 8.0) do 115 | sample Organic[/kick/,4], amp: 2.0 116 | #sample Organic[/kick/,4], amp: 2.0, rate 117 | 118 | #sample Instruments[/violin/, /fs4/].tick(:oboe), amp: 1 119 | 120 | #sample Instruments[/double-bass/, /fs1/].tick(:oboe), amp: 1 121 | 122 | # sample Instruments[/oboe/, /fs5/].tick(:oboe), amp: 1 123 | # sample Instruments[/oboe/, /fs6/].tick(:oboe), amp: 1 124 | 125 | end 126 | 127 | with_fx(:slicer, phase: 0.25*slices[1], probability: 0) do 128 | sample Organ[notes[1],[0,0]].tick(:sample), cutoff: 100, amp: 3.0 129 | end 130 | 131 | with_fx(:slicer, phase: 0.25*slices[2], probability: 0) do 132 | sample Organ[notes[2],[0,0]].tick(:sample), cutoff: 100, amp: 2.9 133 | end 134 | 135 | sleep 8 136 | end 137 | -------------------------------------------------------------------------------- /destination/bang/Readme.md: -------------------------------------------------------------------------------- 1 | ``` 2 | ██╗ 3 | ██║ 4 | ██║ 5 | ╚═╝ 6 | ██╗ 7 | ╚═╝ 8 | ``` 9 | -------------------------------------------------------------------------------- /destination/dark_sea_horses/1.rb: -------------------------------------------------------------------------------- 1 | #Defaults 2 | shader :shader, "wave.glsl", "bits.vert", "points", 10000 3 | shader [:iR, :iB, :iG], 3.0 4 | shader :iForm, 0.01 5 | shader :iDir, 1.0 6 | shader :iMotion, 0.002 7 | shader :iWave, 0.01 8 | shader :iSize, 100.9 9 | shader :iPointSize, 0.2 10 | shader :iDistort, 0.005 11 | -------------------------------------------------------------------------------- /destination/dark_sea_horses/Readme.md: -------------------------------------------------------------------------------- 1 | # ██████╗ █████╗ ██████╗ ██╗ ██╗ ███████╗███████╗ █████╗ 2 | # ██╔══██╗██╔══██╗██╔══██╗██║ ██╔╝ ██╔════╝██╔════╝██╔══██╗ 3 | # ██║ ██║███████║██████╔╝█████╔╝ ███████╗█████╗ ███████║ 4 | # ██║ ██║██╔══██║██╔══██╗██╔═██╗ ╚════██║██╔══╝ ██╔══██║ 5 | # ██████╔╝██║ ██║██║ ██║██║ ██╗ ███████║███████╗██║ ██║ 6 | # ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚══════╝╚═╝ ╚═╝ 7 | # 8 | # ██╗ ██╗ ██████╗ ██████╗ ███████╗███████╗███████╗ 9 | # ██║ ██║██╔═══██╗██╔══██╗██╔════╝██╔════╝██╔════╝ 10 | # ███████║██║ ██║██████╔╝███████╗█████╗ ███████╗ 11 | # ██╔══██║██║ ██║██╔══██╗╚════██║██╔══╝ ╚════██║ 12 | # ██║ ██║╚██████╔╝██║ ██║███████║███████╗███████║ 13 | # ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝ 14 | 15 | ```ruby 16 | :dark_sea_horses 17 | ``` 18 | -------------------------------------------------------------------------------- /destination/div/Readme.md: -------------------------------------------------------------------------------- 1 | ``` 2 | ██╗ 3 | ██╔╝ 4 | ██╔╝ 5 | ██╔╝ 6 | ██╔╝ 7 | ╚═╝ 8 | ``` 9 | -------------------------------------------------------------------------------- /destination/do/0.rb: -------------------------------------------------------------------------------- 1 | ["instruments","shaderview","experiments", "log"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"}; _=nil 2 | 3 | #This is a very experimental version of Sonic Pi 4 | #This annoying flicker :( 5 | 6 | 7 | shader :iCells, 0.0 8 | shader :iStars, 0.0 9 | shader :iStarLight, 0.0 10 | shader :iStarsMotion, 0.0 11 | 12 | 13 | set_volume! 5.0 14 | 15 | with_fx(:reverb, room: 1.0, mix: 0.8, damp: 0.5) do |r_fx| 16 | live_loop :test do 17 | shader :iBeat, rand*0.1 18 | use_random_seed 300 19 | #sample Mountain[/bow/, /F#/,0], cutoff: 90, amp: 0.5 20 | #sample Corrupt[/guitar/,/F#m/].shuffle.tick(:sample), cutoff: rrand(60,70), amp: 0.5, beat_stretch: 8 21 | sleep 8 22 | end 23 | end 24 | 25 | live_loop :something_else do 26 | sync :test 27 | #with_fx(:slicer, phase: 0.25*2, probability: 0) do 28 | with_fx(:echo, decay: 1.0, mix: 1.0, phase: 0.25) do 29 | sample Fraz[/kick/,0], cutoff: 70, amp: 0.5 30 | end 31 | #end 32 | 33 | with_fx(:flanger, feedback: 0.5) do 34 | # sample Corrupt[/Organic/, 0], cutoff: 75, amp: 0.5, beat_stretch: 16.0 35 | sleep 16/4.0 36 | end 37 | 38 | # sample Corrupt[/clap/,[0,0]].tick(:sample), cutoff: 30, amp: 0.5, beat_stretch: 16/4.0 39 | #Very very buggy build :Odd. 40 | 41 | with_fx(:slicer, mix: 0.5, probability: 0.5) do 42 | #sample Corrupt[/Organic/, 0], cutoff: 75, amp: 0.5, beat_stretch: 16.0, rate: -1.0 43 | sleep 16/4.0 44 | end 45 | #with_fx(:slicer, mix: 0.5) do 46 | #sample Corrupt[/Organic/, 0], cutoff: 75, amp: 0.5, beat_stretch: 16.0*2.0 47 | #end 48 | #end 49 | end 50 | 51 | live_loop :movement2 do 52 | #sync :test 53 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 54 | 55 | if spread(7,11).tick 56 | # sample Dust[/hat/,Range.new(1, 4)].tick(:sample), cutoff: 65, amp: 0.4, pan: 0.25 57 | end 58 | if spread(3,7).look 59 | # sample Dust[/hat/,Range.new(1, 2)].tick(:sample), cutoff: 65, amp: 0.4, pan: -0.25 60 | end 61 | end 62 | 63 | #MAchine is hurting..... 64 | sleep 0.25*8 65 | end 66 | 67 | live_loop :something_something_something do 68 | sync :test 69 | #sample Corrupt[/keys/,1], cutoff: (ramp 70, 120).tick(:antoher), amp: 0.5, beat_stretch: 16.0 70 | sleep 16 71 | end 72 | 73 | live_loop :some_one_shots do 74 | #Random here, I'm taking the entire sample set and just grabbing one. 75 | #See what happens 76 | #sample Corrupt[//,1], cutoff: 60, amp: 0.2, beat_stretch: 16 77 | sleep 16 78 | end 79 | 80 | live_loop :coils do 81 | shader :iInvert, [1.0,0.0].choose 82 | with_fx(:bitcrusher, mix: 0.1, bits: 8, sample_rate: 20000) do 83 | sample Ether[/interference/, /Fm/, 1], cutoff: 70, amp: 0.8, beat_stretch: 16 84 | end 85 | 86 | sleep 16 87 | end 88 | 89 | shader :iStarMotion, 0.0 90 | 91 | live_loop :corrupted_bass do 92 | with_fx(:flanger, feedback: 0.5) do 93 | with_fx(:reverb, room: 0.9, mix: 1.0, damp: 0.5, damp_slide: 1.0) do |r_fx| 94 | # sample Sop[/f#/,[0,0]].tick(:sample), cutoff: 60, amp: 0.5, beat_stretch: 8 95 | 8.times{sleep 1 ; control r_fx, damp: rand} 96 | end 97 | end 98 | end 99 | 100 | live_loop :bass2 do 101 | # use_random_seed (ring 300, 400).tick 102 | with_fx(:reverb, reps: 4) do 103 | with_synth :hollow do 104 | #Tooooo loud 105 | n = scale(:Fs3, :minor_pentatonic, num_octaves: 3).take(3).shuffle 106 | 16.times { 107 | hollow n, cutoff: 70, amp: 0.5, decay: 0.25 108 | sleep 0.5 109 | } 110 | end 111 | end 112 | end 113 | 114 | live_loop :bass do 115 | use_random_seed (ring 300, 400).tick 116 | with_synth :dark_sea_horn do 117 | #Tooooo loud 118 | n = scale(:Fs2, :minor_pentatonic, num_octaves: 3).take(2).shuffle 119 | play n, cutoff: 40, amp: 0.2, decay: 8.1 120 | end 121 | sleep 8 122 | end 123 | -------------------------------------------------------------------------------- /destination/do/1.rb: -------------------------------------------------------------------------------- 1 | ["instruments","shaderview","experiments", "log"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"}; _=nil 2 | 3 | #-------------------Activity log--------------------------------> 4 | 5 | shader :shader, "/Users/josephwilk/Workspace/c++/of_v0.8.4_osx_release/apps/myApps/shaderview/bin/data/something.glsl" 6 | 7 | set_volume! 0.5 8 | 9 | #Live coding music and lights. 10 | #Everything you *hear* is driven by this code. 11 | #Everything you *see* is driven by code. 12 | 13 | shader :iWave, 0.0 14 | shader :iGlow, 0.0 15 | shader :iColor, 1.0 16 | shader :iZoom, 0.1 17 | 18 | with_fx(:reverb, room: 1.0, mix: 0.9, damp: 0.0) do |r_fx| 19 | live_loop :warming_up do 20 | with_fx(:bitcrusher, mix: 0.01, bits: 8, sample_rate: 20000, cutoff: 40) do 21 | # sample Corrupt[/guitar/,/fx/].shuffle.tick(:sample), cutoff: rrand(70,90), amp: 0.2, beat_stretch: 16 22 | end 23 | sleep 16 24 | end 25 | end 26 | 27 | live_loop :coils do 28 | with_fx(:reverb, room: 0.7, mix: 0.4, damp: 0.5) do |r_fx| 29 | # sample Fraz[/coil/,/F#/,0], cutoff: 130, amp: 0.5 30 | end 31 | sleep 32 32 | end 33 | 34 | live_loop :interferance do 35 | # sample Ether[/interference/,/F#m/,3], cutoff: 130, amp: 0.5 36 | sleep 8 37 | end 38 | 39 | with_fx(:reverb, room: 0.8, mix: 0.4, damp: 0.5) do |r_fx| 40 | live_loop :bows_over_the_water do 41 | #sample Mountain[/bow/, /F#/], cutoff: 65 42 | sleep 64 43 | end 44 | end 45 | 46 | live_loop :sop do 47 | with_fx(:reverb, room: 0.8, mix: 0.4, damp: 0.5) do |r_fx| 48 | with_fx(:flanger, feedback: 0.8) do 49 | # sample Sop[/F#/,[0,0]].tick(:sample), cutoff: rrand(60,75), amp: 0.5 50 | end 51 | end 52 | sleep 16 53 | end 54 | 55 | live_loop :something_is_missing________ do 56 | use_random_seed 200 57 | 58 | with_fx :reverb, room: 1.0, reps: 4 do 59 | notes = scale(:Fs4, :minor, num_octaves: 3).take(3).shuffle 60 | # sample Corrupt[/f#m/,11..18].tick 61 | sync :waves 62 | 16.times{ 63 | with_synth :pretty_bell do 64 | play (knit notes.choose,2, _,2, notes.choose,4).tick(:n), cutoff: 70, amp: 0.0, decay: 0.1, 65 | detune: 24, release: (ring 0.05,0.1).tick(:r), 66 | attack: 0.01 67 | 68 | synth :dark_ambience, 69 | note: (knit notes.choose,1, _,3).tick(:dark), 70 | cutoff: 100, 71 | amp: 2.0, 72 | release: 1.0, 73 | attack: 2.0 74 | end 75 | sleep 0.25 76 | } 77 | end 78 | end 79 | 80 | live_loop :light do 81 | use_random_seed 300 82 | notes = [chord(:FS3, 'sus4'), 83 | chord(:FS3, 'sus2'), 84 | chord_degree(5, :fs3, :minor), 85 | chord(:Cs3, 'm7+5'), 86 | ].choose.shuffle 87 | 4.times{ 88 | i_hollow(notes, amp: 1.9, cutoff: rrand(55,60)) 89 | sleep 4 90 | } 91 | end 92 | 93 | live_loop :waves do 94 | #sync :warming_up 95 | shader :iIt, rrand(5,40); 96 | shader :decay, :iBeat, 1.0, 0.001 97 | #sample Fraz[/kick/,[0,0]].tick(:sample), cutoff: 130, amp: 8.5 98 | 99 | with_fx(:echo, decay: 0.5, mix: 1.0, phase: 0.25) do 100 | # with_fx(:slicer, phase: 0.25, probability: 0.01) do 101 | # sample Fraz[/kick/,[0,0]].tick(:sample), cutoff: 75, amp: 0.5 102 | # end 103 | end 104 | 105 | # with_fx :echo, phase: 0.25 do 106 | with_fx(:slicer, phase: 2.0 ,invert_wave: 0, smooth: 1.0) do 107 | sample Corrupt[/organic/, 10], amp: 1.0, beat_stretch: 8/2.0 108 | end 109 | # end 110 | 111 | # sample Corrupt[/organic/, 10], amp: 1.0, rate: 1.0, beat_stretch: 8/1.0 112 | 113 | sleep 8/2.0 114 | 115 | # sample Fraz[/clap/,3], cutoff: 100 116 | 117 | 118 | with_fx(:slicer, decay: 0.25, mix: 1.0, phase: 0.5, probability: 0.5) do 119 | # sample Corrupt[/organic/, 10], amp: 1.0, rate: -1.0, beat_stretch: 8/4.0 120 | end 121 | end 122 | 123 | live_loop :darkness_rising do 124 | #use_random_seed 300 125 | with_synth :dark_sea_horn do 126 | play scale(:Fs2, :minor_pentatonic, 127 | num_octaves: 1).take(2).shuffle.choose, cutoff: 55, amp: 0.35*0.0, decay: 8.1 128 | end 129 | sleep 8 130 | end 131 | -------------------------------------------------------------------------------- /destination/do/3.rb: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # 4 | 5 | shader :iColor, 0.5 6 | shader :iZoom, 1.1 7 | shader :iIt, 20.0 8 | 9 | live_loop :play2 do 10 | shader :iIt, 30.0 11 | shader :decay, :iBeat, 1.0, 0.001 12 | 13 | # with_fx(:echo, decay: 0.5, mix: 1.0, phase: 0.25) do 14 | #sample Corrupt[/kick/,[2,2]].tick(:sample), cutoff: 70, amp: 0.8 15 | # end 16 | 17 | #with_fx(:slicer, phase: 4.0, probability: 0, mix: 1.0) do 18 | #sample Corrupt[/organic/,9], cutoff: 50, amp: 1.0, beat_stretch: 8.0 19 | #end 20 | 21 | with_fx(:slicer, phase: 4.0, probability: 0, mix: 1.0) do 22 | # sample Corrupt[/organic/,9], cutoff: 135, amp: 1.0, beat_stretch: 8.0*2, rate: -1.0 23 | end 24 | 25 | with_fx :pan, pan: Math.sin(vt*13)/1.5 do 26 | with_fx(:echo, decay: 1.0, mix: 1.0, phase: 0.25*4) do 27 | with_fx(:slicer, phase: 0.25, probability: 0.0, smooth: 0.5) do 28 | #sample Corrupt[/f#m/,11], beat_stretch: 4, cutoff: 80 29 | end 30 | end 31 | end 32 | sleep 8 33 | end 34 | 35 | live_loop :bass do 36 | sync :play2 37 | #with_fx(:krush, mix: 1.0) do 38 | #sample Corrupt[/bass/,/f#m/,3], amp: 2.0, beat_stretch: 8*2, cutoff: 135 39 | #end 40 | with_fx(:slicer, phase: 0.25, probability: 0) do 41 | # sample Corrupt[/bass/,/f#m/,3], amp: 1.5, beat_stretch: 8*2, rate: -1.0 42 | end 43 | sleep 8 44 | end 45 | 46 | live_loop :perc do 47 | # sample Corrupt[/violin/,4], cutoff: 100, amp: 0.5, beat_stretch: 16 48 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 49 | #sample Corrupt[/f#m/,/fx/,0], cutoff: 100, amp: 0.5, beat_stretch: 16 50 | end 51 | sleep 16 52 | end 53 | 54 | live_loop :keys do 55 | #sync :play2 56 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 57 | #sample Corrupt[/keys/, /f#m/, 7], beat_stretch: 16, cutoff: 100, amp: 0.5 58 | end 59 | sleep 16 60 | end 61 | 62 | live_loop :one_shots do 63 | # sample Corrupt[/one shot/,/B_/] 64 | # sample Corrupt[/Mbira/].tick 65 | sleep 8 66 | end 67 | 68 | with_fx(:reverb, room: 1.0, mix: 0.4, damp: 0.5) do |r_fx| 69 | live_loop :hum do 70 | #4.times{sync :play2} 71 | # sample Corrupt[/Mic Hum/,/f#/].tick(:sample), cutoff: 130, amp: 0.5 72 | #sample Corrupt[/F#/, /Kalimba/, /texture/, /fx/, [1,4,2]].tick, amp: 2.0 73 | sleep 12 74 | end 75 | end 76 | 77 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 78 | live_loop :guitar do 79 | #sample Corrupt[/acoustic guitar/,/fx/, /f#/].tick(:sample), 80 | # cutoff: 80, amp: 0.5 81 | sleep 8 82 | end 83 | end 84 | 85 | _=nil 86 | live_loop :bells do 87 | #sync :keys 88 | #use_random_seed (ring 100, 200).tick 89 | use_synth :dsaw 90 | 91 | #with_fx(:krush, mix: 0.0, cutoff: 70) do 92 | with_fx(:reverb, room: 1.0, mix: 0.4, damp: 0.5, reps: 4.0, damp_slide: 1.0) do |r_fx| 93 | notes = scale(:Fs3, :minor_pentatonic, num_octaves: 1).shuffle.drop(1).take(3).shuffle 94 | synth :dsaw, note: (ring :D2, :Fs2, :Cs2).tick(:bass), cutoff: 50, decay: 8, amp: 0.0, detune: 12 95 | 32.times{ 96 | comment do 97 | play (knit notes.choose, 1, _,2, notes.choose,5), 98 | release: 0.05, sustain: 0.1, attack: 0.001, 99 | cutoff: rrand(70,80), amp: (rand+0.1)*0.0 100 | control r_fx, damp: rand, detune: 12 101 | synth :prophet, note: (knit notes.choose, 1, _,2, notes.choose,5).choose, cutoff: 55, release: 0.05, attack: 0.001, sustain: 0.1, amp: 0.5 102 | end 103 | sleep 0.25 104 | } 105 | 106 | end 107 | #end 108 | end 109 | -------------------------------------------------------------------------------- /destination/do/Readme.md: -------------------------------------------------------------------------------- 1 | ``` 2 | __ 3 | /\ \ 4 | \_\ \ ___ 5 | /'_` \ / __`\ 6 | /\ \L\ \/\ \L\ \ 7 | \ \___,_\ \____/ 8 | \/__,_ /\/___/ 9 | ``` 10 | -------------------------------------------------------------------------------- /destination/frozen?/0.rb: -------------------------------------------------------------------------------- 1 | ["log","experiments", "shaderview"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"} 2 | f=false;t=true;_=nil 3 | # Just messing around with SonicPi. 4 | # Nothing polished, just learning the music and code thing. 5 | @hold = (ring *%w{2 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0}.map(&:to_i)) 6 | @transpose = (ring *%w{-5 0 0 0 -5 0 0 0 0 -12 0 -2 -12 -2 0 -12}.map(&:to_i)) 7 | @velocity = (ring *%w{100 100 49 100 118 78 110 114 100 127 100 127 115 100 100 100}.map(&:to_i)) 8 | 9 | live_loop :frozen? do 10 | synth :supersaw, note: chord(:Fs4, 'm').shuffle.choose, cutoff: 40, decay: 8, amp: 1.0 11 | 12 | # with_fx(:lpf, cutoff: (ramp *(range 40, 130, 10)).tick(:cut3) ) do 13 | with_fx(:reverb, reps: 4, room: 1.0, mix: 0.9){ 14 | use_random_seed 300#(ring 300, 200, 100).tick(:rand?) 15 | notes = scale(:Fs3, :minor_pentatonic, num_octaves: 2).drop(0).take(3).shuffle 16 | #notes = chord(:Cs3, 'm9').take(3) 17 | with_synth(:hollow){ 18 | synth :supersaw, note: chord(:Cs4, 'm9').shuffle.choose, cutoff: 45, 19 | release:(ring 0.5, 1.0).tick(:r) 20 | 16.times do 21 | with_transpose(@transpose.tick(:t)+12){ 22 | play notes.tick, cutoff: rrand(80,100), cutoff:130, 23 | amp: 1.0 + rand, 24 | release: 0.125, release: @hold.tick(:release)+0.02, 25 | attack: 0.001 #/@velocity.tick(:attack) 26 | } 27 | blade_note = notes.choose 28 | with_fx(:distortion, mix: 0.2) do 29 | with_synth(:fm){ 30 | with_transpose(@transpose.look(:t)){ 31 | play (knit blade_note,1,_,1).tick(:bl), amp: 0.5, env_curv: 4, 32 | release: 0.2, 33 | attack: 0.01, 34 | cutoff: rrand(100,130) 35 | } 36 | } 37 | end 38 | #Maybe some bass? 39 | 40 | with_transpose(-24){ 41 | with_synth(:dsaw){ 42 | play (knit blade_note,1, :r, 63).tick(:bassline), attack: 0.3, cutoff: 60, amp: 0.4*rand, release: 2, decay: 8.0, 43 | detune: 12 44 | } 45 | with_synth(:prophet){ 46 | play (knit blade_note,1, :r, 63).look(:bassline), attack: 0.35, cutoff: 60, amp: 0.4*rand, release: 2, decay: 8.0 47 | } 48 | } 49 | sleep 0.125*2 50 | end 51 | } 52 | } 53 | # end 54 | end 55 | 56 | live_loop :texture do 57 | sync :frozen? 58 | end 59 | 60 | live_loop :ending do 61 | # sample_and_sleep Mountain[/cracklin/,0], rate: 0.9, amp: 0.0 62 | end 63 | 64 | live_loop :drums do 65 | # with_fx(:echo, phase: 0.125, decay: 4.0) do 66 | # with_fx(:slicer, phase: 0.25) do 67 | sample Dust[/kick/, [3,2,4,5]].tick(:kick), amp: 3.5, cutoff: 135 68 | # end 69 | # end 70 | sleep 1 71 | sample Dust[/clap/,1], amp: 0.2, cutoff: rrand(90,100) 72 | sleep 1 73 | end 74 | 75 | live_loop :oneshot do 76 | 77 | sleep 32 78 | end 79 | 80 | with_fx(:reverb, room: 0.8, mix: 0.7) do 81 | live_loop :hats do 82 | sleep 0.25 83 | sample Dust[/hat/,[1,1]].tick(:s), cutoff: (range 60, 100).tick(:c), amp: 0.65 if spread(7,11).tick 84 | sample Dust[/hat/,[0,1]].tick(:s2), cutoff: (range 100, 60).tick(:c2), amp: 0.65 if spread(3,8).look 85 | 86 | if (knit f, 28, t,1, f, 3).tick(:open) 87 | sample Scape[/brush/, 1], amp: 0.1 + rand, cutoff: rrand(100,120) 88 | end 89 | 90 | end 91 | end 92 | live_loop :chords do 93 | with_fx(:hpf, cutoff: 100, cutoff_slide: 2) do |fx| 94 | use_synth :dark_ambience 95 | notes = (ring 96 | chord(:Fs3,'sus4'), 97 | chord(:A3, 'M'), 98 | chord(:D3, 'M'), 99 | chord(:Cs3, "m9")).tick 100 | play notes, release: 2.0, attack: 0.5, decay: 8.2, detune1: 24, detune2: -24, amp: 0.1 101 | 8.times{sleep 1; control fx, cutoff: (ring 80, 100).tick(:cutoff)} 102 | end 103 | end 104 | 105 | live_loop :texture2 do 106 | with_fx(:bitcrusher, mix: 0.08, sample_rate: 8*2000) do 107 | #sample Dust[/f#/, 10], amp: 0.5, cutoff: 80 108 | end 109 | sleep 8 110 | end 111 | 112 | live_loop :detroit do 113 | sample_and_sleep ChillD[/Detroit/, (ring /F#1/).tick], amp: 0.2 114 | 115 | end 116 | -------------------------------------------------------------------------------- /destination/frozen?/Readme.md: -------------------------------------------------------------------------------- 1 | ``` 2 | █████▒██▀███ ▒█████ ▒███████▒▓█████ ███▄ █ 3 | ▓██ ▒▓██ ▒ ██▒▒██▒ ██▒▒ ▒ ▒ ▄▀░▓█ ▀ ██ ▀█ █ 4 | ▒████ ░▓██ ░▄█ ▒▒██░ ██▒░ ▒ ▄▀▒░ ▒███ ▓██ ▀█ ██▒ 5 | ░▓█▒ ░▒██▀▀█▄ ▒██ ██░ ▄▀▒ ░▒▓█ ▄ ▓██▒ ▐▌██▒ 6 | ░▒█░ ░██▓ ▒██▒░ ████▓▒░▒███████▒░▒████▒▒██░ ▓██░ 7 | ▒ ░ ░ ▒▓ ░▒▓░░ ▒░▒░▒░ ░▒▒ ▓░▒░▒░░ ▒░ ░░ ▒░ ▒ ▒ 8 | ░ ░▒ ░ ▒░ ░ ▒ ▒░ ░░▒ ▒ ░ ▒ ░ ░ ░░ ░░ ░ ▒░ 9 | ░ ░ ░░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ 10 | ░ ░ ░ ░ ░ ░ ░ ░ 11 | ░ 12 | 13 | :water.frozen? 14 | ``` 15 | -------------------------------------------------------------------------------- /destination/instance_eval/0.rb: -------------------------------------------------------------------------------- 1 | uncomment do 2 | live_loop :looper do 3 | sync :organ 4 | 5 | sample ChillD[/drum_loop/, 10], beat_stretch: 8.0, amp: 0.98, cutoff: 85 6 | sample Frag[/kick/,0], amp: 0.5, cutoff: 80 7 | sleep 1.0 8 | sample Frag[/kick/,1], amp: 0.5, cutoff: 90 9 | 10 | sleep 2.0 11 | sleep 1.0 12 | sample Frag[/kick/,0], amp: 0.5, cutoff: 80 13 | sleep 2.0 14 | sample Frag[/kick/,1], amp: 0.5, cutoff: 80 15 | sleep 8-6 16 | end 17 | 18 | live_loop :hat do 19 | sleep 0.25/2.0 20 | #sample Frag[/hat/,0], amp: 1.0, cutoff: rrand(80,100) 21 | end 22 | 23 | live_loop :clapper do 24 | #sync :looper 25 | 6.times{ 26 | sleep 1 27 | # sample Ambi[/clap/,3], amp: 1.0 28 | 29 | } 30 | sleep 2 31 | 32 | end 33 | end -------------------------------------------------------------------------------- /destination/instance_eval/3.rb: -------------------------------------------------------------------------------- 1 | live_loop :meta_programming do 2 | with_fx :reverb, room: 0.5 do 3 | with_fx(:pitch_shift, mix: 0.8, window_size: 0.1, pitch_dis: 0.05) do 4 | with_fx(:flanger, feedback: 0.8, decay: 0.5, mix: 0.4) do |r_fx| 5 | sample Words[/guy/,0], amp: 2.5 6 | end 7 | end 8 | end 9 | sleep 32 10 | end 11 | 12 | 13 | with_fx(:reverb, room: 0.8, mix: 0.9, damp: 0.5) do |r_fx| 14 | live_loop :warm_up do 15 | # sample Corrupt[/acoustic guitar/, /fx/].tick, cutoff: 75, amp: 1.5, beat_stretch: 8.0 16 | #sync :organ 17 | with_fx(:slicer, phase: 0.25*1, probability: 0) do 18 | 19 | with_synth :dark_sea_horn do 20 | play :e3, cutoff: 74, decay: 8.1, amp: 1.6 21 | end 22 | end 23 | 24 | sleep 8 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /destination/instance_eval/Readme.md: -------------------------------------------------------------------------------- 1 | ``` 2 | 3 | # # # #### ##### ## # # #### ###### ###### # # ## # 4 | # ## # # # # # ## # # # # # # # # # # 5 | # # # # #### # # # # # # # ##### ##### # # # # # 6 | # # # # # # ###### # # # # # # # # ###### # 7 | # # ## # # # # # # ## # # # # # # # # # 8 | # # # #### # # # # # #### ###### ####### ###### ## # # ###### 9 | ``` 10 | 11 | ```ruby 12 | nil.instance_eval{not nil} 13 | ``` 14 | -------------------------------------------------------------------------------- /destination/live/drums2.spi: -------------------------------------------------------------------------------- 1 | _=nil 2 | live_loop :drums2, sync: :kick do 3 | tick 4 | magic= ring(*%w{_ _ _ _ [18,18,19] _ _ _ 5 | _ _ _ _ _ _ [16,16,17] _ 6 | _ _ _ _ [19,19,18] _ _ _ 7 | _ _ _ _ _ _ [34,34] _} 8 | ).look 9 | 10 | drum= ring(*%w{ [18,18,20] _ _ _ [18,18,20] _ _ _ 11 | [18,18,20] _ _ _ [16,16,17] _ _ _ 12 | [18,18,20] _ _ _ [20,20,18] _ _ _ 13 | [18,18,20] _ _ _ [34,34] _ _ _} 14 | ).look 15 | 16 | with_fx :lpf, cutoff: (line 100, 115, steps: 32).look do 17 | if spread(1,8, rotate: 0).look 18 | sample Frag[/hat/,[0,0]].look, rpitch: (ring 12*1,12*2,12*1).look, amp: 0.5+rand*0.1#, cutoff: 40 19 | end 20 | if spread(1,11, rotate: 1).look 21 | smp Frag[/hat/,[1,1]].look, rpitch: (ring 12*1,12*2,12*1).look, amp: 0.5+rand*0.1# ,cutoff: 80 22 | end 23 | if spread(1,16, rotate: 0).look 24 | smp @slices["Fs4/8"][0], rpitch: (ring 7*-1, 12*0, 12*0).look, amp: 1#, cutoff: 40 25 | end 26 | end 27 | if spread(1,32, rotate: 0).look # F# G G# A A# B C C# D D# E F 28 | sample_smash(Alt[/vor_alto_leg_oo_05_d_08/,0], [8,16,16,16,16].shuffle, 29 | fx: (ring :krush, :none), 30 | rpitch: (ring 12, 5, 5+2.0,0).tick(:progrress), cutoff: 135, amp: 1.0) #(F#5->B) => (A#5->E) => (A#5->E) 31 | sample_smash(Alt[/vor_alto_leg_oo_05_d_08/,0], [32,64,64,64,64,64,64,64,64], rpitch: (ring -12, -12, -12).tick(:progrress), cutoff: 80, amp: 1.0) # (F#5->B) => (A#5->E) => (A#5->E) 32 | #smp @slices["Fs4/8"][0][:path], rpitch: (ring 12, 5, 5+2,0).tick(:progrress), cutoff: 80, amp: 1.0 # (F#5->B) => (A#5->E) => (A#5->E) 33 | 34 | #sample_smash(@slices["Fs4/8"][0][:path], [64,64,64,64,64,64,64,64], rpitch: (ring 12, 12, 12).tick(:progrress), cutoff: 80, amp: 1.0) 35 | #sample_smash(@slices["Fs4/8"][0][:path], [128,128,64,128,128], rpitch: (ring 12, 12, 12).tick(:progrress), cutoff: 80, amp: 1.0) 36 | 37 | at do 38 | sleep 1; if spread(1,32).look 39 | #sample "/Users/josephwilk/Workspace/music/samples/melodyne/vor_alto_leg_oo_05_d_F#_D.wav", amp: 2.0 40 | #sample Alt[/vor_alto_leg_oo_05_d_03/,0], amp: 2 #G# -> C# 41 | #sample Alt[/vor_alto_leg_oo_05_d_09/,0], amp: 2 #G# -> C# 42 | # with_fx(:slicer, invert_wave: 1.0, phase: 0.25){sample Alt[/vor_alto_leg_oo_05_d_08/,0], amp: 1} #F# -> B 43 | # sample Alt[/vor_alto_leg_oo_05_d_02/,0], amp: 1.5 #F# -> B 44 | #with_fx :slicer,phase: 0.5 do 45 | #sample Alt[/vor_alto_leg_oo_05_d_01/,0], amp: 1 ;end #E -> A 46 | #sample Alt[/vor_alto_leg_oo_05_d_07/,0], amp: 2 #E -> A 47 | 48 | #sample Alt[/vor_alto_leg_oo_05_d_06/,0], amp: 2 #D -> G??? 49 | end; end 50 | end 51 | if drum != "_" 52 | matches = drum.match(/(.*)(\[.*\])/) 53 | pat = matches[1].empty? ? "kick" : matches[-2] 54 | selection = matches[-1] 55 | s = Fraz[pat,eval(selection)].tick(:sample) 56 | # smp (knit _,8,Frag[/hihats/,0],1,_,7).look, cutoff: 120, amp: 0.25#(ring -3.0,0,-1).look 57 | #smp s, cutoff: (line 100, 80, steps: 32).look/1.0, rpitch: (ring -5,-1,-1).look, amp: 0.8+rand*0.1 58 | end 59 | with_fx :pan, pan: ring(0.25,-0.25).look do 60 | #control e_fx, phase: knit(0.0,31, 0.25,1).look 61 | s = MagicDust[/_HI/,eval(magic)].tick(:s2) 62 | with_fx (knit :none, 31, :echo, 1).look, decay: 4 do 63 | smp s, amp: 0.8+rand*0.1, rate: 1.0, cutoff: line(80, 105, steps: 32).look 64 | end 65 | s = Fraz[/kick/,[0,1]].look(:s2) 66 | if magic != "_" 67 | with_fx (knit :none, 31, :echo, 1).look, decay: 4 do 68 | #smp s, amp: 1.0+rand*0.1, rate: 1.0, cutoff: ring(*range(70, 105, 5)).look, rpitch: (ring -5.0,0,-1).look 69 | end 70 | end 71 | end 72 | sleep 1/8.0 73 | end 74 | -------------------------------------------------------------------------------- /destination/live/init.spi: -------------------------------------------------------------------------------- 1 | require "mysql2" 2 | module Dsp 3 | def self.query(sql) 4 | SonicPi::Core::RingVector.new(Dsp.connection.query(sql,:symbolize_keys => true).to_a) 5 | end 6 | def self.connection() 7 | @@connection ||= Mysql2::Client.new(:host => "localhost", :username => "root", :database => "repl_electric_samples", :reconnect => true) 8 | end 9 | def self.connect!() 10 | @@connection = Mysql2::Client.new(:host => "localhost", :username => "root", :database => "repl_electric_samples",:reconnect => true) 11 | end 12 | end 13 | 14 | module Samples 15 | def self.sql(query="") 16 | Dsp.query("select * from samples where #{query}") 17 | end 18 | def self.find(path: nil, note: nil, max: nil, min: nil) 19 | @@cache ||= {} 20 | k = "samples[note#{note}path#{path}max#{max}min#{min}]" 21 | if !@@cache.has_key?(k) 22 | query = [] 23 | query << "path like '%#{path}%'" if name 24 | query << "note1='#{note}'" if note 25 | query << "length < #{min}" if min 26 | query << "length > #{max}" if max 27 | r = Dsp.query("select * from samples where #{query.join(" AND ")}") 28 | @@cache[k] = r 29 | end 30 | @@cache[k] 31 | end 32 | def self.flush 33 | @@cache = {} 34 | end 35 | end 36 | 37 | module SampleBeats 38 | def self.sql(query="") 39 | Dsp.query("select * from track where #{query}") 40 | end 41 | def self.find(path: nil, col: collection, filename: f) 42 | @@cache ||= {} 43 | k = "path[query]" 44 | if !@@cache.has_key?(k) 45 | query = [] 46 | query << "path='#{path}'" if path 47 | query << "collection='#{path}'" if col 48 | query << "collection ='#{f}'" if f 49 | r = Dsp.query("select * from track where #{query.join(" AND ")} ORDER BY beat") 50 | puts "results#{r}" 51 | if r && !r.empty? 52 | beats = r.map{|r| r[:beat]} 53 | r = {beats: beats[1..-1]}.merge(r[0]) 54 | end 55 | @@cache[k] = r 56 | end 57 | @@cache[k] 58 | r 59 | end 60 | def self.flush 61 | @@cache = {} 62 | end 63 | end 64 | 65 | module NoteSlices 66 | def self.sql(query="") 67 | Dsp.query("select * from notes_fine where #{query}") 68 | end 69 | def self.find(root: nil, octave: nil, min: nil, max: nil, note: nil, pat: nil) 70 | @@cache = {} 71 | octave = if !note.nil? 72 | note[-1] 73 | else 74 | octave 75 | end 76 | root = if !note.nil? 77 | note[0..-2] 78 | else 79 | root 80 | end 81 | k = "noteslices[note#{root}octave#{octave}max#{max}min#{min}]" 82 | if !@@cache.has_key?(k) 83 | query = [] 84 | query << "note='#{root}'" if root 85 | query << "octave=#{octave}" if octave 86 | query << "length > #{min}" if min 87 | query << "length < #{max}" if max 88 | query << "path REGEXP '#{pat}'" if pat 89 | query = query.flatten 90 | r = Dsp.query("select * from notes_fine where #{query.join(" AND ")}") 91 | @@cache[k] = r 92 | end 93 | @@cache[k] 94 | end 95 | def self.flush 96 | @@cache = {} 97 | end 98 | end 99 | 100 | _=nil 101 | def note_slices(note, m) 102 | NoteSlices.find(note: note, max: m, pat: "sop|alto|bass").select{|s| s[:path] =~ /sop|alto/}.take(16) 103 | end 104 | @slices ||= {"Gs2/4" => note_slices("Gs2",1/4.0),"D2/4" => note_slices("D2",1/4.0), "E2/4" => note_slices("E2",1/4.0), "A2/4" => note_slices("A2",1/4.0), "Fs2/4" => note_slices("F#2",1/4.0),"Fs2/8" => note_slices("F#2",1/8.0), "E3/4" => note_slices("E3",1/4.0), "D3/4" => note_slices("D3",1/4.0),"D3/8" => note_slices("D3",1/8.0),"Cs3/4" => note_slices("C#3",1/4.0), "Fs3/8" => note_slices("F#3",1/8.0),"Fs3/4" => note_slices("F#3",1/4.0), "Gs3/4" => note_slices("G#3",1/4.0), "A3/8" => note_slices("A3",1/8.0),"A3/4" => note_slices("A3",1/4.0), "B3/4" => note_slices("B3",1/4.0), "Cs4/4" => note_slices("C#4",1/4.0), "Cs4/8" => note_slices("C#4",1/8.0), "D4/4" => note_slices("D4",1/4.0),"D4/8" => note_slices("D4",1/8.0), "E4/4" => note_slices("E4",1/4.0),"E4/8" => note_slices("E4",1/8.0), "Fs4/4" => note_slices("F#4",1/4.0),"Fs4/8" => note_slices("F#4",1/8.0), "Gs4/4" => note_slices("G#4",1/4.0), "B4/4" => note_slices("B4",1/4.0),"Fs5/4" => note_slices("F#5",1/4.0), "Fs6/4" => note_slices("F#6",1/4.0),"A4/4" => note_slices("A4",1/4.0),"E5/4" => note_slices("E5",1/4.0)} 105 | @slices.values.flatten.each{|f| load_sample f[:path]} 106 | puts @slices.values.flatten.count 107 | 108 | live_loop :doit do 109 | tick 110 | sample @slices["Fs4/8"].map{|p|p[:path]}.look, amp: 10 111 | sleep 2 112 | end 113 | -------------------------------------------------------------------------------- /destination/live/perc.spi: -------------------------------------------------------------------------------- 1 | #use_bpm 60 2 | #sub-zero-minimal-techno 3 | #https://www.attackmagazine.com/technique/beat-dissected/sub-zero-minimal-techno 4 | _=nil 5 | 6 | live_loop :drums, sync: :kick do 7 | with_fx :level, amp: 1.0 do 8 | with_bpm 120 do 9 | k1 = Mountain[/Subkick/,0] 10 | h1,h2 = @slices["Fs3/4"][17], Frag[/hats/,8] 11 | # h1,h2 = @slices["Fs3/8",0] Frag[/hats/,9], Frag[/hats/,8] 12 | s1,s2,s3 = MagicDust[/Hit_HI/,58],Tech[/Drum_Hits/,/snare/,3],Tech[/Drum_Hits/,/snare/,6] 13 | p1 = MagicDust[/_HI/,49] 14 | v1 = "/Users/josephwilk/Dropbox/repl-electric/samples/beauty_and_practical.wav"#Word#Tech[/vocal/,12] 15 | r1 = Tech[/cymbal/,10] 16 | kick = (ring *%w{k1 _ _ _ _ _ _ _}) 17 | hat = (ring *%w{_ _ h1 _}) 18 | hat2 = (ring *%w{_ _ h2 _ 19 | _ _ h2 {path:h2,amp:0.05} 20 | _ _ h2 _ 21 | _ _ h2 _}) 22 | snare = (ring *%w{_ _ _ _ s1 _ _ _}) 23 | snare2 = (ring *%w{_ _ _ _ _ _ _ _ 24 | _ _ _ _ _ _ _ s2 25 | _ _ _ _ _ _ _ _ 26 | _ _ _ _ _ _ _ s3 27 | }) 28 | voice = (ring *%w{ _ _ _ _ _ _ _ _ 29 | _ _ _ _ _ _ v1 _}) 30 | cymbal = (ring *%w{_ _ _ _ _ _ _ _ 31 | _ _ _ _ _ _ _ _ 32 | _ _ _ _ _ _ _ _ 33 | _ _ _ _ _ _ _ _ 34 | _ _ _ _ _ _ _ _ 35 | _ _ _ _ _ _ _ _ 36 | _ _ _ _ _ _ _ _ 37 | _ _ _ r1 _ _ _ _ 38 | }) 39 | perc = (ring *%w{_ _ _ p1 40 | _ _ p1 _ 41 | _ p1 _ _ 42 | _ _ _ _}) 43 | 44 | (4).times{ 45 | tick 46 | smp eval(kick.look), cutoff: 80, amp: 0.5#, rpitch: (ring 12, 24, 24).look 47 | smp eval(hat.look), amp: 5.0# rpitch: 0 48 | smp eval(hat2.look),amp: rand*0.1+0.1 49 | 50 | #smp eval(snare.look), amp: 0.75 51 | #smp eval(snare2.look), amp: 0.75 52 | #smp eval(voice.look), finish: 0.5, start: 0.3, rate: 1.0, amp: 1.5 53 | #smp eval(voice.look), finish: 0.40, start: 0.2, rate: 0.125, amp: 1.5 54 | #smp eval(cymbal.look), finish: 0.95, start: 1.0 55 | smp eval(perc.look), amp: rand*0.2 56 | sleep 1/4.0 57 | } 58 | end 59 | end 60 | end 61 | -------------------------------------------------------------------------------- /destination/live/scratch.spi: -------------------------------------------------------------------------------- 1 | def sample_smash(sample_file, bits, *args, &block) 2 | if sample_file 3 | data = smash(sample_file, bits) 4 | opt = args[0] 5 | selection = data[:data].shuffle 6 | fx_selection = opt[:fx] || ring(:none,:none) 7 | opt.delete(:fx) 8 | selection.each do |d| 9 | opt[:start] = d[0]/data[:total] 10 | opt[:finish] = d[1]/data[:total] 11 | with_fx(fx_selection.tick(:fx), mix: 1.0) do 12 | sample(sample_file, *[opt]) 13 | end 14 | 15 | yield block if block_given? 16 | sleep d[1]-d[0] 17 | end 18 | selection 19 | end 20 | end 21 | 22 | sample_smash(Alt[/vor_alto_leg_oo_05_d_08/,0], 23 | [ 24 | 8,32,32,32,32, 25 | 32,32,32,32, 26 | 32,32,32,32, 27 | 32,32,32,32, 28 | 32,32,32,32, 29 | 32,32,32,32, 30 | 32,32,32,32, 31 | 32,32,32,32, 32 | 32,32,32,32, 33 | 32,32,32,32], 34 | rpitch: (ring 12, 5, 5+2.0,0).tick(:progrress), cutoff: 135, amp: 4.0) 35 | -------------------------------------------------------------------------------- /destination/live/skitter.spi: -------------------------------------------------------------------------------- 1 | with_fx :echo, mix: 0.8, phase: 0.25 do |e_fx| 2 | live_loop :skitter, sync: :kick do 3 | with_fx :level, amp: 1.0 do 4 | tick 5 | idx2= ring( *%w{9 1 1 _ 1 _ 1 _ 1 _ _ _ 1 _ _ _ 6 | } 7 | ).look 8 | idx2= ring( *%w{2 2 _ _ 3 _ _ _ 1 _ _ _ _ _ _ _ 9 | 1 1 _ _ _ _ _ _ 1 _ _ 1 _ _ _ _ 10 | 1 1 _ _ _ _ _ _ 1 _ _ _ _ _ _ _ 11 | 1 1 _ _ _ _ 1 _ 1 _ _ 1 _ _ _ _ 12 | 13 | 3 3 _ _ 2 _ _ _ 1 _ _ _ 1 _ _ _ 14 | 1 1 _ _ _ _ _ _ 1 _ _ 2 _ _ _ _ 15 | 1 1 _ _ _ _ _ _ 1 _ _ _ _ _ _ _ 16 | 1 1 _ _ _ _ 1 _ 1 _ 1 1 _ _ _ _ 17 | } 18 | ).look 19 | idxdd2= ring( *%w{_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 20 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 2 21 | } 22 | ).look 23 | 24 | idx2 = (ring *%w{_ _ 4 _ 25 | _ _ 5 _ 26 | _ _ 6 _ 27 | _ _ 4 _ 28 | _ _ 5 _ 29 | _ _ 6 _ 30 | 31 | _ _ 6 _ 32 | _ _ 7 8 33 | }).look 34 | 35 | s = nil 36 | control e_fx, phase: ring(0.25, 0.0, 0.125, 0.0).look*2 37 | control e_fx, decay: 2.0 38 | if idx2 != "_" 39 | with_fx :hpf, cutoff: 80, mix: 1.0 do 40 | with_fx :bitcrusher, mix: (line 0.0, 1.0, steps: 32).look*0.2 do# bits: (line 4,8,steps: 32).look do 41 | # with_fx :echo, mix: 0.9, decay: 8.0 do 42 | score = knit( 43 | # "Fs4/4",4, _,4, _,4, _,4, 44 | 45 | # "Fs4/4",4, "Fs3/4",4, "Fs3/4",4, "Fs3/4", 4, 46 | # "Fs3/4",4, "A3/4",4, "A3/4",4, "A3/8", 4, 47 | # "Fs3/4",4, "A3/4",4, "A3/4",4, "A3/8", 4, 48 | # "A3/4",4, "A3/4",4, "A3/4",4, "A3/8", 4, 49 | 50 | # "Fs4/4",4, "Fs3/4",4, "Fs3/4",4, "Fs3/4",4, #F#=>C# C# D D# E F F# G G# A 51 | # "Fs3/4",4, "A3/4",4, "A3/4",4, "A3/4", 4, 52 | # "Fs3/4",4, "A3/4",4, "Fs3/4",4, "Fs3/4",4, 53 | # "Fs3/4",4, "A3/4",4, "A3/4",4, "A3/4", 4, 54 | # "Fs3/4",4, "A3/4",4, "Fs3/4",4, "Fs3/4",4, 55 | # "Fs3/4",4, "A3/4",4, "A3/4",4, "A3/4", 4, 56 | # "A3/4",4, "Fs3/4",4, "Fs3/4",4, "Fs3/4",4, 57 | "Fs3/4",4, "A3/4",4, "Fs3/4",4, "Fs3/4", 4, 58 | ) 59 | set = @slices[score.look] 60 | if set 61 | s = set[eval(idx2)] 62 | bits = (ring [ratio_off(s)-0.05, ratio_on(s)], [ratio_on(s)-0.05, ratio_off(s)]) 63 | bits = bits.look#.shuffle 64 | smp s, amp: ring(*range(0.68, 2.0, 0.01)).look*4, cutoff: ring(*range((rand > 0.5 ? 95 : 95), 135, 5)).look, pan: ring(0.25,-0.25).look, 65 | rpitch: (knit 5,4,5+2,4,0,4, 5,4,5+3,4,0,4).look*0#, finish: bits[0], start: bits[1] 66 | # rpitch: knit(note_to_semi(score.look[0..-3], :Cs3),4, note_to_semi(score.look[0..-3], :B3),4, note_to_semi(score.look[0..-3], :A3),4, note_to_semi(score.look[0..-3], :Gs3),4, 67 | # rpitch: knit(note_to_semi(score.look[0..-3], :E4),4, note_to_semi(score.look[0..-3], :D3),4, note_to_semi(score.look[0..-3], :Cs3),4, note_to_semi(score.look[0..-3], :Fs4),4, 68 | # note_to_semi(score.look[0..-3], :E3),4, note_to_semi(score.look[0..-3], :D3),4, note_to_semi(score.look[0..-3], :B3),4, note_to_semi(score.look[0..-3], :Fs4),4, 69 | # note_to_semi(score.look[0..-3], :E3),4, note_to_semi(score.look[0..-3], :D3),4, note_to_semi(score.look[0..-3], :B3),4, note_to_semi(score.look[0..-3], :Fs4),4, 70 | # note_to_semi(score.look[0..-3], :E3),4, note_to_semi(score.look[0..-3], :D3),4, note_to_semi(score.look[0..-3], :B3),4, note_to_semi(score.look[0..-3], :Fs4),4, 71 | # ).look 72 | else 73 | puts "none for #{score.look}" 74 | end 75 | #end 76 | end 77 | end 78 | end 79 | end 80 | sleep 1/8.0 81 | end 82 | end 83 | -------------------------------------------------------------------------------- /destination/live/softer.spi: -------------------------------------------------------------------------------- 1 | with_fx(:reverb, room: 0.6, mix: 0.8, damp: 0.5, damp_slide: 1.0, mix_slide: 0.1) do |r_fx| 2 | with_fx :level, amp: 1.0 do 3 | live_loop :softer, sync: :kick do 4 | score = ring( 8, 8, 8, 8, 8, 16, 8) 5 | n = score.tick 6 | blah = nil 7 | with_fx :slicer, phase: 0.25, wave: 0 do 8 | with_fx :pitch_shift, time_dis: 0.9, window_size: 0.9, mix: 0.1, pitch_dis: 0.1 do 9 | with_fx :wobble, phase: 32, mix: 1 do 10 | with_fx :echo, decay: 16, phase: 0.125 do 11 | #blah=synth :dark_sea_horn, note: (ring :Fs1).look, decay: 0.25, cutoff: 130, amp: 0.5 12 | sample_smash(Sop[/sustain/,[0..3]].tick(:sample),[4.0,4.0,4.0,4.0], amp: 0.8, cutoff: 130, pitch: (ring 2, 3, 2, 0).look(:sample)) 13 | end 14 | end 15 | end 16 | end 17 | comment do 18 | with_fx :slicer, invert_wave: 1, phase: 0.5, wave: 0 do 19 | blah=synth :dark_sea_horn, note: (ring :A2).look, decay: 16, amp: 0.2 20 | end 21 | 22 | with_fx :slicer, invert_wave: 1, phase: 0.25, wave: 0 do 23 | blah=synth :dark_sea_horn, note: (ring :Cs2).look, decay: 16, amp: 0.2 24 | end 25 | end 26 | with_fx :krush, mix: 0.05, mix_slide: 2 do |k_fx| 27 | n.times{|idx| 28 | #sample Sop[/Polysustains/, /release/, /01_oos/, /00/, 0], amp: 12.0 29 | with_fx :krush, mix: 0.2, sample_rate: 20000 do 30 | #sample Bass[/Polysustains/,/Omni/, /whisper/].tick, amp: 4.0# if idx <= 4 31 | # synth :gpa, note: :Fs4, attack: 0.01, release: ring(0.125, 0.25).tick(:r), amp: 1.0 32 | #with_fx :reverb do 33 | #sample Alt[/Polysustains/, /release/, /f#/].tick(:sopnotes3), amp: 12.0# if idx <= 4 34 | # sample Sop[/Polysustains/, /release/, /01_oos/, /f#3|e3|d3/].tick(:sopnotes), amp: 1.0 if idx <= 4 35 | #sample Sop[/Polysustains/, /release/, /01_oos/, /f#4|e4|d4/].tick(:sopnotes2), amp: 2.1, rate: 1 if idx >= 4 && idx < 8 36 | #end 37 | end 38 | sleep 1 39 | control k_fx, mix: 0 40 | control blah, note: :FS1 if rand > 0.5 41 | } 42 | end 43 | end 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /destination/live/softer2.spi: -------------------------------------------------------------------------------- 1 | with_fx(:reverb, room: 0.6, mix: 0.8, damp: 0.5, damp_slide: 1.0, mix_slide: 0.1) do |r_fx| 2 | live_loop :soft2, sync: :kick do 3 | with_fx :level, amp: 1.0 do 4 | score = ring(# 7 -> 1a -> 3 -> 5 -> 1a -> 6 -> 4 5 | # 3 -> 6 -> 7 -> 1 -> 6 -> 4 6 | #[[:Fs2,8],[:A2,8],[:Cs3,8*2]], 7 | # [[:Fs3,8],[:A3,8],[_,8]], 8 | [[:E3,8],[:Gs3,8],[:B3,8]], 9 | [[:CS3,8],[:FS3, 8], [:A3, 8*2]], 10 | [[:Cs4,8],[_,8], [:E4,8], [:E3, -4],[:A2, -6]], 11 | [[:Cs3,16+8], [:E3,16], [:Gs3,16]], 12 | [[:Fs3,8*3], [_,8], [:A3,8*2]], 13 | [[:D3,8*2],[_,8], [_,8]], 14 | [[:B2,8],[_,8],[_,8]], 15 | [[:A2,8], [:Cs3,8],[:E3,8]], 16 | [[:D3,8], [:Fs3,8],[:A3,8]], 17 | [[:E3,8], [:Gs3,8],[:B3,8],[:Cs4,8], [:B3,-6]], 18 | [[:Fs3,8], [:A3,8*2],[:Cs4,8], [:A3,-4]], 19 | [[:D3, 8], [:Fs3, 8], [_, 8] ], 20 | [[:Cs3, 16],[:E3, 16], [:Gs3, 16]], 21 | [[:CS3,8],[:FS3, 8], [:A3, 8*2]], 22 | [[:D3,8],[:Fs3, 8], [_, 8]], 23 | [[:B2,8], [:D3, 8], [:Fs3,8]] 24 | ) 25 | n = score.tick 26 | with_fx :krush, mix: 0.2, mix_slide: 4*1 do |k_fx| 27 | a,s = [],[] 28 | n.select{|n| n[1] > 0}.each do |note| 29 | #puts note 30 | a = synth :beep, note: note[0], amp: (1.0/[n.length,3].max) 31 | s << (synth :hollow, note: note[0], decay: note[1], amp: (1.0/[n.length,3].max), amp_slide: 0.5, attack: 0.5) 32 | end 33 | with_transpose 0 do 34 | #with_transpose(-12){synth :dark_sea_horn, note: n[0][0], decay: 0.5, cutoff: 135, amp: 0.2} 35 | synth :pluck, note: n[0][0], release: n[0][1]/2.0, decay: n[0][1]/2.0, attack: 0.05, amp: 0.2 36 | end 37 | (n.map{|s| s[1] > 0 ? s[1] : 0}.select{|s| s!=0}.min).times{|idx| 38 | control r_fx, damp: rand, mix: 1.0 39 | s.each{|sy| control sy, amp: rrand(0.5, 0.9)} 40 | n.select{|n| n[1] < 0}.each do |note| 41 | if note[1].abs == idx 42 | synth :pluck, note: note[0], release: note[1].abs, decay: note[1].abs, attack: 0.1, amp: 0.01 43 | synth :hollow, note: note[0], release: note[1].abs, decay: note[1].abs, attack: 0.01, amp: 1.0 44 | end 45 | end 46 | if idx == (score.look(offset: 1)[0][1]/2.0)+2 47 | b = nil 48 | with_fx :slicer do 49 | with_transpose 0 do 50 | synth :pretty_bell, note: score.look(offset: 1)[0][0], amp: 0.25, decay: ring(2.0,1.0).tick(:itss), attack: 2.0 51 | end 52 | end 53 | end 54 | sleep 1 55 | control k_fx, mix: 0 56 | } 57 | end 58 | end 59 | end 60 | end 61 | -------------------------------------------------------------------------------- /destination/map/2.rb: -------------------------------------------------------------------------------- 1 | #practice 2 | _=nil 3 | 4 | live_loop :highlight do 5 | with_fx(:lpf, cutoff: 50) do 6 | 32.times{sync :apeg} 7 | with_transpose(0) do 8 | i_deter( deg_seq(%w{Fs3 1*3 }).tick, 9 | deg_seq(%w{Fs3 3 }).stretch(3).tick, amp: 0.8*1, 10 | damp_time: 0.25*2.0) 11 | end 12 | end 13 | end 14 | 15 | live_loop :apeg do 16 | with_fx(:lpf, cutoff: 50){ 17 | root = (knit :Fs3, 16, :As3, 16, :Ds3, 16).tick(:notes) 18 | with_transpose(-24){ 19 | with_synth(:dsaw){play (knit root,1, _, 15).tick(:bass), release: 1.5, decay: 2.5, amp: 0.5, cutoff: 60} 20 | with_synth(:prophet){play (knit root,1, _, 15).look(:bass), release: 1.5, decay: 2.0, amp: 0.2, cutoff: 60} 21 | if (knit root,1, _, 15).look(:bass) 22 | shader("decaying-uniform", :iBeat, 1.0, 0.001) 23 | end 24 | } 25 | sleep 0.25 * 1 26 | } 27 | end 28 | 29 | with_fx(:reverb, room: 1.0, mix: 1.0){ |r_fx| 30 | live_loop :chorus do 31 | #use_random_seed 300 32 | notes = (knit 33 | # chord(:Fs3, "M")[1..-1], 7, #F A C 34 | chord(:Fs3, 'maj9')[0..-1], 1, # 35 | # chord(:As3, 'M')[1..-1], 8, # A C E 36 | # chord(:Ds3, "m")[1..-1], 8, # D F A 37 | ) 38 | 39 | 1.times{sync :apeg} 40 | with_synth(:hoover)do 41 | #play notes.tick(:h)[0], amp: 0.03 42 | end 43 | 44 | com = scale(:Fs3, :major_pentatonic, num_octaves: 3).drop(4).take(3).shuffle 45 | 46 | 1.times{sync :apeg} 47 | with_synth(:zawa){play com.tick, cutoff: 70} 48 | with_synth(:hollow){ 49 | 4.times{control r_fx, damp: rrand(0.0,1.0) ; sleep 0.25/4.0} 50 | play notes.look(:h).to_a.shuffle.choose, amp: (knit 2.0,8, 0.0,0).tick(:amp), 51 | release: 0.01, decay: 1.0, cutoff: (ring rrand(60,135)).tick(:cut), 52 | res: (ring 0.97,0.99).tick(:xcut) 53 | puts note_inspect(notes.look(:h), "CHORD") 54 | 55 | 56 | if(notes.look(:h) == chord(:Ds3, "m7")[1..-1]) 57 | cue :lovely 58 | #sample (knit Frag[/coils/, /F#/,0] ,1, _,7).tick(:s) 59 | with_fx(:flanger){ 60 | sample (knit "/Users/josephwilk/Dropbox/repl-electric/samples/Bowed Notes/G#_HarmBow_01_SP.wav" ,1, _,7, 61 | "/Users/josephwilk/Dropbox/repl-electric/samples/Bowed Notes/D#_BowedGuitarNote_01_SP.wav",1,_,7, 62 | Mountain[/G#_BowedHarmSoft/,0],1,_,7 63 | ).tick(:s), cutoff: 80, amp: 0.15*1 64 | } 65 | # sample (knit Sop[/F#4/,/down/,1] ,1, _,7).tick(:s) 66 | end 67 | } 68 | end 69 | } 70 | live_loop :sea do 71 | 32.times{sync :apeg} 72 | synth :dark_ambience, note: (ring :Fs3, :Es3).tick, decay: 8.0, amp: 2.0, detune1: 24, detune2: 12 73 | end 74 | 75 | shader(:uniform, :iCells, 0.0) 76 | 77 | live_loop :d do 78 | 4.times{sync :apeg} 79 | with_fx(:echo, phase: 0.25, decay: 1) do 80 | with_fx(:slicer, phase: 0.125) do 81 | sample Mountain[/subkick/,1], cutoff: 100 82 | end 83 | end 84 | shader("uniform", "iKick", rand) 85 | 4.times{sync :apeg} 86 | sample Mountain[/subkick/,0], cutoff: 100 87 | shader("uniform", "iKick", 2.0) 88 | 89 | end 90 | -------------------------------------------------------------------------------- /destination/map/3.rb: -------------------------------------------------------------------------------- 1 | _=nil 2 | ["log","experiments", "shaderview"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"} 3 | shader(:texture, "tex16.png", 3) 4 | 5 | live_loop :highlight do 6 | with_fx(:lpf, cutoff: 100) do 7 | 16.times{sync :apeg} 8 | with_transpose(0) do 9 | i_deter( deg_seq(%w{Fs4 1*3 1*5}).tick, 10 | deg_seq(%w{Fs4 3 5}).stretch(3).tick, amp: 0.8*1, 11 | damp_time: 0.25*1.0) 12 | shader("decaying-uniform", :iWave, 1.0, 0.01) 13 | end 14 | end 15 | end 16 | 17 | live_loop :apeg do 18 | with_fx(:lpf, cutoff: 130, mix: 0.0){ 19 | root = (knit :Fs3, 16, :As3, 16, :Ds3, 16).tick(:notes) 20 | with_transpose(-24){ 21 | with_synth(:dsaw){play (knit root,1, _, 15).tick(:bass), release: 1.5, decay: 2.5, amp: 0.8, cutoff: 60} 22 | with_synth(:prophet){play (knit root,1, _, 15).look(:bass), release: 1.5, decay: 2.0, amp: 0.5, cutoff: 60} 23 | if (knit root,1, _, 15).look(:bass) 24 | shader("decaying-uniform", :iBeat, 1.0, 0.001) 25 | end 26 | } 27 | sleep 0.25 * 1 28 | } 29 | end 30 | 31 | with_fx(:reverb, room: 1.0, mix: 1.0){ |r_fx| 32 | live_loop :chorus do 33 | #use_random_seed 300 34 | notes = (knit 35 | # chord(:Fs3, "M")[1..-1], 7, #F A C 36 | # chord(:Fs3, 'maj9')[0..-1], 1, # 37 | # chord(:As3, 'M')[1..-1], 8, # A C E 38 | # chord(:Ds3, "m")[1..-1], 8, # D F A 39 | 40 | chord_degree(1, :fs3, :major)[1..-1], 8, 41 | chord_degree(3, :fs3, :major)[1..-1], 8, 42 | chord(:Ds3, "m")[1..-1], 8, 43 | 44 | chord(:Fs3, 'sus4')[1..-1], 8, 45 | chord(:As3, 'm+5')[1..-1], 8, 46 | chord(:Ds3, "m7")[1..-1], 8, #D F A C 47 | 48 | chord(:Fs3, 'sus4')[1..-1], 8, 49 | chord(:As3, 'm+5')[1..-1], 8, 50 | 51 | chord(:Cs3, :M)[1..-1], 4, 52 | chord(:Cs3, :maj9)[1..-1],4 53 | 54 | 55 | ) 56 | 57 | 1.times{sync :apeg} 58 | with_synth(:hoover)do 59 | #play notes.tick(:h)[0], amp: 0.03 60 | end 61 | 62 | com = scale(:Fs3, :major_pentatonic, num_octaves: 3).drop(0).take(3).shuffle 63 | 64 | 1.times{sync :apeg} 65 | with_synth(:zawa){play com.tick, cutoff: 40, attack: 0.01} 66 | with_synth(:hollow){ 67 | 4.times{control r_fx, damp: rrand(0.0,1.0) ; sleep 0.25/4.0} 68 | play notes.look(:h).to_a.shuffle.choose, amp: (knit 1.0,4, 0.0,4).tick(:amp), 69 | release: 0.5, decay: 1.0, cutoff: (ring rrand(60,105)).tick(:cut), 70 | res: (ring 0.97,0.99).tick(:xcut) 71 | puts note_inspect(notes.look(:h), "CHORD") 72 | 73 | 74 | if(notes.look(:h) == chord(:Ds3, "m7")[1..-1]) 75 | cue :lovely 76 | #sample (knit Frag[/coils/, /F#/,0] ,1, _,7).tick(:s) 77 | with_fx(:flanger){ 78 | sample (knit "/Users/josephwilk/Dropbox/repl-electric/samples/Bowed Notes/G#_HarmBow_01_SP.wav" ,1, _,7, 79 | "/Users/josephwilk/Dropbox/repl-electric/samples/Bowed Notes/D#_BowedGuitarNote_01_SP.wav",1,_,7, 80 | Mountain[/G#_BowedHarmSoft/,0],1,_,7 81 | ).tick(:s), cutoff: 80, amp: 0.15*1 82 | } 83 | # sample (knit Sop[/F#4/,/down/,1] ,1, _,7).tick(:s) 84 | end 85 | } 86 | end 87 | } 88 | live_loop :sea do 89 | 32.times{sync :apeg} 90 | synth :dark_ambience, note: (ring :Fs3, :Es3).tick, decay: 8.0, amp: 2.0, detune1: 24, detune2: 12 91 | end 92 | 93 | shader(:uniform, :iCells, 0.0) 94 | 95 | live_loop :d do 96 | 4.times{sync :apeg} 97 | with_fx(:echo, phase: 0.25, decay: 1) do 98 | with_fx(:slicer, phase: 0.125) do 99 | sample Mountain[/subkick/,1], cutoff: 100 100 | end 101 | end 102 | shader("decaying-uniform", "iKick", rand) 103 | 4.times{sync :apeg} 104 | sample Mountain[/subkick/,0], cutoff: 100 105 | shader("decaying-uniform", "iKick", 1.0) 106 | end 107 | 108 | live_loop :hats do 109 | sync :apeg 110 | sample Frag[/hat/, Range.new(0, (ring 4, 6).tick(:inner))].tick, cutoff: rrand(70,90) 111 | shader("decaying-uniform", :iHit, 1.0) 112 | end 113 | 114 | 115 | shader(:uniform, "iStarLight", 0.5) 116 | 117 | shader(:uniform, "iSpaceMotion", 0.05) 118 | shader(:uniform, "iStarLight", 0.5) 119 | shader(:uniform, "iFlyingSpeed", 0.0) 120 | shader(:uniform, "iStars", 1.0) 121 | -------------------------------------------------------------------------------- /destination/map/4.rb: -------------------------------------------------------------------------------- 1 | _=nil 2 | with_fx(:reverb, room: 0.9, mix: 0.8) do 3 | live_loop :a do 4 | 4.times{ sync :apeg} 5 | notes = (knit 6 | # chord(:Fs3, "M")[1..-1], 7, #F A C 7 | # chord(:Fs3, 'maj9')[0..-1], 1, # 8 | # chord(:As3, 'M')[1..-1], 8, # A C E 9 | # chord(:Ds3, "m")[1..-1], 8, # D F A 10 | 11 | chord_degree(1, :fs3, :major)[0..-1], 4, 12 | chord_degree(3, :fs3, :major)[0..-1], 4, 13 | chord(:Ds3, "m")[0..-1], 4, 14 | 15 | chord(:Fs3, 'sus4')[0..-1], 4, 16 | chord(:As3, 'm+5')[0..-1], 4, 17 | chord(:Ds3, "m7")[0..-1], 4, #D F A C 18 | 19 | chord(:Fs3, 'sus4')[0..-1], 4, 20 | chord(:As3, 'm+5')[0..-1], 4, 21 | 22 | chord(:Cs3, :M)[0..-1], 2, 23 | chord(:Cs3, :maj9)[0..-1],2 24 | ) 25 | 26 | with_transpose(-12) do 27 | with_synth(:dark_sea_horn) do 28 | play (knit _,3 , notes.tick(:a, offset:1)[-1],1).tick(:r), 29 | release: 8.0, sustain:2.0, decay: 8.0, amp: 0.2, 30 | attack: 1.0 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /destination/map/Readme.md: -------------------------------------------------------------------------------- 1 | ``` 2 | ___ ___ ___ ___ __ __ 3 | | _| | _| |_ | |_ | / / ___ _ \ \ 4 | | | | | | | | | _ __ ___ __ _ _ __ | | ( _ ) (_) _ __ ___ __ _ _ __ | | 5 | | | | | | | | | | '_ ` _ \ / _` || '_ \ | | / _ \/\ | '_ ` _ \ / _` || '_ \ | | 6 | | | | | | | | | _ | | | | | || (_| || |_) | | | | (_> < _ | | | | | || (_| || |_) | | | 7 | | |_ | |_ _| | _| | (_) |_| |_| |_| \__,_|| .__/ | | \___/\/(_)|_| |_| |_| \__,_|| .__/ | | 8 | |___| |___| |___| |___| | | \_\ | | /_/ 9 | |_| |_| 10 | 11 | [[:map]].map(&:map) 12 | ``` 13 | -------------------------------------------------------------------------------- /destination/map/graphics.rb: -------------------------------------------------------------------------------- 1 | ["shaderview"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"} 2 | 3 | shader(:shader, "nil.glsl") 4 | shader(:uniform, "iCellCount", 2.0) 5 | shader(:uniform, "iCellMotion", 0.1) 6 | 7 | shader(:uniform, "iSpaceMotion", 0.0) 8 | shader(:uniform, "iSpaceWeight", 0.02) 9 | shader(:uniform, "iMesh", 0.0) 10 | shader(:mesh, 0.0) 11 | -------------------------------------------------------------------------------- /destination/method_missing/Readme.md: -------------------------------------------------------------------------------- 1 | ```ruby 2 | # / / | / / 3 | # _ _ ___ (___ (___ ___ ___| _ _ ___ ___ ___ ___ 4 | # | | )|___)| | )| )| ) | | )| |___ |___ | | )| ) 5 | # | / |__ |__ | / |__/ |__/ | / | __/ __/ | | / |__/ 6 | # --- __/ 7 | 8 | 9 | module MissingMethod 10 | def self.method_missing(where, *are, &you) 11 | i_am_right_here 12 | end 13 | end 14 | 15 | MissingMethod.where_are_you? 16 | ``` 17 | -------------------------------------------------------------------------------- /destination/method_missing/performances/darker.rb: -------------------------------------------------------------------------------- 1 | _=nil 2 | live_loop :thing do 3 | sleep 4 4 | end 5 | 6 | live_loop :beat, sync: :thing do 7 | main_d = MagicDust[/dirt/,[17,17]].tick(:sample) 8 | cut = 50 9 | 6.times{ 10 | sample main_d, cutoff: cut, amp: 3.0+rand 11 | sleep 1/2.0 12 | sleep 1/2.0 13 | } 14 | sample main_d, cutoff: cut, amp: 3.0+rand 15 | sleep 1/2.0/2.0 16 | sample main_d, cutoff: cut, amp: 3.0+rand 17 | sleep 1/2.0/2.0 18 | sample main_d, cutoff: cut, amp: 3.0+rand 19 | sleep 1/2.0 20 | end 21 | 22 | # [:D4, 0.25], [:D4, 0.25], [:D4, 0.25], [:E4,0.25], [_,0.25], [:D4, 0.25], [:E4,0.25],[_,0.25], 23 | # [:D4, 0.25], [:D4, 0.25], [:D4, 0.25], [:E4,0.25], [_,0.25],[_,0.25],[_,0.25], [:D4, 0.25], [:E4,0.25], [_,0.5] 24 | 25 | with_fx :wobble, phase: 16, mix: 0 do 26 | with_fx :distortion, mix: 0.7 do 27 | live_loop :melody, sync: :thing do 28 | # sync :second_voice 29 | tick 30 | score = (ring 31 | [:D4, 0.125],[_, 0.125], [:D4, 0.125],[_, 0.125],[:D4, 0.125],[_, 0.125],[:D4,0.25], [_,0.25], 32 | [:D4,0.5], [:E4, 0.25], [_, 0.125], [:E4,0.5], [_,0.5], [:D4,0.125], [_, 0.5],[:E4,0.125], [_, 0.5], [:E4,0.125], [_, 0.5], [:D3,0.25], [_,1.0], 33 | [:E4, 0.125], [_, 0.125],[:E4, 0.125],[_, 0.125], [:E4, 0.125],[:D3, 0.125], [:E4, 0.125],[_, 0.125], [:E4, 0.125], [_,0.5], [:E4, 0.25], [_,1.0], 34 | [_, 16-9.125] 35 | ) 36 | note = score.look 37 | puts score.map(&:last).reduce(&:+) 38 | #synth :dark_sea_horn, note: :FS2, release: 0.125, attack: 0.001, amp: 1 39 | with_transpose -12*2 do 40 | #synth :gpa, note: note[0], release: note[-1]*2, wave: 4, attack: 0.1, amp: 1/2.0 41 | synth :dark_sea_horn, note: note[0], release: note[-1], attack: 0.001, amp: 3 42 | sleep score.look[-1] 43 | end 44 | end 45 | # } 46 | end 47 | end 48 | 49 | live_loop :perc, sync: :thing do 50 | tick 51 | #sample CineElec[/extra/, /glass/].tick(:s), amp: 2.0, start: 0.21, finish: 0.27 52 | if (ring 1,1,0,1).look == 1 53 | #sample CineElec[/Percussions/,/Pepper/, [0,1]].tick(:sample), amp: 0.5+rand*0.01, cutoff: 100 54 | end 55 | #if (ring 0,0,1,0, 0,0,0,0, 0,1,1,0, 0,0,0,0, 0,0,1,0,0,0,0,1, 0,1,1,0, 0,0,1,0).look == 1 56 | if (ring 57 | 1,0,1,0, 1,0,1,0, 1,0,1,0, 1,0,1,0, 58 | 1,0,1,0, 1,0,1,0, 1,0,0,1, 0,0,1,1).look == 1 59 | #sample Words[/beauty/,[3,3]].tick(:s), amp: 8.0, start: 0.1, finish: 0.11 + [0.04,0.0].choose 60 | #sample CineElec[/one shots/,/hat/,[10,10,9]].tick(:hat), amp: 0.125, cutoff: 100 61 | #sample CineElec[/one shots/,/hat/,[10,10,3,10]].look, amp: 0.5, cutoff: 100 62 | end 63 | if (ring 64 | 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 65 | 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,1,0).look == 1 66 | #sample Abstract[/one shots/,/layered/, /open/,2], amp: 0.5, start: 0.0 67 | 68 | p = (ring [rand*0.25,rand*0.5]).tick(:pos) 69 | with_fx :echo, feedback: rand*0.5, phase: 0.5, decay: 8, mix: [1.0,0.0].choose do 70 | #sample(Words[/beauty/,[3,3]].tick(:s), amp: 2.0, start: p[0], finish: p[1]) 71 | #sample Frag[/coil/,/f#m/,4], amp: 1.55 72 | end 73 | end 74 | sleep 0.25 75 | end 76 | 77 | live_loop :second_voice, sync: :thing do 78 | with_fx :distortion, mix: 0.7 do 79 | rand_reset 80 | p = [0.25, 0.5].shuffle 81 | with_fx :wobble, phase: 16, invert_wave: 0 do 82 | with_fx :slicer, phase: p[0], probability: 0.5 do 83 | #synth :dark_sea_horn, note: chord(:E2, :M7)[0], amp: 0.125, decay: 4 84 | #synth :dark_ambience, note: chord(:E4, :M), amp: 2, decay: 8 85 | end 86 | with_fx :slicer, phase: 0.25, probability: 0.5, invert_wave: 1 do 87 | #synth :dark_sea_horn, note: chord(:Fs2, :m11)[0], amp: 2, decay: 4 88 | #synth :dark_ambience, note: chord(:Fs6, :m11), amp: 2, decay: 8 89 | end 90 | with_fx :slicer, phase: p[1], probability: 0.5, invert_wave: 1 do 91 | #synth :dark_sea_horn, note: chord(:D2, :M7)[0], amp: 0.125, decay: 4 92 | #synth :dark_ambience, note: chord(:D4, :M), amp: 2, decay: 4 93 | end 94 | end 95 | end 96 | sleep 16/2.0/2.0 97 | end 98 | 99 | live_loop :melo, sync: :thing do 100 | tick 101 | score= (ring 102 | [chord(:Fs3, :m),2], 103 | [chord(:E3, :M),2], 104 | [chord(:D3, :M),2]) 105 | c = score.look 106 | synth :gpa, wave: 6, note: c[0], amp: 2, release: 10 107 | sleep 16 108 | end 109 | -------------------------------------------------------------------------------- /destination/nil/Readme.md: -------------------------------------------------------------------------------- 1 | ``` 2 | _ _ _ 3 | (_) | | | 4 | _ __ _| | ___ __| | ___ 5 | | '_ \| | | / _ \ / _` |/ _ \ 6 | | | | | | | _ | (_) | (_| | __/ 7 | |_| |_|_|_| (_) \___/ \__,_|\___| 8 | 9 | nil.ode 10 | ``` 11 | -------------------------------------------------------------------------------- /destination/nil/buffer1.rb: -------------------------------------------------------------------------------- 1 | ["experiments", "drums"].each{|f| require "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}"} 2 | bar = 4.0 3 | live_loop(:drum_timing_loop, auto_cue: false){ 4 | sync :next 5 | density(2){ 16.times{ cue :drum_hit; sleep (bar/16.0)}}} 6 | 7 | with_fx :level, amp: 1.0 do 8 | with_fx :bitcrusher, sample_rate: 44000, mix: 0.1, bits: 12 do 9 | with_fx :pitch_shift, mix: 0.5 do 10 | with_fx :hpf, mix: 0.0 do 11 | with_fx :lpf, cutoff: 70, mix: 0.0 do 12 | #1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 13 | drum_loop(:highli, (ring *%w{- - - x x - - - - - - - - - - - - - - r r - - - - - - - - - - - -*16 -*16 }), Ether[/noise/i,11], amp: 0.2, start: 0.0, rate: (knit 1.0,64,1.1,64)) 14 | drum_loop(:kick, (ring *%w{r - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}), Mountain[/impact/i,9], amp: 0.0, rate: rrand(0.9,1.0)) 15 | drum_loop(:kick2, (ring *%w{x x - - - - - - x - - - - - - - x - - - - - - - x - - - - - - - x - - - - - - - x - - - - - - - x - - - - - - - x - - - - - - -}), Mountain[/subkick/i,0], amp: (ring 0.5,0.2), start: (knit 0.01,1, 0.03,31), rate: pitch_to_ratio(note(:Fs1) - note(:E1)) ) 16 | drum_loop(:snare, (ring *%w{- - - - - - - - x - - - - - - - - - - - - - - - x - - - - - - - - - - - - - - - x - - - - - - - - - - - - - - - x - - - - - - -}), Ambi[/clap/,13], amp: 0.2, delta: 0.001, start: 0.0, rate: 1.0) 17 | drum_loop(:snare2, (ring *%w{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - x - - - - - - - - - - - - - - - - - - - - - - -}), Ambi[/clap/,17], amp: 0.2, delta: 0.002, start: 0.0, rate: 1.0) 18 | drum_loop(:clap, (ring *%w{- - - - - - - - x - - - - - - - - - - - - - - - x - - - x - - -}), Ether[/noise/i,5], amp: 0.2, start: 0.0, rate: 1.0) 19 | drum_loop(:cchat, (ring *%w{x - - x - - x - - x - - - - - - - - x - - - x - x - x - - - - - - - x - - - x - x - x - - - - - x - - x - - x - - x - - x x - -}), Ether[/click/i].shuffle.tick, amp: 1.0*rrand(0.5,0.3), rate: (knit 1.01,3,-1.1,2,-1.2,3), start: rrand(0.0,0.00001)) 20 | with_fx(:reverb, mix: 0.3){with_fx(:slicer, phase: 0.025, probability: 0.5){ 21 | drum_loop(:ochat, (ring *%w{- - - - x - - - - - - - x - - - }), Down[/hat/i, [17, 16,15]], amp: 1.0);}} 22 | drum_loop(:cymbal, (ring *%w{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - r}), Ether[/noise/i,7], amp: 0.2) 23 | drum_loop(:swipe, (ring *%w{- - - - - - - - - - - - x - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - x - - - - - - - - - - - - - - - - - r -}), Ether[/snare/i,12], delta: 0.01, amp: 1.0*(knit 0.5,24, 1.9,8).tick(:amp), start: 0.0, rate: (knit -0.8,16, -1.5,16).tick(:rate)) 24 | drum_loop(:fast, (ring *%w{- - - - - - x - x - x - - - - - }), Ether[/click/i,20], amp: 0.0, rate: (knit -1.0, 2, 1.0,2)) 25 | end;end;end;end;end 26 | 27 | 28 | ## Extract bang -> drum_loop 29 | def ring_gen(n, fn) 30 | (ring *((0..n).map{fn.()})) 31 | end 32 | 33 | with_fx(:level, amp: 0.5) do 34 | #1 2 3 4 5 6 7 8 35 | drum_loop(:bang, (ring *%w{x - - - - - - - -*8 -*8 -*8}), Mountain["subkick",4], amp: ring_gen(32, lambda{1.0 + rrand(0.0,0.2)}), 36 | rate: ring_gen(32, lambda{rrand(0.9,1.0)})) 37 | #1 2 3 4 5 6 7 8 38 | drum_loop(:bang2, (ring *%w{-*8 -*8 39 | x - - - - - - - -*8}), Mountain["subkick",0], amp: ring_gen(32, lambda{1.0 + rrand(0.0,0.2)}), 40 | rate: ring_gen(32, lambda{rrand(0.9,1.0)})) 41 | end -------------------------------------------------------------------------------- /destination/nil/buffer2.rb: -------------------------------------------------------------------------------- 1 | bar = 1.0 2 | _ = nil 3 | live_loop :exceptions do 4 | (knit 1,6, 2,1).tick(:time).times{sync :next} 5 | with_fx :distortion, amp: 0.8, mix: 0.3 do 6 | with_synth :beep do 7 | with_fx (knit :reverb,2).tick(:fx), decay: (knit 4.0,7, 8.0,1).tick(:de), room: 1.0 do |fx_verb| 8 | n = play (knit :Fs5, 1, :Fs4, 1, :Fs5, 1, :Fs4, 3, _, 1, 9 | :Fs4, 7, _, 1, 10 | :Cs4, 7, _, 1, 11 | :Ds4, 7, _, 1, 12 | :As4, 7, _, 1, 13 | :Es4, 7, _, 1, 14 | ).tick, amp: 0.3 15 | 16 | with_transpose(-12) do 17 | with_synth(:beep){ 18 | play (knit :Fs4, 1, :Fs4, 1, :Fs4, 1, :Fs4, 3, _, 1, 19 | :Fs4, 7, _, 1, 20 | :Cs4, 7, _, 1, 21 | :Ds4, 7, _, 1, 22 | :As4, 7, _, 1, 23 | :Es4, 7, _, 1,).tick, amp: 0.1, attack: 0.01, cutoff: 50, res: 0.5, detune: 0.0, release: 0.01 24 | } 25 | end 26 | 27 | if dice(32) == 1 28 | with_fx :pan, pan: Math.sin(vt*13)/1.5 do 29 | with_fx :bitcrusher, bits: 7, sample_rate: 32000 do 30 | # sample Mountain[/bow/i, /f#/i, 0],amp: 0.4 31 | end 32 | end 33 | end 34 | 35 | if (knit :echo,2, :reverb,2).look(:fx) == :reverb 36 | control fx_verb, damp: rrand(0.0,1.0) 37 | end 38 | sleep bar/4.0 39 | control n, note: (knit :As4, 4, :B4, 4, 40 | :Cs4, 4, :B4, 4).tick 41 | 42 | if (knit :echo,2, :reverb,2).look(:fx) == :reverb 43 | control fx_verb, damp: rrand(0.0,1.0) 44 | end 45 | 46 | sleep bar/4.0 47 | 48 | if (knit :echo,2, :reverb,2).look(:fx) == :reverb 49 | control fx_verb, damp: rrand(0.0,1.0) 50 | end 51 | 52 | sleep bar/4.0 53 | if (knit :echo,2, :reverb,2).look(:fx) == :reverb 54 | control fx_verb, damp: rrand(0.0,1.0) 55 | end 56 | end 57 | end 58 | end 59 | end 60 | -------------------------------------------------------------------------------- /destination/nil/buffer3.rb: -------------------------------------------------------------------------------- 1 | ["shaderview"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"} 2 | 3 | shader(:shader, "nil.glsl") 4 | shader(:uniform, "iCellCount", 1.0) 5 | shader(:uniform, "iCellMotion", 0.0) 6 | shader(:uniform, "iMesh", 1.0) 7 | shader(:mesh, 1.0) 8 | -------------------------------------------------------------------------------- /destination/nil/buffer4.rb: -------------------------------------------------------------------------------- 1 | ## Instruments 2 | bar = 1.0 3 | 4 | define :i_float do |note, *opts| 5 | defaults = {cutoff: 70, attack: 0.01, pan: (Math.sin(vt*13)/1.5), amp: 0.5, decay: 0.1 + rrand(0.1,0.2), release: (ring 1.0,0.25,0.4,0.25).tick(:dasd)} 6 | defaults = defaults.merge(opts[0]||{}) 7 | with_synth(:prophet){play note, defaults} 8 | end 9 | 10 | define :i_int do |note, *opts| 11 | defaults = {pan: (Math.sin(vt*13)/1.5), amp: (ring 0.25).tick(:sdf), decay: 0.1 + rrand(0.1,0.2), 12 | release: 0.3} #, release: (ring 1.0,0.25,0.4,0.25).tick(:dasd)} 13 | defaults = defaults.merge(opts[0]||{}) 14 | with_synth(:beep){play note, defaults} 15 | end 16 | 17 | 18 | define :i_bass do |note, *opts| 19 | defaults = { 20 | cutoff: 60, res: 0.5, 21 | release: (knit 2.5*bar,10, 8.0*bar,1, 5.0*bar,2, 5.0*bar,1, 2.5*bar,1, 2.5*bar,1).tick(:sd), 22 | attack: (knit 0.01,10, 0.15,1, 0.15,2, 0.25,1, 0.25,1, 0.01,1,).tick(:att), 23 | amp: (knit 0.5,13, 0.2, 3).tick(:ampe)} 24 | defaults = defaults.merge(opts[0]||{}) 25 | with_transpose(12) do 26 | with_synth(:beep) do 27 | play note, defaults 28 | end 29 | end 30 | 31 | defaults = { 32 | amp: 1.0, release: (knit 2.01*bar, 9, 8.02*bar, 2, 2.1*bar,5).tick(:Bass), 33 | attack: 0.05, cutoff: 60, res: 0.5} 34 | defaults = defaults.merge(opts[0]||{}) 35 | with_transpose(0) do 36 | with_synth :beep do 37 | play note, defaults 38 | end 39 | end 40 | end 41 | 42 | define :i_deter do |note1, note2, *opts| 43 | opts = opts[0] || {} 44 | defaults = {amp: 0.3} 45 | s = opts[:synth] || :beep 46 | d = opts[:mix] || 0.3 47 | fx_pattern = opts[:fx_pattern] || (knit :echo,2, :reverb,2) 48 | distort_amp = opts[:distort_amp] || 0.8 49 | 50 | damp_time = opts[:damp_time] || bar/4.0 51 | 52 | opts.delete(:fx_pattern) 53 | opts.delete(:distory_amp) 54 | opts.delete(:damp_time) 55 | 56 | werble = if opts[:werble] != nil 57 | opts[:werble] 58 | else 59 | true 60 | end 61 | 62 | defaults = defaults.merge(opts) 63 | with_fx :distortion, amp: distort_amp, mix: d do 64 | with_synth(s) do 65 | with_fx fx_pattern.tick(:fx), decay: 4.0, room: 1.0 do |fx_verb| 66 | active_synth = play note1, defaults 67 | sleep damp_time 68 | control(active_synth, note: note2) if werble 69 | 70 | 2.times{ 71 | sleep damp_time 72 | if fx_verb.name =~ /reverb/ 73 | control fx_verb, damp: rrand(0.0,1.0) 74 | end 75 | } 76 | end 77 | end 78 | end 79 | end 80 | define :i_nil do |n, *opts| 81 | defaults = {release: 2.0, amp: 2.0} 82 | defaults = defaults.merge(opts[0]||{}) 83 | with_synth(:hollow) do 84 | with_fx :pitch_shift, pitch_dis: 0.001, time_dis: 0.1, window_size: 1.5 do 85 | play n, defaults 86 | end 87 | end 88 | end 89 | -------------------------------------------------------------------------------- /destination/nil/buffer5.rb: -------------------------------------------------------------------------------- 1 | _=nil 2 | bar = 1.0 3 | live_loop :bellz do 4 | #1.times{sync :foo} 5 | with_fx :distortion, amp: 0.8, mix: 0.3 do 6 | with_synth :beep do 7 | with_fx (knit :reverb,2).tick(:fx), decay: (knit 4.0,7, 8.0,1).tick(:de), room: 1.0 do |fx_verb| 8 | n = play (knit :Fs5, 1, :Fs4, 1, :Fs5, 1, :Fs4, 3, _, 1, 9 | :Fs4, 7, _, 1, 10 | :Cs4, 7, _, 1, 11 | :Ds4, 7, _, 1, 12 | :As4, 7, _, 1, 13 | :Es4, 7, _, 1, 14 | ).tick, amp: 0.3 15 | 16 | if dice(32) == 1 17 | with_fx :pan, pan: Math.sin(vt*13)/1.5 do 18 | with_fx :bitcrusher, bits: 7, sample_rate: 32000 do 19 | # sample Mountain[/bow/i, /f#/i, 0],amp: 0.4 20 | end;end;end 21 | 22 | if (knit :echo,2, :reverb,2).look(:fx) == :reverb 23 | control fx_verb, damp: rrand(0.0,1.0) 24 | end 25 | sleep bar/4.0 26 | control n, note: (knit :As4, 4, :B4, 4, 27 | :Cs4, 4, :B4, 4).tick 28 | 29 | 30 | if (knit :echo,2, :reverb,2).look(:fx) == :reverb 31 | control fx_verb, damp: rrand(0.0,1.0) 32 | end 33 | 34 | sleep bar/4.0 35 | 36 | if (knit :echo,2, :reverb,2).look(:fx) == :reverb 37 | control fx_verb, damp: rrand(0.0,1.0) 38 | end 39 | 40 | sleep bar/4.0 41 | if (knit :echo,2, :reverb,2).look(:fx) == :reverb 42 | control fx_verb, damp: rrand(0.0,1.0) 43 | end 44 | 45 | 46 | end;end;end;end -------------------------------------------------------------------------------- /destination/practice/32_drum_experiments.rb: -------------------------------------------------------------------------------- 1 | bar = 4.0 2 | 3 | def as_ring(pat) 4 | ring(*pat.split("\s")) 5 | end 6 | 7 | def pat(s, p, *args) 8 | sync :s 9 | if p == "x" 10 | sample *([s]+args) 11 | end 12 | end 13 | 14 | live_loop :beatz do 15 | sync :foo 16 | #density(-1) do 17 | 32.times{ 18 | cue :s 19 | sleep (bar/16.0) 20 | } 21 | #end 22 | end 23 | with_fx :lpf, cutoff: 73 do 24 | 25 | #1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 26 | live_loop(:kicker2)do; 32.times{pat(Ether[/click/i,11], 27 | (ring *%w{- - x x - - - - - - - - - - - - x - - - - - - - - - - - - - - -}).tick(:a), amp: 1.0, start: 0.0,)};end 28 | live_loop(:kicker)do; 32.times{pat(Ether[/click/i,11], 29 | (ring *%w{x x - - - - - - x - - - - - - - x - - - - - - - x - x - - - - -}).tick(:a), amp: 3.0, start: 0.1,)};end 30 | live_loop(:snare) do; 32.times{pat(Ether[/click/i,13], 31 | (ring *%w{- - - - x - - - - - - - x - - - - - - - x - - - - - - - x - - -}).tick(:b), amp: 3.0)};end 32 | live_loop(:hats)do; 32.times{pat(Ether[/click/i,2], 33 | (ring *%w{x - x - x - x - - - x - x - x - x - x - x - x - - - x x - x - -}).tick(:a), amp: 1.05)};end 34 | live_loop(:swish) do; with_fx :reverb, room: 0.7, mix: 0.3 do; 16.times{ 35 | with_fx(:slicer, phase: 0.15, probability: 0.5){pat(Ether[/snare/i,12], 36 | (ring *%w{- - - - - x - - - - - - - x - - - - - - - x - - - - - - - - - x}).tick(:c), amp: (knit 0.5,24, 1.9,8).tick(:amp), start: 0.0, rate: -1.0)}};end;end 37 | end 38 | 39 | live_loop :kick do; 16.times{pat(Ether[/kick/i,5], (ring *%w{x x - - - - - - - - - - - - - -}).tick(:d), amp: 0*0.5)};end 40 | 41 | live_loop :kick2 do; 16.times{pat(Ether[/kick/i,4], bar, (ring *%w{- - x x - - - - - - - - - - - -}).tick(:e), amp: 0*0.9, rate: rrand(0.9,1.0))};end 42 | -------------------------------------------------------------------------------- /destination/practice/5th_octave.rb: -------------------------------------------------------------------------------- 1 | live_loop :time do 2 | use_random_seed (ring 3 | 200, 200, 100, 100, 4 | 200, 200, 100, 100, 5 | 200, 200, 100, 100, 6 | 200, 200, 300, 400, 7 | ).tick(:cut) 8 | with_fx :lpf, cutoff: 60 do 9 | play scale(:Fs5, :minor_pentatonic).shuffle.choose, cutoff: 10, amp: 0.5 10 | end 11 | sleep (knit 0.25, 8).tick(:sleep) 12 | end 13 | _=nil 14 | live_loop :time2, sync: :time do 15 | use_random_seed (ring 16 | 200, 200, 100, 100, 17 | 200, 200, 100, 100, 18 | 200, 200, 100, 100, 19 | 200, 200, 300, 400, 20 | ).tick(:cut) 21 | 22 | 23 | with_fx(:reverb, room: 0.9, mix: 0.4, damp: 0.5) do |r_fx| 24 | with_fx :distortion, mix: 0.5 do 25 | n = (ring 26 | _, _, _, _, 27 | _, _, _, _, 28 | _, _, _, _, 29 | 30 | :FS3, :CS3, :D4, :E4, 31 | :A3, :E4, :Fs3, :E4, 32 | :A3, :E4, :Fs3, :E4 33 | ).tick(:n) 34 | synth :hollow, note: n, release: 0.125, amp: 1.5 35 | end 36 | end 37 | sleep (knit 0.25, 8).tick(:sleep) 38 | 39 | end 40 | 41 | live_loop :kick, sync: :time do 42 | sample Mountain[/kick/,[4,4]].tick(:sample), cutoff: 130, amp: 0.8 43 | sleep 1/2.0 44 | sample Mountain[/kick/,[4,4]].tick(:sample), cutoff: 100, amp: 0.5 45 | with_fx(:slicer, phase: (ring 0.25, 0.5,0.5,0.25).tick(:phase), probability: 0) do 46 | with_fx(:echo, decay: 0.5, mix: 1.0, phase: 0.25) do 47 | sample Mountain[/snare/,4], cutoff: 130, amp: 0.5 48 | end 49 | end 50 | sleep 1/2.0 51 | end 52 | 53 | live_loop :background, sync: :time do 54 | use_synth :dsaw 55 | d = (ring 56 | chord(:A2, :M), 57 | chord(:CS2, :m), 58 | chord(:A2, :M), 59 | chord(:Fs2, :m, invert: 1)) 60 | d.tick 61 | # play d.tick, decay: 2.0, release: 2.0, attack: 0.00001, detune: 12, cutoff: 90 62 | 63 | with_transpose 0 do 64 | synth :dsaw, note: d.look, cutoff: 60, decay: 2.0, amp: 0.5 65 | synth :prophet, note: d.look, cutoff: 60, decay: 2.0, amp: 0.5 66 | end 67 | 68 | if spread(1,2).tick(:time) 69 | #synth :dark_sea_horn, note: d.look[0], decay: 4.0 70 | end 71 | sleep 4 72 | end 73 | 74 | live_loop :samples, sync: :time do 75 | sample Corrupt[/instrument/,/fx/, /f#/].tick(:sample), amp: 1.0 76 | sleep 32 77 | end 78 | 79 | live_loop :clickers, sync: :time do 80 | sleep 0.125 81 | if spread(7,11).tick 82 | sample Dust[/hat/,0..2].tick(:sample), cutoff: 50, amp: 1.0 83 | end 84 | if spread(3,8).tick 85 | sample Dust[/hats/,2..3].tick(:sample2), cutoff: 60, amp: 1.0 86 | end 87 | end 88 | 89 | live_loop :voices do 90 | # with_fx :ixi_techno, phase: 0.25 do 91 | #sample Words[//,2], cutoff: 135, amp: 10.0 92 | # end 93 | sleep 32 94 | end 95 | -------------------------------------------------------------------------------- /destination/practice/90bpm.rb: -------------------------------------------------------------------------------- 1 | use_bpm 90 2 | 3 | live_loop :rwa do 4 | use_synth :prophet 5 | use_synth_defaults detune: 12, cutoff: 50, detune: 12, amp: 2.0 6 | #sample Fraz[/kick/,1], amp: 4.0 7 | 8 | notes = (knit :FS1, 1, :Fs1, 2, :A1, 1) 9 | 10 | play notes.tick, attack: 0.01, decay: 2.0 11 | 12 | #sample Fraz[/loop/,/Dm/,0] 13 | #sample Fraz[/loop/,/Dm/,1] 14 | 15 | sample Fraz[/loop/, /C#m/, 0] 16 | 17 | #sample Fraz[/loop/,3], amp: 1.0, beat_stretch: 8.0 18 | #sample Fraz[/loop/,3], amp: 2.0, beat_stretch: 4.0 19 | sleep 1 20 | # sample Fraz[/kick/,0], amp: 1.0 21 | play notes.tick, attack: 0.01, decay: 0.1 22 | sleep 0.5 23 | #play notes.tick, attack: 0.01, decay: 0.1 24 | # sample Fraz[/kick/,1], amp: 1.0 25 | play notes.tick, attack: 0.01, decay: 0.1 26 | sleep 2 27 | 28 | #sample Fraz[/loop/,3], amp: 2.0, beat_stretch: 4.0 29 | 30 | play notes.tick, attack: 0.01, decay: 1.0 31 | #sample Fraz[/kick/,0], amp: 1.0 32 | sleep 1.5 33 | #sample Fraz[/kick/,1], amp: 1.0 34 | sleep 3.0 35 | end 36 | 37 | live_loop :another do 38 | #sample Fraz[/loop/,0], amp: 0.5, beat_stretch: 4.0 39 | sleep 4 40 | end 41 | 42 | live_loop :bass do 43 | sync :rwa 44 | #sample Fraz[/coil/, /c#m/, 1], amp: 2.0 45 | 46 | use_synth :dark_sea_horn 47 | with_fx(:reverb, room: 1.0, mix: 1.0, damp: 0.5) do |r_fx| 48 | #synth :hollow, note: chord(:E3,'7').tick, decay: 8.0, detune: 12, amp: 1.5 49 | #synth :prophet, note: :E2, cutoff: 60, 50 | # decay: 8.0, detune: 12, amp: 5.5 51 | end 52 | with_fx(:slicer, phase: 0.25*2, probability: 0, wave: 0) do 53 | play (ring :A2, :D2, :E2).tick(:a), attack: 0.01, decay: 8.0, amp: 1.0, cutoff: 100 54 | end 55 | sleep 8 56 | end 57 | _=nil 58 | live_loop :apeg do 59 | #sync :rwa 60 | #use_random_seed 300 61 | with_fx(:reverb, room: 1.0, mix: 0.5, damp: 0.5) do |r_fx| 62 | use_synth :twang 63 | #use_synth :plucked 64 | with_fx(:slicer, phase: 0.5, probability: 0) do 65 | play (ring (chord(:Fs2, 'm11')+[_]).choose).tick, release: 0.01, amp: 1.0 66 | end 67 | sleep 0.125*4.0 68 | end 69 | end 70 | -------------------------------------------------------------------------------- /destination/practice/9ths.rb: -------------------------------------------------------------------------------- 1 | ["log","experiments", "shaderview"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"} 2 | _=nil 3 | live_loop :apeg do 4 | sleep (0.25 * 1) 5 | end 6 | 7 | live_loop :coils do 8 | with_synth(:dark_ambience){ 9 | play (ring 10 | chord(:Fs3, :M), 11 | chord(:As3, 'm+5'), 12 | chord(:Ds3, 'm'), 13 | chord(:Cs3, :M), 14 | chord(:Cs3, :maj9) 15 | 16 | ).tick(:c), release: 8, attack: 4.0, amp: 20.0 17 | } 18 | 32.times{sync :apeg} 19 | end 20 | 21 | with_fx(:reverb, room: 1.0, mix: 1.0) do 22 | live_loop :test do 23 | use_synth :tb303 24 | notes = (ring chord(:Fs3, '7'), chord(:As3,'m7+5'), 25 | chord(:Ds3, 'm7+5'), 26 | chord(:Cs3, 'maj9') ).tick(:m) 27 | (32).times{ 28 | sync :apeg 29 | play notes[-1], attack: 0.001, amp: 0.5, cutoff: (range 50,70,5).tick(:c) 30 | } 31 | end 32 | end 33 | 34 | with_fx(:reverb) do |fx_r| 35 | live_loop :stability do 36 | sync :apeg 37 | use_synth :dsaw 38 | notes = (knit :Fs2, 1, nil,31, 39 | :As2, 1, nil,31, 40 | :Ds2, 1, nil,31, 41 | :Cs3, 1, nil,31) 42 | play notes.tick, release: 4, decay: 10, cutoff: 60, detune: 12, attack: 2.0 43 | with_synth(:prophet){ 44 | play notes.look, attack: 0.5, release: 4, decay: 10, cutoff: 75, detune: 12, attack: 2.0 45 | } 46 | control fx_r, damp: rrand(0.0,1.0) 47 | end 48 | end 49 | 50 | live_loop :kicker do 51 | sync :apeg 52 | with_fx((knit :none,3, :echo,1, :none, 4).tick(:fx), phase: 0.25) do 53 | sample Mountain[/subkick/,[1,2]].tick, cutoff: 120 if spread(1,4).tick(:a) 54 | end 55 | # with_fx(:reverb, room: 1.0){ 56 | sample Mountain[/snare/,1], cutoff: 85 if spread(1,8, rotate: 1).look(:a) 57 | # } 58 | 59 | sample Mountain[/micro/,5], cutoff: (range 70,100, 10).tick if spread(7,11).look(:a) 60 | sample Mountain[/micro/,6], cutoff: (range 100,70, 10).tick if spread(3,8).look(:a) 61 | end 62 | -------------------------------------------------------------------------------- /destination/practice/apeg_improv.rb: -------------------------------------------------------------------------------- 1 | ["experiments"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"} 2 | 3 | hold = (ring *%w{1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0}.map(&:to_i)) 4 | tranpose = (ring *%w{10 0 0 0 5 0 0 0 0 -12 0 -2 -12 -2 0 -12}.map(&:to_i)) 5 | velocity = (ring *%w{100 100 49 100 118 78 110 114 100 127 100 127 115 100 100 100}.map(&:to_i)) 6 | 7 | _=nil 8 | live_loop :apeg do 9 | use_synth :blade 10 | root = (knit :Fs3, 16, :As3, 16, :Ds4, 16).tick(:root) 11 | with_fx(:reverb){ 12 | with_fx(:distortion){ 13 | with_transpose(tranpose.tick(:t)){ 14 | play root, release: hold.tick(:h) == 1 ? 0.8 : 0.5, attack: 1-(velocity.tick(:v)/100), cutoff: 80 15 | } 16 | } 17 | } 18 | 19 | with_transpose(-24){ 20 | with_synth(:dsaw){ 21 | play (knit root,1, _,1, root,1, _, 14).tick(:bass), release: 0.5, cutoff: 80, attack: 0.01, decay: 2.0, amp: 0.5 22 | } 23 | with_synth(:prophet){ 24 | play (knit root,1, _,1, root,1, _, 14).tick(:bass), release: 0.5, cutoff: 80, attack: 0.01, decay: 2.0, amp: 0.5 25 | } 26 | } 27 | sleep 0.25 28 | end 29 | 30 | live_loop :harmony do 31 | sync :apeg 32 | with_fx(:reverb){ 33 | with_synth(:hollow){ 34 | play chord(:Fs4, 'M'), amp: (knit 5.0,6, 0.0,2).tick(:amp) 35 | } 36 | } 37 | end 38 | 39 | live_loop :beat do |b_idx| 40 | if b_idx % 32 == 0 41 | sample Fraz[/kick/i,3] 42 | end 43 | 44 | with_fx((knit :none, 3, :reverb, 1, :none, 4).tick(:fx), decay: 0.1){ 45 | sample Fraz[/kick/i,[0,1]].tick(:kick) 46 | } 47 | 4.times{sync :apeg} 48 | sample Fraz[/snap/i,[0,0,0,0, 1,1,1,1]].tick(:s), cutoff: 100 49 | 4.times{sync :apeg} 50 | b_idx+=1 51 | end 52 | 53 | 54 | -------------------------------------------------------------------------------- /destination/practice/bass: -------------------------------------------------------------------------------- 1 | ["instruments","shaderview","experiments", "log","samples"].each{|f| require "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"}; _=nil 2 | shader :shader, "wave.glsl", "bits.vert", "points", 10 3 | #shader :iSpaceLight, 0.4 4 | #shader :iStarLight, 0.3 5 | #shader [:iR, :iB, :iG], 3.0 6 | #shader :iForm, 0.01 7 | #shader :iDir, 1.0 8 | #shader :iMotion, 0.00001 9 | #shader :iWave, 0.9 10 | shader :iSize, 100.9 11 | #shader :iPointSize, 0.1 12 | #shader :iDistort, 0.005 13 | #@cells = 10000; 14 | #shader :iDistort, 0.05 15 | @cells = 10000 16 | live_loop :slept_but do #... 17 | 18 | d = (ring 19 | [(chord :FS3, :m),16], #F A C 20 | [(chord :A3, :M),8], #A C E 21 | [(chord :D3, :M),8], #D F A 22 | [(chord :E3, :M),8]) #E G B 23 | 24 | x= d.tick(:main) 25 | bass = (ring :Fs2, :E2, :A2, :Gs2).tick(:bass) 26 | puts "Bass:#{note_inspect(bass)}" 27 | with_transpose 0 do 28 | synth :fm, note: bass, decay: x[1]/2.0, cutoff: 80, amp: 0.5 29 | with_transpose -12 do 30 | #synth :dark_sea_horn, note: bass, decay: x[1], cutoff: 50 31 | end 32 | end 33 | 34 | at do 35 | use_synth :gpa 36 | 8.times{ 37 | #play d[0][0], decay: (ring 0.25,0.25,0.25,1.0).tick(:decay) 38 | sleep 0.25 39 | } 40 | end 41 | 42 | shader :vertex_settings,"points", [@cells += 50,10000].min 43 | puts @cells 44 | puts "chords:#{note_inspect(x[0])}" 45 | #synth :dark_sea_horn, note: x[0][0], decay: x[1], cutoff: 70, amp: 0.1 46 | synth :dark_sea_horn, note: x[0][1], decay: x[1], cutoff: 70, amp: 0.1 47 | synth :dark_sea_horn, note: x[0][2], decay: x[1], cutoff: 70, amp: 0.1 48 | 49 | at do 50 | sleep x[1]-2 51 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 52 | synth :hollow, note: (ring d.look(:main, offset: 1)[1],_,_).tick(:h), decay: x[1]/2.0, amp: 8.0, attack: 1.0 53 | end 54 | end 55 | 56 | with_transpose -12 do 57 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 58 | synth :dsaw, note: x[0], cutoff: 50, decay: 2.0, amp: 1.2 59 | synth :prophet, note: x[0], cutoff: 50, decay: 2.0, amp: 1.2 60 | end 61 | end 62 | 63 | sample Corrupt[/instrument/,/fx/,/f#/,[0,1]].tick(:sample), cutoff: 60, amp: 0.5 64 | sleep x[1] 65 | end 66 | 67 | live_loop :thing do 68 | sample Dust[/hat/,[0..7]].tick(:sample), cutoff: 60, amp: 0.5 69 | shader :iSize, (range 0, 100, steps:0.1).tick 70 | sleep 0.25*2 71 | end 72 | 73 | live_loop :do, sync: :slept_but do 74 | shader :decay, :iBeat, 2.0*2 75 | sample Mountain[/subkick/,0], cutoff: 130, amp: 2.5 76 | sleep 2 77 | with_fx(:reverb, room: 0.6, mix: 0.7, damp: 0.5) do |r_fx| 78 | sample Ether[/clap/,0], cutoff: 100, amp: 0.2 79 | end 80 | 81 | shader :growing_uniform, :iForm, rrand(0.01, 1.5), 0.001 82 | shader :decay, :iDistort, rrand(0.005, 0.009), 0.0000001 83 | if spread(1,4).tick(:S) 84 | sleep 2-0.25 85 | sample Mountain[/subkick/,1], cutoff: 70, amp: 1.5 86 | sleep 0.25 87 | else 88 | sleep 2 89 | end 90 | end 91 | -------------------------------------------------------------------------------- /destination/practice/beats/Readme.md: -------------------------------------------------------------------------------- 1 | Beats encoded from Attack Magazines beat dissected series: 2 | 3 | * https://www.attackmagazine.com/technique/beat-dissected 4 | -------------------------------------------------------------------------------- /destination/practice/beats/broken_house_beat.rb: -------------------------------------------------------------------------------- 1 | use_bpm 115 2 | #BROKEN HOUSE 3 | #https://www.attackmagazine.com/technique/beat-dissected/broken-house-beat/ 4 | live_loop :drums do 5 | smp Frag[/kick/,0] 6 | smp Frag[/hat/,1] 7 | sleep 3/4.0 8 | smp Frag[/hat/,0] 9 | sleep 1/4.0 10 | 11 | sample Fraz[/snap/,0] 12 | smp Frag[/hat/,1] 13 | 14 | sleep 1/4.0 15 | smp Frag[/kick/,0] 16 | smp Junk[/wood/,0] 17 | 18 | sleep 1/4.0 19 | sleep 1/4.0 20 | smp Frag[/hat/,1] 21 | smp Frag[/kick/,0] 22 | sleep 1/4.0 23 | 24 | 25 | sleep 1/4.0 26 | smp Frag[/hat/,0] 27 | sleep 1/4.0 28 | smp Frag[/hat/,0] 29 | sleep 1/4.0 30 | smp Junk[/wood/,0] 31 | smp Frag[/kick/,0] 32 | smp Frag[/hat/,12] 33 | 34 | sleep 1/4.0 35 | 36 | smp Frag[/hat/,1] 37 | sample Fraz[/snap/,0] 38 | sleep 1/4.0 39 | sleep 1/4.0 40 | smp Frag[/hat/,0] 41 | sleep 1/4.0 42 | smp Frag[/hat/,0] 43 | sleep 1/4.0 44 | 45 | 46 | smp Frag[/kick/,0] 47 | smp Frag[/hat/,1] 48 | 49 | sleep 1/4.0 50 | sleep 1/4.0 51 | sleep 1/4.0 52 | smp Frag[/hat/,0] 53 | sleep 1/4.0 54 | 55 | 56 | 57 | sample Fraz[/snap/,0] 58 | smp Frag[/hat/,1] 59 | 60 | sleep 1/4.0 61 | smp Frag[/kick/,0] 62 | smp Junk[/wood/,0] 63 | smp Frag[/hat/,1] 64 | 65 | sleep 2/4.0 66 | smp Frag[/hat/,1] 67 | smp Frag[/kick/,0] 68 | sleep 1/4.0 69 | 70 | sleep 1/4.0 71 | smp Frag[/hat/,0] 72 | sleep 1/4.0 73 | smp Frag[/hat/,0] 74 | sleep 1/4.0 75 | smp Frag[/kick/,0] 76 | smp Junk[/wood/,0] 77 | 78 | sleep 1/4.0 79 | 80 | sample Fraz[/snap/,0] 81 | smp Frag[/hat/,1] 82 | 83 | sleep 1/4.0 84 | sleep 1/4.0 85 | 86 | smp Frag[/kick/,0] 87 | smp Frag[/hat/,0] 88 | sleep 1/4.0 89 | smp Frag[/hat/,0] 90 | sleep 1/4.0 91 | end 92 | -------------------------------------------------------------------------------- /destination/practice/beats/minimal_house.rb: -------------------------------------------------------------------------------- 1 | use_bpm 123 2 | #Minimal house 3 | set_volume! 1.0 4 | #https://www.attackmagazine.com/technique/beat-dissected/minimal-house/ 5 | live_loop :drums do 6 | 7 | smp Mountain[/subkick/,0] 8 | sleep 1/4.0 9 | sleep 1/4.0 10 | smp Frag[/hat/] 11 | smp MagicDust[/_HI/,15], amp: 1.0 12 | sleep 1/4.0 13 | sleep 1/4.0 14 | 15 | smp Mountain[/subkick/,0] 16 | smp Mountain[/snare/] 17 | smp Mountain[/clap/] 18 | smp MagicDust[/_HI/,14] 19 | sleep 1/4.0 20 | smp MagicDust[/_HI/,16] 21 | sleep 1/4.0 22 | smp Frag[/hat/] 23 | smp MagicDust[/_HI/,15] 24 | sleep 1/4.0 25 | sleep 1/4.0 26 | 27 | smp Mountain[/subkick/,0] 28 | sleep 1/4.0 29 | sleep 1/4.0 30 | smp Frag[/hat/] 31 | smp MagicDust[/_HI/,15] 32 | sleep 1/4.0 33 | sleep 1/4.0 34 | 35 | smp Mountain[/subkick/,0] 36 | smp Mountain[/snare/] 37 | smp Mountain[/clap/] 38 | smp MagicDust[/_HI/,14] 39 | sleep 1/4.0 40 | sleep 1/4.0 41 | smp Frag[/hat/] 42 | smp MagicDust[/_HI/,15] 43 | smp MagicDust[/_HI/,16] 44 | sleep 1/4.0 45 | smp MagicDust[/_HI/,17] 46 | sleep 1/4.0 47 | 48 | smp Mountain[/subkick/,0] 49 | sleep 1/4.0 50 | sleep 1/4.0 51 | smp Frag[/hat/] 52 | smp MagicDust[/_HI/,15] 53 | sleep 1/4.0 54 | sleep 1/4.0 55 | 56 | smp Mountain[/subkick/,0] 57 | smp Mountain[/snare/] 58 | smp Mountain[/clap/] 59 | smp MagicDust[/_HI/,14] 60 | sleep 1/4.0 61 | smp MagicDust[/_HI/,16] 62 | sleep 1/4.0 63 | smp Frag[/hat/] 64 | smp MagicDust[/_HI/,15] 65 | sleep 1/4.0 66 | sleep 1/4.0 67 | 68 | smp Mountain[/subkick/,0] 69 | sleep 1/4.0 70 | sleep 1/4.0 71 | smp Frag[/hat/] 72 | smp MagicDust[/_HI/,15] 73 | sleep 1/4.0 74 | sleep 1/4.0 75 | 76 | smp Mountain[/subkick/,0] 77 | smp Mountain[/snare/] 78 | smp Mountain[/clap/] 79 | sleep 1/4.0 80 | sleep 1/4.0 81 | smp Frag[/hat/] 82 | smp MagicDust[/_HI/,15] 83 | smp MagicDust[/_HI/,16] 84 | sleep 1/4.0 85 | smp MagicDust[/_HI/,17] 86 | sleep 1/4.0 87 | end 88 | -------------------------------------------------------------------------------- /destination/practice/beats/sub_zero_minimal_techno.rb: -------------------------------------------------------------------------------- 1 | use_bpm 125 2 | #sub-zero-minimal-techno 3 | 4 | ["instruments","shaderview","experiments", "log","samples","dsp","monkey"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"}; _=nil 5 | set_volume! 0.8 6 | #https://www.attackmagazine.com/technique/beat-dissected/sub-zero-minimal-techno 7 | _=nil 8 | live_loop :drums do 9 | k1 = Tech[/Drum_Hits/,/kick/,4] 10 | h1,h2 = Tech[/Drum_Hits/,/hat/,0],Tech[/Drum_Hits/,/hat/,1] 11 | s1,s2 = Tech[/Drum_Hits/,/snare/,2], Tech[/Drum_Hits/,/snare/,3] 12 | p1 = Tech[/Drum_Hits/,/perc/,2] 13 | v1 = Tech[/vocal/,10] 14 | r1 = Tech[/cymbal/,8] 15 | kick = (ring *%w{k1 _ _ _}) 16 | hat = (ring *%w{_ _ h1 _ 17 | _ _ h1 {path:h1,amp:0.25} 18 | _ _ h1 _ 19 | _ _ h1 _}) 20 | puts hat 21 | hat2 = (ring *%w{_ _ h2 _}) 22 | snare = (ring *%w{_ _ _ _ s1 _ _ _}) 23 | snare2 = (ring *%w{_ _ _ _ _ _ _ _ 24 | _ _ _ _ _ _ _ s2}) 25 | voice = (ring *%w{ _ _ _ _ _ _ _ _ 26 | _ _ _ _ _ _ v1 _}) 27 | cymbal = (ring *%w{_ _ _ _ _ _ _ _ 28 | _ _ _ _ _ _ _ _ 29 | _ _ _ _ _ _ _ _ 30 | _ _ _ r1 _ _ _ _}) 31 | perc = (ring *%w{_ _ _ p1 32 | _ _ p1 _ 33 | _ p1 _ _ 34 | _ _ _ _}) 35 | (4).times{ 36 | tick 37 | #smp eval(kick.look) 38 | smp eval(hat.look) 39 | #smp eval(hat2.look) 40 | #smp eval(snare.look) 41 | #smp eval(snare2.look) 42 | #smp eval(voice.look), finish: 0.05 43 | #smp eval(cymbal.look), finish: 0.1 44 | #smp eval(perc.look) 45 | sleep 1/4.0 46 | } 47 | end 48 | -------------------------------------------------------------------------------- /destination/practice/bows.rb: -------------------------------------------------------------------------------- 1 | ["instruments","shaderview","experiments", "log"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"} 2 | _=nil 3 | load_snippets("~/.sonic-pi/snippets/") 4 | 5 | # d[-_-]b 6 | # /█\ 7 | # .Π. 8 | 9 | #Fin, thanks. 10 | 11 | with_fx(:reverb, room: 1.0, mix: 1.0) do 12 | live_loop :sop do 13 | with_fx(:slicer, phase: 0.25) do 14 | # sample Sop[/F#/,0], cutoff: 55 15 | end 16 | sleep 4 17 | # sample Sop[/A#/,2], cutoff: 55 18 | # sleep 4 19 | end 20 | end 21 | 22 | live_loop :dark do 23 | with_fx :reverb do 24 | with_fx(:pitch_shift, window_size: 0.1, pitch_dis: 0.01, 25 | mix: 0.1) do 26 | with_synth :dark_sea_horn do 27 | #lets see what it sound like if we go higher... 28 | play (ring :fs4, :as3, :ds3, :Fs3, :As3, :Cs3), 29 | cutoff: 20, 30 | decay: 8.1, amp: 0.7 31 | end 32 | sleep 8 33 | end 34 | end 35 | end 36 | 37 | live_loop :bows do 38 | with_fx((knit :reverb,3, :echo,0).tick(:maybe?), room: 0.0, mix: 1.0) do |fx| 39 | synth :dark_ambience, 40 | note: (ring :Fs3, :Fs3, :Fs3, :Gs3).tick(:dark), decay: 8.1, attack: 1.0, detune1: 24, detune2: 12 41 | 42 | # with_fx(:distortion, mix: (ring 0.0, 0.0, 0.1, 0.15).tick) do 43 | # sample Mountain[/bow/, knit(/G#/,3).tick(:bows),0], amp: 0.2 44 | # end 45 | 8.times{control fx, damp: rrand(0,1); sleep 1} 46 | end 47 | end 48 | 49 | live_loop :har do 50 | # i_hollow((ring :fs2, :as2, :es2, :gs2).tick, amp: 0.5) 51 | sleep 1.0 52 | end 53 | 54 | live_loop :corruption do 55 | with_fx(:echo, phase: 0.5, decay: 0.8, mix: (knit 0.5,1,0.0,3).tick(:mix)) do 56 | # with_fx(:slicer, phase: 0.25, smooth: 0.03) do 57 | #sample Dust[/kick/,10], cutoff: 60 58 | # end 59 | end 60 | sleep 1 61 | with_fx(:bitcrusher, bits: (ring 10, 16).tick(:bits), sample_rate: 10000) do 62 | with_fx((ring :reverb, :reverb, :reverb, :echo).tick(:Fx), decay: 2.0) do 63 | #sample Frag[/F#/,[0,1]].tick(:s), cutoff: 40, amp: 0.6, start: 0.98 64 | end 65 | end 66 | sleep 1 67 | end 68 | -------------------------------------------------------------------------------- /destination/practice/dark_sea_horses.rb: -------------------------------------------------------------------------------- 1 | _=nil 2 | bar=1 3 | live_loop :warm do 4 | notes = ring([:FS2]).tick 5 | sleep 1 6 | s1 = synth :dark_sea_horn, note: notes[0], cutoff: 60, decay: 8.0 7 | s2 = synth :dark_sea_horn, note: notes[1], cutoff: 50, decay: 8.0 8 | s3 = synth :dark_sea_horn, note: notes[2], cutoff: 45, decay: 8.0 9 | 10 | 7.times{ 11 | candidate = scale(:FS3, :minor_pentatonic, num_octaves: 1).drop(1).shuffle.choose 12 | control s1, note: (ring :FS4, :A4, :Cs4).tick, noise1: ring(32.25).tick(:n1), noise2: 0, amp: 1.0, max_delay: 0.5 13 | synth :gpa, note: (ring :E3, _, :Gs3).tick, decay: 1.0, wave: 6 14 | 15 | sleep 1 16 | } 17 | end 18 | 19 | live_loop :go do 20 | sync :warm 21 | i_hollow((ring :FS4, :E4), amp: 2.0) 22 | end 23 | -------------------------------------------------------------------------------- /destination/practice/dark_sea_horses2.rb: -------------------------------------------------------------------------------- 1 | #use_bpm 60 2 | ["samples","instruments","experiments", "log", "shaderview"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"}; _=nil 3 | _=nil 4 | live_loop :warm do 5 | c = _ 6 | co = ring( 7 | [:FS2, :E3, :A3], 8 | [:A2, :Cs3, :E3], 9 | [:Cs2, :E3, :Gs3, :B4], 10 | [:D2, :Fs3, :A3, :CS3], 11 | [:E2, :Gs3, :B3, :D3] 12 | ).tick 13 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 14 | with_transpose -12 do 15 | synth :prophet, note: co[0], cutoff: 55, decay: 4.0, amp: 2.0, attack: 0.5 16 | synth :dsaw, note: co[0], cutoff: 50, decay: 4.0, amp: 2.0, attack: 1.0 17 | end 18 | end 19 | synth :gpa, note: co[-1], decay: 4.0 20 | sleep 1 21 | 22 | with_fx :lpf, cutoff: 80 do 23 | with_synth :"dark_sea_horn" do 24 | c = play co[0], cutoff: 80, decay: 8.0#, noise1: 0 25 | c2 = play co[1], cutoff: 60, decay: 7.0#, noise1: 0 26 | c2 = play co[2], cutoff: 60, decay: 7.0#,# noise1: 0 27 | end 28 | end 29 | sleep 1 30 | 6.times{ 31 | sleep 1; 32 | candidate = scale(:fs3, :minor_pentatonic).shuffle.choose 33 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 34 | with_transpose 12 do 35 | i_hollow(candidate, amp: ramp( *range( 0.1, 8.0, 0.1)).tick(:s2lwower)) 36 | end 37 | 38 | end 39 | control c, note: candidate, 40 | noise1: ring( 0,2).tick(:n1), noise2: ring(0).tick(:n2), 41 | max_delay: rand 42 | } 43 | end 44 | 45 | live_loop :light do 46 | use_synth :dark_sea_horn 47 | play ring( :Cs4, :D4), cutoff: 80, decay: 16.0, noise1: 0, amp: 2.0, noise1_freq: 200 48 | with_synth :hollow do 49 | play ring( :Cs4, :D4), cutoff: 50, decay: 16.0, noise1: 0, amp: 2.0, noise1_freq: 200 50 | end 51 | sleep 16 52 | end 53 | 54 | live_loop :voices do 55 | with_fx :lpf do 56 | with_fx :bitcrusher, mix: 0.2, sample_rate: 1500 do 57 | #sample Words[/tothink/,[0,0]].tick(:sample), cutoff: 120, amp: 4.0, 58 | # finish: 0.125 59 | end 60 | end 61 | sleep 32 62 | end 63 | 64 | live_loop :hollow do 65 | #synth :hollow, note: ring( :E3, :E4).tick, amp: 0.2, decay: 2.0 66 | sleep 8 67 | end 68 | 69 | live_loop :perc do 70 | with_fx :bpf,centre: :FS4 do 71 | with_fx :distortion, mix: 0.5 do 72 | #sample CineAmbi[/loop/,/perc/,0], beat_stretch: 16, cutoff: 80, amp: 1.0 73 | end 74 | end 75 | sleep 16 76 | end 77 | 78 | 79 | live_loop :drums do 80 | # sample Frag[/kick/,[0,0]].tick(:sample), cutoff: 60, amp: 0.5 81 | sample Mountain[/subkick/,[0,0,0,0]].tick(:sample), cutoff: 90, amp: 0.5 82 | with_fx :slicer, phase: ring( 0.5, 1.0).tick, smooth: 0.1 do 83 | sample CineAmbi[/kick/,0], cutoff: 45, amp: 1.0 84 | # sample CineAmbi[/loop/,/f#/,2], amp: 2.0 85 | end 86 | # sample CineAmbi[/loop/,/B_/,15], amp: 0.4 87 | # sample CineAmbi[/GrowlingBass/,2], amp: 8.0, rpitch: -5 88 | # sleep 1 89 | # sleep 1 90 | sleep 4 91 | end 92 | -------------------------------------------------------------------------------- /destination/practice/dark_sea_horses_visuals2.rb: -------------------------------------------------------------------------------- 1 | set_volume! 1.5 2 | shader [:iR, :iB, :iG], 0.2 3 | shader :iWave, 0.4 4 | live_loop :slept_but do 5 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 6 | sample Corrupt[/instrument/,/fx/,/f#/,[1,1]].tick(:sample), cutoff: 50, amp: 0.0 7 | end 8 | #sample CineAmbi[/c#m/,[1,1]].tick(:sample), cutoff: 60, amp: 0.5 9 | with_fx(:echo, decay: 0.5, mix: 1.0, phase: 0.25) do 10 | with_fx(:slicer, phase: 0.25, invert_wave: 1) do 11 | #sample Fraz[/interference/,/f#m/,[1,1]].tick(:sample), cutoff: 60, amp: 0.02, beat_stretch: 16, cutoff: 90 12 | end 13 | end 14 | sleep 16 15 | end 16 | 17 | live_loop :something_different____________________________________________________________, sync: :slept_but do 18 | shader :decay, :iForm, rand, 0.0001 19 | with_fx(:echo, decay: 0.5, mix: 0.1, phase: 0.25) do 20 | with_fx(:reverb, room: 0.8, mix: 0.5, damp: 0.5) do |r_fx| 21 | with_fx(:distortion, mix: 0.01, distort: 0.2) do 22 | #sample Mountain[/bow/, ring(/f#/, /f#/, /c#/).tick(:bowed)], cutoff: 80, amp: 0.3 23 | end 24 | end 25 | end 26 | sleep 8 27 | end 28 | 29 | live_loop :sop, sync: :slept_but do 30 | with_fx(:echo, decay: 8.0, mix: 1.0, phase: 0.25) do 31 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 32 | # sample Sop[/release/,/mm/, (ring 3,4).tick(:spnote)], cutoff: 70, amp: 0.4 33 | sleep 8 34 | end 35 | end 36 | sleep 16-8 37 | end 38 | 39 | live_loop :loop, sync: :slept_but do 40 | data = (ring 41 | chord(:Fs3, :m), chord(:D3, :M), chord(:E3, :M) + [:D3], 42 | chord(:Fs3, :m), chord(:A3, :M), chord(:Cs3, :m7)) 43 | 44 | chords = data.tick(:main) 45 | 46 | with_fx(:pitch_shift, pitch_dis: 0.01, mix: 0.9) do 47 | # synth :dark_sea_horn, note: chords[1], cutoff: 60, release: 4.0, decay: 4.0, amp: 0.1 48 | sleep 1 49 | # synth :dark_sea_horn, note: chords[2], cutoff: 60, release: 4.0, decay: 4.0, amp: 0.1 50 | sleep 1 51 | # synth :dark_sea_horn, note: chords[0], cutoff: 60, release: 4.0, decay: 4.0, amp: 0.1 52 | # shader :decay, :iMotion, 0.005, 0.000001 53 | 54 | if chords.length > 3 55 | # synth :dark_sea_horn, note: chords[-1], cutoff: 60, release: 4.0, decay: 4.0, amp: 0.1 56 | end 57 | end 58 | 59 | #Send the diff between current and future chord 60 | shader :uniform, :iHorse, note(chords[0]).to_f - note(data.look(:main, offset: 1)[0]) 61 | 62 | next_chord_root = chords.look(:main, offset: 1)[0] 63 | at do 64 | sleep 4 65 | with_fx(:reverb, room: 0.6, mix: 0.9, damp: 0.5) do |r_fx| 66 | #synth :dark_ambience, note: dice(6) > 4 ? chords[1] + 5 : next_chord_root, decay: 6.0, amp: 0.3, attack: 2.0, cutoff: 80 67 | end 68 | end 69 | 70 | with_transpose -24 do 71 | #More bass... Ahh thats better. Headphones rumbling 72 | synth :dark_sea_horn, note: chords[0], cutoff: 90, release: 4.0, decay: 2.0, amp: 0.3, attack: 1.0,noise1: 0.5, noise2: 0.5 73 | end 74 | with_transpose (ring -12).tick(:lets_do_something_silly_with_the_bass) do 75 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 76 | at do 77 | # sample Instruments[/double-bass/,/Fs1/, /_15/].tick(:sample), cutoff: 60, amp: 0.2 78 | sleep 1 79 | # sample Instruments[/double-bass/,/Fs1/, /_15/].tick(:sample), cutoff: 70, amp: 0.3 80 | end 81 | # synth :prophet, note: chords[0], cutoff: 50, amp: 0.1, decay: 2.0, release: 2.0 82 | # synth :dsaw, note: chords[0], cutoff: 50, amp: 0.1, decay: 2.0, detune: 12 83 | end 84 | end 85 | 86 | sleep 8-2 87 | end 88 | 89 | live_loop :looping_do_loop do 90 | with_fx(:pitch_shift, time_dis: 0.8) do 91 | sample_and_sleep Mountain[/cracklin/], rate: 0.9, amp: 0.5 92 | end 93 | end 94 | 95 | live_loop :do, sync: :slept_but do 96 | shader :uniform, :iBeat, 1.0 97 | shader :uniform, :iKick, 1.0 98 | # sample Fraz[/kick/,[0,0,0,1]].tick(:sample), cutoff: rrand(60,70), amp: 0.2 99 | # sample Abstract[/perc/,[5,4]].tick(:sample), cutoff: 60, amp: 0.5, beat_stretch: 8 100 | 101 | sleep 2 102 | 103 | # shader :decay, :iDistort, rrand(0.05,0.09), 0.0001 104 | # shader :decay, :iForm, rrand(0.1,0.5), 0.001 105 | with_fx(:reverb, room: 0.6, mix: 0.9, damp: 0.5) do |r_fx| 106 | #sample Fraz[/snap/,[0,0,0,1]].tick(:sample), cutoff: rrand(60,70), amp: 0.2 107 | end 108 | sleep 2 109 | end 110 | -------------------------------------------------------------------------------- /destination/practice/degrees_seq.rb: -------------------------------------------------------------------------------- 1 | beat = 1.0/4.0 2 | live_loop :test do |h_inc| 3 | play degrees_seq(:Cs3, "868885555444433335544441111", 4 | :Cs2, 88818181818181, 5 | :Cs2, 88838383838383, 6 | :Cs2, 88858585858585, 7 | :Cs2, 86888888888888, 8 | :Cs3, 11)[h_inc], 9 | attack: 0.01, release: (ring beat, beat, beat*4, beat*4)[h_inc] 10 | sleep beat 11 | h_inc+=1 12 | end 13 | 14 | live_loop :test2 do |h_inc| 15 | sync :test 16 | case h_inc % 32 17 | when 16..32 18 | play degrees_seq(:Cs3, 8)[h_inc], attack: 0.01, release: beat*4 19 | sleep beat 20 | play degrees_seq(:Cs3, 1)[h_inc], attack: 0.01, release: beat*4 21 | sleep beat 22 | play degrees_seq(:Cs2, 1)[h_inc], attack: 0.01, release: beat*4 23 | else 24 | play degrees_seq(:Cs2, 1)[h_inc], attack: 0.01, release: beat*4 25 | sleep beat 26 | play degrees_seq(:Cs2, 1)[h_inc], attack: 0.01, release: beat*4 27 | sleep beat 28 | play degrees_seq(:Cs2, 1)[h_inc], attack: 0.01, release: beat*4 29 | end 30 | h_inc+=1 31 | end 32 | 33 | live_loop :test3 do |h_inc| 34 | sync :test 35 | with_fx :lpf, cutoff: 60 do 36 | with_synth :saw do 37 | play degrees_seq(:Cs2, 1111122224444)[h_inc], attack: 0.2, release: beat*8 38 | sleep beat*4 39 | end 40 | end 41 | h_inc+=1 42 | end 43 | 44 | live_loop :test4 do |h_inc| 45 | sync :test 46 | with_fx(:reverb, room: 1, mix: 0.6, dry: 0.1){ 47 | sample (ring :drum_tom_lo_soft, :drum_tom_mid_soft, :drum_tom_hi_soft)[h_inc], rate: 0.6, amp: 1.0, start: 0.05 48 | } 49 | sleep beat*14 50 | h_inc+=1 51 | end 52 | 53 | live_loop :test4 do |h_inc| 54 | 4.times{sync :test} 55 | sample :elec_lo_snare, amp: 0.05, start: rand(0.1) 56 | end 57 | -------------------------------------------------------------------------------- /destination/practice/drum_play.rb: -------------------------------------------------------------------------------- 1 | bar = 1/8.0 2 | 3 | live_loop :metro do 4 | cue :sixteen; cue :middle; sleep bar/2; cue :middle; sleep bar/2; 5 | end 6 | 7 | #|1 2 3 4|5 6 7 8|9 10 11 12|13 14 15 16| 8 | 9 | live_loop :ride do 10 | 2.times{sync :sixteen} 11 | sample :drum_cymbal_closed, rate: 1, amp: rrand(1.1, 1.2) 12 | 2.times{sync :sixteen} 13 | sample :drum_cymbal_closed, rate: 1, amp: rrand(1.0, 1.1) 14 | 15 | 6.times{ 16 | sync :sixteen 17 | sample :drum_cymbal_closed, start: 0.2, amp: rrand(0.9,1.0) 18 | sync :sixteen 19 | } 20 | end 21 | 22 | #|1 2 3 4|5 6 7 8|9 10 11 12|13 14 15 16| 23 | 24 | with_fx :level, amp: 1 do 25 | live_loop :kick do 26 | double = (dice(6) > 4) 27 | s = [:elec_snare, :elec_hollow_kick].choose 28 | 29 | #BAR1 30 | sync :sixteen 31 | # with_fx :echo, phase: bar*[9].choose do 32 | with_fx :distortion, distort: 0.6 do 33 | sample :drum_heavy_kick, start: 0.0, amp: 1.0 34 | end 35 | # end 36 | 37 | 4.times{sync :sixteen} 38 | sample :elec_soft_kick 39 | 40 | 2.times{sync :sixteen} 41 | sample :elec_soft_kick 42 | 2.times{sync :sixteen} 43 | 44 | sample :drum_snare_soft, amp: 3 45 | 1.times{sync :sixteen} 46 | sample :drum_snare_soft, amp: 3 if dice(6) >= 5 47 | 1.times{sync :sixteen} 48 | 49 | sample :elec_soft_kick 50 | 2.times{sync :sixteen} 51 | 52 | sample :elec_soft_kick 53 | 3.times{sync :sixteen} 54 | end 55 | end 56 | 57 | with_fx :level, amp: 1 do 58 | with_fx :lpf, cutoff: 100 do 59 | live_loop :striate do 60 | #BAR1 61 | s = :elec_hollow_kick 62 | sync :sixteen; 63 | sample s, rate: 0.9 64 | sync :sixteen; 65 | with_fx :echo, phase: bar/2 do 66 | 2.times { sync :sixteen; sample s, rate: 1.01; } 67 | end 68 | 69 | #BAR2 70 | 4.times{sync :sixteen} 71 | 72 | #BAR3 73 | sync :sixteen 74 | with_fx :distortion, distort: 0.8 do 75 | sample s, amp: 0.8, rate: 0.9 76 | end 77 | 78 | 2.times{sync :sixteen} 79 | sample :drum_heavy_kick, rate: -1, amp: 4 if dice(6)>3 80 | 1.times {sync :sixteen} 81 | 82 | #BAR4 83 | sync :sixteen 84 | with_fx :distortion, distort: 0.5 do 85 | sample s, amp: 0.8, rate: 0.8 86 | end 87 | 3.times{sync :sixteen} 88 | end 89 | end 90 | end 91 | 92 | live_loop :bass do 93 | with_fx :distortion, distort: 0.1 do 94 | with_fx :lpf, cutoff: 80 do 95 | sync :sixteen 96 | use_synth :saw 97 | play_chord chord(:A1, :major), release: 1.0, decay: 0.7, sustain: 0.7 98 | 15.times{sync :sixteen} 99 | 100 | end 101 | end 102 | end -------------------------------------------------------------------------------- /destination/practice/drum_theory.rb: -------------------------------------------------------------------------------- 1 | bar = 1/8.0 2 | 3 | live_loop :metro do 4 | 16.times{cue :sixteen;sleep bar;} 5 | end 6 | 7 | # | 1 2 3 4 | 5 6 (7) 8 | 9 (10) 11 12 | 13 14 15 16 8 | 9 | with_fx :reverb do 10 | live_loop :kickers do 11 | sync :sixteen 12 | sample :drum_heavy_kick, amp: 1.0 13 | 3.times{sync :sixteen} 14 | 15 | sync :sixteen 16 | sample :elec_soft_kick 17 | 3.times{sync :sixteen} 18 | 19 | sync :sixteen 20 | # sample :drum_bass_soft 21 | 3.times{sync :sixteen} 22 | 23 | sync :sixteen 24 | sample :elec_soft_kick 25 | 3.times{sync :sixteen} 26 | end 27 | end 28 | 29 | with_fx :reverb do 30 | live_loop :synco do 31 | 4.times{sync :sixteen} 32 | 33 | 3.times {sync :sixteen} 34 | sample :bd_gas 35 | 1.times {sync :sixteen} 36 | 37 | 2.times {sync :sixteen} 38 | sample :bd_gas 39 | 2.times {sync :sixteen} 40 | 41 | 4.times{sync :sixteen} 42 | end 43 | end 44 | 45 | with_fx :reverb do 46 | live_loop :snares do 47 | sync :sixteen 48 | 3.times{sync :sixteen} 49 | 50 | sample :elec_pop, amp: 0.1 51 | sync :sixteen 52 | sample :elec_snare 53 | 3.times{sync :sixteen} 54 | 55 | sample :elec_pop, amp: 0.2 56 | sync :sixteen 57 | sample :elec_mid_snare, rate: 1 58 | 3.times{sync :sixteen} 59 | 60 | sync :sixteen 61 | sample :elec_snare 62 | 3.times{sync :sixteen} 63 | end 64 | end 65 | 66 | with_fx :reverb do 67 | live_loop :d3 do 68 | 1.times {sync :sixteen} 69 | sample :elec_tick 70 | 3.times {sync :sixteen} 71 | end 72 | end 73 | 74 | set_volume! 2 75 | -------------------------------------------------------------------------------- /destination/practice/drum_thoughts.rb: -------------------------------------------------------------------------------- 1 | live_loop :do do 2 | sample Fraz[/kick/,[0,0]].tick(:sample2), cutoff: 100, amp: 1.5 3 | with_fx(:ixi_techno, phase: 8.0) do 4 | sample Frag[/interference/,/f#m/,[2,2]].tick(:sample), amp: 2.5, beat_stretch: 16 5 | end 6 | 7 | at do 8 | sleep 8 9 | if(dice(6) > 3) 10 | sample Frag[/interference/,/f#m/,[2,2]].tick(:sample), amp: 2.5, beat_stretch: 8, rate: 0.5 11 | end 12 | end 13 | sleep 4 14 | end 15 | 16 | live_loop :loop do 17 | 18 | end 19 | -------------------------------------------------------------------------------- /destination/practice/experiments.rb: -------------------------------------------------------------------------------- 1 | beat = 1.0/4.0 2 | live_loop :test do |h_inc| 3 | with_fx :level, amp: 1.0 do 4 | play degrees_seq(:Cs3, "86888555544443 5 | 333554444111", 6 | :Cs2, 88818181818181, 7 | :Cs2, 88838383838383, 8 | :Cs2, 88858585858585, 9 | :Cs2, 86888888888888, 10 | :Cs3, 11)[h_inc], 11 | attack: 0.01, release: (ring beat, beat, beat*4, beat*4)[h_inc] 12 | sleep beat 13 | h_inc+=1 14 | end 15 | end 16 | 17 | live_loop :test2 do |h_inc| 18 | with_fx :level, amp: 1.0 do 19 | sync :test 20 | case h_inc % 32 21 | when 16..32 22 | cue :high 23 | play degrees_seq(:Cs3, 8)[h_inc], attack: 0.01, release: beat*4 24 | sleep beat 25 | play degrees_seq(:Cs3, 1)[h_inc], attack: 0.01, release: beat*4 26 | sleep beat 27 | play degrees_seq(:Cs2, 1)[h_inc], attack: 0.01, release: beat*4 28 | else 29 | play degrees_seq(:Cs2, 1)[h_inc], attack: 0.01, release: beat*4 30 | sleep beat 31 | play degrees_seq(:Cs2, 1)[h_inc], attack: 0.01, release: beat*4 32 | sleep beat 33 | play degrees_seq(:Cs2, 1)[h_inc], attack: 0.01, release: beat*4 34 | end 35 | end 36 | h_inc+=1 37 | end 38 | 39 | live_loop :test3 do |h_inc| 40 | sync :test 41 | with_fx :lpf, cutoff: 60 do 42 | with_synth :saw do 43 | play degrees_seq(:Cs2, 44 | 2222222, 45 | 3333333, 46 | 1111111, 47 | 2222222, 48 | 4444444, 49 | 4444555)[h_inc], attack: (ring 0.1,0.2)[h_inc], release: (ring beat,beat,beat,beat*4,beat*4,beat*4,beat*4)[h_inc], note_slide: 1.0 50 | sleep beat*2 51 | end 52 | end 53 | h_inc+=1 54 | end 55 | 56 | live_loop :test99 do |h_inc| 57 | sync :time 58 | with_fx :lpf, cutoff: 80 do 59 | with_synth :saw do 60 | case h_inc % 32 61 | when 16..32 62 | play degrees_seq(:Cs3, 1)[h_inc], attack: 0.1, release: (ring beat*1)[h_inc], note_slide: 1.0 63 | else 64 | play degrees_seq(:Cs2, 1)[h_inc], attack: 0.1, release: (ring beat*1)[h_inc], note_slide: 1.0 65 | end 66 | #sleep beat*2 67 | end 68 | end 69 | h_inc+=1 70 | end 71 | 72 | live_loop :test4 do |h_inc| 73 | sync :test 74 | with_fx(:reverb, room: 1, mix: 0.6, dry: 0.1){ 75 | sample (ring :drum_tom_lo_soft, :drum_tom_mid_soft, :drum_tom_hi_soft)[h_inc], rate: 0.6, amp: 1.0, start: 0.05 76 | } 77 | sleep beat*14 78 | h_inc+=1 79 | end 80 | 81 | live_loop :test4 do |h_inc| 82 | 8.times{sync :test} 83 | #sample :elec_lo_snare, amp: 0.01, start: rand(0.1) 84 | end 85 | 86 | set_volume! 1 87 | -------------------------------------------------------------------------------- /destination/practice/harmony_voicing.rb: -------------------------------------------------------------------------------- 1 | # Practicing bass+chord voicing following harmony rules. 2 | 3 | set_volume! 5.0 4 | _=nil 5 | live_loop :do do #E G B - D - F A C - E F G A B C D E 6 | synth :dark_sea_horn, note: (ring chord(:Fs3, :m), chord(:D3, :M), chord(:E3, :M)).tick, decay: 4, cutoff: 80 7 | synth :dark_sea_horn, note: (ring 8 | _,:Fs1, _, 9 | _, _, _ 10 | ).tick(:bass), decay: (ring 12+2).tick(:R), amp: 1.0, cutoff: 120, noise1: 1.5, noise2: 1.5 11 | 12 | sleep 4 13 | end 14 | -------------------------------------------------------------------------------- /destination/practice/harp.rb: -------------------------------------------------------------------------------- 1 | use_bpm 80 2 | live_loop :intro do 3 | #sample CineElec[/80_F#m_MelodicHarp/,[0,0]].tick(:sample), cutoff: 130, amp: 0.5, beat_stretch: 16 4 | sleep 16 5 | end 6 | 7 | live_loop :thing do 8 | #sample CineElec[/cello/, /F#m/,0..3].tick, cutoff: 135 9 | with_fx :slicer, phase: 0.25, invert_wave:0 do |s| 10 | sample CineElec[/cello/, /F#m/,0..3].tick, cutoff: 60 11 | 8.times {sleep 1.0; control s, phase: (ring 12 | 0.5, 0.25, 0.25, 0.5, 13 | 0.5, 0.25, 0.125, 0.5).tick(:phase) 14 | with_fx(:reverb, room: 0.6, mix: 0.6, damp: 0.5) do |r_fx| 15 | sample CineElec[/angelcall/,0..4].tick(:sample), cutoff: (range 60,130,5).tick(:r), amp: 0.5 16 | end 17 | } 18 | end 19 | end 20 | 21 | live_loop :asdasd, sync: :intro do 22 | #sample CineElec[/80/,/F#m/,2], beat_stretch: 16, amp: 2.0, cutoff: 130 23 | with_fx(:slicer, phase: 0.25, probability: 0) do 24 | #sample CineElec[/80/,/F#m/,2], beat_stretch: 16, amp: 2.0, cutoff: 130, rate: -1.0 25 | end 26 | 27 | with_fx(:slicer, phase: 0.5, probability: 0, invert_wave: 1) do 28 | #sample CineElec[/80/,/F#m/,2], beat_stretch: 16, amp: 2.0, cutoff: 130, rate: 1.0 29 | end 30 | 31 | #synth :dsaw, note: chord(:Fs3, :m), cutoff: 70, decay: 4.0, detune: 12, amp: 1.0 32 | with_fx(:krush, mix: 0.1) do |r_fx| 33 | # sample CineElec[/80/,/F#m/,2], beat_stretch: 16, amp: 0.25, cutoff: 80, rate: 1.0, rate: 0.5 34 | end 35 | 36 | with_fx(:slicer, phase: 0.5, probability: 0, invert_wave: 1) do 37 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 38 | with_fx(:distortion) do 39 | # sample CineElec[/80/,/F#m/,2], beat_stretch: 16, amp: 1.0, cutoff: 130, rate: 1.0 40 | end 41 | end 42 | end 43 | sleep 16 44 | end 45 | _=nil 46 | live_loop :bass do 47 | d = (knit 48 | chord(:A1, :M) ,1, _, 15, 49 | chord(:Cs2, :m),1, _, 15, 50 | chord(:A2, :M) ,1, _, 15, 51 | chord(:Fs2, :m),1, _, 15).tick(:n) 52 | if d 53 | #synth :tb303, note: d[0], cutoff: 60, decay: 4.0 54 | #synth :dark_sea_horn, note: d, cutoff: 60, decay: 8.0,attack: 0.00001 55 | end 56 | 57 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 58 | with_fx(:distortion, mix: 0.5) do 59 | synth :hollow, note: (knit 60 | :A3, 16, 61 | :CS3, 16, 62 | :A3, 16, 63 | :Cs3, 16).tick(:d), release: 0.25/2.0, amp: 10.0*0 64 | end 65 | end 66 | sleep 1/2.0 67 | end 68 | 69 | live_loop :pad do 70 | #sample CineElec[/f#m_ColdPad/].tick(:sample), cutoff: 130, amp: 2.0 71 | sleep 16 72 | end 73 | 74 | live_loop :perc_added do 75 | with_fx(:slicer, phase: 0.25*2, probability: 0, mix: 0.0) do 76 | #sample CineElec[/80_OrganicPercs/,6], cutoff: 100, amp: 1.0, beat_stretch: 16 77 | end 78 | sleep 16 79 | end 80 | 81 | live_loop :kickit, sync: :intro do 82 | #sample CineElec[/kick/,[0,3]].tick(:sample), cutoff: 130, amp: 2.5 83 | sleep 1 84 | #sample CineElec[/kick/,[1,2]].tick(:sample), cutoff: 120, amp: 2.5 85 | with_fx(:slicer, phase: (ring 0.25, 0.5, 0.5, 0.25).tick, probability: 0) do 86 | with_fx(:reverb, room: 0.6, mix: 0.5, damp: 0.5) do |r_fx| 87 | # sample CineElec[/snare/,[1,1]].tick(:sample), cutoff: 100, amp: 1.5 88 | end 89 | end 90 | sleep 1 91 | end 92 | -------------------------------------------------------------------------------- /destination/practice/hoover.rb: -------------------------------------------------------------------------------- 1 | ["log","experiments"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"} 2 | 3 | 4 | use_bpm 80 5 | 6 | live_loop :samplz do 7 | #sample "/Users/josephwilk/Workspace/music/samples/loops/Sample Magic/synth & key loops/80bpm/am_syn80_clover_C#.wav", pitch_stretch: 16.0, pitch_dis: 0.0, time_dis: 0.1 8 | sleep 4.0 9 | end 10 | 11 | _=nil 12 | with_fx(:reverb) do 13 | live_loop :ambi do 14 | use_synth :hoover 15 | sync :samplz 16 | 17 | #C#, E, and G# 18 | 19 | #(i, iio, III, iv, v, VI, VII) 20 | # F♯, G♯, A, B, C♯, D, and E. F 21 | # Cm => A C G B D 22 | 8.times{ 23 | notes2 = (knit 24 | #:Cs3,1, _,3, 25 | :Cs3,1, _,3, 26 | # :Cs3, 1, _,3, 27 | # :B3,1, _,3, 28 | ).tick(:note1) 29 | sample Ambi[/perc/,Range.new(2, (ring 4,8).tick(:a))].tick(:perc), cutoff: 100 30 | play notes2, decay: 1.0, release: 2.0, attack: 0.01, amp: 0.5, cutoff: 100 31 | 32 | note = (knit :Cs4,1, :As3,1, :Cs4,1, :Ds4,1, 33 | :Cs4,1, :As3,1, :Cs3,1, :Fs3,1, 34 | :Cs4,1, :As3,1, :Ds4,1, :Fs4,1, 35 | :Cs4,1, :As3,1, :Cs3,1, :Fs3,1, 36 | 37 | ).tick(:note) 38 | release = (ring 1.0/2.0, 1.0/2.0, 1.0/2.0, 1.0, 39 | 1/4.0, 1/4.0, 1/4.0, 1/4.0 40 | ).tick(:r) 41 | 42 | play note, release: release, attack: 0.01 43 | sleep release 44 | } 45 | end 46 | end 47 | 48 | live_loop :blah do 49 | sample Ambi[/kick/,3] 50 | sleep 2 51 | 52 | sample Ambi[/kick/,4] 53 | sample Ambi[/clap/,0] 54 | sleep 2 55 | end 56 | -------------------------------------------------------------------------------- /destination/practice/kreuzberg.rb: -------------------------------------------------------------------------------- 1 | define :choir do |sample| 2 | 4.times do 3 | sample sample, rate: 0.2, sustain: 2.5, attack: 0.01, pan_slide: 0.2, amp_slide: 0.1 4 | sleep 2 5 | end 6 | 7 | loop do 8 | 6.times do 9 | sample sample, rate: 0.3 , sustain: 1.5, attack: 0.01, pan_slide: 0.2, amp_slide: 0.1 10 | sleep 1 11 | end 12 | 13 | 6.times do 14 | sample sample, rate: 0.4 , sustain: 1.5, attack: 0.01, pan_slide: 0.2, amp_slide: 0.1 15 | sleep 0.5 16 | end 17 | end 18 | end 19 | 20 | define :drums do 21 | with_fx :reverb, room: 1 do 22 | 4.times { sleep(2) } 23 | loop do 24 | 25 | 5.times do 26 | sample :drum_tom_lo_soft, amp: 0.3, rate: 0.6 27 | sleep 1 28 | end 29 | 30 | sample :drum_tom_lo_soft, amp: 0.6, rate: 0.8 31 | sleep 0.5 32 | sample :drum_tom_lo_soft, amp: 0.6, rate: 0.8 33 | sleep 0.5 34 | 35 | 6.times {sleep 0.5} 36 | 37 | end 38 | end 39 | end 40 | 41 | define :highlight1 do 42 | 4.times { sleep(2) } 43 | 3.times do 44 | sample :ambi_haunted_hum, amp: 0.5, rate: 0.7, curve: 7 45 | sleep 4 46 | end 47 | 48 | end 49 | 50 | define :support do 51 | 6.times do 52 | sleep 1 53 | end 54 | 55 | 4.times do 56 | sample :ambi_piano, rate: 0.8 57 | sleep 0.5 58 | end 59 | 60 | 1.times do 61 | sample :ambi_piano, rate: 0.9 62 | sleep 0.5 63 | end 64 | 65 | 1.times do 66 | sample :ambi_piano, rate: 0.9 67 | sleep 0.5 68 | end 69 | end 70 | 71 | define :guitar do 72 | with_fx :ixi_techno do 73 | 1.times do 74 | sleep 1 75 | sample :guit_e_slide, rate: 0.1 76 | end 77 | 78 | 6.times do 79 | sleep 1 80 | end 81 | 82 | 6.times do 83 | sleep(0.5) 84 | end 85 | end 86 | end 87 | 88 | in_thread(name: :a) {choir :ambi_choir} 89 | in_thread(name: :d) {drums} 90 | in_thread(name: :e) {loop{highlight1}} 91 | in_thread(name: :e) {loop{support}} 92 | in_thread(name: :f) {loop{guitar}} 93 | 94 | sample :ambi_lunar_land, curve: 7, release: 5, rate: 0.1 95 | 96 | #with_fx :ixi_techno do 97 | # sample "/Users/josephwilk/Dropbox/repl-electric/samples/joe-typing-keyboard.wav" 98 | #end 99 | -------------------------------------------------------------------------------- /destination/practice/london.rb: -------------------------------------------------------------------------------- 1 | _ = nil 2 | bar = 1.0 3 | def bowed_s(name, *args) 4 | s = Dir["/Users/josephwilk/Dropbox/repl-electric/samples/Bowed\ Notes/*_BowedGuitarNote_01_SP.wav"] 5 | puts s 6 | s.sort! 7 | sample (if name.is_a? Integer 8 | s[name] 9 | else 10 | s.select{|s| s =~ /#{name}/}[0] 11 | end), *args 12 | end 13 | def live(name, opts={}, &block) 14 | idx = 0 15 | amp = if(opts[:amp]) 16 | opts[:amp] 17 | else 18 | 1 19 | end 20 | x = lambda{|idx| 21 | with_fx :level, amp: amp do 22 | block.(idx) 23 | end} 24 | live_loop name do |idx| 25 | x.(idx) 26 | end 27 | end 28 | 29 | @polyrhythm = [2,3] 30 | 31 | live_loop :bass do 32 | sync :foo 33 | sample "/Users/josephwilk/Workspace/music/samples/AmbientElectronica_Main_SP/One Shots/Kick/SubKick_01_SP.wav", amp: 3.0 34 | sample "/Users/josephwilk/Workspace/music/samples/AmbientElectronica_Main_SP/Bass/135_C_SwellBass_01_SP.wav", rate: pitch_ratio(note(:Cs3) - note(:C3)), amp: 0.1 35 | bowed_s "F#", rate: 0.5, amp: 0.1 36 | end 37 | 38 | live_loop :foo do 39 | #sample "/Users/josephwilk/Dropbox/repl-electric/samples/Guitar\ Tails/92_Eb_Plucked_01_SP.wav", rate: pitch_ratio(note(:Fs2) - note(:Eb3)) 40 | density(@polyrhythm.sort.first) { play degree(1, :FS3, :major); sleep bar } 41 | end 42 | 43 | live_loop :bar, autocue: false do 44 | sync :foo 45 | density(@polyrhythm.sort.last) do 46 | with_fx (knit :none,7, :echo, 1).tick(:r2), mix: 0.8, phase: bar/2.0 do 47 | n = degree((knit 3,8,4,8,5,2).tick(:r1), :FS3, :major) 48 | play n; sleep bar 49 | if n == degree(5, :FS3, :major) 50 | cue :start 51 | end 52 | end 53 | end 54 | end 55 | 56 | live_loop :high do 57 | 2.times{sync :start} 58 | sample (knit "/Users/josephwilk/Workspace/music/samples/AmbientElectronica_Main_SP/One\ Shots/Perc/MicroPerc_06_SP.wav",3, 59 | "/Users/josephwilk/Workspace/music/samples/AmbientElectronica_Main_SP/One\ Shots/Perc/MicroPerc_07_SP.wav",1).tick(:s) 60 | 61 | end 62 | -------------------------------------------------------------------------------- /destination/practice/loop_practice: -------------------------------------------------------------------------------- 1 | #Location: Spike Island 2 | #Focusing on loops and fx/rate manipulations 3 | 4 | live_loop :play2 do 5 | shader :iIt, rrand(20.0,50) 6 | shader :decay, :iBeat, 1.0, 0.001 7 | 8 | #with_fx(:echo, decay: 0.5, mix: 1.0, phase: 0.25) do 9 | #sample Corrupt[/kick/,[2,2]].tick(:sample), cutoff: 100, amp: 0.8 10 | # end 11 | 12 | # with_fx(:slicer, phase: 4.0, probability: 0, mix: 1.0) do 13 | #sample Corrupt[/organic/,9], cutoff: 135, amp: 1.0, beat_stretch: 8.0 14 | # end 15 | 16 | with_fx(:slicer, phase: 4.0, probability: 0, mix: 1.0) do 17 | #sample Corrupt[/organic/,9], cutoff: 135, amp: 1.0, beat_stretch: 8.0*2, rate: -1.0 18 | end 19 | 20 | with_fx :pan, pan: Math.sin(vt*13)/1.5 do 21 | with_fx(:echo, decay: 1.0, mix: 1.0, phase: 0.25*4) do 22 | with_fx(:slicer, phase: 0.25, probability: 0.0, smooth: 0.5) do 23 | # sample Corrupt[/f#m/,11], beat_stretch: 4, cutoff: 80 24 | end 25 | end 26 | end 27 | sleep 8 28 | end 29 | 30 | live_loop :bass do 31 | sync :play2 32 | with_fx(:krush, mix: 0.5, cutoff: 100, gain: 0.8) do 33 | #sample Corrupt[/bass/,/f#m/,3], amp: 1.0, beat_stretch: 8*2 34 | end 35 | with_fx(:slicer, phase: 0.25, probability: 0) do 36 | #sample Corrupt[/bass/,/f#m/,3], amp: 1.5, beat_stretch: 8*2, rate: -1.0 37 | end 38 | sleep 8 39 | end 40 | 41 | live_loop :perc do 42 | # sample Corrupt[/violin/,4], cutoff: 100, amp: 0.5, beat_stretch: 16 43 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 44 | #sample Corrupt[/f#m/,/fx/,0], cutoff: 135, amp: 0.5, beat_stretch: 16 45 | end 46 | sleep 16 47 | end 48 | 49 | live_loop :keys do 50 | #sync :play2 51 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 52 | #sample Corrupt[/keys/, /f#m/, 11], beat_stretch: 16, cutoff: 100, amp: 0.1 53 | end 54 | sleep 16 55 | end 56 | 57 | live_loop :one_shots do 58 | # sample Corrupt[/one shot/,/B_/] 59 | # sample Corrupt[/Mbira/].tick 60 | sleep 8 61 | end 62 | 63 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 64 | live_loop :hum do 65 | #4.times{sync :play2} 66 | # sample Corrupt[/Mic Hum/,/f#/].tick(:sample), cutoff: 130, amp: 0.5 67 | sample_and_sleep Corrupt[/F#/, /Kalimba/, /texture/, /fx/].tick, amp: 1.0 68 | end 69 | end 70 | 71 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 72 | live_loop :guitar do 73 | sample Corrupt[/acoustic guitar/,/fx/, /f#/].tick(:sample), 74 | cutoff: 80, amp: 0.5 75 | end 76 | sleep 8 77 | end 78 | 79 | _=nil 80 | live_loop :bells do 81 | #sync :keys 82 | # use_random_seed (ring 100, 200).tick 83 | use_synth :pretty_bell 84 | 85 | # with_fx(:krush, mix: 0.0, cutoff: 70) do 86 | with_fx(:reverb, room: 1.0, mix: 0.4, damp: 0.5, reps: 4.0, damp_slide: 1.0) do |r_fx| 87 | notes = scale(:Fs3, :minor_pentatonic, num_octaves: 1).shuffle.drop(1).take(3).shuffle 88 | synth :dsaw, note: (ring :D2, :Fs2, :Cs2).tick(:bass), cutoff: 50, decay: 8, amp: 0.0, detune: 12 89 | 32.times{ 90 | comment do 91 | play (knit notes.choose, 1, _,2, notes.choose,5), 92 | release: 0.05, sustain: 0.1, attack: 0.001, 93 | cutoff: 80, amp: (rand+0.1)*0.0 94 | control r_fx, damp: rand, detune: 12 95 | synth :prophet, note: (knit notes.choose, 1, _,2, notes.choose,5).choose, cutoff: 55, release: 0.05, attack: 0.001, sustain: 0.1, amp: 0.0 96 | end 97 | } 98 | sleep 0.25 99 | 100 | end 101 | # end 102 | 103 | end 104 | -------------------------------------------------------------------------------- /destination/practice/minor_dust.rb: -------------------------------------------------------------------------------- 1 | # (i, iio, III, iv, v, VI, VII) 2 | # F♯, G♯, A, B, C♯, D, E. 3 | f=false;t=true 4 | 5 | live_loop :frozen? do 6 | with_fx(:lpf, cutoff: (ramp *(range 30, 130,5)).tick(:kf)) do 7 | with_fx :reverb, room: 1, reps: 4 do 8 | use_random_seed 200 9 | notes = (scale :fs3, :minor_pentatonic, num_octaves: 4).take(4) 10 | 16.times{ 11 | with_synth(:blade){ 12 | play notes.choose, release: 0.1, amp: rand + 2.0, cutoff: rrand(70, 120) 13 | } 14 | with_synth(:hollow){ 15 | with_transpose(-12) do 16 | play notes.choose, release: 0.11, amp: 0.8, cutoff: rrand(70, 120) 17 | end 18 | } 19 | sleep 0.125 20 | } 21 | end 22 | end 23 | end 24 | 25 | live_loop :collect! do 26 | with_fx(:hpf, cutoff: 110, cutoff_slide: 2, mix: 0.8) do |fx| 27 | use_synth :dark_ambience 28 | play (ring 29 | (chord :Fs3, "sus4"), 30 | (chord :A3, "M"), 31 | (chord :D3, "M"), 32 | (chord :Cs3, "m9")).tick(:notes), 33 | release: 4.0, attack: 0.5, amp: 4.0, decay: 8.3, 34 | detune1: 24, detune2: -24 35 | 8.times{sleep 1.0 ; control fx, cutoff: (ring 100, 130).tick(:fx)} 36 | end 37 | end 38 | 39 | live_loop :slice do 40 | with_fx(:echo, phase: 0.25, mix: 0.5) do 41 | with_fx(:slicer, phase: 0.25, mix: 0.5){ 42 | sample Dust[/F#m/,4], cutoff: (range 40, 80, 5).tick(:cutoff), pan: rdist(1) 43 | } 44 | end 45 | sleep 8 46 | end 47 | 48 | live_loop :push do 49 | with_fx(:echo, phase: 0.25) do 50 | with_fx(:slicer, phase: 0.125) do 51 | sample Dust[/kick/, [4,3,5,3]].tick, amp: 1.0, cutoff: 130 52 | end 53 | end 54 | sleep 2.0 55 | end 56 | 57 | with_fx(:reverb, mix: 0.46, room: 0.7) do 58 | live_loop :pop do 59 | sleep 0.125*1 60 | if spread(7,8).tick(:hat) 61 | sample Dust[/hat/,[12,10]].tick(:d), amp: 0.1+rand*0.2 , 62 | pan: 0.025, 63 | cutoff: (range 80,110,10).tick(:r) 64 | end 65 | if spread(6,11).tick(:hat) 66 | sample Dust[/hat/,[10,10]].tick(:d), amp: 0.1+rand*0.2, 67 | pan: -0.025, 68 | cutoff: (range 100,80,10).tick(:r2) 69 | end 70 | 71 | if (knit f, 29, t, 1, f, 2).tick(:hatz) 72 | #sample Dust[/hat/,14], amp: 1.0, rate: (ring 0.5, 1.0, 2.0, 1.5).tick 73 | sample Scape[/SoftBrushHat/,0], cutoff: 130, amp: rand+0.1 74 | end 75 | end 76 | end 77 | -------------------------------------------------------------------------------- /destination/practice/minor_play.rb: -------------------------------------------------------------------------------- 1 | ["instruments","shaderview","experiments", "log"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"}; _=nil 2 | 3 | #-------------------Activity log--------------------------------> 4 | 5 | shader :shader, "voc.glsl", "bits.vert", "points", rrand(100,2000) 6 | #shader :vertex, "sphere.vert","points", 500 7 | #shader :iColor, 10.0 8 | #shader :iZoom, 0.2 9 | shader :iZoom, 0.9 10 | shader :iStarLight, 1.0 11 | shader :iStar, 2.0 12 | shader :iCells, 1.0 13 | 14 | #shader :vertex, "/Users/josephwilk/Workspace/c++/of_v0.8.4_osx_release/apps/myApps/shaderview/bin/data/sphere.vert", 15 | # :points, 1200 16 | 17 | set_volume! 1.0 18 | 19 | live_loop :go do 20 | #sample Ether[/f#/,[0,0]].tick(:sample), cutoff: 60, amp: 0.5 21 | sleep 8 22 | # sample_and_sleep Sink[/f#/].tick 23 | end 24 | 25 | shader :iWave, 1.0 26 | 27 | live_loop :beat do 28 | sync :synth 29 | shader :decay, :iBeat, 1.0, 0.001 30 | #sample Fraz[/kick/,[0,0]].tick(:sample), cutoff: 50, amp: 2.0 31 | # sample Sink[/f#m/].tick, amp: 0.5 32 | # with_fx(:slicer, phase: 0.25*2, probability: 0) do 33 | # end 34 | # with_fx(:slicer, phase: 0.25) do 35 | #sample Dust[/beats/,2], beat_stretch: 8.0 36 | #sample Dust[/beats/,9], beat_stretch: 8.0, amp: 0.1 37 | # end 38 | 39 | #with_fx(:slicer, phase: 0.25*4, probability: 0) do 40 | #sample Dust[/f#m/,1], cutoff: 130, amp: 0.5 41 | #end 42 | 43 | #with_fx(:slicer, phase: 0.0, probability: 0) do 44 | #sample Dust[/am/,0], cutoff: 135, amp: 0.5 45 | #end 46 | 47 | with_fx(:echo, decay: 8.0, mix: 1.0, phase: 1.0) do 48 | # sample Dust[/whale/].tick, cutoff: 50 49 | end 50 | 51 | #sample Dust[/f#m/,0], cutoff: 40, amp: 0.5, beat_stretch: 8.0 52 | sleep 8 53 | end 54 | _=nil 55 | 56 | live_loop :super do 57 | x= nil 58 | #synth :blade, note: :FS3, decay: 8.0, 59 | # cutoff: 65 60 | with_fx(:slicer, phase: 0.25, probability: 0) do 61 | with_synth :supersaw do 62 | # x = play chord(:Fs3, :m), note_slide: 0.05, cutoff: 65, decay: 8.0 63 | end 64 | end 65 | 8.times{ 66 | sleep 1.0; 67 | # control x, note: chord(:Fs4, :m).choose} 68 | } 69 | end 70 | 71 | live_loop :synth do 72 | use_synth :hollow 73 | with_fx(:reverb, room: 1.0, mix: 0.4, damp: 0.5) do |r_fx| 74 | notes = (ring 75 | (ring :Fs3, :a3, :Cs3), 76 | (ring :D3, :Fs3, :A3), 77 | (ring :E3, :Gs3, :B3), 78 | #(ring :Fs3, :a3, :Cs3) 79 | ).tick(:chords) 80 | 81 | with_transpose(-12) do 82 | synth :dsaw, 83 | note: notes.look, 84 | cutoff: 55, amp: 0.2, decay: rrand(7.0,8.2), 85 | release: 0.01, sustain: 0.01, detune: 24 86 | end 87 | 88 | with_transpose(12) do 89 | with_synth :fm do 90 | play notes.first, cutoff: 80, amp: 0.6 91 | end 92 | end 93 | 94 | 32.times{ 95 | # with_fx(:slicer, phase: 0.25/2.0, probability: 0.5) do 96 | play notes.tick, 97 | wave: 0, decay: 0.01, 98 | attack: 0.01, sustain: 0.1, amp: 2.0, cutoff: 135 99 | sleep 0.25 100 | # end 101 | } 102 | end 103 | end 104 | -------------------------------------------------------------------------------- /destination/practice/mitte.rb: -------------------------------------------------------------------------------- 1 | #Mitte 2 | 3 | define :support do 4 | sleep 1 5 | sample :guit_e_slide, rate: rrand(1.2,1.8), amp: 0.1 6 | sleep 1 7 | end 8 | 9 | define :guitars do 10 | with_fx :reverb, mix: 0.9 do 11 | 6.times do |c| 12 | pattern = [[0.75, 0.75, 1.0, 1.2], [0.75, 0.75, 1.2, 1.0], 13 | [0.75, 0.75, 1.0, 1.0], [0.75, 0.75, 0.8, 1.0]].shuffle.first 14 | sleep 2 15 | sample :guit_e_fifths, rate: pattern[0], pan: rrand(-1,1) 16 | sleep 2 17 | sample :guit_e_fifths, rate: pattern[1], pan: rrand(-1,1) 18 | sleep 2 19 | sample :guit_e_fifths, rate: pattern[2], pan: rrand(-1,1) 20 | sleep 2 21 | sample :guit_e_fifths, rate: pattern[3], pan: rrand(-1,1) 22 | sleep 1 23 | end 24 | 25 | sleep 4 26 | 27 | 6.times do |c| 28 | pattern = [[0.8, 0.8, 1.0, 1.2], [0.8, 1.0, 0.8, 1.2], 29 | [0.8, 0.8, 1.0, 1.0], [0.6, 0.6, 0.8, 1.0]].shuffle.first 30 | sleep 0.5 31 | sample :guit_e_fifths, rate: pattern[0], pan: rrand(-1,1) 32 | sleep 0.5 33 | sample :guit_e_fifths, rate: pattern[1], pan: rrand(-1,1) 34 | sleep 0.5 35 | sample :guit_e_fifths, rate: pattern[2], pan: rrand(-1,1) 36 | sleep 0.5 37 | sample :guit_e_fifths, rate: pattern[3], pan: rrand(-1,1) 38 | sleep 0.25 if c != 5 39 | end 40 | 41 | 1.times do |c| 42 | pattern = [[0.8, 0.8, 1.0, 1.2], [0.8, 1.0, 0.8, 1.2], 43 | [0.8, 0.8, 1.0, 1.0], [0.6, 0.6, 0.8, 1.0]].shuffle.first 44 | sleep 1 45 | sample :guit_e_fifths, rate: pattern[0], pan: rrand(-1,1) 46 | sleep 1 47 | sample :guit_e_fifths, rate: pattern[1], pan: rrand(-1,1) 48 | sleep 1 49 | sample :guit_e_fifths, rate: pattern[2], pan: rrand(-1,1) 50 | sleep 1 51 | sample :guit_e_fifths, rate: pattern[3], pan: rrand(-1,1) 52 | sleep 0.5 if c != 5 53 | end 54 | 55 | 4.times do 56 | guit_sample = [:guit_harmonics].shuffle.first 57 | rates = [0.8, 0.8, 1.0, 1.2, 1.4].shuffle 58 | sleep 2 59 | sample guit_sample, rate: rates[0], pan: rrand(-1,1) 60 | sleep 2 61 | sample guit_sample, rate: rates[1], pan: rrand(-1,1) 62 | sleep 2 63 | sample guit_sample, rate: rates[2], pan: rrand(-1,1) 64 | sleep 2 65 | sample guit_sample, rate: rates[3], pan: rrand(-1,1) 66 | sleep 1 67 | end 68 | end 69 | end 70 | 71 | define :drums do 72 | d = :ambi_choir 73 | 6.times {sleep 9} 74 | 75 | 2.times do 76 | sample d, rate: 1.0, sustain: 2.5, attack: 0.01, pan_slide: 0.2, amp_slide: 0.1 77 | sleep 2 78 | end 79 | 80 | 6.times do 81 | sample d, rate: 1.0 , sustain: 1.5, attack: 0.01, pan_slide: 0.2, amp_slide: 0.1 82 | sleep 0.5 83 | end 84 | 85 | 4.times {sleep 9} 86 | end 87 | 88 | define :beats do 89 | sleep 7.5 90 | s = [:ambi_piano, :ambi_glass_hum, :ambi_drone].shuffle.first 91 | sample s, rate: 0.3 92 | sleep 7.5 93 | sample s, rate: 0.4 94 | end 95 | 96 | define :sam do 97 | sleep 7.5 98 | sample [:guit_harmonics, :guit_e_slide].shuffle.first, rate: 0.8, pan: rrand(-1,1) 99 | end 100 | 101 | define :chords do 102 | with_fx :reverb do 103 | with_fx :lpf do 104 | 105 | use_synth :tri 106 | 107 | use_synth_defaults attack: 0.01, release: 4, sustain: 4, decay: 4.0, amp: 0.1, 108 | cutoff_slide: 0.4, note_slide: 0.4, sustain_level: 0.2, env_curve: 7 109 | 110 | chords = [:F2, :F2, :A2, :C2].shuffle 111 | 112 | sleep 2 113 | play chord(chords[0], :minor) 114 | sleep 2 115 | play chord(chords[0], :minor) 116 | sleep 2 117 | play chord(chords[1], :minor) 118 | sleep 2 119 | play chord(chords[2], :minor) 120 | sleep 1 121 | end 122 | end 123 | end 124 | 125 | define :highlights do 126 | sample [:ambi_haunted_hum, :ambi_glass_hum].shuffle.first 127 | sleep 4 128 | end 129 | 130 | in_thread(name: :a) do loop{highlights} end 131 | in_thread(name: :g) do loop{sample :ambi_lunar_land; sleep 9; guitars} end 132 | in_thread(name: :b) do loop{beats} end 133 | in_thread(name: :s) do loop{sam} end 134 | in_thread(name: :c) do loop{chords} end 135 | in_thread(name: :su) do 136 | sleep(9*4) 137 | loop{support} 138 | end 139 | 140 | in_thread(name: :d) do loop{drums} end -------------------------------------------------------------------------------- /destination/practice/organ.rb: -------------------------------------------------------------------------------- 1 | ["instruments","shaderview","experiments", "log"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"}; _=nil 2 | 3 | #-------------------Activity log--------------------------------> 4 | 5 | shader :shader, "voc.glsl", "bits.vert", "points", rrand(0,0) 6 | #shader :vertex, "sphere.vert","points", 500 7 | #shader :iColor, 10.0 8 | #shader :iZoom, 0.2 9 | shader :iZoom, 0.9 10 | shader :iStarLight, 1.0 11 | shader :iStar, 2.0 12 | shader :iCells, 1.0 13 | 14 | #shader :vertex, "/Users/josephwilk/Workspace/c++/of_v0.8.4_osx_release/apps/myApps/shaderview/bin/data/sphere.vert", 15 | # :points, 1200 16 | 17 | set_volume! 1.0 18 | 19 | live_loop :go do 20 | #sample Ether[/f#/,[0,0]].tick(:sample), cutoff: 60, amp: 0.5 21 | sleep 8 22 | # sample_and_sleep Sink[/f#/].tick 23 | end 24 | 25 | shader :iWave, 1.0 26 | 27 | live_loop :beat do 28 | sync :synth 29 | shader :decay, :iBeat, 1.0, 0.001 30 | #sample Fraz[/kick/,[0,0]].tick(:sample), cutoff: 50, amp: 2.0 31 | # sample Sink[/f#m/].tick, amp: 0.5 32 | # with_fx(:slicer, phase: 0.25*2, probability: 0) do 33 | # end 34 | # with_fx(:slicer, phase: 0.25) do 35 | #sample Dust[/beats/,2], beat_stretch: 8.0 36 | #sample Dust[/beats/,9], beat_stretch: 8.0, amp: 0.1 37 | # end 38 | 39 | #with_fx(:slicer, phase: 0.25*4, probability: 0) do 40 | #sample Dust[/f#m/,1], cutoff: 130, amp: 0.5 41 | #end 42 | 43 | #with_fx(:slicer, phase: 0.0, probability: 0) do 44 | #sample Dust[/am/,0], cutoff: 135, amp: 0.5 45 | #end 46 | 47 | with_fx(:echo, decay: 8.0, mix: 1.0, phase: 1.0) do 48 | # sample Dust[/whale/].tick, cutoff: 50 49 | end 50 | 51 | #sample Dust[/f#m/,0], cutoff: 40, amp: 0.5, beat_stretch: 8.0 52 | sleep 8 53 | end 54 | _=nil 55 | 56 | live_loop :super do 57 | x= nil 58 | #synth :blade, note: :FS3, decay: 8.0, 59 | # cutoff: 65 60 | with_fx(:slicer, phase: 0.25, probability: 0) do 61 | with_synth :supersaw do 62 | # x = play chord(:Fs3, :m), note_slide: 0.05, cutoff: 65, decay: 8.0 63 | end 64 | end 65 | 8.times{ 66 | sleep 1.0; 67 | # control x, note: chord(:Fs4, :m).choose} 68 | } 69 | end 70 | 71 | live_loop :synth do 72 | use_synth :hollow 73 | with_fx(:reverb, room: 1.0, mix: 0.4, damp: 0.5) do |r_fx| 74 | notes = (ring 75 | # (ring :Fs3, :a3, :Cs3), 76 | # (ring :D3, :Fs3, :A3), 77 | # (ring :E3, :Gs3, :B3), 78 | 79 | # chord(:Fs3, 'sus4'), 80 | # (ring :D3, :Fs3, :A3), 81 | # (ring :E3, :Gs3, :B3), 82 | 83 | chord(:Fs3, 'sus2'), #1 84 | chord(:D3, :major7), #6 85 | (ring :E3, :Gs3, :B3), #7 86 | 87 | #(ring :Fs3, :a3, :Cs3) 88 | ).tick(:chords) 89 | 90 | #(i, iio, III, iv, v, VI, VI 91 | 92 | sample (ring Organ[/f#1/,1], Organ[/d1/,1], Organ[/e1,1/] ).tick(:oooo), amp: 1.0 93 | 94 | with_fx :distortion, mix: 0.1 do 95 | synth :blade, note: notes.last, attack: 1.0, decay: 2.0, cutoff: 50 96 | end 97 | with_transpose(-12) do 98 | synth :dsaw, 99 | note: notes.look, 100 | cutoff: 60, amp: 1.0, decay: rrand(7.0,8.2), 101 | release: 0.01, sustain: 0.01, detune: 24 102 | end 103 | 104 | with_transpose(12) do 105 | with_synth :dark_sea_horn do 106 | # play notes.first, cutoff: 100, amp: 0.6 107 | end 108 | end 109 | 110 | 32.times{ 111 | # with_fx(:slicer, phase: 0.25/2.0, probability: 0.5) do 112 | play notes.tick, 113 | wave: 0, decay: 0.01, 114 | attack: 0.01, sustain: 0.1, amp: 2.0, cutoff: 135 115 | sleep 0.25 116 | # end 117 | } 118 | end 119 | end 120 | -------------------------------------------------------------------------------- /destination/practice/prenzlberg.rb: -------------------------------------------------------------------------------- 1 | ["support", "soprano", "samples"].each{|f| require "/Users/josephwilk/Workspace/repl-electric/sonic-pi/lib/#{f}"} 2 | 3 | bar = 1.0/2.0 4 | clap_s = csample("183102__dwsd__clp-bodacious.wav") 5 | 6 | live(:words) do |n| 7 | sync :circleofeight 8 | if n % 16 == 0 9 | with_fx :rlpf, cutoff: 50 do 10 | sample Sop.yehp[1], amp: 8 11 | #sample Sop.yehp[1], release: bar*8, amp: 4 12 | end 13 | end 14 | sleep bar*4 15 | end 16 | 17 | live(:drums) do 18 | with_fx :lpf, cutoff: 65 do 19 | 15.times do |n| 20 | cue :circleofeight 21 | sample :drum_bass_soft 22 | sleep bar/2.0 23 | if (n%4 == 0) 24 | sample clap_s 25 | end 26 | if n == 7 27 | sample clap_s 28 | sleep bar/4 29 | sample clap_s 30 | sleep bar/4 31 | else 32 | sleep bar/2 33 | end 34 | 35 | end 36 | sample :drum_bass_soft 37 | sleep bar/2 38 | sample :drum_bass_soft 39 | sample :drum_cymbal_pedal 40 | sleep bar/2 41 | end 42 | end 43 | 44 | live :synths do |n| 45 | use_synth :beep 46 | with_fx :slicer, phase: bar do 47 | if n % 16 != 15 48 | play :D3 49 | sleep bar 50 | else 51 | with_fx :echo, phase: bar*4 do 52 | play :D4 53 | end 54 | sleep bar/2.0 55 | play :D3 56 | sleep bar/2.0 57 | end 58 | end 59 | end 60 | 61 | live :synths2 do |n| 62 | vol = 1.0 63 | use_synth :fm 64 | # use_synth_defaults attack: 0.4, res: 0.08, attack: 0.8, release: 0.5, cutoff: 50, amp: 1.2 65 | with_fx :slicer, phase: bar do 66 | use_synth :fm 67 | if n % 16 != 15 68 | sleep bar 69 | else 70 | if n % 32 == 15 71 | with_fx :echo, phase: bar do 72 | play :D3, amp: vol 73 | end 74 | sleep bar/2.0 75 | sleep bar/2.0 76 | play :D2, amp: vol 77 | elsif n % 32 == 31 78 | sleep bar/2.0 79 | play :D3, amp: vol 80 | sleep bar/2.0 81 | play :D3, amp: vol 82 | else 83 | sleep bar/2.0 84 | sleep bar/2.0 85 | end 86 | end 87 | end 88 | end 89 | 90 | live :sins do |n| 91 | sync :circleofeight 92 | # sync :highlight 93 | with_fx :rlpf, cutoff: 90 do 94 | with_fx :reverb do 95 | use_synth :beep 96 | play :D4, release: bar*8, attack: 0.25, decay: bar, amp: 0.5 97 | sleep bar*8 98 | play :C4, release: bar*8, attack: 0.25, decay: bar, amp: 0.5 99 | sleep bar*8 100 | play :E4, release: bar*8, attack: 0.25, decay: bar, amp: 0.5 101 | sleep bar*8 102 | play :D3, release: bar*8, attack: 0.20, decay: bar*2, amp: 0.9 103 | sleep bar*8 104 | end 105 | end 106 | end 107 | 108 | live :sins2 do |n| 109 | sync :circleofeight 110 | with_fx :lpf, cutoff: 60 do 111 | use_synth :pretty_bell 112 | play :D4, amp: 0.5, attack: 0.2, release: bar*8, amp: 0.5, decay: bar 113 | sleep bar*8 114 | play :C4, amp: 0.5, attack: 0.2, release: bar*8, amp: 0.5, decay: bar 115 | sleep bar*8 116 | end 117 | end 118 | 119 | live :noise do |n| 120 | synth :circleofeight 121 | use_synth :pnoise 122 | with_fx :pan, pan: (Math.sin(n)) do 123 | with_fx :reverb do 124 | with_fx :lpf, cutoff: 30 do 125 | play :D6, release: bar*16, amp: 2.5 126 | sleep bar * 16 127 | end 128 | end 129 | end 130 | end 131 | 132 | live :highlight do |n| 133 | use_synth :zawa 134 | vol = 0.3 135 | 136 | with_fx :echo do 137 | sync :circleofeight 138 | with_fx :lpf, cutoff: 60 do 139 | play_chord chord(:D3, :major), release: bar*8, amp: vol-0.1, decay: bar*2, phase: bar*2 140 | #play_chord chord(:D3, :major), release: bar*8, amp: vol, decay: bar, phase: bar*2 141 | sleep bar*8 142 | 143 | play_chord chord(:D3, :sus4), release: bar*8, amp: vol-0.1, decay: bar*2, phase: bar*2 144 | #play_chord chord(:D3, :sus4), release: bar*8, amp: vol, decay: bar*2, phase: bar*2 145 | sleep bar*8 146 | 147 | play_chord chord(:D3, :major), release: bar*4, amp: vol-0.1, decay: bar*2, phase: bar*2 148 | #play_chord chord(:D3, :"7sus4"), release: bar*4, amp: vol+0.1, decay: bar*2, phase: bar*2 149 | sleep bar*4 150 | 151 | play_chord chord(:D3, :major), release: bar*4, amp: vol, decay: bar*2, phase: bar*2 152 | sleep bar*4 153 | 154 | play_chord chord(:D3, :sus4), release: bar*4, amp: vol, decay: bar*2, phase: bar*2 155 | sleep bar*4 156 | 157 | with_fx :reverb do 158 | play_chord chord(:D3, :major), release: bar*4, amp: 0.5, decay: bar*4, phase: bar*2 159 | sleep bar*4 160 | end 161 | end 162 | end 163 | end 164 | 165 | #begone :drums 166 | #begone :sins 167 | #begone :sins2 168 | begone :noise 169 | #begone :synths 170 | #begone :synths2 171 | #begone :highlight 172 | #begone :words 173 | -------------------------------------------------------------------------------- /destination/practice/random.rb: -------------------------------------------------------------------------------- 1 | ["samples","instruments","experiments", "log", "shaderview"].each{|f| load"/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"}; _=nil 2 | 3 | 4 | shader :shader, "voc.glsl", "bits.vert", "points", 15000 5 | shader :iMotion, 0.011 6 | shader :iStarLight, 0.1 7 | shader :iSpaceMotion, 0.0 8 | 9 | live_loop :percussion do 10 | # sync :warmup 11 | # sample Abstract[/perc/,/loop/,[1,1]].tick(:sample), cutoff: 75, amp: 0.5, beat_stretch: 16 12 | sleep 16 13 | end 14 | 15 | live_loop :shats do 16 | # sync :warmup 17 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 18 | # sample Frag[/hat/,0..16].tick(:sample), cutoff: 60, amp: 0.8 19 | end 20 | sleep 0.25 21 | end 22 | 23 | live_loop :main do 24 | with_fx(:reverb, room: 0.8, mix: 0.4, damp: 0.5) do |r_fx| 25 | with_fx(:echo, decay: 8.0, mix: 0.3, phase: 0.25) do 26 | shader :decay, :iMotion, rrand(0.01,0.1) 27 | #sample Instruments[/double-bass/,/_1_/, ring(/Cs3/, /Fs3/)].tick(:2sample), cutoff: 100, amp: 1.0 28 | # sample Instruments[/double-bass/,/_1_/, ring(/Cs3/, /Fs3/).tick(:oboe)].tick(:sample), cutoff: 100, amp: 1.0 29 | end 30 | end 31 | 32 | chord_notes = ring( 33 | # chord(:FS3, :sus4), 34 | 35 | # chord(:D3, :major), 36 | # chord(:D3, :major7), 37 | # chord(:E3, :major), 38 | 39 | chord(:FS3, :m), 40 | #chord(:B3, :M), 41 | 42 | chord(:Cs3, :m), 43 | chord(:Gs3, :m), 44 | chord(:Cs3, :minor7) 45 | ).tick 46 | with_synth :leadsaw do 47 | play chord_notes, cutoff: 130, decay: 8.0, amp: 6.0 48 | end 49 | with_synth :dsaw do 50 | play chord_notes, cutoff: 80, decay: 8.0, amp: 0.2, detune: 12 51 | end 52 | 53 | at do 54 | with_transpose 12 do 55 | with_synth :dark_sea_horn do 56 | 8.times{ 57 | play ring( 58 | chord_notes[-1]+ring( 5,3,0).tick(:fifth),_,chord_notes[-2], 59 | chord_notes[-1], chord_notes[-1] ).tick(:d), cutoff: 130, decay: 1.0, amp: 0.7, noise1: 0, noise1: 2 60 | sleep 0.5} 61 | end 62 | end 63 | end 64 | 65 | 66 | with_transpose(12) do 67 | with_synth :leadsaw do 68 | # play chord_notes[-1], cutoff: 100, decay: 8.0, amp: 0.3 69 | end 70 | end 71 | 72 | with_transpose(-12) do 73 | with_synth :leadsaw do 74 | # play :Fs2, cutoff: 135, decay: 8.1, amp: 0.5, 75 | end 76 | end 77 | 78 | sleep 8 79 | end 80 | 81 | 82 | live_loop :everything_is_better_with_sop do 83 | # sync :warmup 84 | with_fx(:bitcrusher, mix: 0.1) do 85 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 86 | with_fx(:echo, decay: 8, mix: 1.0, phase: 1) do 87 | # sample Sop[/release/,/ye/,[3,4]].tick(:sample), cutoff: 80, amp: 0.4 88 | end 89 | end 90 | 91 | end 92 | sleep 16 93 | end 94 | 95 | live_loop :kicker do 96 | sync :warmup 97 | shader :decay, :iKick, rand 98 | #sample Frag[/kick/,[0,0]].tick(:sample), cutoff: 50, amp: 0.5 99 | sleep 4 100 | 101 | end 102 | 103 | set_mixer_control! lpf: 10 104 | 105 | live_loop :ending_thingey do 106 | #QUICK FINISH>>>>> 107 | sample_and_sleep Mountain[/cracklin/,[0,0]].tick(:sample), cutoff: 40, amp: 6.5, rate: 0.1 108 | end 109 | 110 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5, damp_slide: 0.5) do |r_fx| 111 | live_loop :warmup do 112 | # synth :hollow, note: ring( :E3, :E4).tick(:notes), amp: 0.5, attack: 4.0, decay: 8.0 113 | 114 | with_fx :bpf, centre: :Fs3, mix: 0.0 do 115 | with_synth :dark_sea_horn do 116 | 117 | with_fx(:echo, phase: 0.25*4, decay: 16) do 118 | # sample Organic[/kick/,[0,0]].tick(:sample), cutoff: 80, amp: 1.0 119 | end 120 | 121 | with_fx(:slicer, phase: 0.25*4, wave:0, probability: 0) do 122 | 123 | # s2 = play :CS3, cutoff: 65, amp: 0.5, sustain: 4.0, decay: 16.0 124 | 125 | end 126 | 127 | with_fx(:slicer, phase: 0.25, probability: 0) do 128 | #sample Organ[/_f#3_/,0], cutoff: 80, amp: 3.0 129 | end 130 | 131 | with_fx(:slicer, phase: 0.25*2, wave: 0, probability: 0, invert_wave: 1.0) do 132 | # s2 = play :Fs3, cutoff: 60, amp: 0.5, sustain: 4.0, decay: 16.0 133 | end 134 | 135 | s= nil 136 | with_fx(:pitch_shift, pitch_dis: 0.1, window_size: 0.4, amp: 0.2) do 137 | s = play :CS2, cutoff: 50, amp: 0.1, sustain: 4.0, decay: 12.0, note_slide: 0.01, cutoff_slide: 0.2 138 | 139 | end 140 | sleep 1 141 | #This is controling the visuals # 142 | shader :iWave, rrand(0.0,0.5), 0.0001 143 | 14.times{ 144 | sleep 1 145 | control s, note: scale("fs#{[3,3,4].choose}", :minor_pentatonic, num_octaves: 1).shuffle.choose, cutoff: 70 146 | control r_fx, damp: rand 147 | } 148 | end;end;end;end 149 | -------------------------------------------------------------------------------- /destination/practice/sample_db.rb: -------------------------------------------------------------------------------- 1 | use_bpm 120 2 | require "mysql2" 3 | _=nil 4 | max_samples = 500 5 | max_count = 500 6 | @everything ||= Mysql2::Client.new(:host => "localhost", :username => "root", :database => "repl_electric_samples") 7 | octave = 4 8 | @perc_f ||= (ring *@everything.query("select path,onset,offset,length from notes where octave = #{octave} AND length < 0.25 AND (note = 'F#')").to_a.shuffle.take(128)) 9 | @perc_a ||= (ring *@everything.query("select path,onset,offset,length from notes where octave = #{octave} AND length < 0.25 AND (note = 'A')").to_a.shuffle.take(128)) 10 | @perc_d ||= (ring *@everything.query("select path,onset,offset,length from notes where octave = #{octave} AND length < 0.25 AND (note = 'D')").to_a.shuffle.take(128)) 11 | @perc_c ||= (ring *@everything.query("select path,onset,offset,length from notes where octave = #{octave} AND length < 0.25 AND (note = 'C#')").to_a.shuffle.take(128)) 12 | @perc_e ||= (ring *@everything.query("select path,onset,offset,length from notes where octave = #{octave} AND length < 0.25 AND (note = 'E')").to_a.shuffle.take(128)) 13 | @perc_g ||= (ring *@everything.query("select path,onset,offset,length from notes where octave = #{octave} AND length < 0.25 AND (note = 'G#')").to_a.shuffle.take(128)) 14 | 15 | (@perc_c+@perc_f+@perc_a+@perc_d+@perc_g+@perc_e).each{|s| 16 | load_sample s} 17 | puts (@perc_c+@perc_f+@perc_a+@perc_d+@perc_g+@perc_e).count 18 | 19 | def tuned_perc(note) 20 | puts note 21 | case note 22 | when "F#" then (ring *@perc_f.to_a.select{|p| p["path"] =~ /sop/}) 23 | when "C#" then @perc_c #(ring *@perc_c.to_a.select{|p| p["path"] =~ /sop/}) 24 | when "A" then @perc_a#(ring *@perc_a.to_a.select{|p| p["path"] =~ /sop/}) 25 | when "D" then @perc_d#(ring *@perc_d.to_a.select{|p| p["path"] =~ /sop/}) 26 | when "E" then @perc_e z#(ring *@perc_e.to_a.select{|p| p["path"] =~ /sop/}) 27 | when "G#" then (ring *@perc_g.to_a.select{|p| p["path"] =~ /sop/}) 28 | else [] 29 | end 30 | end 31 | 32 | live_loop :techno, sync: :heart do 33 | s = Tech[/loop/,/120/, /f#m/] 34 | puts s 35 | sample s, amp: 0.2 36 | sleep sample_duration(s)-0.2 37 | end 38 | 39 | live_loop :perc_part, sync: :heart do 40 | tick 41 | if spread(1,22).look 42 | with_fx :reverb do 43 | synth :dark_sea_horn, note: (ring chord(:FS1, :m), chord(:A1, :m), chord(:D1, :M), chord(:E1, :M)).look[0], amp: 1.0, decay: 22.0, cutoff: 60 44 | end 45 | end 46 | changing = [spread(7,11).look, spread(1,4).look] 47 | #changing.shuffle! if dice(6) > 4 48 | n = (knit "F#",22, "A",22, "D",22, "E",22).tick(:ti) 49 | p1 = tuned_perc(n).tick(:s1) 50 | if changing[0] && p1 51 | # synth :plucked, note: n.gsub("#","s"), decay: 0.25, attack: 0.001 52 | pos = [ratio_on(p1), ratio_off(p1)] 53 | pos.shuffle! if dice(32) > 1 54 | sample p1["path"], start: pos[0], finish: pos[1], amp: 2.0 55 | end 56 | n = (knit "A",22, "C#",22, "F#",22, "G#",22).tick(:t2i) 57 | p1 = tuned_perc(n).look 58 | if changing[1] && p1 59 | # synth :plucked, note: n.gsub("#","s"), decay: 0.125, attack: 0.001 60 | pos = [ratio_on(p1), ratio_off(p1)] 61 | pos.shuffle! if dice(32) > 1 62 | sample p1["path"], start: pos[0], finish: pos[1], amp: 2.0 63 | end 64 | sleep 0.25 65 | end 66 | 67 | live_loop :hats, sync: :heart do 68 | with_fx :wobble, phase: 32 do 69 | with_fx :reverb, mix: 0.1 do 70 | with_fx :slicer, probability: 0.5 do 71 | sleep 0.5 72 | sample Frag[/hat/,(knit 65,9, 64,1).tick(:hats)], amp: 0.5, pan: (ring 0.25, -0.25).tick(:p), rate: (knit 0.5,2, 0.9,2).tick(:p2) 73 | sleep 0.5 74 | end 75 | end 76 | end 77 | end 78 | 79 | live_loop :heart do 80 | sample Mountain[/subkick/i,1], amp: 2.0 81 | sleep 1 82 | sample Mountain[/subkick/i,1], amp: 1.0, cutoff: 120 83 | sample Corrupt[/snare/,3], amp: 1.0, cutoff: (ring *(range 100, 135, 2.5)).tick 84 | sleep 1 85 | end 86 | 87 | def ratio_on(smp) 88 | if smp 89 | dur = sample_duration(smp["path"]) 90 | smp["onset"]/dur+0.0 91 | end 92 | end 93 | def ratio_off(smp) 94 | if smp 95 | dur = sample_duration(smp["path"]) 96 | smp["offset"]/dur+0.0 97 | end 98 | end 99 | -------------------------------------------------------------------------------- /destination/practice/sephia.rb: -------------------------------------------------------------------------------- 1 | live_loop :beat do 2 | with_fx :reverb, room: 0.0, damp: 0.0 do 3 | sample Frag[/kick/,2], rate: (ramp *range(0.1, 1.0,0.1)).tick, start: 0.0, amp: 0.1 4 | end 5 | sleep 8 6 | end 7 | 8 | live_loop :beat2 do 9 | sync :beat 10 | # with_fx(:slicer, phase: 0.25*1, probability: 0) do 11 | #sample Dust[/f#/,2], cutoff: (ramp *(range 100, 130,1)).tick(:cut), amp: 1.0 12 | # sample Dust[/f#/,1], amp: 1.0 13 | 14 | # end 15 | # sample Frag[/kick/,[0,0]].tick(:sample), cutoff: 130, amp: 2.5 16 | # sample Dust[/beat/,6], cutoff: 135, amp: 1.5, beat_stretch: 8.0 17 | sample Dust[/beat/,1], cutoff: 135, amp: 1.5, beat_stretch: 8.0 18 | # sample Dust[/beat/,3], cutoff: 135, amp: 1.5, beat_stretch: 8.0 19 | 20 | #sample Dust[/f#/,0], cutoff: 135, amp: 0.5, beat_stretch: 8.0*2.0 21 | 22 | # with_fx(:slicer, phase: 0.25*1, probability: 0) do 23 | #sample Dust[/f#/,1], cutoff: 135, amp: 0.5, beat_stretch: 8.0*2.0 24 | # with_fx(:krush) do 25 | #sample Dust[/f#/,1], cutoff: 130, amp: 1.5, beat_stretch: 8.0 26 | # end 27 | with_fx(:echo, decay: 8.0, mix: 1.0, phase: 1.0, max_phase: 0.5) do 28 | # sample Dust[/whale/,1], cutoff: 130, amp: 0.5 29 | end 30 | end 31 | 32 | live_loop :drums do 33 | #sync :beat 34 | #sample Frag[/kick/,[0,0,0,1]].tick(:sample), cutoff: 120, amp: 2.5 35 | sleep 2 36 | end 37 | _=nil 38 | live_loop :synths do 39 | sync :beat 40 | use_synth :hollow 41 | use_random_seed 300 42 | notes = #scale(:fs4, :minor_pentatonic).shuffle.take(4) 43 | 44 | with_fx(:reverb, room: 1.0, mix: 0.5, damp: 0.5, reps: 4.0) do |r_fx| 45 | with_fx(:pitch_shift, window_size: 0.1, pitch_dis: 0.005, time_dis: 0.001, mix: 0.0) do 46 | #synth :dark_ambience, note: (ring :Fs3), decay: 8.0, attack: 1.0, amp: 8.0 47 | 16.times{ 48 | notes = (knit 49 | :fs2, 1, _, 3, 50 | :e2, 1, _, 1, 51 | :cs2, 1, _, 0, 52 | :d2, 1, _, 3, 53 | :cs2, 1, _, 0, 54 | :e2, 1, _, 3) 55 | 56 | synth :prophet, note: notes.tick(:n), cutoff: 90, amp: 0.5, decay: 0.5 57 | with_transpose(-12) do 58 | play notes.look(:n), 59 | attack: 0.01, cutoff: 80, 60 | detune: 12, 61 | release: (knit 1.0, 6, 0.5, 5, 1.0, 5).tick(:s), 62 | amp: 1.5 63 | sleep 0.25*2 64 | end 65 | } 66 | end 67 | end 68 | end 69 | -------------------------------------------------------------------------------- /destination/practice/single_sample.rb: -------------------------------------------------------------------------------- 1 | ["instruments","shaderview","experiments", "log","samples"].each{|f| require "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"}; _=nil 2 | set_volume! 0.5 3 | use_bpm 140 4 | live_loop :beat do 5 | if spread(6,12, rotate: 4).tick(:s) 6 | p = ([0,11, -64, 1] + [[2,1],[5,1],[2,1],[-2,1]].shuffle).flatten 7 | sample CineElec[/f#m/, /WrongPiano/, 0], amp: 0.45, start: 0.0, finish: 0.1, 8 | rpitch: (knit *p).tick(:high) 9 | end 10 | if spread(4,8).look(:s) 11 | start = (knit 0.2,3, 0.9,1).tick 12 | #sample CineElec[/f#m/, /WrongPiano/, 0], amp: (ring 0.8, 0.4,0.5, 0.9).tick(:amp), start: start, finish: 1.0 13 | end 14 | if spread(1,8, rotate: 1).look :s 15 | with_fx :pitch_shift, mix: 0.1 do 16 | sample CineElec[/f#m/, /WrongPiano/, 0], amp: 1.0+rand, rpitch: (ring -32.0, -12.0).tick(:p), 17 | start: (ring 0.5, 0.5, 0.5, 0.6).tick(:bass), finish: 0.48 18 | end 19 | end 20 | if spread(1, 12).look :s 21 | sample CineElec[/f#m/, /WrongPiano/, 0], rpitch: (ring -12, -12).tick(:r), start: 0.9, finish: 1.0 22 | end 23 | 24 | if spread(1, 64).look(:s) 25 | #sample CineElec[/f#m/, /WrongPiano/, 0], amp: 0.45, start: 0.0, finish: 1.0 26 | end 27 | 28 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 29 | if spread(3, 7).tick :s2 30 | sample CineElec[/f#m/, /WrongPiano/, 0], finish: 0.9, start: 0.88, amp: 0.2, cutoff: 100 31 | end 32 | if spread(7, 11).look :s2 33 | with_fx :distortion, mix: 0.9, distort: (range 0.0, 0.5, 0.01).tick(:dis) do 34 | sample CineElec[/f#m/, /WrongPiano/, 0], start:0.9, finish: 0.88, amp: 0.2, cutoff: 130, 35 | rpitch: ([2,2,2,0,5].choose - [12,12,12].choose) 36 | end 37 | end 38 | end 39 | 40 | sleep 0.25 41 | end 42 | -------------------------------------------------------------------------------- /destination/practice/slicing.rb: -------------------------------------------------------------------------------- 1 | shader :shader, "voc.glsl", "bits.vert", "points", 5000 2 | shader :iSpaceLight, 0.4 3 | shader :iStarLight, 0.6 4 | shader :iStarMotion, 0.1 5 | shader :iSpaceLight, 0.4 6 | shader :iStarLight, 0.3 7 | #shader [:iR, :iB, :iG], 3.0 8 | shader :iForm, 1.0 9 | #shader :iDir, 1.0 10 | shader :iMotion, 0.1 11 | #shader :iWave, 0.9 12 | shader :iSize,10.1 13 | shader :iDistort, 100.0 14 | @cells = 10000 15 | live_loop :do, sync: :slept_but do 16 | # shader :iPointSize, rand*2.5 17 | with_fx(:bitcrusher, mix: 0.05, bits: 14, sample_rate: 20000) do 18 | with_fx :distortion, mix: 0.5 do 19 | # shader :vertex_settings,"lines", [@cells+=50,1000].min, 1.0 20 | puts "cells:#{@cells}" 21 | shader :decay, :iBeat, 1.2 22 | with_fx(:slicer, phase: 0.25*4, probability: 0) do 23 | sample Mountain[/subkick/,[0,0]].tick(:sample), cutoff: 50, amp: 0.2 24 | end 25 | if !spread(1,4).look(:s) 26 | sleep 0.25 27 | # sample Fraz[/kick/,[0,0]].tick(:sample), cutoff: 40+rand, amp: 0.5 28 | sleep 2-0.25 29 | else 30 | sleep 2 31 | end 32 | 33 | # shader :growing_uniform, :iForm, rrand(0.1,0.5), 0.0001 34 | 35 | if spread(1,4).tick(:s) 36 | sleep 2-0.25 37 | #shader :decay, :iDistort, rrand(0.005,0.1), 0.00001 38 | with_fx :gverb, mix: 0.01 do 39 | # sample Fraz[/kick/,[1,1]].tick(:sample), cutoff: 40, amp: 0.5+rand*0.1 40 | end 41 | sleep 0.25 42 | else 43 | sleep 2 44 | end 45 | end 46 | 47 | end 48 | end 49 | 50 | live_loop :looping_sea do 51 | with_fx(:pitch_shift, time_dis: 0.8) do 52 | sample_and_sleep Mountain[/cracklin/],rate: 0.9, amp: 0.05, cutoff: 100 53 | end 54 | end 55 | 56 | live_loop :perc, sync: :slept_but do 57 | sleep 0.25*2 58 | # with_fx(:slicer, phase: 0.25, probability: 0.5) do 59 | # with_fx(:reverb, room: 0.9, mix: 0.9, damp: 0.5) do |r_fx| 60 | # sample Dust[/hat/,0..6].tick(:sample), cutoff: 80, amp: 0.5 61 | # end 62 | 63 | #end 64 | end 65 | 66 | live_loop :slept_but do 67 | 68 | with_fx(:reverb, room: 0.5, mix: 1.0, damp: 0.5) do |r_fx| 69 | 70 | data = (ring 71 | (chord :FS3, :m), #FAC 72 | (chord :D3, :M), #DFA 73 | (chord :E3, :M), 74 | ) 75 | 76 | bass = (ring 77 | :Fs3, :E2, :A3, :E3).tick(:bass) 78 | 79 | c = data.tick(:main) 80 | puts "Chord:#{note_inspect(c)}" 81 | #shader :iSize, (rand*100)+100 82 | 83 | with_fx(:reverb, room: 0.8, mix: 0.9, damp: 0.5) do |r_fx| 84 | #sample Mountain[/bow/, ring(/F#/, /C#/).tick(:bow)], cutoff: 65, amp: 0.1 85 | end 86 | 87 | with_transpose -24 do 88 | with_fx(:slicer, phase: 0.25*4, smooth: 0.4, probability: 0, wave: 0) do 89 | synth :dark_sea_horn, 90 | note: c[0], decay: 4.0, cutoff: 70, amp: 0.35 91 | end 92 | 93 | with_transpose -12 do 94 | with_fx(:slicer, phase: 0.25*4, smooth: 0.4, probability: 0, invert_wave: 1, wave: 0) do 95 | synth :dark_sea_horn, 96 | note: c[0], decay: 4.0, cutoff: 70, amp: 0.35 97 | end 98 | end 99 | end 100 | 101 | with_transpose 0 do 102 | with_fx(:reverb, room: 0.8, mix: 1.0, damp: 0.5) do |r_fx| 103 | at do 104 | sleep 4 105 | #Look to the next chord. Anticipation 106 | synth :hollow, note: c[0], decay: 4.5, attack: 2.0, amp: 0.0 107 | # synth :dark_ambience, note: data.look(:main, offset: 1)[0], decay: 4.5, attack: 2.0, amp: 0.05 108 | end 109 | end 110 | end 111 | 112 | with_fx(:reverb, room: 0.8, mix: 0.4, damp: 0.5) do |r_fx| 113 | with_transpose -12 do 114 | # synth :prophet, note: c[0], cutoff: 60, amp: 0.25, decay: 4.0 115 | # synth :dsaw, note: c[0], cutoff: 55, amp: 0.25, decay: 4.0 116 | end 117 | end 118 | shader :iHorse, c[0] 119 | 120 | with_fx(:slicer, phase: 0.25*4, probability: 0, wave: 0, smooth: 0.1) do 121 | # synth :dark_sea_horn, note: c[1], decay: 4.0, cutoff: 65, amp: 0.1, noise1: 0.1 122 | 123 | end 124 | sleep 1 125 | 126 | with_fx(:slicer, phase: 0.25*2, probability: 0, wave: 0, smooth: 0.1, invert_wave: 1) do 127 | # synth :dark_sea_horn, note: c[2], decay: 8.0, cutoff: 60, amp: 0.1 128 | end 129 | sleep 1 130 | # synth :dark_sea_horn, note: c[0], decay: 8.0, cutoff: 60, amp: 0.1 131 | 132 | if c.length > 3 133 | # synth :dark_sea_horn, note: c[-1], decay: 4.0, cutoff: 60, amp: 0.1 134 | end 135 | 136 | sample Corrupt[/instrument/,/fx/,/f#/,[0,0,0,1]].tick(:sample), cutoff: 60, amp: 0.05 137 | #sample Fraz[/interference/,/f#m/,[2,2]].tick(:sample), cutoff: 60, amp: 0.01, beat_stretch: 16 138 | 6.times{sleep 1; control r_fx, damp: rand} 139 | end 140 | end 141 | -------------------------------------------------------------------------------- /destination/practice/sliding_melody.rb: -------------------------------------------------------------------------------- 1 | use_synth :square 2 | n = play :FS2, note_slide: 0.5, decay: 1.0 3 | control n, note: :FS4, note_slide: 0.125 4 | sleep 1 5 | play :D4, decay: 0.5 6 | #n = play :D4, note_slide: 0.5, decay: 1.0 7 | #control n, note: :D3, note_slide: 0.12 8 | 8.times{ 9 | sleep 0.25 10 | play :E4, release: 0.25 11 | 12 | } 13 | -------------------------------------------------------------------------------- /destination/practice/vertex_wrangling.rb: -------------------------------------------------------------------------------- 1 | ["samples","instruments","experiments", "log", "shaderview"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"}; _=nil 2 | #@vertex=1 3 | shader :iWave, 0.4 4 | shader :shader, "wave.glsl", "bits.vert", "points", 10000 5 | shader :iScale, 0.0001 6 | #shader :iMotion, 0.1 7 | #shader :iDistort, 0.0 8 | shader :iMotion, 0.01 9 | #@opening = 0.0 10 | #@vertex = 0¯ 11 | shader :iStarLight, 0.4 12 | #@opening = 0.00001 13 | shader :iScale, 1.9 14 | shader :iDistort, 0.8 15 | 16 | live_loop :beat do 17 | # shader :decay, :iMotion, 0.01 18 | 19 | shader :decay, :iBeat, 8.0 20 | shader :"vertex-settings", "points", [@vertex,10000].min 21 | puts "Vertices active:#{@vertex}" 22 | #shader :iDistort, [@opening,1.0].min 23 | puts "Distortion:#{@opening}" 24 | @opening += 0.01 25 | @vertex += 1000 26 | #shader :iScale, 0.09 27 | # shader :iScale, 0.89 28 | #sample ChillD[/drum_loop/,[9,9]].tick(:sample), cutoff: 80, amp: 0.5, beat_stretch: 8 29 | 30 | sleep 8 31 | # shader :decay, :iBeat, 0.2 32 | #sample CineAmbi[/kick/,9], cutoff: 100, amp: 1.0 33 | end 34 | 35 | live_loop :sop do 36 | sleep 32 37 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 38 | # sample Fraz[/coil/,/c#/,0], cutoff: 80, amp: 0.8 39 | end 40 | sleep 32 41 | end 42 | 43 | #@distort ||=0 44 | live_loop :light do 45 | sync :warm 46 | with_fx(:reverb, room: 1.0, mix: 0.8, damp: 0.5) do |r_fx| 47 | with_synth :hollow do 48 | # @distort += 0.001 49 | # shader :iDistort, @distort 50 | 51 | #shader :iMotion, rrand(0.0,0.01) 52 | 53 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 54 | # synth :prophet, note: ring(:Cs2, :E2).tick, amp: 0.5, decay: 2, cutoff: 45 55 | # synth :dsaw, note: ring(:Cs2, :E2).tick, amp: 0.5, decay: 2, cutoff: 45 56 | 57 | end 58 | 59 | # play ring(:B3).tick, amp: 2.0, decay: 4 60 | sleep 2 61 | # play ring(:CS4, :A3).tick(:r1), amp: 2.0, decay: 4 62 | # play ring(:CS3, :A2).tick(:r2), amp: 2.0, decay: 4 63 | sleep 2 64 | # play ring(:E3, :E3, :Fs3).tick(:r3), amp: 2.0, decay: 8 65 | end 66 | end 67 | end 68 | 69 | live_loop :beat do 70 | # sync :warm 71 | sample Fraz[/kick/,[0,0]].tick(:sample), cutoff: 100, amp: 1.0 72 | sleep 2 73 | 74 | with_fx :distortion do 75 | with_fx(:reverb, room: 0.9, mix: 0.4, damp: 0.5) do |r_fx| 76 | sample Fraz[/snap/,[0,0]].tick(:sample), cutoff: 70, amp: 1.0 77 | end 78 | end 79 | # sample Fraz[/kick/,[0,0]].tick(:sample), cutoff: 90, amp: 1.0 80 | sleep 2 81 | end 82 | 83 | live_loop :hats do 84 | # sync :warm 85 | if spread(3,8).tick(:s) 86 | sample Ether[/hat/,[0,0]].tick(:sample), cutoff: rrand(80,100), amp: 0.1 87 | end 88 | 89 | if spread(7,11).tick(:s) 90 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 91 | # sample Ether[/noise/,0..4].tick(:sample), cutoff: rrand(80,100), amp: 0.1 92 | 93 | end 94 | 95 | end 96 | sleep 0.25 97 | end 98 | 99 | live_loop :warm do 100 | with_fx :lpf do 101 | s,s2 = nil 102 | # @vertex += 10 103 | # shader :"vertex-settings", "points", [@vertex, 10000].min 104 | # puts "Vertices: #{@vertex}" 105 | 106 | at do 107 | ring( 4,2).tick(:time).times do 108 | # with_fx :reverb, mix: 1.0, room: 1. do 109 | # with_fx :distortion, mix: 0.2 do 110 | with_synth :gpa do 111 | play ring(_ 112 | #:A4,:A3,:B4, 113 | #:CS4,:CS3,:Fs4 114 | ).tick, wave: 7, amp: 1.0 115 | end 116 | # end 117 | # end 118 | sleep 0.25 119 | end 120 | end 121 | 122 | s3 = play ring(:Fs3).tick(:n1), cutoff: 70, amp: 0.2, decay: 8.1 123 | 124 | chords = ring( chord(:Cs3)).tick(:chpro) 125 | with_synth :dark_sea_horn do 126 | #ring( :Fs3, :As2, :CS3) 127 | s = play ring(:Fs2).tick(:n1), cutoff: 70, amp: 0.5, decay: 8.1 128 | s = play ring(:Fs1).tick(:n1), cutoff: 70, amp: 0.5, decay: 8.1 129 | end 130 | 131 | with_synth :dark_sea_horn do 132 | #ring( :E3, :Cs3, :E3) 133 | s2 = play ring(:Cs3).tick(:n), cutoff: 70, amp: 0.5, decay: 8.1 134 | end 135 | s3 = play ring(:E3).tick(:n), cutoff: 70, amp: 0.5, decay: 8.1 136 | 137 | with_synth :dark_sea_horn do 138 | #ring( :E3, :Cs3, :E3) 139 | s2 = play ring(:A3).tick(:n), cutoff: 70, amp: 0.5, decay: 8.1 140 | end 141 | 142 | sleep 2 143 | 5.times{ 144 | # shader :iDistort, @opening 145 | # @opening += 0.0001 146 | # control s, note: scale(:FS2, :minor_pentatonic).shuffle.choose 147 | sleep 1 148 | } 149 | end 150 | end 151 | -------------------------------------------------------------------------------- /destination/practice/wierd_floating_voices.rb: -------------------------------------------------------------------------------- 1 | use_bpm 90 2 | 3 | _=nil 4 | live_loop :chords do 5 | with_synth(:dark_ambience){ 6 | play (ring 7 | chord(:Fs3, "M"), 8 | chord(:As3, "M", invert: 0), 9 | chord(:Ds3, "m"), 10 | chord(:Cs3, rand(6) > 3 ? "7" : "M"), ).tick(:chords) , release: 10, attack: 4.0, detune1: (knit 5,3,12,1).tick(:d1), detune2: (knit 10,3,24,1).tick(:d2), amp: 8.0, 11 | cutoff: 80 12 | } 13 | sleep 8.0 14 | end 15 | 16 | live_loop :drums do 17 | sync :chords 18 | 2.times{sample (ring Dust[/kick/,5], Dust[/kick/,5]).tick, cutoff: (ring 130,100).tick(:c), amp: 2.0; sleep 8.0/2.0} 19 | end 20 | 21 | live_loop :voices do 22 | sync :chords 23 | sample_and_sleep Dust[/f#/,5], rate: 0.5 24 | sample_and_sleep Dust[/f#/,4] 25 | end 26 | 27 | live_loop :voice2 do 28 | sync :chords 29 | sample_and_sleep Dust[/f#/,7], cutoff: rand_i(120) 30 | end 31 | 32 | live_loop :voices do 33 | sync :chords 34 | 4.times{ 35 | sample Dust[/hat/,(ring 0,0,1,1)].tick 36 | sleep 8.0/4.0 37 | } 38 | #sample_and_sleep Dust[/f#/,4] 39 | end 40 | 41 | live_loop :growler do 42 | sync :chords 43 | synth :growl, note: (ring :Fs2, :Fs2, :Ds2, :Cs2).tick(:bass), release: 8.0 44 | end 45 | -------------------------------------------------------------------------------- /destination/practice/wobble_glitch.rb: -------------------------------------------------------------------------------- 1 | use_bpm 60 2 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5) do |r_fx| 3 | live_loop :warming do 4 | sample Frag[/f#m/,[0,0]].tick(:sample), cutoff: 60, amp: 0.3 5 | 6 | synth :dark_ambience, note: 7 | (ring chord(:A4, :M7), chord(:Cs4, :m11), chord(:As4, :M7), chord(:Fs4, :m11)).tick(:c), decay: 8.0, attack: 2.0, cutoff: 70, amp: 0.7 8 | shader :iConstrict, rand 9 | sleep 8 10 | end 11 | end 12 | 13 | 14 | live_loop :bass, sync: :warming do 15 | synth :dark_sea_horn, note: chord(:Fs1, :m)[0], cutoff: 50, decay: 8.0, amp: 0.2 16 | shader :iBeat, rand*1 17 | #shader :iR, rand*8 18 | sleep 16 19 | end 20 | 21 | live_loop :frag, sync: :warming do 22 | with_fx :wobble, phase: 8, pulse_width: 8 do 23 | sample Frag[/coil/,/f#/,8], 24 | amp: 0.4, beat_stretch: 64 25 | end 26 | shader :decay, :iMotion, 0.1, 0.001 27 | shader :iPointSize, rand 28 | sleep 12 29 | end 30 | 31 | live_loop :percussion, sync: :warming do 32 | shader :iWave, rand*10 33 | sleep 0.25 34 | if spread(7,11).tick(:s) 35 | #sample Frag[/coil/, /f#/,1], amp: 2.5, start: 0.7, finish: 0.85 36 | end 37 | if spread(3,8).tick(:s) 38 | with_fx :lpf, cutoff: 100 do 39 | sample Frag[/coil/, /f#/,3], amp: 0.2, start: 0.1, finish: 0.0 40 | end 41 | end 42 | 43 | end 44 | 45 | live_loop :kick, sync: :warming do 46 | #I'm bored of kicks 47 | sample Frag[/kick/,[0,0]].tick(:sample), cutoff: 60, amp: 0.5 48 | sample Fraz[/loop/, 1], beat_stretch: 16, amp: 0.3 49 | 50 | with_fx (ring :none, :none, :none, :echo).tick(:r) do 51 | # sample Frag[/coil/,8], cutoff: 60, amp: 0.1, start: 0.0, finish: 0.1 52 | end 53 | with_fx :wobble, phase: (ring 8.0, 4.0).tick(:w), mix: 0.2, wave: 8, cutoff_max: 100, invert_wave: (ring 1,0).tick(:i) do 54 | sample Frag[/coil/,0], cutoff: 60, amp: 0.1, start: 0.0, finish: 0.1, rpitch: -32 55 | end 56 | shader :decay, :iForm , 20.0, 0.025 57 | sleep 2 58 | 59 | sample Frag[/kick/,[0,0]].tick(:sample), cutoff: 60, amp: 0.5 60 | sleep 2 61 | end 62 | -------------------------------------------------------------------------------- /destination/space/falmouth.rb: -------------------------------------------------------------------------------- 1 | ["experiments"].each{|f| require "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}"} 2 | # A B Cs D E Fs Gs A 3 | 4 | use_bpm 60 5 | _=nil 6 | bar = 1.5 7 | 8 | live_loop :clock do 9 | cue :whole; cue :half; cue :quarter 10 | sleep bar/4.0; cue :quarter 11 | sleep bar/4.0; cue :half; cue :quarter 12 | sleep bar/4.0; cue :quarter 13 | sleep bar/4.0 14 | end 15 | 16 | live_loop :back do; with_fx :level, amp: 0.0 do; 17 | with_fx :distortion, distort: 0.0, mix: 0.0 do 18 | use_synth :sine 19 | sync :whole 20 | # with_synth(:tri){play degree(1, :A3, :major), attack: 0.25, amp: 2.15} 21 | play degree(1, :A3, :major),attack: 0.25, amp: 0.7 22 | sync :half 23 | # with_synth(:tri){play degree(5, :A3, :major), attack: 0.1, amp: 2.0} 24 | play degree(5, :A3, :major),attack: 0.1, release: 1.0 25 | end;end;end 26 | 27 | live_loop :basz do |b_idx|;with_fx :level, amp: 0.0 do 28 | use_synth :dark_ambience 29 | use_synth_defaults cutoff: 80 30 | 3.times{sync :whole} 31 | play (knit 32 | _,1, 33 | chord(:D2, 'sus4').last,2, 34 | chord_degree(1, :D2, :major).last,1, 35 | 36 | _,1, 37 | chord(:A2, 'sus4').last,2, 38 | invert_chord(chord_degree(6, :A2, :major),-2).last,1, 39 | 40 | _,1, 41 | invert_chord(chord_degree(6, :A2, :major),-1).last,1, 42 | invert_chord(chord_degree(6, :A2, :major),0).last,1, 43 | invert_chord(chord_degree(5, :A2, :major),1).last,1, 44 | ).tick(:bass), release: 8.0, attack: 0.5 45 | 46 | sync :whole if (b_idx % 4) == 3 47 | b_idx+=1 48 | end;end 49 | 50 | live_loop :doo do |d_idx|; with_fx :level, amp: 0.2 do |l_fx| 51 | 3.times{sync :whole} 52 | with_fx :distortion do |d_fx| 53 | with_fx (ring :echo).tick(:C), decay: (knit 8,3, 10,1).tick(:A) do 54 | play (knit chord(:D4, 'sus4'),3, 55 | chord_degree(1, :D4, :major),1, 56 | 57 | chord(:A3, 'sus4'),3, 58 | invert_chord(chord_degree(6, :A3, :major),-2),1, 59 | 60 | invert_chord(chord_degree(6, :A3, :major),-1),1, 61 | invert_chord(chord_degree(6, :A3, :major),0),1, 62 | invert_chord(chord_degree(3, :A3, :major),1),1, 63 | invert_chord(chord(:E4),0),1, 64 | ).tick(:B) , attack: 0.01, release: 0.5 65 | if (d_idx % 4) == 3 66 | control d_fx, mix: 0.5 67 | #control l_fx, amp: 1.0 68 | sync :whole 69 | else 70 | #control l_fx, amp: 0.8 71 | end 72 | end;end;end 73 | d_idx +=1 74 | end 75 | 76 | live_loop :back2 do with_fx :level, amp: 0.0 do 77 | play (knit chord(:A3, 'sus4'),8, 78 | chord_degree(1, :A3, :major),8).tick(:A) , attack: 0.1, release: 0.1, decay: 0.1, amp: 0.8 79 | sleep bar/4.0 80 | end;end 81 | 82 | live_loop :back2 do with_fx :level, amp: 0.0 do 83 | with_fx :pan do 84 | with_fx :distortion do 85 | with_fx :echo, phase: 0.1, decay: 0.01 do 86 | sync :quarter 87 | play (knit :B4, 3, :D5, 2).tick(:G), attack: 0.001, release: 0.3 88 | sleep bar/2.0 89 | play (knit :B4, 3, :D5, 2).tick(:G), attack: 0.001, release: 0.3 90 | sleep bar 91 | end;end;end;end;end 92 | 93 | live_loop :bass do with_fx :level, amp: 0.0 do 94 | sync :whole 95 | with_fx :reverb,room: 1.0, mix: 1.0 do 96 | play (knit chord(:D3, 'sus4').last,4, 97 | chord(:A3, 'M').last,4).tick(:G), release: bar*4, attack: bar, amp: 0.5 98 | end;end;end 99 | 100 | live_loop :ghost do; with_fx :level, amp: 0.0 do 101 | sync :whole 102 | 8.times do 103 | sample Mountain["microperc_01"], amp: 0.5, start: rrand(0.0, 0.1), beat_stretch: 8 104 | sleep bar/8.0 105 | end;end;end 106 | 107 | live_loop :apeg do; with_fx :level, amp: 0.0 do 108 | with_transpose(0) do 109 | play (ring :A3, :A3, :A3, :E3, 110 | :A3, :A3, :A3, :E3, 111 | :A3, :A3, :A3, :E3, 112 | :A3, :D3, :A3, :D3 113 | ).tick(:A) 114 | end 115 | sleep bar/8.0 116 | end;end 117 | 118 | live_loop :apeg1 do; with_fx :level, amp: 0.0 do 119 | density(3) do 120 | sample Mountain["microperc_01"], start: rrand(0.0,0.05) 121 | with_fx :pan, pan: (Math.sin(vt*13)/1.5)+0.1 do 122 | play (knit :Fs4, 4, :D4,2).tick :C 123 | sleep bar/2 124 | end;end;end;end 125 | 126 | live_loop :apeg2,autocue: false do; with_fx :level, amp: 0.0 do 127 | sync :apeg1 128 | with_fx (knit :none,3, :echo, 1).tick(:b), decay: 0.5 do 129 | sample Mountain["microperc_07"] 130 | with_fx :pan, pan: -(Math.sin(vt*13)/1.5)-0.1 do 131 | density(2) do 132 | play (knit :D4, 4, :Fs4, 2).tick :B 133 | sleep bar/2 134 | end;end;end;end;end 135 | 136 | live_loop :texture do 137 | #4.times{sync :whole} 138 | s = Mountain[(stretch scale(:A3,:major_pentatonic).map{|a| "#{a[0]}_"},1).tick(:tock)] 139 | if s 140 | puts "\n\n\n\nRUN IT #{s.split("/")[-1]}\n\n\n\n\n" 141 | sample s 142 | sleep sample_duration(s) 143 | end 144 | end 145 | -------------------------------------------------------------------------------- /destination/space/yarra_river.rb: -------------------------------------------------------------------------------- 1 | #Composed in Melbourne Australia (Not in Berlin, livecoding the-world?) 2 | #By the Yarra River 3 | 4 | bar = 1 5 | quart = 2*bar 6 | live_loop :schedule do 7 | cue :start 8 | 7.times do 9 | cue :bar 10 | sleep bar;cue :quart 11 | cue :quart 12 | sleep bar 13 | end 14 | end 15 | 16 | def say(words) 17 | sync :bar 18 | with_fx :reverb, room: 100 do 19 | with_fx :lpf do 20 | use_synth :dark_sea_horn 21 | t = scale(:a1, :major_pentatonic, num_octaves: 2).shuffle 22 | notes = words.strip.split("").map(&:ord).map{|n| t[n%t.length]} 23 | notes.map{|n| if n.chr == " " 24 | play n, release: 6, attack: 3 25 | sleep 4 26 | else 27 | play n, release: 4.0, attack: 2 28 | sleep 2.0 29 | end 30 | } 31 | end end end 32 | 33 | live_loop :poem do 34 | with_fx :level, amp: 0.2 do 35 | say <<-FOREST 36 | Tiger tiger burning bright 37 | FOREST 38 | end 39 | end 40 | 41 | live_loop :drums do 42 | use_synth :beep 43 | sync :bar 44 | sample :drum_bass_soft 45 | play :A3 46 | end 47 | 48 | live_loop :dark do; use_synth :dark_ambience; sync :bar 49 | play :A1 50 | end 51 | 52 | n_inc = 0 53 | live_loop :high do; sync :quart; use_synth_defaults release: quart 54 | use_synth :singer 55 | play chord_degree(ring(1,3,4, 1,3,5)[n_inc], :A2, :major_pentatonic) 56 | n_inc+=1 57 | end 58 | 59 | live_loop :drums do; use_synth :growl; sync :bar 60 | play degree(1, :A2, :major), release: bar 61 | sleep bar 62 | end 63 | 64 | live_loop :chords do;with_fx :level, amp: 1.0 do;sync :bar ;with_fx :reverb, room: 0.8, mix: 0.5 do 65 | with_fx :slicer, phase: bar/4.0 do 66 | use_synth :tri; use_synth_defaults decay: bar*2, release: 1, attack: 0.2, amp: 0.2 67 | play chord_degree(4, :A2, :major)[0] 68 | sleep bar/2 69 | play chord_degree(4, :A2, :major)[1..2] 70 | sync :bar 71 | play chord_degree(4, :A2, :major)[1..2] 72 | end 73 | end 74 | end 75 | end 76 | 77 | set_volume! 1.0 78 | -------------------------------------------------------------------------------- /destination/warm_up.rb: -------------------------------------------------------------------------------- 1 | ["instruments","shaderview","experiments", "log", "samples"].each{|f| load "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lib/#{f}.rb"}; _=nil 2 | 3 | with_fx(:reverb, room: 1.0, mix: 1.0, mix_slide: 0.1, damp: 0.5, damp_slide: 1) do |r_fx| 4 | live_loop :guitar do 5 | mix = rrand(0.5, 1.0) 6 | use_random_seed 300 7 | sample Corrupt[/Guitar/, /Gm/, /fx/].take(5).shuffle.tick(:sample), 8 | cutoff: rrand(80,100), amp: rand+0.01, beat_stretch: 16 9 | 32.times{ sleep 1; control r_fx, damp: rand, mix: [1.0, mix+0.01].min} 10 | end 11 | end 12 | 13 | live_loop :atoms do 14 | sleep 6 15 | sample Ether[/interference/, /Gm/, 0], cutoff: rrand(80,100), 16 | beat_stretch: 32, amp: rand+0.01 17 | sleep 10 18 | end 19 | 20 | with_fx(:reverb) do 21 | live_loop :dark do 22 | with_fx(:echo, room: 1.0, mix: 0.8, decay: 8.0, reps: 4) do 23 | n = scale(:G3, :minor_pentatonic, num_octaves: 3).take(3).shuffle 24 | 16.times{ 25 | with_transpose(-24) do 26 | synth :dark_ambience, note: n.choose, decay: 4, attack: 4.0, amp: 0.5 27 | end 28 | sleep 8 29 | synth :dark_ambience, note: n.choose, decay: 4, attack: 4.0, amp: 0.5, 30 | cutoff: 120, detune1: 12, detune2: 24 31 | sleep 8 32 | } 33 | end 34 | end 35 | end 36 | 37 | with_fx(:reverb, room: 0.6, mix: 0.4, damp: 0.5, damp_slide: 0.5) do |r_fx| 38 | live_loop :warmup do 39 | with_fx :bpf, centre: 100 do 40 | with_synth :dark_sea_horn do 41 | s = play :FS2, cutoff: 50, amp: 0.4, sustain: 4.0, decay: 12.0, note_slide: 0.02, cutoff_slide: 0.2 42 | sleep 1 43 | shader :decay, :iWave, rrand(0.0,0.5), 0.0001 44 | shader :decay, :iFat, rrand(1.0,2.0) 45 | shader :iR, rand 46 | shader :iG, rand 47 | shader :iB, rand 48 | 49 | 50 | 14.times{ 51 | sleep 1 52 | control s, note: scale("fs#{[3,3,4].choose}", :minor_pentatonic, num_octaves: 1).shuffle.choose, cutoff: 70 53 | control r_fx, damp: rand 54 | } 55 | end 56 | end 57 | end 58 | end 59 | -------------------------------------------------------------------------------- /lib/composition.rb: -------------------------------------------------------------------------------- 1 | def root(note_seq) 2 | note_seq.map{|n| note(n[0])}.compact.sort[0] 3 | end 4 | 5 | def degrees_seq(*pattern_and_roots) 6 | pattern_and_roots = pattern_and_roots.reduce([]){|accu, id| 7 | if(!accu[-1].kind_of?(Symbol) && id.kind_of?(Integer)) 8 | accu[0..-2] << "#{accu[-1]}#{id}" 9 | else 10 | accu << id 11 | end} 12 | patterns = pattern_and_roots.select{|a| /^[\d]+$/ =~ a.to_s } 13 | roots = pattern_and_roots.select{|a| /^[\d]+$/ !~ a.to_s} 14 | notes = patterns.each_with_index.map do |pattern, idx| 15 | root = roots[idx] 16 | if(root[0] == ":") 17 | root = root[1..-1] 18 | end 19 | s = /[[:upper:]]/.match(root.to_s[0]) ? :major : :minor 20 | pattern.to_s.split("").map{|d| degree(d.to_i, root, s)} 21 | end.flat_map{|x| x} 22 | (ring *notes) 23 | end 24 | 25 | def deg_seq(*pattern_and_roots) 26 | pattern_and_roots = pattern_and_roots.reduce([]){|accu, id| 27 | if(/^[\d_]+$/ =~ accu[-1] && /^[\d_]+$/ =~ id) 28 | accu[0..-2] << "#{accu[-1]}#{id}" 29 | else 30 | accu << id 31 | end} 32 | patterns = pattern_and_roots.select{|a| /^[\d_]+$/ =~ a.to_s } 33 | roots = pattern_and_roots.select{|a| /^[\d_]+$/ !~ a.to_s} 34 | notes = patterns.each_with_index.map do |pattern, idx| 35 | root = roots[idx] 36 | if(root[0] == ":") 37 | root = root[1..-1] 38 | end 39 | s = /[[:upper:]]/.match(root.to_s[0]) ? :major : :minor 40 | if(s == :minor) 41 | s = if root.to_s[1] == "h" 42 | :harmonic_minor 43 | elsif root.to_s[1] == "m" 44 | :melodic_minor 45 | else :minor 46 | end 47 | end 48 | root = root[0] + root[2..-1] if root.length > 2 49 | pattern.to_s.split("").map{|d| d == "_" ? nil : degree(d.to_i, root, s)} 50 | end.flat_map{|x| x} 51 | (ring *notes) 52 | end 53 | 54 | def chords_seq(pattern, root, s=nil) 55 | if !s 56 | s = /[[:upper:]]/.match(root.to_s[0]) ? :major : :minor 57 | end 58 | pattern.to_s.split("").map{|d| chord_degree(d.to_i, root, s)} 59 | end 60 | -------------------------------------------------------------------------------- /lib/drums.rb: -------------------------------------------------------------------------------- 1 | def dpat(s, p, delta=0, *args) 2 | sync :drum_hit 3 | case p 4 | when "x" #hit 5 | sleep(delta) if delta != 0 6 | sample *([s]+args) 7 | when "r" #random 8 | sleep(delta) if delta != 0 9 | sample *([s]+args) if dice(6) > 3 10 | end 11 | end 12 | 13 | def drum_loop(name, state, sample, *args) 14 | state = expand_pattern(state) 15 | live_loop name, auto_cue: false do 16 | dpat(sample.is_a?(SonicPi::Core::RingVector) ? sample.tick("#{name}_sample".to_sym) : sample, state.tick(name), 17 | delta=(args[0][:delta] || 0), 18 | *[args[0].reduce({}){|a,(k,v)| 19 | v.is_a?(SonicPi::Core::RingVector) ? a[k]=v.tick("#{name}_#{k}".to_sym) : a[k]=v 20 | a}]) 21 | end 22 | end 23 | 24 | def expand_pattern(pat) 25 | pat.to_a.map{|slice| 26 | case slice 27 | when /^-\*(\d+)$/ 28 | _, n = *slice.match(/^-\*(\d+)$/) 29 | ("-"*n.to_i).split("") 30 | else 31 | slice 32 | end 33 | }.flatten.ring 34 | end 35 | -------------------------------------------------------------------------------- /lib/dsp.rb: -------------------------------------------------------------------------------- 1 | require "mysql2" 2 | module Dsp 3 | def self.query(sql) 4 | SonicPi::Core::RingVector.new(Dsp.connection.query(sql,:symbolize_keys => true).to_a) 5 | end 6 | def self.connection() 7 | @@connection ||= Mysql2::Client.new(:host => "localhost", :username => "root", :database => "repl_electric_samples", :reconnect => true) 8 | end 9 | def self.connect!() 10 | @@connection = Mysql2::Client.new(:host => "localhost", :username => "root", :database => "repl_electric_samples",:reconnect => true) 11 | end 12 | end 13 | 14 | module Samples 15 | def self.sql(query="") 16 | Dsp.query("select * from samples where #{query}") 17 | end 18 | def self.find(path: nil, note: nil, max: nil, min: nil) 19 | @@cache ||= {} 20 | k = "samples[note#{note}path#{path}max#{max}min#{min}]" 21 | if !@@cache.has_key?(k) 22 | query = [] 23 | query << "path like '%#{path}%'" if name 24 | query << "note1='#{note}'" if note 25 | query << "length < #{min}" if min 26 | query << "length > #{max}" if max 27 | r = Dsp.query("select * from samples where #{query.join(" AND ")}") 28 | @@cache[k] = r 29 | end 30 | @@cache[k] 31 | end 32 | def self.flush 33 | @@cache = {} 34 | end 35 | end 36 | 37 | module SampleBeats 38 | def self.sql(query="") 39 | Dsp.query("select * from track where #{query}") 40 | end 41 | def self.find(path: nil, collection: col, filename: f) 42 | @@cache ||= {} 43 | k = "path[query]" 44 | if !@@cache.has_key?(k) 45 | query = [] 46 | query << "path='#{path}'" if path 47 | query << "collection='#{path}'" if collection 48 | query << "collection ='#{f}'" if f 49 | r = Dsp.query("select * from track where #{query.join(" AND ")} ORDER BY beat") 50 | puts "results#{r}" 51 | if r && !r.empty? 52 | beats = r.map{|r| r[:beat]} 53 | r = {beats: beats[1..-1]}.merge(r[0]) 54 | end 55 | @@cache[k] = r 56 | end 57 | @@cache[k] 58 | r 59 | end 60 | def self.flush 61 | @@cache = {} 62 | end 63 | end 64 | 65 | module NoteSlices 66 | def self.sql(query="") 67 | Dsp.query("select * from notes_fine64 where #{query}") 68 | end 69 | def self.find(root: nil, octave: nil, min: nil, max: nil, note: nil, pat: nil) 70 | @@cache = {} 71 | octave = if !note.nil? 72 | note[-1] 73 | else 74 | octave 75 | end 76 | root = if !note.nil? 77 | note[0..-2] 78 | else 79 | root 80 | end 81 | k = "noteslices[note#{root}octave#{octave}max#{max}min#{min}]" 82 | if !@@cache.has_key?(k) 83 | query = [] 84 | query << "note='#{root}'" if root 85 | query << "octave=#{octave}" if octave 86 | query << "length > #{min}" if min 87 | query << "length < #{max}" if max 88 | query << "path REGEXP '#{pat}'" if pat 89 | query = query.flatten 90 | r = Dsp.query("select * from notes_fine64 where #{query.join(" AND ")}") 91 | @@cache[k] = r 92 | end 93 | @@cache[k] 94 | end 95 | def self.flush 96 | @@cache = {} 97 | end 98 | end 99 | -------------------------------------------------------------------------------- /lib/experiments.rb: -------------------------------------------------------------------------------- 1 | class SonicPi::Core::RingVector 2 | def stretch(n) 3 | args = [self.to_a, n] 4 | res = args.each_slice(2).flat_map do |values, num_its| 5 | if !values.respond_to? :flat_map 6 | values = [values] 7 | end 8 | knit(*values.flat_map{|v| [v, num_its]}) 9 | end 10 | (res||[]).ring 11 | end 12 | 13 | def knit(*args) 14 | res = [] 15 | args.each_slice(2) do |val, num_its| 16 | if num_its > 0 17 | res = res + ([val] * num_its) 18 | end 19 | end 20 | res.ring 21 | end 22 | end 23 | 24 | def chord_seq(*args) 25 | args.each_slice(2).reduce([]){|acc, notes| 26 | chord_type = notes[1] 27 | i = 0 28 | if chord_type =~ /[abcxyz]$/ 29 | invert_char = chord_type[-1] 30 | chord_type = chord_type[0..-2] 31 | i = {'a' => 1, 'b' => 2, 'c' => 3, 32 | 'z' => -3, 'x' => -2, 'y' => -1}[invert_char] 33 | end 34 | acc += chord(notes[0],chord_type, invert: i) 35 | } 36 | end 37 | 38 | def note_to_sample(n, oct=1) 39 | if n 40 | n = n.is_a?(Integer) ? note_info(n).midi_string : n 41 | n = n.to_s 42 | n = n.split(/\d/)[0] 43 | n = n == "Eb" ? "Ds" : n 44 | n = n.gsub("s","#") 45 | /#{n}#{oct}/i 46 | else 47 | false 48 | end 49 | end 50 | 51 | def pat(s, bar, pat, *args) 52 | pat.length.times do 53 | p = ring( *pat.split("\s")) 54 | sleep bar/4.0 55 | if p.hook(:pattern_ticker) == "x" 56 | sample *([s]+args) 57 | end 58 | p.tick(:pattern_ticker) 59 | end 60 | end 61 | 62 | def deg_seq(*pattern_and_roots) 63 | pattern_and_roots = pattern_and_roots.flatten 64 | pattern_and_roots = pattern_and_roots.map{|pat| 65 | if pat =~ /\*/ 66 | note, factor = pat.split("*") 67 | ([note] * factor.to_i).join("") 68 | else 69 | pat 70 | end 71 | }.flatten 72 | 73 | pattern_and_roots = pattern_and_roots.reduce([]){|accu, id| 74 | if(/^[-\d_]+$/ =~ accu[-1] && /^[-\d_]+$/ =~ id) 75 | accu[0..-2] << "#{accu[-1]}#{id}" 76 | else 77 | accu << id 78 | end} 79 | patterns = pattern_and_roots.select{|a| /^[-\d_]+$/ =~ a.to_s } 80 | roots = pattern_and_roots.select{|a| /^[-\d_*]+$/ !~ a.to_s} 81 | 82 | notes = patterns.each_with_index.map do |pattern, idx| 83 | root = roots[idx] 84 | if(root[0] == ":") 85 | root = root[1..-1] 86 | end 87 | s = /[[:upper:]]/.match(root.to_s[0]) ? :major : :minor 88 | if(s == :minor) 89 | s = if root.to_s[1] == "h" 90 | :harmonic_minor 91 | elsif root.to_s[1] == "m" 92 | :melodic_minor 93 | else :minor 94 | end 95 | end 96 | #MESSEY 97 | root = root[0..1] + root[2..-1] if root.length > 2 98 | pattern. 99 | scan(/(\d{1}|-\d{1})/). 100 | flatten. 101 | map{|d| 102 | if(d == "_" ) 103 | nil 104 | elsif(d.to_i < 0) #Only support one octave down 105 | octave_shift = (d.to_i/10).abs 106 | new_root = root[0..-2] + (root[-1].to_i - octave_shift).to_s 107 | degree(d.to_i.abs, new_root, s) 108 | else 109 | degree(d.to_i, root, s) 110 | end} 111 | end.flat_map{|x| x} 112 | (ring *notes) 113 | end 114 | 115 | def note_seq(*patterns) 116 | patterns.reject{|a| a.empty?}. 117 | map{|a| 118 | note, factor = a.last.split("*") 119 | factor ||= "1" 120 | factor = factor.to_i 121 | a[-1] = note 122 | a.map{|s| s.gsub(/#/,"s")}. 123 | map{|s| [s.to_sym] * factor }. 124 | flatten}. 125 | flatten.ring 126 | end 127 | 128 | def sample_and_sleep(*args) 129 | if args 130 | s = args.first 131 | sample *args 132 | sleep sample_duration(s) 133 | end 134 | end 135 | 136 | def bowed_s(name, *args) 137 | s = Dir["/Users/josephwilk/Dropbox/repl-electric/samples/Bowed\ Notes/*_BowedGuitarNote_01_SP.wav"] 138 | s.sort! 139 | sample (if name.is_a? Integer 140 | s[name] 141 | else 142 | s.select{|s| s =~ /#{name}/}[0] 143 | end), *args 144 | end 145 | def live(name, opts={}, &block) 146 | idx = 0 147 | amp = if(opts[:amp]) 148 | opts[:amp] 149 | else 150 | 1 151 | end 152 | x = lambda{|idx| 153 | with_fx :level, amp: amp do 154 | block.(idx) 155 | end} 156 | live_loop name do |idx| 157 | x.(idx) 158 | end 159 | end 160 | -------------------------------------------------------------------------------- /lib/instruments.rb: -------------------------------------------------------------------------------- 1 | def i_hollow(n, *opts) 2 | defaults = {release: 8} 3 | defaults.merge(opts[0]||{}) 4 | with_fx(:reverb) do 5 | with_synth(:hollow) do 6 | with_fx :pitch_shift, pitch_dis: 0.001, time_dis: 0.1, window_size: 1.5 do 7 | # with_fx :slicer, phase: 1.0 do 8 | play n, defaults 9 | end 10 | end 11 | end 12 | end 13 | 14 | def i_float(note, *opts) 15 | defaults = {cutoff: 70, attack: 0.01, pan: (Math.sin(vt*13)/1.5), amp: 0.5, decay: 0.1 + rrand(0.1,0.2), release: ring(1.0,0.25,0.4,0.25).tick(:dasd)} 16 | defaults = defaults.merge(opts[0]||{}) 17 | with_synth(:prophet){play note, defaults} 18 | end 19 | 20 | def i_int(note, *opts) 21 | defaults = {pan: (Math.sin(vt*13)/1.5), amp: ring(0.25).tick(:sdf), decay: 0.1 + rrand(0.1,0.2), 22 | release: 0.3} #, release: (ring 1.0,0.25,0.4,0.25).tick(:dasd)} 23 | defaults = defaults.merge(opts[0]||{}) 24 | with_synth(:beep){play note, defaults} 25 | end 26 | 27 | 28 | def i_bass(note, *opts) 29 | defaults = {cutoff: 60, res: 0.5, 30 | release: knit(2.5*bar,10, 8.0*bar,1, 5.0*bar,2, 5.0*bar,1, 2.5*bar,1, 2.5*bar,1).tick(:sd), 31 | attack: knit(0.01,10, 0.15,1, 0.15,2, 0.25,1, 0.25,1, 0.01,1,).tick(:att), 32 | amp: knit(0.5,13, 0.2, 3).tick(:ampe)} 33 | defaults = defaults.merge(opts[0]||{}) 34 | with_transpose(12) do 35 | with_synth(:beep) do 36 | play note, defaults 37 | end 38 | end 39 | 40 | defaults = { 41 | amp: 1.0, release: knit(2.01*bar, 9, 8.02*bar, 2, 2.1*bar,5).tick(:Bass), 42 | attack: 0.05, cutoff: 60, res: 0.5} 43 | defaults = defaults.merge(opts[0]||{}) 44 | with_transpose(0) do 45 | with_synth :beep do 46 | play note, defaults 47 | end 48 | end 49 | end 50 | 51 | def i_deter(note1, note2, *opts) 52 | opts = opts[0] || {} 53 | defaults = {amp: 0.3} 54 | s = opts[:synth] || :beep 55 | d = opts[:mix] || 0.3 56 | fx_pattern = opts[:fx_pattern] || (knit :echo,2, :reverb,2) 57 | distort_amp = opts[:distort_amp] || 0.8 58 | 59 | damp_time = opts[:damp_time] || bar/4.0 60 | 61 | opts.delete(:fx_pattern) 62 | opts.delete(:distory_amp) 63 | opts.delete(:damp_time) 64 | 65 | werble = if opts[:werble] != nil 66 | opts[:werble] 67 | else 68 | true 69 | end 70 | 71 | defaults = defaults.merge(opts) 72 | with_fx(:lpf, cutoff: 100) do 73 | with_fx :distortion, amp: distort_amp, mix: d do 74 | with_synth(s) do 75 | with_fx fx_pattern.tick(:fx), decay: 4.0, room: 1.0 do |fx_verb| 76 | active_synth = play note1, defaults 77 | sleep damp_time 78 | control(active_synth, note: note2) if werble 79 | 80 | 2.times{ 81 | sleep damp_time 82 | if fx_verb.name =~ /reverb/ 83 | control fx_verb, damp: rrand(0.0,1.0) 84 | end 85 | } 86 | end 87 | end 88 | end 89 | end 90 | end 91 | 92 | def i_nil(n, *opts) 93 | defaults = {release: 2.0, amp: 2.0} 94 | defaults = defaults.merge(opts[0]||{}) 95 | with_synth(:hollow) do 96 | with_fx :pitch_shift, pitch_dis: 0.001, time_dis: 0.1, window_size: 1.5 do 97 | play n, defaults 98 | end 99 | end 100 | end -------------------------------------------------------------------------------- /lib/log.rb: -------------------------------------------------------------------------------- 1 | def note_inspect(n,ns="") 2 | n = [n] unless n.respond_to?(:map) 3 | if n 4 | "#{ns}[#{(n||[]).map{|n| n ? for_joes_brain(note_info(n).midi_string) : "_"}}]" 5 | else 6 | "#{ns}[ _ ]" 7 | end 8 | end 9 | 10 | def for_joes_brain(n) 11 | case n 12 | when /^Ab/ 13 | n.gsub("Ab","Gs") 14 | when /^Bb/ 15 | n.gsub("Bb", "As") 16 | when /^Eb/ 17 | n.gsub("Eb", "Ds") 18 | when /^F\d/ 19 | n.gsub("F", "Es") 20 | else 21 | n 22 | end 23 | end -------------------------------------------------------------------------------- /lib/piano.rb: -------------------------------------------------------------------------------- 1 | module Piano 2 | ROOT ="/Users/josephwilk/Dropbox/repl-electric/samples/pi/9133__neatonk__misstereopiano/" 3 | 4 | FILE_FORMAT = "148532__neatonk__piano-" 5 | TYPE = ".wav" 6 | 7 | def self.note(n, type="med") 8 | "#{ROOT}#{FILE_FORMAT}#{type}-#{n.downcase}#{TYPE}" 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/sample_instruments.rb: -------------------------------------------------------------------------------- 1 | module Harp 2 | def self.slice(n, size: 1/4.0) 3 | @harp_cache ||= {} 4 | n = n.to_s.gsub(/s/,"#") 5 | if !@harp_cache.has_key?(n) 6 | @harp_cache[n] = NoteSlices.find(note: n, max: size, pat: "harp").take(64) 7 | end 8 | @harp_cache[n] 9 | end 10 | end 11 | 12 | module Vocal 13 | def self.slice(n, size: 1/4.0) 14 | @vocal_cache ||= {} 15 | n = n.to_s.gsub(/s/,"#") 16 | if !@vocal_cache.has_key?(n) 17 | @vocal_cache[n] = NoteSlices.find(note: n, max: size, pat: "sop|alto|bass").take(64) 18 | end 19 | @vocal_cache[n] 20 | end 21 | end 22 | 23 | module Strawberry 24 | def self.slice(n, size: 1/4.0) 25 | @straw_cache ||= {} 26 | n = n.to_s.gsub(/s/,"#") 27 | if !@straw_cache.has_key?(n) 28 | @straw_cache[n] = NoteSlices.find(note: n, max: size, pat: "strawberry").take(64) 29 | end 30 | @straw_cache[n] 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/shaderview.rb: -------------------------------------------------------------------------------- 1 | #require "/Users/josephwilk/Workspace/josephwilk/c++/sonic-pi/app/server/sonicpi/lib/sonicpi/osc/osc.rb" 2 | 3 | $LOAD_PATH.unshift("/Users/josephwilk/Workspace/ruby/osc-ruby/lib/") 4 | require "osc-ruby.rb" 5 | 6 | #require 'osc-ruby' 7 | unless defined?(SHADER_ROOT) 8 | SHADER_ROOT = "/Users/josephwilk/Workspace/repl-electric/live-coding-space/lights/" 9 | end 10 | def dshader(endpoint, *args) 11 | at{sleep 0.5; shader(endpoint, *args)} 12 | end 13 | 14 | 15 | def unity(endpoint, *args) 16 | @uclient ||= OSC::Client.new('localhost', 9000) 17 | begin 18 | args = args.map{|a| a.is_a?(Symbol) ? a.to_s : a} 19 | @uclient.send(OSC::Message.new(endpoint, *args)) 20 | rescue Exception 21 | puts $! 22 | puts "$!> Graphics not loaded" 23 | end 24 | end 25 | 26 | def viz(*opts) 27 | ns="/" 28 | begin 29 | if !opts[0].is_a?(Hash) 30 | ns = "/#{opts[0].to_s}/" 31 | opts = opts[1..-1] 32 | end 33 | if opts && !opts.empty? 34 | (opts[0]||{}).keys.map{|k| 35 | if k==:camera 36 | unity "#{ns}camera/#{opts[0][k]}",1 37 | else 38 | unity "#{ns}#{k.to_s}", opts[0][k] 39 | end 40 | } 41 | else 42 | unity "#{ns[0..-2]}",1.0 #bang signal 43 | end 44 | rescue Exception 45 | puts $! 46 | end 47 | end 48 | 49 | def dviz(*args) 50 | at{sleep 0.5; viz(*args)} 51 | end 52 | 53 | def dunity(endpoint, *args) 54 | at{sleep 0.5; unity(endpoint,*args)} 55 | end 56 | 57 | def shader(endpoint, *args) 58 | if endpoint.is_a?(Array) 59 | args = if(args[0].is_a?(Array)) 60 | args[0] 61 | else 62 | args 63 | end 64 | endpoint.zip(args.cycle).each do |thing, value| 65 | shader(thing, value) 66 | end 67 | else 68 | endpoint = endpoint.to_s.gsub(/_/,"-") #Sorry 69 | if endpoint == "shader" 70 | if args && (args.count > 3) && args[-1].is_a?(Numeric) 71 | shader :uniform, :iVC, args[-1] 72 | end 73 | end 74 | 75 | if args.count == 1 && 76 | (endpoint.to_s != "shader" && #This really has to die 77 | endpoint.to_s != "vertex" && 78 | endpoint.to_s != "echo" && 79 | endpoint.to_s != "fx" 80 | ) 81 | args = [endpoint] + args 82 | endpoint = :uniform 83 | end 84 | if endpoint == :shader 85 | args[0] = "#{SHADER_ROOT}/#{args[0]}" 86 | end 87 | endpoint = "#{endpoint.to_s.gsub("smooth", "smoothed-uniform")}" 88 | endpoint = "#{endpoint.to_s.gsub("decay", "decaying-uniform")}" 89 | endpoint = "/#{endpoint}" 90 | @client ||= OSC::Client.new('localhost', 9177) 91 | begin 92 | args = args.map{|a| a.is_a?(Symbol) ? a.to_s : a} 93 | @client.send(OSC::Message.new(endpoint, *args)) 94 | rescue Exception 95 | puts $! 96 | puts "$!> Graphics not loaded" 97 | end 98 | end 99 | end 100 | 101 | def shaderinit 102 | shader :shader, "wave.glsl", "rope.vert", "points", 100000 103 | shader :iVertexCount, 100000 104 | end 105 | 106 | 107 | #shader(:shader, "nil.glsl") 108 | #shader(:uniform, "iColorFactor", 0.0) 109 | #live_loop :dance do 110 | # shader(:suniform, "iColorFactor", 2.0) 111 | # sample :drum_heavy_kick 112 | # sleep 1 113 | #end 114 | -------------------------------------------------------------------------------- /lib/soprano.rb: -------------------------------------------------------------------------------- 1 | module Sop 2 | ROOT = "/Users/josephwilk/Workspace/music/samples/soprano/Samples" 3 | 4 | def self.yehp 5 | sop1 = "#{ROOT}/Sustains/Yeh p/vor_sopr_sustain_eh_p_01.wav" 6 | sop2 = "#{ROOT}/Sustains/Yeh p/vor_sopr_sustain_eh_p_02.wav" 7 | sop3 = "#{ROOT}/Sustains/Yeh p/vor_sopr_sustain_eh_p_03.wav" 8 | sop4 = "#{ROOT}/Sustains/Yeh p/vor_sopr_sustain_eh_p_04.wav" 9 | [sop1, sop2, sop3] 10 | end 11 | 12 | def self.ahp 13 | sop1 = "#{ROOT}/Sustains/Ah p/vor_sopr_sustain_ah_p_01.wav" 14 | sop2 = "#{ROOT}/Sustains/Ah p/vor_sopr_sustain_ah_p_02.wav" 15 | sop3 = "#{ROOT}/Sustains/Ah p/vor_sopr_sustain_ah_p_03.wav" 16 | sop4 = "#{ROOT}/Sustains/Ah p/vor_sopr_sustain_ah_p_04.wav" 17 | [sop1, sop2, sop3] 18 | end 19 | 20 | end 21 | 22 | def sop(note, short=0) 23 | n = case note.to_s.downcase.to_sym 24 | when :a3 25 | 6 26 | when :c4 27 | 7 28 | when :d3 29 | 1 30 | when :e3 31 | 3 32 | when :b3 33 | 5 34 | end 35 | Sop[/vor_sopr_sustain_mm_p_0#{n}/, short] 36 | end 37 | -------------------------------------------------------------------------------- /lib/support.rb: -------------------------------------------------------------------------------- 1 | def csample(name) 2 | root = "/Users/josephwilk/Dropbox/repl-electric/samples/pi" 3 | sample_path = "#{root}/#{name}" 4 | # load_sample sample_path 5 | sample_path 6 | end 7 | 8 | def with_echo(args, &block) 9 | with_fx :echo do 10 | block 11 | end 12 | end 13 | 14 | def live(name, opts={}, &block) 15 | (@__live_cache ||= []) << name 16 | @__live_cache = @__live_cache.uniq 17 | 18 | idx = 0 19 | amp = if(opts[:amp]) 20 | opts[:amp] 21 | else 22 | 1 23 | end 24 | x = lambda{|idx| 25 | with_fx :level, amp: amp do 26 | block.(idx) 27 | end} 28 | live_loop name do |idx| 29 | x.(idx) 30 | end 31 | end 32 | 33 | 34 | def begone(name) 35 | raise "could not find #{name} to silence" unless @user_methods.method_defined?(name) 36 | 37 | __info "Silencing #{name}" 38 | 39 | define(name) do |*args| 40 | sleep 1 41 | end 42 | end 43 | 44 | def solo(name) 45 | if @user_methods.method_defined?(name) 46 | (@__live_cache - [name]).map{|n| silence(n)} 47 | else 48 | raise "could not find #{name}" 49 | end 50 | end 51 | 52 | def fadeout 53 | vol = 1 54 | while(vol >= 0) do 55 | set_volume! vol 56 | vol -= 0.08 57 | sleep 1 58 | end 59 | end 60 | 61 | DEGREES = {:i => 0, 62 | :ii => 1, 63 | :iii => 2, 64 | :iv => 3, 65 | :v => 4, 66 | :vi => 5, 67 | :vii => 6, 68 | :viii => 7, 69 | :ix => 8, 70 | :x => 9, 71 | :xi => 10, 72 | :xii => 11} 73 | 74 | def resolve_degree_index(degree) 75 | if idx = DEGREES[degree] 76 | return idx 77 | elsif degree.is_a? Numeric 78 | return degree - 1 79 | else 80 | raise InvalidDegreeError, "Invalid scale degree #{degree.inspect}, expecting #{DEGREES.keys.join ','} or a number" 81 | end 82 | end 83 | 84 | def degree(degree, tonic, scale) 85 | scale = SonicPi::Scale.new(tonic, scale) 86 | index = resolve_degree_index(degree) 87 | scale.notes[index] 88 | end 89 | -------------------------------------------------------------------------------- /lib/unity.rb: -------------------------------------------------------------------------------- 1 | $LOAD_PATH.unshift("/Users/josephwilk/Workspace/ruby/osc-ruby/lib/") 2 | require "osc-ruby.rb" 3 | 4 | def unity(endpoint, *args) 5 | @uclient ||= OSC::Client.new('localhost', 9000) 6 | begin 7 | args = args.map{|a| 8 | a = (a.is_a?(Symbol) ? a.to_s : a) 9 | a = (a == Float::INFINITY ? 0.0 : a) 10 | } 11 | @uclient.send(OSC::Message.new(endpoint, *args)) 12 | rescue Exception 13 | #puts $! 14 | #puts "$!> Graphics not loaded" 15 | end 16 | end 17 | 18 | def viz(*opts) 19 | ns="/" 20 | begin 21 | if !opts[0].is_a?(Hash) 22 | ns = "/#{opts[0].to_s}/" 23 | opts = opts[1..-1] 24 | end 25 | if opts && !opts.empty? 26 | (opts[0]||{}).keys.map{|k| 27 | if k==:camera 28 | unity "#{ns}camera/#{opts[0][k]}",1 29 | else 30 | unity "#{ns}#{k.to_s}", opts[0][k] 31 | end 32 | } 33 | else 34 | unity "#{ns[0..-2]}",1.0 #bang signal 35 | end 36 | rescue Exception 37 | puts $! 38 | end 39 | end 40 | 41 | def dviz(*args) 42 | at{sleep 0.5; viz(*args)} 43 | end 44 | 45 | def dunity(endpoint, *args) 46 | at{sleep 0.5; unity(endpoint,*args)} 47 | end 48 | -------------------------------------------------------------------------------- /lights/bits.vert: -------------------------------------------------------------------------------- 1 | uniform sampler2D iChannel0; 2 | uniform float iBeat; 3 | uniform float iPointSize; 4 | uniform float iConstrict; 5 | uniform float iMotion; 6 | uniform float iDistort; 7 | uniform float iForm; 8 | uniform float iSize; 9 | uniform float iHorse; 10 | uniform float iDir; 11 | 12 | float rand2(vec2 co){ 13 | return fract(sin(dot(co.xy, vec2(12.9898,78.233))) * 43758.5453); 14 | } 15 | 16 | vec3 posf2(float t, float i) { 17 | return vec3( 18 | sin(t+i*.9553) + 19 | sin(t*1.311+i) + 20 | sin(t*1.4+i*1.53) + 21 | sin(t*1.84+i*.76), 22 | sin(t+i*.79553+2.1) + 23 | sin(t*1.311+i*1.1311+2.1) + 24 | sin(t*1.4+i*1.353-2.1) + 25 | sin(t*1.84+i*.476-2.1), 26 | sin(t+i*.5553-2.1) + 27 | sin(t*1.311+i*1.1-2.1) + 28 | sin(t*1.4+i*1.23+2.1) + 29 | sin(t*1.84+i*.36+2.1) 30 | ) * 0.2; 31 | } 32 | 33 | vec3 posf0(float t) { 34 | return posf2(t,-1.)*3.5; 35 | } 36 | 37 | vec3 posf(float t, float i) { 38 | // float snd = texture2D(iChannel0, vec2(0.75, i)).x*0.1; 39 | //i -= (iHorse+1.0)*0.5; 40 | //t *= (iHorse+1.0)*0.5; 41 | return posf2(t*.3,i) + posf0(t); 42 | } 43 | 44 | vec3 push(float t, float i, vec3 ofs, float lerpEnd) { 45 | float snd = pow(texture2D(iChannel0, vec2(.02+.5 * ofs.x, 0.)).x, 8.); 46 | float wave = texture2D(iChannel0, vec2(ofs.x,0.75)).x *0.8; 47 | vec3 pos = posf(t,i) + ofs; 48 | 49 | //pos.x += snd2; 50 | //pos += iBeat*0.1; 51 | 52 | vec3 posf = fract(pos+.5)-.5; 53 | float l = length(posf)*2.; 54 | vec3 r = (-posf + posf/l) * (1-smoothstep(lerpEnd,1.,l)); 55 | 56 | //Lines through jumping 57 | //return 0.01*rand2(vec2(t,i))+r; 58 | 59 | if(iDistort > 0.0){ 60 | if(rand2(vec2(i,i)) > 0.5){ 61 | r.x += min(iDistort*100,199)*rand2(vec2(i,i)); 62 | } 63 | if(rand2(vec2(i,i)) < 0.2){ 64 | r.y += min(iDistort*2,0.2)*rand2(vec2(i,i)); 65 | } 66 | if(rand2(vec2(i,i)) > 0.9){ 67 | r.z -= min(iDistort*2,0.2)*rand2(vec2(i,i)); 68 | } 69 | } 70 | return r; 71 | } 72 | 73 | void main() { 74 | float time = iGlobalTime * iMotion; 75 | 76 | if(iHorse < 0){ 77 | //time = -time; 78 | } 79 | 80 | time += iBeat*0.01; 81 | float snd = pow(texture2D(iChannel0, vec2(gl_VertexID, 0.)).x, 8.); 82 | float constrict = min(iDistort+snd*0.1,1.0); 83 | float i = (gl_VertexID + cos(gl_VertexID)) * constrict; 84 | 85 | vec3 pos = posf(time,i); 86 | vec3 ofs = vec3(snd); 87 | 88 | for (float f = -10.1; f < 10.; f++) { 89 | 90 | snd = texture2D(iChannel0, vec2(f * ofs.x, 0.8)).x*0.0005; 91 | snd = 0.0; 92 | if(rand2(ofs.xy) > 0.5){ 93 | ofs += push((time+snd+f*.05)*0.1,i,ofs, 199.-exp(-f*.1)); 94 | } 95 | else{ 96 | //ofs += push((time-snd+f*.05),i,ofs, 2.-exp(-f*.1)); 97 | ofs *= push((time-snd+f*.05),i,ofs, 2.-exp(-f*.1)); 98 | } 99 | } 100 | 101 | float formWeight = iForm; 102 | 103 | //if(iHorse < 0){ 104 | // formWeight = -formWeight+0.1*iHorse + snd; 105 | //} 106 | //else{ 107 | // formWeight = formWeight+0.1*iHorse + snd; 108 | //} 109 | 110 | if(formWeight > 0.0){ 111 | ofs += push(time, i, ofs, .999) * formWeight; 112 | } 113 | 114 | 115 | 116 | pos -= posf0(time); 117 | pos += ofs; 118 | 119 | //pos.yz *= mat2(.8,9.6,-.6,.8); 120 | pos.yz *= mat2(.8, 0.6,-.6,.8); 121 | pos.xz *= mat2(.8,.6,-.6,.8); 122 | 123 | if(iSize > 0.0){ 124 | pos.z *= iSize; 125 | } 126 | 127 | //42 => fs2 78 => :FS5 128 | //float horse = smoothstep(42.0, 78.0, iHorse); 129 | if(iHorse > 0.0){ 130 | // pos.z *= iHorse; 131 | } 132 | 133 | pos *= 1.; 134 | pos.z /= 6.0; 135 | pos.xy *= 0.6/pos.z; 136 | 137 | gl_Position = vec4(pos.x, pos.y*iResolution.x/iResolution.y, 0, 1); 138 | float size = (1./pos.z)*6; 139 | if(iPointSize < 0.1){ 140 | if(mod(iGlobalTime, 128.0) > 64.0){ 141 | size = ((1./pos.z)*iPointSize)+iBeat; 142 | } 143 | } 144 | else{ 145 | size = ((1./pos.z)*iPointSize)+iBeat*5; 146 | } 147 | gl_PointSize = max(size, 0.000000001); 148 | gl_FrontColor = vec4(abs(normalize(ofs))*.3+.7,1); 149 | } 150 | -------------------------------------------------------------------------------- /lights/fractal.glsl: -------------------------------------------------------------------------------- 1 | uniform float iBeat; 2 | uniform float iIt; 3 | uniform float iColor; 4 | uniform float iZoom; 5 | uniform sampler2D iChannel0; 6 | 7 | vec3 hsvToRgb(float mixRate, float colorStrength){ 8 | float colorChangeRate = 18.0; 9 | float time = fract(iGlobalTime*0.05/colorChangeRate); 10 | float movementStart = (mod(iGlobalTime*0.05,16) == 0) ? 1.0 : 0.5; 11 | vec3 x = abs(fract((mod(iGlobalTime*0.05,16)-1+time) + vec3(2.,3.,1.)/3.) * 6.-3.) - 1.; 12 | vec3 c = clamp(x, 0.,1.); 13 | //c = c*iBeat; 14 | //c = c * clamp(iBeat, 0.1, 0.4)+0.6; 15 | return mix(vec3(1.0), c, mixRate) * colorStrength; 16 | } 17 | 18 | vec4 lineDistort(vec4 cTextureScreen, vec2 uv1){ 19 | float sCount = 900.; 20 | float nIntensity=0.1; 21 | float sIntensity=0.2; 22 | float noiseEntry = 0.0; 23 | float accelerator= 1000.0; 24 | 25 | // sample the source 26 | float x = uv1.x * uv1.y * iGlobalTime * accelerator; 27 | x = mod( x, 13.0 ) * mod( x, 123.0 ); 28 | float dx = mod( x, 0.05 ); 29 | vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx * 100.0, 0.0, 1.0 ); 30 | // get us a sine and cosine 31 | vec2 sc = vec2( sin( uv1.y * sCount ), cos( uv1.y * sCount ) ); 32 | // add scanlines 33 | cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity; 34 | 35 | // interpolate between source and result by intensity 36 | cResult = cTextureScreen.rgb + clamp(nIntensity, noiseEntry,1.0 ) * (cResult - cTextureScreen.rgb); 37 | 38 | return vec4(cResult, cTextureScreen.a); 39 | } 40 | 41 | // by Nikos Papadopoulos, 4rknova / 2015 42 | // Mashed horrible by Joseph Wilk 43 | // Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. 44 | vec4 fractal(vec2 uv){ 45 | float time = iGlobalTime*.0008; 46 | float k = cos(time); 47 | float l = sin(time*iZoom)*iZoom; 48 | float s = .2; 49 | for(int i=0; i 0.0){ 61 | rWeight = iR; 62 | } 63 | if(iG < 0.0 || iG > 0.0){ 64 | gWeight = iG; 65 | } 66 | if(iB < 0.0 || iB > 0.0){ 67 | bWeight = iB; 68 | } 69 | wave.x *= rWeight; 70 | wave.y *= gWeight; 71 | wave.z *= bWeight; 72 | return wave; 73 | } 74 | 75 | void main(void){ 76 | vec2 c = gl_FragCoord.xy / iResolution.xy; 77 | gl_FragColor = lineDistort(oldmain(), c); 78 | } 79 | --------------------------------------------------------------------------------