From ba6ecb6689df21aea46ef98bc2c424cc5441d424 Mon Sep 17 00:00:00 2001 From: slack Date: Sat, 25 Jul 2009 06:53:23 +0200 Subject: [PATCH] checkpoint 6:53AM --- play.c | 8 ++++---- song.h | 2 +- thesong.c | 10 ++++++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/play.c b/play.c index f127f5f..0aa7088 100644 --- a/play.c +++ b/play.c @@ -6,7 +6,7 @@ #include -float row_duration=60.0f/320.0f; // denominator == RPM +float row_duration=60.0f/340.0f; // denominator == RPM Voice voices[NUM_CHANNELS]; float mix_buf[BUFFER_SIZE]={0}; uint8 last_voice_used=0; @@ -84,9 +84,9 @@ void play(void *s, uint8 *stream, int len) for (int i=0; i1.0f) tmp=1.0f; - //else if(tmp<-1.0f) tmp=-1.0f; - buf[i]=(int16)(tmp*32767.0f); + if (tmp>1.0f) tmp=1.0f; + else if(tmp<-1.0f) tmp=-1.0f; + buf[i]=(int16)(tmp*30720.0f); } #ifdef OUTFILE diff --git a/song.h b/song.h index a0ae0a3..e5007c7 100644 --- a/song.h +++ b/song.h @@ -11,7 +11,7 @@ #define NUM_PATTERNS 20 #define NUM_CHANNELS 12 -#define NUM_TRACKS 15 +#define NUM_TRACKS 20 #define TRACK_LENGTH 12 #define INSTRUMENT_DATA_LENGTH 300 #define PLAYLIST_LENGTH 50 diff --git a/thesong.c b/thesong.c index 97f4703..867a3d9 100644 --- a/thesong.c +++ b/thesong.c @@ -17,6 +17,8 @@ Song thesong={ {0x05, 0x07, 0x06, 0x06, 0x06, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // 11 - bongo+piano+bass1+melody4 {0x05, 0x07, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // 12 - bongo+bass1+piano {0x05, 0x07, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // 13 - bongo+bass1+piano + {0x05, 0x07, 0x06, 0x06, 0x06, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // 11 - bongo+piano+bass1+melody5 + {0x05, 0x07, 0x06, 0x06, 0x06, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // 11 - bongo+piano+bass1+melody5 }, // end patterns { // begin txpose {-15, 0, 0, 0, 0}, // wind1 @@ -33,6 +35,8 @@ Song thesong={ {24,6,7,11,16,21,21,21}, // bongo+piano+bass1+melody4 {24,9,7,11,14}, // bongo+bass1+piano {24,6,7,11,16}, // bongo+bass1+piano + {24,9,7,11,14,25,}, // bongo+piano+bass1+melody5 + {24,9,7,11,14,25,}, // bongo+piano+bass1+melody6 }, // end txpose { // begin tracks {{0,0,0,0,0,0,0,0,0,0,0,0}, 0}, @@ -48,7 +52,9 @@ Song thesong={ {{0,0,0,0,0,0,0,0,0,0,0,0x6e}, 143}, // a {{0x6b,0,0x69,0,0,0x67,0,0,0,0,0,0}, 115}, // b {{0,0,0,0,0,0,0,0,0,0,0,0x6e}, 171}, // c - {{0x6e,0,0,0,0,0x6c,0x6b,0,0x6c,0,0,0x6e}, 171}, // d + {{0x6e,0,0,0,0,0x6c,0x6b,0,0x6c,0,0,0x6e}, 115}, // d + {{0x6f,0,0,0x6e,0,0,0x6c,0,0,0x6a,0,0}, 115}, // e - melody 5 + {{0x67,0,0,0x65,0,0x63,0,0,0,0,0,0}, 115}, // f - melody 6 }, // end tracks { // begin instrument data // 0 (bongo) @@ -129,7 +135,7 @@ Song thesong={ }, // end instrument data { // begin playlist - 0,1,2,1,3,3,3,3,4,5,6,7,4,5,6,7,8,9,10,11,8,9,10,11,12,12,13,13,12,12,13,13,255, + 0,1,2,1,3,3,3,3,4,5,6,7,4,5,6,7,8,9,10,11,8,9,10,11,12,12,13,13,12,12,13,13,14,15,14,15,255, }, // end playlist }; -- 2.34.1