M4L keypresses/keyup not detected if device's window not selected
Hi guys,
I'm working on a simple M4L device for my young electronic students and i'm facing a issue with keyup and keypressed. I searched the forum for all the treads for 2 days about that stuff and can't find any real answer to my problem.
So, I assigned number keys of my computer keyboard to max toggles and want to be able to use that assignment in Ableton. Pushing a number key trigger a chord, holding it sustain it, and keyup stop the chord. I know that key and keyup don't work in Ableton if device's window isn't selected but i really need to find a way to avoid that problem (or find a alternative solution with key mapping ,working with the LOM or i don't know what)...
oh and btw aka.keyboard isn't a viable option for that project.
Tnx
Martin
Hi,
What you want is a global keyboard listener which isn't possible with the default objects in m4l.
You could use automatable elements like live.button instead of toggles and assign keys to them in ableton.
What if the device opens a window that stays in foreground, does that keep the key objects active?
O.
Or use the 'hi' object, also works when the patch runs in the background.
Can however be confusing with different types of keyboards/computers though, as they might output different values for the same keys.
Tnx for you answers. I already tried to make the device pop in a floating window but the result is the same.
For the "hi" object it is no viable as my students will not work on the same computer when they will go back home.
So I tried the live.button solution, and it seems to be a viable option. The only problem is that mapped computer's keys are just ok for toggle operations. I don't think that it is possible in ableton to make them work as gates ( but if it is possible I'm all ears).
You're right. Only momentary input seems to be midi. Your running out of options here :(. What about an extra key to end sustain (e.g. keypad-0). It is possible to reverse the live.button after mapped key arrived. So at least you get it to be a trigger instead of a toggle.
O.
Yeap that would be my backup plan but I'm sure that a workaround exist somewhere ( at least I want to believe it )...
What about working in the LOM to "refresh" max device selection in Ableton (like every 10ms ) in order to make the "key" and "keyup" objects constantly work in M4L ??? Is that thing achievable ?
It's not enough to select the device. It needs a click into the device window to reactivate the key objects. Last Option is a Java or C-external!
Damned... So this clic isn't simulable with the LOM ???
Ok if someone see that tread and is JAVA or C competent you know what to do if you want to help :p
Why are you stuck to the idea of using the numpad. there's a simulated midi keyboard in Live on the tabulator and caps lock row. And your device could be a simple midi effect or instrument, could it? O.
Because numbers are related to chords degrees, so my students will be able to play the first degree with numpad 1, second on with numpad 2.... I want the device to be as simple as possible so they would just have to put it on a track as midi effect, choose a tonality and an instrument and start making simples chords progressions.
Just to let you know this kind of injecting notes into the track needs another track if your students want to record what they are playing. and if they want to record notes with the correct timing best is to put the midi generating device on it's own track and the instrument on a separate track. This is making things complicated even if your device is working someday.
It's maybe easier for them to use A S D F G H J for 1 2 3 4 5 6 7 but be able to record in the same track. You could print the played degree to the device screen so they are sure the correct key was hit.
O.
"but be able to record in the same track"
They still won't be able to record the generated chords on the same track only the trigger notes.
"if they want to record notes with the correct timing best is to put the midi generating device on it’s own track and the instrument on a separate track."
Yes am aware of that thing but this isn't really a problem because the students know the bases of Ableton.
"You could print the played degree to the device screen so they are sure the correct key was hit."
The feedback is already implemented. In fact the device is working well expect for that key/keyup stuff... Erf... it seems that i'm kind of fu**ed.
Thank you for the help ^^
If it can wait till next week i can help you with a java ext.
O.
d┃・∀・┃b
Yeah it can wait ^^ Thanks again for your help !!!!!
I will post the patch here later.
ok, let's do it.
Just a thank you note for that awesome keylistener!! Great super-simple way of adding extra functionality to M4L interfaces!