Channels
channels
are a means for sharing data between the visual
framework and the sound framework.
Channels are usually used to send audio-rate signals to the visual domain.
In monolith, there are 16 channels, which are addressed via an integer values 0-15.
The monset
ugen will store a signal to a specfic monolith
channel.
The code below stores a 0.1Hz unit-amplitude sine at channel 0.
(monset (sine 0.1 1) (param 0))
The monget
ugen retrieves a channel.
The snippet below retrieves the value stored in channel 1.
(monget (param 1))
NOTE: channels only store things at control rate! audio-rate signals will be downsampled. To store and retrieve signals, use cables, or just rely stack operations.
Graphics in monolith are mostly done
using Janet. The way to retrieve stuff in Janet is done with
monolith/chan-get
.
To get the value stored channel 0:
(monolith/chan-get 0)
monolith/chan-set
sets a value.
This snippet sets channel 1 to be 12345:
(monolith/chan-set 1 12345)
For more of a deep dive, see the Monolith program at 18.3. Channels Interface. The janet and scheme bindings can be found in 8. Channels in Scheme and Janet.