Steevio inspired setup

My performance recording with Steevio inspired setup

  1. Can I create variation with use_random_seed on spread()?

  2. How can I in fx spread(5,7) take a single of them and give another sound like Steevio does at Freeform Techno / Machine Jazz demo - Steevio - YouTube

  3. How would you improve/optimize this code?

  4. Are there any pattern in what numbers of use_random_seed fits together musically?

Kind regards
Relaxnow

# Inspired by - "Freeform Techno / Machine Jazz demo - Steevio"
# https://youtu.be/x6hJa2lRRgM?t=278

# https://sonic-pi.net/tutorial.html#section-8-5   #Available Chain Methods
# Backup 220221 - my performance recording https://youtu.be/0fc0IaIFn9Y

# 1) Can I create variation with use_random_seed on spread()?

# 2) How can I in fx spread(5,7) take a single of them and give another sound like Steevio does at https://youtu.be/x6hJa2lRRgM?t=278

# 3) How would you improve/optimize this code?

# 4) Are there any pattern in what numbers of use_random_seed fits together musically?

use_bpm 115

live_loop :met do
  sleep 1
end


my_drums_on = true #true/false
my_bass_on = false #true/false
my_fill_on = false #true/false


### drums start ###
### --- NOISE perc --- ###
live_loop :Noise5, sync: :met do
  # stop
  use_synth :noise
  play :c5, release: 0.07, amp: 1, pan: -1, on: my_drums_on if spread(3,5).tick
  sleep 0.25
end
live_loop :Noise7, sync: :met do
  #stop
  use_synth  :bnoise
  play :c3, release: 0.1, amp: 1, pan: 1, on: my_drums_on if spread(5,7).tick
  sleep 0.25
end

### --- KICK --- ###
live_loop :kick1, sync: :met do
  #stop
  sample :bd_haus, amp: 4, cutoff: 80  if spread(ring(2,5).look,16).tick   #2,16  4,16  5,16  7,16   1,16
  #sample :bd_haus, amp: 4, cutoff: 80, on: my_drums_on  if spread(ring(2,7).tick(:one),16).tick   #2,16  4,16  5,16  7,16   1,16
  #sample :bd_haus, amp: 4, cutoff: 80  if spread(ring(2,5,7).tick(:one),16).tick   #2,16  4,16  5,16  7,16   1,16
  sleep 0.25
end
live_loop :ghost_kick2, sync: :met do
  #stop
  ## sample :bd_haus, amp: 1.5, cutoff: 110  if spread(3,7).drop(2).tick
  sample  :bd_haus, amp: 1.5, finish: rrand(0.03,0.9), cutoff: rrand(90,110), on: my_drums_on if spread(2,16).drop(1).rotate().tick
  sleep 0.25
end
### --- SNARE --- ###
live_loop :snare1, sync: :met do
  #stop
  sample  :drum_snare_hard, amp: 1.5, finish: rrand(0.03,0.09), cutoff: rrand(80,130), on: my_drums_on if spread(3,7).drop(2).rotate().tick
  #sample  :drum_snare_hard, amp: 8, finish: rrand(0.03,0.09), cutoff: rrand(80,130) if spread(3,7).drop(2).rotate().tick
  #sample  :drum_snare_hard, amp: knit(1.5,2, 8,1).tick(:two), finish: rrand(0.03,0.09), cutoff: rrand(80,130) if spread(3,7).drop(2).rotate().tick
  sleep 0.25
end
### drums end ###


### --- BASS --- ###
my_use_random_seed = 20   #20 # 26    #20 #0  #200  400
my_offset = 0            #0  #0      #0  #0  #400
my_scale = :minor #_pentatonic
my_bass_synth = :prophet  #:sine #:dpulse #:dsaw #:prophet

live_loop :bass4, sync: :met do
  #stop
  use_synth my_bass_synth
  use_random_seed my_use_random_seed
  16.times do
    #play (scale :c3, my_scale).choose, amp: 4, release: 0.35, pan: 0.5, on: my_bass_on if spread(7,16).tick
    play (scale :c3, my_scale).choose, amp: 4, release: 0.35, pan: 0.5, on: my_bass_on if spread(6,16).tick   #offset spread(6,16) for more movement
    sleep 0.25
  end
end
live_loop :bass5, sync: :met do
  #stop
  use_synth my_bass_synth
  use_random_seed my_use_random_seed+my_offset
  16.times do
    play (scale :c4, my_scale).choose, amp: 4, release: 0.35, pan: -0.5, on: my_bass_on if spread(7,16).tick
    sleep 0.25
  end
end

### --- fill --- ###
live_loop :fill1, sync: :met do    #fill
  #stop
  use_synth :prophet #:chiplead #saw #:prophet #:fm
  play (octs :c4,3).tick, release: 0.5, amp: 2, pan: 0, cutoff: range(40,110,5).reflect.tick(:asd), on: my_fill_on if spread(5,7).drop(2).pick(1).tick
  sleep 0.25
end




#### sketches below ###



### --- not using these right now --- ###
live_loop :bass2, sync: :met do
  stop
  use_synth :prophet
  play :c5, amp: 4, release: 0.25 if spread(7,16).tick
  sleep 0.25
end
live_loop :bass3, sync: :met do
  stop
  use_synth :prophet
  play :c4, amp: 4, release: 0.35 if spread(5,16).tick
  sleep 0.25
end




### --- chords --- ### not using these right now
#my_chord_on = (knit true,4, false, 4).tick(:c)
my_chord_on = false #true
my_drop = 0                #0   #3
my_chord_spread_front = 3  #3   #7
my_chord_spread_back =  7  #7  #14

live_loop :chord1, sync: :met do
  use_synth :saw
  play (knit :f2,14, :g2,14).tick(:a),  release: 0.15, amp: 4, on: my_chord_on if spread(my_chord_spread_front,my_chord_spread_back).drop(my_drop).tick
  sleep 0.25
end
live_loop :chord2, sync: :met do
  use_synth :saw
  play (knit :f4,14, :g4,7, :as4,7).tick(:a),  release: 0.15, amp: 4, on: my_chord_on if spread(my_chord_spread_front,my_chord_spread_back).drop(my_drop).tick
  sleep 0.25
end
live_loop :chord3, sync: :met do
  use_synth :saw
  play (knit :c5,14, :d5,7, :f5,7).tick(:a),  release: 0.15, amp: 4, on: my_chord_on if spread(my_chord_spread_front,my_chord_spread_back).drop(my_drop).tick
  sleep 0.25
end
1 Like

Hey hey @Relaxnow,

I’m off to work shortly so don’t have time to answer every question, but I’ll answer this one:

  1. Can I create variation with use_random_seed on spread()?

Yes, absolutely! Or with_random_seed - I have done this many times myself :slightly_smiling_face: Here’s the basic technique I use:

bools = with_random_seed ____ do
  (spread ...)
end
1 Like

:joy:

Clearly I was either in a rush or not entirely awake or both when I wrote the above message :slight_smile:
Sonic Pi does not like you using the names of built in functions as the names of your own variables - so bools was not a great example :joy:

Also, I forgot the most important part of the pattern - something to actually randomise the values :wink:

So really, what I meant to write was something like this:

vals = with_random_seed ____ do
  (spread ...).shuffle
end

On with my thoughts about the next few questions: (definitely interested in any other ideas other people might have too!)

How can I in fx spread(5,7) take a single of them and give another sound

Here’s one example - it’s not super elegant, but it works. The key here is basically just: “every time we actually want to trigger a synth, increment with a separate counter through another list to see what kind of synth we play next”.

live_loop :test do
  #stop
  tick
  on spread(5,7).look do
    s = :bnoise
    if (spread 1, 5).reverse.tick(:s)
      s = :saw
    end
    synth s, note: :c4, release: 0.1, amp: 0.5
  end
  sleep 0.25
end

You could replace the code that chooses the synth with something like this too, it’s a matter of personal preference really:

s = ((ring :bnoise).repeat(4) + (ring :saw)).tick(:s)

Maybe there’s other ways of swapping the synth now and then too :man_shrugging:

How would you improve/optimize this code?

If we’re talking about simplifying or shortening the code: there’s a few things you could edit - it really depends also on how much/whether you intend to ‘live code’ or perform this script, and whether ‘optimising’ bits out might remove parts that you’d just need to add back in as you live code with it…

  • You could leave out opts that have default values, like amp: 1.
  • You could use use_synth_defaults/with_synth_defaults/use_sample_defaults/with_sample_defaults to set your own defaults, if you find yourself repeating common sets of opts - with the same caveat for live performance as above…
  • You could use synth X, .... instead of use_synth X... play
  • Where you use on: ... if spread(...), you could use on: ... && spread(...) (since eg my_bass_on and spread(...) both return boolean values)

Are there any pattern in what numbers of use_random_seed fits together musically?

Not much - the (pseudo) random number streams that the seeds index into are just streams of numbers generated by noise. Whether a group of numbers that are chosen by starting with a particular seed sound good is just down to luck really. The exception to that is that since seeds are just pointers to a particular starting point in the list of random numbers, if you change the seed by a small amount that is less than the length of the list of things you’re trying to randomise, (as opposed to a few hundreds or thousands), you’ll quite possibly hear a very similar bunch of randomised sounds between close seeds as most of the numbers will still be the same.

In v3.3.1 @xavierriley introduced the ability to change the type of noise that the random numbers streams are made from, with use_random_source/with_random_source. This means that the patterns in the numbers in the random stream may be different depending on what source you choose, and this may change (even if only slightly) the musicality of your randomised sounds. The function references in the docs describe the ways the noise sources affect the numbers :slight_smile:

1 Like

Thank you so much @ ethancrawford for deepening my understanding of the concepts. I look forward to exploring this.

1 Like

No problem! If anything’s still unclear, let me know :+1:

1 Like