1234567891011121314151617181920 |
- class_name Music
- # To deal with music theory in the digital world
- enum Note {A = 0, Ad, B, C, Cd, D, Dd, E, F, Fd, G, Gd}
- const NOTE_PITCH_SCALE = 1.0594630943592953
- static func scale_note(note: Note) -> float:
- return pow(NOTE_PITCH_SCALE, float(note))
- static func scale_octave(octave_offset: int) -> float:
- return pow(2, octave_offset)
- static func scale_note_octave(note: Note, octave: int) -> float:
- return scale_note(note) * scale_octave(octave)
|