Quickly create open-source chiptune music

image

So, you make your game, add new features and test them. Yes, it turns out quite well. But something is missing - the game is too quiet. You need music. Of course, you can find and download free music from the Internet, but this is not a game dev, this is the use of someone else's work. So let's write our own music. This is how the music you wrote will sound [approx. lane: lower the volume before listening]:


This is what I did at the end of the tutorial.

We are going to write this chiptune music with no experience in making music. For this, a little creative ability and the ability to understand that the melody does not sound very correct are enough.

Making music is not easy. But not super complicated. Yes, you can become a musician and study the work of a composer, etc., but we make a hobby game, so we do not need such knowledge. I will step by step explain how to create music.

What do we need


This list contains only what is needed to write our “fast and dirty” chiptune. This is the minimum.

DAW - Digital Audio Workstation


DAW is a digital sound workstation. It is a digital version of one of these pieces:


Today, even professional recording studios use DAW , but they connect all the devices shown in the photograph to a computer.


Digital Audio Workstation

This is very convenient for you and me, because we do not need all this sophisticated equipment. Yes, we won’t even use a piano keyboard, just one mouse (I personally use only a laptop with a trackpad in development).

DAWs have many great features. They have piano keys, recording functions, MIDI functions, recording notes for playing with virtual instruments . They can export music in many different formats.

There are many different types of software. And most of them are not free. I don’t know why, but all game developers are not particularly willing to shell out DAW. Honestly, for a long time there were no alternatives: either you buy software, or you pirate it.

But not today. Now we can download the awesome free open-source DAW with full functionality. You can get Ardor here .

VST - Virtual Studio Technology Instruments


VST Instrument, as the name implies, is a virtual instrument. He plays notes sampled from a real instrument. A high-quality VST can store within hundreds of audio samples of the instrument that it simulates. Or he may have only a few. In general, the larger the file size, the more samples are contained inside.

VST plays notes from MIDI signals. In the old days, we had MIDI synthesizers that had an operating system. It was possible to play a MIDI note C3 ("before" a small octave), and the synthesizer played C3. You could order the synthesizer to play the sound of a piano or trumpet. You could play a note on a keyboard connected to a computer, or enter it into a sequencer in DAW.

But they sounded terrible. They are still hiding somewhere in your operating system and continue to sound terrible. But frankly, now they are much better than they were before.

VSTs replace horrible synthesizers with real instrument sounds. You can find any tool, and many of them are free. We use a couple of tools that are well suited for our “quick and dirty” project. They do not sample instruments, as, for example, a virtual tube does, because we will write chiptuns, but they sound better than the terrible MIDI that are still stored on your computer.

Puls



PULS

Download PULS here . This is a very simple synthesizer with very limited capabilities, which suits us, because we don’t really know what we are doing (but we will find out soon).

Blue arp


You can download it here . This is a VST, but it is not a tool . This is a “pattern sequencer”; can be considered its effect / plugin, which applies to other VSTs.


Screenshot Blue ARP

Essentially, it modifies the MIDI output, for example, holds a C3 note and turns it into a pattern of various notes. Correctly call it a MIDI Arpeggiator (MIDI Arpeggiator) .

Melody Generator 2


This freeware program was developed by Dirk Jan Powel as a complement to his article . It's hard to find, but I managed to find the link . This software will generate a tune for us.

Dirk Jan Powel is dead, which means that Melody Generator 2 most likely will not receive further development. Fortunately, he wrote the above article, and since the program’s help contains a lot of theory, it is hoped that some of the bored developers will continue to develop his amazing ideas.

Alas, the program is not available as a VST plugin, although it would be great (I give a hint to the developers). But she can create MIDI files, and if you remember that VST instruments simply play MIDI notes, then we will understand what we can do with it.

That's all. That is all we need. Four downloaded files.

Installation


Install Ardor, it’s not so difficult. It’s probably worth choosing the 32-bit version, because the VSTs described above are also 32-bit. You can build bridges so that 32-bit VSTs can work in 64-bit software, but I have not yet found a solution suitable for me. Most free VSTs are 32-bit, and if they have a 64-bit version, then a 32-bit build usually still exists. The 64-bit version provides access to a larger amount of RAM, which in our case is most likely not to be a limiting factor, but if you use one of these huge VSTs with gigabytes of samples for each instrument, you will need this amount.

Next, you need to put the VST files in the desired folder. Personally, I create a new folder and just tell Ardor to search there along with the usual folders there (we will talk about this below).

That's all. Installation completed.

Customization


Ardor is usually very easy to configure. I am developing on Windows , so on Linux, the setup order may vary.

First run the program and create a New Session. You can select any folder to place it.


Select "Empty Template" and then "Open."

Then the audio configuration options will open. If you are unfamiliar with such things, then this part can be quite confusing.


As the Audio System , the default system should be selected.

Driver depends on which sound card you have. ASIO drivers have a low latency, that is, you can connect the electric guitar directly to the computer and use guitar effects in DAW. If you try to do this without ASIO, there will be a delay in the signal, measured in hundreds of milliseconds, which will greatly ruin the beat.

A good ASIO driver gives a delay of less than 40 ms. For fairly little money, you can purchase an external sound card that provides extremely low latency and allows you to connect a piano keyboard, microphones and guitars.

I won’t do any of this, because we simply play tracks recorded in MIDI signals, and so we’ll select MME.

Input Device - this parameter is not important, we will not record sounds.

The output device is also not very important here.

However, it is important to set the Sample Rate to 44.1kHz. We leave the rest unchanged. This is the only thing that is important, because this standard needs to be used for our music tracks.

Click on “Start” and most likely the program will not give any errors. Ardor starts up and searches for VST tools in folders. Then you will see something like this:


Ardor Editor

If this window does not appear, then find the "Editor" button in the upper right corner and click it.

Then we just need to tell Ardor where the VSTs are (unless you put them in one of the standard system folders). To do this, select Edit> Preferences from the menu . In the Preference window, select Plugins> VST in the left navigation menu , and then change the path ( Edit the path ) to the folder with VST.


Ardor VST Preferences

When done , click on the Editor in the upper right corner again . And that’s all, the program is tuned and ready to create music.

Recording a bass part


This is the easiest part, and to be honest, for some games and scenes you can end there.

Add a new MIDI track to the Ardor session. Just right-click and select Add Track, or select Track> Add Track, Bus or VCA ... from the menu .


Add New Track A

whole bunch of options will appear. Select Midi Tracks in the left pane , and then in the Instrument section of the main panel, select our simple PULS synthesizer (I have it called PULS_1_1). Having selected the tool, click “Add and Close”.

Now a new track has appeared in the editor. It can be expanded by moving the mouse to one of the edges until the resize cursor appears. A small keyboard should appear. Click on the mouse button. If you do not hear the sound, then something is wrong; write a comment on the original article and I will try to help you.

The selected track is highlighted in red, and a couple of small elements appear on the left side of the window.


Those same elements

There you will see PULS_1_1; double click on it. The VST window opens. All VSTs have a window, even the simplest ones. Often it has a strange interface created by the author of VST, and the controls are located without any logic or meaning. In fact, there are several VSTs that I could not use, because I did not understand how to manage them.

But each of these controls is related to what can be programmatically changed through MIDI controls. In fact, MIDI is not only the notes you play, but also a set of control signals. DAW like ArdorAllow you to transmit these signals using rendered curves and graphs. For example, you can gradually increase the sound or gradually twist some knob from 0 to 100 over several measures of music. (Who knows what this knob does? It's already a VST problem, and Ardor just sends the signals.)

If you have a midi controller, or if you purchase one, you can twist the knobs and attach them to the VST controls (so you start create that music studio, a photograph of which is presented at the beginning of the article). Over time, you may want to invest money in it, but not because you know how to play the piano, but because it simplifies listening to samples and adjusting parameters when writing a lot of music or when studying it in more depth.

Don't forget about all of these ways to control MIDI for the future if you want to experiment.

Well, back to the bass part. You should see the following picture:


PULS Window

You can customize these orange buttons as you like. Start playing one of these keys on the track in the main window to understand what you are doing. But play notes from C3 and lower, because we want to hear bass notes (scroll the keyboard down using the strange scrollbar to the left of the keys). Here are some suggestions:

  • OSC1 and OSC2 are frequency generators. They resemble a sine wave generator and create “noise”.
  • Effects are curious that each of these buttons includes a corresponding effect.
  • Release — , — , — .
  • LFO — (low-frequency oscillation), ; , , , . , , OSC, , . , — 100%, — 0%; , , . LFO , 100%, , ..

    VST- LFO. , . .
  • LFO Shape — , LFO. , ,
  • LFO Dest — LFO, .
  • LFO Speed — LFO. ,
  • LFO Depth —

After receiving the desired sound, you can close the VST window.

Now we need to add Blue ARP to our track . We need this because we absolutely do not know how music is written, and music is mathematics, and the computer is a large calculator, so he can definitely do it for us.

Right-click on the item box on the left and select New Plugin . Browse through all the additional menus and find BlueARP in them . The following confirmation dialog box appears:


Confirmation Dialog

Select Add . We do not want to replace the existing PULS tool , but want to add a new one. Actually, I would not call BlueARP a tool, but in the VST world there is not much difference.

See if VSTs can output signals as well as receive the output of other VSTs as input. They can be chained (it depends on whether the selected VST is capable of it) and create strange, delightful and amazing effects.

After selecting Add, the Blue ARP tool can open by itself. This is normal,
but first we need to move its element in the element field to the very top, before PULS. The item field will look like this:


Blue ARP before PULS

This tells the program that Blue ARP will output the signal to PULS. BlueARP will modify the MIDI notes we enter.

In the upper right corner of the Blue ARP window there is a drop-down list that says “01/12”; open this list and choose something else. After selecting, press a note on the keyboard, but do not release it.


Window Blue ARP

Wow! Sounds cool, right? I chose 51.

Of course, you can create your own, but you will need to study these controls well. Do it! Everything is not so complicated there, it’s just not included in the framework of the topic of fast music writing. Presets are quite enough for me.

Having received the sound we need, we can close the VST window. On the Ardor editor screen, you need to make sure that the small pencil icon is selected, and that the snap to grid on each measure is enabled. Let's set about 120 beats per minute and size 4/4.


Useful settings for us

Now click on the very beginning of our track and drag the field for about 20-25 seconds. In this project, you will need to create a shorter composition, but for the demonstration we will do everything quickly.

It is important that your field starts at each beginning of the track. It is worth clicking on about 20-25 seconds and go back to the beginning. Now when you move the mouse over this new field, you will see a green rectangle. It is in him that we will write a note.

Select a note from the beginning of the track, start from the very beginning, and drag it to the end. I chose F2. When finished, press the spacebar several times until you hear music playing.

Fine.

You can change the length of your note and add new notes. Do not superimpose them on each other and do not change them too often, because this is still a bass part. Here's what my path looks like:


My cool bass part

And that's where our bass is ready.

Create a melody


Let's leave Ardor in the background for a minute and open Melody Generator 2 . Compared to commercial software, this program is ugly.


Oh my god, well, chaos

But she copes with her task. The interface is confusing and inconvenient, but the results work, and the program itself is free. So here is what we will do.

Set the model to Attraction Model . You can experiment with others, I just picked up what gives the best results. In the Meter section of the left-most panel, you need to select the 4/4 size so that it matches the one specified in Ardor .

I created 12 bass bars in Ardor ; this can be understood by the thick white line running from top to bottom along the tracks. Also above the tracks in the Bar: Beats section are small numbers.


Bar: Beats

Therefore, set Nr Bars in Melody Generator 2 so that they match.

Then you need to change the Key in the Pitch Parameters panel to match this parameter to what we placed in the bass part. In fact, you can simply google the key of “F-Major” (“F Major”) to see which notes are included in “F Major”, etc .; you need to make the bass notes match the key. Be sure to select the key used in the bass part.

All other settings will remain unchanged for now. When we finish, we can play around with them and understand what they are doing.

Click on New Melody in the Melody Construction panel. Then, right below it, you can click Add complete part .

Boom! - now there is music in the window.


Music generated by magic

In the upper left panel, you can click on play . Sometimes during playback the window freezes, but it doesn’t matter, it comes to life when the music ends. If desired, you can change the MIDI instrument, but so far we are satisfied with the piano.

You can press other buttons in the Melody Construction panel to randomize the parts and regenerate them. There are a couple of options in the drop-down lists that say “No constraints”. When changing these options, the melody will be more repeating, and often this is what we need.

When finished, press Ctrl + M or select the menu item Melody> ExportAsMidi . Save the file somewhere.

Return to Ardor, select Session> Import from the menu and import the .mid file that we only imported from Melody Generator 2 . So far we do not need to change any import options. After that, two more tracks will be added - delete the second, it was for the second hand, which we did not generate in Melody Generator 2 (after all, the piano is played with two hands). To remove a track, right-click on it and select remove.

Now select our new track, which has notes. In the elements window add PULS to this track , you already know how to do it; but this time replace the existing tool. Also change the output from Master to out 1 + 2 .


Switch to 1/2

When finished with the setting, you can press the spacebar and listen to the new song!

Improving music


We will assume that when creating the bass part you observed a certain tonality; then both parts must be in order. You can try to regenerate the melodies until you get something suitable, or just move the individual notes in the melody up and down or delete them if you do not like them.

This part depends entirely on your tastes, but most likely you will still have to polish the melody. Let's do it.

Export


In Ardor, select Sesson> Export> Export to Audio File (s) . You can copy my settings, but the most important here is the file format. All other settings are already selected correctly.


Export Window Settings

Here are my results; the only thing I did was change two notes in the melody.


My composition, which I called "Embelish the detail of the lost" (take care of the ears).

Further steps


And that’s all it takes to quickly create tracks. But here's what you can do more:

  1. Experiment with the parameters of your software, find out how to create different random melodies, more energetic compositions (with more notes), compositions in minor with fewer notes.
  2. Download more VST tools. Using the same tools, you can even generate compositions resembling orchestral. There are tons of free VST tools on the Internet.
  3. Create longer music. Try repeating musical phrases repeatedly. You can change the phrase of one instrument while the rest remain the same, etc.
  4. Add more tools. Honestly, most often a small amount is enough.
  5. Learn more about making music. Keys, builds, etc. It's easy to figure this out if you can instantly hear the result in software.
  6. You will probably also need to learn how to stream music to your proprietary engine.



I hope you enjoyed exploring the possibilities of quickly creating chiptune music for games.

All Articles