COMMODORE PLUS/4 WORLD
  Home  Search  Games  Tapes  Covers  Cheats  Maps  Software  New Stuff 
 Hall Of Fame  HVTC  Game Endings  Solutions  Remakes  Publications  Magazines  Effects  Top List 
 Members  Groups  Features  Plus/4 Encyclopedia  Hardware  Tools  Options  Forum 
Login
Using LOD Player V2

Using LOD Player V2


Index


0) Foreword
1) Getting set up
2) Writing your first pattern
3) Ordering patterns
4) Other features
5) Closing words

0) Foreword


This article assumes that you're computer literate, familiar with music editing (tracking) and with some minimal music theory. It will not teach you:

  • what music theory is

  • what basic musical terms mean

  • what tracking terms like "pattern" mean

  • how to code your own music player

  • how to compose a good tune


It will only show you one thing: how to use LOD Player V2.

1) Getting set up


The idea of releasing my player and the music always was this: anyone can open the player and the music, it will immediately work. Since the music is in it's own file, all you have to do is look at what is written there and start experimenting. Change some things, see how the music changes. It shouldn't be hard to figure it out. Nevertheless, here is now in detail.

You will need Plus4IDE, you can download it from Plus/4 World. Once you have it running, you will need a copy of LOD Player.
Since the player is code based, the features change between implementations. The reason for this is to keep the code small: why include the arpeggio code if the music doesn't use it?
So included here is a version of the player with some standard features: normal sound, drums, arpeggio and glissando.
Unzip this file to a new folder, then open !driver.asm in Plus4IDE. Press F6 (compile and run in Plus4IDE). The player and music should compile and run in YAPE. If you can do this, you're all set up and ready to go!
There's no music yet though, so we will move on.

2) Writing your first pattern


The music data is just bytes. Here's how LOD Player uses bytes:
$00-$3F: musical notes
$40-$EF: set note length
$F0-$F5: change instrument
$FF : end of pattern.

So, in Plus4IDE, open music.asm (don't close !driver.asm). This is where you will do all your editing. Take a quick look and see what's in the file first. You can see that both channels keep repeating a single pattern, which is called "quiet", as it doesn't make any sound. So let's write a simple baseline:

pat_bass
db $F0,LEN+speed*2,C0
db C1
db C0
db C1
db C0
db C1
db LEN+speed*1,Ai0
db G0
db Di0
db D0
db END_MARK


Once you typed (or copy/pasted) this to the end of the file, you have to set one of the channels to use this pattern, so change channel one like so:
Channel1
Channel1_restart
dw pat_bass
dw 0


Press F6 and enjoy the music. With this formatting, you can see that the music data looks very similar to a tracker.

So what's going on here?

First, the pattern is called "pat_bass", but this label could by absolutely anything. I have a habit of prefixing all patterns with "pat_", to me this makes this cleaner.
$F0 sets the instrument to 0, which is normal sound. LEN + the value sets the note length. (I like to use the "speed" constant instead of hardcoded values, because in case I want to change the speed of music later, this can be done by just changing the value of it in one place. However, writing LEN+5, or even $45 is perfectly fine.)

The player remembers both of these things (the instrument and the note length), and it will be the same until you change it. One more note: if you want to change the instrument and the note length at the same time, it has to be in that order.

The rest is just the musical notes. Simple, eh?

3) Ordering patterns


So far the music is very repetitive, so let's add another pattern:

pat_bass2
db $F0,LEN+speed*2,Di0
db Di1
db F0
db F1
db G0
db G1
db Ai0
db Ai1
db END_MARK


Now let's make channel one play the "normal" bass variation 3 times, then this one once as a "fill". So now channel one will look like this:

Channel1
Channel1_restart
dw pat_bass
dw pat_bass
dw pat_bass
dw pat_bass2
dw 0


The last 0 means to restart the channel from the beginning. Or, if you move the Channel1_restart marker to elsewhere, then from that point.
Press F6 and listen to the music so far. It should be clear now how to make your own patterns and how to sequence them.

4) Other features


1x/2x/4x speed: The included version of the player is a 4x player (that is, there's 4 interrputs per frame). The more times the music is called per frame, the better some things (e.g. drums) will sound. If you need a 1x player, there's many of those (e.g. Ati's part in 8SOB).

Volume envelopes: the player uses a fixed volume envelope that is independent from the tune. Therefore it's best to decide on the tune's speed first and make the volume envelope to fit that.
You can have more than one though, just add another one like this:

vol_different
db 8,6,5,4,3,2,8,6,5,4,3,2
db $FF


The values are obviously the TED volume values (8 = loudest, 0 = silence), and $FF is the end marker.
To change to this volume envelope, use the SET_VOLTAB command, like this:

pat_bass2
db SET_VOLTAB, vol_different & 255
db $F0,LEN+speed*2,Di0
db Di1
...


Instruments: again, this varies between players. If you want to know what the instruments are in a player, open up !player.asm and search for inst_table. $F0 will be the first one listed there, $F1 is the second, etc. Therefore, the included player has these instruments:
$F0: normal (pure TED sound)
$F1: bassdrum
$F2: snare
$F3: add_hihat (it will have a short noise then normal sound)
$F4: arpeggio (see below)
$F5: glide (glissando, also see below)

Arpeggios: some versions of the player have "advanced" arpeggio feature, where you program each type of arpeggio yourself.
Other versions (for example, the one used in Clone) have a simple arpeggio: you set them like in most trackers, e.g. "37" will be a minor chord.
(This is why there is no tracker for LOD Player: which type of arpeggio is right? The first uses more memory and raster time, but it's powerful, the second is small and simple, but can't do arpeggios consisting of 4 notes, for example.)
Anyway, the arpeggio feature in this player is used like this:
arp_minor
db 0,0,0,0,3,3,3,3,7,7,7,7,12,12,12,12,$80
arp_minor2
db 0,0,0,5,5,5,8,8,8,$80

Each number denotes how many halftones you step up from your original note.

$80 means jump back to the beginning, $81 means jump to the first byte, etc.

You can make up your own arpeggios, as many as you like.
Here's how you use them in a pattern:

pat_lead
db $F5
db LEN+speed*1
db C2,G2,C3,G2
db C2,G2,C3,G2
db C2,D2,Di2,F2
db G2,Gi2,Ai2,C3

db SET_ARP, arp_minor & 255
db $F4,LEN+speed*4,C2
db SET_ARP, arp_minor2 & 255
db $F4,LEN+speed*4,G2
db SET_ARP, arp_minor & 255
db $F4,LEN+speed*4,C2
db SET_ARP, arp_minor2 & 255
db $F4,LEN+speed*4,G2

db END_MARK


This pattern also shows the usage of glissando ($F5), you just set the instrument, and the player does the rest.

5) Closing words


That's it in a nutshell. Experiment, have fun, contact me if you have questions.

Copyright © Plus/4 World Team, 2001-2017