home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / ST_USER / 1992 / USERJA92.MSA / EDSYNTH_READ.ME < prev    next >
Text File  |  1987-04-21  |  34KB  |  1,057 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.                                     Edsynth V1.2
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                 A complete music synthesizer system for the Atari ST
  22.  
  23.  
  24.  
  25.  
  26.  
  27.                                   By Chris Horton
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.                                  Table of Contents
  73.  
  74.          1 Introduction  ..............................................  1
  75.             1.1 Programming Information  ..............................  1
  76.          2 The Editor  ................................................  2
  77.             2.1 The Command Language  .................................  2
  78.             2.2 The Commands  .........................................  3
  79.                2.2.1  Envelope  .......................................  3
  80.                2.2.2  Note  ...........................................  4
  81.                2.2.3  Off  ............................................  4
  82.                2.2.4  Double  .........................................  5
  83.                2.2.5  Chord  ..........................................  5
  84.                2.2.6  Slide  ..........................................  5
  85.                2.2.7  Vibrato  ........................................  5
  86.                2.2.8  Tremolo  ........................................  5
  87.                2.2.9  Freq  ...........................................  6
  88.                2.2.10 FadeIn  .........................................  6
  89.                2.2.11 FadeAway  .......................................  6
  90.                2.2.12 Loop  ...........................................  6
  91.                2.2.13 Restart  ........................................  6
  92.          3 An Example Tune  ...........................................  7
  93.          4 Editor Functions  ..........................................  9
  94.             4.1  F1 - Load file  ......................................  9
  95.             4.2  F2 - Merge file  .....................................  9
  96.             4.3  F3 - Save file  ......................................  9
  97.             4.4  F4 - Save a file in stand-alone format  ..............  9
  98.             4.5  F5 - Erase voice  ....................................  9
  99.             4.6  F6 - Top of input data  ..............................  9
  100.             4.7  F7 - Bottom of input data  ...........................  9
  101.             4.8  F8 - Disk directory  .................................  9
  102.             4.9  F9 - Stop tune  ......................................  9
  103.             4.10 F10 - Play tune  ..................................... 10
  104.          5 Including stand-alone tunes in your own programs  .......... 11
  105.          6 Personal use of Edsynth  ................................... 14
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.              Edsynth V1.2             1                   Chris Horton
  138.  
  139.  
  140.          1 Introduction
  141.               This  manual  describes  the  utilisation of Edsynth, a music
  142.          synthesizer  system  for  the  Atari  ST  series  of computers. It
  143.          consists  of  an  editor for the entry of the music commands which
  144.          are  then  compiled  and  passed  to the synth for playing. As the
  145.          synth  has  been  designed  to  run on the interrupt system of the
  146.          computer,  once started the music merely continues as a background
  147.          task, allowing further editing while playing music.
  148.  
  149.               The  synth allows three voices to be played simultaneously as
  150.          well as a noise channel. However, with a little bit of programming
  151.          this  limit can be overcome. There are special commands built into
  152.          Edsynth  to  allow  multiple  notes  to be played on a voice, thus
  153.          giving  the  illusion  of  extra  voices. This gives a theoretical
  154.          maximum  of nine voices, plus the noise channel!  This manual will
  155.          describe  all  the  editor  commands  in detail, as well as how to
  156.          install the synth into your own programs.
  157.  
  158.          1.1 Programming Information
  159.               Edsynth was written entirely in 68000 Machine Code, assembled
  160.          using the GST Assembler. Programming began in Summer '88 and ended
  161.          in Spring '89. V2.0 under development.
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.              Edsynth Manual                               February '89
  199.  
  200.  
  201.  
  202.  
  203.              Edsynth V1.2             2                   Chris Horton
  204.  
  205.  
  206.          2 The Editor
  207.               On booting up you are confronted with the editing screen. The
  208.          first  thing  you  will  notice are the three boxes on the screen;
  209.          this  is where the music commands for the three voices are input -
  210.          voice  1  is the first box, voice 2 the second, etc. At the moment
  211.          the  cursor  is  in the input area for channel 1, but pressing the
  212.          right and left cursor keys jumps between the other voices.  Before
  213.          we  begin  writing  a tune let's load in a tune and hear just what
  214.          the  synth  can do. Press the F1 key. Now the cursor is located on
  215.          the bar at the top of the screen. Type :
  216.  
  217.                                       TUNE.DAT
  218.  
  219.               The disk-drive will spin for a few seconds, and then you will
  220.          be  asked which voices you want loaded. We want all the voices, so
  221.          simply hit RETURN. The data file will now be loaded, and the input
  222.          areas  fill with the code for this tune. The cursor is now back in
  223.          the  input  area for channel 1. Now press F10, but first make sure
  224.          the  volume  on your TV is turned up. You will now be able to hear
  225.          the  tune  playing.  But notice how the cursor can still be moved.
  226.          This  is  because  the  music  is  running  as  a background task,
  227.          allowing re-editing of the music, even while it's still playing!
  228.  
  229.               You  might  have  wondered why we can only see seven lines of
  230.          the code for each  voice. This is because the input area is really
  231.          a  window  through  which  only  a small amount of the code can be
  232.          seen.  We  can  look  at  the  rest by making the window look at a
  233.          different  section  of  the  code.  Press  the down cursor key. In
  234.          response,  the  cursor  moves  down a line. Keep pressing until it
  235.          moves off the bottom line. You will see that the text has scrolled
  236.          up and another line can be seen. Moving back up is accomplished by
  237.          pressing  the  up  cursor key. However if we wanted to find a line
  238.          further  down  in  the  text,  it  is  going  to  take a long time
  239.          scrolling  line by line through the code. For this reason a paging
  240.          facility  has been included. Simply press SHIFT while pressing the
  241.          required  cursor  key,  and  the text scrolls up a whole page - or
  242.          seven lines.
  243.  
  244.               Now  press  F4. This is the erase facility. You are now being
  245.          asked  which  voice you wish to erase. We want to erase all voices
  246.          so  simply  press  RETURN.  All  the input areas are now empty, in
  247.          preparation for data entry.
  248.  
  249.          2.1 The Command Language
  250.               Edsynth  tunes  are  written  in  a  language  that has to be
  251.          learned before we can begin our composition. The tune code is made
  252.          up of a sequence of music commands such as ENVELOPE, NOTE, DOUBLE,
  253.          and  a  host  of  others,  the use of which is described in detail
  254.          below.  However I will just include here a brief note on how these
  255.          are  input  to  the editor. To ease the entry of tunes, the editor
  256.          only  expects  the first letter of each command to be typed, which
  257.          it will then expand to the full command name.
  258.  
  259.               For  example,  press  the  E  key. The editor expands this to
  260.          ENVELOPE - the first music command. Now the cursor moves on to the
  261.  
  262.  
  263.  
  264.              Edsynth Manual                               February '89
  265.  
  266.  
  267.  
  268.  
  269.              Edsynth V1.2             3                   Chris Horton
  270.  
  271.  
  272.          next input column. For this particular command, the next parameter
  273.          has to be a number - let's say 01. So hit the 0 key and then the 1
  274.          key. We are now on the next column.
  275.  
  276.                                  Type : F 01 A 05
  277.  
  278.               Now  the cursor should be in the last column. Press the T key
  279.          and  then  the N key. The cursor has now returned to the left-hand
  280.          side  of  the  input  area ready for the next command entry. Don't
  281.          worry  about  what  you  have  just typed in, all will be revealed
  282.          later.
  283.  
  284.          2.2 The Commands
  285.               Here  follows  a description of all the commands available in
  286.          Edsynth.
  287.  
  288.          2.2.1 Envelope
  289.               It  would  be  pretty  boring  if, when a note was played, it
  290.          stayed  at  one particular volume throughout. Therefore, we need a
  291.          way  of describing the way the volume of the note changes as it is
  292.          played. The ENVELOPE command fulfils this purpose for us.
  293.  
  294.               The  diagram  below  shows  how  the  envelope  of a voice is
  295.          constructed.
  296.  
  297.  
  298.                                  /\
  299.                                 /^ \
  300.                                / |  \
  301.                               /  |   \___________
  302.                              /   |   |    ^     |\
  303.                             /    |   |    |     | \
  304.                            /     |   |    |     |  \
  305.                           /______|___|____|_____|___\
  306.                           |      |   |    |     |   |
  307.                           |      |   |    |     |   |
  308.                           |<---->|   | SUSTAIN  |   |
  309.                            ATTACK|   |  LEVEL   |   |
  310.                                  |<->|          |   |
  311.                                  |DECAY         |   |
  312.                                  |              |<->|
  313.                                  |             RELEASE
  314.                             PEAK VOLUME
  315.                                LEVEL
  316.  
  317.               It's  pretty  difficult  to understand, so I'll go through it
  318.          stage by stage.
  319.  
  320.               The  ATTACK SPEED is the speed with which the volume rises to
  321.          its peak when the note is played. The higher the attack value, the
  322.          slower  the  increase  in  volume.  The PEAK VOLUME is the maximum
  323.          volume reached before the note begins to die away again. The DECAY
  324.          SPEED  is  the speed at which the volume decreases before it holds
  325.          steady at the SUSTAIN LEVEL for the duration of the note. When the
  326.          note stops it doesn't simply cut out, but decays away at the speed
  327.  
  328.  
  329.  
  330.              Edsynth Manual                               February '89
  331.  
  332.  
  333.  
  334.  
  335.              Edsynth V1.2             4                   Chris Horton
  336.  
  337.  
  338.          of the RELEASE value.
  339.  
  340.               The   ENVELOPE  command  sets  up  all  these  values  for  a
  341.          particular  voice. They are input in the order they were described
  342.          above,  with  the  addition  of  one  more parameter - we must say
  343.          whether  the  voice is going to be a tone or noise (a tone plays a
  344.          pure  note, and a noise plays as a kind of hissing sound), or both
  345.          at the same time.
  346.  
  347.               It is easiest explained with an example :
  348.  
  349.                              ENVELOPE 01 F 01 A 05 TN
  350.  
  351.               This  sets  the  ATTACK  as 1, PEAK VOLUME as 15, DECAY as 1,
  352.          SUSTAIN  LEVEL  as  10, RELEASE as 5, and the voice will play both
  353.          tone and noise.
  354.  
  355.                                         NOTE
  356.               Edsynth uses a numbering system called hexadecimal (base 16).
  357.          In  this  system  all  the  digits  0 to 9 are used as well as the
  358.          letters  A  to  F.  Thus  the  number ten becomes 0A, thirteen 0D,
  359.          seventeen 11, etc.
  360.  
  361.               All  notes thereafter will be played with this envelope until
  362.          the next ENVELOPE command is reached.
  363.  
  364.               When the cursor is in the TN column (the small one on the far
  365.          right),  it  expects  you  to  specify noise - N - last. So if you
  366.          simply  want noise, just press 'N', and the cursor will proceed to
  367.          the  next  line.  For  both tone and noise type 'T' first and then
  368.          'N'.  However,  if you only want tone, then type 'T' as before and
  369.          then hit the SPACE bar, so that the editor realises that you don't
  370.          want noise as well.
  371.  
  372.          2.2.2 Note
  373.               This command selects the pitch and duration of the note to be
  374.          played. For example :
  375.  
  376.                                    NOTE C#3 0010
  377.  
  378.               The  above plays the note C SHARP of octave 3 for duration 10
  379.          (in hex).
  380.  
  381.               Edsynth allows notes in the octave range 0 to 7.
  382.  
  383.          2.2.3 Off
  384.               When we want to insert a pause into the tune, the OFF command
  385.          is  used.  The  only  parameter needed here is the duration of the
  386.          pause. Hence :
  387.  
  388.                                       OFF 0050
  389.  
  390.               will  pause  for  duration 50. When an OFF command is reached
  391.          the  note  decays  away at the speed that the RELEASE has been set
  392.          to.
  393.  
  394.  
  395.  
  396.              Edsynth Manual                               February '89
  397.  
  398.  
  399.  
  400.  
  401.              Edsynth V1.2             5                   Chris Horton
  402.  
  403.  
  404.          2.2.4 Double
  405.               I  mentioned  above  Edsynth's ability to play two notes with
  406.          one  voice.  This  technique  is  achieved  by rapidly alternating
  407.          between  two notes to give the effect of both notes playing at the
  408.          same  time.  The  command  used for this is DOUBLE and it requires
  409.          four parameters:
  410.  
  411.                                DOUBLE C3 G3 01 0020
  412.  
  413.               The first two are the notes to be played, the third the speed
  414.          with  which  the synth alternates between the two, and the last is
  415.          the duration for which they are held.
  416.  
  417.          2.2.5 Chord
  418.               This command is very similar to DOUBLE except this time three
  419.          notes  are  played as opposed to just two. Thus an extra parameter
  420.          is required:
  421.  
  422.                              CHORD C3 D#3 G3 02 0010
  423.  
  424.               The first three are the notes to be played, the fourth is the
  425.          speed of alternation, and the last is the duration.
  426.  
  427.          2.2.6 Slide
  428.               Wouldn't  it  be  nice if, instead of simply jumping from one
  429.          note  to  the  other,  we  good  gradually  move  through  all the
  430.          intervening pitches (this is called a glissando in musical terms).
  431.          This is the role of the SLIDE command.
  432.  
  433.                                   SLIDE G2 G3 0050
  434.  
  435.               The  first two parameters are the start and destination notes
  436.          respectively.  Lastly comes the duration of the slide (the smaller
  437.          the duration the faster the slide, and vice versa).
  438.  
  439.          2.2.7 Vibrato
  440.               Vibrato is a technique which quite simply varies the pitch of
  441.          a  note  by  a  certain  amount  above and below the note as it is
  442.          played.   This  is  a  rather  complex  command,  requiring  three
  443.          parameters.
  444.  
  445.                                   VIBRATO 05 01 04
  446.  
  447.               The first is the amount by which the pitch is varied (in this
  448.          case  5 pitch graduations above and below the note). The second is
  449.          the  speed  with  which the pitch varies between these limits (the
  450.          smaller  the  number the more gradual the effect). The last is the
  451.          delay  after  the  note  has been played, before the vibrato takes
  452.          effect (set this to zero, and the vibrato begins immediately).
  453.  
  454.          2.2.8 Tremolo
  455.               Tremolo  is  much  the same as vibrato, except that it varies
  456.          the  volume.  This  only  requires  two parameters - the amount of
  457.          variation, and the speed of the tremolo.
  458.  
  459.  
  460.  
  461.  
  462.              Edsynth Manual                               February '89
  463.  
  464.  
  465.  
  466.  
  467.              Edsynth V1.2             6                   Chris Horton
  468.  
  469.  
  470.                                    TREMOLO 04 02
  471.  
  472.               It  is  useful to realise that if the note is in its decay or
  473.          release  period, the tremolo produces a kind of echo effect as the
  474.          note dies away.
  475.  
  476.          2.2.9 Freq
  477.               This command is used to vary the pitch of the 'hiss' produced
  478.          when  a voice is playing as a noise. FREQ only has one parameter -
  479.          the frequency of the noise channel - which can be anything from 00
  480.          to FF. As there is only one noise channel, it should be noted that
  481.          changing the frequency affects all voices playing as noise.
  482.  
  483.          2.2.10 FadeIn
  484.               With  this command you can create the effect of  music fading
  485.          gradually  from  zero  volume to  maximum. Only  one  parameter is
  486.          required - the fade speed.
  487.  
  488.                                    FADEIN 0010
  489.  
  490.          2.2.11 FadeAway
  491.               This  is exactly the same as FadeIn except the volume  changes
  492.          from maximum to zero.
  493.  
  494.                                    FADEAWAY 0040
  495.  
  496.          2.2.12 Loop
  497.               Many tunes have phrases which are repeated, and it would be a
  498.          nuisance  if  the phrase had to be retyped every time it was to be
  499.          played.  This  is where the LOOP structure comes in. LOOP allows a
  500.          sequence  of  commands  to  be  replayed a certain amount of times
  501.          before  moving  on  to  the  next  set  of  commands. It takes two
  502.          parameters - the amount of lines to be repeated, and the number of
  503.          times they are to be repeated.
  504.  
  505.                                      LOOP 09 02
  506.  
  507.               The  above  would  repeat the next nine lines twice (i.e. the
  508.          phrase would be played three times in all).
  509.  
  510.          2.2.13 Restart
  511.               The  last  command  is  often  used  at the end of a tune and
  512.          simply resets that particular voice back to the first command.
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.              Edsynth Manual                               February '89
  527.  
  528.  
  529.  
  530.  
  531.              Edsynth V1.2             7                   Chris Horton
  532.  
  533.  
  534.          3 An Example Tune
  535.               The  easiest  way  to  get used to the language is to write a
  536.          short  tune as an example. Type in the following commands for each
  537.          of  the  three  voices  -  remember  only the first letter of each
  538.          command is needed.
  539.  
  540.                                   VOICE 1
  541.  
  542.                    ENVELOPE  00   F    01   0    00   T
  543.                    FREQ      15
  544.                    LOOP      06   03
  545.                    NOTE      C1   0008
  546.                    NOTE      C2   0008
  547.                    ENVELOPE  00   F    01   0    00   TN
  548.                    NOTE      C2   0008
  549.                    ENVELOPE  00   F    01   0    00   T
  550.                    NOTE      C2   0008
  551.                    LOOP      06   03
  552.                    NOTE      A0   0008
  553.                    NOTE      A1   0008
  554.                    ENVELOPE  00   F    01   0    00   TN
  555.                    NOTE      A1   0008
  556.                    ENVELOPE  00   F    01   0    00   T
  557.                    NOTE      A1   0008
  558.                    LOOP      06   01
  559.                    NOTE      G0   0008
  560.                    NOTE      G1   0008
  561.                    ENVELOPE  00   F    01   0    00   TN
  562.                    NOTE      G1   0008
  563.                    ENVELOPE  00   F    01   0    00   T
  564.                    NOTE      G1   0008
  565.                    LOOP      06   01
  566.                    NOTE      B0   0008
  567.                    NOTE      B1   0008
  568.                    ENVELOPE  00   F    01   0    00   TN
  569.                    NOTE      B1   0008
  570.                    ENVELOPE  00   F    01   0    00   T
  571.                    NOTE      B1   0008
  572.                    NOTE      C1   0020
  573.                    ENVELOPE  00   F    01   0    00   TN
  574.                    NOTE      C0   0020
  575.  
  576.  
  577.                                   VOICE 2
  578.  
  579.                    ENVELOPE  00   F    01   C    00   T
  580.                    VIBRATO   07   07   06
  581.                    NOTE      G3   0080
  582.                    NOTE      A3   0080
  583.                    NOTE      A#3  0010
  584.                    NOTE      A3   0020
  585.                    NOTE      G3   0030
  586.                    NOTE      D#3  0020
  587.                    NOTE      C3   0010
  588.                    SLIDE     C3   C2   0010
  589.  
  590.  
  591.  
  592.              Edsynth Manual                               February '89
  593.  
  594.  
  595.  
  596.  
  597.              Edsynth V1.2             8                   Chris Horton
  598.  
  599.  
  600.                    NOTE      C2   0010
  601.                    OFF       0010
  602.  
  603.  
  604.                                   VOICE 3
  605.  
  606.                    ENVELOPE  00   F    02   0    00   T
  607.                    LOOP      05   01
  608.                    DOUBLE    G#3  G#4  01   0008
  609.                    DOUBLE    G3   G4   01   0010
  610.                    DOUBLE    G3   G4   01   0010
  611.                    DOUBLE    G3   G4   01   0010
  612.                    DOUBLE    D#3  D#4  01   0008
  613.                    LOOP      05   01
  614.                    DOUBLE    F3   F4   01   0008
  615.                    DOUBLE    E3   E4   01   0010
  616.                    DOUBLE    E3   E4   01   0010
  617.                    DOUBLE    E3   E4   01   0010
  618.                    DOUBLE    C3   C4   01   0008
  619.                    DOUBLE    G3   G4   01   0010
  620.                    DOUBLE    G3   G4   01   0010
  621.                    DOUBLE    F3   F4   01   0010
  622.                    DOUBLE    F3   F4   01   0010
  623.                    DOUBLE    D3   D4   01   0010
  624.                    DOUBLE    D3   D4   01   0010
  625.                    DOUBLE    B2   B3   01   0010
  626.                    DOUBLE    B2   B3   01   0010
  627.                    DOUBLE    C3   C4   01   0020
  628.                    DOUBLE    C4   C5   01   0020
  629.  
  630.  
  631.               If you make any mistakes, the BACKSPACE key will allow you to
  632.          edit within the column you are currently typing in. If you want to
  633.          change  a  line  simply move the cursor onto that line and type in
  634.          the new command - the old one will be deleted automatically as you
  635.          start  typing.  If  you  want  to  take out a line without putting
  636.          another  in  its  place, move on to the offending line and hit the
  637.          DELETE  key.  Inserting  a  line  in between two others is just as
  638.          simple,  just  move  to the position at which you want to put your
  639.          new  command,  and  press  the INSERT key (it's next to the cursor
  640.          keys).
  641.  
  642.               Now  simply  turn  up the volume and press F10. Okay, so it's
  643.          nothing  spectacular  but it does demonstrate most of the commands
  644.          available,   and  serves  as  a  good  introduction  to  Edsynth's
  645.          capabilities.
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.              Edsynth Manual                               February '89
  659.  
  660.  
  661.  
  662.  
  663.              Edsynth V1.2             9                   Chris Horton
  664.  
  665.  
  666.          4 Editor functions
  667.               I  have  already  explained the use of the BACKSPACE, DELETE,
  668.          and INSERT keys, but there are also a plethora of other facilities
  669.          available from the keyboard, mainly from the row of function keys.
  670.          There now follows a list of the keys and there respective uses.
  671.  
  672.          4.1 F1 - Load file
  673.               When  F1 is pressed, the cursor moves into the top input line
  674.          and  prompts  for  a  filename. Just type in the name of the music
  675.          data  file  to  be  loaded  and then press return. You will now be
  676.          prompted  to  select  the  voice to be loaded. If you want all the
  677.          voices,  then  hit  RETURN. If a single voice is selected, you are
  678.          then  asked  into which input area you want the data to be loaded.
  679.          Any loading errors will be reported.
  680.  
  681.          4.2 F2 - Merge file
  682.               This  function  appends  the selected voices of the new music
  683.          file onto the tune currently in memory.
  684.  
  685.          4.3 F3 - Save file
  686.               Saves  the  tune  currently in memory to disk. Files saved in
  687.          this  fashion can later be loaded back into the editor with the F1
  688.          key.  The  convention I use is to have filenames with the extender
  689.          .DAT for tunes saved with this function.
  690.  
  691.          4.4 F4 - Save a file in stand-alone format
  692.               This  saves  a  version  of  the  music synthesizer, with the
  693.          compiled  version  of the tune currently in memory. Tunes saved in
  694.          this  fashion  cannot  be loaded back into the editor, but are for
  695.          inclusion  in  your  own  programs.  I  use  the extender .MUS for
  696.          stand-alone files.
  697.  
  698.          4.5 F5 - Erase voice
  699.               Allows  a  specific  voice  (or all voices if required) to be
  700.          erased from memory.
  701.  
  702.          4.6 F6 - Top of input data
  703.               Pressing  F6  moves  the  cursor  to the first command of the
  704.          current voice being edited.
  705.  
  706.          4.7 F7 - Bottom of input data
  707.               The opposite of F6 - moves to the last command of the current
  708.          voice.
  709.  
  710.          4.8 F8 - Disk directory
  711.               Gives  a  list  of the files on the disk in the drive. At the
  712.          prompt  type  the  pathname to be searched (e.g B:\*.* ). Pressing
  713.          return  defaults  to  the  pathname  *.DAT . The directory will be
  714.          displayed in the input area for voice one, and appears seven lines
  715.          at  a  time.  To  see the next page press any key. Pressing ESCape
  716.          exits from this command and returns you back to normal editing.
  717.  
  718.          4.9 F9 - Stop tune
  719.               Stops playing the current tune,
  720.  
  721.  
  722.  
  723.  
  724.              Edsynth Manual                               February '89
  725.  
  726.  
  727.  
  728.  
  729.              Edsynth V1.2             10                   Chris Horton
  730.  
  731.  
  732.          4.10 F10 - Play tune
  733.               Plays the tune currently held in memory.
  734.  
  735.  
  736.  
  737.                                         NOTE
  738.               When  asked  for  a  filename,  pressing  the  ESCape key (or
  739.          pressing  RETURN without entering a filename), will exit from that
  740.          command without any effect.
  741.  
  742.               Sometimes  when  you  are  editing  a tune,  you  may  want to 
  743.          concentrate  on one voice  at  a time. Pressing  the 1,2, or 3 keys
  744.          on the numeric keypad, toggles the selected voice on or off.         
  745.  
  746.               There  are two other special keys, namely the + and - keys on
  747.          the  numeric  keypad.  Pressing  + emulates a sort of fast-forward
  748.          feature,  moving rapidly through the tune in memory. Conversely, -
  749.          restores  the  speed  to  normal.  This facility is great for long
  750.          tunes,  where  you  don't  want to listen to the whole tune again,
  751.          just to here a section towards the end.
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.              Edsynth Manual                               February '89
  791.  
  792.  
  793.  
  794.  
  795.              Edsynth V1.2             11                   Chris Horton
  796.  
  797.  
  798.          5 Including stand-alone tunes in your own programs.
  799.  
  800.                                         NOTE
  801.                This section is strictly for experienced programmers!
  802.  
  803.               The  stand-alone  file  consists  of the synth player and the
  804.          compiled  code  for  that particular tune. The synth is completely
  805.          position  independent  (it  can be loaded anywhere in memory). The
  806.          music  runs  on  the  vertical  blank  (located  at $4CE) and once
  807.          installed  can  be  forgotten.  The  address  to  be placed on the
  808.          vertical blank is simply the music load address.
  809.  
  810.               For  example - if you load the synth at $30000, put $30000 at
  811.          $4CE (or alternatively your own vertical blank routine can include
  812.          the instruction JSR $30000).
  813.  
  814.               To  start  the  tune  include  a JSR to the load address + 4.
  815.          Subsequent  calls  to  this routine will restart the tune from the
  816.          beginning.  Before this routine is called however, you must ensure
  817.          the computer is in Supervisor mode.
  818.  
  819.               The  following is a program which outlines this procedure. It
  820.          first  loads  in  the  file  TUNE.MUS  (this  is  the  demo music,
  821.          contained  on  the  disk  -  it must be in the same folder as this
  822.          program),   and   initialises   it  on  the  vertical  blank.  Two
  823.          subroutines are also included to stop and start the music.
  824.  
  825.              ************************************
  826.              * Example program to load and play *
  827.              *     a stand-alone Music file     *
  828.              ************************************
  829.              *         By Chris Horton          *
  830.              ************************************
  831.  
  832.              CLR.L     -(SP)               ; Set supervisor mode
  833.              MOVE.W    #$20,-(SP)
  834.              TRAP      #1
  835.              ADDQ.L    #6,SP
  836.  
  837.              MOVE.L    $4CE,OLD_VBL        ; Save old vertical blank
  838.  
  839.              BSR       LOADMUSIC           ; Load the music file
  840.  
  841.              MOVE.L    #STORAGE,$4CE       ; Put synth onto vertical blank
  842.              BSR       STARTMUSIC          ; Start music playing
  843.  
  844.              ******************************
  845.              * Your own code goes in here *
  846.              ******************************
  847.              * The following simply waits *
  848.              *   for a keypress before    *
  849.              * turning off the music and  *
  850.              *    ending the program.     *
  851.              ******************************
  852.  
  853.  
  854.  
  855.  
  856.              Edsynth Manual                               February '89
  857.  
  858.  
  859.  
  860.  
  861.              Edsynth V1.2             12                   Chris Horton
  862.  
  863.  
  864.    MAIN      MOVE.W    #7,-(SP)            ; Wait for a keypress
  865.              TRAP      #1
  866.              ADDQ.L    #2,SP
  867.  
  868.              **********************************
  869.              * Turn off music and end program *
  870.              **********************************
  871.  
  872.    EXIT      BSR       STOPMUSIC           ; Stop the music.
  873.                                            ; Could be restarted with
  874.                                            ; another BSR STARTMUSIC
  875.  
  876.              MOVE.L    OLD_VBL,$4CE        ; Restore old vertical blank
  877.              OR.B      #1,$484             ; Turn key-click back on
  878.  
  879.              CLR.W     -(SP)               ; Exit to desktop
  880.              TRAP      #1
  881.  
  882.              *******************
  883.              * The subroutines *
  884.              *******************
  885.  
  886.              *******************************
  887.              *         STARTMUSIC          *
  888.              * Starts the music playing or *
  889.              * restarts if already playing *
  890.              *******************************
  891.  
  892.    STARTMUSIC
  893.              JSR       STORAGE+4
  894.              RTS
  895.  
  896.              ***********************
  897.              *      STOPMUSIC      *
  898.              *  Pauses the music   *
  899.              * can be restarted by *
  900.              * calling STARTMUSIC  *
  901.              ***********************
  902.  
  903.    STOPMUSIC MOVE.B    #1,STORAGE+$59E     ; This is a flag which :
  904.                                            ; pauses music if set,
  905.                                            ; continues if cleared
  906.  
  907.              MOVE.B    #7,$FF8800          ; Turn off all sound channels
  908.              MOVE.B    #$FF,$FF8802
  909.              RTS
  910.  
  911.              ************************
  912.              *      LOADMUSIC       *
  913.              * Loads the music file *
  914.              *  at address STORAGE  *
  915.              ************************
  916.  
  917.    LOADMUSIC MOVE.W    #2,-(SP)            ; Open file
  918.              PEA       FILENAME
  919.  
  920.  
  921.  
  922.              Edsynth Manual                               February '89
  923.  
  924.  
  925.  
  926.  
  927.              Edsynth V1.2             13                   Chris Horton
  928.  
  929.  
  930.              MOVE.W    #$3D,-(SP)
  931.              TRAP      #1
  932.              ADDQ.L    #8,SP
  933.              MOVE.W    D0,HANDLE
  934.  
  935.              PEA       STORAGE             ; Read file
  936.              MOVE.L    #$FFFF,-(SP)
  937.              MOVE.W    HANDLE,-(SP)
  938.              MOVE.W    #$3F,-(SP)
  939.              TRAP      #1
  940.              ADD.L     #12,SP
  941.  
  942.              MOVE.W    HANDLE,-(SP)        ; Close file
  943.              MOVE.W    #$3E,-(SP)
  944.              TRAP      #1
  945.              ADDQ.L    #4,SP
  946.              RTS
  947.  
  948.              ****************
  949.              * Storage area *
  950.              ****************
  951.  
  952.    OLD_VBL   DS.L      1
  953.    HANDLE    DS.W      1
  954.    FILENAME  DC.B      'TUNE.MUS',0
  955.  
  956.    STORAGE   DC.B      0
  957.  
  958.              END
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.              Edsynth Manual                               February '89
  989.  
  990.  
  991.  
  992.  
  993.              Edsynth V1.2             14                   Chris Horton
  994.  
  995.  
  996.          6 Personal use of Edsynth
  997.               You  are  free  to  include any stand alone files in your own
  998.          programs.  All  I ask is that you include on your title screen the
  999.          legend :
  1000.  
  1001.                             Music Synth by Chris Horton
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.              Edsynth Manual                               February '89
  1055.  
  1056.  
  1057.