//    Sfront, a SAOL to C translator
//    Copyright (C) 2001 John Lazzaro
//    This file: Garageband Sampled Piano: h subset
//    Maintainers's address: lazzaro@cs.berkeley.edu;
// 
// This license covers also covers SASL file in this directory.
// 
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation (Version 1, 1989).
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; see the file COPYING.  If not, write to
// the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


// table defines for a subset Garageband Grand Piano sample set

#define HSET left_024_h, right_024_h,\
  left_031_h, right_031_h,\
  left_035_h, right_035_h,\
  left_038_h, right_038_h,\
  left_042_h, right_042_h,\
  left_045_h, right_045_h,\
  left_050_h, right_050_h,\
  left_054_h, right_054_h,\
  left_058_h, right_058_h,\
  left_060_h, right_060_h,\
  left_062_h, right_062_h,\
  left_064_h, right_064_h,\
  left_065_h, right_065_h,\
  left_068_h, right_068_h,\
  left_070_h, right_070_h,\
  left_072_h, right_072_h,\
  left_077_h, right_077_h,\
  left_081_h, right_081_h,\
  left_086_h, right_086_h,\
  left_090_h, right_090_h,\
  left_095_h, right_095_h,\
  left_099_h, right_099_h,\
  left_101_h, right_101_h


#define LEFT_H_MAP left_024_h, /*  0 */ \
		       left_024_h, /*  1 */ \
		       left_024_h, /*  2 */ \
		       left_024_h, /*  3 */ \
		       left_024_h, /*  4 */ \
		       left_024_h, /*  5 */ \
		       left_024_h, /*  6 */ \
		       left_024_h, /*  7 */ \
		       left_024_h, /*  8 */ \
		       left_024_h, /*  9 */ \
		       left_024_h, /* 10 */ \
		       left_024_h, /* 11 */ \
		       left_024_h, /* 12 */ \
		       left_024_h, /* 13 */ \
		       left_024_h, /* 14 */ \
		       left_024_h, /* 15 */ \
		       left_024_h, /* 16 */ \
		       left_024_h, /* 17 */ \
		       left_024_h, /* 18 */ \
		       left_024_h, /* 19 */ \
		       left_024_h, /* 20 */ \
		       left_024_h, /* 21 */ \
		       left_024_h, /* 22 */ \
		       left_024_h, /* 23 */ \
		       left_024_h, /* 24 */ \
		       left_024_h, /* 25 */ \
		       left_024_h, /* 26 */ \
		       left_024_h, /* 27 */ \
		       left_031_h, /* 28 */ \
		       left_031_h, /* 29 */ \
		       left_031_h, /* 30 */ \
		       left_031_h, /* 31 */ \
		       left_031_h, /* 32 */ \
		       left_031_h, /* 33 */ \
		       left_035_h, /* 34 */ \
		       left_035_h, /* 35 */ \
		       left_035_h, /* 36 */ \
		       left_038_h, /* 37 */ \
		       left_038_h, /* 38 */ \
		       left_038_h, /* 39 */ \
		       left_042_h, /* 40 */ \
		       left_042_h, /* 41 */ \
		       left_042_h, /* 42 */ \
		       left_042_h, /* 43 */ \
		       left_045_h, /* 44 */ \
		       left_045_h, /* 45 */ \
		       left_045_h, /* 46 */ \
		       left_045_h, /* 47 */ \
		       left_045_h, /* 48 */ \
		       left_050_h, /* 49 */ \
		       left_050_h, /* 50 */ \
		       left_050_h, /* 51 */ \
		       left_050_h, /* 52 */ \
		       left_054_h, /* 53 */ \
		       left_054_h, /* 54 */ \
		       left_054_h, /* 55 */ \
		       left_054_h, /* 56 */ \
		       left_058_h, /* 57 */ \
		       left_058_h, /* 58 */ \
		       left_058_h, /* 59 */ \
		       left_060_h, /* 60 */ \
		       left_060_h, /* 61 */ \
		       left_062_h, /* 62 */ \
		       left_062_h, /* 63 */ \
		       left_064_h, /* 64 */ \
		       left_065_h, /* 65 */ \
		       left_065_h, /* 66 */ \
		       left_068_h, /* 67 */ \
		       left_068_h, /* 68 */ \
		       left_070_h, /* 69 */ \
		       left_070_h, /* 70 */ \
		       left_072_h, /* 71 */ \
		       left_072_h, /* 72 */ \
		       left_072_h, /* 73 */ \
		       left_072_h, /* 74 */ \
		       left_077_h, /* 75 */ \
		       left_077_h, /* 76 */ \
		       left_077_h, /* 77 */ \
		       left_077_h, /* 78 */ \
		       left_081_h, /* 79 */ \
		       left_081_h, /* 80 */ \
		       left_081_h, /* 81 */ \
		       left_081_h, /* 82 */ \
		       left_081_h, /* 83 */ \
		       left_086_h, /* 84 */ \
		       left_086_h, /* 85 */ \
		       left_086_h, /* 86 */ \
		       left_086_h, /* 87 */ \
		       left_086_h, /* 88 */ \
		       left_090_h, /* 89 */ \
		       left_090_h, /* 90 */ \
		       left_090_h, /* 91 */ \
		       left_090_h, /* 92 */ \
		       left_095_h, /* 93 */ \
		       left_095_h, /* 94 */ \
		       left_095_h, /* 95 */ \
		       left_095_h, /* 96 */ \
		       left_095_h, /* 97 */ \
		       left_099_h, /* 98 */ \
		       left_099_h, /* 99 */ \
		       left_101_h, /* 100 */ \
		       left_101_h, /* 101 */ \
		       left_101_h, /* 102 */ \
		       left_101_h, /* 103 */ \
		       left_101_h, /* 104 */ \
		       left_101_h, /* 105 */ \
		       left_101_h, /* 106 */ \
		       left_101_h, /* 107 */ \
		       left_101_h, /* 108 */ \
		       left_101_h, /* 109 */ \
		       left_101_h, /* 110 */ \
		       left_101_h, /* 111 */ \
		       left_101_h, /* 112 */ \
		       left_101_h, /* 113 */ \
		       left_101_h, /* 114 */ \
		       left_101_h, /* 115 */ \
		       left_101_h, /* 116 */ \
		       left_101_h, /* 117 */ \
		       left_101_h, /* 118 */ \
		       left_101_h, /* 119 */ \
		       left_101_h, /* 120 */ \
		       left_101_h, /* 121 */ \
		       left_101_h, /* 122 */ \
		       left_101_h, /* 123 */ \
		       left_101_h, /* 124 */ \
		       left_101_h, /* 125 */ \
		       left_101_h, /* 126 */ \
		       left_101_h  /* 127 */

#define RIGHT_H_MAP right_024_h, /*  0 */ \
		       right_024_h, /*  1 */ \
		       right_024_h, /*  2 */ \
		       right_024_h, /*  3 */ \
		       right_024_h, /*  4 */ \
		       right_024_h, /*  5 */ \
		       right_024_h, /*  6 */ \
		       right_024_h, /*  7 */ \
		       right_031_h, /*  8 */ \
		       right_031_h, /*  9 */ \
		       right_024_h, /* 10 */ \
		       right_024_h, /* 11 */ \
		       right_024_h, /* 12 */ \
		       right_024_h, /* 13 */ \
		       right_024_h, /* 14 */ \
		       right_024_h, /* 15 */ \
		       right_024_h, /* 16 */ \
		       right_024_h, /* 17 */ \
		       right_031_h, /* 18 */ \
		       right_031_h, /* 19 */ \
		       right_024_h, /* 20 */ \
		       right_024_h, /* 21 */ \
		       right_024_h, /* 22 */ \
		       right_024_h, /* 23 */ \
		       right_024_h, /* 24 */ \
		       right_024_h, /* 25 */ \
		       right_024_h, /* 26 */ \
		       right_024_h, /* 27 */ \
		       right_031_h, /* 28 */ \
		       right_031_h, /* 29 */ \
		       right_031_h, /* 30 */ \
		       right_031_h, /* 31 */ \
		       right_031_h, /* 32 */ \
		       right_031_h, /* 33 */ \
		       right_035_h, /* 34 */ \
		       right_035_h, /* 35 */ \
		       right_035_h, /* 36 */ \
		       right_038_h, /* 37 */ \
		       right_038_h, /* 38 */ \
		       right_038_h, /* 39 */ \
		       right_042_h, /* 40 */ \
		       right_042_h, /* 41 */ \
		       right_042_h, /* 42 */ \
		       right_042_h, /* 43 */ \
		       right_045_h, /* 44 */ \
		       right_045_h, /* 45 */ \
		       right_045_h, /* 46 */ \
		       right_045_h, /* 47 */ \
		       right_045_h, /* 48 */ \
		       right_050_h, /* 49 */ \
		       right_050_h, /* 50 */ \
		       right_050_h, /* 51 */ \
		       right_050_h, /* 52 */ \
		       right_054_h, /* 53 */ \
		       right_054_h, /* 54 */ \
		       right_054_h, /* 55 */ \
		       right_054_h, /* 56 */ \
		       right_058_h, /* 57 */ \
		       right_058_h, /* 58 */ \
		       right_058_h, /* 59 */ \
		       right_060_h, /* 60 */ \
		       right_060_h, /* 61 */ \
		       right_062_h, /* 62 */ \
		       right_062_h, /* 63 */ \
		       right_064_h, /* 64 */ \
		       right_065_h, /* 65 */ \
		       right_065_h, /* 66 */ \
		       right_068_h, /* 67 */ \
		       right_068_h, /* 68 */ \
		       right_070_h, /* 69 */ \
		       right_070_h, /* 70 */ \
		       right_072_h, /* 71 */ \
		       right_072_h, /* 72 */ \
		       right_072_h, /* 73 */ \
		       right_072_h, /* 74 */ \
		       right_077_h, /* 75 */ \
		       right_077_h, /* 76 */ \
		       right_077_h, /* 77 */ \
		       right_077_h, /* 78 */ \
		       right_081_h, /* 79 */ \
		       right_081_h, /* 80 */ \
		       right_081_h, /* 81 */ \
		       right_081_h, /* 82 */ \
		       right_081_h, /* 83 */ \
		       right_086_h, /* 84 */ \
		       right_086_h, /* 85 */ \
		       right_086_h, /* 86 */ \
		       right_086_h, /* 87 */ \
		       right_086_h, /* 88 */ \
		       right_090_h, /* 89 */ \
		       right_090_h, /* 90 */ \
		       right_090_h, /* 91 */ \
		       right_090_h, /* 92 */ \
		       right_095_h, /* 93 */ \
		       right_095_h, /* 94 */ \
		       right_095_h, /* 95 */ \
		       right_095_h, /* 96 */ \
		       right_095_h, /* 97 */ \
		       right_099_h, /* 98 */ \
		       right_099_h, /* 99 */ \
		       right_101_h, /* 100 */ \
		       right_101_h, /* 101 */ \
		       right_101_h, /* 102 */ \
		       right_101_h, /* 103 */ \
		       right_101_h, /* 104 */ \
		       right_101_h, /* 105 */ \
		       right_101_h, /* 106 */ \
		       right_101_h, /* 107 */ \
		       right_101_h, /* 108 */ \
		       right_101_h, /* 109 */ \
		       right_101_h, /* 110 */ \
		       right_101_h, /* 111 */ \
		       right_101_h, /* 112 */ \
		       right_101_h, /* 113 */ \
		       right_101_h, /* 114 */ \
		       right_101_h, /* 115 */ \
		       right_101_h, /* 116 */ \
		       right_101_h, /* 117 */ \
		       right_101_h, /* 118 */ \
		       right_101_h, /* 119 */ \
		       right_101_h, /* 120 */ \
		       right_101_h, /* 121 */ \
		       right_101_h, /* 122 */ \
		       right_101_h, /* 123 */ \
		       right_101_h, /* 124 */ \
		       right_101_h, /* 125 */ \
		       right_101_h, /* 126 */ \
		       right_101_h  /* 127 */



// global block that declares tables 

global { 

  table left_024_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/024_C0KM56_H.wav"
     );

  table right_024_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/024_C0KM56_H.wav"
     );

  table left_031_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/031_G0KM56_H.wav"
     );

  table right_031_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/031_G0KM56_H.wav"
     );

  table left_035_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/035_B0KM56_H.wav"
     );

  table right_035_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/035_B0KM56_H.wav"
     );

  table left_038_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/038_D1KM56_H.wav"
     );

  table right_038_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/038_D1KM56_H.wav"
     );

  table left_042_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/042_F#1KM56_H.wav"
     );

  table right_042_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/042_F#1KM56_H.wav"
     );

  table left_045_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/045_A1KM56_H.wav"
     );

  table right_045_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/045_A1KM56_H.wav"
     );

  table left_050_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/050_D2KM56_H.wav"
     );

  table right_050_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/050_D2KM56_H.wav"
     );

  table left_054_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/054_F#2KM56_H.wav"
     );

  table right_054_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/054_F#2KM56_H.wav"
     );

  table left_058_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/058_A#2KM56_H.wav"
     );

  table right_058_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/058_A#2KM56_H.wav"
     );

  table left_060_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/060_C3KM56_H.wav"
     );

  table right_060_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/060_C3KM56_H.wav"
     );

  table left_062_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/062_D3KM56_H.wav"
     );

  table right_062_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/062_D3KM56_H.wav"
     );

  table left_064_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/064_E3KM56_H.wav"
     );

  table right_064_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/064_E3KM56_H.wav"
     );

  table left_065_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/065_F3KM56_H.wav"
     );

  table right_065_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/065_F3KM56_H.wav"
     );

  table left_068_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/068_G#3KM56_H.wav"
     );

  table right_068_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/068_G#3KM56_H.wav"
     );

  table left_070_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/070_A#3KM56_H.wav"
     );

  table right_070_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/070_A#3KM56_H.wav"
     );

  table left_072_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/072_C4KM56_H.wav"
     );

  table right_072_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/072_C4KM56_H.wav"
     );

  table left_077_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/077_F4KM56_H.wav"
     );

  table right_077_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/077_F4KM56_H.wav"
     );

  table left_081_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/081_A4KM56_H.wav"
     );

  table right_081_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/081_A4KM56_H.wav"
     );

  table left_086_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/086_D5KM56_H.wav"
     );

  table right_086_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/086_D5KM56_H.wav"
     );

  table left_090_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/090_F#5KM56_H.wav"
     );

  table right_090_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/090_F#5KM56_H.wav"
     );

  table left_095_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/095_B5KM56_H.wav"
     );

  table right_095_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/095_B5KM56_H.wav"
     );

  table left_099_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/099_D#6KM56_H.wav"
     );

  table right_099_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/099_D#6KM56_H.wav"
     );

  table left_101_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/left/101_F6KM56_H.wav"
     );

  table right_101_h
    (sample, -1, 
     "/Users/lazzaro/work/class/mu209/lec/feb23/saol/samples/right/101_F6KM56_H.wav"
     );

}


// global block that sets pitch map

#define MINUS3 (0.840896415)
#define MINUS2 (0.890898718)
#define MINUS1 (0.943874313)
#define ROOT   (1.0)
#define PLUS1  (1.05946309)
#define PLUS2  (1.12246205)
#define PLUS3  (1.18920712)
#define PLUS4  (1.25992105)
#define PLUS5  (1.33483985)
#define PLUS6  (1.41421356)
#define PLUS7  (1.49830708)

global {
  table h_pitch(data, 128, 
	       /* 000 */   MINUS3, MINUS3, MINUS3, MINUS3, MINUS3, 
	       /* 005 */   MINUS3, MINUS3, MINUS3, MINUS3, MINUS3,
	       /* 010 */   MINUS3, MINUS3, MINUS3, MINUS3, MINUS3,
	       /* 015 */   MINUS3, MINUS3, MINUS3, MINUS3, MINUS3,
	       /* 020 */   MINUS3, MINUS3, MINUS2, MINUS1, ROOT,
	       /* 025 */   PLUS1,  PLUS2,  PLUS3,  MINUS3, MINUS2,
	       /* 030 */   MINUS1, ROOT,   PLUS1,  PLUS2,  MINUS1,
	       /* 035 */   ROOT,   PLUS1,  MINUS1, ROOT,   PLUS1,
	       /* 040 */   MINUS2, MINUS1, ROOT,   PLUS1,  MINUS1,
	       /* 045 */   ROOT,   PLUS1,  PLUS2,  PLUS3,  MINUS1,
	       /* 050 */   ROOT,   PLUS1,  PLUS2,  MINUS1, ROOT,
	       /* 055 */   PLUS1,  PLUS2,  MINUS1, ROOT,   PLUS1,
	       /* 060 */   ROOT,   PLUS1,  ROOT,   PLUS1,  ROOT,
	       /* 065 */   ROOT,   PLUS1,  MINUS1, ROOT,   MINUS1,
	       /* 070 */   ROOT,   MINUS1, ROOT,   PLUS1,  PLUS2,
	       /* 075 */   MINUS2, MINUS1, ROOT,   PLUS1,  MINUS2, 
	       /* 080 */   MINUS1, ROOT,   PLUS1,  PLUS2,  MINUS2,
	       /* 085 */   MINUS1, ROOT,   PLUS1,  PLUS2,  MINUS1,
	       /* 090 */   ROOT,   PLUS1,  PLUS2,  MINUS2, MINUS1,
	       /* 095 */   ROOT,   PLUS1,  PLUS2,  MINUS1, ROOT,
	       /* 100 */   MINUS1, ROOT,   PLUS1,  PLUS2,  PLUS3,
  	       /* 105 */   PLUS4,  PLUS5,  PLUS6,  PLUS7,  PLUS7,
	       /* 110 */   PLUS7,  PLUS7,   PLUS7,  PLUS7,  PLUS7,
	       /* 115 */   PLUS7,  PLUS7,   PLUS7,  PLUS7,  PLUS7,
	       /* 120 */   PLUS7,  PLUS7,   PLUS7,  PLUS7,  PLUS7,
	       /* 125 */   PLUS7,  PLUS7,   PLUS7);

}

#undef MINUS3
#undef MINUS2
#undef MINUS1
#undef ROOT
#undef PLUS1
#undef PLUS2
#undef PLUS3
#undef PLUS4
#undef PLUS5
#undef PLUS6
#undef PLUS7