sorry if im doubleposting but i got an email by pd-list@iem.at telling me that it is now possible for me to write to the list; so if it didnt work now it works
hi everyone, i'm new to this list and pure data itself so please allow me to ask some kinda n00by question.
i want to build a computerkeyboard setup in which i can press many keys at once to play chords and stuff and until now i found no solution to this.
as i want those notes to stop in the moment of the keyup event i made a fix around which sadly stops all notes at the moment i release any key.
could anyone post me something or names of objects i should look at for the moment => thanks
here s my crappy code:
#N canvas 0 0 1087 712 12; #X obj 38 625 osc~ 440; #X obj 38 600 r notes; #X obj 37 654 dac~; #X obj 383 3 key; #X obj 1 2 keyname; #X floatatom 383 26 5 0 0 0 - - -; #X symbolatom 52 24 10 0 0 0 - - -; #X obj 3 89 select 48; #X obj 79 89 select 49; #X obj 155 89 select 50; #X obj 231 89 select 51; #X obj 307 89 select 52; #X obj 383 89 select 53; #X obj 459 89 select 54; #X obj 611 89 select 56; #X obj 687 89 select 57; #X obj 535 89 select 55; #X obj 3 112 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 687 112 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 611 112 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 535 112 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 459 112 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 383 112 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 307 112 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 231 112 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 155 112 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 79 112 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 79 131 s "1"; #X obj 3 131 s "0"; #X obj 155 130 s "2"; #X obj 231 131 s "3"; #X obj 307 130 s "4"; #X obj 383 130 s "5"; #X obj 459 131 s "6"; #X obj 535 130 s "7"; #X obj 611 130 s "8"; #X obj 687 131 s "9"; #X obj 3 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 3 168 select 97; #X obj 79 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 79 168 select 115; #X obj 163 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 163 168 select 100; #X obj 247 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 247 168 select 102; #X obj 331 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 331 168 select 103; #X obj 415 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 415 168 select 104; #X obj 499 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 499 168 select 106; #X obj 583 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 583 168 select 107; #X obj 667 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 667 168 select 108; #X obj 751 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 751 168 select 246; #X obj 835 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 835 168 select 228; #X obj 919 168 select 35; #X msg 3 209 262; #X msg 79 208 277; #X msg 163 208 294; #X msg 247 208 311; #X msg 331 209 330; #X msg 415 208 349; #X msg 499 208 370; #X msg 583 208 392; #X msg 667 208 415; #X msg 751 208 440; #X msg 835 208 466; #X msg 919 209 494; #X obj 919 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 440 326 keyup; #X obj 4 408 select 97; #X obj 80 408 select 115; #X obj 164 408 select 100; #X obj 248 408 select 102; #X obj 332 408 select 103; #X obj 416 408 select 104; #X obj 500 408 select 106; #X obj 584 408 select 107; #X obj 668 408 select 108; #X obj 752 408 select 246; #X obj 836 408 select 228; #X obj 920 408 select 35; #X obj 463 484 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 463 501 0; #X obj 463 525 s notes; #X obj 432 287 s notes; #X floatatom 3 33 5 0 0 0 - - -; #X connect 0 0 2 0; #X connect 0 0 2 1; #X connect 1 0 0 0; #X connect 3 0 5 0; #X connect 4 0 90 0; #X connect 4 1 6 0; #X connect 5 0 7 0; #X connect 5 0 8 0; #X connect 5 0 11 0; #X connect 5 0 12 0; #X connect 5 0 9 0; #X connect 5 0 10 0; #X connect 5 0 13 0; #X connect 5 0 15 0; #X connect 5 0 14 0; #X connect 5 0 16 0; #X connect 5 0 38 0; #X connect 5 0 40 0; #X connect 5 0 42 0; #X connect 5 0 44 0; #X connect 5 0 46 0; #X connect 5 0 48 0; #X connect 5 0 50 0; #X connect 5 0 52 0; #X connect 5 0 54 0; #X connect 5 0 56 0; #X connect 5 0 58 0; #X connect 5 0 59 0; #X connect 7 0 17 0; #X connect 8 0 26 0; #X connect 9 0 25 0; #X connect 10 0 24 0; #X connect 11 0 23 0; #X connect 12 0 22 0; #X connect 13 0 21 0; #X connect 14 0 19 0; #X connect 15 0 18 0; #X connect 16 0 20 0; #X connect 17 0 28 0; #X connect 18 0 36 0; #X connect 19 0 35 0; #X connect 20 0 34 0; #X connect 21 0 33 0; #X connect 22 0 32 0; #X connect 23 0 31 0; #X connect 24 0 30 0; #X connect 25 0 29 0; #X connect 26 0 27 0; #X connect 37 0 60 0; #X connect 38 0 37 0; #X connect 39 0 61 0; #X connect 40 0 39 0; #X connect 41 0 62 0; #X connect 42 0 41 0; #X connect 43 0 63 0; #X connect 44 0 43 0; #X connect 45 0 64 0; #X connect 46 0 45 0; #X connect 47 0 65 0; #X connect 48 0 47 0; #X connect 49 0 66 0; #X connect 50 0 49 0; #X connect 51 0 67 0; #X connect 52 0 51 0; #X connect 53 0 68 0; #X connect 54 0 53 0; #X connect 55 0 69 0; #X connect 56 0 55 0; #X connect 57 0 70 0; #X connect 58 0 57 0; #X connect 59 0 72 0; #X connect 60 0 89 0; #X connect 61 0 89 0; #X connect 62 0 89 0; #X connect 63 0 89 0; #X connect 64 0 89 0; #X connect 65 0 89 0; #X connect 66 0 89 0; #X connect 67 0 89 0; #X connect 68 0 89 0; #X connect 69 0 89 0; #X connect 70 0 89 0; #X connect 71 0 89 0; #X connect 72 0 71 0; #X connect 73 0 74 0; #X connect 73 0 75 0; #X connect 73 0 76 0; #X connect 73 0 77 0; #X connect 73 0 78 0; #X connect 73 0 79 0; #X connect 73 0 80 0; #X connect 73 0 81 0; #X connect 73 0 82 0; #X connect 73 0 83 0; #X connect 73 0 84 0; #X connect 73 0 85 0; #X connect 74 0 86 0; #X connect 75 0 86 0; #X connect 76 0 86 0; #X connect 77 0 86 0; #X connect 78 0 86 0; #X connect 79 0 86 0; #X connect 80 0 86 0; #X connect 81 0 86 0; #X connect 82 0 86 0; #X connect 83 0 86 0; #X connect 84 0 86 0; #X connect 85 0 86 0; #X connect 86 0 87 0;
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
On Wed, 04 Oct 2006 18:44:54 +0200 "Marten Rieger" kali.84@gmx.net wrote:
hi everyone, i'm new to this list and pure data itself so please allow me to ask some kinda n00by question.
i want to build a computerkeyboard setup in which i can press many keys at once to play chords and stuff and until now i found no solution to this.
as i want those notes to stop in the moment of the keyup event i made a fix around which sadly stops all notes at the moment i release any key.
could anyone post me something or names of objects i should look at for the moment => thanks
If you want polyphony you will need more than one oscillator. Each key pressed should be routed to a new oscillator. You don't need one oscillator for every key, but you need as many as the degree of polyphony you require.
For example to make 3 note triad chords you need three oscillators.
The unit that helps with this is [poly]. This combines pairs of values which represent the key and its status and prepends a number asigned in round-robin mode to each. Used in combination with a [route] unit you can have these sent to each of the oscillators. The argument to [poly] is the number of voices of polyphony you want.
For example [poly 3] for a 3 note system.
Each event is now a 3 value list.
The [route] separates out each of these into 2 value lists and sends each to its respective output matching the number of an argument.
See attchment... it's not the best way to do it, but hopefully you will understand with a little study.
There is a problem with using the keyboard on many machines. The kernel automatically sends repeated events from the I/O, which isn't what you want for musical use.
You can try setting your key repeat to the lowest rate possible and the longest delay before it starts, on linux/unix
kbdrate -r 2 -d 1000
Hallo, padawan12 hat gesagt: // padawan12 wrote:
You can try setting your key repeat to the lowest rate possible and the longest delay before it starts, on linux/unix
kbdrate -r 2 -d 1000
Hm, I don't have the kbdrate command on my machine, but alternatively you may use "xset" to set keyboard specifics. "xset -r" will switch off autorepeat altogether, "xset r" will switch it back on.
Attached is another way to get at keyboard data in Pd that is suited to be used to built a midi-keyboard from a standard PC keyboard. It involves an abstraction "keytrans.pd" which should be used with two argument as [keytrans <keyname> <midi note>] and will output a list of "<frequency> <keypress state as 0 or 1>" if the respective key passed as <keyname> is pressed or released. It's a good example for when an abstraction can save a lot of typing and connecting work.
Frank Barknecht _ ______footils.org_ __goto10.org__
Frank Barknecht wrote:
Attached is another way to get at keyboard data in Pd that is suited to be used to built a midi-keyboard from a standard PC keyboard. It involves an abstraction "keytrans.pd" which should be used with two argument as [keytrans <keyname> <midi note>] and will output a list of "<frequency> <keypress state as 0 or 1>" if the respective key passed as <keyname> is pressed or released. It's a good example for when an abstraction can save a lot of typing and connecting work.
Ciao
hi, nice work! i altered your keytrans.pd a little bit and added a retrigger-filter to it, in order to make it independent from changing the keyboard retrigger rate on the system and make it work out of the box. release-events for keys are only let through if no trigger-event for the same key occurs within 50 ms. this of course implies a 50 ms latency on releases, but on synths with a percussive envelope, this won't be too audible. the 50 ms delay work fine for me, but YMMV.
while experimenting with chords on the keyboard, i added 4 more voices to my local copy of the help/test-patch. i found that it is possible to play some 7-voice chords like 'asdfzhk' (interesting chord name ;) but some other keys would not combine as well, for example the only other key i could play in addition to 'fg' was 'z', other 3-voice chords based on 'fg' did not work. operating system weirdness? hardware weirdness? i don't know, but it renders a "polyphonic" pc-keyboard kinda useless for musical use if certain combinations of 3 notes aren't possible.
charlie
#N canvas 311 204 782 431 10; #X obj 195 55 keyname; #X obj 195 127 route $1; #X obj 274 287 f $2; #X obj 58 357 outlet; #X text 292 68 swap output of [keyname] to be a list: <keyname> <state> ; #X obj 195 106 list trim; #X text 294 102 trim the "list" selector; #X obj 58 61 inlet; #X text 28 34 pass-through trick to make connecting easier; #X obj 274 309 mtof; #X text 38 386 list <freq> <0|1>; #X obj 195 78 list prepend; #X obj 274 267 loadbang; #X obj 195 332 list prepend; #X text 308 322 prepend the desired frequency from a midi note passed as argument 2; #X text 294 118 wait for the key passed as first argument. Output after this stage is: 1 (down) or 0 (up) for the selected keyname.; #X obj 195 156 moses 1; #X msg 195 231 0; #X msg 232 185 stop; #X obj 195 186 b; #X obj 195 251 change; #X obj 195 210 delay 50; #X text 296 203 add latency to release events which are stopped again when a trigger event comes. the delay used here depends on your keyboard repeat rate , 50 ms works for me; #X connect 0 0 11 0; #X connect 0 1 11 1; #X connect 1 0 16 0; #X connect 2 0 9 0; #X connect 5 0 1 0; #X connect 7 0 3 0; #X connect 9 0 13 1; #X connect 11 0 5 0; #X connect 12 0 2 0; #X connect 13 0 3 0; #X connect 16 0 19 0; #X connect 16 1 18 0; #X connect 16 1 20 0; #X connect 17 0 20 0; #X connect 18 0 21 0; #X connect 19 0 21 0; #X connect 20 0 13 0; #X connect 21 0 17 0;
Hallo, Christopher Charles hat gesagt: // Christopher Charles wrote:
while experimenting with chords on the keyboard, i added 4 more voices to my local copy of the help/test-patch. i found that it is possible to play some 7-voice chords like 'asdfzhk' (interesting chord name ;) but some other keys would not combine as well, for example the only other key i could play in addition to 'fg' was 'z', other 3-voice chords based on 'fg' did not work. operating system weirdness? hardware weirdness? i don't know, but it renders a "polyphonic" pc-keyboard kinda useless for musical use if certain combinations of 3 notes aren't possible.
This is a hardware issue and varies from keyboard to keyboard: Many keyboards don't let you press all key combinations at the same time. For example my keyboard doesn't like the chord "afg". ;)
Frank Barknecht _ ______footils.org_ __goto10.org__
Aha! very good. xset does the trick, much better than using kbdrate.
On Wed, 4 Oct 2006 21:07:33 +0200 Frank Barknecht fbar@footils.org wrote:
Hallo, padawan12 hat gesagt: // padawan12 wrote:
You can try setting your key repeat to the lowest rate possible and the longest delay before it starts, on linux/unix
kbdrate -r 2 -d 1000
Hm, I don't have the kbdrate command on my machine, but alternatively you may use "xset" to set keyboard specifics. "xset -r" will switch off autorepeat altogether, "xset r" will switch it back on.
Attached is another way to get at keyboard data in Pd that is suited to be used to built a midi-keyboard from a standard PC keyboard. It involves an abstraction "keytrans.pd" which should be used with two argument as [keytrans <keyname> <midi note>] and will output a list of "<frequency> <keypress state as 0 or 1>" if the respective key passed as <keyname> is pressed or released. It's a good example for when an abstraction can save a lot of typing and connecting work.
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
hello again, where do i have to do this trick with the xset -r / kbdrate thing. i tried as startupoption to pd itself or as terminalcmd but nothing changes.
also i dont know if this is correct but it seems like the poly-object is not correctly sending keyupevents(0) to my oscs. so when i hold a chord on my keyboard the chord is there for like 2 seconds, then theres only the last note ringing with full amplitude & then moreover when i take my fingers off the machine theres still some single note left.
so at last it seems like having the same note in each ocsillator
thanks for being m
Marten Rieger wrote:
hello again, where do i have to do this trick with the xset -r / kbdrate thing. i tried as startupoption to pd itself or as terminalcmd but nothing changes.
the "xset" command interacts with the Xserver in the background and has nothing to do with pd. you have to execute it somewhere in the running X-session, e.g. in your startpd.sh script (just before running pd), or in a script that is executed once you log into your x-session. (the latter being the better, imho)
mf.asdr. IOhannes
oh sorry i forgot to tell that im on a windoze machine ?! i already tried to configure my keyboard in the systempreferences where i lessened the repeatrate & delay ? with no obvious reaction i even think nothing at all changed with that; now i built in the change command and have always a chord containing the 3 notes of the last 3 keys pressed
last thing i need for now is a working keyupevent that mutes the corresponding keynote
attached the code
-------- Original-Nachricht -------- Datum: Thu, 05 Oct 2006 11:43:48 +0200 Von: IOhannes m zmoelnig zmoelnig@iem.at An: Marten Rieger kali.84@gmx.net Betreff: Re: [PD] polyphonic ? key, keyup setup question
the "xset" command interacts with the Xserver in the background and has nothing to do with pd. you have to execute it somewhere in the running X-session, e.g. in your startpd.sh script (just before running pd), or in a script that is executed once you log into your x-session. (the latter being the better, imho)
mf.asdr. IOhannes
oh sorry i forgot to tell that im on a windoze machine ?! i already tried to configure my keyboard in the systempreferences where i lessened the repeatrate & delay ? with no obvious reaction i even think nothing at all changed with that; now i built in the change command and have always a chord containing the 3 notes of the last 3 keys pressed
would you help me again with this? last thing i need for now is a working keyupevent that mutes the corresponding keynote
attached my code:
GMX DSL-Flatrate 0,- Euro* - Ãberall, wo DSL verfügbar ist! NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl
i know this is wishful thinking (along with getting vst~ ported to osx, yves playlist external for windows, and trigger objects to relocate inputs when edited)
but how hard would it be to make [keyup] indepandant to the retrigger function? obviously your computer hardware knows when i key is pressed or not.
On 6 Oct 2006, at 10:49 PM, hard off wrote:
but how hard would it be to make [keyup] indepandant to the retrigger function? obviously your computer hardware knows when i key is pressed or not.
why not just use [hid]? it does not use the OS keyup, but direct from
USB input instead.
simon
simon wise wrote:
On 6 Oct 2006, at 10:49 PM, hard off wrote:
but how hard would it be to make [keyup] indepandant to the retrigger function? obviously your computer hardware knows when i key is pressed or not.
why not just use [hid]? it does not use the OS keyup, but direct from USB input instead.
most likely because of w32...
f,.asdr IOhannes
Hallo, Marten Rieger hat gesagt: // Marten Rieger wrote:
where do i have to do this trick with the xset -r / kbdrate thing. i tried as startupoption to pd itself or as terminalcmd but nothing changes.
You use "xset -r" in a Terminal like xterm. If you press and hold any key in the Terminal, it will start to repeat after a while. But if you input the command "xset -r" and then try the key-test again, it should not repeat automatically again.
also i dont know if this is correct but it seems like the poly-object is not correctly sending keyupevents(0) to my oscs. so when i hold a chord on my keyboard the chord is there for like 2 seconds, then theres only the last note ringing with full amplitude & then moreover when i take my fingers off the machine theres still some single note left.
Maybe the autorepeat isn't really switched off. You can use the command "xset q" to "q"uery the current settings of your X-Server, including autorepeat settings.
Frank Barknecht _ ______footils.org_ __goto10.org__
thanks a lot for your quick answer padawan. your attachment really comes in handy long lives the poly object @-@'
-------- Original-Nachricht -------- Datum: Thu, 5 Oct 2006 07:52:04 +0100 Von: padawan12 padawan12@obiwannabe.co.uk An: pd-list@iem.at Betreff: Re: [PD] polyphonic ? key, keyup setup question
On Wed, 04 Oct 2006 18:44:54 +0200 "Marten Rieger" kali.84@gmx.net wrote:
hi everyone, i'm new to this list and pure data itself so please allow
me to
ask some kinda n00by question.
i want to build a computerkeyboard setup in which i can press many keys
at
once to play chords and stuff and until now i found no solution to this.
as i want those notes to stop in the moment of the keyup event i made a
fix
around which sadly stops all notes at the moment i release any key.
could anyone post me something or names of objects i should look at for
the
moment => thanks
If you want polyphony you will need more than one oscillator. Each key pressed should be routed to a new oscillator. You don't need one oscillator for every key, but you need as many as the degree of polyphony you require.
For example to make 3 note triad chords you need three oscillators.
The unit that helps with this is [poly]. This combines pairs of values which represent the key and its status and prepends a number asigned in round-robin mode to each. Used in combination with a [route] unit you can have these sent to each of the oscillators. The argument to [poly] is the number of voices of polyphony you want.
For example [poly 3] for a 3 note system.
Each event is now a 3 value list.
The [route] separates out each of these into 2 value lists and sends each to its respective output matching the number of an argument.
See attchment... it's not the best way to do it, but hopefully you will understand with a little study.
There is a problem with using the keyboard on many machines. The kernel automatically sends repeated events from the I/O, which isn't what you want for musical use.
You can try setting your key repeat to the lowest rate possible and the longest delay before it starts, on linux/unix
kbdrate -r 2 -d 1000