Trigger Sound Effect with Audio Player Plugin Revisited

I want to trigger a sound effect WAV file with a note on the keyboard (CC note on) and have the sound stop and play head position return to 0:00 when the note is released (CC note off).

I followed the instructions in the “Trigger Audio Player” post to setup two widgets for implementing this setup.

What appears to be happening is that even when the note is held down the second widget is getting activated immediately and the playback head position returns to 0:00. No sound is produced. Perhaps this happens because both widgets are part of the same group?

To my knowledge I have assigned the widget parameters correctly:

Widget 1:
Momentary to Latching
Mapped to Audio Player “Play start/stop”

MIDI Learn: Note on from keyboard controller

Widget 2:
Momentary Touch
Mapped to Audio Player “Play head position”

MIDI learn: Note off from keyboard controller

Widgets 1 and 2 are assigned to group “A”

If I disable Widget 2 then the CC note on event does trigger playback of the sound effect wav file.

Therefore, something is wrong with introducing Widget 2 to the configuration. Some AI prompts suggest using scripting to accomplish the setup but I think this should be possible with simple MIDI learn operations for CC events?

I don’t have time to help much now. But, if you use Midi Learn, do you make sure you disable “learn” before you let go of the keyboard note? (Or else (I believe) your “note on” and “note off” will trigger the effect.)

Yes - I found I had to stop the “MIDI learn” in order to make sure Widget 1 is “Note on” and Widget 2 is “Note off”.