A UNIX-Inspired Domain-Specific Language for Modular ABC Music Notation Processing
Bruno M. Azevedo, Jose Joao Almeida
Journal of Electronic Systems, Vol. 15, No. 3, 2025.
DOI: https://doi.org/10.6025/jes/2025/15/3/140-160
Link: https://www.dline.info/jes/fulltext/v15n3/jesv15n3_2.pdf
Abstract:
This paper introduces abc::dt, a domain-specific language (DSL) embedded in Perl, designed for creating
modular and composable tools to process music written in the abc notation. Leveraging the UNIX philosophy
of simple, text-stream-based tools, the authors reuse the parser from abcm2ps to handle real-world
abc files. The system comprises three stages: parsing input into an internal representation (IR), transforming
it using rule-based actuators, and generating output, which may serve as input for other tools. abc::dt
enables users to define specific transformations using concise rules, making tool creation more efficient.
Several tools built with abc::dtâ€”like All-but-one, abc_paste, and abc_catâ€”demonstrate its capability
to manipulate polyphonic scores, concatenate tunes, or isolate voices for rehearsal. The sequential structure
used simplifies integration with scripting languages, while the DSLâ€™s extensibility supports advanced
transformations. Overall, abc::dt aims to establish a flexible â€œabc operating systemâ€ to fill the gap in generalpurpose
abc music processing tools.