Abstract:
This article presents a domain-specific language designed to make music composition and automation easier for people with elementary programming knowledge. This tool provides a more understandable and user-friendly syntax compared to the other existing tools on the market, such as Super Collider, Sonic Pi, and Tidal Cycles. A preliminary domain analysis was conducted to identify the primary drawbacks of the modern music software, which included complex user interfaces, nonexistent or insufficient automation functionalities, and poor MIDI and digital audio workstation (DAW) integration. In order to address these limitations, the proposed Music DSL comes with a variety of built-in capabilities for music theory, MIDI and MP3 export support, and real-time audio playing through an easy-to-use, simplified syntax. A lexer, recursive-descent parser, and interpreter make up the compiler-based architecture used to construct the language. The language utilizes a Backus-Naur Form (BNF) syntax for composition using fundamental musical elements, such as tempo, loudness, loops, synchronised blocks, and pauses. The interpreter turns abstract syntax trees into audio output by using the pydub package and sine wave synthesis. An interactive interface with features including playing controls, music sheet visualisation, modular code chunks, and a history panel is part of the development.