-
Notifications
You must be signed in to change notification settings - Fork 13
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
Integration with midly
for full MIDI message parsing / support using "Owned" message variants
#36
base: main
Are you sure you want to change the base?
Conversation
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.
Nice! Looking good!
As mentioned, I added a debug custom message for OwnedLiveEvent
when NoteOn, NoteOff & AfterTouch.
Also fixed a bug in the piano example.
Haven't had time to check the input and output example yet, but I'll do that next 👍
I noticed that in the piano example, the function fn display_press(mut query: Query<(&mut Transform, &Key), With<PressedKey>>) {
for (mut t, k) in &mut query {
if t.translation.y == k.y_reset{
t.translation.y += -0.05;
}
}
} |
fix for piano example, better message debugging Co-authored-by: Mikkel Rasmussen <theluja@gmail.com>
// let pitch = data.message.msg[1]; | ||
// let octave = pitch / 12; | ||
// let key = KEY_RANGE[pitch as usize % 12]; | ||
|
||
// if data.message.is_note_on() { | ||
// debug!("NoteOn: {}{:?} - Raw: {:?}", key, octave, data.message.msg); | ||
// } else if data.message.is_note_off() { | ||
// debug!("NoteOff: {}{:?} - Raw: {:?}", key, octave, data.message.msg); | ||
// } else { | ||
// debug!("Other: {:?}", data.message.msg); | ||
// } |
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.
// let pitch = data.message.msg[1]; | |
// let octave = pitch / 12; | |
// let key = KEY_RANGE[pitch as usize % 12]; | |
// if data.message.is_note_on() { | |
// debug!("NoteOn: {}{:?} - Raw: {:?}", key, octave, data.message.msg); | |
// } else if data.message.is_note_off() { | |
// debug!("NoteOff: {}{:?} - Raw: {:?}", key, octave, data.message.msg); | |
// } else { | |
// debug!("Other: {:?}", data.message.msg); | |
// } |
Made a pr to your branch with some updates to the piano example along with the above-mentioned issue: masonium#1 |
Added Orthographic projection and made keypress relative in the piano example
Initial branch based on the discussion in #35 .
Docs are probably a little sparse; I wasn't sure what should be copied / re-worded vs. what isn't really necessary.
I went with
OwnedLiveEvent
andOwnedSystemCommand
as anologues to themidly
variants, but I'm definitely not wedded to those names. I do think it's better to have different names than simply e.g.LiveEvent
; the user can differentiate with qualified paths (midly::LiveEvent
vs.bevy_midi::LiveEvent
) but that strikes me as clunky.