home/ atoms/ glicol-numbers-need-decimal

Glicol parameters are safest written with a decimal point, as the grammar's float rule wants a `.`

Glicol’s grammar has a float rule that expects a decimal point. Integer literals work in some positions (saw 110), but many parameters are safest written as floats — mul 0.5, lpf 900.0 1.0 — and mul 1 versus mul 1.0 can behave differently. When a parameter unexpectedly fails to parse or behaves oddly, adding the decimal point is the first thing to try.

Examples

mul 0.5 // ok lpf 900.0 1.0 // safest saw 110 // integer works for pitch mul 1 vs mul 1.0 // prefer the decimal

Assessment

A Glicol chain >> mul 1 behaves unexpectedly. Explain the grammar reason to prefer mul 1.0, and give one parameter position where an integer is nonetheless accepted.

“Numbers usually need a decimal point.** The grammar's `float` rule wants a `.` (`saw 110` works for integers, but many params like `mul 0.5`, `lpf 900.0 1.0` are safest written as floats; `mul 1` vs `mul 1.0`).”
context/ · L1-instruments/glicol/gotchas.md · chunk 1