fb54d3afefe8b03ff68791e6ec2ea6c3dc6dee2f
2 Created on 15 juil. 2009
4 @author: Samuel Benveniste
9 Object representing an instrument.
12 The MIDI numbers of the notes played by this instrument (usually a scale)
14 The channel corresponding to the instrument in the synthesizer
16 The image for the instrument
19 def __init__(self
, notes
, channel
, image
, octave
= 0):
24 The MIDI numbers of the notes played by this instrument (usually a scale)
26 The channel corresponding to the instrument in the synthesizer
28 The image for the instrument
31 self
.notes
= [loop
+12*octave
for loop
in notes
]
33 self
.channel
= channel
36 def getNote(self
,noteNumber
):
37 if noteNumber
== None :
40 return(self
.notes
[noteNumber
])
42 def getNoteByNoteNumber(self
,baseMidiNoteNumber
):
43 if baseMidiNoteNumber
== None:
46 return(baseMidiNoteNumber
+self
.octave
*12)