Set the Note corresponding to the integer. 0 is a C on octave 0, 12 is a C on octave 1, etc. Example: >>> Note().from_int(12) 'C-1'
(self, integer)
| 199 | self.octave -= 1 |
| 200 | |
| 201 | def from_int(self, integer): |
| 202 | """Set the Note corresponding to the integer. |
| 203 | |
| 204 | 0 is a C on octave 0, 12 is a C on octave 1, etc. |
| 205 | |
| 206 | Example: |
| 207 | >>> Note().from_int(12) |
| 208 | 'C-1' |
| 209 | """ |
| 210 | self.name = notes.int_to_note(integer % 12) |
| 211 | self.octave = integer // 12 |
| 212 | return self |
| 213 | |
| 214 | def measure(self, other): |
| 215 | """Return the number of semitones between this Note and the other. |
no outgoing calls