{"id":16733224,"url":"https://github.com/krasjet/mint","last_synced_at":"2025-07-24T01:38:30.741Z","repository":{"id":98566588,"uuid":"286019072","full_name":"Krasjet/mint","owner":"Krasjet","description":"A C library to work with music intervals, (tonal) pitches, and transpositions","archived":false,"fork":false,"pushed_at":"2020-10-15T10:48:28.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T20:14:45.640Z","etag":null,"topics":["c","music-theory","parser"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Krasjet.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":"2020-08-08T10:09:34.000Z","updated_at":"2021-12-14T05:44:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"699c68e1-91e3-4601-a37e-6ed45a9fa77c","html_url":"https://github.com/Krasjet/mint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Krasjet/mint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Krasjet%2Fmint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Krasjet%2Fmint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Krasjet%2Fmint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Krasjet%2Fmint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Krasjet","download_url":"https://codeload.github.com/Krasjet/mint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Krasjet%2Fmint/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266780360,"owners_count":23983040,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["c","music-theory","parser"],"created_at":"2024-10-12T23:49:06.304Z","updated_at":"2025-07-24T01:38:30.721Z","avatar_url":"https://github.com/Krasjet.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"mint\n====\n\nmint is a C library to work music intervals, (tonal) pitches, and\ntranspositions.\n\nIt contains parsers that convert shorthand notation of music intervals [1] and\nscientific pitch notation into *invertible*, unambiguous representations of\nmusic intervals and tonal pitches.\n\nmint also comes with several utility functions to work with these\nrepresentations, e.g. it can\n\n- convert an interval into number of semitones\n- convert a pitch into MIDI representation\n- transpose a pitch in a way that distinguishes *enharmonically equivalent*\n  notes, i.e. it treats notes like `C#` and `Db` differently.\n- etc.\n\nThe documentation of this library is in `mint.h`, `pitch.h` and `transpose.h`.\n\nGrammar: interval\n-----------------\n\nThe BNF grammar for the shorthand notation is\n\n    interval ::= quality number\n    quality  ::= \"P\" | \"M\" | \"m\" | \"A\" | \"AA\" | \"d\" | \"dd\"\n    number   ::= positive_int\n\nwhere\n\n    P  = perfect\n    M  = major\n    m  = minor\n    A  = augmented\n    AA = doubly augmented      \u003c- yes, we support doubly augmented/diminished\n    d  = diminished\n    dd = doubly diminished\n\nFor example,\n\n    mint_to_st(mint_parse(\"M3\")) == 4   /* major third */\n    mint_to_st(mint_parse(\"m3\")) == 3   /* minor third */\n    mint_to_st(mint_parse(\"A3\")) == 5   /* augmented third */\n    mint_to_st(mint_parse(\"d3\")) == 2   /* diminished third */\n\nThis notation can be found in many music theory textbooks and references, but\nthey probably won't define it using the formal grammar above. It should be\ngenerally understood by musicians, though.\n\nGrammar: pitch\n--------------\n\nThe BNF grammar for the scientific pitch notation is\n\n    pitch       ::= pitch_class | pitch_class octave\n    octave      ::= integer\n    pitch_class ::= letter | letter accidental\n    accidental  ::= sharp | flat | 'x'\n    sharp       ::= '#' | '#' sharp\n    flat        ::= 'b' | 'b' flat\n\nwhere\n\n    #  = sharp\n    b  = flat\n    x  = double sharp\n\nBuild\n-----\n\nmint consists of three component:\n\n     +------+       +-------+\n     | mint |       | pitch |\n     +------+       +-------+\n          ^           ^\n          |           |\n          +-----------+\n          | transpose |\n          +-----------+\n\n`mint` and `pitch` are independent of each other, but `transpose` depends on\nboth `mint` and `pitch`.\n\nThis library does not have any external dependencies, even libc. Simply copy\nthe corresponding `.c` and `.h` files to your project and add, for example\n\n    #include \"mint.h\"\n\nto any source file using this library. You should be able to compile it with\nany C compiler compatible with C99.\n\nAlternatively, use\n\n    $ make install\n\nto install a static library to your system (path can be customized via\n`PREFIX`), then use\n\n    $ pkg-config --cflags mint\n    $ pkg-config --libs mint\n\nto get compiler and linker flags.\n\ntrx\n---\n\nmint also comes with a simple demo called `trx` for transposing pitch classes.\nRun\n\n    $ make trx\n\nto build it and then try the following in bash or zsh\n\n    $ ./trx Ab \u003c\u003c\u003c \"A3 m13\"\n    C# Fb\n\n[1]: https://en.wikipedia.org/wiki/Interval_(music)#Shorthand_notation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrasjet%2Fmint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrasjet%2Fmint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrasjet%2Fmint/lists"}