Skip to content

Commit

Permalink
Changed event::get_rank() to give Note Offs a higher priority to fix …
Browse files Browse the repository at this point in the history
…potential playback issues.
  • Loading branch information
ahlstromcj committed Aug 22, 2024
1 parent 35b1887 commit cb1e7d8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
5 changes: 4 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NEWS for Seq66 0.99.14
Chris Ahlstrom
2015-07-10 to 2024-08-21
2015-07-10 to 2024-08-22

# Changelog

Expand Down Expand Up @@ -33,6 +33,9 @@ Chris Ahlstrom
See issue #128.
- Updating the PDF documentation based on issue fixes and other fixes.
- Replaced the --session-tag option with --session.
- Changed the sort order of events so that Note Offs get priority over
Note Ons with the same time-stamp. Prevents playback errors in
the tune judyblue.mid. Enabled via macro SEQ66\_PRIORITIZE\_NOTE\_OFF.

## [0.99.13] - 2024-08-05

Expand Down
11 changes: 4 additions & 7 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TO DO for Seq66 0.99.14
Chris Ahlstrom
2019-04-13 to 2024-08-21
2019-04-13 to 2024-08-22

Mutes:

Expand All @@ -17,12 +17,9 @@ Playlists:

From Testing:

- Add an option fix notes by shortening them a few ticks.
- File errors (fixed!), but odd issues (w/qsynth):
'/usr/local/share/seq66-0.99/midi/FM/judyblue.mid' plays, but some
notes are blipped out. Try with another player.
'/usr/local/share/seq66-0.99/midi/FM/longhair.mid' plays just fine
mostly, some glitches.
- Add an option to fix notes by shortening them a few ticks? Not
really needed with macro SEQ66_PRIORITIZE_NOTE_OFF enabled in
event.cpp.
- The 'usr' time-color settings do not seem to work. Actually, it does
work, but not with the Qt gtk styling. Document this issue.
- The Carpet song has PPQN = 120 and displays weirdly in pattern editor.
Expand Down
24 changes: 23 additions & 1 deletion libseq66/src/midi/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2015-07-24
* \updates 2024-01-16
* \updates 2024-08-22
* \license GNU GPLv2 or above
*
* A MIDI event (i.e. "track event") is encapsulated by the seq66::event
Expand Down Expand Up @@ -79,6 +79,18 @@
#include "midi/calculations.hpp" /* seq66::rescale_tick() */
#include "util/basic_macros.hpp" /* helpful debugging/build macros */

/*
* As noted elsewhere, the song judyblue.mid does not play all notes.
* This happens when the Note Off for a preceding note follows
* a Note On for the same note number, and these two events have the
* same time-stamp.
*
* Enabling this macro gives Note Offs priority over Note Ons with the
* same time-stamp, and seems to fix the problem.
*/

#define SEQ66_PRIORITIZE_NOTE_OFF

/*
* Do not document a namespace; it breaks Doxygen.
*/
Expand Down Expand Up @@ -1157,13 +1169,23 @@ event::get_rank () const
int eventcode = mask_status(m_status); /* strip off channel nybble */
switch (eventcode)
{
#if defined SEQ66_PRIORITIZE_NOTE_OFF /* EXPERIMENTAL reversal */
case EVENT_NOTE_ON:
result = 0x2000 + get_note();
break;

case EVENT_NOTE_OFF:
result = 0x1000 + get_note();
break;
#else
case EVENT_NOTE_OFF:
result = 0x2000 + get_note();
break;

case EVENT_NOTE_ON:
result = 0x1000 + get_note();
break;
#endif

case EVENT_AFTERTOUCH:
case EVENT_CHANNEL_PRESSURE:
Expand Down

0 comments on commit cb1e7d8

Please sign in to comment.