home/ atoms/ glicol-meta-node-inline-dsp

Glicol's meta node allows inline Rust DSP code inside a live session

Glicol’s meta node is an escape hatch from the high-level node language into raw sample-by-sample Rust DSP code. A learner can write the inner loop of a sine oscillator directly in the meta node, demonstrating at teaching level how the ‘hello world’ tone is computed: iterating over a 128-sample buffer, computing phase-accumulator-based sine, and writing to the output array. This bridges the abstraction gap between high-level nodes (sin 440) and the underlying DSP loop. It is an advanced feature aimed at students ready to go from graph thinking to sample thinking — both within a single Glicol session.

Examples

o: meta `
    output.pad(128, 0.0);
    for i in 0..128 {
        output[i] = sin(2*PI()*phase);
        phase += 440.0 / sr;
    };
    while phase > 1.0 { phase -= 1.0 };
    output
`

Assessment

Modify the meta node sine oscillator above to produce a triangle wave at 220 Hz. What two parameters need to change and how?

“o: meta ` output.pad(128, 0.0); for i in 0..128 { output[i] = sin(2*PI()*phase) ; phase += 440.0 / sr;”
corpus · glicol-language-playground-and-guide-graph-oriented-live-cod · chunk 1