I’m trying to make sounds like the mannfish, but can’t yet make head nor tail on meaning, or how to use
I see sonic pi has a :just tuning, but not sure if that’s needed or affects anything if playing frequencies, calculated from ratios (eg hz_to_midi)
Even starting with something relatively simply like 12:19:25 is a little too much to unpack right now!
Can anyone explain what things like 12:19:25 are, maybe with an example with base_frequency like A 440 ?
I get why an octave is 2:1, why a forth “plus” it’s fifth equals an octave, even how to get cents from an interval or calculate “how many times” an interval goes into another (I went down the math rabbit holes).
Many Thanks for this! Nice and clean. I did not think of expressing this way, or even interpreting a:b:c as a/b and a/c (as eluded to by f25). Keep it simple
A blessing and a curse: I keep finding things on the world’s wonderful web that I can’t quite decipher, most recently where this 15/8 comes from, or how to arrive at that ratio
Ever since Ptolemy in the second century A.D., our major scale has been an approximation of the following ratios:
|1/1|9/8|5/4|4/3|3/2|5/3|15/8|2/1|
define :n_ratio do |n,a,b|
#Takes the fundamental note, dividend and divisor
f = midi_to_hz(n)
if a*b == 0
#Can't have a zero in the ratio
return n
else
return hz_to_midi(f * a / b)
end
end
#Just intonation second
use_synth :blade
use_synth_defaults sustain: 1
play :c4
play n_ratio(:c4, 9, 8)