home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / Information / ENH-SID-FORM.TXT < prev    next >
Encoding:
Text File  |  2019-04-13  |  15.5 KB  |  294 lines

  1. **************************************************************************** 
  2.  *                      SIDPLAYER MUSIC FILE CONTENTS                        * 
  3.  *                    Including Enhanced Editor Commands                     * 
  4.  *                            By Dick Thornton                               * 
  5.  ***************************************************************************** 
  6.  
  7.  SIDPLAYER music files are PRG type files which contain the musical notes and 
  8.  command directives for playing a song, as well as the several text lines 
  9.  intended for the song name and credit lines for the composer and SID 
  10.  arranger. 
  11.  
  12.  On disk, the file consists of one or more sectors written in standard PRG 
  13.  format. Characteristics of this file type can be found in your disk manual, or 
  14.  other books on disk file management. From here on, we will consider the file 
  15.  data as it resides in memory after being LOAD'ed. The general format of the 
  16.  .MUS file in memory is: 
  17.  
  18.     (1) Two-byte length of voice 1 in low-byte, high-byte form. 
  19.     (2) Two-byte length of voice 2 in low-byte, high-byte form. 
  20.     (3) Two-byte length of voice 3 in low-byte, high-byte form. 
  21.     (4) The data for voice 1 always ending with a HLT command. 
  22.     (5) The data for voice 2 always ending with a HLT command. 
  23.     (6) The data for voice 3 always ending with a HLT command. 
  24.     (7) The text lines for song name, etc. There are five lines, each 
  25.         containing 0-32 bytes and ending with a carriage return. The text data 
  26.         information is in upper-case Commodore Pet ASCII. A hex zero byte 
  27.         follows the last byte of the last line of text. 
  28.  
  29.  The effect of this is that each .MUS file is actually four files packed end- 
  30.  to-end in a single PRG file with three little two-byte lengths in the front to 
  31.  help you find things. Voice 1 begins at the sixth byte of the data file as 
  32.  LOAD'ed into memory. Voice 2 starts at a point 6 + length of voice 1 from the 
  33.  beginning of the file in memory. Voice 3 is at 6 + length of voice 1 + length 
  34.  of voice 2 from the file start, and the text lines begin at 6 + length of 
  35.  voice 1 + length of voice 2 + length of voice 3. Each voice ends with a HLT 
  36.  command (hex 014F), and if there is no data for a voice that is all it will 
  37.  contain. The text area ends with a hex zero after the carriage return for the 
  38.  final line. 
  39.  
  40.  Each voice contains data in two-byte pairs that contain the musical notes and 
  41.  commands needed to play the song. The first byte of each pair will have bits 1 
  42.  and 0 both set to zero if the byte-pair describes a musical note, otherwise 
  43.  the byte-pair describes a SID chip command or SIDPLAYER command. 
  44.  
  45.  In the following, commands are identified by the three character abbreviation 
  46.  used by the SID EDITOR program described in the books "All About the Commodore 
  47.  64" Volume 2, and "COMPUTE!'s Music System for the Commodore 128 and 64". Both 
  48.  books are published by COMPUTE! Books. 
  49.  
  50.  ***************************************************************************** 
  51.  *                          MUSICAL NOTE DATA PAIRS                          * 
  52.  ***************************************************************************** 
  53.  
  54.  Musical note data pairs will contain 00 in the lower-order two bits of the 
  55.  first byte of the pair. Each musical note byte-pair contains duration in its 
  56.  first byte, and frequency (pitch) in the second. This data is coded as 
  57.  follows, where decoding proceeds downward until a > terminator is found. A dot 
  58.  means the bit can be either 0 or 1: 
  59.  
  60.  ***************************************************************************** 
  61.  *                         BYTE 1 - TIE AND DURATION                         * 
  62.  ***************************************************************************** 
  63.  
  64.      BITS 
  65.    7654 3210   DESCRIPTION                    ---------------------------- 
  66.    0000 0000   Absolute Pitch>                !          EXAMPLE         ! 
  67.    .1.. ..00   Tie/Slur                       !                          ! 
  68.    1.10 0000   Triplet 64th note>             ! GIVEN byte 1 = hex F0    ! 
  69.    ..10 0100   Utility Voice>                 !    (binary 1111 0000)    ! 
  70.    1.0. ..00   Triplet                        ! tie        .1.. ..00     ! 
  71.    ..00 0100   Utility Duration>              ! dotted     ..1. ....     ! 
  72.    ...0 0000   64th note>                     ! dbl-dot    1.1. ....     ! 
  73.    0.1. ..00   Single Dotted duration         ! qtr note>  ...1 0000     ! 
  74.    1.1. ..00   Double Dotted duration         !                          ! 
  75.    ...0 1000   Whole note>                    ! This is a double-dotted  ! 
  76.    ...0 1100   Half Note>                     ! quarter note with tie.   ! 
  77.    ...1 0000   Quarter Note>                  ---------------------------- 
  78.    ...1 0100   Eighth Note> 
  79.    ...1 1000   Sixteenth Note> 
  80.    ...1 1100   Thirty-Second Note> 
  81.  
  82.  ***************************************************************************** 
  83.  *                    BYTE 2 - FREQUENCY (PITCH) AND RESTS                   * 
  84.  ***************************************************************************** 
  85.  
  86.    7654 3210   DESCRIPTION                    ---------------------------- 
  87.                                               !                          ! 
  88.                Bits 7 6    Modifier           !          EXAMPLE         ! 
  89.    11.. ....     Flatted                      !                          ! 
  90.    10.. ....     Natural                      ! GIVEN byte 2 is hex 94   ! 
  91.    01.. ....     Sharped                      !       (binary 1001 0100) ! 
  92.    00.. ....     Double sharp (GFDC)          !                          ! 
  93.               or Double flat (ABE)            !                          ! 
  94.                                               ! Natural       10.. ....  ! 
  95.                Bits 5 4 3  Octave             ! Octave 5      ..01 0...  ! 
  96.    ..11 1...     Octave 0                     ! F Note>       .... .100  ! 
  97.    ..11 0...     Octave 1                     ---------------------------- 
  98.    ..10 1...     Octave 2 
  99.    ..10 0...     Octave 3 
  100.    ..01 1...     Octave 4 
  101.    ..01 0...     Octave 5 
  102.    ..00 1...     Octave 6 
  103.    ..00 0...     Octave 7 
  104.  
  105.                Bits 2 1 0  Note 
  106.    .... .111     B Note> 
  107.    .... .110     A Note> 
  108.    .... .101     G Note> 
  109.    .... .100     F Note> 
  110.    .... .011     E Note> 
  111.    .... .010     D Note> 
  112.    .... .001     C Note> 
  113.    .... .000     Rest> 
  114.  
  115.  ***************************************************************************** 
  116.  *                             COMMAND DATA PAIRS                            * 
  117.  ***************************************************************************** 
  118.  
  119.  Commands contain information other than musical note pitch and duration. For 
  120.  commands, the low-order two bits of the first byte are not 00. A whole set of 
  121.  commands are identified with a first byte value of hex 01. For these commands, 
  122.  the low-order four bits of the second byte can be used as a gross identifier, 
  123.  while the high order four bits often contain a numeric value. These commands 
  124.  are described by their second bytes below: 
  125.  
  126.  ***************************************************************************** 
  127.  *                      COMMANDS WITH FIRST BYTE = HEX 01                    * 
  128.  ***************************************************************************** 
  129.  
  130.    * BYTE2 *   HEX   COMMAND   VALUE 
  131.    7654 3210         NAME 
  132.    nnnn 0000   n0    DCY       Bits 7654 contain a value, 0-F 
  133.    nnnn n001         RUP       Bits 76543 contain a value, 0-1F 
  134.    nnnn 0010   n2    CAL       Bits 7654 contain a value, 0-F 
  135.    0000 0011   03    BMP       UP 
  136.    0001 0011   13    FLT       NO 
  137.    0010 0011   23    RNG       NO 
  138.    0011 0011   33    SNC       NO 
  139.    0100 0011   43    F-X       NO 
  140.    1nnn 0011   n3    DEF       Bits 7654 contain a value, 9-F, which is 8 
  141.                                less than the true value. 
  142.    0nnn n100         ATK       Bits 6543 contain a value, 0-F 
  143.    1nnn n100         SUS       Bits 6543 contain a value, 0-F 
  144.    0110 0011   63    LFO       0 
  145.    0111 0011   73    P&V       NO 
  146.    nnnn n101         RDN       Bits 76543 contain a value, 0-1F 
  147.    nnnn 0110   n6    DEF       Bits 7654 contain a value, 0-F 
  148.    nnn0 0111   n7    WAV       Bits 7 6 5  WAVEFORM 
  149.                                     0 0 0  Noise 
  150.                                     0 0 1  Triangle 
  151.                                     0 1 0  Sawtooth 
  152.                                     0 1 1  Triangle + Sawtooth 
  153.                                     1 0 0  Pulse 
  154.                                     1 0 1  Pulse + Triangle 
  155.                                     1 1 0  Pulse + Sawtooth 
  156.                                     1 1 1  Pulse + Triangle + Sawtooth 
  157.    nnn1 0111   n7    F-M       Bits 7 6 5  FILTER MODE 
  158.                                     0 0 0  Off (N) 
  159.                                     0 0 1  Low Pass 
  160.                                     0 1 0  Band Pass 
  161.                                     0 1 1  Low + Band 
  162.                                     1 0 0  High Pass 
  163.                                     1 0 1  High + Low 
  164.                                     1 1 0  High + Band 
  165.                                     1 1 1  High + Band + Low 
  166.    nnnn 1000   n8    RLS       Bits 7654 contain a value, 0-F 
  167.    nnnn 1010   nA    RES       Bits 7654 contain a value, 0-F 
  168.    0000 1011   0B    BMP       DN (Down) 
  169.    0001 1011   1B    FLT       YES 
  170.    0010 1011   2B    RNG       YES 
  171.    0011 1011   3B    SNC       YES 
  172.    0100 1011   4B    F-X       YES 
  173.    0101 1011   5B    3-O       YES 
  174.    0110 1011   6B    LFO       1 
  175.    0111 1011   7B    P&V       YES 
  176.    1nnn 1011   nB    CAL       Bits 7654 contain a value, 9-F, which is 8 less 
  177.                                than the true value. 
  178.    nnnn 1110   nE    VOL       Bits 7654 contain a value, 0-F 
  179.    0000 1111   0F    TAL       N/A 
  180.    0010 1111   2F    END       N/A 
  181.    0100 1111   4F    HLT       N/A 
  182.    0nn1 1111   nF    SRC       Bits 65 contain a value, 0-2 
  183.    1nnn 1111   nF    DST       Bits 654 contain a coded value: 
  184.                                000=0, 010=1, 101=2, 110=3 
  185.  
  186.  ***************************************************************************** 
  187.  *                   COMMANDS WHOSE FIRST BYTE IS NOT HEX 01                 * 
  188.  ***************************************************************************** 
  189.  
  190.  This group of command pairs generally has a first byte that defines the 
  191.  command, and the second byte gives a numeric value from hex 00 to FF (decimal 
  192.  range 0 to 255). There are a few variations, however, where the value range 
  193.  exceeds 255 (DTN, P-W, MS#, JIF, POR), and where negative values must be 
  194.  available (AUT, P-S, TPS, F-S, SCA, RTP, JIF, and DTN). 
  195.  
  196.    BYTE1    * BYTE2 *     CMD 
  197.     HEX     7654 3210     NAME    VALUE 
  198.  
  199.      n2     nnnn nnnn     P-W     The 12-bit number composed of byte 1, bits 
  200.                                   7-4, and all 8 bits of byte 2 give a range 
  201.                                   of 0-4095. 
  202.  
  203.      06     nnnn nnnn     TEM     If the second byte is zero, it is replaced 
  204.                                   by 256 (hex 100). The second byte value is 
  205.                                   then divided into 14,400. The whole number 
  206.                                   quotient is the number of quarter notes 
  207.                                   per minute. 
  208.  
  209.      16     nnnn nnnn     UTL     Second byte is the value. 
  210.  
  211.      26     nnnn nnnn     PNT     Second byte is the value. 
  212.  
  213.      36     nnnn nnnn     HED     Second byte is the value. 
  214.  
  215.      46     nnnn nnnn     FLG     Second byte is the value. 
  216.  
  217.      56     snnn nnnn     P-S     Second byte contains the value as a signed 
  218.                                   number with range -128 (hex 80) to +127 
  219.                                   (hex 7F). 
  220.  
  221.      66     snnn nnnn     F-S     Second byte contains the value as a signed 
  222.                                   number with range -128 (hex 80) to +127 
  223.                                   (hex 7F). 
  224.  
  225.      6E     snnn nnnn     SCA     Second byte contains the value as a signed 
  226.                                   number with range -7 (hex F9) to 7 (hex 07). 
  227.  
  228.      76     0nnn nnnn     VDP     Byte 2 bits 6-0 contain the value, 0-127. 
  229.  
  230.      86     nnnn nnnn     VRT     Second byte is the value. 
  231.  
  232.      96     snnn nnnn     AUT     Second byte contains the value as a signed 
  233.                                   number with range -128 (hex 80) to +127 
  234.                                   (hex 7F). 
  235.  
  236.      A6     hhhh ooos     TPS     The second byte contains the number of half- 
  237.                                   steps to transpose, from -95 to +95. Bit 0 
  238.                                   is the sign, 0=+, 1=-. Bits 3-1 give the 
  239.                                   number of whole octaves for negative values. 
  240.                                   For positive numbers, the number of octaves 
  241.                                   is 7 minus the number in bits 3-1. Bits 7-4 
  242.                                   give the additional half-steps less than an 
  243.                                   octave (0-11) for positive numbers. For 
  244.                                   negative numbers, the excess half-steps are 
  245.                                   11 minus the number in bits 7-4. 
  246.  
  247.      B6     nnnn nnnn     AUX     Second byte is the value. 
  248.  
  249.      C6     nnnn nnnn     PVD     Second byte has value, 0-127. 
  250.  
  251.      D6     nnnn nnnn     PVR     Second byte has value, 0-127. 
  252.  
  253.      E6     nnnn nnnn     MAX     Second byte has value, 0-255. 
  254.  
  255.      F6     nnnn nnnn     UTV     Second byte has value, 0-255. 
  256.  
  257.      0E     nnnn nnnn     F-C     Second byte is the value. 
  258.  
  259.      2E     nnnn nnnn     RTP     Second byte has the number of half-steps to 
  260.                                   adjust, -47 to +47 where 3 minus the number 
  261.                                   given by bits 210 give the number of whole 
  262.                                   octaves, and bits 76543 minus 11 is the 
  263.                                   number of additional half-steps less than 
  264.                                   an octave. 
  265.  
  266.      4E     nnnn nnnn     HLD     Second byte has a value, 0-255. 
  267.  
  268.      nE     nnnn nnnn     MS#     The 10-bit number composed of bits 7-6 of 
  269.                                   the 1st byte and all 8 bits of the second 
  270.                                   byte give a value of 0-1023. Bits 5 and 4 
  271.                                   are always 01 for this command, so the first 
  272.                                   byte may be 1E, 5E, 9E, or DE. 
  273.  
  274.      nE     nnnn nnnn     JIF     Bits 76 of the first byte are appended to 
  275.                                   the 8 bits of the second byte to form a 
  276.                                   10-bit value with a range of -200 to 757. 
  277.                                   Byte 1 bits 54 are always 11, so the first 
  278.                                   byte may be 3E, 7E, BE, or FE. 
  279.  
  280.      nA     nnnn nnnn     DTN     The 11-bit number composed of byte 1, bits 
  281.                                   7-5 and all 8 bits of byte 2 produces a 
  282.                                   value of 0-2047. If byte 1, bit 4 is 1, the 
  283.                                   number is negative, and is reduced by 2048 
  284.                                   for an effective range of -2048 to 2047. 
  285.  
  286.      nn     nnnn nnnn     POR     The 14-bit number composed of byte 1, bits 
  287.                                   7-2 and all 8 bits of the second byte. Value 
  288.                                   range is 16383. Bits 1 and 0 of byte 1 are 
  289.                                   always 11 for this command, all other bits 
  290.                                   may be any value. 
  291.  
  292.   
  293.