Name Joystick Controller
Created At 2024-11-17 2:46pm
Submitted By Menno0
Description

DESCRIPTION:

This is a Joystick Controller data recorder and player. Joystick Controller2 records and plays 3 different Joystick Controller Data. You can set the resolution of this device in Device Data Range, this is 65536 for my Joystick.
CC number and start/initialization values should be given.
A name should be entered; this name is used to send the Joystick data globally, i.e. as gkxxxx signal.
Other, higher numbered Instruments can pick this Global data up. In that particular Instrument, the range of the Joystick data (0-127) can be scaled at will and, if needed, interpolated.

When recording the midi controller data, set the length of the SoundObject and the resolution you want to record in; both are in seconds. Length and resultion go hand in hand. These values are needed so that, on playback,
the SoundObject's length and resolution can be used to scale.
Be sure to have the Joystick Controller on the Timeline above the ScoreObjects of the Instruments you want to influence with the Joystick Controller.

Joystick CC data are global: they have an influence on ALL notes of that Instrument as they are used to control the parameters of the Instrument.

Most of the time, Joystick Controller and the ScoreObject make up a pair; moving and scaling them together ensures the expected behavior.

When setting a name as outputfile for recording, the format of the name is as follows:
NAME + LENGTH OF SOUNDOBJECT JOYSTICK CONTROLLER + RESOLUTION
length of SoundObject and resolution are in seconds.

In the Instrument you want to influence with controller data, here is basic example to add the Smooth Joystick Data Module to the Instrument:

idevicerange = 1/65536 ; joystickrsolution
kmass_scl scale gkxxxx, 2*imiditotal, .02*imiditotal ; scale midi values to usable range and let it influence the .02-2 range
kPortTime linseg 0,0.001,i() ; if needed, create a value that quickly ramps up to .01 for better response and interpolate the controller values
kmassscl portk kmass_scl, kPortTime ; range 0.02 - 2

a1 poscil3 1, kmassscl*200 ; make some noise

First set the switch to 'write'. Run Blue. Then set switch to 'play' and the controller data are played back. There is an optional printing to see what is happening.
Plotting the controller data can be used if you have GNUPLOT installed.

Portamento can be set in your instrument but is optional. It does help to smooth out the poor resolution of the Joystick Controller and avoid sudden jumps between controller data values.

Be aware that the output values of a joystick move around value 0, so a range of -x to x. In my case, the 'raw'value range is from -32768 to 32768, where 0 is the joystick X and Y axes in restposition.

CONTROLLERS:

see the help balloon when hovering over the controllers in the instrument. Help can be turned off by pressing the 'I' button next to the play bar.

---

version 1, November 2024
- initial version