Skip to content

Midi looping preliminaries - #2218

Merged
Paul-Licameli merged 11 commits into
audacity:masterfrom
Paul-Licameli:MIDI-looping-preliminaries
Dec 6, 2021
Merged

Paul-Licameli merged 11 commits into
audacity:masterfrom
Paul-Licameli:MIDI-looping-preliminaries

Conversation

@Paul-Licameli

@Paul-Licameli Paul-Licameli commented Dec 2, 2021 •

Copy link
Copy Markdown
Collaborator

Prepares for the fixes for #2081

Some preliminary refactorings before the real fix for adjusting bounds of looping play of MIDI (and also, enabling scrubbing of MIDI). Not the complete fix . Minor behavior changes, as described in commit comments.

  • Small corrections of play head position
  • Don't briefly sound the notes at the starting position again at the ending position when not playing looped (recent bug)
  • Always send the correct update events for muted channels, in case they become un-muted during play (old bug)
  • I signed CLA
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

@Paul-Licameli
Paul-Licameli requested a review from crsib December 2, 2021 02:05
@Paul-Licameli
Paul-Licameli marked this pull request as draft December 2, 2021 02:08
@Paul-Licameli
Paul-Licameli force-pushed the MIDI-looping-preliminaries branch from f75f4dc to c77f53b Compare December 5, 2021 16:54
@Paul-Licameli
Paul-Licameli marked this pull request as ready for review December 5, 2021 16:56
@Paul-Licameli
Paul-Licameli force-pushed the MIDI-looping-preliminaries branch from c77f53b to a50723f Compare December 5, 2021 23:30
... So that if you play a MIDI selection non-looped, the notes at the start of
it don't briefly replay when you reach the end.

However the function Looping() will be eliminated in a later pull request.
... And move the call to reset the iterator after outputting all-notes-off
... Assuming mHasSolo is false only if GetSolo() returns true for none of the
the playing tracks.  And the truth of that is supposed to be maintained (even
as the user might change mute and solo settings during play) by
AudioIoCallback::AudioCallback() counting the solo tracks each time through,
and sending that to FillOtherBuffers.
... With many comments.

The case where two MIDI tracks might merge events into the very same MIDI
channel was never really handled right, as an experiment can verify (duplicate
a track, offset one of them by a short duration, play both -- the note-off of
one track also silences the other track's notes too early).

So no fault if it remains unfixed.  But this change should fix the behavior in
case of changes of muting of tracks or MIDI channels (pressing the numbered
buttons) during play.  Events meant to change timbre of notes don't get lost
even if the notes are muted; then unmuting them will make the desired sound.
@Paul-Licameli
Paul-Licameli force-pushed the MIDI-looping-preliminaries branch from a50723f to 41fbd88 Compare December 6, 2021 21:24
@Paul-Licameli
Paul-Licameli merged commit 5f4e15b into audacity:master Dec 6, 2021
@Paul-Licameli
Paul-Licameli deleted the MIDI-looping-preliminaries branch December 6, 2021 21:29
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

Successfully merging this pull request may close these issues.

2 participants