8-Bit Tracker
Total Page:16
File Type:pdf, Size:1020Kb
8-Bit Tracker (Version 1.0.1) 8-Bit Tracker is a powerful Unity Asset for creating digital sound effects and music in a similar style to the many retro computers and consoles that were available in the 1980s and 1990s. At its lowest level, 8-Bit Tracker generates sounds from simple waveforms with varying frequency (pitch) and amplitude (volume). At its highest level, it has support for blended waveforms, volume variation via ADSR envelopes (attack, decay, sustain and release), pitch changing, ornaments, noise generation, chorus and echo, and supports repeatable patterns of notes that can be arranged into any number of tracks to create an entire composition. The 8-Bit Tracker Track Editor Window Any sound or music created in 8-Bit Tracker is stored as a series of parameters in the component added to a scene. The audio itself can be generated at runtime to allow for complex pieces of music that take up far less size in the build than the corresponding raw audio data would. To put this into context, the example scene that comes with the asset contains two pieces of music and four sound effects. Exporting all of these as wave files would take up a total of 6.5Mb, whereas in the scene they take up only 92Kb. That’s over 70 times smaller! However, the option to export an 8-Bit Tracker composition to a wave file of any quality is also provided in case you want to import it as a normal audio asset into your project. Or of course you can use an exported wave file outside of Unity in whichever way you like. Example Scene The assets comes with an example scene that shows off some of the capabilities of 8-Bit Tracker. It contains two examples of music tracks that can be generated via the asset, and four examples of sound effects. Simply run the scene and click the buttons to hear the sounds. A screenshot of the example scene that comes with the 8-Bit Tracker How 8-Bit Tracker Works Sounds in 8-Bit Tracker are made using Instruments. The basis of an instrument is a waveform, such as a sine wave. Different waveforms make different sounds – for example a sine wave makes a smooth sound whereas a sawtooth wave makes a harsh, rasping sound. It’s worth experimenting with instrument waveforms to get the instrument sound you desire. Instruments also support blending of waveforms, volume and pitch variations, ornaments and chorus and echo effects. These are all described in detail in this document. A sine wave An instrument’s note can be played at any pitch, and an arrangement of notes at varying pitches is called a Pattern. Patterns are typically short sequences of notes that can be repeated to form a song. Patterns are then arranged in Tracks which support individual volume and transpose controls. Any number of tracks can be added, and the final 8-Bit Tracker audio is generated from merging all tracks together. So that’s the theory. Let’s get started! Adding an 8-Bit Tracker Component To use 8-Bit Tracker, simply add an 8-Bit Tracker component to a game object. The default component will look like this: An 8-Bit Tracker component with default settings The component is split into sections for building the various parts of 8-Bit Tracker audio. These sections are described individually in detail below. Note that throughout the inspector view of the component and inside the individual editor windows for instruments, patterns and tracks (more on these later), you will find buttons with question marks on them. This is contextual help – click these buttons to open up a window containing an explanation of the section they relate to. A help button Audio Source When a scene containing an 8-Bit Tracker component is run, the component automatically generates an audio clip of the song that has been created if and only if the game object has an Audio Source component on it too. If this is the case, the generated audio clip will automatically be added to the Audio Source. If this is not the case, nothing will happen when the scene is run, so a warning is displayed to remind you to add an Audio Source: A warning indicating an 8-Bit Tracker component must have an audio source to generate wave data at run-time Alternatively it is possible to export a wave file of the audio data in the Unity Editor before the scene runs to avoid having to generate wave data at run-time. In this case you can ignore the warning because you wouldn’t add an Audio Source otherwise you would have two copies of the audio. If you do export to wave, it is advisable to keep the original 8-Bit Tracker component somewhere, such as on an inactive game object, in case you ever need to change the audio and re- export it. See Exporting a Wave File further down for more details. General Settings The general settings shown in the inspector at the top of an 8-Bit Tracker component are as follows: • Name – This is where you can give your 8-Bit Tracker component a name so you can identify it. The name is also the default filename if a wave file is ever exported. • Tempo – This is the overall speed of the generated music in beats per minute, so higher values make the audio play faster. Tempo defaults to 120 beats per minute and can be set to between 10 and 1,000 beats per minute. • Frequency – This represents the quality of the generated audio. Higher frequencies produce better quality audio but take up more memory (and disk space if a wave file is exported) and take longer to generate. The frequency literally refers to the number of audio samples per second of sound. A number of default frequencies have been provided in the drop down – usually the default 44,100kHz which is the same quality as a CD is sufficient but you can select a different frequency or enter your own by clicking the Custom checkbox. Instruments Instruments are the basic building blocks of 8-Bit Tracker sounds. They work the same way a real-world instruments such as a piano or a guitar – they represent the way a sound is formed, and allow notes of any pitch to be played using them. Instruments can be given names and are listed in the inspector. There is an instrument editor window that is used to configure them. An example of some 8-Bit Tracker Instruments Each instrument has a name to allow you to identify it when it is associated with a pattern. You can configure the name directly in the inspector, and the following buttons are also available to control the instrument: • Moves the instrument up the instruments list. • Moves the instrument down the instruments list. Opens up the instrument editor window where you can configure what the • instrument sounds like. More details below. Duplicates the instrument and adds it to the end of the instruments list. This is • useful if you want to create a new instrument that sounds similar to an existing one. Deletes the instrument. This is only possible if the instrument is not associated • with any patterns. The Instrument Editor Window Clicking on the edit icon next to an instrument opens the instrument editor window, where instruments are configured. This window is split into sections, which are each covered below: Instrument Details Instrument details The instrument details section just contains the name of the instrument so you can identify and modify it. This is the same name that is shown in the inspector on the 8-Bit Tracker component. Waveform Waveform details In the waveform details section, you can configure the following settings: • Number of Waveforms – A basic instrument can generate its sound from a single waveform, such as the square wave. However this limits you to using the pre-set waveforms that are defined in 8-Bit Tracker. It is possible to blend two waves together, which is achieved by selecting Two here. See Blending Waveforms, below, for more details on how this works. • Waveform Shape – This is where you decide on what your instrument should sound like. Currently the following waveforms are available: o Sawtooth o Sine o Square o Triangle o Sine Cubed o Triangle Cubed o Semi-circle Each one makes a unique sound. Experiment with them to get a sound you like. • Noise Level – Noise is random distortion of a wave and sounds like static background noise such that an old TV might make. Many old 8-bit computers used this effect to simulate drumbeats. A short, sharp sample of an instrument with 100% noise sounds a bit like a snare drum. If you are creating percussion sounds, you’ll want to use this setting, but most instruments that are designed to play notes at different pitches will have noise set to 0%. Noise can be useful for sound effects too – the explosion sound effect in the example scene uses it. To the right of these settings is a graphical representation of the wave you have selected, including the effect of any added noise. Blending Waveforms It is possible to blend two waveforms together to create a third, unique waveform for your instrument. Setting the number of waveforms to Two changes the waveform section to look like this: Waveform details when blending two waveforms • Waveform Shapes – To create a blended waveform, you must select two source waveforms to blend together. • Offsets – Either waveform can be offset up to one complete cycle.