This should be straight forward. Add a script with a button to the sine generator and call Midi.ignoreEvent(true); in both the note on and note off callback. Then use Synth.playNote(45, 127) and Synth.noteOffByEventId() in the button callback.

You can control this script from your main interface just like any other module then.