{"id":13420808,"url":"https://github.com/Artefact2/libxm","last_synced_at":"2025-03-15T07:31:35.155Z","repository":{"id":8610657,"uuid":"10250877","full_name":"Artefact2/libxm","owner":"Artefact2","description":"A small XM (FastTracker II Extended Module) player library.","archived":false,"fork":false,"pushed_at":"2021-12-28T16:41:21.000Z","size":546,"stargazers_count":139,"open_issues_count":5,"forks_count":13,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-07-31T22:56:41.625Z","etag":null,"topics":["demoscene","fasttracker","mod","module","tracker","xm"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Artefact2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-23T18:47:33.000Z","updated_at":"2024-06-16T22:53:49.000Z","dependencies_parsed_at":"2022-09-06T23:11:46.277Z","dependency_job_id":null,"html_url":"https://github.com/Artefact2/libxm","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/Artefact2%2Flibxm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Artefact2%2Flibxm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Artefact2%2Flibxm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Artefact2%2Flibxm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Artefact2","download_url":"https://codeload.github.com/Artefact2/libxm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243701206,"owners_count":20333614,"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":["demoscene","fasttracker","mod","module","tracker","xm"],"created_at":"2024-07-30T22:01:41.808Z","updated_at":"2025-03-15T07:31:34.819Z","avatar_url":"https://github.com/Artefact2.png","language":"C","funding_links":[],"categories":["TODO scan for Android support in followings","Demomaking","Multimedia"],"sub_categories":["Audio \u0026 Synths"],"readme":"libxm\n=====\n\nA small XM (FastTracker II Extended Module) player library. Main\nfeatures:\n\n* Small size in mind; many features can be disabled at compile-time,\n  or are optimized out by the compiler if not used.\n\n* Timing functions for synchronising against specific instruments,\n  samples or channels.\n\n* Samples can be loaded and altered at run-time, making it possible to\n  use libxm with softsynths or other real-time signal processors.\n\nWritten in C11 and released under the WTFPL license, version 2.\n\nSize\n====\n\nThe playback routine (assuming the non-portable `.libxm` format is\nloaded, see `libxmize` below) fits in under 7KiB of compressed\nmachine code.\n\n~~~\nxzcrush libxmtoau\nfor x in *.xm; do libxmize $x $x.libxm; done\nrename .xm.libxm .libxm *.xm.libxm\nls *.{xm,libxm} | xargs -n 1 -P 16 xz -9ekf\nwc -c *.*xm *.*xm.xz libxmtoau.crushed\n\n 6810919 an-dream.libxm\n 5585551 an-dream.xm\n  109423 cerror-expatarimental.libxm\n   49240 cerror-expatarimental.xm\n  282590 drozerix_-_crush.libxm\n  121346 drozerix_-_crush.xm\n  581955 heritage.libxm\n  438340 heritage.xm\n\n 2855496 an-dream.libxm.xz\n 2876184 an-dream.xm.xz\n    4180 cerror-expatarimental.libxm.xz\n    4820 cerror-expatarimental.xm.xz\n   36060 drozerix_-_crush.libxm.xz\n   37276 drozerix_-_crush.xm.xz\n  201348 heritage.libxm.xz\n  201200 heritage.xm.xz\n\n    6833 libxmtoau.crushed\n~~~\n\nBinaries crushed with [`xzcrush`](https://gitlab.com/artefact2/xzcrush).\n\n`libxmize` and the non-portable format\n======================================\n\nThe `libxmize` binary can convert a standard `.xm` file to a\nnon-standard, non-portable representation of that module. The file\ngenerated by `libxmize` is usually a lot larger than the original\nmodule, but has better compressibility.\n\nIn addition, the non-portable format:\n\n* requires less code to load (`xm_create_context_from_libxmize()`\n  instead of `xm_create_context()`) and thus can be used to produce\n  smaller binaries. (See the size section above.)\n\n* requires significantly less memory to play back modules (only\n  kilobytes thanks to `mmap()`, see `libxmtoau` for an example).\n\nThe data generated by `libxmize` will not be readable:\n\n* On a different CPU architecture\n* On a different libxm commit\n* On a libxm compiled with another compiler\n* On a libxm compiled with a different compiler version\n* On a libxm compiled with different options or CFLAGS\n\nExamples\n========\n\nSome example programs are provided.\n\n* [libxm.js](https://artefact2.github.io/libxm.js/) is a very simple\n  XM player/visualiser that runs in a browser (emscripten port).\n\n* `xmgl` is a simple music visualiser that uses OpenGL and JACK for\n  very precise audio synchronisation. See a demo here:\n  \u003chttps://www.youtube.com/watch?v=SR-fSa7J698\u003e\n\n* `xmprocdemo`: see [README](./examples/xmprocdemo/README.md)\n\n* `xmtoalsa` is a simple player that uses the ALSA library. It\n  produces `xmp`-like output while playing. Use `xmtoalsa --help` (or\n  check the source) to see the full usage.\n\n  ~~~\n  ./xmtoalsa --random **/*.xm\n  ~~~\n\n* `xmtowav` will play a module and output a `.wav` file.\n\n  ~~~\n  ./xmtowav my_module.xm my_module.wav\n  ~~~\n\n* `xmtoau` will play a module and output a `.au` file to standard\n  output.\n\n  ~~~\n  mpv \u003c(./xmtoau my_module.xm)\n  ~~~\n\n* `libxmtoau` is similar to `xmtoau`, except that it loads\n  non-portable files generated by `libxmize`.\n\n* `xmbench` is a benchmark program.\n\nHere are some interesting modules, most showcase unusual or advanced\ntracking techniques (and thus are a good indicator of a player's\naccuracy):\n\n* [Cerror - Expatarimental](http://modarchive.org/module.php?136603)\n* [Lamb - Among the stars](http://modarchive.org/module.php?165819)\n* [Raina - Cyberculosis](http://modarchive.org/module.php?165308)\n* [Raina - Slumberjack](http://modarchive.org/module.php?148721)\n* [Strobe - One for all](http://modarchive.org/module.php?161246)\n* [Strobe - Paralysicical death](http://modarchive.org/module.php?65817)\n\nStatus\n======\n\nEffects\n-------\n\n~~~\n Status |##| Eff | Info | Description\n--------+--+-----+------+------------------------------\nDONE    |00|  0  |      | Arpeggio\nDONE    |01|  1  |  (*) | Porta up\nDONE    |02|  2  |  (*) | Porta down\nDONE    |03|  3  |  (*) | Tone porta\nDONE    |04|  4  |  (*) | Vibrato\nDONE    |05|  5  |  (*) | Tone porta+Volume slide\nDONE    |06|  6  |  (*) | Vibrato+Volume slide\nDONE    |07|  7  |  (*) | Tremolo\nDONE    |08|  8  |      | Set panning\nDONE    |09|  9  |      | Sample offset\nDONE    |10|  A  |  (*) | Volume slide\nDONE    |11|  B  |      | Position jump\nDONE    |12|  C  |      | Set volume\nDONE    |13|  D  |      | Pattern break\nDONE    |14|  E1 |  (*) | Fine porta up\nDONE    |--|  E2 |  (*) | Fine porta down\n        |--|  E3 |      | Set gliss control\nDONE    |--|  E4 |      | Set vibrato control\nDONE    |--|  E5 |      | Set finetune\nDONE    |--|  E6 |      | Set loop begin/loop\nUNTESTED|--|  E7 |      | Set tremolo control\nDONE    |--|  E9 |      | Retrig note\nDONE    |--|  EA |  (*) | Fine volume slide up\nDONE    |--|  EB |  (*) | Fine volume slide down\nDONE    |--|  EC |      | Note cut\nDONE    |--|  ED |      | Note delay\nDONE    |--|  EE |      | Pattern delay\nDONE    |15|  F  |      | Set tempo/BPM\nDONE    |16|  G  |      | Set global volume\nDONE    |17|  H  |  (*) | Global volume slide\nDONE    |20|  K  |      | Key off              (Also note number 97)\nDONE    |21|  L  |      | Set envelope position\nDONE    |25|  P  |  (*) | Panning slide\nDONE    |27|  R  |  (*) | Multi retrig note\nDONE    |29|  T  |  (*) | Tremor\nDONE    |33|  X1 |  (*) | Extra fine porta up\nDONE    |--|  X2 |  (*) | Extra fine porta down\n~~~\n\nVolume effects\n--------------\n\n~~~\n Status |  Value  | Meaning\n--------+---------+-----------------------------\nDONE    | $10-$50 | Set volume (Value-$10)\nDONE    | $60-$6f | Volume slide down\nDONE    | $70-$7f | Volume slide up\nDONE    | $80-$8f | Fine volume slide down\nDONE    | $90-$9f | Fine volume slide up\nDONE    | $a0-$af | Set vibrato speed\nDONE    | $b0-$bf | Vibrato\nDONE    | $c0-$cf | Set panning\nDONE    | $d0-$df | Panning slide left\nDONE    | $e0-$ef | Panning slide right\nDONE    | $f0-$ff | Tone porta\n~~~\n\nKnown issues\n------------\n\n* Only loads FastTracker II-compatible XM files.\n\n* Loading a bogus file (that yet has a valid 60-byte header) will\n  probably result in a segmentation fault.\n\n* Big endian architectures are not yet supported.\n\nTests\n=====\n\nSome test XM files are in the `tests` directory. Their goal is to test\na certain feature against regressions. A summary of tests (and what\nthey are supposed to test) is in the table below.\n\n~~~\n     Test                      |     Status     |     Tested against     | Extras\n-------------------------------+----------------+------------------------+------------------------------------------------\namiga.xm                       | FAIL           | MilkyTracker, xmp      | Should sound identical.\narp-slow.xm                    | FAIL           | MilkyTracker, OpenMPT  | Should sound identical.\nautovibrato-turnoff.xm         | PASS           | MilkyTracker           | Same pitches should be heard twice in a row.\nfadeout-speed.xm               | PASS           | MilkyTracker           | Should sound identical.\nfinetune.xm                    | PASS           | MilkyTracker           | Left and right channels should sound identical.\nghosts.xm                      | FAIL           | MilkyTracker           | Left and right channels should sound identical.\nmultiretrig-volume.xm          | PASS           | FT2, OpenMPT           | Should sound identical.\nnote-delay-ghost.xm            | PASS           | MilkyTracker, FT2      | Should sound identical.\nnote-delay-retrig.xm           | PASS           | MilkyTracker           | Should sound identical.\npanning-law.xm                 | PASS           | MilkyTracker, FT2clone | Should sound identical.\npattern-loop-quirk.xm          | PASS           | MilkyTracker           | Should play the same notes at the same time.\npos_jump.xm                    | PASS           | Milkytracker, OpenMPT  | Only one beep should be heard.\nramping.xm                     | PASS           | MilkyTracker           | If XM_RAMPING is ON, no loud clicks should be heard.\nramping2.xm                    | PASS           | MilkyTracker           | If XM_RAMPING is ON, no loud clicks should be heard.\nretrig-vol-fade.xm             | PASS           | MT, FT2clone, OpenMPT  | Should sound identical.\ntone-portamento.xm             | PASS           | MilkyTracker           | Should sound identical.\ntremolo.xm                     | PASS           | MilkyTracker           | Should sound identical.\ntremor.xm                      | PASS           | MilkyTracker           | Should sound identical.\nvibrato.xm                     | PASS           | MilkyTracker           | Should sound identical.\nvibrato-slow.xm                | PASS           | OpenMPT                | Should sound identical.\nvibrato-octave.xm              | PASS           | FT2clone, OpenMPT      | Should sound identical.\n~~~\n\nThanks\n======\n\nThanks to:\n\n* Thunder \u003ckurttt@sfu.ca\u003e, for writing the `modfil10.txt` file;\n\n* Matti \"ccr\" Hamalainen \u003cccr@tnsp.org\u003e, for writing the `xm-form.txt`\n  file;\n\n* Mr.H of Triton and Guru and Alfred of Sahara Surfers, for writing\n  the specification of XM 1.04 files;\n\n* All the MilkyTracker contributors, for the [thorough\n  documentation](http://www.milkytracker.org/docs/MilkyTracker.html#effects)\n  of effects;\n\n* All the people that helped on `#milkytracker` IRC;\n\n* All the\n  [libxm](https://github.com/Artefact2/libxm/graphs/contributors)\n  contributors.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArtefact2%2Flibxm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FArtefact2%2Flibxm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArtefact2%2Flibxm/lists"}