MCPcopy Create free account
hub / github.com/bspaans/python-mingus / from_int

Method from_int

mingus/containers/note.py:201–212  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 4

__init__Method · 0.95
fft.pyFile · 0.80
find_notesFunction · 0.80
test_from_intMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_from_intMethod · 0.64