-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Mute Midi-Channels while playback is running #39
Comments
If you use release version of the library, there is no way to do this. But you can take develop sources and then you can use playback.NoteCallback = (d, rt, rl, t) => mutedChannels.Contains(d.Channel) ? null : d;
playback.EventCallback = (e, rt, t) =>
{
var channelEvent = e as ChannelEvent;
if (channelEvent == null)
return e;
return mutedChannels.Contains(channelEvent.Channel) ? null : e;
}; You can set these callbacks before playback start and they will be automatically applied to all events and notes during playback. |
Hello melanchall, Thanks really a lot for your fast response to my 3 issues!! With best regards |
Thomas, You are welcome! :) Thanks for using the library. Please close issues if they are resolved. Max |
Thanks a lot, Max. |
I have one additional comment or proposal: In "TryPlayNoteEvent " I changed a small part of Code:
That's simpler and faster than using events..... |
Hi Thomas, Hmm, it seems reasonable to implement this feature. I'll do it :) Your implementation slightly incomplete since there are other channel events except |
Hi Max, Because of that I think Note_On seems to be ok for muting.... Regards |
Hi Max, Greetings |
Hi Thomas, Recently I've merged PR from @zivillian (#36). So yes, I accept changes from users :) But array of Please do PR and we'll discuss it :) |
PR was created - issue can be closed… :-) |
I reopen the issue. Please clarify your requirement according to your last comment on #45. Do you in fact mute channels on TrackChunk instead of Playback? What does it mean? There is no concept of muting on track chunk level since MIDI spec hasn't such thing. |
As I mentioned in the PR: It‘s fine and sufficient for me to have the mute functionality on the level of midi Channels. |
OK, I've got it. Interesting case. I'll think how it can be implemented. |
Well, I've investigated efforts needed for this task and it seems new class Thanks for using the library and for sharing your experience! |
Ooh - that means my simple solution for the Midi-Channels will not be integrated and also not your method-call solution ? |
It's just unncecessary since there is a way to achieve what you want (and it's not so complex as you think). You just need to manage array of bools on your side. Also you can easily replace all array at once and callbacks will use new array automatically. Also inside callback you can check what track note or event belongs to and mute/unmute it. So you can arrange your data into logical tracks, not by channels. |
How can I mute/unmute midi-channels, while the Playback is running?
The text was updated successfully, but these errors were encountered: