Using typing keyboard for playing
I want to be able to play from the typing keyboard - the idea is that a note of specific frequency should be sounded as long as the key is held down. (Typically in an generalized diatonic key layout.) The function KBHit.getchar() does not seem to be the right thing, because it just gives a value when the key is depressed, not when it is released, and further, does not disable "key repeat". In addition, it would be better to get the key numbers, not the text key map translated values which may change (and not work one special key combinations). So can this playing functionality be achieved somehow? Hans Aberg
Hey, Hans!
2009/4/15 Hans Aberg
I want to be able to play from the typing keyboard - the idea is that a note of specific frequency should be sounded as long as the key is held down. (Typically in an generalized diatonic key layout.)
Sounds good!
So can this playing functionality be achieved somehow?
Yes. The general "Hid" object can also open a keyboard device (which is just another hid device). that interface is a lot more versatile, supports signals for releasing the keys and isn't affected by keyboard repeat rate as you're just reading the device directly. The directory of Hid examples in the examples dir that came with your download will have a example or two doing more or less what you want, you'll be able to edit it for the scale and layout that you want with sounds of your choice. Hope that helps, Kas.
On 15 Apr 2009, at 13:24, Kassen wrote:
I want to be able to play from the typing keyboard - the idea is that a note of specific frequency should be sounded as long as the key is held down. (Typically in an generalized diatonic key layout.)
Sounds good!
I have used it in Scala for about a year, mostly in E31 (close to Renaissance extended meantone). The new Apple flat mini-keyboard (with USB chord) is good for this purpose. Rapid melodic movements and ornaments are possible :-).
So can this playing functionality be achieved somehow?
Yes. The general "Hid" object can also open a keyboard device (which is just another hid device). that interface is a lot more versatile, supports signals for releasing the keys and isn't affected by keyboard repeat rate as you're just reading the device directly.
The directory of Hid examples in the examples dir that came with your download will have a example or two doing more or less what you want, you'll be able to edit it for the scale and layout that you want with sounds of your choice.
Hope that helps,
Hope, so too :-). I have something to go for. Hans
Hans; I have used it in Scala for about a year, mostly in E31 (close to
Renaissance extended meantone).
It's not very urgent, more like a future idea for a "luxury" feature but I think it would be interesting to be able to load Scala files and have those affect Std.mtof(). That function is one of the few bits in ChucK that makes any assumptions about "what music is". Of course we are all free to develop our own scales and tunings; I'm still happy with integer multiples of 200Hz.
The new Apple flat mini-keyboard (with USB chord) is good for this purpose. Rapid melodic movements and ornaments are possible :-).
Keyboards matter; both the tactile feel and "ghosting" are important, IMHO. I think it's a great shame that so many companies cut so many corners there these days. Good to hear you found one you like, USB "chords" sound especially interesting. :¬p Sorry to poke fun at your typo; I just imagined what a USB chord would be like.
Hope, so too :-). I have something to go for.
I think the Smelt one and the one in /examples/ are quite comparable. The Hid interface is quite pleasant to work with, there will be lots of "magic numbers" but the code for the device abstraction is very readable. Yours, Kas.
On 15 Apr 2009, at 14:19, Kassen wrote:
I have used it in Scala for about a year, mostly in E31 (close to Renaissance extended meantone).
It's not very urgent, more like a future idea for a "luxury" feature but I think it would be interesting to be able to load Scala files and have those affect Std.mtof().
Scala is a bit more MIDI oriented, and is quite difficult to develop ones own tunings with (notation systems are hardwired), though of course very useful for many microtonal tasks.
That function is one of the few bits in ChucK that makes any assumptions about "what music is". Of course we are all free to develop our own scales and tunings; I'm still happy with integer multiples of 200Hz.
The (generalized) diatonic pitch system I use the set of pitches p M + q m, where m (resp. M) is a choice minor (resp. minor) second, and p, q runs through all integers. It blends well with other music if one sets A = 440 Hz. The Pythagorean tuning is close to E53 and sets m = 4, M = 9; the Renaissance meantone is close to E31 and set m = 3, M = 5. The layout is C# D# E# C D E F# G# A# B# Cb Db Eb F G A B Fb Gb Ab Bb C' You might check that transposition takes place by translation. Play C major, and see that the fingering is the same as on a piano keyboard. Then it is the same in all other major keys: each scale needs only one fingering, independent of key. Same for chords.
The new Apple flat mini-keyboard (with USB chord) is good for this purpose. Rapid melodic movements and ornaments are possible :-).
Keyboards matter; both the tactile feel and "ghosting" are important, IMHO. I think it's a great shame that so many companies cut so many corners there these days. Good to hear you found one you like, ...
This the best I have tried so far, trying some other Apple keyboards of older vintage before. Typing keyboards often have the problem of a distinct touchpoint, but this keyboard has instead a firm and rather short key movement, more like favored on accordions, for example.
...USB "chords" sound especially interesting. :¬p
Sorry to poke fun at your typo; I just imagined what a USB chord would be like.
The chord-less ones may have a small delay in them. That is anyway the case of joysticks. Not good for music.
Hope, so too :-). I have something to go for.
I think the Smelt one and the one in /examples/ are quite comparable. The Hid interface is quite pleasant to work with, there will be lots of "magic numbers" but the code for the device abstraction is very readable.
The Smelt files kb.ck and kb-fret.ck have enough info in them that it might be possible to for me to figure it out. But your suggestion may be of help, too. Hans
On Wed, Apr 15, 2009 at 7:02 AM, Hans Aberg
I want to be able to play from the typing keyboard - the idea is that a note of specific frequency should be sounded as long as the key is held down. (Typically in an generalized diatonic key layout.)
The function KBHit.getchar() does not seem to be the right thing, because it just gives a value when the key is depressed, not when it is released, and further, does not disable "key repeat". In addition, it would be better to get the key numbers, not the text key map translated values which may change (and not work one special key combinations).
So can this playing functionality be achieved somehow?
You want smelt! http://smelt.cs.princeton.edu/ http://smelt.cs.princeton.edu/code/keyboard/kb.ck -- Tom Lieber http://AllTom.com/
On 15 Apr 2009, at 13:27, Tom Lieber wrote:
So can this playing functionality be achieved somehow?
You want smelt!
Thank you. It looks interesting. Hans
participants (3)
-
Hans Aberg
-
Kassen
-
Tom Lieber