a = (scale :c, :major)
a_duration = (ring 1)*8
define :foo do | n , d, trans |
l= d.length
l.times do
tick
use_transpose trans
synth :piano, note: n.look, decay: 1
sleep d.look
end
end
in_thread do
foo a, a_duration, 0
end
in_thread do
foo a, a_duration, 5
end
in_thread do
foo a, a_duration, -12
end
Edit : this text below is absolutely wrong - so yes use_transpose is the way.
you see or better you hear that your :c major scale has become an :d minor scale. And i guess you want a D major scale.
So you have to work with intervalls.
I remember some threads about that on this forum, so use the search (magnifying glass) button (“loupe” in french not loop )
Cheers
Hi @nlb, I think you are mistaken. I tried running your code and it plays a :c major scale followed by a :d major scale. Transposing a major scale should always give you another major scale because you are not modifying the steps between the notes.
You don’t have to. You can use your original key as an offset in relation to C, assuming this has a value of 0. Here’s an example.
sc = (ring :C4, :D4, :G4) # a phrase in C
play_pattern sc, 0.5 #play in C
use_transpose -2 #transpose down to Bb
play_pattern sc, 0.5
use_transpose 5 #transpose up to F
play_pattern sc, 0.5
use_transpose -4 #transpose down to Ab
play_pattern sc, 0.5
sc = (ring :F4, :G4, :C5) # same phrase but now in F
play_pattern sc, 0.5 #play in F
use_transpose -2 #transpose down to Eb
play_pattern sc, 0.5
use_transpose 5 #transpose up to Bb
play_pattern sc, 0.5
use_transpose -4 #transpose down to Db
play_pattern sc, 0.5
The first half of the code is in C and transposed around.
The next half the phrase is written in F but the same transpositions are used as for the previous example.