Scripting Mouse interaction and the XY Pad

Noise Native
Noise Native Member Posts: 17 Member

Hi KSP’ers, I hope this post finds you happy, safe and very well.

I have a KSP scripting issue with mouse interaction and the XY Pad: I have been able to get the XY cursors to play a sample with any of the multiple cursors when interacting with them with the mouse (on mouse-down, mouse-up and when dragging), but the cursors re-trigger the sample with any interaction with the cursors i.e. continuously re-triggering when dragging the cursors around the XY Pad. 

I want to be able to play the sample ONLY on mouse-down and mouse-up, leaving the actual playable notes in the sampler for the MIDI keyboard, and dragging cursors solely assigned to multiple parameters such as Pan, Cutoff, Sends etc (which all works perfectly fine after much reading of the KSP manual and some really helpful forum posts).

I am triggering the playable samples via MIDI keyboard with no problems at all, but I also want to trigger a sample ONLY on mouse-up and mouse-down also. 

The continuous re-triggering of the sample when dragging around the XY screen is quite an interesting sound, I am going to keep it! But I want to be able to deactivate this at will via a ui-switch if at all possible. 

I am very new to KSP scripting, although not to Kontakt, and really enjoying the creativity possible. I have been reading the manual, experimenting with the examples, and can see the improved features (see below) relating to the XY Pad and mouse interaction, but I am not quite sure how to implement them in relation to the triggering, and specifically with the non-triggering, of samples/notes when dragging.

 “Improved Features

• New built-in variable and related built-in constants for the XY Pad allow identification of the mouse events that trigger its callback: $NI_MOUSE_EVENT_TYPE, $NI_MOUSE_EVENT_TYPE_LEFT_BUTTON_DOWN, $NI_MOUSE_EVENT_TYPE_LEFT_BUTTON_UP and $NI_MOUSE_EVENT_TYPE_DRAG”

I hope this makes some sense and thank you for taking the time to read this. If it does make some sense, and anyone has the time to provide some useful advice, I would be really grateful.

Kindest regards, Noise Native.


  • Noise Native
    Noise Native Member Posts: 17 Member

    Aha! I believe I have solved my issue with a (fairly) simple ‘If else play_note’ script. I haven’t needed to go near the Mouse Event features, which still remain for me to explore and implement correctly in the near future… anyways, onwards!

Back To Top