_____ | ___| __ ___ _ __ ___ | |_ | '__/ _ \| '_ ` _ \ | _|| | | (_) | | | | | | |_| |_| \___/|_| |_| |_| _____ _ ____ _ _ _ _ | ___|_ _ _ __ ___ (_) ___|| |_ _ _ __| (_) ___ | |_ ___ | |_ / _` | '_ ` _ \| \___ \| __| | | |/ _` | |/ _ \ | __/ _ \ | _| (_| | | | | | | |___) | |_| |_| | (_| | | (_) | | || (_) | |_| \__,_|_| |_| |_|_|____/ \__|\__,_|\__,_|_|\___/ \__\___/ ____ ____ ____ _ _ _ / ___| __ ) / ___|| |_ _ _ __| (_) ___ | | _| _ \ \___ \| __| | | |/ _` | |/ _ \ | |_| | |_) | ___) | |_| |_| | (_| | | (_) | \____|____/ |____/ \__|\__,_|\__,_|_|\___/ [From FamiStudio to GB Studio] by TheOuterLinux (https://theouterlinux.gitlab.io) Last updated: 2025/01/14 The following is a tutorial on how to convert a MIDI file to a UGE file for use with GB Studio using cross-platform tools. Things get a little difficult at the end, but it is not too bad. GB Studio has its own piano-roll music editor that saves to UGE, but this tutorial assumes that you would rather either use a MIDI-friendly program or you found a MIDI file already made that you can make use of. Doing things this way is also helpful if you ever intend to port the game to a newer engine as MIDI can be easily opened and converted to MP3 or OGG with most modern digital audio workstations. This tutorial requires: - A MIDI file - FamiStudio - DOSBox - SoundClub for DOS - MilkyTracker - hUGETracker - GB Studio TIME SAVER WARNING: If you plan to create your own music from scratch, you can simple skip all of this mess by just using GB Studio's built-in music editor. You could also open a MIDI file with a program that uses a piano-roll editor and just copy what you see to GB Studio's paino-roll editor. Step 01: Create you MIDI ------------------------ The cool thing about MIDI is that most digital audio work stations support MIDI. The MIDI file format has been around for a very long time. If you are not "musically gifted" enough to create a *.MID, look for Creative Commons licensed MIDI music on the Internet. Step 02: Import MIDI file to 'FamiStudio' ----------------------------------------- Import your simple or complicated MIDI file to FamiStudio. This program will then "decimate" everything down to four channels with no notes layered on top of each other within each channel because this program is designed to create Nintendo Entertainment System (NES) music, which has similar requirements as Game Boy/Game Boy Color. Programs like OpenMPT do not do this for you. FamiStudio is cross-platform. The easiest way to install on a GNU/Linux system is to use flatpack. When you import a MIDI file, you will be asked about which channles or tracks to use for each of the available channels in FamiStudio. Note the area that says "MIDI Source" in the MIDI Import pop-up box. Click the down-arrow for each NES channel and scroll until you see tracks used in the MIDI file so as to assign one to each channel. Leave the noise part as "Channel 10" since CH10 in MIDI is for drums and FamiStudio seems to do a good job of handling this as far as translating drums to noise. Think of CH1 and CH2 as for co-leading instruments and CH3 as the bass or pad instrument. Maybe this will help you decide what to keep or get rid of and what to then assign to what channel... Pianos: Ch1 or Ch2 Chromatic Percussion: Ch1 or Ch2 Organs: Ch3 Guitars: Ch1 or Ch2 Bass: Ch3 Strings: Ch3 Brass: Ch3 for lower toned and Ch1 or Ch2 for higher toned Reed: Ch3 for lower toned and Ch1 or Ch2 for higher toned Pipe: Ch1 or Ch2 for most except maybe "Blown Bottle" of "Ocarina" Synth Lead: Ch1 or Ch2 Synth Pad: Ch3 Synth Effects: Ch3 Ethnic: Ch1 or Ch2 Percussive: Ch4 Sound Effects: Ignore unless super important and even then, Ch4 but you will have to find examples of sound effects or make your own. The GB Studio manual briefly mentions SFX. Drum Set: Ch4 Unfortunately, there is no "preview" for this. If you do not like the tracks picked for the channels, you will have to re-import the MIDI again and try different tracks. You could also open the MIDI file using another program, such as LMMS, and toggle tracks on and off to see what you want to keep; pick only three + the drum track if you have one. If you pick your three tracks and there are still empty "gaps," you can move patterns from on track to another in FamiStudio. You could also do this ahead of time using another MIDI-friendly program but if you are going to go that far, it may be wise to keep both that program and FamiStudio opened at the same time. And remember, we are only using FamiStudio for "decimation"; if a track or parts of a track apear too high or too low pitched, wait until you can change instruments or waveforms in GB Studio's built-in editor. It may also be wise to use GB Studio's music editor for the noise channel rather than expecting FamiStudio to always understand how to translate drums on MIDI channel 10, especially if a MOD/S3M/XM was converted to MIDI using something like the 'timidity' program, which treats all of the tracks as "piano." !!!IGNORE DCPM SAMPLES OPTIONS; SMALL AND SIMPLE 8-BIT WAV SAMPLES CAN BE ADDED USING GB STUDIO!!! Step 03: Save the imported MIDI again as a MIDI ----------------------------------------------- It may seem weird to import a MIDI file only to export it as a MIDI file again, but we are only using FamiStudio to for the automatic "decimation." When exporting, make sure to select instruments for each channel in a way that is very different from each other but you do not need to be exact with it in relation to the original MIDI file. Step 04: Import to the "decimated" MIDI file to 'SoundClub' for DOS ------------------------------------------------------------------- Why? Well, you need an easy way to convert the decimated MIDI file to a 4-channel MOD and SCLUB for DOS (via DOSBox) is the easiest and most cross-platform way that I know of. Step 05: Export MIDI to 4-channel MOD using 'SCLUB' Step 06: Extract instruments from GB Studio's example via 'MilkyTracker' ------------------------------------------------------------------------ When starting a GB Studio project, an example MOD file is also created. Open this MOD file using 'MilkyTracker,' a free and open-source, cross-platform, modular music tracker. Next, select each instrument, one at a time, and export them in the MilkyTracker format (*.xi), making sure to label the file-names so as to know what order to re-import in the next step. Step 06: Open the MOD using 'MilkyTracker' and change the instruments --------------------------------------------------------------------- When you open the MOD file and play it using MilkyTracker, you will notice that it still sounds the same from when inside of SCLUB for DOS. This means we will have to replace all of the instruments with the following setup... 01 Ch 1&2 - 25% Pulse 02 Ch 1&2 - 50% Pulse 03 Ch 1&2 - 75% Pulse 04 Ch 1&2 - 12.5% Pulse 05 06 07 08 Ch 3 - Random Waveform 09 Ch 3 - Ringy Waveform 0A Ch 3 - Sync Saw Wave 0B Ch 3 - Ring Saw Wave 0C Ch 3 - Pulse+Tri Wave 0D Ch 3 - Sawtooth Wave 0E Ch 3 - Square Wave 0F Ch 3 - Sine Wave 10 Ch 4 - Periodic Noise 1 11 Ch 4 - Periodic Noise 2 12 Ch 4 - Periodic Noise 3 13 Ch 4 - Periodic Noise 4 14 Ch 4 - Periodic Noise 5 15 Ch 4 - Periodic Noise 6 16 Ch 4 - Periodic Noise 7 17 Ch 4 - Periodic Noise 8 18 Ch 4 - White Noise B 19 Ch 4 - White Noise D 1A Ch 4 - White Noise F 1B Ch 4 - White Noise G 1C Ch 4 - White Noise H 1D Ch 4 - White Noise A 1E Ch 4 - White Noise C 1F Ch 4 - White Noise E Instruments on the first two channels will be 1-4, instruments on the third channel need to be 8-0F, and channel four is the noise channel. Also, MilkyTracker has a way to select channels and switch them around if for some reason this needs to be done. Instruments can be dragged- and-dropped from your system's own file-manager into MilkyTracker. You will most likely need to correct the instrument numbers in channels three and four. Channel four should only use C5 notes. Remove anything related to "8??" at the beginning of the MOD (Pattern 01); the only effects-related things at the beginning should be "C??" (volume) and "F??" (speed). Step 07: Import to 'hUGETracker' (v1.0.9) and save as UGE file -------------------------------------------------------------- At this point, you may be thinking "This is absolutely ridiculous," and you are correct. But until certain digital audio work stations allow MOD import and export, such as LMMS with a "GB Studio" compatibility option, (or when pigs fly) it is what it is. At this point, use hUGETracker's "Import GBT Player MOD..." option to import the MOD from Step 06. Next, save as a UGE file by just using the "Save As..." option. GB Studio accepts UGE files; HOWEVER, it can only either accept UGE files or MOD files, not both. If hUGETracker plays the music just fine, you know GB Studio will too. Make sure that the version of hUGETracker you use is either v1.0.9 (maybe newer?) for GB Studio v4 or v1.0.5 if using GB Studio v3.2.1 (I think). And, if you have not realized already, you technically could use hUGETracker if you know how to use a traditional modular music tracker instead of a piano-roll editor. The problem is channel three; hUGETracker recognizes that this channel and its instruments can be more customized than simply using what is assigned to channel three via the MOD method. Because of this, getting sound on CH3 is much harder than it needs to be. Having GB Studio's instruments added to the MOD before importing to hUGETracker makes CH3 work well enough. If you have an idea for something for a CH3 instrument, worry about it after things are working in GB Studio as it has its own piano-roll editor, waveform editor, subpattern editor, and so forth and is MUCH easier to use than hUGETracker. GB Studio's built-in music editor also saves to UGE. Step 07: Add UGE to your GB Studio project ------------------------------------------ Now, all you have to do is make sure that the saved UGE file created by huGETracker is inside of your project folder's "assets/music" directory and GB Studio should see it after launch or after using "File -> Reload Assets." If GB Studio acts like it will not play the UGE file, try switching the view from "Music" to something else and then come back to "Music" to try again. If you cannot see any listed UGE files and perhaps only MOD files while in the "Music" view, go to the "Settings" view and select "Music" on the side-panel or scroll down to the "Music" section and switch the setting from "MOD" to "UGE." Remember, you cannot currently use both UGE's and MOD's at the same time for music/sound effects.