I used a similar approach for the drums here, but without amplitude. In another unpublished project in progress, I also included parsing to amplitudes. There, I use x
/X
for 10, and -
, 1
, …, 9
for 0 to 9.
Further, in the project mentioned first, I used a similar string notation to control amplitudes and other “instrument” parameters over the entire track (see here). You can find the respective parsing functions at the end of the document (str_scale
and str_select
). Note that parsing into arrays is done before starting any loops for the sake of performance.
Also note that spaces and the pipe character |
are ignored to allow for a more readible representation. The same technique can be applied to drum patterns to allow for nicely readible rhythms that span multiple measures.
EDIT: See also this thread.