{"id":21651870,"url":"https://github.com/mignon-p/inty-midi","last_synced_at":"2025-03-20T04:06:48.799Z","repository":{"id":141895714,"uuid":"177486423","full_name":"mignon-p/inty-midi","owner":"mignon-p","description":"Convert MIDI files into IntyBASIC code for use on the Intellivision game console.","archived":false,"fork":false,"pushed_at":"2020-08-14T18:47:18.000Z","size":60,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-25T05:43:09.602Z","etag":null,"topics":["intellivision","intybasic","midi"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mignon-p.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","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":"2019-03-25T00:24:19.000Z","updated_at":"2020-09-29T09:10:54.000Z","dependencies_parsed_at":"2023-03-13T10:27:54.502Z","dependency_job_id":null,"html_url":"https://github.com/mignon-p/inty-midi","commit_stats":null,"previous_names":["mignon-p/inty-midi"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mignon-p%2Finty-midi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mignon-p%2Finty-midi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mignon-p%2Finty-midi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mignon-p%2Finty-midi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mignon-p","download_url":"https://codeload.github.com/mignon-p/inty-midi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244547606,"owners_count":20470103,"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":["intellivision","intybasic","midi"],"created_at":"2024-11-25T07:49:55.370Z","updated_at":"2025-03-20T04:06:48.760Z","avatar_url":"https://github.com/mignon-p.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"`inty-midi` is a program which will convert a [MIDI][1] file into a\nformat playable by [IntyBASIC][2] on an [Intellivision][3] game\nconsole.  Specifically, `inty-midi` generates an IntyBASIC file\ncontaining `MUSIC` lines, which can then be included in an IntyBASIC\nprogram with the `include` directive.  (Or, when given the `-m`\ncommand-line option, `inty-midi` generates a stand-alone IntyBASIC\nfile which will play the music when run.)\n\nIntyBASIC and the Intellivision support a maximum of three voices, or\nsix when the optional [ECS][4] component is used.  If the MIDI file\ncontains more than three voices (simultaneous notes), then `inty-midi`\nautomatically uses the ECS.  If more than six voices are used, then\n`inty-midi` will drop some notes to stay within the voice limit.\n`inty-midi` will also drop notes if they are outside the range\nsupported by IntyBASIC ([C2 to C7][5]).\n\nIntyBASIC has some support for drums, and `inty-midi` will convert any\nnote on [Channel 10][6] into an `M1` drum note.  (This has only been\nminimally tested.)  Notes on any other MIDI channel are played on one\nof the four IntyBASIC instruments: piano, clarinet, flute, or bass.\n(See \"Program Change\", below.)\n\n`inty-midi` reads the time signature from the MIDI file, and\nautomatically places a blank line in the output between each measure,\nto make the output somewhat more human-readable.  If the MIDI file\ndoes not begin with a complete measure, you'll need to help it out\nwith the `-p` option (see below).  `inty-midi` does not currently\nsupport changes in time signature, or changes in tempo, in the middle\nof a file.\n\nFor some example MIDI files and the resulting IntyBASIC files produced\nby `inty-midi`, see the [examples](examples) directory.\n\n## Usage\n\n```\nUsage: inty-midi [-i inst] [-m] [-p n] [-q n] input.mid output.bas\n       inty-midi -v\n    -i inst  use specified instrument (W, X, Y, or Z)\n    -m       include a main program in output\n    -p n     number of quarter notes in first measure (can be fractional)\n    -q n     quantize to 1/n notes (e. g. 16 for 16th notes)\n    -v       print version number and exit\n```\n\nThe `-i` option specifies an instrument.  If specified, this\ninstrument will override all of the Program Change messages (see\nbelow).  Instruments are:\n\n* W - Piano\n* X - Clarinet\n* Y - Flute\n* Z - Bass\n\nThe `-m` option outputs a complete, stand-alone IntyBASIC program,\nrather than an IntyBASIC fragment meant to be included from another\nprogram.  This can be useful for easily previewing the results of a\nconversion.\n\nIf the MIDI file does not start with a complete measure, `-p` can be\nused to specify the number of quarter notes in the first measure.\nThis number can be fractional, such as `0.5` for a single eighth-note\npickup.  Note that this only affects where blank lines are printed in\nthe output; it does not change how the music sounds.\n\nThe `-q` option can be used to quantize the MIDI file before\nconverting it.  For example, `-q 16` would quantize to sixteenth\nnotes, while `-q 32` would quantize to thirty-second notes.  See below\nfor more information about quantization.\n\n## Quantization\n\nInput to `inty-midi` must be [quantized][7].  If your MIDI file is not\nalready quantized, you can ask `inty-midi` to do it for you with the\n`-q` option (see above).\n\nThe following could all be signs that you need to quantize the input:\n\n* `inty-midi` fails with the error `Needs quantization`\n\n* `inty-midi` takes a long time to run (normally it should be almost\n  instantaneous)\n\n* the generated `.bas` file is huge\n\n* `as1600` fails with the error `Address overflow`\n\n* the resulting ROM crashes when run\n\nGenerally you want to quantize as much as possible (i. e. a `-q`\nparameter as small as possible) without losing notes or making the\nrhythm sound wrong.\n\nUnfortunately, the IntyBASIC music player does not handle triplets\nwell.  In order to play triplets accurately, while also playing\nsixteenth notes accurately, you would need to quantize to forty-eighth\nnotes, which generally is not quantized enough for good results.\n\n## Program Change\n\nIntyBASIC supports four instruments: Piano (W), Clarinet (X), Flute\n(Y), and Bass (Z).  `inty-midi` does its best to map the\n[General MIDI Program Change messages][12] to the four instruments:\n\n* Bass (33-40) maps to Bass (Z)\n* Reed (65-72) maps to Clarinet (X)\n* Pipe (73-80) maps to Flute (Y)\n* Everything else maps to Piano (W)\n\nThis feature has only been minimally tested.\n\n## Binary releases\n\nBinaries for Mac OS X, Linux, and Windows are available under the\n[releases][13] tab on GitHub.\n\n## Building from source\n\n`inty-midi` is written in [Haskell][8].  If you're familiar with\nHaskell, you already know how to build `inty-midi`.  `inty-midi` can\nbe built with either [Cabal][9] or [Stack][10].\n\nIf you're not familiar with Haskell, here's the quick-start:\n\n* Clone this repo (or download a source distribution from [releases][13])\n* [Install Stack][11]\n* In the top directory of this repo, run `stack --install-ghc install`\n* Wait a really long time (it only takes this long the first time)\n\nThis will copy `inty-midi` to the directory `~/.local/bin`.  (Or on\nWindows, `%APPDATA%/local/bin`.)  You can either put that directory on\nyour `PATH`, or copy the binary to wherever you want to have it.\n\nIf you get a weird-sounding error, such as `AesonException`, it\nprobably means your version of `stack` is not new enough.\n\n## Using the ECS\n\nIf your file requires more than three voices, you will need the ECS to\nrun your program.  If you are running on real Intellivision hardware,\nyou will need the physical [ECS][4] hardware component.\n\nIf you are using [jzIntv][14], you will need to have `ecs.bin` in your\nROM search path in order to enable emulation of the ECS.  To obtain\n`ecs.bin`, do the following:\n\n* Go to the [jzIntv home page][14], and download the latest jzIntv\n  source archive, which is currently [jzintv-20200712-src.zip][15].\n* Extract the zipfile you downloaded, and find the file\n  `jzintv-20200712-src/src/emscripten/fake_ecs.bin` within it.\n* Rename `fake_ecs.bin` to `ecs.bin` and copy it into a directory\n  which is on your ROM search path.\n\n## Alternatives\n\nThis is not the first program to convert MIDI files to IntyBASIC\nprograms.  AtariAge user \"decle\" previously wrote the program\n[MusoCheat][16], which does much the same thing.\n\nThe two programs take different approaches, so you may find one or the\nother more to your liking.  MusoCheat gives the user a lot more\noptions, although this may also require the user to do more work.\n`inty-midi` has very few options, and tries to \"do the right thing\"\nautomatically.\n\n[1]: https://en.wikipedia.org/wiki/MIDI\n[2]: http://nanochess.org/intybasic.html\n[3]: https://en.wikipedia.org/wiki/Intellivision\n[4]: https://en.wikipedia.org/wiki/Entertainment_Computer_System\n[5]: https://en.wikipedia.org/wiki/Scientific_pitch_notation#Table_of_note_frequencies\n[6]: https://en.wikipedia.org/wiki/General_MIDI#Percussion\n[7]: https://en.wikipedia.org/wiki/Quantization_%28music%29\n[8]: https://www.haskell.org/\n[9]: https://www.haskell.org/cabal/\n[10]: https://haskellstack.org/\n[11]: https://docs.haskellstack.org/en/stable/install_and_upgrade/\n[12]: https://en.wikipedia.org/wiki/General_MIDI#Program_change_events\n[13]: https://github.com/ppelleti/inty-midi/releases\n[14]: http://spatula-city.org/~im14u2c/intv/\n[15]: http://spatula-city.org/~im14u2c/intv/dl/jzintv-20200712-src.zip\n[16]: https://atariage.com/forums/topic/264422-musocheat-adequate-inty-music-for-non-musicians\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmignon-p%2Finty-midi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmignon-p%2Finty-midi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmignon-p%2Finty-midi/lists"}