Just Tuning and interval ratios... 12:19:25?

Hello very smart synthesists!

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).

Thanks so much!

#Frequency Ratios

#Ratio 12:19:25
fundamental = 440
f19 = fundamental / 12 * 19
f25 = fundamental / 12 * 25

#Frequencies
print fundamental
print f19
print f25

#MIDI Notes
n12 = hz_to_midi(fundamental)
n19 = hz_to_midi(f19)
n25 = hz_to_midi(f25)

#Play
use_synth_defaults amp: 0.5
play n12
play n19
play n25

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 :+1:t2:

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|

image
from Just Intonation Explained (kylegann.com)

Also of use: JI.pdf (marsbat.space)
determine the harmonic relationship between two known
frequencies :pushpin:

Progress is slow. Larghissimo!

Here is a function:

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)