-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wip] Supporting more midi messages in MidiDrop plugin #1399
base: master
Are you sure you want to change the base?
Conversation
}; | ||
struct MidiTrackEvent { | ||
static MidiTrackEvent make_note_off(const double start, const midi_size_t ch, const midi_size_t n, const midi_size_t v){ | ||
return MidiTrackEvent{m_start: start, m_message: Midi::NoteOffData{channel: ch, note: n, velocity: v}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{m_start: start,
is not valid C++ syntax AFAIK, it should be
.m_start = start
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -18,11 +18,101 @@ class DropHandler final : public Process::ProcessDropHandler | |||
const score::DocumentContext& ctx) const noexcept override; | |||
}; | |||
|
|||
struct PitchbendData{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MAybe all of these could go into a more general Midi.hpp ... or, I wonder if it wouldn't be best in libremidi, and then try to consume those directly ? not sure...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, I'll start moving it soon then, please let me know what makes most sense.
I was going with MidiTrackEvent as type name (which is the core object along MidiNote which has "pointers" to optional? pair), and considering a "domain" folder:
/domain/MidiNote.hpp moving the current one
/domain/MidiTrackEvent.hpp the detailed header
/domain/Midi.hpp a logical header, including several others, for convenience in other modules.
Do you like this?
@@ -65,11 +65,8 @@ void DropHandler::dropData( | |||
const double ratio = song_t / actualDuration.msec(); | |||
if (ratio != 1.) | |||
{ | |||
for (auto& note : track.notes) | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
midi_size_t velocity; | ||
}; | ||
struct MidiTrackEvent { | ||
static MidiTrackEvent make_note_off(const double start, const midi_size_t ch, const midi_size_t n, const midi_size_t v){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these functions look a lot like the ones in libremidi, maybe it should go there ?
…nothing is handled in the UI yet, but it parses the MidiTrackEvent objects.
b4d9700
to
ba90398
Compare
66a7ad0
to
5dc8d48
Compare
9a9b382
to
28c6d0a
Compare
hello ! just so you know - as this was requested in many places I added a very small separate "midi reader" object which will take a midi file explicitly and output every message, as well as a "midi filter" object which is able to filter a specific CC, pitch bend, after touch, etc... message. It's availble in the current nightlies |
ac5bf9a
to
fd8efed
Compare
This is wip of a first iteration on supporting a bit more of the midi messages in Score.
current scope
Guidance appreciated, including pointers for: