marianinn / mingus

Automatically exported from code.google.com/p/mingus
GNU General Public License v3.0
0 stars 1 forks source link

Compositions can not be played by fluidsynth #105

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
def comp():
    """compositions"""
    b1 = Bar()
    t1 = Track(Instrument())
    b1.place_notes(chords.triad("A", "C"),4)
    b1.place_notes(chords.triad("G", "C"),4)
    b1.place_notes(chords.triad(intervals.minor_unison("A"), "C"),4)
    t1.add_bar(b1)
    c = Composition()
    c.add_track(t1)
    fluidsynth.play_Composition(c, 2, 50)   
2.
3.

What is the expected output? What do you see instead?

Should play the song

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "test.py", line 142, in comp
    fluidsynth.play_Composition(c, 2, 50)
  File "/usr/lib/python2.5/site-packages/mingus/midi/fluidsynth.py", line 
156, in play_Composition
    return midi.play_Composition(composition, channels, bpm)
  File "/usr/lib/python2.5/site-packages/mingus/midi/Sequencer.py", line 
366, in play_Composition
    return self.play_Tracks(composition.tracks, channels, bpm)
  File "/usr/lib/python2.5/site-packages/mingus/midi/Sequencer.py", line 
338, in play_Tracks
    self.set_instrument(channels[x], 1)
TypeError: 'int' object is unsubscriptable

What version of the product are you using? On what operating system?
Ubuntu 9.10 

Please provide any additional information below.

Original issue reported on code.google.com by DavoudTa...@gmail.com on 1 Jun 2010 at 8:06

GoogleCodeExporter commented 9 years ago
This may be more of a problem with the documentation than the play_Composition 
function. The second argument of play_Composition should be a list. So,

fluidsynth.play_Composition(c, 2, 50)

should be changed to:

fluidsynth.play_Composition(c, [2], 50)

Original comment by stoneno...@gmail.com on 12 Dec 2010 at 2:26