FluidWaveform plots a buffer with optional overlays such as slices derived from a FluCoMa Slicer, or feature values from a FluCoMa audio descriptor.
Create a new instance of FluidWaveform.
audioBuffer |
The audio buffer to plot. | ||||||||||
indicesBuffer |
A Buffer of slice indices. This will very likely be in the form of a Buffer output from a FluCoMa slicer object. If this Buffer is only one channel it will plot lines at these slice points. If the Buffer is two channels it will consider the 0th channel to contain onsets and the 1st channel to contain offsets. This matches the output of FluidBufAmpGate. | ||||||||||
featuresBuffer |
A Buffer containing features to plot over the waveform. If this Buffer is multiple channels, it will plot each channel as a separate feature. | ||||||||||
parent |
A Window to place this FluidWaveform in. If nil, FluidWaveform will make its own window using the bounds argument. To create a view without parent and bounds (e.g. for GUIs with Layout Management), see the standalone argument below. | ||||||||||
bounds |
A Rect of where to place the FluidWaveform. If parent is nil, these bounds will be used to create a new Window. If parent is not nil, these bounds will be used to place this FluidWaveform in the parent. | ||||||||||
lineWidth |
The width of the line for plotting slice points and features. | ||||||||||
waveformColor |
A Color to make the waveform. | ||||||||||
stackFeatures |
If false, all the features (i.e., channels in the featureBuffer) will be overlayed on each other, as though on the same x and y axis. If true, each feature will occupy its own space covering the width of the plot and an fraction of the height (the number of channels in featureBuf / the height of the plot). The default is false. | ||||||||||
imageBuffer |
A Buffer that will be turned into a raster image and displayed. The buffer's frames will comprise the y axis, the buffer's channels will comprise the x axis (channel 0 at the bottom). Very likely this will come from the output of a Fluid analysis object, such as FluidBufSTFT which can be used to plot a spectrogram. Using FluidBufMelBands can be used to plot a Mel-frequency spectrum. | ||||||||||
imageColorScheme |
An integer indicating which color scheme1 to use to distinguish differences in the values in imageBuffer. The default is 0. One can also pass a Color and differences will be shown using alpha.
| ||||||||||
imageAlpha |
An transparency value (0-1) for displaying the waveform. 0 is fully transparent, 1 is fully visible. The default is 1. | ||||||||||
normalizeFeaturesIndependently |
Boolean. All the features in featureBuf need to be normalized for plotting. If true, this normalization will happen per feature, so that each will use the full visual range allowed to them. If false, the normalization will happen over all the values in the featureBuf (in all the channels), so that the features relative strengths will be preserved. The default is true. | ||||||||||
imageColorScaling |
An integer indicating how to scale the values in imageBuffer before applying the imageColorScheme. 0 indicates linear scaling, 1 indicates logarithmic scaling. The default is 1. These integers can also be accessed via FluidWaveform.lin and FluidWaveform.log. | ||||||||||
standalone |
If false, creates a View without parent or bounds, so that it can be used as part of a larger GUI, e.g. with Layout Management. |
A new instance of FluidWaveform.
Can be used as the colorScaling argument.
0
Can be used as the colorScaling argument.
1
Add a graphic layer that shows a waveform.
audioBuffer |
See this argument in the class method 'new' above. |
waveformColor |
See this argument in the class method 'new' above. The default is gray. |
Add a grapic layer that shows indices.
indicesBuffer |
See this argument in the class method 'new' above. |
audioBuffer |
The audioBuffer that the indices refer to. |
color |
The Color to display the indices. The default is red. |
lineWidth |
How wide to draw the indices lines. The default is 1. |
Add a grapic layer that shows feature curves.
featuresBuffer |
See this argument in the class method 'new' above. |
colors |
An array of Color objects to use to display the different features. If there are more features than colors, FluidWaveform will modulo around the colors. If this is left blank, default colors will be used. |
stackFeatures |
See this argument in the class method 'new' above. |
normalizeFeaturesIndependently |
See this argument in the class method 'new' above. |
lineWidth |
See this argument in the class method 'new' above. |
Add a grapic layer that shows an image derived from a buffer.
imageBuffer |
See this argument in the class method 'new' above. |
imageColorScheme |
See this argument in the class method 'new' above. |
imageColorScaling |
See this argument in the class method 'new' above. |
imageAlpha |
See this argument in the class method 'new' above. |
Similar to Window's front method. Shows the FluidWaveform. This must be called after layers have been added in order to see the layers.
Similar to Window's refresh method. Redraws all FluidWaveform layers. Has to be called after FluidWaveform: -addLayer in order to see the new layer.
Close the FluidWaveform window. If parent is not nil, this method will close the parent window.
The FluidWaveform window. If parent is not nil, this method will return the parent window.
Adding Layers One at a Time