Can sonicpi do anything like this?! 'intelligent scale transposition'

I just got made aware of rip x and it’s note translation…

This may be something that’s already been attempted by some sonic wizards… may be outside realm of possibility…

Not even sure if description in my title is accurate!

2 Likes

Amazing software and great explanation of scales - finally I understand why melodic minor had to be! I don’t know how to do this in Sonic but hopefully someone will…

That’s a really interesting video!
There are a couple of aspects to what he’s doing, some of which may be more feasible in Sonic Pi than others…

The first thing is taking a sample of a song and separating out the different parts, like the vocals etc. This is not possible in Sonic Pi, at least at the moment. If there is an open source implementation of it available or maybe a paper explaining how it’s done, and someone has the time and knowledge (and desire) to do it, it could be possible that this might one day be added to Sonic Pi, but it seems unlikely in the near future.

Then there is shifting the pitch of samples, which can be done in Sonic Pi. I think there are a few posts on these forums about it. Or if you use synths it’s even easier, you just need to choose which notes to play according to the scale you want.

There’s also the information about the different scales, and here Somic Pi excels, as it has dozens of different scales built in. Although I think in the video he did more than just shift the pitches to match the scale: he also adjusted the chords to fit in with the different scales, and sometimes tweaked the melody a bit. This would require knowledge of music theory to do well.

But if you just want to take a simple well-known melody and play it in different scales, it’s not too hard. I had a go and came up with this:

use_bpm 120
use_synth :pretty_bell
use_debug false

m = 2 # minim
c = 1 # crotchet
q = 0.5 # quaver

notes = [1, 4, 4, 5, 4, 3, 2, 2,
         2, 5, 5, 6, 5, 4, 3, 1,
         1, 6, 6, 7, 6, 5, 4, 2,
         1, 1, 2, 5, 3, 4]
times = [c, c, q, q, q, q, c, c,
         c, c, q, q, q, q, c, c,
         c, c, q, q, q, q, c, c,
         q, q, c, c, c, m]

puts "Possible scale names: " + scale_names.to_a.join(', ')

[:mixolydian, :minor, :locrian, :phrygian, :spanish, :enigmatic].each do |name|
  puts "Using: " + name.to_s
  s = scale(:g3, name, num_octaves: 2)
  
  notes.zip(times).each do |n, t|
    play s[n-1], release: t
    sleep t
  end
end
2 Likes

Really helpful to see these code examples - thank you!

1 Like