Our Keyboard script allows us to play an audio source like an instrument. In order to demonstrate a couple of other scripting concepts with audio sources, let's add a couple of features to our script by following the following exercise:
- The first set of features that we will add is the ability to record a session and then play the audio back. This may sound like an incredibly complex task, but it is something we can accomplish with just a few more lines of code.
- Open back up MonoDevelop or your favorite script editor and add the following lines just after the declaration of the transpose variable, as shown here:
public int transpose = 0; //after this line private List<int> notes = new List<int>(); private ...