![]() |
![]() ![]() ![]() ![]() ![]()
|
next newest topic | next oldest topic |
Author | Topic: processing midi input | |
Phi Curtis Member |
![]() ![]() ![]() Hi, I'd just like a quick pointer to what prototypes/areas of Kyma I should be looking at in order to process midi input. For example, while playing my Wacom tablet as a keyboard, I'd like to be able to press one of the PenButtons and change the octave of the next note I'm going to play with the pen, but not change the octave of the currently playing notes (for example, I may have a chord sustaining beneath a melody, or I'm playing a legato line and I don't want to have to precisely coordinate touching the eraser to the pad and pressing the button at the same time). Any suggestions? thanks, IP: Logged | |
SSC Administrator |
![]() ![]() ![]() To send a Pen event but not have it take effect until the next KeyDown, you could use: !PenButton1 alignWith: !KeyDown To have this change the octave, you could multiply it by 12 half steps and add it to the pitch from the keyboard or tablet: !KeyPitch + (12 nn * (!PenButton1 alignWith: !KeyDown)) IP: Logged | |
Phi Curtis Member |
![]() ![]() ![]() Looks like I need a smalltalk reference - "alignWith" isn't covered in the Kyma X Revealed Smalltalk appendix (I realize that it wasn't meant to be exhaustive). Do you have any recommendations? I've seen the free downloadable books listed in the Tweaky, but am not sure which would be the best to serve as a reference. Anyway, a modified version of your suggestion worked for me: !KeyPitch hz * (1 + (!PenButton1 alignWith: !KeyDown)) However, a problem arises in that I am using a polyphonic sound (preceding the Oscillator with a MidiVoice with polyphony set to 4). So now what happens is the sound changes the octave on the next !KeyDown, but you have to play four notes (going through the 4 notes of the polyphony) before the octave returns to normal. How can I make this solution work polyphonically? Thanks, IP: Logged | |
SSC Administrator |
![]() ![]() ![]() "Looks like I need a smalltalk reference - "alignWith" isn't covered in the Kyma X Revealed Smalltalk appendix" alignWith: is CapyTalk (not Smalltalk) and it is a relatively new addition (thus, it does not appear in the book). Update notes are available on the download page of the tweaky: http://www.symbolicsound.com/cgi-bin/bin/view/Know/KymaXDownloads "However, a problem arises in that I am using a polyphonic sound" "How can I make this solution work polyphonically?" !KeyPitch hz * (1 + (!PenButton1 alignWith: (!KeyDown * (?VoiceNumber eq: 1)))) IP: Logged | |
Phi Curtis Member |
![]() ![]() ![]() quote: I'm using a sustain pedal with the tablet. I suppose I could also be using multiple pens, if I had multiple pens. Hopefully, if I manage to come up with a sound that does some of these kinds of tricks I can post it to the Tweaky eventually. Now I need a way to keep track of which VoiceNumber is current. Something that involves countTriggersMod? Incidentally, I get the entire sustaining chord jumping octaves with the code: IP: Logged | |
SSC Administrator |
![]() ![]() ![]()
In the meantime, here is an example of how to do what you want. First, you use !PenButton2 to set !Offset. In the Frequency field, you don't actually sample the new value of !Offset until there is a !KeyDown: !KeyPitch + (12 nn * (!KeyDown sampleAndHold: !Offset)) Next, you want to *reset* !Offset whenever the next !KeyDown occurs. But !KeyDown is local to each voice and you need a global variable to know when *any* key down has occured. Since continuous controllers are global to all voices, you can use a SoundToGlobalController in the MIDIVoice so that each local !KeyDown generates a global controller (called, in this case, !AnyKeyDown). Outside the MIDIVoice, you can generate the !Offset controller such that !PenButton2 sets the !Offset to 1 and the *next* keydown (on *any* voice) will reset !Offset to 0: !PenButton2 hasChangedReset: !AnyKeyDown To get the full picture you should probably download the attached Sound and take a look at it. (It may not function correctly until you get the new software update this weekend). IP: Logged | |
Phi Curtis Member |
![]() ![]() ![]() Thanks! It's tricky, but I think I get it. It also seems to mostly work as is, although there's some strange behavior. But take your time with the software update - I can wait. Phil IP: Logged | |
Phi Curtis Member |
![]() ![]() ![]() quote: I just found what I think is a bug, maybe one of the ones that you've also found, but wanted to check: I've found that in polyphonic Keyboard setups, if I set the attack to a slow attack and then play more notes than I have polyphony, after I've played through the number of midi voices that I have, any notes that are then stolen are played with a short attack. thanks, IP: Logged | |
SSC Administrator |
![]() ![]() ![]() Which module was this? (e.g. the AR envelope?) There is a quick release when you voice steal but it is not supposed to affect the attack. IP: Logged | |
Phi Curtis Member |
![]() ![]() ![]() I'm using the ADSR w/sustain, as found in the prototypes, using the expression (!KeyDown sustainBy: !Damper. IP: Logged | |
SSC Administrator |
![]() ![]() ![]() Interesting. I hear what you mean. But the envelope is actually doing the right thing--so it is more of a psychoacoustic effect. When Legato = 0, a re-attack immediately sets the envelope back to 0 and restarts the attack. However, when you have Legato = 1, the reattack begins from the *current* amplitude level, whatever that is. If the envelope has not decayed all the way to zero and you reattack with a new pitch, that new pitch pops out at you as a sudden change. Oddly enough, if you put smoothing onto the !KeyPitch, you do not hear this as a sudden attack any more. One solution would be to set Legato to 0. (This has the disadvantage of introducing a click when you voice steal and the envelope jumps to 0 immediately). Another solution is to introduce a small amount of portamento (e.g. !KeyPitch smooth: 10 ms). If the pitch does not jump instantaneously to the new value, the reattack no longer pops out at you. IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() ![]() |
This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.