Algorithic music on alternative tuning


#1

The code

nota = 260
raiz = 1.1040895136738123
nt = []

for i in 0..14 do
    nt[i]= nota
    nota = nota*raiz
    puts nt[i]
  end
  with_fx :reverb do
   
    live_loop :acordes do
      d = (ring 1,2).choose
      use_synth :piano
      play hz_to_midi(nt[0]/d),pan: (ring -0.7,-0.3,0.7,0.3).choose
    sleep 0.5
    play hz_to_midi(nt[2]/d),pan: (ring -0.7,-0.3,0.7,0.3).choose
      sleep 0.5
      
      play hz_to_midi(nt[4]/d),pan: (ring -0.7,-0.3,0.7,0.3).choose
    sleep 0.5
    play hz_to_midi(nt[0]/d),pan: (ring -0.7,-0.3,0.7,0.3).choose
      sleep 0.5
      
      play hz_to_midi(nt[2]/d),pan: (ring -0.7,-0.3,0.7,0.3).choose
    sleep 0.5
    play hz_to_midi(nt[5]/d),pan: (ring -0.7,-0.3,0.7,0.3).choose
      sleep 0.5
      play hz_to_midi(nt[0]/d),pan: (ring -0.7,-0.3,0.7,0.3).choose
    sleep 0.5
    play hz_to_midi(nt[3]/d),pan: (ring -0.7,-0.3,0.7,0.3).choose
      sleep 0.5
      
      play hz_to_midi(nt[5]/d),pan: (ring -0.7,-0.3,0.7,0.3).choose
    sleep 0.5
    play hz_to_midi(nt[1]/d),pan: (ring -0.7,-0.3,0.7,0.3).choose
      sleep 0.5
      play hz_to_midi(nt[4]/d),pan: (ring -0.7,-0.3,0.7,0.3).choose
    sleep 0.5
    play hz_to_midi(nt[6]/d),pan: (ring -0.7,-0.3,0.7,0.3).choose
      sleep 0.5
    end
    
    sleep 12
    live_loop :mus do
      use_synth :piano
      azar = rrand_i(0,5000)
      veces = rrand_i(5,8)
      d = (ring 0.5,1,2).choose
      with_fx :echo, phase: (ring 0.25,0.50).choose do
        2.times do
          use_random_seed azar
          veces.times do
            i = rrand_i(0,7)
            n = rrand_i(2,4)
            play hz_to_midi(nt[i]/d), pan: rrand(-0.5,0.5)
            play hz_to_midi(nt[i+n]/d), pan: rrand(-0.5,0.5)
            sleep (ring 0.75,0.25,0.50).choose
          end
        end
      end
      with_fx :echo, phase: (ring 0.25,0.50).choose do
        2.times do
          use_random_seed azar
          veces.times do
            i = rrand_i(0,7)
            n = rrand_i(2,4)
            play hz_to_midi(nt[i]/d), pan: rrand(-0.5,0.5)
            sleep 0.25
            play hz_to_midi(nt[i+n]/d), pan: rrand(-0.5,0.5)
            sleep (ring 0.75,0.25,0.50).choose
          end
        end
      end
    end

https://www.youtube.com/watch?v=iQ2sPHg59o4


#2

Nice stuff, although please be aware that the :piano synth only plays whole tones, and so the following will result in exactly the same pitch:

synth :piano, note: 60
synth :piano, note: 60.4

However, all other synths will honour fractional notes.

Also, for experimenting with different tuning systems, you might be interested in playing with use_tuning :slight_smile: