User Guide

Ruby Component
Frames
FlowBotics Studio processes high data rate signals such as audio using Streams. These allow you to perform one-sample-at-a-time
processing at rates of 44.1Khz and beyond with minimal compromise in performance.
Frames allow you to process this data via the Ruby component without losing a single sample. Because of the high data rates involved you
can't do this processing one sample at a time – the processing overhead would be way too much. What we can do is give you access to the
data in batches of samples. We call these batches Frames.
Processing frames in Ruby can never compete with the speed of streams, so there is a performance cost. However, if squeezing everything
out of your cpu is not that critical then, together with Ruby, Frames provide a very flexible way of analysing high data rate signals.
Mono to Frame
The Mono To Frame component takes Mono stream data and delivers it one frame at a time in precise sync with the stream. The example
below shows how you can use this.
The component produces instances of a Frame class. These are generated every time a frame of samples is requested from ASIO or Direct
Sound. The size of the frame depends on the ASIO or Direct Sound setup you have.
The Frame Class
The Frame class encapsulates a frame of samples. Frame objects can be easily manipulated inside a Ruby component.
Reading Sample
There are two ways to access the individual samples. You can use the element reference operator ie. square brackets to access a particular
sample:
myFrame[i] – gives you the sample at index i in myFrame
If you need access to the whole frame of samples you can convert it to an array:
myFrame.to_array – gives you the samples in a Ruby array
There's a little bit of an overhead in converting to a Ruby array. However, if you plan on manipulating all the samples then it's probably more
efficient to convert to a Ruby array and do the processing on the array than it is to access each sample individually.
165 of 212