Skip to content

controlVoltage API

ianhattwick edited this page Jun 3, 2021 · 1 revision

The main controlVoltage library API.

constructor

controlVoltage();

controlVoltage(uint8_t bitDepth);

  • controlVoltage cv = controlVoltage();
  • optional argument to set bit depth. Default bit depth is 12-bit.

mandatory methods

void loop();

  • called every time your main loop runs. Checks to see whether it is time to generate a new sample, and then generates the samples

int get();

  • reads the current cv sample, and flags the object to generate a new sample on the next loop()

signal generators

void trigger();

  • creates a 3ms long trigger signal

void gate(int val);

  • creates a static gate signal

void timedGate(int gateLen);

  • creates a timed gate signal of duration length

void cv(int val);

  • creates a standard CV signal

void cv(int val, int lineTime);

  • creates a cv signal that ramps to val over lineTime milliseconds

void cv(int val, int attack, int decay);

  • creates a cv signal that ramps to val, with variable ramp time depending on whether the signal is ascending or descening.
    • if the signal is ascneding the ramp time is attack ms
    • if the signal is descending, the ramp time i decay ms

void AR(int attack, int decay);

  • creates an attack release envelope, that ramps from 0 to maximum over attack ms and then ramps to 0 over decay ms

void midi( byte _val );

  • creates a quantized cv signal which represents a midi note value.
    • Note the input is a byte midi note, but the output is a cv signal in the range 1000 unit/ octave
    • each midi note step is 1000/12 units

parameter setters

void curve(float val);

  • creates an exponential curve to ramps. The formula is simply pow(sig, curve).
    • A curve of 1 is linear
    • A curve of 2 is exponential
    • A curve of 0.5 is 'logarithmic' like

void bitDepth( byte depth);

  • sets the bit resolution of the cv signal
    • note you can set this when you create the controlVoltage object as well

Clone this wiki locally