Modules are the basic building block for processing audio/midi/beat data.
Most modules are defined as plugin files and compiled into tsunami at runtime via the kaba
JIT compiler.
Modules can be connected to form signal chains.
AudioEffect
- audio in, audio outAudioSource
- audio outAudioVisualizer
- audio in, audio out, but for showing graphicsMidiEffect
- midi in, midi outMidiSource
- midi outSynthesizer
- midi in, audio outBeatSource
- produces beats- Plumbing - Y-connectors, etc.
- Streams - speaker output, microphone input, midi input
Additionally, two more plugin categories:
SongPlugin
- executed once to affect the current songTsunamiPlugin
- running in the background
- modules are mostly passive and provide in and out ports
- out port implements functionality
- in ports only know to which out port in another module they are connected
A typical use case: AudioSource >> AudioEffect >> OutputStream
-
OutputStream
(speaker) is the only active part (regularly called by the audio library or the signal chain)OutputStream
provides a buffer and reads from theAudioEffect
s out portAudioEffect
reads from theAudioSource
s out port by forwarding the bufferAudioSource
fills the provided buffer fromAudioEffect
AudioEffect
edits the buffer
OutputStream
gives the buffer to the audio library/speaker
-
modules can return fewer data samples than requested
-
the can choose to return
NOT_ENOUGH_DATA
instead (preferred way) -
or
END_OF_STREAM
Modules can have a configuration state, that can be written into files. Modules might also provide a GUI panel for the user to edit the configuration.
-
ConfigPanel
- basic gui definition (easy to write in plugins) -
ModulePanel
- wrapper with favourites (presets) and action linking...- subscribed to
Module
- subscribed to
-
Module
can have multiple panels -
gui interactions edit
Module.config
and send
ConfigPanel.changed()
-> Module.changed()
-> Module.on_config()
-> Module.notify(MESSAGE_CHANGED)`
ModulePanel
catchesMESSAGE_CHANGED
- callback... could execute Action for fx etc...
- Actions send
Module.notify(MESSAGE_CHANGED_BY_ACTION)
- caught by
ModulePanel
- caught by
-> ConfigPanel.update() to refresh gui