A similar question/idea? -> https://forum.renoise.com/t/help-return-a-function-when-a-note-play-in-pattern-editor/47135