Numbers, signals & audio

The four ways DNA carries loose values: a single number, a list, a stream that changes over time, and audio.

Not everything in DNA is geometry or pixels. Plenty of the time you're just moving values around — a slider position, a list of sizes, a pulsing rhythm, or the audio coming out of your speakers. DNA has a few shapes for these, and knowing which is which saves a lot of head-scratching.

Single numbers and lists

The simplest thing you can pass down a wire is one value: a number, a position, a colour, a true/false. A node that asks "how big?" or "which colour?" usually wants exactly one.

A list (an array) is many of those lined up — number arrays, vector arrays, colour arrays, integer arrays. These show up everywhere: one value per point in a shape, a set of frequencies, a palette of colours. When you connect a list into something that wanted a single value, DNA usually applies it across all the rows for you.

Lists pair naturally with Fields (attributes). A "size per point" attribute is really just a number list riding along with your geometry.

Signals: numbers that move over time

A signal is a list with one extra promise: it has a sample rate, so DNA knows it represents something measured evenly over time. That's the whole difference between a signal and a plain number list — a signal animates. The samples are spaced out in time, so the same data can be played back, scrubbed, and reasoned about as a moving stream.

This is the format audio flows through, but signals aren't only for sound:

The same Oscillate node makes both: leave its sample rate at 0 and it's a gentle control wobble; turn the sample rate up and it becomes an audible tone.

A signal and a number list can stand in for each other when a node accepts either. DNA fills in a sample rate when a plain list becomes a signal, and drops it going the other way. You rarely have to think about this — just know that "it animates" is the part that matters.

Audio buffers

Audio in DNA is just a signal at audio rate. A whole sound file, a live input, or the output of a synth chain is one long stream of samples.

A couple of practical things to know:

To turn sound into motion, feed audio through analysis.audio (band energy, beat, kick/snare/hat) or utility.envelope_follower. Those hand you back plain numbers and lists you can wire into anything — scale, colour, position.

Which one do I have?

If something should animate or be heard and isn't, you're probably holding a plain list where a signal was expected, or vice versa. Check the node that made it: a sample rate of 0 means "control wobble", above 0 means "audio".

See also