-Fix: When quantising, remove all notes after the end of the loop.
-Fix: Use notecache based on loop events to add note-offs, else some could possibly be missed. git-svn-id: http://svn.fuzzle.org/mloop/trunk@31 ba049829-c6ef-42ef-81ac-908dd8d2e907master
parent
604ae996d6
commit
4180158dc9
|
@ -144,7 +144,7 @@ void Jack::ToggleRecording(int loop, int bpm, bool delay)
|
||||||
|
|
||||||
m_loops[m_recording_loop].SetLength(m_recording_time);
|
m_loops[m_recording_loop].SetLength(m_recording_time);
|
||||||
m_loops[m_recording_loop].SetState(LS_IDLE);
|
m_loops[m_recording_loop].SetState(LS_IDLE);
|
||||||
m_loops[m_recording_loop].EndFromNoteCache(m_notecache);
|
m_loops[m_recording_loop].Finalise();
|
||||||
} else {
|
} else {
|
||||||
if (m_loops[loop].State() == LS_IDLE) {
|
if (m_loops[loop].State() == LS_IDLE) {
|
||||||
m_recording_loop = loop;
|
m_recording_loop = loop;
|
||||||
|
|
20
src/loop.cpp
20
src/loop.cpp
|
@ -134,6 +134,26 @@ void Loop::EndFromNoteCache(NoteCache &cache)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Loop::Finalise()
|
||||||
|
{
|
||||||
|
NoteCache nc;
|
||||||
|
|
||||||
|
/* Remove all events after the end of the loop. */
|
||||||
|
EventList::iterator it;
|
||||||
|
for (it = m_events.begin(); it != m_events.end();) {
|
||||||
|
jack_midi_event_t &ev = *it;
|
||||||
|
if (ev.time < m_length) {
|
||||||
|
nc.HandleEvent(ev);
|
||||||
|
++it;
|
||||||
|
} else {
|
||||||
|
it = m_events.erase(it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Now make sure no notes are left on. */
|
||||||
|
EndFromNoteCache(nc);
|
||||||
|
}
|
||||||
|
|
||||||
void Loop::Empty()
|
void Loop::Empty()
|
||||||
{
|
{
|
||||||
if (m_state != LS_IDLE) return;
|
if (m_state != LS_IDLE) return;
|
||||||
|
|
|
@ -81,6 +81,8 @@ public:
|
||||||
return m_loop;
|
return m_loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Finalise();
|
||||||
|
|
||||||
void Save(FILE *f) const;
|
void Save(FILE *f) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue