+++ /dev/null
-'''\r
-Created on 15 juil. 2009\r
-\r
-@author: Samuel Benveniste\r
-'''\r
-\r
-class Instrument:\r
- '''\r
- Object representing an instrument.\r
- \r
- notes:\r
- The MIDI numbers of the notes played by this instrument (usually a scale)\r
- channel:\r
- The channel corresponding to the instrument in the synthesizer\r
- image:\r
- The image for the instrument\r
- '''\r
-\r
- def __init__(self, notes, channel, image, octave = 0):\r
- '''\r
- Constructor\r
- \r
- notes:\r
- The MIDI numbers of the notes played by this instrument (usually a scale)\r
- channel:\r
- The channel corresponding to the instrument in the synthesizer\r
- image:\r
- The image for the instrument\r
- '''\r
- \r
- self.notes = [loop+12*octave for loop in notes]\r
- self.octave = octave\r
- self.channel = channel\r
- self.image = image\r
- \r
- def getNote(self,noteNumber):\r
- if noteNumber == None :\r
- return(None)\r
- else :\r
- return(self.notes[noteNumber])\r
- \r
- def getNoteByNoteNumber(self,baseMidiNoteNumber):\r
- if baseMidiNoteNumber == None:\r
- return(None)\r
- else :\r
- return(baseMidiNoteNumber+self.octave*12)
\ No newline at end of file