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

Semi-Realtime MIDI - separation of voices [WIP] #2794

Closed
wants to merge 1 commit into from

Conversation

shoogle
Copy link
Contributor

@shoogle shoogle commented Aug 22, 2016

Definitely a work-in-progress at the moment. The voice recalculation works perfectly, but there are bugs when it comes to entering the newly calculated voice into the score. The pre-existing setNoteRest() function appears to have problems with higher voices. It seems like ChordRests are being created but then ignored, so when the chord looks for the next ChordRest the new ones are missed and things get corrupted.

Voice separation works some of the time, but crashes consistently with certain inputs, such as when playing short low notes at the same time as long high notes. For example, playing an E whole-note while playing C quarters causes a crash, but playing E quarters against a C whole note is fine.

@shoogle shoogle force-pushed the semi-realtime-midi-voices branch 2 times, most recently from 25ca630 to 1fbbfb3 Compare August 22, 2016 21:43
seg = setNoteRest(seg, track, NoteVal(), Fraction::fromTicks(rchord->tick() - seg->tick()), Direction::AUTO); // This *appears* to work in all voices, but see FIXME below.
while (seg->tick() < rchord->tick()) // might encounter segments from other voices before the one we want
seg = seg->next(Segment::Type::ChordRest); // FIXME: in higher voices this sometimes does not find the ChordRest we just added 2 lines above with setNoteRest()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the problem occurs.
I use setNoteRest to add a rest so that I can guarantee there will be a ChordRest at the tick immediately after it. I then try to move to the end of the rest with seg->next(Segment::Type::ChordRest). This works fine in Voice 1 and usually in higher voices too, but sometimes in higher voices it moves too far and skips past the end of the rest.

@lasconic lasconic added the work in progress not finished work or not addressed review label Aug 23, 2016
@lasconic
Copy link
Contributor

lasconic commented Sep 8, 2016

What's the current status? I still have the PR marked as WIP.

@shoogle
Copy link
Contributor Author

shoogle commented Sep 9, 2016

Status is unchanged at present. TLDR: ChordRests and ties are being added to the score but are subsequently ignored. Does this mean anything to you?

My code separates the voices and adds the notes to ChordRests in each voice, but for some reason the new ChordRests do not appear to be "visible" to the other voices. Perhaps I need to do something like call endCmd() before changing voice? I noticed something similar with my note grouping code (already merged) where the ties are visible, but are ignored during playback until the file is saved and loaded again. Perhaps I have not added them correctly?

@wschweer
Copy link
Contributor

For any playback changes probably score->setPlaylistDirty() has to be called to force the midi event list to be recreated on next play..

@lasconic
Copy link
Contributor

This PR now needs a rebase.

@dmitrio95
Copy link
Contributor

@shoogle, would you like to rebase this PR or should we better archive it for now?

@dmitrio95 dmitrio95 closed this Mar 11, 2020
@dmitrio95 dmitrio95 reopened this Mar 11, 2020
@dmitrio95 dmitrio95 added the archived PRs that have gone stale but could potentially be revived in the future label Mar 18, 2020
@dmitrio95
Copy link
Contributor

Archiving this for now, if it is planned to be updated feel free to reopen this PR.

@dmitrio95 dmitrio95 closed this Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archived PRs that have gone stale but could potentially be revived in the future work in progress not finished work or not addressed review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants