EarSketch
Debugging, Commenting, and Sharing Scripts
Where are Errors Shown in EarSketch?
Errors are shown in the console. The line number of the error and explanation are in red.
Notes are on
The next slide
Notes For Previous Slide
Most Common Error
Putting two sounds on the same track with overlapping measures will cause an error.
The script will run successfully with lines 8 and 10, but line 9 will not run.
The console gives you two suggestions to fix the error – change line 8 or line 9.
You can change the track number or the measures.
Another Common Error
Can you figure out what the error is?
See the next slide for the answer.
What does (9:21) mean?
Syntax Error
There is a comma missing after the start measure. The console tells you that the syntax error is on line 9 and character 21. Simply count from left to right and the comma will go in the 21st spot.
Debugging Coding Errors
Voice and Choice
Commenting the Code
It is good practice to comment your code. At the top of the script, you can add information about the creator of the code and a description of the code as well as important details throughout the code.
Use 2 forward slash (or just slash) marks to indicate a comment, This line of code will not run.
Mini Task Assignment
as an example Period5_ScoobyDoo_8MScript
Share with me: csteacher1
Sharing Your Code and Music