TEAM a.r.g.

ATMlib Song Editor manual · v1.0.1

← Back to the editor

What is this?

The ATMlib Song Editor lets you compose chiptune music for the Arduboy and turn it into a .h file you can drop into your sketch. It runs in your browser. Nothing is uploaded anywhere: your song lives on your own computer.

ATMlib gives you four channels:

ChannelSoundGood for
CH0pulse wavelead melody
CH1square wavechords, harmony, second melody
CH2sawtooth wavebass
CH3noisedrums

Each channel plays one sound at a time, like a single instrument. That is the whole trick of chiptune: a small sound chip, clever tricks, and a lot of character.

The editor only makes songs. Sound effects will get their own editor.

Your first song in 5 minutes

When you open the editor you already get a small example song. Press Space (or the yellow Play button) to hear it. Press it again to stop. Now make your own:

  1. Press Reset or New in the top bar for a clean start. (Reset brings back the example, New gives you an empty song.)
  2. Open the Drums tab on the left. Press ▶ next to a few grooves until you find one you like, then drag it onto the CH3 lane at the top. Drag it a few times to repeat it.
  3. Go to the Patterns tab and press + Tone pattern. In the big piano roll at the bottom, click to put in some notes. Drag to the right while clicking to make a note longer.
  4. Open the Instruments tab and press Use next to an instrument, for example "Pluck lead". Press ▶ to hear it first.
  5. Drag your pattern from the Patterns list onto the CH0 lane. Press Play and listen.
  6. Open Export (top right), press Copy or Download, and you have your song file.
TipEverything can be undone with Ctrl+Z (Cmd+Z on a Mac). Try things out freely.

The screen

The editor has three columns and a top bar.

Top bar

Left column

Three tabs with the building blocks: Patterns (your own bits of music), Drums (ready-made drum parts and the drum kit) and Instruments (ready-made sounds).

Middle

The top half is the arrangement: four lanes, one per channel, where you line up your patterns in time. The bottom half is the pattern editor, where you write the notes of the pattern you have selected.

Right column

Three tabs: Song (name, tempo, loop, volume), Selection (details of whatever you have selected: transposition, instrument, effects) and Export.

Patterns

A pattern is a short piece of music, usually one bar or a few. You write it once and then place it in your song as often as you like. Placing the same pattern ten times costs almost nothing in the final file, so reuse is the way to keep songs small.

The length is counted in ticks. The editor uses 16 ticks per beat and 64 ticks per bar. A 64-tick pattern is one bar; a 128-tick one is two bars. The buttons 16, 32, 64 and 128 are shortcuts.

TipMost songs are easiest if every pattern is the same length (64 ticks). Different lengths are fine, but the lanes will then drift apart and you will need to keep an eye on them. Drum parts can be any length, for instance 36 ticks for a waltz.

Writing notes (the piano roll)

When a tone pattern is selected you see a piano roll. High notes are at the top, time runs left to right.

You want to…Do this
add a noteclick in an empty spot. Hold the button and drag right to make it longer
move a notedrag it
change its lengthdrag its right edge
delete a noteright-click it (or Shift+click)
hear a pitchclick on the piano keys on the left
snap notes more roughly or finelychange Grid (1, 2, 4, 8 or 16 ticks)
zoomthe Zoom slider

One channel can only play one note at a time. If you put a note on top of another, the new one wins and the old one is shortened. That is how the hardware works, and it is why chords need a trick (see Instruments).

Typing notes with the keyboard

Click once in the roll to place the red cursor, then use the computer keyboard like a piano:

 W E   T Y U   O P
A S D F G H J K L ;
C D E F G A B C D E

Each key you press writes a note at the cursor and moves the cursor on by the length of your last note. Z and X go down and up an octave (the current octave is shown above the roll). The arrow keys move the cursor left and right. Delete removes the note at the cursor.

The range is C2 to D7. That is 63 notes, and it is all the chip can do.

Drums

Good drums are hard to build by hand, so the editor comes with ready-made drum parts. Open the Drums tab:

Press ▶ to listen. Drag a part onto the CH3 lane to use it, or press + to add it to your patterns list first. A good rhythm: use a groove three times, then a "+ roll" version as the fourth bar.

Changing a drum part

Select a drum pattern and you get a grid instead of a piano roll. Every row is a drum sound (kick, snare, hats, crash…). Click a cell to put a hit there, click it again to remove it. Hold the button and drag to paint several. You can also type: each row shows a letter (K kick, S snare, H closed hat, O open hat, C crash…). Press a letter and a hit appears at the cursor.

Only one drum can sound at a time. If two hits land on the same tick, the last one wins.

The drum kit

The channel is noise, and every drum is a burst of noise that gets quieter. At the bottom of the Drums tab, Kit voices lets you change how loud a drum starts (vol) and how fast it dies away (slide, more negative is shorter). A change affects every pattern that uses that drum. Reset kit brings back the defaults.

Instruments

An instrument decides how each note sounds: how loud it starts, how it fades, whether it wobbles or arpeggiates. Without an instrument, notes just play at one steady volume.

The Instruments tab has ready-made ones, grouped as Lead, Chord, Pad, Bass, Drum and FX. Press ▶ to hear a short demo, Use to give it to the pattern you have selected (or to a new pattern if none is selected). You can also drag an instrument onto a block in the arrangement.

About chords

A channel plays one note at a time, so a "chord" is an arpeggio: the chip plays the notes of the chord one after the other so fast that your ear hears them together. The Chord instruments do this for you: write the root note (for instance D), pick "Chord stab (minor)" and you get D minor. Use the "maj", "minor", "Maj7" and "m7" versions to colour your harmony.

Making your own

Select a pattern, open the Selection tab and scroll to Instrument. Here you can change:

SettingWhat it does
Volumehow loud the note starts, 0 to 63
Fadea volume slide makes notes die away (a negative step) or swell (a positive one). A pitch slide makes the note rise or fall. "Every N ticks" makes the slide slower
GateArpeggio plays a chord quickly. Note gate makes the note sound for only a few ticks and then go quiet (staccato)
ModulationVibrato wobbles the pitch, tremolo wobbles the volume. Depth is how strong, rate is how fast
Glidethe pitch slides up or down by a semitone every few ticks
Cut note at its endsilences the channel when a note ends and a rest follows

Use ▶ Listen to test it. Copy as new keeps the original and gives you your own version.

CarefulAn instrument is shared by every pattern that uses it. If you change "Pluck lead", all patterns using "Pluck lead" change. Use Copy as new if you only want to change one pattern.

The arrangement

The lanes at the top are your song in time, from left to right. Each coloured block is a placement of a pattern.

Tone patterns go on CH0, CH1 or CH2. Drum patterns go on CH3. If you drop one on the wrong kind of lane, nothing happens.

Transposition

Click a block and open the Selection tab. Transpose shifts that placement up or down in semitones, without touching the pattern. Write a bass line once, then play it again two semitones higher for the chord change. The buttons add or subtract one octave (12).

Make this block unique

If a pattern is used many times and you want to change only one of them (say, a different last note in bar 4), press Make this block unique. That block gets its own copy to edit. The other blocks stay as they were.

Lanes of different length

In a looping song, all channels must be the same length so that they come back together. If one lane is shorter, the editor pads it with silence (the hatched area) when you export. You do not need to fill it yourself.

Effects

Besides the instrument, you can place single effects at a point in a pattern: a vibrato that starts halfway, a volume change, a pitch slide. Open the Selection tab and scroll to Effects in this pattern.

  1. Click in the piano roll where the effect should start, to place the red cursor.
  2. Choose the effect type and fill in its numbers.
  3. Press Add at cursor.

Effects show as small flags in the strip at the top of the piano roll. Drag a flag to move it. Click one to select it, and use the ✕ in the list to remove it. Most effects have an "off" version to switch them off again.

Rules of thumbAn arpeggio combined with transposition does not work as you would expect (the library adds the transposition twice). The note gate only works at transposition 0. The editor warns you in the Export tab when it sees these.

Listening

What you hear is made by the real ATMlib playroutine, so it should sound the same on your Arduboy (the Arduboy's tiny speaker will of course colour it).

Export and use in a game

Open the Export tab. The editor builds the song and tells you the size in bytes and the number of tracks. Fix anything shown in red (a problem that stops the export, for example a note that would go out of range after transposition). Yellow messages are warnings.

Press Copy or Download to get your .h file. Put it next to your sketch and use it like this:

#include "mysong.h"

void setup() {
  ATM.setTempo(35);   // use the tempo shown in the Export tab
  ATM.play(mySong);   // use your song's name
}

The name in ATM.play(…) is the Name from the Song tab.

The editor writes the song the way a human would: short macros like ATM_NOTE_A5 and ATM_DELAY(16), with comments, and tracks sorted so loops are seamless. There is also a "raw bytes (hex)" option if you only want the numbers.

Song settings that affect the export

Saving, opening and importing

TipSave a project file before you import or reset. Both can be undone with Ctrl+Z right afterwards, but not after you close the page.

Keyboard shortcuts

KeysAction
Spaceplay / stop the song
Ctrl/Cmd + Zundo
Ctrl/Cmd + Shift + Z or Ctrl + Yredo
A W S E D F T G Y H U J K O L P ;write a note (tone pattern)
Z / Xoctave down / up
K L S T G H O C Rwrite a drum hit (drum pattern): kick, long kick, snare, tight snare, ghost snare, hat, open hat, crash, roll
← →move the cursor by one grid step
Deleteremove the selected block, or the note / hit at the cursor
right-click or Shift+clickdelete a note

The keys only work when you are not typing in a text box.

Limits and good habits

Tempo and time

Time is counted in ticks. The tempo is the number of ticks per second. At tempo 35 a bar of 64 ticks lasts about 1.8 seconds. A rough conversion: tempo × 3.75 ≈ beats per minute.

Size

An Arduboy has very little memory, and the song takes space in it. The Export tab shows the size. To keep it small:

The editor already removes repeated commands and turns repeated bars into loops for you.

The chip's rules

Something is wrong

ProblemTry this
No soundCheck that your computer is not muted. Press Play once more. Check that the lane's button does not say "muted". Some browsers only allow sound after you click on the page.
A lane is emptyIs a tone pattern on a tone lane and a drum pattern on CH3? A pattern with no notes makes no sound.
Notes sound very plainThe pattern has no instrument. Pick one in the Instruments tab.
I cannot drop a pattern on a laneDrum patterns only go on CH3, and tone patterns only on CH0 to CH2.
The Export tab shows a red messageRead it: it names the pattern and the problem, for example a note that is out of range after transposition.
I changed something and it affects everythingPatterns and instruments are shared. Use "Make this block unique" or "Copy as new". Ctrl+Z undoes it.
The last note of my one-shot song is cut offAdd a rest at the end, or tick "Loop forever".
I lost my song after clearing browser dataAutosave lives in the browser. Use Save to keep a project file.

Made by TEAM a.r.g. If this tool is useful to you, a coffee is always welcome:

☕  Cool tool? Buy us a coffee