Music Tracker
With the Music Tracker you compose the music for your game. A song is a list of rows that play one after another, from top to bottom. Each row has a column per channel (four tone channels and one noise channel) and a command column. Notes play with the song's instruments, each with its own wave, volume, envelope and LFOs.
It edits the .jms files in the Music folder. When you compile, the IDE turns them into the .jmu files that the Sound module loads. The scene editor uses them too: each room can have its own music.
There are three ways to open it:
- New Music, in the explorer menu (right-click) or on its button bar, or New, on the tracker's toolbar. It asks for a template and a name, creates the
.jmsand opens it. It goes into Music, or into the folder you have selected in the explorer. - Double-click a
.jmsin the explorer. - Home › View › Music, on the ribbon: it shows the tracker window (Music Editor), with the songs you already have open.
Each song opens in its own tab, and you can have several open. The tab shows a * while there are unsaved changes.
The Your first chiptune melody tutorial walks through the editor with screenshots: creating the song from a template, typing notes into the grid, tweaking an instrument, and playing it from your game.
A walkthrough
A short melody that loops in your game.
- Create the song. In the explorer, right-click Music › New Music. Pick the Chiptune lead template and press OK. Type a name, for example
Theme, and accept: the IDE createsMusic/Theme.jmsand opens it in the tracker. - Listen to it. Press
F5. The row that is playing turns green, and the meters in the status bar move with each channel.F8stops it. - Make room. Click row
007and pressInsfour times: four empty rows appear below it. - Record notes. Press REC. Click the Note cell of Tone 0 on row
008, and pressE,W,QandW. The tracker writesE-4,D-4,C-4andD-4with instrument00, the one selected in KEYBOARD, and moves down a row with each note. Press REC again to stop recording. - Listen again with
F5. The template comes with Loop song on: when it reaches theENDon the last row, the song goes back to row000. - Save with
Ctrl+S. While there are unsaved changes, the button reads Save ●. - Put it in your game. In a room of the scene editor, pick it in Room › Music (The room and the game tells you how). In a game written in code, load it with
Sound.loadMusic("Music/Theme.jmu"): see "From code" below. The IDE creates the.jmuwhen you compile.
Templates
New Music starts by asking for a template, in the New music — pick a template dialog:
| Template | What it has | Tempo (ms) | Row ticks | Loop song |
|---|---|---|---|---|
| Empty | A single row, with END. | 72 | 8 | No |
| Basic 4/4 beat | Eight rows that alternate a C-2 on Tone 0 and the snare on Noise. | 72 | 8 | Yes |
| Chiptune lead | The C major scale, from C-4 to C-5, on Tone 0, with a bass on Tone 1 and a second voice on Tone 2. | 72 | 6 | Yes |
| Battle theme | A fast ostinato on Tone 0, with bass and snare. | 48 | 4 | Yes |
All four come with the same instruments: 0 Pulse (pulse wave), 1 Bass (triangle), 2 Lead (saw) and 3 Snare (white noise, a short hit). Volume is 185, except in Battle theme, where it is 200. You can change everything afterwards.
Tools
| Button | What it does | Key |
|---|---|---|
| New | Creates a song: the same as New Music in the explorer. | |
| MIDI | Imports a MIDI file into the open song (see "Importing a MIDI file" below). | |
| Validate | Checks the cells and compiles the song, without saving it. If all is well, the status bar shows its compiled size (valid - 170 bytes); if not, a message says what is wrong. | F9 |
| Save | Saves the .jms. With unsaved changes it reads Save ●; with none, it is disabled. | Ctrl+S |
| Close Tab | Closes the tab. If there are changes, it asks whether to save them. | |
| ▶ (Play) | Plays the song from the start row: 000, or the one you mark in blue. If there are red cells, it doesn't play, and the status bar says how many there are. | F5 |
| ❚❚ (Pause) | Pauses the song; the second time, it resumes. | F6 |
| ■ (Stop) | Stops the song. | F8 |
| REC | Records: the notes you play with the keyboard are written into the grid (see "Entering notes"). | |
| Insert row | Inserts an empty row below the cursor. | Ins |
| Delete rows | Deletes the selected rows. One row always stays. | Shift+Del |
| Duplicate rows | Copies the selected rows right below them. | Ctrl+D |
| Pitch + and Pitch - | Raise or lower the selected notes of the tone channels by a semitone. They don't touch the noise channel. | Shift+↑ and Shift+↓ |
| +12 and -12 | The same, by an octave. | Shift+PgUp and Shift+PgDn |
| Piano | The octave the on-screen keyboard starts at, from 0 to 3. | Ctrl+← and Ctrl+→ |
Play, Pause, Stop and the three row buttons are icons: their tooltip says what they do. When raising or lowering notes, those that would go past 0 or 127 stay at the limit.
The grid
Rows and time
The song plays from top to bottom, row by row, until an END or the last row. Every row lasts the same: Row ticks ticks of Tempo (ms) milliseconds. With 8 ticks of 72 ms, each row lasts 576 ms. If Loop song is on, at the end it goes back to the Loop row.
Every fourth row is lighter, and every eighth row lighter still: they help you count bars. During Play, the row that is playing turns green and the grid follows it. Double-clicking the number of a row marks it in blue: Play starts there.
Channels
| Channel | What it plays | Its instruments |
|---|---|---|
| Tone 0 to Tone 3 | Notes, with a square, triangle, saw, pulse or sine wave. | Of type tone. |
| Noise | Noise: percussion and effects. | Of type noise. |
Each channel plays one note at a time: for a chord, put each note on a different channel.
The M and S buttons on each channel header mute it (M) or let it play alone (S): if any channel is on S, only those play. They help you hear a single line, and they are not saved. Alt+1 to Alt+4 and Shift+Alt+1 to Shift+Alt+4 do the same for Tone 0 to Tone 3.
The cells
Each channel has four columns:
| Column | What it holds |
|---|---|
| Note | The note, with its English name and its octave: C-4, F#3. Natural notes take a -, and C-4 is MIDI note 60. A MIDI number from 0 to 127 also works. OFF cuts the note that is playing, and --- is nothing. On Noise, the noise period, from N01 to N255: N01 is the highest and, the higher the number, the lower the sound. |
| Inst | The instrument, by its Id. Empty (..), the channel keeps the one it had. |
| Vol | The note's volume, from 0 to 255. Empty, the channel keeps the volume it had: the last Vol, or the instrument's if you have just changed instrument. |
| Dur | How long the note lasts, as a code from 01 to 15, counted from the start of the row. Empty, the note goes on until the next note or an OFF on the same channel. |
Dur codes 01 to 06 are 1 to 6 ticks; 07 is 8; 08, 10; 09, 12; 10, 16; 11, 20; 12, 24; 13, 32; 14, 48, and 15, 64. A long note can go past its row into the next ones.
Anything badly written gets a red underline, and the status bar says how many errors there are (● 2 errors). With errors, Play doesn't play.
The Cmd column
Cmd holds commands for the whole song. The cell drops down a list of examples: pick one and change the numbers. You can put several in a cell, separated by ;, and delay one within the row with @ and the tick: TEMPO 60; @4 VOL 120 changes the tempo when the row starts and the volume four ticks later. The tick goes from 0 to Row ticks minus one.
| Command | What it does | Values |
|---|---|---|
END | Ends the song. With Loop song, it goes back to Loop row. The rows below it don't play. | |
TEMPO ms | Changes Tempo (ms) from there on. | 1 to 255 |
VOL v | Changes the overall volume. | 0 to 255 |
STOPALL | Stops every channel. | |
TRANSPOSE n | From there on, the notes of the tone channels play n semitones higher, or lower if it is negative. TRANSPOSE 0 removes it. | -128 to 127 |
CHSTOP c | Stops channel c: 0 to 3 are the tone channels, and 4 is the noise channel. | 0 to 4 |
DUTY c v | Changes the duty of the pulse wave on channel c. | c: 0 to 3; v: 1 to 99 |
TSLIDE c target ticks | Slides the note playing on channel c to target over that many ticks. The target is a note (C-5), a MIDI number or a frequency (440hz, 65.406hz). | c: 0 to 3; ticks: 0 to 255 |
NMODE mode | Changes the noise mode: white, periodic, short or dark. | |
NENV ticks | On the noise channel, how long each hit takes to fade out, if its instrument has no envelope. | 0 to 255 |
NSLIDE period ticks | Slides the noise period to period over that many ticks. | period: 1 to 255; ticks: 0 to 255 |
NPER period | Changes the noise period. | 1 to 255 |
Entering notes
There are two ways:
- With the keyboard. Press REC and put the cursor on a Note cell. Each key writes its note, puts the instrument selected in KEYBOARD into Inst and moves down a row. Without REC, the keys only play.
- The keys are laid out like a piano:
Z X C V B N Mare the white keys of one octave, andS D G H J, the black ones;Q W E R T Y Uand2 3 5 6 7, the octave above. - The octave is the one shown as Input oct in the status bar:
Ctrl+↑andCtrl+↓change it, from 0 to 7. At 3, the default,ZisC-3andQisC-4. - On Noise, the keys write periods: from
N01(theZ) toN12(theM). - If the KEYBOARD instrument is not of the channel's type (a noise instrument on Tone 0, for example), the note is written without an instrument, and the status bar says so.
1writesOFFandBackspaceempties the note (---). Both move down a row, with or without REC.- Clicking a key of the on-screen keyboard is like pressing it.
- The keys are laid out like a piano:
- Typing the text. Press
F2on a cell (or, without REC, click the cell that is already selected), type and pressEnter. This is how you enter Inst, Vol, Dur and Cmd. If you have several rows of that column selected, the value goes into all of them.
Selecting, copying and undoing
- Click the number of a row to select the whole row; with
Shift, you select from the cursor's row down or up to that one. Dragging across the cells selects a rectangle. Delempties the selected cells.Ctrl+C,Ctrl+XandCtrl+Vcopy, cut and paste as tab-separated text. Pasting starts at the cursor, and if it doesn't fit, rows are added at the end.Ctrl+F5loops the selected rows. With a single row selected, it plays the whole song.Ctrl+Zundoes andCtrl+Y(orCtrl+Shift+Z) redoes, up to 99 steps per tab: notes, rows, instruments and settings.
Panels and options
SONG SETTINGS
| Field | What it is |
|---|---|
| Tempo (ms) | How long a tick lasts, in milliseconds, from 1 to 255. The lower it is, the faster the song. |
| Volume | The overall volume of the song, from 0 to 255. |
| Row ticks | How many ticks each row lasts, from 1 to 65535. |
| Loop song | With enabled ticked, when it reaches END (or the last row) the song goes back to Loop row and never ends. Ctrl+L toggles it. |
| Loop row | The row it starts again from. |
| Copy ms (seekMusic) | Copies to the clipboard the millisecond at which the cursor's row starts, for Sound.seekMusic (see "From code"). It takes the TEMPO commands in the Cmd column into account. |
Below it, a cheat sheet of the shortcuts.
KEYBOARD
The on-screen keyboard spans six octaves, starting at the C of Piano: at 3, the default, from C3 to C9. < and > move it by an octave. Click a key to hear it; with REC, it is also written. The keys you can play from the computer keyboard show their letter, and during Play the notes sounding on the tone channels light up.
The list next to < and > picks the instrument: the one the keys play with, and the one REC writes.
INSTRUMENTS
The table of the song's instruments. You can type in its cells, as in the grid; Type and Wave/Mode drop down their values.
| Column | What it is |
|---|---|
| Id | The instrument's number, from 0 to 255: the one you type in Inst. |
| Name | Its name. |
| Type | tone, for Tone 0 to Tone 3, or noise, for Noise. |
| Wave/Mode | For tone, the wave: square, triangle, saw, pulse or sine. For noise, the mode: white (white noise), periodic (a short repeating pattern: it sounds almost like a note), short (it sounds metallic) or dark (smoothed white noise: duller). |
| Volume | Its volume, from 0 to 255. |
| Duty | The pulse width, from 1 to 99. It only matters with the pulse wave. |
| Atk ms, Dec ms, Sus % and Rel ms | The ADSR envelope (see Edit instrument below). Sus % goes from 0 to 255, not in percent. |
| Vib Dep, Vib dHz and Vib dly | The vibrato: depth, from 0 to 255; rate, in tenths of a hertz, and delay, in ms. tone only. |
| PWM d:r:dly | An LFO on the duty: depth, rate and delay, separated by :. tone only, and only audible with pulse. |
| Trm d:r:dly | The tremolo, an LFO on the volume, in the same way. For tone and noise. |
| Slide | noise only: target:ticks. Each hit slides its period to the target over that many ticks. |
| Test | Click the > to hear it: it plays C-4, or N08 for noise instruments. |
The buttons on the header:
- Edit opens the selected instrument in Edit instrument.
- Add adds one:
Instrumentplus its number, of typetone, with apulsewave. - Dup copies the selected one, with a new Id and
copyat the end of its name. - Del deletes the selected one. If any cell uses it, it warns you first: those cells keep their Id, which no longer exists, and the song won't compile until you change them. A song must have at least one instrument.
Id numbers are never reused or renumbered: a new one is the highest plus one, and the Inst cells keep pointing at the same instrument.
Edit instrument
Edit opens the instrument in a dialog with the same values, shown visually and with sound preview. What you change sounds as soon as you play a key, and goes into the table when you press OK. Cancel, or Esc, leaves it as it was.
- Preset: a General MIDI family (from Piano to Sound Effects, plus Percussion (Drums) for noise instruments) and, in the list next to it, one of its instruments. When you pick it, the dialog loads its sound as a starting point. It keeps the Id and your name; if the instrument still has its default name, it takes the preset's.
- Name, Type and Wave: the name,
toneornoise, and the wave (for noise instruments, the mode). - OSCILLATOR: a drawing of the wave and two knobs, Volume (0 to 255) and Duty (1 to 99; hidden for noise instruments).
- ENVELOPE: the ADSR envelope. Atk ms is how long the note takes to rise; Dec ms, how long it takes to drop to Sus 0-255, the level it holds while it lasts (255 is its full volume), and Rel ms, how long it takes to fade out once cut. Drag the points of the graph (up to 4 seconds per segment) or type in the boxes (up to 65535 ms). With all four at 0, there is no envelope: a tone note plays at the same volume until it is cut.
- VIBRATO LFO (for
tone): drag across the strip: up and down changes the depth, and sideways, the rate, up to 12 Hz. Or type in Depth, Rate (in tenths of a hertz) and Delay (in ms). - NOISE SLIDE (for
noise, in place of the vibrato): Target and Ticks, the Slide column of the table. - PWM LFO (duty, pulse) (for
tone) and TREMOLO LFO (amplitude): Dep, Rate and Dly, like the vibrato. At full depth, PWM moves the duty 40 points up and down, and tremolo brings the volume down to silence. - PREVIEW: a two-octave keyboard, from
C-3toB-4. Click and drag across the keys. Test playsC-4(orN08, for noise instruments) and Stop releases it.
The status bar
- On the left: the cursor's row and the last row, the channel and column, the note in the cell (with its MIDI number), Cursor (the millisecond at which the row starts), the tempo, Input oct (the computer keyboard's octave) and Piano view (the on-screen keyboard's).
- In the middle: a meter per channel, from
CH0toCH3plusNSE, the noise channel. - On the right: the state.
● okor the errors,► playing @ 22kHz,■ stopped, the size after Validate