Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
b8d241b26a27cbcf2c7345393 opened this issue Oct 1, 2022 · 0 comments
Open

Comments

@b8d241b26a27cbcf2c7345393
Copy link

b8d241b26a27cbcf2c7345393 commented Oct 1, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant