Skip to content

Sequencer plays same note multiple times in play_Bar() #109

@b8d241b26a27cbcf2c7345393

Description

Hi folks. Sorry for the way to proceed, I dont really know how to properly submit a patch.
But I found a bug in the sequencer and would like to share.

The issue: in the below code, the (whole) note on bBackground bar actually gets rendered as 4 quarter notes.

from mingus.midi import fluidsynth
from mingus.containers import Note
from mingus.containers import Bar
from mingus.containers import Track
from mingus.containers import Composition
from mingus.containers import NoteContainer

fluidsynth.init("timbres.sf2")

bBackground = Bar()
bDrums = Bar()

bBackground.place_notes("A-3", 1)

bDrums.place_notes("A-5", 4)
bDrums.place_notes("A-5", 4)
bDrums.place_notes("A-5", 4)
bDrums.place_notes("A-5", 4)

trackBg = Track()
trackBg.add_bar(bBackground)
trackDr = Track()
trackDr.add_bar(bDrums)
c = Composition()
c.add_track(trackBg)
c.add_track(trackDr)
print(c)

for n in range (1):
    fluidsynth.play_Composition(c, [1,2], 180)

The issue is coming from sequencer.py, line 248, in play_Bars().
for (n, x) in enumerate(cur):

The enumerate() function will return the (0,0) couple at each tick increment (due to the 2nd track having quarter notes). But this should occur only once.

Sorry again for the format, but if that can serve...

cheers', and thanks for this cool software!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions