home/ atoms/ punctual-osc-vs-sin

In Punctual 0.5 osc is the sine oscillator and sin is the math sine function of its argument; old sin-as-oscillator code is wrong

As of Punctual 0.5, osc and sin are distinct. osc produces a running sine oscillator at a given frequency (a signal source over time). sin is the mathematical sine function applied to its argument — a pointwise transform, not an oscillator. Code written for older Punctual that used sin as an oscillator will behave wrong under 0.5. The documentation’s transitional name for the sine function is sin', but the 0.5.2.3 parser reserves plain sin for the math function. Reach for osc when you want an audible or animated tone; reach for sin when transforming an existing signal.

Examples

osc 440 >> audio — a 440 Hz sine tone. sin (fx * 6.28) — the sine of a coordinate, a spatial shape, not a tone.

Assessment

A performer copies pre-0.5 Punctual code using sin 440 as a tone and hears nothing musical. Explain what changed in 0.5 and give the correct call for a sine oscillator.

“**`osc` is the oscillator; `sin` is the math sine.** As of 0.5 `osc` produces the sine *oscillator* and `sin` is the sine *function* of its argument.”
context/ · L1-instruments/punctual/gotchas.md · chunk 1