├── .gitignore ├── LICENSE.md └── sonic-pi ├── byte └── common │ └── 2020-11-21 │ ├── README.md │ ├── buffer 0.rb │ ├── buffer 1.rb │ ├── buffer 2.rb │ ├── buffer 3.rb │ ├── buffer 4.rb │ ├── buffer 5.rb │ ├── snippets │ ├── fx │ │ └── sliding │ │ │ └── internal │ │ │ └── fx sl th.sps │ └── syntax │ │ └── synth.sps │ └── utility functions.rb ├── noizemaschin!! ├── 105 │ ├── README.md │ └── noizemaschin!! #105 - mellow.txt └── README.md ├── sonic-pi-monthly-challenge ├── December-2020 │ └── Teach-Yourself-Irish-Breakbeats.rb └── README.md ├── splashed ├── splashed_part1.txt └── splashed_part2.txt ├── synthtober_2018 ├── 2018_10_01_minor_chill.rb ├── README.md ├── ten.rb └── wrap_beats.rb └── toplap15 ├── README.md ├── buffer0.rb ├── buffer1.rb ├── buffer2.rb ├── buffer3.rb ├── buffer4.rb ├── buffer5.rb ├── buffer6.rb ├── buffer7.rb └── buffer8.rb /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .AppleDouble 3 | .LSOverride 4 | 5 | # Icon must end with two \r 6 | Icon 7 | 8 | 9 | # Thumbnails 10 | ._* 11 | 12 | # Files that might appear in the root of a volume 13 | .DocumentRevisions-V100 14 | .fseventsd 15 | .Spotlight-V100 16 | .TemporaryItems 17 | .Trashes 18 | .VolumeIcon.icns 19 | 20 | # Directories potentially created on remote AFP share 21 | .AppleDB 22 | .AppleDesktop 23 | Network Trash Folder 24 | Temporary Items 25 | .apdisk 26 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright 2020 Ethan Crawford 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /sonic-pi/byte/common/2020-11-21/README.md: -------------------------------------------------------------------------------- 1 | # Performance for COMMON 21.NOV.2020 2 | 3 | ## What's in this directory 4 | The files here are the source code for my 1 hour live coding performance during the Currents.fm COMMON 21.NOV.2020 event, as part of the Byte live coding collective. 5 | This includes the code that was manipulated in each buffer inside Sonic Pi at the time, as well as code in several supporting files used but not modified during the performance. 6 | The files each named 'buffer X.rb' contain the manipulated code in its end-of-performance state. 7 | 8 | Some extra comments have been added after the fact. These hopefully explain the most significant parts of the code in relation to custom functions and behaviour specific to this performance. 9 | While the code and inserted comments are hopefully sufficient, if you still have questions feel free to contact me as seen further down. 10 | 11 | ## Minimum Sonic Pi version required 12 | [v3.2.1](https://github.com/sonic-pi-net/sonic-pi/releases/tag/v3.2.1) (for a correctly functioning `:ping_pong` fx). 13 | 14 | ## How to use this code in Sonic Pi 15 | If you wish to test this code inside Sonic Pi yourself, you could follow the below steps: 16 | - Ensure that the utility functions are in memory and ready to use. There are several ways to do this, but the quickest is to copy the contents of the file 'utility functions.rb' into a spare buffer in Sonic Pi and hit `Run`. Alternatively, you could choose to do it in a way that does not use up a spare buffer - by using the Sonic Pi start-up file `init.rb` in your `.sonic-pi` directory and using `run_file` in it for example. 17 | - Copy the contents of files 'buffer 0.rb', 'buffer 1.rb', 'buffer 2.rb', 'buffer 3.rb', 'buffer 4.rb' and 'buffer 5.rb' into the corresponding buffers in Sonic Pi. Everything you need to reproduce the same kind of sounds as in the original performance will now be ready. (Keeping in mind again that the code is of course in its _end-of-performance_ state). 18 | - For the sake of completeness, the snippets used in the performance are also available. If you wish to use these, place the snippets folder in a location of your choosing, and in a Sonic Pi buffer (or using the `init.rb` file again) load the snippets into memory by running code similar to the following: `load_snippets('path/to/your/snippets/folder')`. The snippets will then be available when typing in Sonic Pi. 19 | 20 | ## Corresponding audio/visual media 21 | The original video recording of this performance can be found on YouTube at [https://www.youtube.com/watch?v=PImAqLc3TN8](https://www.youtube.com/watch?v=PImAqLc3TN8). 22 | 23 | ## Contacting me 24 | If you have questions or comments about this source code, feel free to find me on the [Sonic Pi community forum](https://in-thread.sonic-pi.net) (@ethancrawford), or create an issue on [my live coding GitHub repository](https://github.com/ethancrawford/live-coding). 25 | -------------------------------------------------------------------------------- /sonic-pi/byte/common/2020-11-21/buffer 0.rb: -------------------------------------------------------------------------------- 1 | # The below (commented out) command was purely to bump up the volume 2 | # as a workaround for an apparent limitation with my virtual sound device 3 | #set_mixer_control! amp: 2 4 | 5 | use_bpm 132 6 | 7 | live_loop :met do 8 | sleep 2 9 | end 10 | 11 | # Used to store scale information for the degs2ns function 12 | set(:r, [:d2, :major]) 13 | 14 | #s = sth sq, a 0.3, n ns.lk, sus ds.lk, co 70 15 | live_loop :one1, sync: :met do 16 | #stop 17 | level(:one1, 0) do 18 | ##| ns = degs2ns((ring 5, 4, 2, 5)) 19 | ##| ns = degs2ns((ring 1, 2, 6, 8)) 20 | ##| ns = degs2ns((ring 8, 6, 3, 4)) 21 | ##| ds = (knit 8, 4) 22 | ns = degs2ns((ring 1)) 23 | ds = (ring 32) 24 | with_fx :reverb, room: 1 do 25 | with_fx :compressor, slope_above: 0.4, threshold: 0.1, slope_below: 1.2 do 26 | with_fx :flanger, phase: 8, depth: 1, feedback: 0.5, delay: 10, decay: 5, amp: 1 do 27 | with_fx :echo, phase: 1, decay: 16, mix: 0.25 do 28 | with_fx :bitcrusher, sample_rate: 3000, cutoff: 90, mix: 0.5 do 29 | with_fx :bpf, centre: 90, cutoff: 90, mix: 0.8 do 30 | ns.length.times do 31 | tick 32 | s = synth :square, amp: 0.3, note: ns.look, sustain: ds.look, cutoff: 70 33 | 34 | control s, cutoff_slide: 1, cutoff: 100 35 | sleep 1 36 | control s, cutoff_slide: 1, cutoff: 80 37 | sleep ds.look - 1 38 | end 39 | end 40 | end 41 | end 42 | end 43 | end 44 | end 45 | end 46 | end 47 | # (Commented out below): 48 | # As soon as the :one1 live_loop has completed its current loop, 49 | # slide the amp value of the level fx used above (named :one1_lv) over 64 beats 50 | # to a value of 1, and do not 'snap' the value back afterwards. 51 | # (Similar calls like this in the rest of the code follow the same pattern). 52 | ##| sync :one1 53 | ##| slide(:one1_lv, 64, false, amp: 1) 54 | 55 | 56 | #s = sth tb, rs 0.4, a 0.3, n ns.lk + 12, sus ds.lk, co 70 57 | live_loop :one2, sync: :one1 do 58 | #stop 59 | level(:one2, 0) do 60 | ns = degs2ns((ring 5, 4, 2, 5)) 61 | ##| ns = degs2ns((ring 1, 2, 6, 8)) 62 | ##| ns = degs2ns((ring 8, 6, 3, 4)) 63 | ds = (knit 8, 4) 64 | ##| ns = degs2ns((ring 1)) 65 | ##| ds = (ring 32) 66 | with_fx :reverb, room: 1 do 67 | with_fx :compressor, slope_above: 0.4, threshold: 0.1, slope_below: 1.2 do 68 | with_fx :flanger, phase: 8, depth: 1, feedback: 0.5, delay: 10, decay: 5, amp: 1 do 69 | with_fx :echo, phase: 1, decay: 16, mix: 0.25 do 70 | with_fx :bpf, centre: 90, cutoff: 90, mix: 0.9 do 71 | ns.length.times do 72 | tick 73 | s = synth :tb303, amp: 0.3, res: 0.4, note: ns.look + 12, sustain: ds.look, cutoff: 70 74 | 75 | control s, cutoff_slide: 1, cutoff: 90 76 | sleep 1 77 | control s, cutoff_slide: 1, cutoff: 80 78 | sleep ds.look - 1 79 | end 80 | end 81 | end 82 | end 83 | end 84 | end 85 | end 86 | end 87 | ##| sync :one2 88 | ##| slide(:one2_lv, 64, false, amp: 1) 89 | 90 | #s = sth saw, a 0.3, n ns.lk + 36, rel ds.lk, co 80 91 | live_loop :one3, sync: :met do 92 | #stop 93 | level(:one3, 0) do 94 | with_fx :reverb, room: 1 do 95 | with_fx :ping_pong, phase: 0.75, feedback: 0.75, mix: 0.75 do 96 | ns = degs2ns((ring 3, 1, :r, 2, 3, 1, :r, 3, :r, 4, 1, :r, 3, 5, 2, :r)) 97 | ds = (ring 0.25, 0.25, 0.5, 0.75, 0.25, 0.25, 1, 0.5, 1, 0.25, 0.25, 0.75, 0.25, 0.5, 0.25, 1) 98 | ns = degs2ns((ring 2, 4, :r, 1, 5, 2, :r, 4, :r, 1, 3, :r, 4, 2, 1, :r)) 99 | ds = (ring 0.25, 0.25, 0.5, 0.75, 0.25, 0.25, 1, 0.5, 1, 0.25, 0.25, 0.75, 0.25, 0.5, 0.25, 1) 100 | num = rrand(4, ns.length) 101 | ns = ns.take(num) 102 | ds = ds.take(num) 103 | ns.length.times do 104 | tick 105 | s = synth :saw, amp: 0.3, note: ns.look + 36, release: ds.look, cutoff: 80 106 | 107 | control s, cutoff_slide: 0.25, cutoff: 70 108 | sleep ds.look 109 | end 110 | tick_reset 111 | end 112 | end 113 | end 114 | end 115 | ##| sync :one3 116 | ##| slide(:one3_lv, 64, false, amp: 1) 117 | 118 | # s elec_filt_snare, a 3, at 0.1, b_s 16, hp 110 119 | live_loop :one4, sync: :one1 do 120 | #stop 121 | level(:one4, 0) do 122 | sample :elec_filt_snare, amp: 3, attack: 0.1, beat_stretch: 16, hpf: 110 123 | sleep 32 124 | end 125 | end 126 | ##| sync :one4 127 | ##| slide(:one4_lv, 64, false, amp: 1) 128 | 129 | # s loop_mehackit1, a 0.8, on hs.lk, hp rr(60, 100), pn rr(-1, 1), onst pk 130 | live_loop :one5, sync: :one1 do 131 | #stop 132 | level(:one5, 0) do 133 | use_random_seed 5976 134 | hs = (spread 14, 16).shuffle 135 | hs.length.times do 136 | tick 137 | sample :loop_mehackit1, amp: 0.8, on: hs.look, hpf: rrand(60, 100), pan: rrand(-1, 1), onset: pick 138 | sleep 0.25 139 | end 140 | end 141 | end 142 | ##| sync :one5 143 | ##| slide(:one5_lv, 64, false, amp: 1) 144 | 145 | # s bd_mehackit, a 0.4, on hs.lk, lp rr(60, 90) 146 | live_loop :one6, sync: :one5 do 147 | #stop 148 | level(:one6, 0) do 149 | use_random_seed 2 150 | hs = (spread 4, 16).shuffle 151 | with_fx :echo, phase: 1, mix: 0.25 do 152 | hs.length.times do 153 | tick 154 | sample :bd_mehackit, amp: 0.4, on: hs.look, lpf: rrand(60, 90) 155 | sleep 0.25 156 | end 157 | end 158 | end 159 | end 160 | ##| sync :one6 161 | ##| slide(:one6_lv, 64, false, amp: 1) 162 | 163 | # sth subp, a 0.35, n ns.lk(:n) + 24, rel ds.look, pn 0.25 164 | live_loop :one7, sync: :one5 do 165 | #stop 166 | level(:one7, 0) do 167 | use_random_seed 57537 168 | # Set a variable to a random value controlled by a seed 169 | # specific only to the with_random_seed block 170 | # (so that random values elsewhere in this live_loop are not affected by it) 171 | f = with_random_seed 4625 + look do 172 | [2, 4].choose 173 | end 174 | ns = degs2ns((ring 3, 1, 6, f).stretch(16)) 175 | ds = (ring 0.25) 176 | hs = (spread 8, 16).shuffle.repeat(4) 177 | with_fx :reverb, room: 1 do 178 | with_fx :echo, phase: 0.75, decay: 16, mix: 0.5 do |ec| 179 | with_fx :wobble, filter: 1, phase: 16, wave: 2, mix: 0.8, cutoff_min: 60, cutoff_max: 100 do |wb| 180 | if one_in(3) 181 | with_random_seed 3457 + look do 182 | control ec, decay: rrand(4, 16) 183 | control wb, mix: rrand(0, 1) 184 | control wb, cutoff_min: rrand(60, 80), cutoff_max: rrand(90, 100) 185 | control wb, invert_wave: (ring 0, 1).choose 186 | control wb, wave: (ring 0, 1, 2, 3).choose 187 | control wb, phase: (ring 4, 8, 16).choose 188 | end 189 | end 190 | hs.length.times do 191 | tick 192 | if hs.look 193 | tick(:n) 194 | synth :subpulse, amp: 0.35, note: ns.look(:n) + 24, release: ds.look, pan: 0.25 195 | 196 | end 197 | sleep ds.look 198 | end 199 | end 200 | end 201 | end 202 | end 203 | end 204 | ##| sync :one7 205 | ##| slide(:one7_lv, 64, false, amp: 1) 206 | -------------------------------------------------------------------------------- /sonic-pi/byte/common/2020-11-21/buffer 1.rb: -------------------------------------------------------------------------------- 1 | # The below line was just a way for me to remind myself about 2 | # which loops to leave running in the transition between pieces 3 | # (loops one5 and one6, out of 7 live_loops in buffer 0) 4 | # Similar lines in the rest of the code mean the same thing. 5 | 6 | # 7, one5, one6 -> 7 | 8 | # Here is where I used slide to fade out the desired loops 9 | #slide([:one5_lv,:one6_lv], 64, false, amp: 0) 10 | 11 | use_bpm 132 12 | 13 | live_loop :met do 14 | sleep 2 15 | end 16 | 17 | live_loop :two1, sync: :met do 18 | #stop 19 | level(:two1, 0) do 20 | use_random_seed 45016 21 | hs = (spread 28, 32).shuffle.pick(7) 22 | hs = hs + hs.pick(4) 23 | ss = sample_names(:tabla).pick(5) 24 | with_fx :ping_pong, phase: 0.75, feedback: 0.9, mix: 0.5 do 25 | with_fx :tanh, mix: 0.2 do 26 | hs.length.times do 27 | tick 28 | sample ss.look, amp: rrand(0.1, 0.2), on: hs.look, beat_stretch: rrand(0.5, 1), lpf: rrand(80, 120), pan: rrand(-1, 1) 29 | sleep 0.25 30 | end 31 | end 32 | end 33 | end 34 | end 35 | ##| sync :two1 36 | ##| slide(:two1_lv, 64, false, amp: 1) 37 | 38 | # s ss.lk(s), a 0.5, on hs.lk, b_s rr(1, 2) 39 | live_loop :two2, sync: :two1 do 40 | #stop 41 | level(:two2, 0) do 42 | use_random_seed 600241 43 | hs = (bools 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0) 44 | #hs = (bools 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1) 45 | ss = sample_names(:bd).pick(4) 46 | with_random_seed 2345 + look do 47 | ss = ss.shuffle 48 | end 49 | hs.length.times do 50 | tick 51 | tick(:s) if hs.look 52 | sample ss.look(:s), amp: 0.5, on: hs.look, beat_stretch: rrand(1,2) 53 | sleep 0.25 54 | end 55 | end 56 | end 57 | ##| sync :two2 58 | ##| slide(:two2_lv, 64, false, amp: 1) 59 | 60 | # sth dtri, a 0.2, n ns.look, co 80 61 | # sth tri, a 0.4, n ns.look + 19, co 70 62 | # sth tri, a 0.2, n ns.look - 24.1, co 80 63 | # sth sine, a 0.2, n ns.look + 12 64 | # sth hollow, a 5, n ns.look + 19, co 110 65 | live_loop :two3, sync: :two1 do 66 | #stop 67 | level(:two3, 0) do 68 | ns = (ring :fs4) 69 | ds = (ring 16) 70 | with_fx :reverb, room: 1 do 71 | with_fx :rlpf, cutoff: 60, mix: 1, amp: 1.5 do 72 | with_fx :rbpf, centre: 75, amp: 1.5 do 73 | use_synth_defaults attack: ds.look / 2.0, release: ds.look / 2.0 74 | ns.length.times do 75 | tick 76 | synth :dtri, amp: 0.2, note: ns.look, cutoff: 80 77 | synth :tri, amp: 0.4, note: ns.look + 19, cutoff: 70 78 | synth :tri, amp: 0.2, note: ns.look - 24.1, cutoff: 80 79 | synth :sine, amp: 0.2, note: ns.look + 12 80 | synth :hollow, amp: 5, note: ns.look + 19, cutoff: 110 81 | sleep ds.look 82 | end 83 | end 84 | end 85 | end 86 | end 87 | end 88 | ##| sync :two3 89 | ##| slide(:two3_lv, 64, false, amp: 1) 90 | 91 | # s = snth pre_b, a 0.25, n ns.lk, sus ds.lk 92 | live_loop :two4, sync: :two1 do 93 | #stop 94 | level(:two4, 0) do 95 | ns = (ring [:fs2, :cs5], [:fs4, :cs3], :r) 96 | #ns = (ring [:fs2, :cs5], [:fs4, :e3], :r) 97 | #ns = (ring [:fs2, :cs5], [:fs3, :b2], :r) 98 | #ns = (ring [:fs2, :cs5], [:a3, :d2], :r) 99 | ds = (ring 0.25, 0.25, 15.5) 100 | with_fx :reverb, room: 1 do 101 | with_fx :ping_pong, phase: 0.75, feedback: 0.75, mix: 0.75 do 102 | ns.length.times do 103 | tick 104 | s = synth :pretty_bell, amp: 0.25, note: ns.look, sustain: ds.look 105 | 106 | control s, cutoff_slide: 0.25, cutoff: 60 107 | sleep ds.look 108 | end 109 | end 110 | end 111 | end 112 | end 113 | ##| sync :two4 114 | ##| slide(:two4_lv, 64, false, amp: 1) 115 | 116 | # sth noise, a (ln 0, 1, stps 256, inc true).lk, sus ds.look/3.0, rel 0, co (ln 60,90,stps 256, inc true).lk 117 | live_loop :two5, sync: :two4 do 118 | #stop 119 | #sync :two4 120 | level(:two5, 0) do 121 | ds = (ring 0.25).stretch(256) 122 | ds.length.times do 123 | tick 124 | synth :noise, amp: (line 0, 1, steps: 256, inclusive: true).look, sustain: ds.look / 3.0, release: 0, cutoff: (line 60, 90, steps: 256, inclusive: true).look 125 | sleep ds.look 126 | end 127 | cue :b 128 | end 129 | end 130 | ##| sync :two5 131 | ##| slide(:two5_lv, 64, false, amp: 1) 132 | 133 | # The below sync and slide were my attempt to slide the :tanh fx 134 | # in the following live_loop 135 | #sync :two6 #sync slide to a cue 136 | #slide(:two6_th, 64, false, mix: [0,1]) 137 | 138 | live_loop :two6, sync: :two2 do 139 | #stop 140 | level(:two6, 0) do 141 | # Track which sequence to use in the melody 142 | seq2 = true 143 | # Assign notes and durations depending on current sequence 144 | # Not the best ruby code - I was writing this in a hurry ;p 145 | # ns = seq1 notes, nss = seq2 notes, ds = durations 146 | ns, nss2, ds = if seq2 == true 147 | [ 148 | ns = ((knit :fs2, 11) + (knit :fs2, 10)).mirror, 149 | nss = (ring :fs2, :fs2, :d2, :fs2, :fs2, :fs2, :a2, :fs2), 150 | ds = (knit 0.75, 10, 0.5, 1) + (knit 0.75, 9, 1.25, 1) + (knit 0.75, 9, 1.25, 1) + (knit 0.75, 10, 0.5, 1) 151 | ] 152 | else 153 | [ 154 | ns = (knit :fs2, 4, :r, 1).repeat(8), 155 | nil, 156 | ds = (knit 0.75, 3, 0.5, 1, 1.25, 1).repeat(8) 157 | ] 158 | end 159 | 160 | with_fx :ping_pong, phase: 0.375, feedback: 0.75, mix: 0.75 do 161 | # th m 1, kr 20, a 0.45 162 | # Set the initial value of the tanh slide variable 163 | set(:two6_th_mix, 0) 164 | with_fx :tanh, mix: get(:two6_th_mix) do |th| 165 | # Store the tanh fx node to manipulate elsewhere 166 | set(:two6_th, th) 167 | tick(:s) if look == 0 && look(:s) == 0 && seq2 168 | ns.length.times do 169 | tick 170 | n = seq2 ? nss.look(:s) : ns.look 171 | s = synth :fm, amp: 0.15, note: n, release: ds.look + 0.5, cutoff: 120, depth: 1, divisor: 2 172 | s2 = synth :fm, amp: 0.08, note: n+12, release: ds.look + 0.5, cutoff: 120, depth: 1, divisor: 4, pan: -0.5 173 | s3 = synth :fm, amp: 0.08, note: n+19, release: ds.look + 0.5, cutoff: 120, depth: 1, divisor: 2, pan: 0.5 174 | if seq2 && look == (ring 10, 20, 30, 41).look(:s) 175 | tick(:s) 176 | control s, note_slide: ds.look + 0.5, note: nss.look(:s) 177 | control s2, note_slide: ds.look + 0.5, note: nss.look(:s) + 12 178 | control s3, note_slide: ds.look + 0.5, note: nss.look(:s) + 19 179 | end 180 | control s, cutoff_slide: 0.25, cutoff: 90 181 | control s2, cutoff_slide: 0.25, cutoff: 90 182 | control s3, cutoff_slide: 0.25, cutoff: 90 183 | sleep ds.look 184 | end 185 | tick_reset if seq2 && look(:s) % 4 == 0 186 | 187 | end 188 | end 189 | end 190 | end 191 | ##| sync :two6 192 | ##| slide(:two6_lv, 64, false, amp: 1) 193 | 194 | # s bd_tek, a 0.5, on hs.lk 195 | live_loop :two7, sync: :two1 do 196 | #stop 197 | level(:two7, 0) do 198 | # Wait for a :b cue if this is the first time this loop has run 199 | sync :b if look == 0 200 | 201 | hs = (bools 1, 0, 0, 0, 1, 0, 0, 0) 202 | hs.length.times do 203 | tick 204 | sample :bd_tek, amp: 0.5, on: hs.look 205 | sleep 0.25 206 | end 207 | end 208 | end 209 | ##| sync :two7 210 | ##| slide(:two7_lv, 64, false, amp: 1) 211 | -------------------------------------------------------------------------------- /sonic-pi/byte/common/2020-11-21/buffer 2.rb: -------------------------------------------------------------------------------- 1 | # 7, two1, two7 -> 2 | 3 | #slide([:two1_lv,:two7_lv], 64, false, amp: 0) 4 | 5 | use_bpm 132 6 | 7 | live_loop :met do 8 | sleep 2 9 | end 10 | 11 | # s ss.lk, a rr(0.35, 0.6), on hs.lk, b_s rr(0.5, 1), lp rr(80, 120), pn rr(-1, 1) 12 | live_loop :three1, sync: :met do 13 | #stop 14 | level(:three1, 0) do 15 | use_random_seed 78916#90226#78916#142561 16 | hs = (spread 28, 32).shuffle 17 | ss = sample_names(:tabla).pick(3) 18 | hs.length.times do 19 | tick 20 | sample ss.look, amp: rrand(0.35, 0.6), on: hs.look, beat_stretch: rrand(0.5, 1), lpf: rrand(80, 120), pan: rrand(-1, 1) 21 | sleep 0.25 22 | end 23 | end 24 | end 25 | ##| sync :three1 26 | ##| slide(:three1_lv, 64, false, amp: 1) 27 | 28 | 29 | # s bd_haus, a 0.5, on hs.lk 30 | live_loop :three2, sync: :three1 do 31 | #stop 32 | level(:three2, 0) do 33 | #use_random_seed 30768 34 | hs = (bools 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0) 35 | hs.length.times do 36 | tick 37 | sample :bd_haus, amp: 0.5, on: hs.look 38 | sleep 0.25 39 | end 40 | end 41 | end 42 | ##| sync :three2 43 | ##| slide(:three2_lv, 64, false, amp: 1) 44 | 45 | # s drum_cymbal_closed, a 0.5, on hs.lk, hp 105 46 | live_loop :three3, sync: :three1 do 47 | #stop 48 | level(:three3, 0) do 49 | hs = (bools 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0) 50 | hs.length.times do 51 | tick 52 | sample :drum_cymbal_closed, amp: 0.5, on: hs.look, hpf: 105 53 | sleep 0.25 54 | end 55 | end 56 | end 57 | ##| sync :three3 58 | ##| slide(:three3_lv, 64, false, amp: 1) 59 | 60 | # s drum_snare_soft, on hs.lk, rt rr(1, 4) 61 | live_loop :three4, sync: :three1 do 62 | #stop 63 | level(:three4, 0) do 64 | use_random_seed (knit 67260, 3, 43737, 1).tick(:r) 65 | hs = (spread 10, 16).shuffle 66 | hs.length.times do 67 | tick 68 | sample :drum_snare_soft, on: hs.look, rate: rrand(1, 4) 69 | sleep 0.25 70 | end 71 | end 72 | end 73 | ##| sync :three4 74 | ##| slide(:three4_lv, 64, false, amp: 1) 75 | 76 | # s = sth saw, a 0.5, n ns.look, rel ds.lk, co 100 77 | # s2 = sth sq, a 0.2, n ns.look - 0.1, rel ds.lk, co 70 78 | live_loop :three5, sync: :three1 do 79 | #stop 80 | level(:three5, 0) do 81 | ns = (ring :r, :e4, :b3, :e3, :r) 82 | ds = (ring 4, 1, 1, 1, 8) 83 | ns = (scale :d3, :major, num_octaves: 1).shuffle.take(3).repeat(8) 84 | ds = (ring 0.5) 85 | with_fx :reverb, room: 1 do 86 | with_fx :tanh, mix: 0, amp: 0.5 do |th| 87 | with_fx :echo, phase: 0.75, decay: 8, mix: 0.9 do 88 | with_fx :rhpf, cutoff: 70, mix: 0.5 do |hp| 89 | ns.length.times do 90 | tick 91 | s = synth :saw, amp: 0.5, note: ns.look, release: ds.look, cutoff: 100 92 | synth :square, amp: 0.2, note: ns.look - 0.1, release: ds.look, cutoff: 70 93 | control s, cutoff_slide: 0.25, cutoff: 70 94 | sleep ds.look 95 | end 96 | end 97 | end 98 | end 99 | end 100 | end 101 | end 102 | ##| sync :three5 103 | ##| slide(:three5_lv, 64, false, amp: 1) 104 | 105 | # sth dark_a, a 1, n ns.lk 106 | # sth holl, a 0.4, n ns.lk + 12, cutoff: 100 107 | # sth subp, a 0.8, n ns.sh.look - 24, pan: -0.25 108 | # sth subp, a 0.5, n ns.sh.look - 12, pan: 0.25 109 | live_loop :three6, sync: :three5 do 110 | #stop 111 | level(:three6, 0) do 112 | ns = (scale :d3, :major).shuffle.pick(3) 113 | ds = (ring 8) 114 | use_synth_defaults sustain: ds.look, release: 0 115 | with_fx :compressor, slope_above: 0.3, slope_below: 1.2, amp: 0.75 do 116 | with_fx :reverb, room: 1 do 117 | tick 118 | synth :dark_ambience, amp: 1, note: ns.look 119 | synth :hollow, amp: 0.4, note: ns.look + 12, cutoff: 100 120 | synth :subpulse, amp: 0.8, note: ns.look - 24, pan: -0.25 121 | synth :subpulse, amp: 0.5, note: ns.look - 12, pan: 0.25 122 | sleep ds.look 123 | end 124 | end 125 | end 126 | end 127 | ##| sync :three6 128 | ##| slide(:three6_lv, 64, false, amp: 1) 129 | -------------------------------------------------------------------------------- /sonic-pi/byte/common/2020-11-21/buffer 3.rb: -------------------------------------------------------------------------------- 1 | # 6, three2, three3, three4 -> 2 | 3 | #slide([:three2_lv, :three3_lv, :three4_lv], 64, false, amp: 0) 4 | 5 | use_bpm 132 6 | 7 | live_loop :met do 8 | sleep 2 9 | end 10 | 11 | live_loop :four1, sync: :met do 12 | #stop 13 | level(:four1, 0) do 14 | use_random_seed 401090#98716#915221 15 | hs = (spread 14, 16).shuffle 16 | ss = sample_names(:elec).take(32).shuffle#.take(16) 17 | with_fx :tanh, mix: 0 do |th| 18 | hs.length.times do 19 | tick 20 | control th, mix: rrand(0.5, 1) 21 | sample ss.look, amp: 0.15, on: hs.look, lpf: rrand(60, 120), beat_stretch: rrand(0.125, 0.5), pan: -0.5 22 | sleep 0.25 23 | end 24 | end 25 | end 26 | end 27 | ##| sync :four1 28 | ##| slide(:four1_lv, 64, false, amp: 1) 29 | 30 | live_loop :four2, sync: :four1 do 31 | #stop 32 | level(:four2, 0) do 33 | use_random_seed 401090#93711#60519 34 | hs = (spread 10, 16).shuffle 35 | ss = sample_names(:bd).take(32).shuffle#.take(16) 36 | with_fx :ping_pong, phase: 0.75, feedback: 0.75, mix: 0.5 do 37 | with_fx :bitcrusher, bits: 5 do 38 | with_fx :tanh, mix: 0 do |th| 39 | hs.length.times do 40 | tick 41 | control th, mix: 1 42 | sample ss.look, amp: 0.15, on: hs.look, beat_stretch: rrand(0.25, 0.5), pan: 0.5 43 | sleep 0.25 44 | end 45 | end 46 | end 47 | end 48 | end 49 | end 50 | ##| sync :four2 #sync slide to a cue 51 | ##| slide(:four2_lv, 64, false, amp: 1) 52 | 53 | live_loop :four3, sync: :four1 do 54 | #stop 55 | level(:four3, 0) do 56 | use_random_seed 402190#3830#195230 57 | hs = (spread 3, 16).shuffle 58 | ss = sample_names(:sn).take(32).shuffle.take(16) 59 | with_fx :ping_pong, phase: 0.75, feedback: 0.75, mix: 0.3 do 60 | with_fx :bitcrusher, bits: 5, mix: 0 do 61 | with_fx :tanh, mix: 0.5 do |th| 62 | hs.length.times do 63 | tick 64 | #control th, mix: 1 65 | sample ss.look, amp: 0.15, on: hs.look, beat_stretch: rrand(0.25, 2), pan: -0.5 66 | sleep 0.25 67 | end 68 | end 69 | end 70 | end 71 | end 72 | end 73 | ##| sync :four3 74 | ##| slide(:four3_lv, 64, false, amp: 1) 75 | 76 | 77 | # s = sth subp, a as.lk, n ns.lk + 0.1 78 | # s2 = sth tri, a as.lk, n ns.lk 79 | live_loop :four4, sync: :four1 do 80 | #stop 81 | level(:four4, 0) do 82 | ns = (knit :fs3, 3, :fs5, 1, :r, 1, :fs4, 3, :fs6, 1).shuffle + (ring :r) 83 | ds = (knit 0.25, 4, 0.25, 1, 0.25, 4) + (ring (rrand(13, 29) + 0.75)) 84 | as = (ring 0.3, 0.4, 0.25, 0.5, 1, 0.3, 0.4, 0.25, 0.5, 0) 85 | use_synth_defaults release: ds.look 86 | with_fx :reverb, room: 1 do 87 | with_fx :rbpf, centre: rrand(70, 90), res: rrand(0.5, 0.9), mix: rrand(0.8, 1), amp: 0.7 do 88 | with_fx :wobble, res: 0.4, phase: 0.5, cutoff_max: 100 do 89 | with_fx :ring_mod, freq: 60, mix: 0.4 do 90 | with_fx :echo, phase: 0.75, decay: 16, mix: 0.5, amp: 0.25 do |ec| 91 | control ec, phase_slide: rrand(4, 8), phase: rrand(0.7, 0.8) 92 | ns.length.times do 93 | tick 94 | synth :subpulse, amp: as.look, note: ns.look + 0.1 95 | synth :tri, amp: as.look, note: ns.look 96 | sleep ds.look 97 | end 98 | end 99 | end 100 | end 101 | end 102 | end 103 | end 104 | end 105 | ##| sync :four4 #sync slide to a cue 106 | ##| slide(:four4_lv, 64, false, amp: 1) 107 | 108 | #s = sth saw, a 0.5, n ns.lk, at ds.lk / 2, rl ds.lk / 2, cu 100 109 | live_loop :four5, sync: :four1 do 110 | #stop 111 | level(:four5, 0) do 112 | ns = (ring :fs2, :e2, :fs2, :b1) 113 | ds = (ring 8) 114 | with_fx :reverb, room: 1 do 115 | with_fx :slicer, phase: 0.25, probability: 0.8, prob_pos: 0.3, seed: 56943 do 116 | ns.length.times do 117 | tick 118 | s = synth :saw, amp: 0.5, note: ns.look, attack: ds.look / 2.0, release: ds.look / 2.0 119 | 120 | control s, cutoff_slide: 0.25, cutoff: 90 121 | sleep ds.look 122 | end 123 | end 124 | end 125 | end 126 | end 127 | ##| sync :four5 #sync slide to a cue 128 | ##| slide(:four5_lv, 64, false, amp: 1) 129 | 130 | #s = sth saw, a 0.5, n ns.lk, sus ds.lk, cu 100 131 | live_loop :four6, sync: :four1 do 132 | #stop 133 | level(:four6, 0) do 134 | ns = (ring :cs3, :e3, :eb3, :gs3) 135 | ds = (ring 8) 136 | with_fx :slicer, phase: 0.25 do 137 | with_fx :wobble, phase: 32, filter: 1, cutoff_min: 80, cutoff_max: 100, invert_wave: 1, mix: 0.5 do 138 | #with_fx :tanh, mix: 0.2 do 139 | ns.length.times do 140 | tick 141 | s = synth :saw, amp: 0.5, note: ns.look, sustain: ds.look, cutoff: 100 142 | 143 | control s, cutoff_slide: 0.25, cutoff: 85 144 | sleep ds.look 145 | end 146 | #end 147 | end 148 | end 149 | end 150 | end 151 | ##| sync :four6 #sync slide to a cue 152 | ##| slide(:four6_lv, 64, false, amp: 1) 153 | 154 | # sth sine, n ns.lk + 12, pan: -0.5, re ds.lk 155 | # sth sine, n ns.lk, pan: 0.5, re ds.lk 156 | live_loop :four7, sync: :four1 do 157 | #stop 158 | level(:four7, 0) do 159 | ns = (ring :cs4, :e4, :gs4, :fs4, :r) + [(ring :eb4, :e4, :b4), (ring :b4, :fs4, :gs4)].choose + (ring :r, :gs4, :fs4, :e4, :eb4, :r) 160 | ds = (knit 0.25, 4, 15, 1, 0.5, 1, 0.25, 2, 15, 1, 0.25, 4, 15, 1) 161 | with_fx :reverb, room: 1 do 162 | with_fx :ping_pong, phase: 0.75, feedback: 0.85 do 163 | use_synth_defaults amp: 0.3 164 | ns.length.times do 165 | tick 166 | synth :sine, note: ns.look + 12, pan: -0.5, release: ds.look 167 | synth :sine, note: ns.look, pan: 0.5, release: ds.look 168 | 169 | sleep ds.look 170 | end 171 | end 172 | end 173 | end 174 | end 175 | ##| sync :four1 #sync slide to a cue 176 | ##| slide(:four7_lv, 64, false, amp: 1) 177 | 178 | -------------------------------------------------------------------------------- /sonic-pi/byte/common/2020-11-21/buffer 4.rb: -------------------------------------------------------------------------------- 1 | #7, four1, four2, four3, four7 -> 2 | 3 | #slide([:four1_lv,:four2_lv,:four3_lv, :four7_lv], 64, false, amp: 0) 4 | 5 | use_bpm 132 6 | 7 | live_loop :met do 8 | sleep 2 9 | end 10 | 11 | # s elec_twang, a 1, hp rr(90, 100), b_s 0.0625, on hs.lk 12 | live_loop :five1, sync: :met do 13 | #stop 14 | level(:five1, 0) do 15 | use_random_seed 351261#65426 16 | hs = (spread 8, 17).shuffle 17 | hs.length.times do 18 | tick 19 | sample :elec_twang, amp: 1, hpf: rrand(90, 100), beat_stretch: 0.0625, on: hs.look 20 | sleep 0.25 21 | end 22 | end 23 | end 24 | ##| sync :five1 #sync slide to a cue 25 | ##| slide(:five1_lv, 64, false, amp: [0,1]) 26 | 27 | # s elec_plip, a rr(1, 1.5), on hs.lk, b_s rr(0.125, 0.5), hp rr(60, 80) 28 | live_loop :five2, sync: :five1 do 29 | stop 30 | level(:five2, 0) do 31 | use_random_seed 476345 32 | hs = (spread 7, 14).shuffle 33 | hs.length.times do 34 | tick 35 | sample :elec_plip, amp: rrand(1, 1.5), on: hs.look, beat_stretch: rrand(0.125, 0.5), hpf: rrand(60, 80) 36 | sleep 0.25 37 | end 38 | end 39 | end 40 | ##| sync :five2 41 | ##| slide(:five2_lv, 64, false, amp: [0,1]) 42 | 43 | # sample elec_lo_snare, a 0.3, on hs.lk, b_s rr(0.125, 0.5), lp rr(60, 100) 44 | live_loop :five3, sync: :five1 do 45 | stop 46 | level(:five3, 0) do 47 | hs = (spread 12, 19) 48 | with_fx :echo, phase: 1, decay: 8, mix: 0.5 do 49 | with_fx :tanh, mix: 0.6 do 50 | hs.length.times do 51 | tick 52 | sample :elec_lo_snare, amp: 0.3, on: hs.look, beat_stretch: rrand(0.125, 0.5), lpf: rrand(60, 100) 53 | sleep 0.25 54 | end 55 | end 56 | end 57 | end 58 | end 59 | ##| sync :five3 60 | ##| slide(:five3_lv, 64, false, amp: [0,1]) 61 | 62 | # set(:r, [:d2, :minor]) 63 | # s = sth subpulse, a 0.3, n ns.lk, sus ds.lk / 2.0, rel ds.lk / 2.0, co 100, pn -0.25 64 | # s2 = sth subpulse, a 0.5, n ns.lk - 12, sus ds.lk / 2.0, rel ds.lk / 2.0, co 100, pn 0.25 65 | live_loop :five4, sync: :five1 do 66 | stop 67 | level(:five4, 0) do 68 | ns = degs2ns((ring 8, 11, 7, 5)) 69 | ds = (knit 8, 4) 70 | ns.length.times do 71 | tick 72 | s = synth :subpulse, amp: 0.3, note: ns.look, sustain: ds.look / 2.0, release: ds.look, cutoff: 100, pan: -0.25 73 | s2 = synth :subpulse, amp: 0.5, note: ns.look - 12, sustain: ds.look / 2.0, release: ds.look / 2.0, cutoff: 100, pan: 0.25 74 | control s, cutoff_slide: 0.25, cutoff: 70 75 | control s2, cutoff_slide: 0.25, cutoff: 70 76 | sleep ds.look 77 | end 78 | end 79 | end 80 | ##| sync :five4 81 | ##| slide(:five4_lv, 64, false, amp: [0,1]) 82 | 83 | # s bd_haus, a 0.75, lp 90 84 | live_loop :five5, sync: :five1 do 85 | #stop 86 | level(:five5, 0) do 87 | sample :bd_haus, amp: 0.75, lpf: 90 88 | sleep 1 89 | end 90 | end 91 | #sync :five5 92 | #slide(:five5_lv, 64, false, amp: [0,1]) 93 | 94 | # s = sth dtri, a 0.25, n ns.lk, rel ds.lk, co 100, dtn 0.2 95 | live_loop :five6, sync: :five1 do 96 | stop 97 | level(:five6, 0) do 98 | sc = if one_in(3) 99 | (scale :g3, :minor_pentatonic).choose 100 | else 101 | :g3 102 | end 103 | ns = (ring sc, :r, sc, :r) 104 | ds = (ring 0.5, 0.25, 0.5, 6.75) 105 | with_fx :reverb, room: 1 do 106 | with_fx :echo, phase: 0.75, decay: 8, mix: 0.5 do 107 | with_fx :tanh, mix: 0.5 do 108 | with_fx :flanger, phase: 4, feedback: 0.1, depth: 2 do 109 | ns.length.times do 110 | tick 111 | s = synth :sine, amp: 0.25, note: ns.look, release: ds.look, cutoff: 100, detune: 0.2 112 | 113 | control s, cutoff_slide: 0.25, cutoff: 70 114 | sleep ds.look 115 | end 116 | end 117 | end 118 | end 119 | end 120 | end 121 | end 122 | ##| sync :five6 123 | ##| slide(:five6_lv, 64, false, amp: [0,1]) 124 | -------------------------------------------------------------------------------- /sonic-pi/byte/common/2020-11-21/buffer 5.rb: -------------------------------------------------------------------------------- 1 | # 6, five1, five2, five4, leave five5?? 2 | 3 | #slide([:five5_lv], 64, false, amp: 0) 4 | 5 | use_bpm 132 6 | 7 | live_loop :met do 8 | sleep 2 9 | end 10 | 11 | 12 | # s :elec_blup a 0.75, bs 4 fsh 0.25, l rr(80, 130) if h.look 13 | live_loop :six1, sync: :met do 14 | #stop 15 | level(:six1, 0) do 16 | use_random_seed 642564264 17 | hs = (bools 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0).shuffle 18 | with_fx :compressor do 19 | with_fx :rbpf, centre: 70, amp: 5 do 20 | hs.length.times do 21 | tick 22 | stop if get(:stop) 23 | sample :elec_blup, amp: 0.75, beat_stretch: 4, finish: 0.25, lpf: rrand(80, 130) if hs.look 24 | sleep 0.25 25 | end 26 | end 27 | end 28 | end 29 | end 30 | ##| sync :six1 31 | ##| slide(:six1_lv, 64, false, amp: 1) 32 | 33 | # s :elec_twip, a 0.25, bs 2, fsh 0.25, l rr(80. 90), o: hs.look 34 | live_loop :six2, sync: :six1 do 35 | #stop 36 | level(:six2, 0) do 37 | use_random_seed 96487653 38 | hs = (bools 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0).shuffle.rotate(1) 39 | with_fx :panslicer, pan_min: -0.5, pan_max: 0.5, phase: 0.25, mix: 0.5 do 40 | with_fx :echo, phase: 0.75, decay: 8, mix: 0.3 do 41 | with_fx :compressor do 42 | with_fx :rbpf, centre: 85, mix: 0.8, amp: 1.3 do 43 | with_fx :rlpf, cutoff: (knit 130, 3, 80, 1).tick(:l) do 44 | with_fx :tanh, mix: 0.5 do 45 | hs.length.times do 46 | tick 47 | stop if get(:stop) 48 | sample :elec_twip, amp: 0.25, beat_stretch: 2, finish: 0.25, lpf: rrand(80, 90), on: hs.look 49 | sleep 0.25 50 | end 51 | end 52 | end 53 | end 54 | end 55 | end 56 | end 57 | end 58 | end 59 | ##| sync :six2 60 | ##| slide(:six2_lv, 64, false, amp: 1) 61 | 62 | # Thanks!! 63 | 64 | # s1 = sth tri, a (r 0.5, 0.3).t(a), n :a3, sus 4, co 90 65 | #live_loop :six3, sync: :six2 do 66 | #stop 67 | sync :end 68 | level(:six3, 0, true) do 69 | with_fx :reverb, room: 1 do 70 | with_fx :echo, phase: 0.75, decay: 30, mix: 1 do 71 | with_fx :compressor do 72 | with_fx :ixi_techno, phase: rrand(4, 16), cutoff_min: rrand(60, 120), cutoff_max: rrand(60, 120), phase_offset: rrand(0, 1) do 73 | with_fx :bpf, centre: rrand(80, 100), res: 0.7, amp: 2, mix: 0.95 do 74 | sleep 1.25 75 | s1 = synth :tri, amp: (ring 0.5, 0.3).tick(:a), note: :a3, sustain: 4, cutoff: 90 76 | stop if get(:stop) 77 | control s1, note_slide: 4, note: :a1 78 | sleep (ring 14, 22, 30).choose + 0.75 79 | end 80 | end 81 | end 82 | end 83 | end 84 | end 85 | #end 86 | ##| sync :six3 87 | ##| slide(:six3_lv, 64, false, amp: 1) 88 | 89 | # s1 = sth sine, a (r 0.5, 0.25).t(a), n :a3, sus 4 90 | live_loop :six4, sync: :six1 do 91 | #stop 92 | level(:six4, 0) do 93 | with_fx :compressor do 94 | with_fx :echo, phase: 0.75, decay: 16, mix: 0.8 do 95 | stop if get(:stop) 96 | sleep 3.25 97 | s1 = synth :tri, amp: (ring 0.15, 0.15).tick(:a), note: :a3, sustain: 4 98 | 99 | control s1, note_slide: 4, note: :a5 100 | sleep (ring 12, 20, 28).choose + 0.75 101 | end 102 | end 103 | end 104 | end 105 | ##| sync :six4 106 | ##| slide(:six4_lv, 64, false, amp: 1) 107 | 108 | # s elec_blup, a 0.5, on hs.lk 109 | # sl th mx 1 110 | # ctl ec, mx_sl 2, ph 4, mx 0 111 | live_loop :six5, sync: :six2 do 112 | #stop 113 | level(:six5, 0) do 114 | # fill 115 | hs = (bools 1, 1, 1, 1, 1, 1, 1, 0) 116 | ds = (knit 0.25, 8) 117 | with_fx :reverb, room: 1 do 118 | with_fx :panslicer, pan_min: -0.5, pan_max: 0.5, phase: 4, mix: 1 do |ps| 119 | # control ps, phase_slide: 128, phase: 0.5 120 | with_fx :echo, phase: 0.75, mix: 0 do |ec| 121 | # control ec, mix_slide: 128, mix: 1 122 | with_fx :bitcrusher, bits: 7, sample_rate: 8000, mix: 0.5 do 123 | 124 | with_fx :distortion, distort: 0.9, amp: 0.1 do 125 | (hs.length*4).times do 126 | tick 127 | stop if get(:stop) 128 | if one_in(8) 129 | control ec, mix_slide: 0, mix: 1 130 | else 131 | control ec, mix_slide: 0.25, mix: 0 132 | end 133 | sample :elec_blup, amp: 0.5, on: hs.look 134 | sleep ds.look 135 | end 136 | end 137 | 138 | end 139 | end 140 | end 141 | end 142 | end 143 | end 144 | ##| sync :six5 145 | ##| slide(:six5_lv, 64, false, amp: 1) 146 | 147 | live_loop :six6, sync: :six1 do 148 | #stop 149 | level(:six6, 0) do 150 | stop if get(:stop) 151 | with_fx :echo, phase: 0.75, decay: 32 do 152 | sleep 16 153 | sample :drum_splash_hard, amp: 0.5, hpf: 110, pan: 0.5 154 | sleep 1 155 | sample :drum_splash_hard, amp: 0.25, rate: 0.5, hpf: 90, pan: -0.5 156 | sleep 31 157 | end 158 | end 159 | end 160 | 161 | # wrap was just a way for me to reduce repetition since a few loops below had 162 | # similar code. It wraps a segment of code. 163 | 164 | # ns = notes 165 | # ds = durations 166 | # block = reference to block of code being wrapped 167 | 168 | define :wrap do |ns, ds, &block| 169 | with_fx :rbpf, centre: 85, mix: 0.8, amp: 2.5 do 170 | ns.length.times do 171 | tick 172 | stop if get(:stop) 173 | synth :tb303, amp: 0.5, note: ns.look, release: ds.look, cutoff: 80, res: 0.7 174 | sleep ds.look 175 | end 176 | end 177 | # Run the wrapped code 178 | block.call if block 179 | end 180 | 181 | ##| set(:six7_lv_amp, 0) 182 | ##| set(:six8_lv_amp, 0) 183 | ##| set(:six9_lv_amp, 0) 184 | ##| set(:six10_lv_amp, 0) 185 | 186 | # Which sequence are we in? :rand here 187 | # There was originally also :cons but this was not used. 188 | set(:seq, :rand) 189 | 190 | # Variables storing the number of random note hits 191 | # when playing notes in the :rand sequence 192 | set(:rand8, 8) # 2 193 | set(:rand9, 8) # 6 194 | 195 | # A bunch of the below code was not used in the end, 196 | # like anything using the cons variables :shrug: 197 | set(:cons8, (ring 4).choose) 198 | set(:cons9, (ring 0, 0.25, 0.5, 0.75, 1, 1.25, 1.5).choose) 199 | 200 | # (r d2, r), 201 | # (r 1, 7) 202 | live_loop :six7, sync: :six1 do 203 | #stop 204 | level(:six7, 0) do 205 | ns, ds = case get(:seq) 206 | when :rand, :cons 207 | [ 208 | (knit :d2, 1, :r, 7).rotate(dice(8) - 1), 209 | (ring 1) 210 | ] 211 | else 212 | [ 213 | (ring :d2, :r), 214 | (ring 1, 7) 215 | ] 216 | end 217 | wrap(ns, ds) 218 | end 219 | end 220 | ##| sync :six7 221 | ##| slide(:six7_lv, 64, false, amp: 1) 222 | 223 | # (r r, d4, r, d4, r), 224 | # (r 1, 0.25, 1.75, 0.25, 0.75) 225 | live_loop :six8, sync: :six1 do 226 | #stop 227 | #sync :six1 228 | level(:six8, 0) do 229 | ns, ds = case get(:seq) 230 | when :rand 231 | [ 232 | (knit :d4, get(:rand8), :r, 16 - get(:rand8)).shuffle, 233 | (knit 0.25, 16) 234 | ] 235 | when :cons 236 | [ 237 | (ring :r, :r, :d4, :r, :d4, :r), 238 | (ring get(:cons8), 1, 0.25, 1.75, 0.25, 0.75) 239 | ] 240 | else 241 | [ 242 | (ring :r, :d4, :r, :d4, :r), 243 | (ring 1, 0.25, 1.75, 0.25, 0.75) 244 | ] 245 | end 246 | wrap(ns, ds) 247 | end 248 | end 249 | ##| sync :six8 250 | ##| slide(:six8_lv, 64, false, amp: 1) 251 | 252 | # (kn r, 1, d2, 6, r, 1), #(r r) + (r d2, d3).pk(6) + (r r) if o_i(3) 253 | # (kn 1.5, 1, 0.25, 6, 1, 1) 254 | live_loop :six9, sync: :six1 do 255 | #stop 256 | level(:six9, 0) do 257 | ns, ds = case get(:seq) 258 | when :rand 259 | [ 260 | (knit :d2, get(:rand9), :r, 16 - get(:rand9)).shuffle, 261 | (knit 0.25, 16) 262 | ] 263 | when :cons 264 | [ 265 | (knit :r, 1, :d2, 6, :r, 1), #(ring :r) + (ring :d2, :d3).pick(6) + (ring :r) if one_in(3) 266 | (knit get(:cons9), 1, 0.25, 6, 2.5 - get(:cons9), 1) 267 | ] 268 | else 269 | [ 270 | (knit :r, 1, :d2, 6, :r, 1), #(ring :r) + (ring :d2, :d3).pick(6) + (ring :r) if one_in(3) 271 | (knit 1.5, 1, 0.25, 6, 1, 1) 272 | ] 273 | end 274 | wrap(ns, ds) 275 | end 276 | end 277 | ##| sync :six9 278 | ##| slide(:six9_lv, 64, false, amp: 1) 279 | 280 | live_loop :six10, sync: :six1 do 281 | #stop 282 | level(:six10, 0) do 283 | ns = (ring :r, :b1, :c2, :cs2, :r) 284 | ds = (knit 7.25, 1, 0.25, 3, 8, 1) 285 | wrap(ns, ds) 286 | end 287 | end 288 | ##| sync :six10 289 | ##| slide(:six10_lv, 64, false, amp: 1) 290 | 291 | # s = sth mod_tri, pan: -0.5, cutoff: 90 292 | # s2 = sth mod_sine, pan: 0.5 293 | live_loop :six11, sync: :six1 do 294 | #stop 295 | ns = (ring :d2) 296 | ds = (ring 128) 297 | with_fx :rbpf, centre: 60, slide: 128, mix: 0 do |rb| 298 | control rb, centre_slide: 128, centre: 90, mix_slide: 128, mix: 1, amp_slide: 128, amp: 1 299 | use_synth_defaults amp: 0.3, note: ns.look, sustain: ds.look, mod_phase: 8, mod_wave: 3, mod_range: 0.5 300 | ns.length.times do 301 | tick 302 | s = synth :mod_tri, pan: -0.5, cutoff: 90 303 | s2 = synth :mod_sine, pan: 0.5 304 | control s, mod_phase_slide: 64, mod_phase: 0.125, mod_range_slide: 128, mod_range: 24, note_slide: 128, note: ns.look + 24 305 | control s2, mod_phase_slide: 64, mod_phase: 0.125, mod_range_slide: 128, mod_range: 24, note_slide: 128, note: ns.look + 24 306 | sleep ds.look 307 | # Tell other live_loops to stop when they see this value 308 | set(:stop, true) #!! 309 | # Trigger the very last sound 310 | cue :end 311 | stop 312 | end 313 | end 314 | end 315 | 316 | -------------------------------------------------------------------------------- /sonic-pi/byte/common/2020-11-21/snippets/fx/sliding/internal/fx sl th.sps: -------------------------------------------------------------------------------- 1 | # key: fx sl th 2 | # point_line: 0 3 | # point_index: 5 4 | # -- 5 | set(:_th_mix, ) #only needed here for initial or snap values 6 | with_fx :tanh, mix: get(:_th_mix) do |th| 7 | set(:_th, th) 8 | 9 | end 10 | #sync : #sync slide to a cue 11 | slide(:_th, , false, mix: ) 12 | -------------------------------------------------------------------------------- /sonic-pi/byte/common/2020-11-21/snippets/syntax/synth.sps: -------------------------------------------------------------------------------- 1 | # key: snth 2 | # point_line: 0 3 | # point_index: 7 4 | # -- 5 | synth :, amp: , note: ns.look, release: ds.look 6 | 7 | -------------------------------------------------------------------------------- /sonic-pi/byte/common/2020-11-21/utility functions.rb: -------------------------------------------------------------------------------- 1 | #utility functions 2 | 3 | # level is used to wrap a section of code with a :level fx in order to easily 4 | # manipulate the volume of all enclosed synths/samples/fx. 5 | # It boils down to giving the fx opts values that are controlled by get & set 6 | # so that every time a new instance of the fx is used, its opts can have 7 | # values set by other parts of the code over time. 8 | 9 | # name = name of the live_loop this fx sits in 10 | # init_amp = initial volume of fx 11 | # no_stop = does the enclosing live_loop ignore instructions to stop? 12 | # block = reference to block of code this 'level' wrapper encloses 13 | 14 | define :level do |name, init_amp = 0, no_stop = false, &block| 15 | # This set stop line was intended to allow an easy way to bulk-stop several 16 | # live_loops at once - but did not really allow individual customisation 17 | set(:"stop_#{name}", false) if get(:"stop_#{name}").nil? 18 | # set the variable that holds the amp value to use in the fx 19 | set(:"#{name}_lv_amp", init_amp) if get(:"#{name}_lv_amp").nil? 20 | # Here is where we would stop the live_loop if desired 21 | stop if get(:"stop_#{name}") and !no_stop 22 | # Actually wrap the code with the level fx, set with the current value 23 | # of the script controlled volume variable 24 | with_fx :level, amp: get(:"#{name}_lv_amp") do |lv| 25 | # Store reference to the fx node so that it can be manipulated elsewhere 26 | set(:"#{name}_lv", lv) 27 | # Run the enclosed code 28 | block.call 29 | end 30 | end 31 | 32 | # slide is a function used to smoothly fade a synth, sample or fx opt's value 33 | # (or multiple opt values at once) from one number to another. 34 | # Note: this must be called *from outside* the live loop in question, 35 | # or opt values will oscillate undesirably. 36 | # Many thanks to [https://github.com/rbnpi](Robin Newman) for sharing the code 37 | # that this is adapted from :-) 38 | # (Originally discussed here: 39 | # [Smooth Parameter Automation](https://in-thread.sonic-pi.net/t/smooth-parameter-automation/1626)) 40 | 41 | # pointers = references to a synth, sample or fx node, or an array of them 42 | # (for example, as set by the above 'level' function) 43 | # duration = time length in beats to slide over 44 | # snap = whether to 'snap' the value back to the starting value after the slide 45 | # opt = key/value pair describing the opt to manipulate and its new value. 46 | # (can be in the form opt: x, where only the desired end value is given, or 47 | # in the form opt: [a, b], giving the exact start and end values of the slide). 48 | 49 | define :slide do |pointers, duration, snap, opt| 50 | # Allow a single synth/sample/fx node as well as multiple at once if desired 51 | pointers = [pointers] unless pointers.is_a?(Array) 52 | pointers.each do |pointer| 53 | # Extract desired opt slide values 54 | key, val = *opt.flatten 55 | var = :"#{pointer}_#{key}" 56 | # Handle end only value as well as start & end value for slide 57 | start = mxr(var, val.is_a?(Array) ? val[0] : (duration.positive? ? nil : val)) 58 | finish = val.is_a?(Array) ? val[1] : val 59 | # Ignore slide if start and end are the same value and sliding over time 60 | return if start == finish && duration.positive? 61 | # Set incremental values of slide to use over time, or instantaneous value 62 | l = if duration.positive? 63 | (line start, finish, steps: 11, inclusive: true).stretch(2).drop(1).butlast.ramp 64 | else 65 | (ring finish) 66 | end 67 | # Set time increment of each slide 'slice' 68 | dt = duration / 20.0 69 | # Perform sliding in a separate thread to avoid affecting current thread's timing 70 | in_thread do 71 | # For each slice of the slide 72 | l.length.times do 73 | tick 74 | # Print debug value 75 | puts "#{var}: #{l.look}" 76 | # Retrieve the desired synth/sample/fx node and actually control its opt 77 | control get(pointer), key => l.look, (key.to_s+"_slide").to_sym => dt 78 | sleep dt 79 | # Store the current value of the sliding opt so that it can be used to 80 | # initialise a new synth/sample/fx if the old one ends before the slide 81 | # has completed 82 | set var, l.look 83 | end 84 | # 'Snap' the value of the opt to a certain value if asked 85 | # (Hard coded to 0 here unintentionally) 86 | control get(pointer), key => start, (key.to_s+"_slide").to_sym => 0 if snap 87 | end 88 | end 89 | end 90 | 91 | # mxr was created to possibly initialise the variables that stored 92 | # the sliding opt values if they had not already been initialised, or to 93 | # override their values. 94 | 95 | # key = opt name 96 | # value = new value 97 | 98 | define :mxr do |key, value = nil| 99 | value ? set(key, value) : (get(key) || set(key, 0)) 100 | end 101 | 102 | # degs2ns seemed like a reasonable function to convert a list of scale degrees 103 | # and information about a scale into actual note values 104 | 105 | # degs = ring or array of scale degrees 106 | # scl = array specifying the scale to use 107 | # (default can be provided by using set(:r, [tonic_note, scale_name])) 108 | 109 | define :degs2ns do |degs, scl = get(:r, [:d2, :major])| 110 | tonic, sc = scl 111 | degs.map do |deg| 112 | if rest?(deg) 113 | :r 114 | else 115 | degree(deg, tonic, sc) 116 | end 117 | end 118 | end 119 | -------------------------------------------------------------------------------- /sonic-pi/noizemaschin!!/105/README.md: -------------------------------------------------------------------------------- 1 | # Source code for my performance for NoizeMaschin!! #105 2 | ## (Event theme: "1 c0d3d 17 my53lf") 3 | 4 | Each work for this event involved the artist using code in some part of its construction. 5 | **My contribution:** "Mellow", a chilled melodic piece composed in [Sonic Pi](https://sonic-pi.net/). 6 | 7 | There is also [a video of this piece](https://youtu.be/0qeX0dAja4Y). 8 | [The full NoizeMaschin!! #105 video](https://youtu.be/xZ3bTW9gr0w) including this and all the other artists' performances is also viewable. 9 | 10 | -------------------------------------------------------------------------------- /sonic-pi/noizemaschin!!/105/noizemaschin!! #105 - mellow.txt: -------------------------------------------------------------------------------- 1 | # Welcome to Sonic Pi! 2 | 3 | # This is going to be a fairly mellow piece. 4 | 5 | # Hope you enjoy! 6 | 7 | live_loop :met do 8 | sleep 2 9 | end 10 | 11 | define :wrap do |ns, seed, &block| 12 | use_random_seed seed if seed 13 | ns = ns || (chord :a3, :major, num_octaves: 2).shuffle.pick(6) 14 | ds = (ring 8, 8) 15 | 2.times do 16 | tick 17 | block.call(ns, ds) 18 | sleep ds.look 19 | end 20 | 21 | end 22 | 23 | live_loop :mel1, sync: :met do 24 | stop 25 | ds = (ring 0.125) 26 | with_fx :reverb, room: 1 do 27 | with_fx :rhpf, cutoff: 80 do 28 | 2.times do 29 | use_random_seed (ring 234123121, 234123122, 234123123).tick(:r) 30 | ns = (scale :a3, :major, num_octaves: 2).shuffle.pick(64) 31 | ns.length.times do 32 | tick 33 | synth :sine, amp: rrand(0.1, 0.4) * (line 0, 1, steps: 128).ramp.tick(:l), note: ns.look, sustain: ds.look, release: 0.125, pan: -0.5 34 | sleep ds.look 35 | end 36 | end 37 | end 38 | end 39 | end 40 | 41 | ##| ll mel2, s mel1 42 | ##| sd = 864576542 43 | ##| wr(nil, seed) ns, ds 44 | ##| syn dtri, a 0.2, n ns.lk, rl ds.lk, pn -0.25 45 | 46 | ##| ll mel3, s mel1 47 | ##| sd = 4562652 48 | ##| wr(nil, seed) ns, ds 49 | ##| syn dtri, a 0.2, n ns.lk - 12, rl ds.lk, pn 0.25 50 | 51 | live_loop :mel2, sync: :mel1 do 52 | stop 53 | seed = 864576542 54 | wrap(nil, seed) do |ns, ds| 55 | synth :dtri, amp: 0.2, note: ns.look, release: ds.look, pan: -0.25 56 | 57 | end 58 | end 59 | 60 | live_loop :mel3, sync: :mel1 do 61 | stop 62 | seed = 4562652 63 | wrap(nil, seed) do |ns, ds| 64 | synth :dtri, amp: 0.2, note: ns.look - 12, release: ds.look, pan: 0.25 65 | 66 | end 67 | end 68 | 69 | 70 | ##| ll mel4, s mel1 71 | ##| st 72 | ##| ns = (kn a2, 3, b1, 1) 73 | ##| use_s_dfs at 1, su 1, rl 6 74 | ##| wr(ns, nil) ns, ds 75 | ##| syn sine, a 0.3, n ns.lk 76 | ##| syn pr, a 0.4, ct 65, n ns.lk 77 | ##| sl ds.lk 78 | 79 | live_loop :mel4, sync: :mel1 do 80 | stop 81 | ns = (knit :a2, 3, :b1, 1) 82 | use_synth_defaults attack: 1, sustain: 1, release: 6 83 | wrap(ns, nil) do |ns, ds| 84 | synth :sine, amp: 0.3, note: ns.look 85 | synth :prophet, amp: 0.4, note: ns.look, cutoff: 65 86 | 87 | end 88 | end 89 | 90 | ##| ll beat1, s mel1 91 | ##| st 92 | ##| hs = (spr 16, 16) 93 | ##| hs2 = (spr 4, 16) 94 | ##| hs3 = bl 0, 1, 1, 0, 0, 0, 0, 1.rp 2 95 | ##| hs.lth.t 96 | ##| tk 97 | ##| s elec_cymbal, a (kn 0.2, 2, 0.5, 1, 0.2, 1).lk, bs 0.125, hp 115, on hs.lk 98 | ##| s bd_ada, a 0.2, lp 70, on hs2.lk 99 | ##| s drum_cymbal_pedal, a rr(0.2, 0.5), lp 96, on hs.lk 100 | ##| sl 0.125 101 | ##| s drum_splash_s, a 0.5, lp 110 102 | ##| st 103 | 104 | live_loop :beat1, sync: :mel1 do 105 | stop 106 | hs = (spread 16, 16) 107 | hs2 = (spread 4, 16) 108 | hs3 = (bools 0, 1, 1, 0, 0, 0, 0, 1).repeat(2) 109 | hs.length.times do 110 | tick 111 | sample :elec_cymbal, amp: (knit 0.2, 2, 0.5, 1, 0.2, 1).look, beat_stretch: 0.125, hpf: 115, on: hs.look 112 | sample :bd_ada, amp: 0.3, lpf: 70, on: hs2.look 113 | sample :drum_cymbal_pedal, amp: rrand(0.2, 0.5), lpf: 96, on: hs3.look 114 | sleep 0.125 115 | end 116 | sample :drum_splash_soft, amp: 0.5, lpf: 110 117 | stop 118 | end 119 | 120 | ##| s1 = synth :saw, amp: 0.3 121 | ##| s2 = synth :tri, amp: 0.2 122 | live_loop :mel5, sync: :mel1 do 123 | stop 124 | ns = (ring :e4, :r) 125 | ds = (ring 4, 4) 126 | with_fx :reverb, room: 1 do 127 | with_fx :echo, phase: 0.375, decay: 4, mix: 0.5 do 128 | with_fx :rbpf, centre: 90, centre_slide: 0.125, amp: 1.5 do |rb| 129 | use_synth_defaults note: ns.look, cutoff: 70, attack: ds.look / 4, release: ds.look * 0.75 130 | tick 131 | s1 = synth :saw, amp: 0.3 132 | s2 = synth :tri, amp: 0.2 133 | sleep 1.875 134 | control s1, note_slide: 0.125, note: :e5 135 | control s2, note_slide: 0.125, note: :e5 136 | control rb, centre: 70 137 | sleep ds.look - 1.875 138 | end 139 | end 140 | end 141 | end 142 | 143 | ##| st 144 | ##| syn bl, a 0.5, n ns.lk, cu 85 145 | ##| syn bl, a 0.3, n ns.lk - 12, cu 85 146 | live_loop :mel6, sync: :mel1 do 147 | stop 148 | use_random_seed 27426542 149 | ns = (scale :a3, :major, num_octaves: 2).shuffle.pick(32) 150 | ds = (knit 0.125, 3, 0.25, 1, 0.125, 11).repeat(2).drop_last(4)+(ring 0.5) 151 | with_fx :reverb, room: 1 do 152 | with_fx :rhpf, cutoff: 90, mix: 0.75 do 153 | use_synth_defaults sustain: ds.look, release: 0.5, pan: 0.5 154 | ns.length.times do 155 | tick 156 | synth :blade, amp: 0.5, note: ns.look, cutoff: 85 157 | synth :blade, amp: 0.3, note: ns.look - 12, cutoff: 85 158 | sleep ds.look 159 | end 160 | end 161 | end 162 | end 163 | 164 | ##| st 165 | ##| syn fm, a 0.7, n ns.lk, rl ds.lk + 0.25, dth 1, div 1, cu 90 166 | 167 | live_loop :mel7, sync: :mel1 do 168 | stop 169 | ds = (ring 2, 0.75, 1, 0.125, 0.125) 170 | with_fx :reverb, room: 1 do 171 | with_fx :rbpf, centre: 70, mix: 0 do |rb| 172 | control rb, centre: 100, centre_slide: 64, mix_slide: 64, mix: 1 173 | with_fx :tanh, mix: 0.2 do 174 | 16.times do 175 | nsa = (scale :a1, :major) 176 | ns = nsa.take(3).mirror.butlast 177 | ns = ns.take(1) + nsa.shuffle.take(2) + ns.drop(3) 178 | ns.length.times do 179 | tick 180 | synth :fm, amp: 0.7, note: ns.look, release: ds.look + 0.25, depth: 1, divisor: 1, cutoff: 90 181 | 182 | sleep ds.look 183 | end 184 | end 185 | end 186 | end 187 | end 188 | end 189 | -------------------------------------------------------------------------------- /sonic-pi/noizemaschin!!/README.md: -------------------------------------------------------------------------------- 1 | # NoizeMaschin!! 2 | 3 | The files here are the source code for the various Sonic Pi pieces performed as part of the Perth Artifactory's monthly experimental music night, NoizeMaschin!!. 4 | 5 | The code for each one is in its end-of-performance state, unless otherwise stated. 6 | -------------------------------------------------------------------------------- /sonic-pi/sonic-pi-monthly-challenge/December-2020/Teach-Yourself-Irish-Breakbeats.rb: -------------------------------------------------------------------------------- 1 | # 'Teach Yourself Irish Breakbeats' 2 | # Produced on a development build of Sonic Pi 3.3.0 3 | # For the December 2020 edition of the Sonic Pi Monthly Challenge. 4 | # This month's theme: "RPM = BPM" - dedicated to vinyl record speeds. 5 | # The BPM of the composition must be a multiple of a vinyl record speed. 6 | # 7 | # This piece is just a bit of fun messing about with a sample from archive.org, 8 | # from a series of audio recordings on 12" vinyl titled "Teach Yourself Irish". 9 | # The external sample is licensed CC-0 and can be downloaded here: 10 | # https://archive.org/download/Gael-linnAudioRecordingForTeachYourselfIrish1961/Side1_mono.aiff 11 | 12 | # The rest of the sounds are from built in synths, samples and fx distributed 13 | # with Sonic Pi. 14 | # Minimum version of Sonic Pi required: v3.0 ? (for 'set'/'get') 15 | # Corresponding audio/visual media: 16 | # An audio recording of this piece can be found on SoundCloud at 17 | # https://soundcloud.com/ethancrawford/teach-yourself-irish-breakbeats. 18 | 19 | bpm = 33 # or 45, 78 20 | use_bpm bpm 21 | set(:stop, false) 22 | 23 | side1 = "path/to/Side1_mono.aiff" # Change this to match your own path 24 | sample side1, amp: 1.75, finish: 0.005 25 | sleep 3 26 | 27 | live_loop :loop do 28 | stop if get(:stop) 29 | 30 | if tick(:l) == 25 31 | sleep 8 32 | cue :mel 33 | end 34 | sample :loop_breakbeat, amp: 33.0 / bpm, beat_stretch: 2 35 | sleep 2 36 | end 37 | 38 | sleep 2 39 | 40 | live_loop :two do 41 | stop if get(:stop) 42 | 43 | use_random_seed 6666 + look(:a) 44 | tick(:sla) 45 | sla = (ring 1.75, 0.5, 0.25, 0.125).look(:sla) 46 | 47 | with_fx :level, amp: 1.75 do 48 | 8.times do 49 | tick(:a, step: 40) 50 | start = rrand(0.005, 0.95) 51 | finish = start + 0.0032 52 | if one_in(4) && look(:sla) > 1 53 | with_fx :echo, phase: 0.375, decay: 8, mix: 1 do |ec| 54 | sample side1, start: start, finish: finish 55 | end 56 | else 57 | sample side1, start: start, finish: finish 58 | end 59 | sleep sla 60 | end 61 | 62 | 63 | use_random_seed 4299398 + look(:b) 64 | tick(:slb) 65 | slb = (ring 1, 0.5, 0.25, 0.125).look(:slb) 66 | 67 | 2.times do 68 | tick(:b, step: 60) 69 | start = rrand(0.005, 0.95) 70 | finish = start + 0.0016 71 | if one_in(4) && look(:slb) > 1 72 | with_fx :echo, phase: 0.375, decay: 8, mix: 1 do |ec| 73 | sample side1, start: start, finish: finish 74 | end 75 | else 76 | sample side1, start: start, finish: finish 77 | end 78 | sleep slb 79 | end 80 | 81 | use_random_seed 7844842 + look(:c) 82 | tick(:slc) 83 | slc = (ring 1, 0.5, 0.25, 0.125).look(:slc) 84 | 85 | 5.times do 86 | tick(:c, step: 80) 87 | start = rrand(0.005, 0.95) 88 | finish = start + 0.002 89 | if one_in(4) && look(:slc) > 1 90 | with_fx :echo, phase: 0.375, decay: 8, mix: 1 do |ec| 91 | sample side1, start: start, finish: finish 92 | end 93 | else 94 | sample side1, start: start, finish: finish 95 | end 96 | sleep slc 97 | end 98 | end 99 | end 100 | 101 | 102 | live_loop :dr1 do 103 | stop if get(:stop) 104 | 105 | with_fx :panslicer, pan_min: -1, pan_max: 1, phase: 8, wave: 2 do 106 | 8.times do 107 | sample :ambi_soft_buzz, amp: 33.0 / bpm, beat_stretch: 2, finish: 0.5, rpitch: -2 108 | sleep 1 109 | end 110 | end 111 | end 112 | 113 | live_loop :bass do 114 | ns = (scale :c1, :minor_pentatonic, num_octaves: 1).shuffle.take(4) 115 | ds = (ring 8) 116 | stop if get(:stop) 117 | with_fx :rhpf, cutoff: 50, res: 0.8, amp: 1.5 do |rh| 118 | with_fx :tanh, mix: 0.0 do |th| 119 | control rh, cutoff_slide: 8, cutoff: 90 120 | control th, mix_slide: 8, mix: 0.6 121 | 1.times do 122 | tick 123 | synth :fm, amp: rrand(0.2, 0.4), note: ns.look, sustain: ds.look, release: 0, depth: 1, divisor: 1, cutoff: 110 124 | synth :tri, amp: rrand(0.1, 0.2), note: ns.look + 0.1, sustain: ds.look, release: 0, cutoff: rrand(50, 80) 125 | synth :saw, amp: rrand(0.1, 0.2), note: ns.look + 0.2, sustain: ds.look, release: 0, cutoff: rrand(60, 90) 126 | sleep ds.look 127 | end 128 | end 129 | end 130 | end 131 | 132 | live_loop :mel3, sync: :mel do 133 | with_fx :reverb, room: 1 do 134 | with_fx :wobble, filter: 1, phase: 8, cutoff_min: 60, cutoff_max: 90, mix: 0.7 do 135 | with_fx :rbpf, centre: 80, mix: 0.8, amp: 2 do 136 | 8.times do 137 | ns = ((scale :c3, :minor_pentatonic).take(3) + 138 | (scale :c4, :minor_pentatonic, num_octaves: 2).take(7).rotate(tick(:r)).take(1)) 139 | ds = (ring 0.25) 140 | 141 | ns.length.times do 142 | tick 143 | synth :sine, amp: 0.3, note: ns.look, release: ds.look 144 | synth :blade, amp: 0.2, note: ns.look, release: ds.look, cutoff: 90 145 | sleep ds.look 146 | end 147 | end 148 | stop if get(:stop) 149 | end 150 | end 151 | end 152 | end 153 | 154 | sleep 100 155 | set(:stop, true) 156 | -------------------------------------------------------------------------------- /sonic-pi/sonic-pi-monthly-challenge/README.md: -------------------------------------------------------------------------------- 1 | # Sonic Pi Monthly Challenge 2 | 3 | ## What's in this directory 4 | The files here are the source code for my contributions to a series of monthly challenges put to the Sonic Pi community. The idea is that each month, a challenge is given to produce a musical composition using Sonic Pi, which meets certain requirements - perhaps styled in a particular genre, using a certain type of audio sample or synth instrument, etc. 5 | 6 | ## Minimum Sonic Pi version required 7 | Versions may vary - see comments in individual files for details. 8 | 9 | ## Contacting me 10 | If you have questions or comments about this source code, feel free to find me on the [Sonic Pi community forum](https://in-thread.sonic-pi.net) (@ethancrawford), or create an issue on [my live coding GitHub repository](https://github.com/ethancrawford/live-coding). 11 | -------------------------------------------------------------------------------- /sonic-pi/splashed/splashed_part1.txt: -------------------------------------------------------------------------------- 1 | # This file is part one of the code, mostly the utility functions 2 | # that enable musical sequencing and playing. 3 | # Parts one and two both need to be placed in separate buffers in Sonic Pi. 4 | # Trigger Run on this part first, then on part two. 5 | # A video of the code in action is at https://vimeo.com/133740686 6 | 7 | require 'mathn' 8 | 9 | tp = 1 10 | 11 | # Methods for timing and playing the sequences 12 | 13 | define :do_sleep do 14 | sleep tp 15 | end 16 | 17 | # Basic loop keeping the beat 18 | live_loop :metro do 19 | do_sleep 20 | end 21 | 22 | define :audible do |level| 23 | level > 0 24 | end 25 | 26 | define :patt_length do |pattern| 27 | pattern[:dur_list].reduce(0, :+) 28 | end 29 | 30 | # :ctl_slide takes a variable representing a playing synth, sample or effect 31 | # and a list of slide values, and slides the parameters in the list, 32 | # where an example of slide_list is: 33 | # slide_list = [ 34 | # { 35 | # param: "cutoff", values: [ 36 | # {dur: 4, end_value: 30}, 37 | # {dur: 4, end_value: 100} 38 | # ] 39 | # } 40 | # ] 41 | define :ctl_slide do |ctl_focus, slide_list| 42 | slide_list.each_with_index do |slide, si| 43 | in_thread(name: "control_#{ctl_focus.id}_#{si}") do 44 | slide[:values].each do |val| 45 | control ctl_focus, {:"#{slide[:param]}_slide" => val[:dur]} 46 | control ctl_focus, {:"#{slide[:param]}" => val[:end_value]} 47 | sleep val[:dur] 48 | end 49 | end 50 | end 51 | end 52 | 53 | # :pl_synth takes a list of synths, a musical pattern, and an optional list of slide values 54 | # similar to the one specified above, and uses each synth to simultaneously play 55 | # the specified pattern, sliding the slide values if present. 56 | define :pl_synth do |synth_list, pattern, slide_list = nil| 57 | pattern[:note_list].zip(pattern[:dur_list], pattern[:amp_list]) do |note, dur, amp| 58 | synth_list.each_with_index do |s, i| 59 | with_synth s[:synth] do 60 | attack = dur * 0 61 | sustain = dur * 1 62 | release = dur * 0 63 | new_amp = amp 64 | attack = s[:params][:attack] * dur if s[:params].has_key?(:attack) 65 | sustain = s[:params][:sustain] * dur if s[:params].has_key?(:sustain) 66 | release = s[:params][:release] * dur if s[:params].has_key?(:release) 67 | 68 | if s[:params].has_key?(:amp) 69 | new_amp *= s[:params][:amp] 70 | else 71 | new_amp /= synth_list.length 72 | end 73 | dur = attack + sustain + release 74 | 75 | with_synth_defaults s[:params], attack: attack, sustain: sustain, release: release do 76 | out = if note.respond_to?(:each) 77 | play_chord note, amp: amp 78 | else 79 | play note, amp: new_amp 80 | end 81 | 82 | if !rest?(note) && !slide_list.nil? 83 | ctl_slide(out, slide_list) 84 | end 85 | end 86 | end 87 | end 88 | sleep dur 89 | end 90 | end 91 | 92 | # :pl_smp plays a given sample with a given pattern, each hit separated by a given delay, 93 | # Altering the sample if any sample parameters are specified, and shuffling 'hits' 94 | # or amplitudes if specified. 95 | define :pl_smp do |smp, pattern, params = {}, shuffle_hits, shuffle_amps, delay| 96 | pattern[:hit_list] = pattern[:hit_list].shuffle if shuffle_hits 97 | pattern[:amp_list] = pattern[:amp_list].shuffle if shuffle_amps 98 | 99 | pattern[:hit_list].zip(pattern[:amp_list]) do |val, amp| 100 | sample smp, params, amp: amp if val == 1 101 | sleep delay 102 | end 103 | end 104 | -------------------------------------------------------------------------------- /sonic-pi/splashed/splashed_part2.txt: -------------------------------------------------------------------------------- 1 | # This file is part two of the code - mostly the actual musical data. 2 | # Parts one and two both need to be placed in separate buffers in Sonic Pi. 3 | # Part one needs to be triggered with Run first, then this one also. 4 | 5 | bpm = 140 6 | use_bpm bpm 7 | use_random_seed 96487 8 | use_cue_logging false 9 | 10 | # Sample and synth musical pattern data 11 | # For samples, consisting of an array of 'hits' 12 | # and an array of their corresponding amplitudes. 13 | # Synth patterns have arrays of notes, durations and amplitudes. 14 | perc_length = 12 15 | bass_drum_patt = { 16 | hit_list: [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], 17 | amp_list: knit(0.5, 11, 0.2, 1) 18 | } 19 | bass_drum_length = (3 * (perc_length * (1/3))) 20 | 21 | elec_flip_patt = { 22 | hit_list: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 23 | amp_list: Array.new(perc_length){rrand(0.5,1)} 24 | } 25 | 26 | elec_hollow_kick_patt = { 27 | hit_list: [0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0], 28 | amp_list: [0, 0, 0, 0, 0, 0, 0.7, 0, 0, 0.7, 0.2, 0], 29 | } 30 | 31 | arp_patt = { 32 | note_list: [:e3, :fs3, :g3, :b3, :fs4, :g4, :b4, :r], 33 | dur_list: knit(1/3, 7, 5/3, 1), 34 | amp_list: [0.7] * 8 35 | } 36 | 37 | arp_patt2 = { 38 | note_list: [:e3, :fs3, :g3, :b3, :fs4, :g4, :d5, :r], 39 | dur_list: knit(1/3, 7, 5/3, 1), 40 | amp_list: [0.7] * 8 41 | } 42 | 43 | arp_patt3 = { 44 | note_list: [:e3, :fs3, :g3, :b3, :fs4, :g4, :d5, :r, :e5, :r], 45 | dur_list: knit(1/3, 9, 1, 1), 46 | amp_list: [0.7] * 10 47 | } 48 | 49 | arp_patt4 = { 50 | note_list: [:e3, :fs3, :g3, :b3, :fs4, :g4, :d5, :e5, :r, :fs5, :e5, :r], 51 | dur_list: [1/3] * 12, 52 | amp_list: [0.7] * 12 53 | } 54 | arp_length = patt_length(arp_patt) 55 | 56 | pad_patt = { 57 | note_list: [:e4], 58 | dur_list: [16], 59 | amp_list: [0.4] 60 | } 61 | pad_length = patt_length(pad_patt) 62 | 63 | breath_patt = { 64 | note_list: [[:b3, :e4], [:a3, :g4]], 65 | dur_list: [16, 16], 66 | amp_list: [0.5, 0.4] 67 | } 68 | breath_length = patt_length(breath_patt) 69 | 70 | mod_pad_patt = { 71 | note_list: [[:b4, :g4], [:a4, :fs4], [:e4, :a3], [:fs4, :g3], [:g4, :fs3]], 72 | dur_list: [8, 8, 46/3, 1/3, 1/3], 73 | amp_list: [0.5] * 5 74 | } 75 | mod_pad_length = patt_length(mod_pad_patt) 76 | 77 | bass_sine_patt = { 78 | note_list: knit(:e3, 24, :b2, 24), 79 | dur_list: knit(1/3, 48), 80 | amp_list: knit(0.5, 48) 81 | } 82 | bass_sine_length = patt_length(bass_sine_patt) 83 | 84 | melody3_patt = { 85 | note_list: knit(:r, 1, :b3, 1, :r, 1), 86 | dur_list: knit(4, 1, 1/3, 6, 2/3, 3), 87 | amp_list: knit(0.5, 10) 88 | } 89 | bitcrushed_melody_patt = { 90 | note_list: [:r, [:b3] * 6, :e5, :d4, :d5, :d4, :b4, :b3, :g4, :fs4, :e4, :fs4, :g4, :fs4 ].flatten, 91 | dur_list: knit(2, 1, 1/3, 12, 2/3, 1, 1/3, 4, 8, 1), 92 | amp_list: knit(0.5, 19) 93 | } 94 | sine_melody_patt = { 95 | note_list: [:e4, :d4, :b3, :fs4, :g4, :a4, :g4, :fs4], 96 | dur_list: knit(2, 3, 1, 2, 1/3, 2, 22/3, 1), 97 | amp_list: knit(0.5, 9) 98 | } 99 | sine_melody_length = patt_length(sine_melody_patt) 100 | 101 | sine_melody2_patt = { 102 | note_list: [:g4, :fs4, :e4, :b3, :e4, :d4, :e4, :fs4], 103 | dur_list: knit(2, 3, 1, 2, 1/3, 2, 22/3, 1), 104 | amp_list: knit(0.5, 9) 105 | } 106 | 107 | # Audio "mixer" - used to bring in or silence the various 'instruments' 108 | arp_level = 0#1 109 | pad_level = 0#1.3 110 | breath_level = 0#1.3 111 | mod_pad_level = 0.8 112 | bass_sine_level = 0#2 113 | bitcrushed_melody_level = 0#1 114 | sine_melody_level = 0#1 115 | bass_drum_level = 1 116 | elec_flip_level = 0 117 | elec_hollow_kick_level = 0#1 118 | 119 | # :splash_delay was created to calculate the precise amount of time 120 | # necessary to sleep before triggering the 'splash/whoosh' noise 121 | # in order to have its mid-point align exactly with the beginning of 122 | # a new bar or song segment etc. 123 | define :splash_delay do |pattern_length| 124 | splash_duration = sample_duration(:drum_splash_hard) 125 | splash_offset = pattern_length - splash_duration 126 | splash_delay = (pattern_length - splash_offset).abs 127 | splash_delay = splash_offset if pattern_length > splash_duration 128 | splash_delay 129 | end 130 | 131 | # :splash is a percussion 'whoosh' function typed in from scratch 132 | # during a live performance to introduce different segments 133 | # of the song 134 | define :splash do |pattern_length | 135 | in_thread(name: :sp) do 136 | sleep splash_delay(pattern_length) 137 | with_fx :reverb, room: 1, pre_amp: 2 do 138 | with_fx :lpf, cutoff: 110 do 139 | sample :drum_splash_hard, rate: -1 140 | sleep sample_duration :drum_splash_hard 141 | cue :splashed 142 | sample :drum_splash_hard, rate: 1 143 | end 144 | end 145 | end 146 | 147 | end 148 | 149 | # Are we allowing the splash/whoosh to be triggered? 150 | do_splash = false 151 | 152 | live_loop :bass_drum_loop do 153 | with_fx :level, amp: bass_drum_level do |level| 154 | #ctl_slide(level, slide_list) if audible() <- This function not used in this performance 155 | 3.times do 156 | pl_smp :bd_ada, bass_drum_patt, false, false, 1/3 157 | end 158 | tick 159 | splash(bass_drum_length) if look % 3 == 0 && do_splash 160 | end 161 | end 162 | 163 | live_loop :elec_flip_loop do 164 | sync :bass_drum_loop 165 | with_fx :level, amp: elec_flip_level do |level| 166 | #ctl_slide(level, slide_list) if audible() 167 | 4.times do 168 | pl_smp :elec_flip, elec_flip_patt, false, true, 1/4 169 | end 170 | end 171 | end 172 | 173 | live_loop :elec_hollow_kick_loop do 174 | params = {rate: 2, cutoff: 85, finish: 1} 175 | sync :bass_drum_loop 176 | with_fx :level, amp: elec_hollow_kick_level do |level| 177 | #ctl_slide(level, slide_list) if audible() 178 | 3.times do 179 | pl_smp :elec_hollow_kick, elec_hollow_kick_patt, params, false, false, 1/3 180 | end 181 | end 182 | end 183 | 184 | live_loop :bass_sine_loop do 185 | synth_list = [ 186 | # {synth: name, params: params_hash} 187 | {synth: :sine, params: {sustain: 0.75, release: 0.25}} 188 | ] 189 | #sync :splashed 190 | with_fx :level, amp: bass_sine_level do |level| 191 | #ctl_slide(level, slide_list) if audible() 192 | with_fx :reverb, room: 0.9 do 193 | pl_synth synth_list, bass_sine_patt 194 | end 195 | end 196 | end 197 | 198 | live_loop :bitcrushed_melody_loop do 199 | synth_list = [ 200 | # {synth: name, params: params_hash} 201 | {synth: :sine, params: {sustain: 0.75, release: 0.25}} 202 | ] 203 | sync :bass_sine_loop 204 | with_fx :level, amp: bitcrushed_melody_level do |level| 205 | #ctl_slide(level, slide_list) if audible() 206 | with_fx :reverb, room: 0.9 do 207 | with_fx :bitcrusher, pre_amp: 1, sample_rate: 4000, bits: 6 do 208 | pl_synth synth_list, bitcrushed_melody_patt 209 | sleep bass_sine_length 210 | end 211 | end 212 | end 213 | end 214 | 215 | live_loop :sine_melody_loop do 216 | synth_list = [ 217 | # {synth: name, params: params_hash} 218 | {synth: :sine, params: {sustain: 0.75, release: 0.25, amp: 1}}, 219 | {synth: :sine, params: {sustain: 0.75, release: 0.25}}, 220 | #{synth: :tri, params: {}} 221 | ] 222 | sync :mod_pad_loop 223 | with_fx :level, amp: sine_melody_level * 0.5 do |level| 224 | #ctl_slide(level, slide_list) if audible() 225 | with_fx :reverb, room: 0.9 do 226 | in_thread do 227 | with_transpose 0.1 do 228 | pl_synth synth_list, sine_melody_patt 229 | end 230 | end 231 | in_thread do 232 | pl_synth synth_list, sine_melody_patt 233 | end 234 | in_thread do 235 | with_transpose 0.1 do 236 | pl_synth synth_list, sine_melody2_patt 237 | end 238 | end 239 | in_thread do 240 | pl_synth synth_list, sine_melody2_patt 241 | end 242 | sleep sine_melody_length 243 | end 244 | end 245 | end 246 | 247 | 248 | live_loop :mod_pad_loop do 249 | synth_list = [ 250 | {synth: :beep, params: {}}, 251 | {synth: :mod_beep, params: {mod_phase: 0.33, mod_range: 5, mod_wave:1, cutoff: 30, mod_pulse_width: 0.5}} 252 | ] 253 | with_fx :level, amp: mod_pad_level do 254 | with_fx :reverb, room: 0.8 do 255 | with_fx :rlpf, cutoff: 85, res: 0.5 do 256 | sync :splashed 257 | pl_synth synth_list, mod_pad_patt 258 | end 259 | end 260 | end 261 | end 262 | 263 | 264 | live_loop :breath_loop do 265 | synth_list = [ 266 | # {synth: name, params: params_hash} 267 | {synth: :hollow, params: {cutoff: 60, attack: 0, sustain: 0, release: 1, amp: 0.7, res: 0.9}}, 268 | {synth: :growl, params: {cutoff: 50, attack: 0, sustain: 0, release: 1, amp: 1.3, res: 0.4}}, 269 | ] 270 | sync :mod_pad_loop 271 | with_fx :level, amp: breath_level do 272 | with_fx :reverb, room: 0.8 do 273 | pl_synth synth_list, breath_patt 274 | end 275 | end 276 | #splash(breath_length) if do_splash 277 | end 278 | 279 | live_loop :pad_loop do 280 | synth_list = [ 281 | # {synth: name, params: params_hash} 282 | {synth: :dark_ambience, params: {sustain: 0, release: 1}} 283 | ] 284 | sync :breath_loop 285 | with_fx :level, amp: pad_level do |level| 286 | #ctl_slide(level, slide_list) if audible() 287 | pl_synth synth_list, pad_patt 288 | end 289 | end 290 | 291 | live_loop :arp_loop do 292 | synth_list = [ 293 | # {synth: name, params: params_hash} 294 | {synth: :tri, params:{}} 295 | ] 296 | sync :breath_loop 297 | in_thread do 298 | with_fx :level, amp: arp_level do |level| 299 | #ctl_slide(level, slide_list) if audible() 300 | with_fx :reverb, room: 0.8 do 301 | with_fx :echo, phase: 1, decay: 24 do 302 | uncomment do 303 | pl_synth synth_list, arp_patt 304 | end 305 | comment do 306 | sleep arp_length 307 | pl_synth synth_list, arp_patt3 308 | end 309 | comment do 310 | pl_synth synth_list, arp_patt 311 | end 312 | comment do 313 | sleep arp_length 314 | pl_synth synth_list, arp_patt4 315 | end 316 | end 317 | end 318 | end 319 | end 320 | sleep pad_length 321 | end 322 | -------------------------------------------------------------------------------- /sonic-pi/synthtober_2018/2018_10_01_minor_chill.rb: -------------------------------------------------------------------------------- 1 | live_loop :met do 2 | sleep 2 3 | end 4 | 5 | live_loop :one, sync: :met do 6 | use_random_seed 383654 + look 7 | ns = (scale :f3, :minor_pentatonic, num_octaves: 2).shuffle.take(5) 8 | set(:ns, ns) 9 | ds = (knit 0.25, 4, 3, 1) 10 | 11 | times = (ring 1, 2).choose 12 | set(:times, times) 13 | (times * 5).times do 14 | tick 15 | s = synth :tri, note: ns.look, release: ds.look, cutoff: 90 16 | control s, cutoff_slide: 0.125, cutoff: 60 17 | sleep ds.look 18 | end 19 | end 20 | 21 | live_loop :two, sync: :met do 22 | use_random_seed 383654 + look 23 | ns = (ring get(:ns).rotate(2).first, get(:ns).rotate(2).last) 24 | 25 | d = (ring 1, 2, 3).choose 26 | ds = (ring d, 4 - d) 27 | times = get(:times) 28 | with_fx :rlpf, cutoff: 80 do 29 | with_fx :bitcrusher, sample_rate: 3000 do 30 | (times * 2).times do 31 | tick 32 | n = ns.look - 24 33 | n += 12 if n < 36 34 | synth :fm, note: n, sustain: ds.look - 0.5, depth: 2, cutoff: 70 35 | sleep ds.look 36 | end 37 | end 38 | end 39 | end 40 | 41 | live_loop :three, sync: :met do 42 | ns = get(:ns).rotate(3) 43 | ds = (ring 4) 44 | 45 | with_fx :reverb, room: 1 do 46 | with_fx :echo, phase: 0.75, decay: 4 do 47 | s = synth :prophet, amp: 0.5, note: ns.first, attack: ds.look / 2.0, release: ds.look / 2.0, cutoff: 60 48 | synth :prophet, amp: 0.5, note: ns.drop(1).take(1).look, release: 0.25, cutoff: 80 49 | control s, cutoff_slide: 4, cutoff: 120 50 | sleep ds.look 51 | end 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /sonic-pi/synthtober_2018/README.md: -------------------------------------------------------------------------------- 1 | # #Synthtober 2018 2 | 3 | A collection of [Sonic Pi](https://sonic-pi.net) noodling and experimentation, coded over the course of October 2018. 4 | 5 | Thanks to [Factoid](https://github.com/Factoid) for the inspiration :smile: 6 | 7 | The pieces may be short loops, tunes in various states of completion, sound effect tests, etc. 8 | 9 | "*Like #inktober, but less graphic."*\* 10 | ___ 11 | \* Until I practice my skills at programming some visuals anyway... 12 | -------------------------------------------------------------------------------- /sonic-pi/synthtober_2018/ten.rb: -------------------------------------------------------------------------------- 1 | use_bpm 50 2 | 3 | live_loop :met do 4 | sleep 2 5 | end 6 | 7 | live_loop :hollow, sync: :met do 8 | with_fx :reverb, room: 1 do 9 | with_fx :bitcrusher, bits: 7, sample_rate: 6000, cutoff: 90, mix: 0.5 do 10 | with_fx :rbpf, centre: 65, res: 0.9, mix: 1, amp: 3 do 11 | with_fx :distortion, mix: 0.1, distort: 0.4 do 12 | ns = (ring :f3, :g3, :a3, :e3, :f3, :g3, :d3, :a3) 13 | tick 14 | synth :hollow, amp: 2, note: ns.look, sustain: 8, release: 0.25, cutoff: 70 15 | sleep 8 16 | end 17 | end 18 | end 19 | end 20 | end 21 | 22 | live_loop :bass, sync: :met do 23 | stop 24 | ns = (ring :d2, :c2, :d2, :c2, :d2, :c2, :g1, :bb1) 25 | with_fx :rbpf, centre: 60, res: 0.8, mix: 0.9, amp: 3 do 26 | with_fx :distortion, distort: 0.6, amp: 0.8 do |d| 27 | with_fx :rhpf, cutoff: 90, mix: 0.5 do 28 | tick 29 | distort = true 30 | s = synth :square, note: ns.look, amp: 1, sustain: 8, release: 0.05, pan: 0.5, cutoff: 55 31 | s = synth :tri, note: ns.look, amp: 1, sustain: 8, release: 0.05, pan: 0.5, cutoff: 100 32 | control d, distort_slide: 2, distort: 0.995 if distort 33 | sleep 2 34 | control d, distort_slide: 6, distort: 0.5 if distort 35 | sleep 6 36 | end 37 | end 38 | end 39 | end 40 | 41 | live_loop :organ, sync: :met do 42 | #stop 43 | n1s1 = (ring :d4, :g4, :c4, :a4, :g4, :b3, :e4, :c4) 44 | n1s2 = (ring :d4, :b3, :c4, :d4, :e4, :g4, :d4, :c4) 45 | n1s3 = (ring :b3, :e4, :d4, :g4, :e4, :g4, :b4, :c5) 46 | n1s4 = (ring :b4, :g4, :a4, :g4, :a4, :b3, :c4, :d4) 47 | n1 = n1s1 + n1s2 + n1s3 + n1s4 48 | 49 | n2s1 = (ring :d4, :c4, :d4, :a4, :b4, :e4, :g4, :b3) 50 | n2s2 = (ring :c4, :e4, :g4, :d4, :e4, :c4, :d4, :b3) 51 | n2s3 = (ring :e4, :a4, :g4, :d4, :e4, :d4, :g4, :b3) 52 | n2s4 = (ring :a3, :d4, :e4, :g4, :e4, :a4, :g4, :d4) 53 | n2 = n2s1 + n2s2 + n2s3 + n2s4 54 | 55 | ns = n1 + n2 56 | 57 | with_fx :level, amp: 0 do |l| 58 | control l, amp_slide: 32, amp: 1 59 | with_fx :reverb, room: 1 do 60 | with_fx :flanger, mix: 0.3 do 61 | with_fx :tanh, mix: 0.2, reps: (8 * 32) do 62 | tick 63 | with_fx :rbpf, centre: 75, res: 0.8, mix: 0.7 do 64 | s = synth :dtri, amp: 0.25, note: ns.look, release: 0.25, pan: -0.35 65 | s2 = synth :pretty_bell, amp: 0.25, note: ns.look + 12, attack: 0.01, release: 0.375, pan: -0.35 66 | end 67 | sleep 0.125 68 | end 69 | end 70 | end 71 | end 72 | end 73 | 74 | ns1 = (ring :e5, :g5, :r, :d5, :d5, :d5, :r, :d5, :r, :d5, :r, :c5, :d5, :e5, :c5, :d5) 75 | ns2 = (ring :e5, :g5, :r, :d5, :d5, :d5, :r, :d5, :r, :d5, :r, :c5, :c5, :b4, :a4, :b4) 76 | ns3 = (ring :e5, :g5, :d5, :e5, :c5, :d5, :b4, :c5, :a4, :b4, :c5, :d5, :e5, :g5, :a5, :b5) 77 | ns4 = (ring :d5, :e5, :r, :e5, :e5, :a5, :r, :b5, :r, :b5, :r, :b5, :b5, :a5, :a5, :a5) 78 | ns5 = (ring :g5, :g5, :r, :g5, :g5, :g5, :r, :g5, :r, :g5, :r, :g5, :g5, :g5, :g5, :g5) 79 | 80 | ns_a = ns1 + ns2 + ns1 + ns3 + ns4 + ns5 + ns4 + ns5 81 | set(:sub_a_ns, ns_a) 82 | set(:sub_a_ds, (ring 0.125)) 83 | 84 | 85 | define :mel do |ns, ds, &block| 86 | with_fx :echo, phase: 0.5, decay: 4, mix: 0.2 do 87 | with_fx :rbpf, centre: 75, res: 0.6, mix: 0.8 do 88 | with_fx :rbpf, centre: 100, cutoff: 90, res: 0.8, mix: 0.9, amp: 1.5 do |b| 89 | with_fx :tanh, mix: 0.2 do 90 | with_fx :distortion, distort: 0.95, amp: 0.7 do 91 | ns.length.times do 92 | tick 93 | block.call 94 | synth :sine, amp: 0.1, note: ns.look - 12, attack: 0.02, release: 0.105, pan: 0.25 if get(:on) 95 | synth :sine, amp: 0.4, note: ns.look, attack: 0.02, release: 0.105, pan: 0.25 if get(:on) 96 | control b, centre_slide: 0.125, centre: 80, cutoff_slide: 0.125, res_slide: 0.125, cutoff: 70, res: 0.3 if get(:on) 97 | control b, centre_slide: 0.05, centre: 100, cutoff_slide: 0.05, cutoff: 90, res_slide: 0.05, res: 0.8 unless get(:on) 98 | 99 | sleep 0.125 100 | end 101 | end 102 | end 103 | end 104 | end 105 | end 106 | end 107 | 108 | 109 | live_loop :sub1, sync: :met do 110 | stop 111 | ns = get(:sub_a_ns) 112 | ds = get(:sub_a_ds) 113 | mel(ns, ds) do 114 | set(:on, look % 2 == 0) 115 | end 116 | end 117 | 118 | live_loop :sub2, sync: :met do 119 | stop 120 | ns = get(:sub_a_ns) 121 | ds = get(:sub_a_ds) 122 | mel(ns, ds) do 123 | set(:on, look % 2 == 1) 124 | end 125 | end 126 | 127 | ns6 = (ring :b5, :c6, :r, :c6, :c6, :c6, :r, :c6, :r, :c6, :r, :c6, :c6, :b5, :b5, :b5) 128 | ns_b = ns6 + ns6 + ns6 + ns6 129 | set(:sub_b_ns, ns_b) 130 | set(:sub_b_ds, (ring 0.125)) 131 | 132 | live_loop :sub3, sync: :met do 133 | stop 134 | ns = get(:sub_b_ns) 135 | ds = get(:sub_b_ds) 136 | 137 | sleep 8 138 | mel(ns, ds) do 139 | set(:on, look % 2 == 0) 140 | end 141 | end 142 | 143 | live_loop :sub4, sync: :met do 144 | stop 145 | ns = get(:sub_b_ns) 146 | ds = get(:sub_b_ds) 147 | 148 | sleep 8 149 | mel(ns, ds) do 150 | set(:on, look % 2 == 1) 151 | end 152 | end 153 | -------------------------------------------------------------------------------- /sonic-pi/synthtober_2018/wrap_beats.rb: -------------------------------------------------------------------------------- 1 | live_loop :met do 2 | sleep 2 3 | end 4 | 5 | define :in_wrapper do |&block| 6 | with_fx :wobble, phase: 8, reps: 8, mix: 1 do 7 | block.call 8 | end 9 | end 10 | 11 | live_loop :ehh, sync: :met do 12 | in_wrapper do 13 | with_fx :rbpf, centre: 90, mix: 0.9, amp: 2 do 14 | with_fx :tanh, mix: 0.5 do 15 | sample :elec_pop 16 | sleep 1 17 | end 18 | end 19 | end 20 | end 21 | 22 | live_loop :bee, sync: :met do 23 | in_wrapper do 24 | with_fx :bitcrusher do 25 | sleep 0.5 26 | sample :bd_tek, rate: 0.5 27 | sleep 0.5 28 | end 29 | end 30 | end 31 | 32 | live_loop :sea, sync: :met do 33 | in_wrapper do 34 | sleep 0.625 35 | sample :tabla_ke2 36 | sleep 0.375 37 | end 38 | end 39 | 40 | live_loop :dee, sync: :met do 41 | in_wrapper do 42 | sleep 0.75 43 | sample :elec_twip, beat_stretch: 2 44 | sleep 0.25 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /sonic-pi/toplap15/README.md: -------------------------------------------------------------------------------- 1 | # TOPLAP15 2 | 3 | The files here contain the code I used for a [Sonic Pi](https://sonic-pi.net) music live coding performance as part of the [TOPLAP](https://toplap.org/) 15th birthday celebrations. 4 | 5 | Each file contains a separate musical idea, many of which I had originally intended on extending or taking in different directions. 6 | However, for the purposes of the TOPLAP performance I made them flow together as-is. 7 | As such, there are several bits of code in here that I did not end up fully using, due partly to time constraints. 8 | 9 | The code is in its end-of-performance state. 10 | -------------------------------------------------------------------------------- /sonic-pi/toplap15/buffer0.rb: -------------------------------------------------------------------------------- 1 | live_loop :met do 2 | sleep 2 3 | end 4 | 5 | # s :ambi_soft_buzz, a 0.5, bs 2 6 | 7 | live_loop :ring_buzz, sync: :met do 8 | stop 9 | with_fx :slicer, seed: 49326, probability: 0.9, phase: 0.125, prob_pos: 0.5, mix: 0.8 do 10 | with_fx :echo, phase: 0.375, mix: 0.5, decay: 8 do 11 | with_fx :reverb, room: 1 do 12 | with_fx :ring_mod, freq: 60, mix: 0.5 do 13 | sample :ambi_soft_buzz, amp: 0.5, beat_stretch: 2 14 | sleep 4 15 | end 16 | end 17 | end 18 | end 19 | end 20 | 21 | # s :bass_hit_c, a 0.5, rt -1, bs 1, r 2, l 70 22 | 23 | live_loop :ring_bass, sync: :met do 24 | stop 25 | with_fx :echo, phase: 0.375, decay: 8 do 26 | with_fx :ring_mod, freq: 60, mix: 0.25 do 27 | with_fx :tanh do 28 | sample :bass_hit_c, amp: 0.5, rate: -1, beat_stretch: 1, release: 2, lpf: 70 29 | sleep 4 30 | end 31 | end 32 | end 33 | end 34 | 35 | # s :ambi_dark_woosh, a 0.5, bs 4 36 | 37 | live_loop :woosh, sync: :met do 38 | stop 39 | with_fx :reverb, room: 1 do 40 | with_fx :bitcrusher, sample_rate: 3000 do 41 | sample :ambi_dark_woosh, amp: 0.5, beat_stretch: 4 42 | sleep 8 43 | end 44 | end 45 | end 46 | 47 | # s :bd_fat, a 0.5 48 | 49 | live_loop :fat, sync: :met do 50 | stop 51 | with_fx :bitcrusher do 52 | sample :bd_fat, amp: 0.5 53 | sleep 1 54 | end 55 | end 56 | 57 | # s :elec_soft_kick, l 60 if (spr 4, 7).l 58 | 59 | live_loop :elec_kick, sync: :met do 60 | stop 61 | tick 62 | sample :elec_soft_kick, lpf: 60 if (spread 4,7).look 63 | sleep 0.125 64 | end 65 | 66 | # s :drum_snare_soft, l 70 if (spr 5, 7).l 67 | 68 | live_loop :soft_snare, sync: :met do 69 | stop 70 | tick 71 | sample :drum_snare_soft, lpf: 70 if (spread 5,7).look 72 | sleep 0.125 73 | end 74 | 75 | # sth growl, a 0.4, n [:e3, :e4], r 16 76 | 77 | live_loop :growl1, sync: :met do 78 | stop 79 | with_fx :rlpf, cutoff: rrand(60, 100) do 80 | with_fx :reverb, room: 1, amp: 0.8 do 81 | with_fx :bitcrusher, bits: 5, mix: 0.5, cutoff: 110 do 82 | synth :growl, amp: 0.4, note: [:e3, :e4], release: 16 83 | sleep 16 84 | end 85 | end 86 | end 87 | end 88 | -------------------------------------------------------------------------------- /sonic-pi/toplap15/buffer1.rb: -------------------------------------------------------------------------------- 1 | kck_t = (ring 0, 0.375, 0.5, 1.75) 2 | kck_a = (ring 0.75, 0.75, 0.5, 0.75) 3 | 4 | bd_t = (ring 0.25, 0.5, 1.25, 1.5) 5 | 6 | sn_t = (ring 0, 0.125, 0.75, 1, 1, 1.375, 1.75) 7 | 8 | sn2_t = (ring 0, 16) 9 | sn2_rt = (ring 1, -1) 10 | 11 | tom_t = (ring 0, 0.125) 12 | 13 | tck_t = (range 0, 8, 0.125) 14 | tck_l = (knit 70, 3, 120, 1, 70, 4) 15 | 16 | live_loop :met, sync: :m do 17 | sleep 2 18 | end 19 | 20 | 21 | # s :elec_hol_kick, a a, bs 0.125, l 100 22 | 23 | live_loop :kck, sync: :met do 24 | stop 25 | with_fx :bitcrusher, bits: 8, sample_rate: 3000 do 26 | at kck_t, kck_a do |a| 27 | sample :elec_hollow_kick, amp: a, beat_stretch: 0.125, lpf: 100 28 | end 29 | sleep 2 30 | end 31 | end 32 | 33 | # at bd_t 34 | # s bd_gas, a 0.5 35 | # fx tan 36 | # at sn_t 37 | # s elec_mid_snare, a 0.5, bs 0.25, l 70 38 | 39 | live_loop :bd_sn, sync: :met do 40 | stop 41 | with_fx :lpf, cutoff: 80 do 42 | with_fx :slicer, phase: 0.125, mix: 0.75 do 43 | with_fx :tanh, mix: 0.5 do 44 | at bd_t do 45 | sample :bd_gas, amp: 0.5 46 | end 47 | end 48 | end 49 | end 50 | with_fx :tanh do 51 | at sn_t do 52 | sample :elec_mid_snare, amp: 0.5, beat_stretch: 0.25, lpf: 70 53 | end 54 | end 55 | sleep 2 56 | end 57 | 58 | # s elec_filt_snare, a 0.5, bs 16, rt rt 59 | 60 | live_loop :sn2, sync: :met do 61 | stop 62 | with_fx :bitcrusher, sample_rate: 2000, cutoff: 80 do 63 | with_fx :ring_mod, freq: 30, mix: 0.5 do 64 | at sn2_t, sn2_rt do |rt| 65 | sample :elec_filt_snare, amp: 0.5, beat_stretch: 16, rate: rt 66 | end 67 | end 68 | end 69 | sleep 32 70 | end 71 | 72 | # s drum_tom_hi_soft, l 80 73 | 74 | live_loop :tom, sync: :met do 75 | stop 76 | with_fx :reverb, room: 0.9 do 77 | with_fx :echo, phase: 0.5, decay: 8, mix: 0.75 do 78 | with_fx :ring_mod, freq: rrand(30, 90), mix: 0.9 do 79 | at tom_t do 80 | sample :drum_tom_hi_soft, lpf: 80 81 | end 82 | end 83 | end 84 | end 85 | sleep 4 86 | end 87 | 88 | # s elec_tick, a 1, l l, pn rrand(-1, 1) 89 | 90 | live_loop :tck, sync: :met do 91 | stop 92 | at tck_t, tck_l do |l| 93 | sample :elec_tick, amp: 1.5, lpf: l, pan: rrand(-1, 1) 94 | end 95 | sleep 8 96 | end 97 | 98 | # sth tri, n ns.l, rel ds.l, co 100 99 | 100 | live_loop :tri, sync: :met do 101 | stop 102 | ns = (ring :c1) 103 | ds = (ring 8) 104 | tick 105 | with_fx :wobble, phase: 8, invert_wave: 1 do 106 | with_fx :bitcrusher, bits: 6, sample_rate: 3000 do 107 | with_fx :tanh, mix: 0.75 do 108 | synth :tri, note: ns.look, release: ds.look, cutoff: 100 109 | sleep ds.look 110 | end 111 | end 112 | end 113 | end -------------------------------------------------------------------------------- /sonic-pi/toplap15/buffer2.rb: -------------------------------------------------------------------------------- 1 | define :slide do |pointer, duration, opt| 2 | key, finish = *opt.flatten 3 | var = :"#{pointer}_#{key}" 4 | start = get(var) 5 | return if start == finish 6 | l = (line start, finish, steps: 11, inclusive: true).stretch(2).drop(1).butlast.ramp 7 | dt = duration / 20.0 8 | puts "slide #{pointer} #{key} #{var} #{start} #{finish} #{duration}" 9 | in_thread do 10 | l.length.times do 11 | control get(pointer), key => l.tick, (key.to_s+"_slide").to_sym => dt 12 | sleep dt 13 | set var, l.look 14 | end 15 | end 16 | end 17 | 18 | #set initial volume value on first run 19 | defonce :setup, override: true do 20 | set :growl_level_amp, 1 21 | set(:pad1_level_amp, 1) 22 | set(:pad2_level_amp, 1) 23 | set(:arp_level_amp, 1) 24 | set(:pulse_level_amp, 1) 25 | set(:hats_level_amp, 0) 26 | set(:bd_level_amp, 1) 27 | set(:twip_level_amp, 1) 28 | set(:tri_level_amp, 1) 29 | end 30 | 31 | live_loop :met do 32 | sleep 2 33 | end 34 | 35 | # sth tri, a 0.5, n a1 36 | # sth dark_a, a 0.3 n a1, no 1, rng 0.2 37 | # fx rm, fq 62, mx 0.8 38 | # sth dark_a, a 0.3, n d2, no 0, rng 1 39 | 40 | live_loop :pad1, sync: :met do 41 | with_fx :level, amp: get(:pad1_level_amp) do |lv| 42 | set(:pad1_level, lv) 43 | with_fx :slicer, phase: 0.125, mix: 0, mix_slide: 32 do |s| 44 | use_synth_defaults sustain: 64, release: 4 45 | control s, mix: 0.5 46 | synth :tri, amp: 0.5, note: :a1 47 | synth :dark_ambience, amp: 0.3, note: :a1, noise: 1, ring: 0.2 48 | with_fx :ring_mod, freq: 62, mix: 0.8 do 49 | synth :dark_ambience, amp: 0.3, note: :d2, noise: 0, ring: 1 50 | end 51 | sleep 32 52 | control s, mix: 0 53 | sleep 32 54 | end 55 | end 56 | end 57 | 58 | # sll 59 | # sth blade a 3, n [d2, g3, a3], at 8, r 8, co 70 60 | # sl 16 61 | live_loop :pad2, sync: :met do 62 | with_fx :level, amp: get(:pad2_level_amp) do |lv| 63 | set(:pad2_level, lv) 64 | with_fx :level, amp: get(:dm_level_amp) do 65 | synth :blade, amp: 3, note: [:d2, :g3, :a3], attack: 8, release: 8, cutoff: 70 66 | sleep 16 67 | end 68 | end 69 | end 70 | 71 | # sth sine a 0.3, n ns.tick, r 0.125 72 | 73 | live_loop :arp, sync: :met do 74 | with_fx :level, amp: get(:arp_level_amp) do |lv| 75 | set(:arp_level, lv) 76 | ns = (ring :d5, :c5, :a4, :d5) + 77 | (ring :c5, :a4, :g4, :c5) + 78 | (ring :a4, :g4, :f4, :a4) + 79 | (ring :g4, :a4, :c5, :e5) 80 | with_fx :panslicer, phase: 0.25, probability: 0.9, seed: 3837453, pan_min: -0.75, pan_max: 0.75, mix: 0.5 do 81 | with_fx :echo, phase: 0.25, mix: 0.5, decay: 2, reps: 32 do 82 | synth :sine, amp: 0.3, note: ns.tick, release: 0.125 83 | sleep 0.125 84 | end 85 | end 86 | end 87 | end 88 | 89 | 90 | # sth subpulse, a 1.5, n [d5, d4], at 0.25, r 8, co 70 91 | 92 | live_loop :pulse, sync: :met do 93 | with_fx :level, amp: get(:pulse_level_amp) do |lv| 94 | set(:pulse_level, lv) 95 | with_fx :reverb, room: 1 do 96 | with_fx :rbpf, centre: 60, mix: 1, centre_slide: 0.25 do |b| 97 | control b, centre: 70 98 | synth :subpulse, amp: 1.5, note: [:d4, :d5], attack: 0.25, release: 8, cutoff: 70 99 | sleep 16 100 | end 101 | end 102 | end 103 | end 104 | 105 | -------------------------------------------------------------------------------- /sonic-pi/toplap15/buffer3.rb: -------------------------------------------------------------------------------- 1 | set(:root, :c5) 2 | set(:arp_p, (ring 4, 12, 5, 7)) 3 | 4 | set(:a_slide, 32) 5 | set(:a, 1) 6 | 7 | set(:bass_p, (ring 36, 36, 34, 38)) 8 | 9 | define :arp do |transpose = 0| 10 | get(:root) + get(:arp_p).look(:n) + transpose 11 | end 12 | 13 | define :bass do |transpose = 0| 14 | get(:root) - get(:bass_p).look(:n) + transpose 15 | end 16 | 17 | 18 | live_loop :met do 19 | sleep 2 20 | end 21 | 22 | 23 | # sth tri, n arp, at 0.125, r 0.125 24 | 25 | live_loop :arp1, sync: :met do 26 | stop 27 | ds = (ring 0.25, 0.25, 0.25, 0.25) 28 | with_fx :level, amp: 1, amp_slide: get(:a_slide) do |l| 29 | control l, amp: get(:a) 30 | with_fx :rlpf, cutoff: 50, mix: 1, amp: 2, reps: 128 do 31 | tick(:n) 32 | synth :tri, note: arp, attack: 0.125, release: 0.125 33 | sleep ds.look(:n) 34 | end 35 | end 36 | end 37 | 38 | # sth saw, n g(:arp_p) + g(:root) - 12, sus 8, r 0 39 | 40 | live_loop :arp2, sync: :met do 41 | stop 42 | with_fx :level, amp: 1, amp_slide: get(:a_slide) do |l| 43 | control l, amp: get(:a) 44 | with_fx :tremolo, phase: 0.25, depth: 0.8 do 45 | with_fx :rlpf, cutoff: 70, reps: 4 do 46 | synth :saw, note: get(:arp_p) + get(:root) - 12, sustain: 8, release: 0 47 | sleep 8 48 | end 49 | end 50 | end 51 | end 52 | 53 | # fx flanger, fb 0.8, ph 4, mx 0.2 54 | # sth subpulse, a 0.3, n bass(12), r 8, pn -0.3 55 | # fx rlpf, co 65 56 | # sth prophet, a 0.3, n bass, sus 6, r 2, pn 0.3 57 | 58 | live_loop :bass_prophet, sync: :arp2 do 59 | stop 60 | tick(:n) 61 | with_fx :level, amp: 1 do 62 | with_fx :reverb, room: 1 do 63 | with_fx :echo, phase: 0.5, decay: 8, mix: 0.8 do 64 | with_fx :slicer, seed: 50726423, phase: 0.125, probability: 1, prob_pos: 0.5, mix: 0.3 do 65 | with_fx :flanger, feedback: 0.8, phase: 4, mix: 0.2 do 66 | synth :subpulse, amp: 0.3, note: bass(12), release: 8, pan: -0.3 67 | end 68 | with_fx :rlpf, cutoff: 65 do 69 | synth :prophet, amp: 0.3, note: bass, sustain: 6, release: 2, pan: 0.3 70 | end 71 | end 72 | sleep 8 73 | end 74 | end 75 | end 76 | end -------------------------------------------------------------------------------- /sonic-pi/toplap15/buffer4.rb: -------------------------------------------------------------------------------- 1 | live_loop :met do 2 | sleep 2 3 | end 4 | 5 | # s :glitch_perc1, hp 100 if (spr 5, 8).l 6 | # s :drum_cym_closed, hp: (r 100, 125).t(f) if (b 0, 0, 0, 0, 1, 0, 1, 1).l 7 | 8 | live_loop :hats, sync: :met do 9 | stop 10 | with_fx :level, amp: get(:hats_level_amp) do |lv| 11 | set(:hats_level, lv) 12 | 16.times do 13 | tick 14 | sample :glitch_perc1, hpf: 100 if (spread 5,8).look 15 | sample :drum_cymbal_closed, hpf: (ring 100, 125).tick(:f) if (bools 0,0,0,0,1,0,1,1).look 16 | sleep 0.125 17 | end 18 | end 19 | end 20 | 21 | 22 | # s :bd_boom, a 2 if (b 1, 0, 0, 1, 0, 0, (b 0, 0, 0, 0, 0, 0, 0, 1).str(8).t(b), 0).l 23 | 24 | live_loop :bd, sync: :bd_on do 25 | #sync :bass_prophet 26 | with_fx :level, amp: 1 do |lv| 27 | set(:bd_level, lv) 28 | 64.times do 29 | tick 30 | sample :bd_boom, amp: 2 if (bools 1,0,0,1,0,0,(bools 0,0,0,0,0,0,0,1).stretch(8).tick(:b),0).look 31 | sleep 0.125 32 | end 33 | end 34 | end 35 | 36 | 37 | # s :elec_twip if (b 0, 0, 0, 0, 1, 0, 0, 0).l 38 | 39 | live_loop :twip, sync: :twip_on do 40 | stop 41 | with_fx :level, amp: get(:twip_level_amp) do |lv| 42 | set(:twip_level, lv) 43 | 16.times do 44 | tick 45 | sample :elec_twip if (bools 0,0,0,0,1,0,0,0).look 46 | sleep 0.125 47 | end 48 | end 49 | end 50 | 51 | 52 | live_loop :seq, sync: :met do 53 | at 48 do 54 | puts "--------------------hats on!" 55 | slide :hats_level, 16, amp: 1 56 | slide :pad1_level, 16, amp: 0 57 | slide :pad2_level, 16, amp: 0 58 | slide :arp_level, 16, amp: 0 59 | slide :pulse_level, 16, amp: 0 60 | end 61 | at 88 do 62 | puts "--------------------bddddddd on!" 63 | cue :bd_on 64 | end 65 | at 104 do 66 | cue :twip_on 67 | end 68 | at 120 do 69 | cue :tri 70 | end 71 | 72 | sleep 120 73 | stop 74 | end 75 | 76 | # syn tri, a 0.5, n ns.l - 12, sus ds.l, co 100 77 | # syn sine, a 0.5, n ns2.l + o, sus ds.l 78 | 79 | live_loop :tanh_tri, sync: :tri do 80 | stop 81 | with_fx :level, amp: get(:tri_level_amp) do |lv| 82 | set(:tri_level, lv) 83 | ns = (knit :r, 1, :g4, 5, :r, 1, :f4, 5, :r, 1, :f4, 5, :r, 1, :c4, 5) 84 | ns2 = (knit :r, 1, :c5, 5, :r, 1, :a4, 5, :r, 1, :a4, 5, :r, 1, :g4, 5) 85 | 86 | ds = (knit 0.375, 1, 0.125, 5).repeat(4) 87 | with_fx :bpf, centre: 80, mix: 0.75, amp: 1.5 do 88 | with_fx :bpf, centre: 70, mix: 0.92, amp: 2 do |bp| 89 | 90 | with_fx :tanh, amp: 0.4, mix: 0.25 do 91 | o = (ring 0, 12).choose 92 | puts o 93 | ns.length.times do 94 | tick 95 | #stop hats 96 | synth :tri, amp: 0.5, note: ns.look - 12, sustain: ds.look, cutoff: 100 97 | synth :sine, amp: 0.5, note: ns2.look + o, sustain: ds.look 98 | control bp, centre: (line 70, 110, steps: 5).tick(:l) if ns.look != :r 99 | sleep ds.look 100 | end 101 | end 102 | end 103 | end 104 | end 105 | end 106 | -------------------------------------------------------------------------------- /sonic-pi/toplap15/buffer5.rb: -------------------------------------------------------------------------------- 1 | use_bpm 100 2 | 3 | live_loop :met do 4 | sleep 2 5 | end 6 | 7 | slide :bd_level, 16, amp: 0 8 | slide :tri_level, 16, amp: 0 9 | slide :hats_level, 16, amp: 0 10 | slide :twip_level, 16, amp: 0 11 | 12 | # sth mod_sine, a 0.5, n ns.look, mod_r 7, mod_ph 1, mod_w 1, at 16, r 16 13 | 14 | live_loop :m1, sync: :met do 15 | stop 16 | with_fx :reverb, room: 1, mix: 0.8 do 17 | ns = (ring :e3, :b2) 18 | tick 19 | synth :mod_sine, amp: 0.5, note: ns.look, mod_range: 7, mod_phase: 1, attack: 16, release: 16 20 | sleep 32 21 | end 22 | end 23 | 24 | # sth mod_sine, a 0.5, n ns.look, mod_r 3, mod_ph 1, at 16, r 16 25 | 26 | live_loop :m2, sync: :met do 27 | stop 28 | with_fx :reverb, room: 1, mix: 0.8 do 29 | ns = (ring :e2, :b3) 30 | tick 31 | synth :mod_sine, amp: 0.5, note: ns.look, mod_range: 3, mod_phase: 1, attack: 16, release: 16 32 | sleep 32 33 | end 34 | end 35 | 36 | # sth square, a 0.5, n [ns.l, ns.l - 12], r ds.look 37 | 38 | live_loop :m3, sync: :m1 do 39 | stop 40 | with_fx :reverb, room: 1, mix: 0.8 do 41 | ns = (ring :e3, :d3, :fs3) 42 | ds = (ring 28, 8, 28) 43 | tick 44 | set(:tri_bass, ns.look == :fs3 ? :b1 : :e1) 45 | cue :two if ns.look == :e3 46 | with_fx :bitcrusher, bits: 6, sample_rate: 3000, cutoff: 90, mix: 0.3 do 47 | with_fx :rlpf, res: 0.7, cutoff: 60 do 48 | synth :square, amp: 0.5, note: [ns.look, ns.look - 12], release: ds.look 49 | sleep ds.look 50 | end 51 | end 52 | 53 | end 54 | end 55 | -------------------------------------------------------------------------------- /sonic-pi/toplap15/buffer6.rb: -------------------------------------------------------------------------------- 1 | # sth tri, n ns, r 0.25 if (spr 3, 8).l 2 | 3 | use_bpm 100 4 | live_loop :tri_b, sync: :m3 do 5 | stop 6 | with_fx :rlpf, cutoff: 70, res: 0.8, cutoff_slide: 0.25 do |r| 7 | with_fx :echo, decay: 4, phase: 0.25, mix: 0.5 do 8 | with_fx :tanh, krunch: 10, mix: 0.5, reps: 32 do |t| 9 | tick 10 | ns = get(:tri_bass) 11 | synth :tri, note: ns, release: 0.25 if (spread 3, 8).look 12 | sleep 0.25 13 | end 14 | end 15 | end 16 | end 17 | 18 | 19 | # sth square, a 0.3, n ns.ch, r ds + 0.2, co 80 20 | 21 | live_loop :bit_sq, sync: :tri_b do 22 | stop 23 | with_fx :wobble, phase: 4, cutoff_max: 100 do 24 | use_random_seed (ring 566272431114, 375436452, 5957425426).tick(:r) #68653661 25 | with_fx :reverb, room: 1, reps: 12 do 26 | tick 27 | ns = (scale :e3, :minor, num_octaves: 2).shuffle.take(5) + (ring :r, :r, :r, :r) 28 | ds = (ring 0.25, 0.25, 0.25, 0.25, 0.5, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.5).choose 29 | with_fx :bitcrusher, bits: 5, mix: 0.2 do 30 | synth :square, amp: 0.3, note: ns.choose, release: ds + 0.2, cutoff: 80 31 | sleep ds 32 | end 33 | end 34 | sleep 12.75 35 | end 36 | end 37 | 38 | 39 | # sth sine 40 | # sth dsaw 41 | 42 | live_loop :muted_arp, sync: :tri_b do 43 | stop 44 | ns = (knit :e3, 1, :g3, 1, :a3, 1, :b3, 1) 45 | ds = (ring 0.25) 46 | with_fx :echo, decay: 8, phase: 1 do 47 | with_fx :reverb, room: 1 do 48 | with_fx :rlpf, cutoff: 70 do 49 | with_fx :tanh, krunch: 20, mix: 0.2 do 50 | with_fx :octaver, mix: 0.2, reps: 4, amp: 0.7 do 51 | 4.times do 52 | tick 53 | use_synth_defaults amp: 0.25, attack: 0.05, attack_level: 0.7, decay_level: 0.5, release: ds.look + 0.15, note: ns.look 54 | synth :sine 55 | synth :dsaw 56 | sleep ds.look 57 | end 58 | sleep 7 59 | end 60 | end 61 | end 62 | end 63 | end 64 | end 65 | 66 | # s = sth saw, a 0.2, n ns.l, at 1, r ds.l - 1, co 95 67 | # slp 1 68 | # ctrl s 69 | 70 | live_loop :hipad, sync: :tri_b do 71 | stop 72 | ns = (ring :fs5) 73 | ds = (ring 8) 74 | with_fx :reverb, room: 1 do 75 | with_fx :wobble, phase: 8, cutoff_max: 100 do 76 | with_fx :flanger do 77 | with_fx :bitcrusher, bits: 5, mix: 0.2 do 78 | tick 79 | s = synth :saw, amp: 0.2, note: ns.look, attack: 1, release: ds.look - 1, cutoff: 95 80 | sleep 1 81 | control s, note_slide: 1, note: ns.look - 2, cutoff_slide: 1, cutoff: 80 82 | t = (ring 8, 12).choose 83 | puts t 84 | sleep t + ds.look - 1 85 | end 86 | end 87 | end 88 | end 89 | end 90 | 91 | # sth dsaw, a 0.2, n ns.l, dcy 0.125, dcy_l 0.5, r 0.25, co 70 92 | 93 | live_loop :dsaw, sync: :tri_b do 94 | stop 95 | ns = (ring [:e5, :b5]) 96 | ds = (ring 0.25) 97 | with_fx :echo, phase: 2, decay: 16 do 98 | with_fx :reverb, room: 1 do 99 | with_fx :rbpf, centre: 100, mix: 0.95, amp: 2 do 100 | 16.times do 101 | tick 102 | synth :dsaw, amp: 0.2, note: ns.look, decay: 0.125, decay_level: 0.5, release: 0.15, cutoff: 70 103 | sleep 0.25 104 | end 105 | sleep 8 106 | end 107 | end 108 | end 109 | end 110 | 111 | # sth tri, a 0.3, n ns.l, at 2, r 6, co 80 112 | # w_trns -0.1 113 | # sth sine, a 0.3, n ns.l, at 2, r 6 114 | 115 | live_loop :detuned, sync: :tri_b do 116 | stop 117 | ns = (ring [:a5, :fs5], [:fs5, :d5]) 118 | ds = (ring 8) 119 | with_fx :reverb, room: 1 do 120 | tick 121 | synth :tri, amp: 0.3, note: ns.look, attack: 2, release: 6, cutoff: 80 122 | with_transpose -0.1 do 123 | synth :sine, amp: 0.3, note: ns.look, attack: 2, release: 6 124 | end 125 | sleep ds.look * 2 126 | end 127 | end 128 | 129 | -------------------------------------------------------------------------------- /sonic-pi/toplap15/buffer7.rb: -------------------------------------------------------------------------------- 1 | # 3 s bd_tek, rt rrand(0.5, 2.5), co rrand_i(80, 100) if (spr 3, 9).l 2 | # 1 s elec_flip, rt rrand(1, 1.5), co rrand_i(60, 100) if (spr 5, 9).l 3 | # 2 s elec_plip, rt rrand(1.5, 2), co rrand_i(60, 120) if (spr 14, 16).l 4 | 5 | 6 | define :bs do |seed| 7 | use_random_seed seed 8 | tick_reset 9 | 16.times do 10 | tick 11 | sample :bd_tek, rate: rrand(0.5,2.5), lpf: rrand(80, 100) if (spread 3,9).look 12 | sample :elec_flip, rate: rrand(1,1.5), lpf: rrand(60, 100) if (spread 5,9).look 13 | sample :elec_plip, rate: rrand(1.5,2), lpf: rrand(60, 120) if (spread 14,16).look 14 | sleep 0.25 15 | end 16 | end 17 | 18 | live_loop :fd, sync: :m3 do 19 | use_bpm 100 20 | stop 21 | with_fx :echo, phase: 0.25, decay: 4, mix: 0.1 do 22 | with_fx :distortion, mix: 0.0 do 23 | with_fx :bitcrusher, sample_rate: 3000, bits: 4.5, cutoff: 100, mix: 0.5 do 24 | with_fx :ring_mod, freq: 30, mix: 0.5 do 25 | 3.times do 26 | bs(3300156) 27 | end 28 | bs(3300142) 29 | end 30 | end 31 | end 32 | end 33 | end -------------------------------------------------------------------------------- /sonic-pi/toplap15/buffer8.rb: -------------------------------------------------------------------------------- 1 | use_bpm 100 2 | 3 | 4 | # sth sine, a 0.5, n ns.l, at a, r d - a 5 | # sth saw, a 0.5, n ns2.l, at a, r d - a 6 | # sth chipbass, a 1, n ns3.l, at a, r d - a 7 | 8 | live_loop :chord, sync: :fd do 9 | stop 10 | use_random_seed 564361 11 | ns = (ring :d4, :e4, :d4, :c4, :c4) 12 | ns2 = (ring :f3, :d3, :e3, :f3, :e3) 13 | ns3 = (ring :g3, :a3, :fs3, :d3, :f3) 14 | ds = (ring 8) 15 | at = (ring 0.25, 0.5, 1) 16 | with_fx :reverb, room: 1 do 17 | with_fx :rbpf, centre: 50, amp: 2 do |rb| 18 | 5.times do 19 | d = ds.choose 20 | a = at.choose 21 | tick 22 | set(:n, ns3.look) 23 | set(:d, d) 24 | control rb, centre_slide: 1, centre: 70 25 | synth :sine, amp: 0.5, note: ns.look, attack: a, release: d - a 26 | synth :saw, amp: 0.5, note: ns2.look, attack: a, release: d - a 27 | synth :chipbass, amp: 1, note: ns3.look, attack: a, release: d - a 28 | sleep 1 29 | control rb, centre_slide: 1, centre: 50 30 | sleep d - 1 31 | end 32 | end 33 | end 34 | end 35 | 36 | # sth square, a 0.5, n ns3.l - 12, r d, co 60 37 | 38 | live_loop :sq_bass, sync: :fd do 39 | stop 40 | use_random_seed 564361 41 | ns3 = (ring :g3, :a3, :fs3, :d3, :f3) 42 | ds = (ring 8) 43 | at = (ring 0.25, 0.5, 1) 44 | 45 | 5.times do 46 | d = ds.choose 47 | rand_skip 48 | tick 49 | synth :square, amp: 0.5, note: ns3.look - 12, release: d, cutoff: 60 50 | sleep d 51 | end 52 | end 53 | 54 | # sth sine, a 0.12, n ns.l, r ds.l, co 90 55 | 56 | live_loop :sine_echoes, sync: :fd do 57 | stop 58 | ns = (ring :g4, :b4, :d5, :g5, :r, :e5, :c5, :b4, :a4, :c5) 59 | ds = (knit 0.25, 4, 2, 1, 1, 1, 0.25, 2, 2.5, 1, 1, 1) 60 | with_fx :reverb, room: 1, mix: 0.5 do 61 | with_fx :echo, phase: 0.5, decay: 10, reps: ns.length do 62 | tick 63 | synth :sine, amp: 0.12, note: ns.look, release: ds.look, cutoff: 90 64 | sleep ds.look 65 | end 66 | end 67 | end 68 | 69 | # sth sine, a 0.5, n ns.l 70 | # sth saw, a 0.3, n ns.l - 0.15, co 60 71 | 72 | live_loop :dsawed, sync: :fd do 73 | stop 74 | ns = (ring :r, :d4, :d4, :e4, :c4) 75 | ds = (ring 2, 0.75, 0.75, 0.5, 4) 76 | with_fx :reverb, room: 0.8 do 77 | with_fx :flanger, phase: 2, reps: ns.length do 78 | use_synth_defaults attack: 0.125, decay: 0.125, decay_level: 1, release: ds.look 79 | tick 80 | synth :sine, amp: 0.5, note: ns.look 81 | synth :saw, amp: 0.3, note: ns.look - 0.15, cutoff: 60 82 | sleep ds.look 83 | end 84 | end 85 | end 86 | 87 | # sth square, a 0.3, n ns.l, at ds.l*0.25, sus ds.l*0.75, r 0 88 | # sth prophet, a 0.2, n ns.l - 12, at ds.l*0.25, sus ds.l*0.75, r 0 89 | 90 | live_loop :crushed_square, sync: :fd do 91 | stop 92 | r = (ring :g3, :c4, :a3, :d4, :c4).tick(:r) 93 | ns = (ring :r, r, r, r) 94 | ds = (ring 0.75, 0.25, 0.5, 0.5) 95 | 96 | with_fx :rbpf, centre: 60, mix: 0.9, amp: 2 do 97 | with_fx :bitcrusher, sample_rate: 3000, mix: 0.3 do 98 | 16.times do 99 | tick 100 | synth :square, amp: 0.3, note: ns.look, attack: ds.look * 0.25, sustain: ds.look * 0.75, release: 0 101 | synth :prophet, amp: 0.2, note: ns.look - 12, attack: ds.look * 0.25, sustain: ds.look * 0.75, release: 0 102 | sleep ds.look 103 | end 104 | end 105 | end 106 | end 107 | --------------------------------------------------------------------------------