Getting Started

ccampbell edited this page Apr 12, 2012 · 6 revisions

This tutorial walks you through making your first chiptune.
First make sure that you have installed mmlx and that you have Nestopia installed.

  1. On your computer create a directory named mmlx and a directory named mml

  2. Make sure that Nestopia is set up as the default application to open .nsf files

  3. From your terminal run the following command:

    mmlx --watch path/to/mmlx:path/to/mml --open-nsf --create-mml 1

Make sure that you use relative paths here

  1. Create a new file at mmlx/myfirstchiptune.mmlx:

    #TITLE My First Chiptune
    #COMPOSER Your Name
    #PROGRAMER Your Name
  2. Save the file

  3. In your terminal window you should see something like this:
    Screen shot

  4. You will see the generated MML file and NSF file in the mml directory. Also the file should open automatically in Nestopia, but there is nothing to play. Let's go ahead and create a few instruments by adding the following to mmlx/myfirstchiptune.mmlx:

     * Instruments
        adsr: 0 10 10 30
        timbre: 2
        max_volume: 12
        adsr: 0 10 7 30
        timbre: 0
        vibrato: 2 4 4
        volume:  10 8 6 4 2 0
        q: 4
  5. Save the file. If you look at mml/myfirstchiptune.mml you will notice that it hasn't changed. This is because instruments are only generated in the mml file when they are used in your song. This allows you to create a big list of instruments and include it with every mmlx file you make without having to worry about clogging up your generated mml files.

  6. Let's set the tempo to 110 BPM and add our first voice on the pulse wave channel A:

    ABCD t110
    // pulse wave channel
    A o4 @square-wave-piano c d e f g a b > d c1

    The @square-wave-piano declaration is telling this voice to use that instrument.

  7. Save the file. The NSF should be generated and should open with Nestopia. At this point you should finally hear some music.

  8. Let's go ahead and add the rest of the voices:

// pulse wave channel
B o3 @guitar e f g a b > c d f e1

// triangle wave channel
C o4 @bass c1 g1 c2

// noise channel
D @drum e [f16]4 f8 e f8 f f f8 e8 [f32]8 f
  1. Save the file and you are done! Now this song is in C major... what if you wanted it to be in Bb major instead? Easy. You can add the following line at the top of the file underneath the #PROGRAMER Your Name line:
  1. Save the file again. You will notice that it is now transposed down a step!

Congratulations on making your first chiptune.

You can view the final MMLX file here:

You can view the generated MML file here:

You can listen to the final song here:

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.