diff --git a/lib/SongConverter.cpp b/lib/SongConverter.cpp index 4f9649a..b93134a 100644 --- a/lib/SongConverter.cpp +++ b/lib/SongConverter.cpp @@ -814,12 +814,14 @@ std::vector SongConverter::SongToMIDI(const unsigned char* data, Target while (true) { /* Load next command */ - if (*reinterpret_cast(trk->m_data) == 0xffff0000) + if ((song.m_bigEndian && *reinterpret_cast(trk->m_data) == 0xffff0000) || + (!song.m_bigEndian && *reinterpret_cast(trk->m_data) == 0xffff)) { /* End of channel */ trk->m_data = nullptr; break; } +#if 0 else if (trk->m_data[0] & 0x80 && trk->m_data[1] & 0x80) { /* Control change */ @@ -835,6 +837,7 @@ std::vector SongConverter::SongToMIDI(const unsigned char* data, Target events.emplace(regStart + trk->m_eventWaitCountdown, Event{ProgEvent{}, trk->m_midiChan, prog}); trk->m_data += 2; } +#endif else { if ((trk->m_data[2] & 0x80) != 0x80) diff --git a/lib/SongState.cpp b/lib/SongState.cpp index 369ad07..3d8598d 100644 --- a/lib/SongState.cpp +++ b/lib/SongState.cpp @@ -348,12 +348,14 @@ bool SongState::Track::advance(Sequencer& seq, int32_t ticks) } /* Load next command */ - if (*reinterpret_cast(m_data) == 0xffff0000) + if ((m_parent.m_bigEndian && *reinterpret_cast(m_data) == 0xffff0000) || + (!m_parent.m_bigEndian && *reinterpret_cast(m_data) == 0xffff)) { /* End of channel */ m_data = nullptr; return !m_nextRegion->indexValid(); } +# if 0 else if (m_data[0] & 0x80 && m_data[1] & 0x80) { /* Control change */ @@ -369,6 +371,7 @@ bool SongState::Track::advance(Sequencer& seq, int32_t ticks) seq.setChanProgram(m_midiChan, prog); m_data += 2; } +#endif else { if ((m_data[2] & 0x80) != 0x80)