OscProcessor
A polyphonic oscillator with one voice for each pattern lane.
| Declared in | src/libs/libbahn/bahn/tracker/processor/OscProcessor.hpp |
| Inherits | Processor |
| Group | bahn |
Detailed description
The Shape node parameter selects a sine, saw, square or triangle wave for all voices. Each lane carries a Note and a Volume for its own voice, so the number of lanes is the number of notes that can sound together, up to 16. The amplitude of each voice moves toward its target, so a note that starts or stops does not click.
Member function documentation
applyRowData
[override virtual] void OscProcessor::applyRowData(const Value *values, int valueCount, int currentStep)
Take one pattern row and hand each lane to its own voice.
values holds the valueCount values of the row at step currentStep. A second call for the same step changes nothing.
One lane is one voice
The schema has said this since it was written. Shape is a node parameter, so it is stored once. Note and Volume are LANE parameters, and Pattern::newRow repeats the lane block once per lane. A row is therefore Shape, then Note and Volume per lane, and the lane count is what is left over after Shape divided by two.
That makes this node polyphonic by its layout, which the monophonic instruments beside it are not. The number of lanes is the number of notes that can sound together.
Notes
setSampleRate
[override virtual] void OscProcessor::setSampleRate(int rate)
Follow the device: rate is the sample rate of the output device, in Hz. A rate of zero or less, or a rate equal to the current one, changes nothing.
BahnPlayer calls this once the speaker's format is known. Without it the node stays at the factory's default rate and every pitch is wrong by the ratio between the two.