Step 10 of 11
Error messages
What Strudel's messages mean, how to fix them, and what to check when there is no sound.
10.1How errors work
Strudel shows errors at the bottom of the editor and in the console tab. The music usually keeps playing the last version that worked, so an error never stops your set. Fix the code and press Ctrl+Enter again.
10.2The most common one: "… is not defined"
| You wrote | Strudel says | Fix |
|---|---|---|
.s(gm_choir_aahs) | gm_choir_aahs is not defined | .s("gm_choir_aahs") |
Strudel code is JavaScript. A word in quotes is text: a sound name, a pattern, a chord. A word without quotes is the name of a variable or function, and JavaScript looks for something called gm_choir_aahs that you defined with const. It doesn't exist, so you get "not defined".
- Sound names, patterns, chords, scales and banks always go in double quotes:
s("bd"),.s("gm_choir_aahs"),.bank("RolandTR909"),.scale("A4:minor"). - Your own names go without quotes: layers and blocks you made with
const(kick,verse) and built-in functions (sine,rev,stack). - The same message appears when a
constdoesn't exist yet, for example$: versewhen you haven't run the code that definesverse. Names are case-sensitive:Verseis notverse.
10.3Other messages and what they mean
| Message | What it means | Fix |
|---|---|---|
X is not defined | A name without quotes, or a const that wasn't defined or run | Add quotes, or define it first (see above) |
sound X not found! Is it loaded? | The name is in quotes but no such sound exists: a typo (gm_choir_ahs), a bank prefix (RolandTR909_triangle means s() is missing), or single quotes (s('bd sd') looks for a sound called "bd sd") | Check the spelling in the sounds tab or the Sound bank; use s("…") with double quotes |
note(...).lpff is not a function | A function name is misspelled, or has the wrong upper/lower case | .lpf(). Check the reference tab for the right name. |
Unexpected token (1:20) | JavaScript can't read the code: a missing ) or ", or an extra comma. The numbers are line:column. | Look at that position. Every ( needs a ), and every " needs a closing ". |
[mini] parse error at line 1: Expected … but "\"" found | The pattern inside the quotes is broken: an unclosed [, < or {, or a stray symbol | Count the brackets inside the quotes: "bd [sd hh]" |
not a note: "h4" | Not a valid note name. Notes are a–g, plus # or b for sharp or flat, plus an octave. The German "H" is b. | note("b4") |
[voicing]: unknown chord "Cxyz" | The chord symbol isn't in the dictionary. With .dict("triads"), 7th chords like Am7 are unknown too. | Use symbols like C Am F^7 G7 Dm7; with triads, only C Am Dm… |
Failed to set the 'value' property on 'AudioParam': The provided float value is non-finite | A layer produced something that isn't a number where a sound needs one (a pitch, a filter frequency…). One known cause: chord(…).rootNotes(2).note(), which makes no valid notes. | Find the layer by muting layers one at a time (_$:). For root notes use chord(…).rootNotes(2) or "<Am F>".rootNotes(2).note(). |
[webaudio] skip hap: still loadingloading sound "bd:0" took too long | Not an error. A sample is downloading the first time it's used, so the first hit may be silent. | Wait a moment. It plays from the next hit on. |
10.4No sound, and no error
- Reload the page and press Run again.
- Check the Windows volume, the output device, and that the browser tab isn't muted.
- In Strudel, click inside the page once: browsers block sound until you interact with the page. Then press Ctrl+Enter.
- Check the code itself:
.gain(0), a_$:(muted layer), a mask that is all zeros.
Tested with Strudel 1.3. Course text: CC BY-SA 4.0, code: CC0 1.0 (licences).