
  MARTIN GALWAY COLLECTION, PART 1
  SID music player for eLeMeNt ZX and MB03+                              rev 2
===============================================================================

Four pieces by Martin Galway, played by his own 6502 driver rewritten for the
Z80. The music data is untouched - what you hear should be the original old
bytecode interpreted note for note. However, the player is still unfinished
and experimental.

  1  Loader (Rambo)   Ocean 1985, the loading music
                      (with the Morse message Galway put in it)
  2  Green Beret      Konami / Imagine 1986
  3  Wizball 1        Ocean 1987
  4  Wizball 2        Ocean 1987, the enter-your-name tune


  KEYS
-------------------------------------------------------------------------------

  1 - 4    play that tune from the beginning; pressing it again restarts it

  SPACE    stop
  ENTER    pause; then any key carries on and SPACE gives up instead

  ->       right arrow (CAPS + 8) scrubs forward, and keeps going for as long
           as you hold it.

  V        the bars on or off. The channel names and the figures beside them
           stay either way, so it is still plain which voice is playing and
           what it is doing;

  L        loop on or off. With it off - which is how it starts - each tune
           plays through once and the list comes back.

  S        6581 or 8580 - which SID the player pretends to talk to. The two
           chips filter quite differently (Wizball's long filtered intro
           is the place to hear it).

  N / P    NTSC or PAL - how fast the SID itself is clocked, which sets the
           pitch.

     None: Wizball has a frequency table for each and gets the matching one.
           Green Beret and Rambo carry only one table, computed for a 1 MHz
           clock, so with N they are in tune the way the numbers were meant and
           with P they sit about two thirds of a semitone lower - which is how
           they sounded on the European machines. Try both and use the one you
           like.

  A B C    silence voice 1, 2 or 3; press again to bring it back. Each bar is
           labelled with the key it answers to. Starting a tune turns
           everything back on.

  F        the same for the filter - the voices carry on but stop being routed
           through it, which is the quickest way to hear what it was doing.

  T        time base - where the player takes its timing from. Three settings,
           see below.


  PAL, NTSC AND WHY IT IS NOT ABOUT SPEED
-------------------------------------------------------------------------------

Two things differed between a European and an American C64, and they are easy
to mix up.

The SID was clocked a little faster over there, and since the pitch of a note
comes from that clock, the same numbers would sound higher. So a tune needs a
different frequency table for each - which is why Galway wrote two of them for
Wizball and marked them P.A.L. and N.T.S.C.

And the picture ran at 60 frames a second instead of 50. The driver is called
once per frame, so the same tune simply played a fifth faster over there. That
has nothing to do with the tables; it is the tempo.

Here the frame is always the ZX Spectrum's 50 Hz, so what you hear is always
the European tempo. N and P change the pitch only, never the speed - and there
is nothing to be done about the tempo short of rewriting the music.


  TIME BASE
-------------------------------------------------------------------------------

The music runs four times per frame - once per frame for the two older tunes -
so something has to say when a frame has gone by and when each quarter of it
has. This is a different thing again: it is how finely the envelopes and the
vibrato are updated inside a frame, not which country the tune is from. T
cycles through three ways of doing that. All three should sound very similar;
they differ in what they rely on.

  counted delay loop      Counts instructions. The player measures how many fit
                          in one frame at start-up, so it works at any CPU
                          speed, but it is the least precise of the three.

  raster, ZXi beam line   Reads the beam position from the ZXi register and
                          waits for quarter-frame lines - the same idea as the
                          original on the C64, which timed itself off the
                          raster.

  ZXi 48bit counter       Reads the machine's clock counter. It cares neither
                          about the CPU speed nor about the video, so it is the
                          steadiest of the three.

Both counters are measured at start-up rather than assumed. If one of them does
not behave, the line says "no beam" or "no clock", that setting quietly falls
back to the delay loop, and a row of numbers appears showing what was measured.
On working hardware you will never see it.

-------------------------------------------------------------------------------
Music (C) Martin Galway / Ocean Software, 1985-87
                                                    Z80 port: samista and Zirin
