Skip to content

Commit

Permalink
add reset and phase versions of lf_sawpos
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetophon committed Jun 27, 2020
1 parent cde57d7 commit cf41bb2
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion oscillators.lib
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ lf_rawsaw(periodsamps) = (_,periodsamps : fmod) ~ +(1.0);
// Where:
//
// * `freq`: frequency
// * `phase`: phase
// * `phase`: phase between 0 and 1
//---------------------------------------------------------
lf_sawpos_phase(phase,freq) = (+(phase-phase') : ma.frac) ~ +(freq/ma.SR);

Expand All @@ -446,6 +446,47 @@ lf_sawpos_phase(phase,freq) = (+(phase-phase') : ma.frac) ~ +(freq/ma.SR);
// MarkDown: Romain Michon
lf_sawpos(freq) = ma.frac ~ +(freq/ma.SR);

//-----------------`(os.)lf_sawpos_reset`--------------------
// Simple sawtooth waveform oscillator between 0 and 1.
// with reset.
//
// #### Usage
//
// ```
// lf_sawpos_reset(freq,reset)
// ```
//
// Where:
//
// * `freq`: frequency
// * `reset`: reset the oscillator to 0
//
//---------------------------------------------------------
// Author: Bart Brouns
// License: STK-4.3
lf_sawpos_reset(freq,reset) = ma.frac * (reset <= reset') ~ +(freq/ma.SR)

//-----------------`(os.)lf_sawpos_phase_reset`--------------------
// Simple sawtooth waveform oscillator between 0 and 1.
// with phase control and reset.
//
// #### Usage
//
// ```
// lf_sawpos_phase_reset(freq,phase,reset)
// ```
//
// Where:
//
// * `freq`: frequency
// * `phase`: phase between 0 and 1
// * `reset`: reset the oscillator to 0
//
//---------------------------------------------------------
// Author: Bart Brouns
// License: STK-4.3
lf_sawpos_phase_reset(freq,phase,reset) = lf_sawpos_reset(freq,reset) +phase :ma.frac;

//-----------------`(os.)lf_saw`--------------------
// Simple sawtooth waveform.
// `lf_saw` is a standard Faust function.
Expand Down

0 comments on commit cf41bb2

Please sign in to comment.