Switch between two variables with key press

Here you go man every time you press the F button the velocity changes.

You get the velocity. And connect the velocity node directly. Don’t connect the red node from IsVelocity0 and convert it to Integer it is wrong. Velocity → Velocity of NoteOn.

So every time you press F the velocity that is connected to NoteOn will also change.

How can I switch between two variables for the velocity pin when a key is pressed? I want to start the note at 0, switch to 120 with the F key, and then go back to 0 with the F key again, while the timer is already playing, so that it’s in sync with another timer. Also, can I switch smoothly between the variables? With lerp maybe? thanks!

Thanks - I’m not sure how it should be connected to the note on node though -

Sorry, I should have added some more information - the note velocity I want to change is in a function - that’s the CNOTE function the timer is turning on. I’ve tried set Is Velocity 0? disconnected and connected but no avail. So I need to the get velocity for the Note On in the CNOTE function.

Maybe this will be easier - I’ve changed the function to a custom event. The timer is triggering, and I’ve attached get velocity to the Note On velocity node, but still no sound.