Minor fixes + start working on data output for gp2ly
authorJelmer Vernooij <jelmer@samba.org>
Sat, 8 Jan 2005 18:05:35 +0000 (19:05 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 8 Jan 2005 18:05:35 +0000 (19:05 +0100)
gp.h
gp2ly.c
ptb2ly.c

diff --git a/gp.h b/gp.h
index 6f828e95227039292bb8eb55cea13e32d0c6fb58..85e6025557269485fea8256cfd223c35edfd1de7 100644 (file)
--- a/gp.h
+++ b/gp.h
@@ -69,7 +69,7 @@ struct gpf {
        uint32_t bpm;
 
        uint32_t num_instruments;
-       struct gp_instrument {\r
+       struct gp_instrument {
                char dummy;
        } *instrument;
 
diff --git a/gp2ly.c b/gp2ly.c
index 647a4bac68becdce262bcf6eb6da38074622f70f..5df88168cf76d29d5eb2a7618ebedaf5822d95bf 100644 (file)
--- a/gp2ly.c
+++ b/gp2ly.c
@@ -73,6 +73,7 @@ int main(int argc, const char **argv)
        int c;
        int version = 0;
        int quiet = 0;
+       int i;
        const char *input;
        char *output = NULL;
        poptContext pc;
@@ -141,18 +142,23 @@ int main(int argc, const char **argv)
        ly_write_header(out, ret);
 
        ly_write_lyrics(out, ret);
-               
+
        fprintf(out, "\n\\score { << \n");
 
        fprintf(out, "\t\\context ChordNames {\n");
        fprintf(out, "\t}\n");
 
-       fprintf(out, "\t\\context StaffGroup <<\n");
-       fprintf(out, "\t\t\\context Staff { \n");
-       fprintf(out, "\t\t}\n");
-       fprintf(out, "\t\\context TabStaff { \n");
-       fprintf(out, "\t\t}\n");
-       fprintf(out, "\t>>\n");
+       for (i = 0; i < ret->num_tracks; i++) {
+               struct gp_track *t = &ret->tracks[i];
+               fprintf(out, "\t%% Track %d: %s\n", i, t->name);
+               fprintf(out, "\t%% %d frets, %d strings\n", t->num_frets, t->num_strings);
+               fprintf(out, "\t\\context StaffGroup <<\n");
+               fprintf(out, "\t\t\\context Staff { \n");
+               fprintf(out, "\t\t}\n");
+               fprintf(out, "\t\\context TabStaff { \n");
+               fprintf(out, "\t\t}\n");
+               fprintf(out, "\t>>\n\n");
+       }
 
        fprintf(out, "\t>>\n");
        
index b39a9e90b4b9154a140f654576fea4e22c762543..03bf7f360edc654791ba8615ca07c2157bde56b1 100644 (file)
--- a/ptb2ly.c
+++ b/ptb2ly.c
@@ -491,7 +491,7 @@ int ly_write_book_section(FILE *out, struct ptb_section *s, int section_num)
        int staff_num = 0;
        struct ptb_staff *st = s->staffs;
 
-       fprintf(out, "\t\\score {  \n");
+       fprintf(out, "\\score {  \n");
        fprintf(out, "\t\\header { \n");
        if (s->description) {
                fprintf(out, "\t\tpiece = \"%c: %s\"\n", s->letter, s->description);