flag Where there are programs, there are bugs.
Most web developers are quite familiar with the built-in browser development tools. If you aren't, it's not a big problem, but it is beyond the scope of this page to provide a tutorial.
The good news is that source-level debugging of your JavaScript code is straightforward.
info Remember: your scripts are run in a Sandboxed context. Because a web-audio app has many contexts, it can be difficult to identify the one your code may be running in.
More Tools -> Developer Tools.Sources tabdebugger; line to your script If your script has syntax errors it will fail to load
and never trigger the debugger. Usually syntax errors
amount to missing closing elements (quotes, brackets, braces).
The Code Editor offers some clues
but because it's not fully aware of the context in which your
code runs, it can mis-flag some issues like invalid yield
statements.
If your script has no syntax errors, then the debugger should
pause on your debugger line and you can step through
your function, inspect local variables, etc.
info When a debugger pauses your script, other aspects of the system continue running. Audio engines have a running clock and may soundscapes schedule notes to occur at a stated time. Pauses can result in missed notes, because by the time your script emits the notes, the scheduled time has already past.
info It's generally wise to clear the sandbox prior to each debugging session.
info Much of the rest of the
Hzis compiled into a compressed javascript representation. This makes it faster to load but more difficult to debug into the app, its plugins, etc. When debugging into the code of others, please remember to respect their respective licensing terms, copyrights, etc.