tonalidad = scale(:g4, :major_pentatonic)
the notes that are used are those that are part of the scale of g pentatonica (g, a, b, d, e, g)
acordes = (ring chord(:e3,:minor), chord(:g3,:major), chord(:c3,:major), chord(:d3,:major))
is the harmonic progression that will be used
With these two premises we make sure that any of the notes are heard at random, it sounds good in the harmonic-melodic set
use_random_seed (ring 1,1,1,1,2,1,1,2,3,1,1,2,3,5).tick
We make the seed is based on the fibonacci series, our ears are used to melodic patterns repeat or vary little
nota = tonalidad.choose
play nota + 0.2,amp: 0.3,pan: -0.8
play nota,amp: 0.3,pan: 0.8
sleep (ring 0.45,0.45,0.95).choose
A note is generated at random, for a channel 20% is detuned, on the other 5% of the bmp is delayed.
The duration of the note plus the delay is 0.5 or 1.
It does not matter if the melodic rifle fits perfectly with the chord change … any note sounds good with any of the chords.