notated_interval

pitchtools.notated_interval(n0, n1)[source]

Gives information regarding the notated interval between n0 and n1

Parameters:
  • n0 (str) – the first notename

  • n1 (str) – the second notename

Return type:

tuple[int, float]

Returns:

a tuple (delta vertical position, delta midinote).

Examples

>>> notated_interval("4C", "4D")
(1, 2)        # 1 vertical step, 2 semitone steps
>>> notated_interval("4C", "4C+")
(0, 0.5)
>>> notated_interval("4C", "4Db")
(1, 1)
>>> notated_interval("4Db", "4C")
(-1, -1)

See also

notated_pitch()