home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / audio / tracker / song.h < prev    next >
C/C++ Source or Header  |  2014-05-19  |  2KB  |  88 lines

  1. /* song.h */
  2.  
  3. /* internal data structures for the soundtracker player routine....
  4.  */
  5.  
  6. /* $Author: espie $
  7.  * $Date: 1991/11/17 23:07:58 $
  8.  * $Revision: 2.1 $
  9.  * $Log: song.h,v $
  10.  * Revision 2.1  1991/11/17  23:07:58  espie
  11.  * Added some symbolic constants.
  12.  *
  13.  * Revision 2.0  1991/11/17  21:42:08  espie
  14.  * New version.
  15.  *
  16.  * Revision 1.1  1991/11/04  13:23:59  espie
  17.  * Initial revision
  18.  *
  19.  *
  20.  */
  21.  
  22.  
  23. #define NUMBER_SAMPLES 32
  24.  
  25. #define BLOCK_LENGTH 64
  26. #define NUMBER_TRACKS 4
  27. #define NUMBER_PATTERNS 128
  28.  
  29. #define NUMBER_EFFECTS 16
  30.  
  31. #define MIN_PITCH 113
  32. #define MAX_PITCH 1023
  33.  
  34. #define MIN_VOLUME 0
  35. #define MAX_VOLUME 64
  36.  
  37. /* the fuzz in note pitch */
  38. #define FUZZ 2
  39.  
  40. /* we refuse to allocate more than 500000 bytes for one sample */
  41. #define MAX_SAMPLE_LENGTH 500000
  42.  
  43. struct sample_info
  44.    {
  45.    char *name;
  46.    int  length, rp_offset, rp_length;
  47.    int volume;
  48.    int finetune;
  49.    SAMPLE *start, *rp_start;
  50.    };
  51.  
  52. /* the actual parameters may be split in two halves occasionnally */
  53.  
  54. #define LOW(para) ((para) & 15)
  55. #define HI(para) ((para) >> 4)
  56.  
  57. struct event
  58.    {
  59.    unsigned char sample_number;
  60.    unsigned char effect;
  61.    unsigned char parameters;
  62.    unsigned char note;
  63.    int pitch;
  64.    };
  65.  
  66. struct block
  67.    {
  68.    struct event e[NUMBER_TRACKS][BLOCK_LENGTH];
  69.    };
  70.     
  71.         
  72. struct song_info
  73.    {
  74.    int length;
  75.    int maxpat;
  76.    char patnumber[NUMBER_PATTERNS];
  77.    struct block *pblocks;
  78.    };
  79.  
  80. struct song
  81.    {
  82.    char *title;
  83.       /* sample 0 is always a dummy sample */
  84.    struct sample_info *samples[NUMBER_SAMPLES];
  85.    struct song_info *info;
  86.    };
  87.  
  88.