diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h index 994d15d5b8..5a253c1033 100644 --- a/libs/ardour/ardour/midi_model.h +++ b/libs/ardour/ardour/midi_model.h @@ -55,7 +55,10 @@ public: inline uint8_t velocity() const { return _on_event.velocity(); } inline double duration() const { return _off_event.time() - _on_event.time(); } - inline void set_duration(double d) { _off_event.time() = _on_event.time() + d; } + inline void set_time(double t) { _off_event.time() = t + duration(); _on_event.time() = t; } + inline void set_note(uint8_t n) { _on_event.buffer()[1] = n; _off_event.buffer()[1] = n; } + inline void set_velocity(uint8_t n) { _on_event.buffer()[2] = n; } + inline void set_duration(double d) { _off_event.time() = _on_event.time() + d; } inline MidiEvent& on_event() { return _on_event; } inline MidiEvent& off_event() { return _off_event; } diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc index 27bb681c43..b2d5a80928 100644 --- a/libs/ardour/midi_model.cc +++ b/libs/ardour/midi_model.cc @@ -116,7 +116,7 @@ MidiModel::read (MidiRingBuffer& dst, nframes_t start, nframes_t nframes, nframe { size_t read_events = 0; - cerr << "MM READ @ " << start << " + " << nframes << endl; + //cerr << "MM READ @ " << start << " + " << nframes << endl; /* FIXME: cache last lookup value to avoid the search */ @@ -170,8 +170,8 @@ MidiModel::read (MidiRingBuffer& dst, nframes_t start, nframes_t nframes, nframe } } - if (read_events > 0) - cerr << "MM READ " << read_events << " EVENTS" << endl; + //if (read_events > 0) + // cerr << "MM READ " << read_events << " EVENTS" << endl; return read_events; }