checkpoint 6:53AM
authorslack <slack@codemaniacs.com>
Sat, 25 Jul 2009 04:53:23 +0000 (06:53 +0200)
committerslack <slack@codemaniacs.com>
Sat, 25 Jul 2009 04:53:23 +0000 (06:53 +0200)
play.c
song.h
thesong.c

diff --git a/play.c b/play.c
index f127f5f6594a27d1b56f9ca64558d15a0e2dc9ad..0aa708851cc76a1e915954bd86f11675167b1df1 100644 (file)
--- a/play.c
+++ b/play.c
@@ -6,7 +6,7 @@
 #include <string.h>
 
 
-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; i<num_samples; ++i)
     {
         float tmp = mix_buf[i];
-        //if (tmp>1.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 a0ae0a35fe2d19f02567ddf28fd794eec9d55508..e5007c7b33578bf5be1327fed900f16df300c4aa 100644 (file)
--- 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
index 97f470323a7ad954d750931029df68b3598b6267..867a3d90d2c38c7503f0de07eb04fe3b5488e397 100644 (file)
--- 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
 };