looking for an object that can mix mtof signals or cycle signals
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.
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-
----------begin_max5_patcher---------- 750.3oc0X00ihBCE8Y7WQCOtw0ssPQYea+crYxFD5ncBzZn0nNSF+sukVXFz U9PEcbSLn2Z8x4b58bo02F43NWrkJcA+D7afiyaibbLCULfSYriaVz13zHoY ZtwhrLJW4N19cJ5VkYbQN3k0REHisErgoVB1IVmqi3IUS8YAWIYuRKlNBOAV NLesdRoTkI8nOGTrVUMZ0TWEohWx3K9SNMVYAsuOQmI.Nzu3MjefIBNABdp7 GwRr3a9KeG6WGK7nLCVb+UNKJ0s3KdeznhKi6oVrHhw26dJdfOIOvsviPxQD nHnIdfqto1jq1shZSiqjsfqIyXfKSuHAd5BXUSqvpkLIP+ZgPj.TBQGqqqxo RcZhTLAuFQ8HXCCIFhBKu7AKutpAOaVwDS0PHp0hAzvVLnA4bZ99NTkLQB8f RgFTo.aYsWOTopToW5MxScmU+J97lBs2Myaj18PvVjstqJeNUDcg0kb5FM.9 mxxusWSYx4zj4zlSTm5CZlYQwG2l9fBub8YPsqoToDnVFwAnJW6MsSLxZ5vD OiVgZ07glMrlO5qIQwmSq3VHRo0KvPG6iWJtdRZD7k2o.EXsqdj6QmBzT6xJ dZ2cJPjupNEMYIVjSiTz7Zth4Q2VSgQlPkOaG2tkXf2bRCsK+wd.9l1rDcPy RO7DRKbFdmaVdYVuA1DQlYDnfd3gl8nYgjqy.pMBf8lHuolGLLzHT1MAE1pP EbWLO58ZftKlGeX2lG+6s24zZR7t3T5dfODdYGH.GXrCAg8+4W8VNOH21O23 9Z+OSMGj5rR4oUgAMPBiI2toL9w+eCF3UL9gpkTrNOtJgk06fOQXBUpXbSwT s4Tbx3ZSZIKIgxq2lIikrRnOZrrRGBKrXHaEhmOZB9Dg1FPDn2GsiZXIuuTo 3PBcyE34wkqDS8QdOB28VdmZNxjWsnqU.g8AsjGOA7waMc1E5XLlA8dXpBtR nh6AT8OOnhmZQGx9eCVB7hnqs5a3w5QsJG89n+BmBc+Z -----------end_max5_patcher-----------
edit: spelling is hard
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.
----------begin_max5_patcher---------- 887.3oc2Y0saaBCF85jmBDZWztkF4ew3c2dNVqlnA2TuEfn.UKsUsO6CaGVS pZigD3aq4FSvwXeNG+4i+v733QgWWrVUFF70fuGLZziiGMxVkohQateTXVx5 YKRJsMKT8PZxrmCm39qkIUytUmO+GqTypbcCSNEMIfHwlKLdSYvUadj76xz4 KTU1ti7RkE2U0TKZSs5T6PVb8OufSCM08z3wlhIsDr0c60pU+Esk541teJZO vmymJvLhjUSBZrA97HKiPaQhrhT0qvuOR0T6ME4U4IY1GO7aqzIKZfmqwU2u T4fhAu4l+NH7lEEI0.7ps5iR8C11gISeC8hIARunRwofdwQPoWT4IgdgARuH w3SB8h.kdQnV8RH+X6eI.RuvQ7SB8JFJ8B476iEer0qHnxmvkNzGXkheHJ0u JWnSUq7mmH0TRQV4wTUWxSj7dzUmWY3p4xe6usoD6PnjaT1CiHLggEXoaVl2 T91TB21TeYnlwbVQVlJ2NZgCCCvwCBCvfw.rDMHLf.GChHCBCnvw.JaHX.MF NFf3CBCjfw.wfXEQEfQ.21C8NA38EAxU+ttCa5sJ0ZWWM69YKT9OdDLi9xwi rS9.sXaO7Au+eG11mH6QUIqp3F+ZBwdjQNyi2WSv8klzI0HtGUi4IUpmCh8K HBaPBAGMk28nj3iIKwd3WcQcOhW1aut33sVqwQGRb0Ajq8ljOuNIedmDATOF hoVubUPM4NK9xKmT+.mgqud1mz3KnQm+YzTLg+E74m2BwysnjXw7+aqJw84p xp.cf16ZRosTf1+Jx9NVZmWjoEgRQ8ntTVsRuLunR4Uab4bvEGxdZvoM6bvk 1GLbgN+0eDDKIM0uqfUVb2pYM.XyqRNI3EllpJqz4IU5h7sZT8XtcitUmlpx 2NCkLc5xhZhrADAW8lSesES01o0SFdvDS9NXBObXJxCl3H3wD2GlvviIlOLQ fGSTewSB3wDwGlhgGSXeXJBdL4yehwAESVOSba7Lws2yjxDl8jE12dPF07aP rRQvau6yJk8OXKGeVoLB7XxmUp4XwfFS9rRowviIeVoTI7XxmEAU.Ol7YkR4 vhIYaR+TzMqTdrw8DG49.MtuYk8tiErwsAr.GnE0FLA7BRTamT6.lvXjaV0d jiMSw7ieRMpEqTwvJf3VEnA7t131foni.S027z3+.HCtMLD -----------end_max5_patcher-----------
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?
thanks for your help
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.