Danny Wyatt Posted September 12, 2022 Share Posted September 12, 2022 (edited) My electronic drum kit's lowest velocity is 32. I would like to have it go all the way down to 1 when I play so basically using a scrip to change the input range from 32-127 to 1-127. How can that be achieved? Edited September 12, 2022 by Danny Wyatt Quote Link to comment Share on other sites More sharing options...
Atlas007 Posted September 12, 2022 Share Posted September 12, 2022 (edited) Try with the following mathematical formula: X-31*1.323=Y (where X is the original drum velocity value and Y is the converted-expanded value) BTW, I think that could also be achieved via the Environment (using two Transformer objects) or (possibly?) via the Modifier MIDI Fx plugin... Edited September 12, 2022 by Atlas007 Quote Link to comment Share on other sites More sharing options...
Danny Wyatt Posted September 12, 2022 Author Share Posted September 12, 2022 6 minutes ago, Atlas007 said: X-31*1.323=Y I'm not sure how to apply that in terms of JavaScript... also, would that convert the whole range? Or just 1 note? 7 minutes ago, Atlas007 said: BTW, I think that could also be achieved via the Environment (using two Transformer objects) My goal is to save this as a Patch so I can use it without always having to go to the Environment. To be honest, I don't even like the Environment at all. It just feels a bit "messy" to me. On top of that, I'm not an expert at all when it comes to it anyway. But yeah, I'm looking at something that I can save as a patch. 11 minutes ago, Atlas007 said: via the Modifier MIDI Fx plugin I tried this, but no matter what settings I picked, it wouldn't go all the way down. I noticed some super minor difference, but nothing significant. Quote Link to comment Share on other sites More sharing options...
Atlas007 Posted September 12, 2022 Share Posted September 12, 2022 19 minutes ago, Danny Wyatt said: I'm not sure how to apply that in terms of JavaScript... also, would that convert the whole range? Or just 1 note? Using the Handle Midi on note.velocity should do that for every note events. It should convert the whole range. and all the notes that go through the script (which I don't have time to do and test at the moment). You likely will have to use the JS round method Math.round() in your script, as described here. 25 minutes ago, Danny Wyatt said: My goal is to save this as a Patch so I can use it without always having to go to the Environment. To be honest, I don't even like the Environment at all. It just feels a bit "messy" to me. On top of that, I'm not an expert at all when it comes to it anyway. But yeah, I'm looking at something that I can save as a patch. That:s too bad 'cause the Environment is pretty powerful when you know how to use it. But if you prefer using a patch or plugin, it's up to you... 29 minutes ago, Danny Wyatt said: I tried this, but no matter what settings I picked, it wouldn't go all the way down. I noticed some super minor difference, but nothing significant. Did you try the following settings (it requires two Modifier Fx, one after the other) set as shown in the picture below: Quote Link to comment Share on other sites More sharing options...
Danny Wyatt Posted September 12, 2022 Author Share Posted September 12, 2022 32 minutes ago, Atlas007 said: Using the Handle Midi on note.velocity should do that for every note events. It should convert the whole range. and all the notes that go through the script (which I don't have time to do and test at the moment). You likely will have to use the JS round method Math.round() in your script, as described here. I guess this is too advanced for me... I was playing around with JS a few months ago, but then I stopped to focus on work and it's one of those things that if you don't practice on a regular basis, it doesn't stick 33 minutes ago, Atlas007 said: That:s too bad 'cause the Environment is pretty powerful when you know how to use it. To be honest, up until now for the type of work I do, I never felt the need to use it. Every time I have some need, it can be solved with other tools and the fact that it's something you can' really save and you have to set it up for every project, seems to be very "unproductive" for my workflow. 35 minutes ago, Atlas007 said: Did you try the following settings (it requires two Modifier Fx, one after the other) set as shown in the picture below: This actually made it sound louder a little bit Quote Link to comment Share on other sites More sharing options...
Solution Danny Wyatt Posted September 12, 2022 Author Solution Share Posted September 12, 2022 (edited) 2 hours ago, Atlas007 said: Try with the following mathematical formula: X-31*1.323=Y Ok I just tried it, after running some tests on a spreadsheet so I could understand the formula and it's working now: // Velocity Range Convertion function HandleMIDI(event) { if (event instanceof Note) { event.velocity = (event.velocity-29) * 1.2959 } event.trace(); event.send(); } I noticed the lowest velocity was actually 30 so I followed your formula and adapted to the new values. Working like a charm! Thank you so much! My drum kit sounds more human than ever now! Edited September 12, 2022 by Danny Wyatt Quote Link to comment Share on other sites More sharing options...
Danny Wyatt Posted September 12, 2022 Author Share Posted September 12, 2022 (edited) 2 hours ago, Atlas007 said: X-31*1.323=Y Can you explain why these numbers? If the lowest velocity was 32, why the 31? Also, I noticed that you got to 1.323 by dividing the 127 by 96. If 127-32=95 steps being used, why adding 1 extra on that division? Curious to know why to make sure there was no typo or anything and to learn something new, of course. Thanks. Edited September 12, 2022 by Danny Wyatt Quote Link to comment Share on other sites More sharing options...
gacki Posted September 12, 2022 Share Posted September 12, 2022 6 hours ago, Danny Wyatt said: If the lowest velocity was 32, why the 31? Note on with velocity 0 is treated as a Note Off; hence we need to cap this off at velocity 1. Quote Link to comment Share on other sites More sharing options...
Atlas007 Posted September 12, 2022 Share Posted September 12, 2022 46 minutes ago, gacki said: Note on with velocity 0 is treated as a Note Off; hence we need to cap this off at velocity 1. Exact… Quote Link to comment Share on other sites More sharing options...
Atlas007 Posted September 12, 2022 Share Posted September 12, 2022 7 hours ago, Danny Wyatt said: Thank you so much! My drum kit sounds more human than ever now! Great! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.