Sinus' Branch of Impulse Tracker to AGI Sound
Version 0.2.7
Author: Adam Skawiński and Nat Budin
2025
| Latest Version: | 0.2.7 | ||
|---|---|---|---|
| Release Date: | 2025-05-19[1] | ||
| Company: | Template:N/A | ||
| Development Status: | {{{DevStatus}}} | ||
| Publication Status: | Published | ||
| Developer(s): | Adam Skawiński, Nat Budin | ||
| Interface: | CLI | ||
| Language: | Perl | ||
| Open Source: | Open | ||
| Source Availability: | Yes | ||
| License: | None | ||
| Type: | Template:FanAGISoundConverter | ||
| Relevant Engine: | AGI2 | ||
| Platform: | Windows, Linux | ||
| Localization: | English | ||
| Website: | https://github.com/SinusPi/any2agi | ||
A.K.A.
- ANY2AGI
Description
Adam 'Sinus' Skawiński's branch of Nat Budin's Impulse Tracker to AGI Sound Perl script adds support for noise channel and more input formats (now: IT, MOD and MIDI), as well as some quality-of-life options.
The Perl language runtime is required to run. Input music files may be created with ImpulseTracker, OpenMPT or any MIDI editor.
Features
Input formats:
- Impulse Tracker (.it)
- Protracker (.mod) - basic support only, no tempo support yet
- MIDI (.mid) - input needs to have monophonic tracks or channels, no tempo support yet
Notes
The PCjr sound chip supports only 3 voices and 1 noise channel, so you'll have to use the first 4 channels of an IT file, or use --channels to cherry-pick.
Noise notes are: C-0 (high buzz), C#0 (mid buzz), D-0 (low buzz), D#0 (borrow buzz), C-1 (high noise), C#1 (mid noise), D-1 (low noise), D#1 (borrow noise). "Borrowed" notes play frequencies borrowed from the third channel, though not very precisely. They're good for special effects like explosions or zaps, though, if you play a series of appropriate notes on channel 3 (probably with a volume of 0).
On PC Speaker, only the first channel will be used, other channels will be ignored. Keep that in mind when making your input files. Of course you can also make two separate files, one monophonic for PC Speaker, and one multichannel for PCjr, and play them appropriately from within your game, by checking AGI var 22 - but watch out for memory limits.
If you're writing an IT file from scratch, set tempo to 150 and speed to 1. This will give you a perfect match for the AGI engine's 60 ticks per second, and 16.67 ms per tick.
Requirements
Usage
To convert music, type this from the command line:
perl it2agi <name>
The script will produce a file called "<name>.ags".
Options
--channels x,x,x,y- select input channels. Default is--channels 1,2,3,4to output first four channels, with the last being used as noise.--channels 1,2,3would simply omit the noise channel. You'll probably have to use this to pick channels out of multi-channel input files, or rearrange them to put the noise channel last. Midi channels are numbered from 0.
--tempo-exact- force exact tempo, at the cost of jittery playback. AGI engine plays using 1/60s ticks, so any playback must either use equal note lengths (at the cost of a different BPM from the original - by default), or try to match the original's BPM exactly by using varied note lengths. MIDI conversion uses exact tempo matching only.--auto-drum-offs n- automatically terminate notes on the noise channel afternticks. Useful when converting input files that use short samples and don't bother terminating them, which would turn into long noise notes in AGI.--instr-note x y- force instrumentxto play only notey. Useful to force a drum-like instrument to play only valid AGI drum notes. Typical notes are 13 (high noise), 14 (middle noise) and 15 (low noise). Combined with--channelsto properly map an input channel to the noise output, and--auto-drum-offsto make output drums shorter, this option can turn a typical "rhythm channel" in the input into proper noise channel output for AGI.--instr-shift x y- shift (transpose) instrumentxbyysemitones. Use when input samples were recorded in a weird pitch, and notes in the input were written to match that. Or, use +12 or -12 to transpose by an octave.
Version History
- 0.2.1: Added recognizing MOD, S3M and XM modules, and MIDI files. They're not (yet?) supported, but recognized.
- 0.2.2: Experimental option --channels added
- 0.2.3: Tempo mode added: --tempo-exact
- 0.2.4: Auto drum note-offs added: --auto-drum-offs 1/2/3...
- 0.2.5: very basic MOD and MIDI support added
- 0.2.6: --auto-drum-offs now use AGI ticks for scale, not rows; --instr-drum added
- 0.2.7: --instr-drum changed to --instr-note, and --instr-oct to --instr-shift
Development Status
Last updated: 2025-05-29.
Download
Download from here:
Known issues
- IT2AGI doesn't (yet) support changing tempo or speed in the middle of the song. Don't try this, as it will be cruelly ignored.
- Finally, AGI is very limited in what it can do. If AGI doesn't support something, IT2AGI most likely doesn't either.
Credits
References
Also See