Multiple Layers Expanded
- Aaron Lockwood
- Mar 3, 2021
- 1 min read

This update builds off of the last new feature of multiple layers but makes them more dynamically stored in the ChucK script. In iteration_02 I only had two layers that were hard coded in and referred to as drums and synth. Now I have made a new class called Board which holds an an integer array for the lit indexes and color of the board so that I can make more than just two layers. To do this I used an array of Boards which gets added onto when one of the buttons in the right column is pressed, this creates a new board, updates currentBoard to that index, and illuminates the button with the layers corresponding color.
I have yet to explore different play back options like fm synthesis instead of sound clips or more interesting scroll techniques besides the horizontal scrolling bar. But with this update I was able to clean up my script and organize my containers so that I can more easily expand into those other options. Instead of having set int arrays for each layer and having to store the color in these arrays haphazardly, I can now use functions like getColor() or lit() which I have off loaded to the Board class so that my script stays clean and legible.
To run this script you only need to add "main.ck" to the machine since the "Board.ck" file is sporked off at the start of main.
Comments