{"id":22108581,"url":"https://github.com/superdisk/lang-music","last_synced_at":"2026-01-05T22:05:12.640Z","repository":{"id":62424238,"uuid":"154048008","full_name":"SuperDisk/lang-music","owner":"SuperDisk","description":"A music notation language","archived":false,"fork":false,"pushed_at":"2019-06-21T02:50:13.000Z","size":55,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-29T09:48:48.091Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Racket","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/SuperDisk.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}},"created_at":"2018-10-21T20:11:24.000Z","updated_at":"2024-12-03T01:31:11.000Z","dependencies_parsed_at":"2022-11-01T18:01:04.639Z","dependency_job_id":null,"html_url":"https://github.com/SuperDisk/lang-music","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperDisk%2Flang-music","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperDisk%2Flang-music/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperDisk%2Flang-music/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperDisk%2Flang-music/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SuperDisk","download_url":"https://codeload.github.com/SuperDisk/lang-music/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245206459,"owners_count":20577578,"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":[],"created_at":"2024-12-01T09:16:30.354Z","updated_at":"2026-01-05T22:05:12.609Z","avatar_url":"https://github.com/SuperDisk.png","language":"Racket","funding_links":[],"categories":[],"sub_categories":[],"readme":"# #lang music\n\nis a project that Michael Gunantra and I did for IU's P424 Advanced Functional Programming class. It's a music notation language inspired by MML, but instead of manipulating and concatenating strings, it's a structured language with full support for manipulating notes and bars.\n\nIt was done in Racket and outputs MIDI data. The playback routine is still a little buggy but it's a fun prototype to play with nonetheless.\n\n# How do I use this?\n\nThe idea behind composing in **#lang music** is that a song is a stream of notes, and you are given a few basic \"primitive\" streams of notes with which you can build bigger compositions. The primitive \"notes,\" which are really just songs with a length of one note, are **a** through **g**, followed optionally by a sharp sign, duration, and dot.\n\nA sharp brings the note up by one semitone, a duration specifies the length of the note (half, quarter, etc), and the dot increases the duration by half of its value, like in regular old music notation.\n\nHere's the \"docs.\" I'll probably eventually make some proper Scribble docs but here's a list of functions:\n\n    (defun \u003cname\u003e (\u003carg\u003e ...) \u003cseq\u003e ...)\n    \nDefines a musical function. Return a list of sequences. Any call to a function defined with `defun` will be considered a sequence.\n    \n    (seq \u003cseq\u003e ...)\n    \nSequences notes. Most blocks do this by default, but this can be useful inside a `together` to allow for serial note playback again.\n    \n    (drumseq \u003cseq\u003e ...)\n    \nSame as a regular `seq` except all notes played are on the drum track.\n\n    (loop \u003cnum\u003e \u003cseq\u003e ...)\n    \nLoops the sequences `num` number of times. If `num` is zero, then loop the sequences infinitely.\n    \n    (octave+ \u003cnum\u003e \u003cseq\u003e ...)\n    \nBrings up the provided sequences by `num` octaves. `num` can be negative.\n    \n    (semitone+ \u003cnum\u003e \u003cseq\u003e ...)\n    \nBrings up the provided sequnces by `num` semitones. `num` can be negative.\n    \n    (with-voice \u003cvoice\u003e \u003cseq\u003e ...)\n    \nSets the voices of the provided sequences. See `voices.rkt` for what voices you can use.\n    \n    (together \u003cseq\u003e ...)\n    \nPlays the provided sequences simultaneously. Plays until the shortest provided sequence runs out of notes, upon which the other sequences will be cut short.\n    \n    (play \u003cseq\u003e ...)\n    \nConverts sequences into MIDI control data.\n    \n    (dump-to-midi \u003cfilename\u003e \u003cmidi-control-data\u003e)\n    \nConverts MIDI control data into a MIDI file.\n\nSome other niceties:\n\n`\u003e` and `\u003c` aren't the greater than and less than operators anymore (use `lt?` and `gt?` instead), they function as \"notes\" that bring the current octave up and down respectively. You can also use `r` for resting in the style of a regular note, and `o?` where `?` is in the range of 0-5 to set the octave explicitly.\n\n# Example\nHere's an example tune programmed by Michael, the intro to _Sweet Child 'O Mine_.\n\n    #lang music\n    \n    (defseq lead1\n      \u003e r8 d8 a8 \u003c g8 \u003e g8 a8 f#8 a8 \u003c)\n\n    (defseq lead2\n      d8 \u003e d8 a8 \u003c g8 \u003e g8 a8 f#8 a8 \u003c)\n\n    (defseq lead3\n      e8 \u003e d8 a8 \u003c g8 \u003e g8 a8 f#8 a8 \u003c)\n\n    (defseq lead4\n      g8 \u003e d8 a8 \u003c g8 \u003e g8 a8 f#8 a8 \u003c)\n\n    (defseq lead5\n      \u003e e8 a8 d8 a8 e8 a8 f#8 a8\n      g8 a8 f#8 a8 e8 a8 d4 \u003c)\n\n\n    (defseq bass1\n      d\n      d\n      e\n      e\n      g\n      g\n      d\n      d2. r8 \u003c \u003c  r32 d32 f#32 \u003e a32 \u003e)\n\n    (defseq bass2a\n      \u003c \u003c d4. \u003e f#4. f#8 g8 \n      \u003e a4 b8 a8 \u003c g8 f#8 d8 \u003c r32 c32 e32 g32\n      c2 \u003e g2\n      \u003e d8 c4 d4. c8 \u003c \u003c r32 g32 \u003e b32 d32\n      \u003c g2. \u003e r8 r32 g32 \u003e b32 d32\n      g)\n\n    (defseq bass2b\n      \u003c \u003c f#2. r4\n      r\n      d2 r2\n      r\n      \u003e b2. r4\n      \u003e b\n      )\n\n    (defseq bass2c\n      \u003c a2. r4\n      r\n      g2 r2\n      r\n      \u003e d2. r4\n      \u003e d  \u003c\n      )\n\n    (defseq bass3a\n      \u003c \u003c d\n      d \u003e \u003e)\n\n    (defseq bass3b\n      \u003c a\n      a \u003e)\n\n    (defseq bass3c\n      \u003c d\n      d \u003e)\n\n    (dump-to-midi\n     \"sweet.mid\"\n     (play\n      (together (with-voice electric-guitar-clean (seq (loop 8 lead1)\n                     (loop 2 lead2)\n                     (loop 2 lead3)\n                     (loop 2 lead4)\n                     (loop 2 lead2)))\n                (with-voice electric-bass-finger bass1)\n                (loop 0 (with-voice side-stick (drumseq lead1)))\n                )\n\n      (together (seq (loop 2 lead2)\n                     (loop 2 lead3)\n                     (loop 2 lead4)\n                     lead5)\n                (seq bass2a bass3a)\n                (seq bass2b bass3b)\n                (seq bass2c bass3c)\n      )))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperdisk%2Flang-music","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperdisk%2Flang-music","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperdisk%2Flang-music/lists"}