Sonic Pi Scripts

Jumping-off points for Sonic Pi!

:organ_tonewheel explorer
:organ_tonewheel explorer

:organ_tonewheel explorer

The organ tonewheel has a ton of capabilities. This script basically plays with the drawbars in various ways; some waviness, some randomness, a bit of inversion here and there. A nice template as well, since all the parameters + slides are written out for you 🙂

What it sounds like:

Code:

'================================================================'
# by ts-swx,  03/27/23

# this script was created to get to know the opts for the
# :organ_tonewheel synth -- check the docs for an explanation of
# the parameters

'================================================================'

'================================================================'
# it's pretty heavily randomized, and could be made to sound...
# ...smoother, easier on the ears, whatever you wanna call it...
# with more predictable levels, especially on the drawbars

# of course, you can also make it much more erratic.
'================================================================'

'================================================================'
# I've added some comments in the first block of variables to
# explain some portion of how I came up with the modulating
# variables; this could likely be done in a much cleaner way,
# & I'd love to see these controls tied into a markov chain.

# steal this, use it in your music...

# play it in a spooky tunnel...

'================================================================'

use_debug false
use_bpm 115

live_loop :lvlset do
  clvl = range(45,100,15).tick
  clvl2= range(110,55,20).look
  set :c, clvl
  set :c2, clvl2
  
  sleep 1.5
end


with_fx :gverb, mix: 0.3, room: 40 do
  with_fx :rlpf do |lpf|
    with_fx :echo, mix: 0.5 do |e|
      with_fx :distortion do |dst|
        with_fx :compressor, threshold: 0.6, slope_above: 0.12 do
          with_fx :level do |amp|
            sleep 2
            live_loop :ch do
              tick
              
              control amp, amp: 0.7
              
              d8 = dice(8)
              # all of the drawbar params max out @8, so this gives the full range
              
              d8i = 8-d8
              # this will give us the inverse - it's fun to take two related parameters
              # such as tierce (5x base frq) and larigot (6x base) and make them "inverses"
              
              d81 = 1+d8 #just in case you wanna use the DICE value as a divisor
              
              
              wv=(line 0,1, steps: 8).mirror #.rotate(knit(3,12,-3,12).look)
              # also wanted an option for wavy modulation, not hard random jumps
              
              # remove the comment before .rotate to make the line less even,
              # the position with this rotation hops around every 12 beats, skipping 6
              # wavepoints when it hops (kinda arbitrary, kinda fun).
              
              wv2=wv.mirror+wv.rotate(4).look/3
              # adding a rotated version of the wave
              
              use_transpose 0
              
              use_synth :organ_tonewheel
              
              use_synth_defaults attack: [0.001,0.1*wv2.rotate(7).look,1].look,
                release: [2,3].look-wv.look, decay: 0.1* [2,1].look+rrand(0,1.3),
                bass: 3+3*wv.rotate(5).look, bass_slide: 0.125*wv.mirror.look, # -1oct
                quint: [7*wv.rotate(2).look,8-wv.look].look, quint_slide: rrand(1,3), # 3/2 base
                fundamental: [5+wv2.look,7-wv2.look].look, fundamental_slide: rrand(2,4), #base
                oct: 0,#[4+2*wv.mirror.look,5,4].look, oct_slide: rrand(1,5),
                nazard: 7, #[wv2.look*[0.2,0,0.1,0,0].look,0].look, nazard_slide: rrand(0,7), # 3x
                blockflute: look%8, #[0,2/d81,0].look
                blockflute_slide: rrand(0,4), # +2oct
                tierce: -look%8, # [0,0,d8i/6].look, tierce_slide: rrand(0,5),
                rs_freq: line(1,9,steps:12).mirror.look, rs_freq_slide: 0.5,
                rs_freq_var: 0.125, rs_pitch_depth: 0.012 #, # 5x
                # larigot: [d8i/1.5,0].look, larigot_slide: rrand(0,5), # 6x
                # sifflute: [0,d8/12].look, sifflute_slide: rrand(0,3) # +3oct
                
              n=get[:n]
              
              control lpf, cutoff: get[:c2], cutoff_slide: 0.5,
                res: rrand(0.2,0.99), mix: wv.look*0.8
              control dst, distort: wv.choose, distort_slide: 1*wv2.look,
                mix: wv.choose/3
              control e, phase: halves(4,6).mirror.look*wv2.look
              
              
              notes = (ring :E4, :Fs4, :B4, :Cs5, :D5, :Fs4, :E4, :Cs5, :B4, :Fs4, :D5, :Cs5)
              
              # with_cent_tuning 0.05*halves(4,6).mirror.look*wv2.look do
              
              # cent tuning will take the two organs slightly out of tune with each other
              # causing dissonant fuzzy noises. There is another (nearly) identical
              # loop below, which has the cent tuning active
              
              # Exploring what can be done with small variations to the cent tuning
              # is very fun as well
              
              density [5,14,6].look do
                play notes.look, pan: line(-1,1,steps: 25).look, amp: 0.5+0.1*dice
              sleep 3*[0.3,0.295].look end
              # end
          end end
        end
        
        live_loop :ch2 do
          control amp: 0.7
          d8 = dice(8)
          d8i = 8-d8
          d81 = 1+d8
          wv=(line 0,1, steps: 8).mirror #.rotate(knit(4,12,-4,12).look)
          wv2=wv.mirror+wv.rotate(4).look/3
          
          use_transpose 0
          
          use_synth :organ_tonewheel
          
          use_synth_defaults attack: [0.001,0.1*wv2.rotate(7).look,1].look,
            release: [2,3].look-wv.look, decay: 0.1* [2,1].look+rrand(0,1.3),
            bass: 3+3*wv.rotate(5).look, bass_slide: 0.125*wv.mirror.look, # -1oct
            quint: d8, #[7*wv.rotate(2).look,8-wv.look].look, quint_slide: rrand(1,3), # 3/2 base
            fundamental: [5+wv2.look,7-wv2.look].look, fundamental_slide: rrand(2,4), #base
            oct: 6,#[4+2*wv.mirror.look,5,4].look, oct_slide: rrand(1,5),
            nazard: look%8,#[wv2.look*[0.2,0,0.1,0,0].look,0].look, nazard_slide: rrand(0,7), # 3x
            blockflute: -look%8,#[0,2/d81,0].look, blockflute_slide: rrand(0,4), # +2oct
            tierce: [0,0,d8i/6].look, tierce_slide: rrand(0,5),
            rs_freq: line(1,9,steps:12).mirror.look, rs_freq_slide: 0.5,
            rs_freq_var: 0.125, rs_pitch_depth: 0.012 #, # 5x
            # larigot: [d8i/1.5,0].look, larigot_slide: rrand(0,5), # 6x
            # sifflute: [0,d8/12].look, sifflute_slide: rrand(0,3) # +3oct
            
          control lpf, cutoff: get[:c2], cutoff_slide: 0.75,
            res: rrand(0.2,0.99), mix: wv.look*0.8
          control dst, distort: wv.choose, distort_slide: 1*wv2.look,
            mix: wv.choose/3
          control e, phase: halves(4,6).mirror.look*wv2.look
          
          
          notes = (ring :E4, :Fs4, :B4, :Cs5, :D5, :Fs4, :E4, :Cs5, :B4, :Fs4, :D5, :Cs5)
          
          spark wv
          spark wv2
          with_cent_tuning 0.05*halves(6,8).mirror.look*wv2.look do
            
            density line(1,6,steps:6).shuffle.look do
              play notes.tick, amp: dice*0.12, pan: line(1,-1,steps: 15).look
            sleep [2,3].look*[0.295,3].look end
          end
        end
    end end
    
end end

Leave a Reply

Your email address will not be published. Required fields are marked *