FluidWaveform plots a buffer with optional overlays such as slices derived from a FluCoMa Slicer.
FluidWaveform plots a buffer with optional overlays such as slices derived from a FluCoMa Slicer, or feature values from a FluCoMa audio descriptor.
CLASSMETHODS::
CLASSMETHODS::
METHOD:: new
METHOD:: new
Create a new instance of FluidWaveform.
Create a new instance of FluidWaveform.
ARGUMENT:: audio_buf
ARGUMENT:: audioBuffer
The audio buffer to plot.
The audio buffer to plot.
ARGUMENT:: slices_buf
ARGUMENT:: slicesBuffer
A buffer of slice indices. This will very likely be in the form of a buffer output from a FluCoMa slicer object. Currently this buffer must be only one channel, therefore it will not work with the output of link::Classes/FluidBufAmpGate::.
A link::Classes/Buffer:: of slice indices. This will very likely be in the form of a link::Classes/Buffer:: output from a FluCoMa slicer object. If this link::Classes/Buffer:: is only one channel it will plot lines at these slice points. If the link::Classes/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 link::Classes/FluidBufAmpGate::.
ARGUMENT:: featureBuffer
A link::Classes/Buffer:: containing features to plot over the waveform. If this link::Classes/Buffer:: is multiple channels, it will plot each channel as a separate feature.
ARGUMENT:: parent
A link::Classes/Window:: to place this FluidWaveform in. If STRONG::nil::, FluidWaveform will make its own window using the STRONG::bounds:: argument.
ARGUMENT:: bounds
ARGUMENT:: bounds
A link::Classes/Rect:: of where to place the FluidWaveform.
A link::Classes/Rect:: of where to place the FluidWaveform. If parent is STRONG::nil::, these bounds will be used to create a new link::Classes/Window::. If parent is not STRONG::nil::, these bounds will be used to place this FluidWaveform in the parent.
ARGUMENT:: lineWidth
The width of the line for plotting slice points and features.
ARGUMENT:: waveformColor
A link::Classes/Color:: to make the waveform.
ARGUMENT:: stackFeatures
If STRONG::false::, all the features (i.e., channels in the STRONG::featureBuffer::) will be overlayed on each other, as though on the same x and y axis. If STRONG::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 STRONG::featureBuf:: / the height of the plot). The default is STRONG::false::.
ARGUMENT:: showSpectrogram
Boolean whether or not to plot a spectrogram. The default is STRONG::false::.
ARGUMENT:: spectrogramColorScheme
An integer indicating which color scheme footnote::The non-gray-scale color schemes used are from https://colorcet.com/ Kovesi, Peter. "Good colour maps: How to design them." arXiv preprint arXiv:1509.03700 (2015). https://arxiv.org/abs/1509.03700 :: to use to distinguish magitudes in the spectrogram. The default is 0.
table::
## 0 || Gray-scale
## 1 || Black - Blue - Green - Yellow - White
::
ARGUMENT:: spectrogramAlpha
An transparency value (0-1) for displaying the waveform. 0 is fully transparent, 1 is fully visible. The default is 1.
ARGUMENT:: showWaveform
Boolean whether or not to show the waveform. The default is true.
ARGUMENT:: normalizeFeaturesIndependently
Boolean. All the features in STRONG::featureBuf:: need to be normalized for plotting. If STRONG::true::, this normalization will happen per feature, so that each will use the full visual range allowed to them. If STRONG::false::, the normalization will happen over all the values in the STRONG::featureBuf:: (in all the channels), so that the features relative strengths will be preserved. The default is STRONG::true::.
returns:: A new instance of FluidWaveform.
returns:: A new instance of FluidWaveform.
INSTANCEMETHODS::
INSTANCEMETHODS::
EXAMPLES::
code::
METHOD:: close
Close the FluidWaveform window. If parent is not STRONG::nil::, this method will close the parent window.
METHOD:: win
returns:: The FluidWaveform window. If parent is not STRONG::nil::, this method will return the parent window.