2 #include <halp/callback.hpp>
3 #include <halp/meta.hpp>
4 #include <halp/midi.hpp>
5 #include <libremidi/message.hpp>
7 namespace Nodes::PitchToValue
11 halp_meta(name,
"Midi Pitch")
12 halp_meta(c_name,
"PitchToValue")
13 halp_meta(category,
"Midi")
14 halp_meta(author,
"ossia score")
15 halp_meta(manual_url,
"https://ossia.io/score-docs/processes/midi-utilities.html#midi-pitch")
16 halp_meta(description,
"Extract a MIDI pitch")
17 halp_meta(uuid,
"29ce484f-cb56-4501-af79-88768fa261c3")
21 halp::midi_bus<
"in", libremidi::message> midi;
25 struct : halp::timed_callback<
"out",
int>
27 halp_meta(unit,
"midipitch");
33 for(
const auto& note : inputs.midi)
35 if(note.get_message_type() == libremidi::message_type::NOTE_ON)
36 outputs.out(note.timestamp, (
int)note.bytes[1]);
Definition: PitchToValue.hpp:10