playing multiple notes on the midi keyboard

saichaitanya88's icon

I've been working on a midi keyboard patch which takes in up to 10 notes on the midi keyboard, and separates them into 8 channels depending on where the note is from.. however, i found that the notes that get separated to the same channel tend to have a weird wavy oscillating sound to them.. i think it has something to do with the "wave" addition, but can't really figure out a way to approach this problem..

does any one know how to fix this issue? if you have any more questions that will help me explain this clearly please ask.

Thanks!
Sai C

saichaitanya88's icon

sorry to double post:

the weird effect sounds like the volume of the note increases and then decreases. this happens when the notes are closer together on the scale (and this causes the notes to be played from the same channel)

seejayjames's icon

saichaitanya88 wrote on Wed, 17 June 2009 10:26I've been working on a midi keyboard patch which takes in up to 10 notes on the midi keyboard, and separates them into 8 channels depending on where the note is from.. however, i found that the notes that get separated to the same channel tend to have a weird wavy oscillating sound to them.. i think it has something to do with the "wave" addition, but can't really figure out a way to approach this problem..

It's hard to tell, but probably the oscillation is normal, just having to do with wave addition of the cycle~ objects that are close together. It may be unavoidable in this design, I'm not sure.

A couple other things:

poly: only takes up to 2 arguments, the first is the # of voices, the second (if present) implements voice-stealing. So you'd just want [poly 10], and maybe [poly 10 1] for voice-stealing, if you want that... I think for this design it makes sense to have it on.

The calculations in the subpatch for converting the MIDI note number into Hz for your cycle~ can be done with [mtof], unless you're doing something else with them. Hard to tell exactly what's happening there with the math, but [mtof] could be more straightforward.

Anytime you have 10 copies of a subpatch that are the same, think about a way to do it with just one, using a way to route around the incoming info but re-use the processes. So the [route 1 2 3 4 5 6 7 8 9 10] based upon voice number could be in the subpatch, then the pitch-velocity pairs would go through the [split] objects. Since the outputs of the subpatches all go the same places (to the [dac]), it shouldn't be necessary for 10 subpatches, only 1. You could also look into [poly~] for more processor-friendly MSP action, but it may not be needed here.

[dac~ 1 2 3 4 5 6 7 8] --- do you actually have 8-channel audio? If you don't, the only active channels are the first two (L and R), so this may be messing things up as far as what you're hearing (and not hearing, like note ranges 3 and up). If you're going to use just stereo, you can control how much goes to the L and R from each voice.

It's a cool idea, there's a lot you can do with some simple cycle~ objects and some routing. Try sending another cycle~ signal into the right (phase) outlet of the main cycle~ and crank it up... a whole different timbre which can get really interesting, play with different frequencies and levels into this inlet. Maybe certain notes or velocity ranges could activate this, for a really crunchy alternative sound to the sine wave.

Try the little synth patch below for some timbre ideas, it implements the phase inlet and ring modulation. Certain combinations of frequencies and levels give you some wild sounds, try the presets to see...and be gentle with your speaker levels...

Max Patch
Copy patch and select New From Clipboard in Max.