User Guide

DSP Code Component
DSP Coding
For most tasks, FlowBotics Studio's graphical programming approach meets your needs nicely. However, when it comes to programming
DSP a more algorithmic approach is required. For this purpose we have the Code Component.
Using the code component you can do any kind of processing you like. The component uses a very small set of commands to allow you to
translate DSP algorithms into very simple code. The code is then dynamically compiled into binary that runs extremely fast for maximum
performance.
The DSP Code Component
You'll find the DSP code component in the Code group of the toolbox. The component provides an area into which you can type your code.
Click on the component to go into edit mode. You’ll stay in edit mode until you click or tab away.
Inputs and Outputs
In order to link the code into a schematic you’ll need some inputs and outputs. The code component is used for audio signal processing so it
only allows you to create Poly, Mono, Stream or Stream Boolean inputs and outputs. There are eight commands for adding inputs and
outputs:
polyin, polyout, monoin, monoout, streamboolin, streamboolout, streamin, streamout, polyintin,
polyintout, memin
You need to make sure that you give each input and output a name and that each line of code is terminated with a semicolon. Once the
correct syntax has been applied, the input or output will appear automatically when you click or tab away.
Stream boolean inputs/outputs allow you to process or receive boolean mask data. See the sections on Expressions and Conditional
Statements for more information on masks.
The input/output names become variables that you can use in subsequent code. The variables will take whatever values come in or go out
when you link the component to other parts of a schematic. If nothing is linked to an input, the variable will assume a value of zero.
One final point worth noting is that it’s a good idea to use streamin and streamout instead of the poly and mono alternatives as your code can
then be used in both poly and mono sections.
174 of 212