wip
authorslack <slack@codemaniacs.com>
Thu, 23 Jul 2009 16:47:33 +0000 (18:47 +0200)
committerslack <slack@codemaniacs.com>
Thu, 23 Jul 2009 16:47:33 +0000 (18:47 +0200)
play.c
print_sizes.sh
thesong.c

diff --git a/play.c b/play.c
index 49888d84d988a0a3a1d894829c76349792946a15..34e86b9e29eb43b99765ec45127eab7218f9f711 100644 (file)
--- a/play.c
+++ b/play.c
@@ -70,9 +70,10 @@ void play(void *s, uint8 *stream, int len)
                 Track *cur_trk = &song->tracks[trknum];
                 int8 trans = song->transpose[cur_ptn][i];
 
-                unsigned int note = (cur_trk->notes[cur_row] & 0x0F);
-                if (note) {
-                    float vol = ((cur_trk->notes[cur_row])>>4) * 0.125f;
+                uint8 cell=cur_trk->notes[cur_row];
+                if (cell) {
+                    float vol = (cell>>4) * 0.125f;
+                    unsigned int note = cell & 0x0F;
                     note+=trans;
 
                     memset(&voices[i], 0, sizeof(Voice));
index e9424978507a9df876146fd5c60e33fb0699918b..6ece4c36eeb2057a5e8d0d72c4a2994ea17157b6 100644 (file)
@@ -6,7 +6,7 @@ for i in *.o; do
     COMPRESSED_SIZE=$(cat $i.bin.gz | wc -c)
     printf "%10s: %4d -> %4d bytes\n" ${i%.o} $ORIG_SIZE $COMPRESSED_SIZE
 done
-
+rm lolailo.o.bin
 cat *.bin > all.bin
 ORIG_SIZE=$(cat all.bin | wc -c)
 7z a -tGZIP -mx=9 -mfb=64 all.bin.gz all.bin > /dev/null
index 13f26009f88e00103845dc278a6884d5192966ec..011d19ba7a513d800d885bdd75925408e990946c 100644 (file)
--- a/thesong.c
+++ b/thesong.c
@@ -9,6 +9,8 @@ Song thesong={
         {0x01, 0x02, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00},
         {0x01, 0x02, 0x06, 0x06, 0x06, 0x05, 0x00, 0x00},
         {0x01, 0x02, 0x06, 0x06, 0x06, 0x06, 0x05, 0x00},
+        {0x01, 0x02, 0x06, 0x06, 0x06, 0x06, 0x05, 0x00},
+        {0x01, 0x02, 0x05, 0x07, 0x00, 0x00, 0x00, 0x00},
     }, // end patterns
     {  // begin txpose
         {-15, 0, 0, 0, 0},
@@ -17,6 +19,8 @@ Song thesong={
         {-15,0,24,0,0},
         {-15, 0, 12, 15, 19, 24},
         {-15, 0, 7, 11, 14, 19, 24},
+        {-15, 0, 8, 12, 15, 20, 24},
+        {-15,0,24,-27,0},
     }, // end txpose
     {  // begin tracks
         {{0x44,0,0,0,0,0,0,0,0,0,0,0}, 19},
@@ -25,17 +29,18 @@ Song thesong={
         {{0,0,0,0x51,0,0,0,0,0,0,0,0}, 19},
         {{0x94,0x54,0x14,0x94,0x54,0x14,0x94,0x54,0x14,0x94,0x54,0x14,}, 0},
         {{0xf1,0,0xf1,0,0xf1,0xf1,0,0xf1,0,0xf1,0,0xf1}, 53},
+       {{0x37,0,0,0x3d,0,0,0x37,0,0x3d,0,0x31,0,}, 0},
     }, // end tracks
     {  // begin instrument data
-        // 0
+        // 0 (bongo/bass)
        SIGMOID,10,1,
         SQUARE,0,20,
         LPF,2,40,
         MUL,1,3,
-       CONST,8,0,
+       CONST,10,0,
        MUL,1,2,
         ENDI,
-       // 19
+       // 19 (wind)
        SIGMOID,2,15,
        SIGMOID,-10,6,
        MUL,1,2,
@@ -48,12 +53,13 @@ Song thesong={
        LPF,2,10,
        MUL,1,8,
        ENDI,
+       // 53 (piano-ish)
        CONST,0,30,
        CONST,0,10,
        SIGMOID,10,1,
-       SQUARE,0,20,
-       SQUARE,12,15,
-       SQUARE,-12,10,
+       SQUARE,0,15,
+       SQUARE,12,10,
+       SQUARE,-12,20,
        SUM,1,2,
        SUM,1,4,
        MUL,1,6,
@@ -65,7 +71,7 @@ Song thesong={
        // 53
     }, // end instrument data
     {  // begin playlist
-        0,1,2,1,3,3,3,3,3,3,3,3,3,4,4,5,5,4,4,5,5,4,4,5,5,255,
+        0,1,2,1,3,3,3,3,4,4,5,5,6,6,5,5,4,4,5,5,6,6,5,5,255,
     }, // end playlist
 };