-
Notifications
You must be signed in to change notification settings - Fork 22
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
change channel function #123
Comments
We have The only difficulty I see here is that this field that you suggest adding to the |
Concerning your second point : after thinking about it in more detail I don't think the modification I suggested is necessary. We can modify the |
The function is here : https://github.com/JuliaMusic/MIDI.jl/blob/master/src/miditrack.jl#L312-L317 (and it should also be changed to accept the channel as a standard UInt8, i.e. from 0 to 127 instead of 1 to 128). But I wonder, isn't it easier to simply write the drum notes directly on channel 10? You can specify the channel of each note. This is how I do it when I create drums exercises for myself, as e.g. here https://juliamusic.github.io/JuliaMusic_documentation.jl/dev/blog/garibaldi_dragadiddle/ |
If you are creating a MIDI file from scratch you can directly assign the notes to channel 10 yes. |
Ah now I finally see. Okay, what you want is solved by defining a dictionary that maps instrument strings (e.g. "drums") to channel numbers. If the second argument of |
What is asked here is as simple as
perhaps it can be added as a convenience function |
Selecting the instrument of a track is usually done by adding a
program change
event to the track which describes when to change and what instrument to use.This, however, is not the case when dealing with drums. The MIDI convention is that notes to be rendered as drums have to be on the channel 10.
I propose to add an internal attribute to the
MIDITrack
structure that describes the channel to be used when calling theaddnotes!
function. That way the notes would be directly send to the drum channel without having to modify them.Then, the constructor of
MIDITrack
could be modified to accept aninstrument
argument in order to add the correctprogram change
event or update thechannel
attribute of the track so that the instrument of the MIDI track is correct upon synthesis.What do you think ?
The text was updated successfully, but these errors were encountered: