Creating a trigger device
I’m trying to create a device to essentially achieve something like drum trigger software.
An incoming audio signal is detected and sends midi information out.
The purpose is to use a mic’ed voice, or guitar, or drums, or any other instrument to control vsts, or ableton itself, or lighting equipment, etc…
The part were I’m stuck is how to effectively differentiate between velocities. I want to assign different velocity zones to different midi messages.
Let’s say I have zone 1 from -70 to -50db, zone 2 from -50 to -20 db and zone 3 from -20 to 6 db.
If the incoming signal is -30db, then the midi message associated with zone 2 is triggered.
The basic structure is already working, but the problem is that every sound has an attack and decay, of course.
So a -30 db signal fades in from -inf to -30. At the moment my device first triggers zone 1 and THEN zone 2. And of course when the sound stops, it fades back out, triggering zone 1 again.
But I want it to only trigger zone 2.
So I was thinking to introduce some kind of delay, only evaluating the signal after x ms.
It would have to be short enough so it does not mess with the playability (like trying to play guitar with too much latency), but long enough to not misinterprete short sounds with a fast attack, or even miss them alltogether.
This could take care of the problem at the start of the sound, going up. But it would still fade out and go through zone 1 at the end.
Does anyone have any insights on how long the delay should be or how to fix the fading out problem?
Or any suggestions for a more efficient way to achieve my goal?
I advise setting an attack threshold above which you consider the ‘note’ to have begun, then tracking the amplitude until it is no longer increasing, and using its amplitude apex to determine the velocity you will assign.
Also, look at bonk~ for some good inspiration.
christophers right here. Setting an attack and release threshold will allow the selection of one zone.
Maybe its easier to convert the amplitude to a float with the example patch.
Heres my solution (with the audio analysis from someone else’s awesome patching skills)
Probably a better way to do it but hopefully this works.
<code>-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 1638.3oc2Zt0iZiCEG+Y3SgEO0JMEEamqq5Kc28wUZkVsZeoppx.FF2FRPwN SmYp57Ye8kjgPmbwL.FnuLv3XBG+67+b74D72GOZxr76o7IfeC7QvnQee7nQ 5gTCLp5+GMYM494oDtdZSlmudMMSL4Fy0Dz6E5w+OZZ9bl3Avi4YTfe80yJW mWJRoB8m1qZzk4YBN6QpZLHZ5yCWrZldZOOxFhX9srrUetfNWXLS+vfoA2.B R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NwdP4elAEOks f9zwIVy5LxXOcwPXSA6cxF7qgMGwjQjYbWSlJQCt+zPdtRzLbWfw1WncvTui zOQWGEZqqYGfS53GXpQg1HOuAd7glbc9vNtWV83CgWkMBFuGEaGe42I31FBt .ZEznPiNB+DU5znInCnSvjqymSQ3UUufccpO9C4fzBfFff2AdiVG8V.mVc3O jbiL+q.AaMUNIvZ9zVO5GX6O5Gd62Q+npgg5eU0pdn5pigDuy3In4CEqJUWf CdS9Fkhmj91FLsBkjrEfBZJkvoMwJ3OoKIkoxOrjPpmgnbI1NqCNYrt5HsUs 2u1DtADh5h0vyHq+a8JWRWSEMRhVkpQth.x5sk83VtfBnYpSuzFJHeIPeLIp le6j0+zohCzGcGruoHbn4ImAamrwmQt9OrU2J5NcPKBWGmOnphn57AlB36Je v47HF9WzkaAIobAKuVqJxAyjYVku8gGoK.KyKZQw5ZEZL7kXsKAJLv4Gwt1J nJ5hqj+ngq3GNPE+0MseXU7eUdhA15PsnjpnSVIUZRqC69oynu1aoFeWUKOu rXdsro9PwA15vVP4xckd1e8wsGPyFS5V1hEzrlAyKXbkaQ6U8ZM9wZ6I1F6I zc1CxV6w2M1ims1C1I1CxZ+ExM1Sjs1CzM9KrM1Cxc5Y3NK8NrGrasmA4imy rGTnM7A5N6IwB9.cHeBrvdPIt0eMn8D6N6Aag9AE5V6YP9D4P8rMaXfbWBHn ManBcn8XiCC5NGl5GaaPAMD6rMTgg1ZOtofCXjUID6JCD7DTgnUJZeGZP1rG OL7UZPlVfHa1bGsfWcO01hrS1ujWnOhn2L1zhs4e02wIETUKVl4qaAaBoP1f qP1caYgo+s6iCmLV887iw+OfBgtXw -----------end_max5_patcher-----------
Thanks for all the tips.
The trigger is working, or at least in a basic way.
The input signal is evaluated and, depending on the volume, triggers one of four messages.
I fixed the problem of going through all "zones" by adding a count~, so now it only sends the message to the rest of the device if the message is on for longer than 50 ms (adjustable), which seems to do the trick…
I don’t know if this is what you guys meant by setting an attack treshold, but if not, it achieves the same thing.
For the moment, I can differentiate between 4 volume zones, each triggering a different envelope.
The envelopes are then mapped to macro’s in an instrument rack with a vst.
I’ve been controlling a dubstep bass synth with my real bass guitar for half an hour, sounds great :p
Of course, there’s some fine tuning to do, but it’s playable without too much delay. :)
I also tried the same thing with the standard envelope follower (ctrlenvfol) and I must say my method works more precise for what I want to use it for, ie Dubstep-like growls and stuff like that.
Forums > Max For Live