{"id":26715867,"url":"https://github.com/dhruv-m1/musicmakerdsl","last_synced_at":"2025-03-27T14:36:37.937Z","repository":{"id":95686169,"uuid":"412302151","full_name":"dhruv-m1/MusicMakerDSL","owner":"dhruv-m1","description":"An experimental domain-specific language (DSL) to quickly create basic sound effects and export them as WAV files 🎵🎶","archived":false,"fork":false,"pushed_at":"2023-07-09T08:23:33.000Z","size":560,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2024-08-05T23:13:23.108Z","etag":null,"topics":["antlr","dsl"],"latest_commit_sha":null,"homepage":"https://mmdsl.labs.dhruv.tech","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhruv-m1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-01T02:45:41.000Z","updated_at":"2024-08-05T23:14:00.039Z","dependencies_parsed_at":"2024-08-05T23:13:27.095Z","dependency_job_id":"286140a4-969d-4d61-a83d-459a33a56201","html_url":"https://github.com/dhruv-m1/MusicMakerDSL","commit_stats":null,"previous_names":["dhruv-m1/musicmakerdsl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruv-m1%2FMusicMakerDSL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruv-m1%2FMusicMakerDSL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruv-m1%2FMusicMakerDSL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruv-m1%2FMusicMakerDSL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhruv-m1","download_url":"https://codeload.github.com/dhruv-m1/MusicMakerDSL/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245863737,"owners_count":20684910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["antlr","dsl"],"created_at":"2025-03-27T14:36:37.318Z","updated_at":"2025-03-27T14:36:37.923Z","avatar_url":"https://github.com/dhruv-m1.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Music Maker Project (MMP)\n\n## Introduction\nThe Music Maker Project (MMP) is a Domain-Specific Language (DSL) that allows you to quickly create basic sound effects and export them as WAV files.\n\n## Objective\nThe objective of this DSL is to enable software developers that have negligible/very basic knowledge of music to create basic sound effects for use in small-scale software projects (such as a simple quiz game).\n\n## Technical Context\nMMP is implemented using a modular, event-based approach and relies on the JavaScript's native \u003ca href=\"https://www.w3.org/TR/webaudio/\"\u003eWeb Audio API standard\u003c/a\u003e for producing and recording sounds. This is an immensively powerful, ever-evolving standard and provides plently of opportunity for future extensibility/devlopment of this project.\n\n## The Basics\n\n### Structure\n\nThe DSL consists of 3 major blocks:\n\n* Sound\n* Combination\n* Play\n\n### Sound\n\nThe sound block describes individual audio tracks to be used for creating your sound effect.\n\nThere are 2 types of sound blocks:\n\n* Preset\n* Clip\n\n#### Preset\n\nPreset sound blocks represent the use of an exisiting sound effect.\n\n```\nSound Kick1 as Preset\n    Pattern: x-xx-x\n    Repeat: 1\n    UseSound: \"Kick\"\nEndSound\n```\n\nYou specify which sound effect you want to use in the `UseSound` attribute. Currently, you can choose from Kick, Bass, OpenHats, ClosedHats \u0026 Snare.\n\n#### Clip\n\nClip sound blocks represent the use of a sequence of musical notes.\n\n```\nSound MyMelody as Clip\n    Pattern: x\n    Repeat: 2\n    UseSound: \"C1 D2 F7\"\nEndSound\n```\n\nYou specify the sequence of notes (with octaves) in the `UseSound` attribute as shown in the example sound block, named 'MyMelody', above.\n\nIn both types of sound blocks, you must also specify `Pattern` \u0026 `Repeat`.\n\n`Pattern` is denoted by a series of 'x' and '-'.\nx means that the sound specified in `UseSound` should be played and '-' represents a pause of (approximately) 0.5 seconds.\n\n`Repeat` denotes how many times you wish to repeat the pattern.\n\n### Combination\n\nThis block specifies how you would like to sequence the sounds you defined earlier.\n\n```\nCombination Draft1\n    Track\n        Volume: 75\n        Components: [5*Kick1, 1*MyMelody]\n    EndTrack\n    Track\n        Offset: 100\n        Volume: 25\n        Components: [2*MyMelody]\n    EndTrack\nEndCombination\n```\n\nThe two main parts of a Combination are the `Track` and `Components`.\n\nAs is illustrated by the way the DSL is strucuted, all Tracks in a combination are played in parallel.\n\nIn a Track, you specify:\n\n* Volume - loudness of the track.\n* Offset - start time delay in milliseconds\n\nand \n\n* Components\n\n`Components` represents the sounds that a track should play.\nThe sounds specified in the `components` section are played in sequence (one after the other) for each track.\n\n### Play\n\nTo help you ideate/draft your sound effect, you are allowed to create multiple combination blocks in your code. \nHowever, only one of them will played/rendered upon executuion.\n\nThe `Play` block is used to specify which combination block you would like to be played in the current execution.\n\n```\nPlay Draft1\n```\n\n### Full Example\n\n```\nSound Kick1 as Preset\n    Pattern: x-xx-x\n    Repeat: 1\n    UseSound: \"Kick\"\nEndSound\n\nSound Melody1 as Clip\n    Pattern: x\n    Repeat: 2\n    UseSound: \"C1 D2 F7\"\n    EndSound\n\nCombination Draft1\n    Track\n        Volume: 75\n        Components: [5*Kick1, 1*Melody1]\n    EndTrack\n    Track\n        Offset: 100\n        Volume: 25\n        Components: [2*Melody1]\n    EndTrack\nEndCombination\nPlay Draft1\n```\n\n## Documenation\n\n```\nprogram         : sound+ combination+ play\nsound           : 'Sound ' soundname 'as ' SUBTYPE pattern repeat usesound 'EndSound'\nsoundname       : TEXT\npattern         : 'Pattern:' TEXT\nrepeat          : 'Repeat:' NUM\nusesound        : 'UseSound:' USESOUNDS '\"'\ncombination     : 'Components:' TEXT track+ 'EndCombination'\ntrack           : 'Track' offset? volume? components* 'EndTrack'\noffset          : 'Offset:' NUM\nvolume          : 'Volume:' NUM\ncomponents      : 'Components:' '[' component [','component]* ']'\ncomponent       : NUM? '*' COMPONENT_NAME\nplay            : 'Play' TEXT\n\nTEXT            : ~[[\\]\\r\\n ]+\nSUBTYPE         : 'Preset' | 'Clip';\nNUM             : [0-9]+\nUSESOUNDS       : ~[[\\]'\"]+\nCOMPONENT_NAME  : ~[[\\]\\r\\n,* ]+\n```\n\nIn addition to the grammar rules above, a few logical rules are in place in order for the DSL to\nrun properly:\n\u003cul\u003e\n    \u003cli\u003e\n        The \u003ccode\u003epattern\u003c/code\u003e must be a string consisting of any combination of only characters\n        \"x\" and \"-\" and no other characters, where an \"x\" means to play a note, where as \"-\" means\n        rest (don't play a note)\n    \u003c/li\u003e\n    \u003cli\u003eTEXT in each \u003ccode\u003ecomponent\u003c/code\u003e must match a \u003ccode\u003esoundname\u003c/code\u003e created by you\u003c/li\u003e\n    \u003cli\u003e\n        If a \u003ccode\u003esound\u003c/code\u003e has \u003ccode\u003eSUBTYPE\u003c/code\u003e \"Clip\", \u003ccode\u003eUSESOUNDS\u003c/code\u003e must be\n        a single line of text, with each note following the pattern of {note}{octave} with a space\n        between each note(e.g. \"C2 G9\")\n    \u003c/li\u003e\n    \u003cli\u003e\n         If a \u003ccode\u003esound\u003c/code\u003e has \u003ccode\u003eSUBTYPE\u003c/code\u003e \"Preset\", then the \u003ccode\u003eUSESOUNDS\u003c/code\u003e\n         must match exactly with any one of the following sound names provided: \"Kick\", \"Base\",\n         \"Snare\", \"OpenHats\", or \"ClosedHats\"\n    \u003c/li\u003e\n    \u003cli\u003e\n        The indentation level on each line does not affect the success/failure of running the DSL.\n    \u003c/li\u003e\n\u003c/ul\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhruv-m1%2Fmusicmakerdsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhruv-m1%2Fmusicmakerdsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhruv-m1%2Fmusicmakerdsl/lists"}