notes2ratio

pitchtools.notes2ratio(n1, n2, maxdenominator=16)[source]

Find the ratio between n1 and n2

Parameters:
  • n1 (Union[float, str]) – first note (a midinote or a notename)

  • n2 (Union[float, str]) – second note (a midinote or a notename)

  • maxdenominator – the maximum denominator possible

Return type:

tuple[int, int]

Returns:

a Fraction with the ratio between the two notes

NB: to obtain the ratios of the harmonic series, the second note

should match the intonation of the corresponding overtone of the first note

Note 1

Note 2

Ratio

C4

D4

8/9

C4

Eb4+20

5/6

C4

E4

4/5

C4

F#4-30

5/7

C4

G4

2/3

C4

A4

3/5

C4

Bb4-30

4/7

C4

B4

8/15

See also

ratio2interval()