#
TCP interface
⭐ Starter
The TCP interface allows you to start and stop tracks as well as dynamically adjust their intensity. To use is, keep Hapticlabs Studio running as it will handle the hardware communication.
The TCP port runs by default on localhost , port 64209.
#
Command syntax
We maintain an identical syntax for all supported APIs including TCP, Serial and UART.
TCP in addition also allows ,
to seperate values.
#
Start a track
startTrack("trackName" amplitudeScale);
Plays a track from your currently opened project. Replace the trackName
with the name of the track you want to playback. Optionally, you can pass a value to scale the intensity (amplitude) of the track to be played back, for example doubling the intensity.
//Play the track called 'Short Pulses':
startTrack("Short Pulses");
//Play the track 'Short Pulses' at twice the intensity:
startTrack("Short Pulses" 2);
#
Stop playback
stop();
With this command, you can terminate any currently active playback.
#
Scaling intensity
⭐ Pro
setAmplitudeScale(amplitudeScale);
This command allows you to vary the intensity (amplitude) of the satellite output during the playback. The default value is 1.0.
// Decrease the intensity value
setAmplitudeScale(0.7);
// Incerasing the intensity value
setAmplitudeScale(1.3);
// Reset the intensity value
setAmplitudeScale(1.0);
You can not increase the amplitude beyond 100%. If you e.g. select 100% amplitude in a block within Hapticlabs studio and use setAmplitudeScale(2.0);
, the maximum amplitude will remain the same as with setAmplitudeScale(1.0);