home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / MM1 / SOUNDUTILS / mm1_tracker.lzh / TRACKER4.6 / song.h < prev    next >
Text File  |  1994-11-24  |  3KB  |  131 lines

  1. /* song.h 
  2.     vi:ts=3 sw=3:
  3.  */
  4.  
  5. /* internal data structures for the soundtracker player routine....
  6.  */
  7.  
  8. /* $Id: song.h,v 4.2 1994/11/15 16:11:01 espie Exp espie $
  9.  * $Log: song.h,v $
  10.  * Revision 4.2  1994/11/15  16:11:01  espie
  11.  * *** empty log message ***
  12.  *
  13.  *
  14.  * Revision 4.0  1994/01/11  17:55:59  espie
  15.  * REAL_MAX_PITCH for better player.
  16.  * REAL_MAX_PITCH != MAX_PITCH.
  17.  * Added samples_start.
  18.  *
  19.  * Revision 2.5  1992/10/31  11:18:00  espie
  20.  * New fields for optimized resampling.
  21.  * Exchanged __ANSI__ to SIGNED #define.
  22.  */
  23.  
  24. #ifdef SIGNED
  25. typedef signed char SAMPLE;
  26. #else
  27. typedef char SAMPLE;
  28. #endif
  29.  
  30. #define NUMBER_SAMPLES 32
  31.  
  32. #define BLOCK_LENGTH 64
  33. #define NUMBER_TRACKS 4
  34. #define NUMBER_PATTERNS 128
  35.  
  36. #define NUMBER_EFFECTS 40
  37.  
  38. /* some effects names */
  39. #define EFF_ARPEGGIO    0
  40. #define EFF_DOWN        1
  41. #define EFF_UP          2
  42. #define EFF_PORTA       3
  43. #define EFF_VIBRATO     4
  44. #define EFF_PORTASLIDE  5
  45. #define EFF_VIBSLIDE    6
  46. #define EFF_OFFSET      9
  47. #define EFF_VOLSLIDE    10
  48. #define EFF_FF          11
  49. #define EFF_VOLUME      12
  50. #define EFF_SKIP        13
  51. #define EFF_EXTENDED    14
  52. #define EFF_SPEED       15
  53. #define EFF_NONE        16
  54. #define EXT_BASE        16
  55. #define EFF_SMOOTH_UP   (EXT_BASE + 1)
  56. #define EFF_SMOOTH_DOWN (EXT_BASE + 2)
  57. #define EFF_CHG_FTUNE   (EXT_BASE + 5)
  58. #define EFF_LOOP        (EXT_BASE + 6)
  59. #define EFF_RETRIG      (EXT_BASE + 9)
  60. #define EFF_S_UPVOL     (EXT_BASE + 10)
  61. #define EFF_S_DOWNVOL   (EXT_BASE + 11)
  62. #define EFF_NOTECUT     (EXT_BASE + 12)
  63. #define EFF_LATESTART   (EXT_BASE + 13)
  64. #define EFF_DELAY       (EXT_BASE + 14)
  65.  
  66. #define SAMPLENAME_MAXLENGTH 22
  67. #define TITLE_MAXLENGTH 20
  68.  
  69. #define MIN_PITCH 113
  70. #define MAX_PITCH 856
  71. #define REAL_MAX_PITCH 1050
  72.  
  73. #define MIN_VOLUME 0
  74. #define MAX_VOLUME 64
  75.  
  76. /* the fuzz in note pitch */
  77. #define FUZZ 2
  78.  
  79. /* we refuse to allocate more than 500000 bytes for one sample */
  80. #define MAX_SAMPLE_LENGTH 500000
  81.  
  82. struct sample_info
  83.    {
  84.    char *name;
  85.    int  length, rp_offset, rp_length;
  86.    unsigned long  fix_length, fix_rp_length;
  87.    int volume;
  88.    int finetune;
  89.    SAMPLE *start, *rp_start;
  90.    };
  91.  
  92. /* the actual parameters may be split in two halves occasionnally */
  93.  
  94. #define LOW(para) ((para) & 15)
  95. #define HI(para) ((para) >> 4)
  96.  
  97. struct event
  98.    {
  99.    unsigned char sample_number;
  100.    unsigned char effect;
  101.    unsigned char parameters;
  102.    unsigned char note;
  103.    int pitch;
  104.    };
  105.  
  106. struct block
  107.    {
  108.    struct event e[NUMBER_TRACKS][BLOCK_LENGTH];
  109.    };
  110.     
  111.         
  112. struct song_info
  113.    {
  114.    int length;
  115.    int maxpat;
  116.    int transpose;
  117.    char patnumber[NUMBER_PATTERNS];
  118.    struct block *pblocks;
  119.    };
  120.  
  121. struct song
  122.    {
  123.    char *title;
  124.       /* sample 0 is always a dummy sample */
  125.    struct sample_info samples[NUMBER_SAMPLES];
  126.    struct song_info info;
  127.    long samples_start;
  128.    };
  129.  
  130. #define AMIGA_CLOCKFREQ 3575872
  131.