CC to velocity



  • Has anybody got a good method to convert a CC to velocity?

    My current thinking is to measure the time interval between the CC being below a threshold, let's say 10, and the CC being moved up to above the threshold. And using the result to calculate a velocity value.

    I've tried implementing this but it doesn't seem to work properly. Sometimes values are skipped (due to my mod-wheel's resolution probably) and other times it just seems to produce weird results.



  • @d-healey I’m afraid I don’t understand the issue. Is it not possible just to use the CC as-is and set the velocity from its value?

    Unfortunately I won’t be in font of my computer before Sunday...



  • Is it not possible just to use the CC as-is and set the velocity from its value?

    Yes, but not for what I'm doing.

    I want to use a breath controller to trigger note ons. So the user presses a key and nothing happens until they blow into the breath controller, at that point it will play a note. The velocity of this note could come from the original key press, but the user can also stop blowing into the controller and the note will stop, but the key is still held. They then blow into the controller again but this time with a harder attack, so I need the velocity to adapt to how hard they blow.

    I already have the note triggering/stopping working, I just need to convert the breath pressure into velocity.



  • @d-healey I see. Do you have multiple velocity layers? I imagine yes, but if not, you could use a CC modulator to control the gain
    Or a time variant with the onController section

    I might have wrong but isn’t a velocity attached to a noteOn message and so is definitive?

    Just throwing things as they come to my mind...

    Another idea would be to use velocity layers as RRGroups instead and use XFade modulation



  • @ustk Notes are created using Synth.playNote() when the breath CC is above a threshold. I need to pass a velocity value to playNote based on how hard the user blows.



  • Delay the note on until you have received a few Cc messages then average them for the velocity information, otherwise it will be very inconsistent and you might as well use a random value...



  • @Christoph-Hart Not sure how that would work.

    User presses key, no sound
    User blows into controller, value is initially zero, no sound
    Value hits threshold, let's say 10, note plays. Not much room for averaging.

    I wonder how wind controllers do it...



  • Oh I think I get what you mean now! I was just reading about how the WARBL handles velocity and it uses a delay - https://warbl.xyz/phpbb/viewtopic.php?f=6&t=25&hilit=velocity



  • Yep the delay technique works, thanks! Now I just need to fine tune it.



13
Online

1.2k
Users

3.8k
Topics

33.5k
Posts