Programming reference for the SoundBlocks Configurator
Each line of the script begins with the ID of the module to be configured. The next element in the line defines the module's behavior, indicating whether it will send or receive information.
Send
If the element contains -> it means that the module will send information.
Syntax:
module_send -> sensor_send : module_receives
Sensor
Sensors must be separated by commas and can only be selected from the following list:
- t1 to t7: touch sensor (7 in total)
- ax, ay, az: accelerometer values (X, Y, Z axes)
- aax, aay, aaz: absolute accelerometer values (X, Y, Z axes)
- gx, gy, gz: angular velocity (gyroscope)
- agx, agy, agz: absolute angular velocity (gyroscope)
- rx, ry, rz: orientation (yaw, pitch, and roll)
Modules that receive
Up to three numerical ranges of destination modules can be defined. The ranges are separated by commas, and a hyphen indicates a continuous range. To send to a single module, simply specify its number. Destination module 255 is reserved for broadcast to all modules. A maximum of five destination modules can be specified per send.
Example:
122->t1,ax:102,105-108
Module 122 sends the data from sensor t1 and the ax axis of the accelerometer to modules 102, 105, 106, 107, and 108.
Receives
If the element is <- it means that the module receives information from another module.
Syntax:
module_receive <- sensor : module_send @ action [map]
Parameter Details
- Sensor: The specific sensor from which information is received.
- Module that sends: ID of the module that sends the information.
Actions
Device or function that is activated based on the received information. Available options:
- Play: plays a sample (range: 1 to 127).
- Pause: pauses the sample.
- Stop: stops the sample.
- Resume: resumes the sample.
- EQ: sets the equalizer (values: 0=Off, 1=Pop, 2=Rock, 3=Jazz, 4=Classic, 5=Bass).
- Vol: adjusts the volume (range: 1 to 30).
- PlayStop: toggles between play and stop (range: 1 to 127).
- PlayResume: toggles between play (or resume) and pause (range: 1 to 127).
- TouchPlay: plays while touch is held (range: 1 to 127).
- SweepPlay: plays a sweep of samples (range: 1 to 127).
- Wave1: waveform of oscillator #1 (values: 1=triangle, 2=sawtooth, 3=square).
- Freq1: frequency of oscillator #1 (range: 1 to 127).
- Vol1: volume of oscillator #1 (range: 1 to 127).
- Wave2: waveform of oscillator #2 (values: 1=triangle, 2=sawtooth, 3=square).
- Freq2: frequency of oscillator #2 (range: 1 to 127).
- Vol2: volume of oscillator #2 (range: 1 to 127).
- Wave3: waveform of oscillator #3 (values: 1=triangle, 2=sawtooth, 3=square).
- Freq3: frequency of oscillator #3 (range: 1 to 127).
- Vol3: volume of oscillator #3 (range: 1 to 127).
- NoiseVol: white noise volume (range: 1 to 127).
Map
Is used to adjust the range of values received by the actuator. It can be a single value (maximum) or two values (minimum and maximum). If not specified, the default value is [0,0].
Example:
108<-ax:122@Vol[0,15]
102<-t7:108@Play[3]
Comments
Comments are added by prefixing # to the beginning of the line or the end of an instruction.
Example:
122->ax:102,105-108 # Module 122 sends ax to modules 102 and from 105 to 108.
# 102 <- ax : 122 @ Vol [0,15]