LITTLE SOUND DJ
Copyright (C) Johan Kotlinski, 2000-2001

http://www.littlesounddj.com






                        [ D O C U M E N T A T I O N ] 







____FUNDAMENTALS_______________________________________________________________



---* IMPORTANT *---

Turning off the Gameboy while playing music might destroy all memory data. Remember to stop playing before turning off your Gameboy!


---* GAMEBOY SOUND *---

The Gameboy sound chip has four channels.

Channel 0: Quadrangular wave with envelope and sweep functions.
Channel 1: Quadrangular wave with envelope function.
Channel 2: Voluntary waveforms, stored in RAM.
Channel 3: Noise with envelope and sweep functions.


---* HEXADECIMAL NUMBER SYSTEM *---

In order to save CPU power and screen space, Little Sound Dj uses the hexadecimal number system. It consists of 16 unique symbols: the numbers 0 to 9 and the letters A to F. For example, the decimal number 15 is represented as F in the hexadecimal numbering system. The hexadecimal system is useful because it can represent every byte (8 bits) as two consecutive hexadecimal digits.


---* PLAYING AND STOPPING *---

You can start and stop playing by pressing START. When pressing START in the SONG screen, Little Sound Dj will always try to play all four channels. When pressing START in the other screens, Little Sound Dj will only try to play the channel that's indicated in the "CH" field at the top of the screen. This can be good for soloing.

If you want to start playing all four channels from some other screen than the SONG screen, you can do that by pressing SELECT+START.

It is always possible to mute all channels temporarily by pressing B+SELECT. If releasing B and SELECT exactly at the same time, the channels will stay muted until a key is pressed.




____SCREEN CONCEPT_____________________________________________________________


Little Sound Dj is built out of several screens. You can navigate between the screens by using SELECT+CURSOR keys.

  SCREEN MAP:
 ________ ________         
|        |        |<--.
| PROJECT|  WAVE  |   |
|________|________|___V____
|        |        |        |
|  SONG  |  LINE  | PHRASE |
|________|________|________|
|        |        |        |
| GROOVE | TABLE  | INSTR  |
|________|________|________|


---* PHRASE SCREEN *---

The phrase screen is the most atomical part of the sequencer; this is where you enter the actual note data. It has four columns: the note column, the instrument select column, the command column and the command value column. As a default, phrases are set to the length 16 steps, even though you can make the sequencer jump to the next phrase end earlier by using the HOP command.

You can enter data by pressing A+CURSOR keys. A+LEFT/RIGHT changes the values in small steps (+-1), A+UP/DOWN changes the values in big steps (+-10). You can delete a value by pressing B+A.

The number of phrases is limited to 255 (hexadecimal: FF).


---* CHAIN SCREEN *---

Chains are used for linking together several phrases into one unity, thus creating a longer rhythm block, a melody or a bass line.

The chain screen contains 2 columns. The first column contains the list of phrases that are to be played by this chain, while the second column transposes the phrase that's on the same row. For example, a row like this...

 03 05
 04 00
 05 00
 06 00

...will play phrase 3, adding 5 half-notes to each note, and then play each of the phrases 4, 5, 6, without transposing.

To create a new phrase, move the cursor to an empty step and press A.

To edit a phrase, move the cursor to the phrase number and press SELECT+RIGHT.

If editing a chain, you can go to the nextmost chain in a neighbouring channel by moving the cursor as far to the left/right as possible, releasing the cursor key, and pressing left/right again. This channel switching method works well in the PHRASE screen, too.

If editing a phrase inside a chain with several phrases, you can scroll between the different phrases in the chain by simply moving the cursor up or down. In this way, editing four tiles placed after each other will be much like editing a virtual 64-step tile.

The number of chains is limited to 128 (hexadecimal: 80).


---* SONG SCREEN *---

The song screen is the highest level of the sequencer. It contains 4 columns, one for each channel. The columns contain lists of chains, which will be played in piano-roll style, up to down. The number of rows in the song screen is limited to 256 (hexadecimal: 100).

To create a new chain, move the cursor to an empty step and press A.

To edit a chain, move the cursor to the chain number and press SELECT+RIGHT.


---* GROOVE SCREEN *---

In this song, you can edit grooves. The grooves decide by which rhythm phrases or arpeggiator tables should be played. The channels are not synchronized to each other, so you can use a different groove for every phrase and table.

For understanding the groove concept, you need to know that the sequencer's time handling is based on a period of time named "ticks". One tick is approximately 1/60th of a second (this can be changed by the TEMPO command). In the groove screen, you can specify how many ticks each note step should be played. 

This groove:

6

...would make the sequencer spend 6/60th of a second on each note step.

You can also use the groove screen to create more advanced rhythms.

This groove:

7
5

would make the sequencer spend a little less time playing the 2nd, 4th, 6th, ..., notes, which creates a swing feeling. With a little programming, grooves can also be used to create triplets, and other custom rhythms.

You can select the groove you wish to edit by pressing B+CURSOR key. The default groove is groove number 0, but you can switch to another groove with the GROOVE ("G") command.

The number of grooves is limited to 32 (hexadecimal: 20).


---* ARPEGGIATOR TABLE SCREEN *---

The arpeggiator table screen contains 5 columns. First out the transpose column, which contains the numbers of half-notes with which the notes being played should be transposed. The other columns are command colums, just like the one in the phrase screen.

A typical use for the arpeggiator is to create chords, by changing the transpose values very fast. A table like this:

00 --- G0A
04 --- ---
07 --- ---
00 H00 ---

...would emulate striking a C major, provided that the groove number A is very fast. (As a default, the A groove is set to 1, the fastest possible setting.)

The arpeggiator can also be used as a kind of micro-sequencer, since it implements all of the commands found in the phrase screen. It allows for creating complex instruments, envelopes and effects.

To view a different table, press B+CURSOR keys.

The number of arpeggiator tables is limited to 32 (hexadecimal: 20).


---* WAVE SCREEN *---

In this screen, you can edit wave frames that are supposed to be played by channel 2, by using the cursors.

Copy/paste works well in this screen. An useful trick is drawing the first half of the wave, marking+copying it and pasting to the other half. You can then mark the other half and press A+DOWN in order to reverse it vertically. A+RIGHT reverses the marked portion of the wave frame horizontally.

When you are done editing, you can select the wave frame you wish to play using either the instrument editor or the SET WAVE FRAME ("F") command.

To view a different wave frame, press B+CURSOR keys.

The number of wave frames is limited to 256 (hexadecimal: 100).


---* INSTRUMENT SCREEN *---

Here, you can edit the instrument parameters. It's possible to copy/paste entire instruments, by pressing SELECT+B for copy and SELECT+A for paste.

The instrument parameters are:

NAME - use this to mark up instruments and avoid mix-ups.
TYPE - channel 0/1, 2 or 3 sound?
LENGTH - change the sound length.
PAN - panorate the sound to left/right/both/none speakers. (use the headphone output to hear the difference!)
TABLE - if not off, latch the specified table when playing a note.

Specific for Channel 0/1 Type:
ENVELOPE - first digit is initial amplitude (0-F). second digit is release (0,8: none, 1-7: decrease amplitude, 9-F: increase amplitude).
WAVE - choose the wave type to be used.
SWEEP - modulate the frequency. only working on channel 0. see SWEEP command for further information.
VIB.TYPE - change the effect of the VIBRATO command.

Specific for Channel 2 Type:
VOLUME - set amplitude. (0=0%, 1=25%, 2=50%, 3=100%)
FRAME - set wave frame. (wave frames can be edited in the WAVE screen.)
VIB.TYPE - change the effect of the VIBRATO command.

Specific for Channel 3 Type:
ENVELOPE - first digit is initial amplitude (0-F). second digit is release (0,8: none, 1-7: decrease amplitude, 9-F: increase amplitude).
SWEEP - modulate the frequency. see SWEEP command for further information.

The number of instruments is limited to 32 (hexadecimal: 20).


---* PROJECT SCREEN *---

Here, you can choose to reset all memory, purge unused phrases and chains, or purge unused instruments.


---* BORDER DATA *---

Some data is displayed in the screen border...

  __________________________
 |111111 22     333 444     |
 |                          |
 |                      555 |
 |                      666 |
 |                          |
 |                          |
 |                      777 |
 |                      888 |
 |                      999 |
 |                      AAA |
 |                          |
 |______________________BBBB|

1. Screen title.
2. Frame/groove/phrase/chain/instrument number.
3. CH=The active Channel, or, horizontal song position.
4. The current tempo, in BPM.
5. SP=Song Position.
6. CP=Chain Position.
7. Channel 0 played note indicator.
8. Channel 1 played note indicator.
9. Channel 2 played note indicator.
A. Channel 3 played note indicator.
B. Mute indicator.




____ADVANCED EDITING___________________________________________________________


---* COPYING AND PASTING *---

Little Sound Dj has a RAM clipboard for temporary data storage. Pressing B+A will cut a single value and store it on the clipboard. The value can then be pasted by pressing SELECT+A.

In most screens, it is possible to mark up blocks by pressing SELECT+B and moving the cursor around. When having marked up a block, it can be copied to the clipboard by pressing B, or cut to the clipboard by pressing SELECT+A.

Some quick-mark button presses are implemented:

SELECT+(B,B) - quick-mark a row
SELECT+(B,B,B) - quick-mark an entire screen

When having marked a block, you can often change all data inside that block by pressing A+CURSOR keys.


---* LIVE MODE *---

The live mode is a special flavour of the song screen. It can be reached by pressing B+(LEFT/RIGHT) while standing in the song screen. In the live mode, it is possible to start and stop playing chains one by one. In contrast to the usual song screen, the different channels can be started and stopped independently. It is also possible to jump between different song positions while playing, without causing audio glitches.

To begin playing a channel at a specific song position, go to the channel and song position you want to play, and press START. To stop playing a channel, go to the channel and press SELECT+START.


---* MICRO-LOOPS *---

Micro-loops is an useful live mode technique. This technique is based on the fact that the song sequencer doesn't rewind the song position to the first step when encountering end of track; instead, it stops rewinding as soon as it encounters an empty step.

Example:

We have a setup that looks like this:

LIVE

 0 00 -- -- --
 1 01 -- -- --
 2 -- -- -- --
 3 -- -- -- --
 4 02 -- -- --
 5 03 -- -- -- 
 6 -- -- -- --
 7 -- -- -- --

Assume that we start playing channel 0 at song position 4. One could expect that the sequencer would play chains 2 and 3, and then go back to the first step and loop chains 0 and 1. This is *not* the case! Instead, the player will loop chains 2 and 3. Defining a number of such micro-loops would provide a good starting point for a live set.




____COMMANDS___________________________________________________________________


These commands can be used in phrases and tables.



A: Run Arpeggiator Table

This command starts running a table. This command may be used inside a table, for jumping to another table.

Example:
 A03 - run table 3


E: Amplitude Envelope

For channels 0, 1 and 3:
The first value digit sets the initial volume, the second digit sets the release (0,8: off, 1-7: decrease, 9-F: increase).

For channel 2:
   E00 - volume 0%
   E01 - volume 25%
   E02 - volume 50%
   E03 - volume 100%

   
F: Set Wave Frame (channel 2 only)

With this command, you can select the wave frame that channel 2 should use.

Example:
 F02 - start using wave frame 2 on channel 2


G: Groove

Example:
 G04 - select groove 4
      

H: Hop

This command has two different functions, depending on whether it is used in the
phrase or the table screen.

In the phrase screen, it is used for jumping to the next phrase, without
playing the current phrase to it's end.

Example:
 H00 - hop to next phrase
 H03 - hop to next phrase and start play at phrase row 3
 
In the table screen, it is used for creating loops.

Example:
 H21 - hop to table position 1, 2 times.
 H04 - hop to table position 4 forever.
 

K: Kill note after n ticks

Example:
 K00 - kill note instantly
 K03 - kill note after 3 ticks


M: Set Master Volume
Ex.
 M77 - max volume
 M35 - medium, panned slightly to the right
 M00 - very quiet


O: Set Outputs. 

This command hard panorates a channel.


R: Retrig the latest played note. 

If a value larger than zero is given, this command will repeat the retriggering with a period of n ticks. On some drum machines, this effect is called "flam".

Example:
 R00 - retrig once
 R03 - medium speed flam
 R01 - the fastest flam!


V: Vibrato (channels 0,1,2 only)

Example:
 V42 - period=4, depth=2


T: Tempo. This changes the tick frequency.

Example:
 T80 - tempo = 80 hexadecimal BPM = 128 decimal BPM


W: Set Wave (channels 0,1 only)

This command allows you to choose from the four different waveforms available for channel 0 and 1.


S: Set Sweep (channel 0,3 only)

This command modulates the pitch, using the Game Boy hardware. It can be good for creating drum sounds. It's really difficult to understand this command by pure logic, the best idea probably is to try some different values and see what you can come up with.

From the Pan of -ATX- Gameboy hardware documentation:

---8<---
	FOR CHANNEL 0:
              
              Bit 6-4 - Sweep Time
              Bit 3   - Sweep Increase/Decrease
                         0: Subtraction (frequency decreases)
                         1: Addition    (frequency increases)
              Bit 2-0 - Number of sweep shift (n: 0-7)

              Sweep Time: 111: sweep off - no freq change
                          110: 7.8 ms  (1/128Hz)
                          101: 15.6 ms (2/128Hz)
                          100: 23.4 ms (3/128Hz)
                          011: 31.3 ms (4/128Hz)
                          010: 39.1 ms (5/128Hz)
                          001: 46.9 ms (6/128Hz)
                          000: 54.7 ms (7/128Hz)

              The change of frequency (NR13,NR14) at each shift
              is calculated by the following formula where
              X(0) is initial freq & X(t-1) is last freq:

               X(t) = X(t-1) +/- X(t-1)/2^n---8<---

	FOR CHANNEL 3:
	
              Bit 7-4 - Selection of the shift clock frequency of the
                        polynomial counter
              Bit 3   - Selection of the polynomial counter's step
              Bit 2-0 - Selection of the dividing ratio of frequencies

              Selection of the dividing ratio of frequencies:
              111: f * 1/2^3 * 2
              110: f * 1/2^3 * 1
              101: f * 1/2^3 * 1/2
              100: f * 1/2^3 * 1/3
              011: f * 1/2^3 * 1/4
              010: f * 1/2^3 * 1/5
              001: f * 1/2^3 * 1/6
              000: f * 1/2^3 * 1/7           f = 4.194304 Mhz

              Selection of the polynomial counter step:
              0: 7 steps
              1: 15 steps

              Selection of the shift clock frequency of the polynomial
              counter:

              1111: dividing ratio of frequencies * 1/2
              1110: dividing ratio of frequencies * 1/2^2
              1101: dividing ratio of frequencies * 1/2^3
              1100: dividing ratio of frequencies * 1/2^4
                    :                          :
                    :                          :
                    :                          :
              1010: dividing ratio of frequencies * 1/2^14
              0001: prohibited code
              0000: prohibited code
	
---8<----


P: Pitch Bend (channel 0,1,2 only)

Example:
 P02 - bend up pitch with speed 2
 PFE - bend down pitch with speed 2 (hexadecimal FE=-2)
