Switch between two variables with key press

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.