## looking for an object that can mix mtof signals or cycle signals

Jun 22, 2009 at 8:17pm

# looking for an object that can mix mtof signals or cycle signals

hi

I’m working on a midi patch which can take a signal from the keyboard, and creates a wave signal and sends it to the output(depending on which key is pressed, the output is sent to a different channel(i have 8 channels since i presonus firepod)..

however when i have 2 signals sent from the same channel, the waves are not added properly, which causes a distorted, wavy effect on the output signal..

i attached the patch for your convenience, please let me know if you know any objects or patches that might do add the waves.

Thanks

Sincerely,
Sai C.

#44497
Jun 22, 2009 at 8:44pm

I didn’t check your patch but just keep in mind that two full-scale audio signals will distort because 1 + 1 = 2, and 1 is the clipping point.

The simple solution would be to use something like gain~ on each signal that is going to the output. That way you can manually mix as you see fit.

If you know that all of the signals going to the output will be between -1 and 1 then simply divide the amplitude of the output by the number of signals that are going there. the /~ object is good for this or though multiplying by the reciprocal [*~] might be more efficient… I believe they are more or less the same if the divisor is a static number.

Here is a simple patch-

– Pasted Max Patch, click to expand. –

edit: spelling is hard

#160026
Jun 22, 2009 at 9:11pm

You need to scale the output to stop the distortion. The [dac~] works with signals in the -1 to 1 range so if you send it a signal that goes outside of this range (as you are doing when you press more than one key which is routed to the same channel) then the distortion occurs. Here’s a modified version of your “midi21″ subpatch which you might want to have a look at, it might not be perfect for what you intended but I hope it shows a simpler way of doing what you are trying to achieve. Also you might want to read the tutorials on the [poly~] object as using this would be much easier than duplicating your [patcher] multiple times.

lh

– Pasted Max Patch, click to expand. –
#160027
Jun 23, 2009 at 3:32pm

Thanks for your help, i did the scaling and it works really well.. but not so well for the notes that have a lower frequency, they still have an oscillation effect.

the distance between these frequencies is about 3-6 hz (21hz, 23, 24hz etc 21 is the lowest frequency), is there any way for this effect to be fixed? or is it an effect of have 2 phazes so close together on 1 speaker?

Sincerely,
Sai C.

#160028
Jun 23, 2009 at 3:51pm

Frequencies this close (within a few Hz) will exhibit beat frequencies, read about it on wikipedia. There’s nothing you can do to “fix” this in your patch.

lh

#160029

You must be logged in to reply to this topic.