-
-
Notifications
You must be signed in to change notification settings - Fork 39.2k
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
how can I specify a different MIDI channel for identical MIDI notes on a layer? #9456
Comments
I've looked into QMK's MIDI abilities a bit for my keyboard, and sadly, I've not seen this as an option. I may have missed seeing this in my searching though. |
thanks, Alex. i realize MIDI is still experimental in QMK, but i was hoping someone might have had the same need and found a solution. |
If you check out my fork, I made Keyboard handwired/ortho5x12. I made a custom midi keyboard layer where I store the octave, and make a 'custom' key that sends its notes at the octave specified. I didn't know that sending the same note at the same octave caused an error, so I need to make some keys send octave +1. You can check out out and see if anything there could help you out. |
it doesn't cause an error, per se, but different DAWs treat a repeated note differently across platforms (i'm using Linux and Mac mainly). on a Mac running GarageBand the notes will both play simultaneously, but it activates a sustain effect that stays until you unplug the keyboard. on LMMS on Linux the second not simply won't play. |
https://github.com/AlexOConnorHub/qmk_firmware is my fork. (in the master branch) my files are in keyboards/handwired/ortho5x12 |
that's quite interesting. |
You understand that perfectly! I don't use quantum because of the constant channel and velocity. I made channel +/- and velocity +/- buttons. I checked the quantum buttons, and they call a midi send function. So I just call that function, but use what ever velocity /channel is selected currently. I don't have a keyboard yet, waiting on parts, so I keep adding to my keymap, hehe. I don't plan on having a speaker on my board, I'll just use a DAW. |
would you mind my experimenting with a similar solution (provided i can wrap my head around your code)? |
Enjoy! I put it on git for that reason. |
thanks! i will let you know how it goes and share the code (if it works...). |
Hey, I just split up that one file func.c into 3, because the one file was getting long, and I was really making 3 different new functions. now custom_midi.c has what I was doing with midi. |
*My keyboard is now in a branch called "custom-keyboard" on my fork. |
hi Alex, your solution doesn't seem to work for me (perhaps because i understand it conceptually, but not in terms of actually developing the code). i need to set different channels for repeated notes by default. |
hi Alex, i have a technical question for you: there's a way to use a single keystroke to send a KC with a modifier, as in LCTL(kc). could i just define LCTL(noteX) as "noteX on MIDI channel 2"? something like "if midi is on, define LCTL(noteX) as noteX played on midi channel 2". any thoughts on this? |
Sorry I just got around to thinking about this... So to respond to your first question, with my implementation, repeated notes are not sent on different channels. I just thought my project might provide a base for you to modify. While there might be a more efficient way to do this, one idea I can think of is making a boolean for each note, and if it is true, you could send on channel 2, if not, send on channel 1. I think you understand what my code does rather well, but I may have misrepresented what I made it do. To reply to your second question, you can check if the left control modifier key is being pressed with |
Alex, thank you for your comments, and sorry for the delayed response! |
It's a bit off from the main topic here but this happens on my setup, too. I raised this topic here. |
the solution is to have the possibility to assign identical notes to different MIDI channels, but qmk doesn't support that functionality (yet). it only supports keyboard-wide channel up/down functions. |
It seems I found a solution. |
hi @3araht 3araht, i don't understand what your code does. can you explain the logic of what you did in plain language? |
To be honest, I'm not 100% sure why this modification fixed the issue. I should say it just happened. What I intended to do was to suppress the second or further midi_send_noteon() if the note is already turned on. |
"suppress the second or further midi_send_noteon" makes sense, yes. but that wouldn't even be an issue if we found a way to send the same note on different MIDI channels. that's what i'm still shooting for ;-) |
ok, i'm stuck. |
I’m new to the concept of isomorphic midi keyboards but did a quick search and have a basic understanding now. My main question is: what is the benefit of having the same note on multiple channels playing at the same time as opposed to suppressing a duplicate note? If multiple channels for the same midi key code is a requirement, does every key/note need to play on channel 1 unless it is a duplicate at which point it must play on the next unused channel for that note? Or could different switches that duplicate the same notes be hard coded to separate channels and always play on their respective channels? How many repeats of the same notes are there on an isomorphic keyboard? |
hi @brandenbyers , thanks for pitching in! and thanks for all the previous refinements you've contributed to the MIDI component! the benefit is what is called "immutable fingering", meaning: you can move your hand around on a key array when transposing a piece (melody or chord) without having to find a new fingering because the piece doesn't "fit" within the keys you have left. what you propose in the second paragraph would be an option, but it doesn't meet the expectation of the isomorphic musicians i've been in contact with. they expect the duplicates to be mapped across different channels: i will try to upload the suggested mapping one of them provided to illustrate (i'm not proficient with github, i may fail to do so). as to your last question: the number of repeats would depend on the extent of the key array. the biggest arrays i've built for testing would require no more than 5 MIDI channels. |
as to why have repeat notes, and why not have a "rule" to silence repetitions: if you use two hands on a single keyboards, you may repeat a note, and you might want that to just go without issues. i've played a bit and have found that different DAWs respond differently to a repeated not on the same MIDI channel: GarageBand will introduce a sustain, and the note will remain weird until you unplug and reconnect the keyboard. LMMS does something different, i cannot recall right now exactly what. by the way, the above is a wicki-hayden layout. but repetition is a common event on the most common isomorphic layouts. in hindsight, there's one isomorphic keyboard that would benefit from cancelling: the Jankó. the notes repeat every two rows, so you can finger consistently and comfortably. but you would NOT want the notes to repeat, you would want them to cancel as you suggest! |
Ok, I think I now understand the scenario where silencing repeats wouldn’t work. Let me know if I’m understanding this correctly: If a user presses a note on the right hand, and then presses the same note on the left hand, if the user lets up on the right hand, the left note should still be playing, right? If the left note (the repeat of the right note) had been silenced, when lifting up on the right note, the left note would not be playing as expected. If this scenario is correct, then I understand the need for a different solution. |
Instead of channels and firmware, why not solve this problem in hardware? Wire all switches together that are the same midi key code. That way, the firmware will see each of those keys being pressed as the same key in code. So even if one of them lets up, the other(s) would still make the code think the same switch is still pressed. Would that work? Or am I still missing something about why isomorphic users expect and/or need multiple channels? |
Hi @brandenbyers, allow me to jump in. I can tell this because actually, there are hardwired keys on the right side of my keyboard already, which limited the layout flexibility... |
Hi @ralfkaa, do you still have the sustain effect? It should be solved in the latest QMK firmware. |
There are many amazing isomorphic layouts!!! Here are some. Wicki–Hayden note layout The strategy which throws 2nd of further duplicate notes to other channels might work with some conditions. |
hi @brandenbyers , this is correct for 2 of the 3 layouts i've been using: the Wicki-Hayden (first image above) and the Harmonic Table (see below). that's why these two layouts should permit activation of the same note on different keys. but as i mentioned in my second message, this is not the case for the Jankó: for the Jankó you would want a repeat note (say, Y and B in "Mann's Virtual Jankó") to be simply ignored. this is a complication i had honestly not thought about, nor run into yet, because the Jankó is a more linear (ascending left-to-right, like a regular piano keyboard) layout, and i am less likely to hit repeat notes by accident. it makes me think that perhaps the Jankó would have to be addressed on a different keyboard altogether (see below my answer to your other comments). |
@3araht is aware of the issue: the keyboard in question has multiple layers. in @3araht 's case it's the different accordion layouts (and, i assume, an alphanumeric layout as well). in my case it's at least 3 layers: alphanumeric, Wicki-Hayden, and Harmonic Table (i'm seriously considering dropping the Jankó for now, because it adds a different kind of complexity, and the two MIDI layouts are sufficient for my purpose: using the keyboard as a tool to teach theory and harmony). |
so i'm looking at three possibilities (2 suggested by Dean Camera, two i've though of, but don't know whether they are feasible):
there may be other/better solutions. but something along these lines would make the MIDI functionality in QMK much more robust (for Wicki-Hayden, Harmonic Table, and the C-system and B-system chromatic accordions, in particular). |
hi @3araht i haven't flashed new layouts recently, and my old mac got converted to a Fedora machine, so i'd have to give that a try. thanks for sharing. but i still have to see what the effect is in, say, an open source DAW such as LMMS, or in online DAWs i've tested over time. |
i hope this isn't creating more confusion, @3araht . you are correct in that, as i stated previously, the Jankó needs a different solution. but the PRINCIPLE of MIDI is the ability to assign notes to up to 16 channels, so that should, IMHO, be the go-to solution for the issue of replicated notes across note arrays in isomorphic layouts. more importantly, i researched this with professional musicians and music instructors who use isomorphic layouts extensively (except for Jankó, now that i think about it), and this is the solution they expect: throw duplicates onto different channels, and all is good. |
hi @brandenbyers , just checking in: did you have any insights on how QMK might address this need? |
This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in the next 30 days unless it is tagged properly or other activity occurs. |
closing this though this is unresolved, and a clear requirement for any more serious use of MIDI on QMK mechanical keyboards... |
Background: I'm implementing MIDI on a hand-wired keyboard. Several notes repeat by design to make for more convenient fingering (I'm using isomorphic note layouts). But if the repeated notes send the same MIDI note keycodes on the same MIDI channel (i.e., if there are notes on the keyboard which are absolutely identical), I run into trouble depending on what DAW and/or OS I'm using.
Question: Can I configure a layout (in the keymap, I assume) so that each switch sends not only a MIDI note, but also a MIDI channel specification?
An example using quantum keycodes: on a layer I need to have, say, the note MI_G_2 playing on channel MI_CH1 on one switch, and the same MI_G_2 playing on channel MI_CH2 on another switch (on the same layer).
Is that possible, and if so, is there any written documentation on this or example that could show me how to implement this?
Thank you in advance for any help!
The text was updated successfully, but these errors were encountered: