From: slack Date: Thu, 23 Jul 2009 16:47:33 +0000 (+0200) Subject: wip X-Git-Url: http://slack.codemaniacs.com/git/?a=commitdiff_plain;h=0e39a4ed8a07a49f1bf87f4775f0bf321d404c9b;p=lolailo.git wip --- diff --git a/play.c b/play.c index 49888d8..34e86b9 100644 --- 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)); diff --git a/print_sizes.sh b/print_sizes.sh index e942497..6ece4c3 100644 --- a/print_sizes.sh +++ b/print_sizes.sh @@ -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 diff --git a/thesong.c b/thesong.c index 13f2600..011d19b 100644 --- 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 };