8 clicked. When the function is defined in the PluginEditor.cpp a conditional statement checks whether the button clicked is noteButton. If this condition is met, an if-else ladder determines the current state of emun instance noteState and assigns a corresponding lambda function to the callback object button.onClick. Each lambda function calls a method associated with the current note length which changes the state of noteState, the value of mNoteVal, noteButton colour, and noteButton text accordingly.
During the conversion from MATLAB to C++, the way that the bounds checking is accomplished is altered slightly. Because C++ is a programming language that indexes from zero, bounds checking can be achieved by taking the modulo of the read or write head against the buffer size. For any value before the read/write index meets the buffer size, ππππ/π€πππ‘π % ππ’πππππ ππ§π will return the current read/write index, however, when the read/write index reaches the buffer size, ππππ/ π€πππ‘π % ππ’πππππ ππ§π will return 0, resetting the index to the beginning of the delay line and restarting the process. This is what makes the buffers circular in the C++ implementation. This could not be attained in the same way in MATLAB as indexing starts at 0.
RESULTS AND DISCUSSION The entirety of the testing is performed on the same two-channel delta function audio file, consisting of a regular delta function as the left channel and a delayed, attenuated delta function as the right channel (fig 2). The signal was created and used for testing in MATLAB before being rendered out as an audio file using audiowrite() and used as test audio for the final JUCE plugin.