Skip to content

Commit

Permalink
Fixed lilypond file structure
Browse files Browse the repository at this point in the history
  • Loading branch information
sertansenturk committed Apr 16, 2016
1 parent 13cd0f2 commit 06d2f36
Show file tree
Hide file tree
Showing 6 changed files with 503 additions and 544 deletions.
511 changes: 243 additions & 268 deletions demo.ipynb

Large diffs are not rendered by default.

47 changes: 20 additions & 27 deletions musicxml2lilypond/ScoreConverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,26 @@ def _write_lilypond(measures, makam, usul, form, beats, beat_type,
# getting headers
if render_metadata:
poet_str = """
poet = \"Lyricist: {0:s}\"""".\
format(lyricist) if lyricist else ''

ly_stream = ["""
\\include "makam.ly" """ + """
\\header { """ + """
tagline = \"\"
title = \"{0}\"
composer = \"{1}\"
piece = \"Makam: {2}, Form: {3}, Usul: {4}\"""".format(
work_title, composer, form, makam, usul) + poet_str +
"""
}
{
%\\override Score.SpacingSpanner.strict-note-spacing = ##t
%\\set Score.proportionalNotationDuration = #(ly:make-moment 1/8)
"""]
\tpoet = \"Lyricist: {0:s}\"""".format(lyricist) if lyricist else ''

metadata_str = """
\ttitle = \"{0}\"
\tcomposer = \"{1}\"
\tpiece = \"Makam: {2}, Form: {3}, Usul: {4}\"""".format(
work_title, composer, form, makam, usul) + poet_str
else:
ly_stream = ["""
\\include "makam.ly" """ + """
\\header { """ + """
tagline = \"\"
""""\n\t\t}" + """
{
%\\override Score.SpacingSpanner.strict-note-spacing = ##t
%\\set Score.proportionalNotationDuration = #(ly:make-moment 1/8)
"""]
metadata_str = ''

ly_stream = ["""
\\include "makam.ly" """ + """
\\header {
\ttagline = \"\"""" + metadata_str +
"""
}
{
\t%\\override Score.SpacingSpanner.strict-note-spacing = ##t
\t%\\set Score.proportionalNotationDuration = #(ly:make-moment 1/8)
"""]

octaves = {"2": ",", "3": "", "4": "\'", "5": "\'\'", "6": "\'\'\'",
"7": "\'\'\'\'", "r": ""}
Expand Down Expand Up @@ -158,7 +151,7 @@ def _write_lilypond(measures, makam, usul, form, beats, beat_type,
pos = 0

for note in measure:
temp_note = "\n\t"
temp_note = "\n\t\t"
line += 1
if note[6] is None: # gracenote
# for now we display it as a 8th \grace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3308,8 +3308,5 @@
</lyric>
</note>
</measure>
<measure number="29-0">
<attributes/>
</measure>
</part>
</score-partwise>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[[2, 4, 13], [3, 92, 14], [4, 182, 15], [5, 270, 16], [6, 300, 17], [7, 324, 18], [8, 348, 19], [9, 437, 20], [10, 462, 21], [11, 4, 23], [12, 93, 24], [13, 183, 25], [14, 208, 26], [15, 231, 27], [16, 320, 28], [17, 351, 29], [18, 377, 30], [19, 401, 31], [20, 490, 32], [21, 4, 34], [22, 94, 35], [23, 120, 36], [24, 144, 37], [25, 169, 38], [26, 258, 39], [27, 4, 41], [28, 86, 42], [29, 176, 43], [30, 264, 44], [31, 353, 45], [32, 441, 46], [33, 530, 47], [34, 619, 48], [35, 708, 49], [36, 798, 50], [37, 4, 52], [38, 93, 53], [39, 184, 54], [40, 273, 55], [41, 304, 56], [42, 329, 57], [43, 354, 58], [44, 444, 59], [45, 470, 60], [46, 4, 62], [47, 93, 63], [48, 183, 64], [49, 208, 65], [50, 231, 66], [51, 320, 67], [52, 351, 68], [53, 377, 69], [54, 401, 70], [55, 490, 71], [56, 4, 73], [57, 94, 74], [58, 120, 75], [59, 144, 76], [60, 169, 77], [61, 258, 78], [62, 4, 80], [63, 86, 81], [64, 176, 82], [65, 264, 83], [66, 353, 84], [67, 441, 85], [68, 530, 86], [69, 4, 88], [70, 94, 89], [71, 185, 90], [72, 276, 91], [73, 301, 92], [74, 392, 93], [75, 417, 94], [76, 442, 95], [77, 4, 97], [78, 26, 98], [79, 116, 99], [80, 140, 100], [81, 229, 101], [82, 318, 102], [83, 342, 103], [84, 432, 104], [85, 4, 106], [86, 27, 107], [87, 118, 108], [88, 143, 109], [89, 168, 110], [90, 259, 111], [91, 283, 112], [92, 371, 113], [93, 461, 114], [94, 486, 115], [95, 511, 116], [96, 536, 117], [97, 561, 118], [98, 4, 120], [99, 94, 121], [100, 185, 122], [101, 277, 123], [102, 303, 124], [103, 395, 125], [104, 421, 126], [105, 447, 127], [106, 4, 129], [107, 27, 130], [108, 118, 131], [109, 143, 132], [110, 233, 133], [111, 323, 134], [112, 348, 135], [113, 439, 136], [114, 4, 138], [115, 28, 139], [116, 120, 140], [117, 146, 141], [118, 172, 142], [119, 264, 143], [120, 289, 144], [121, 4, 146], [122, 91, 147], [123, 174, 148], [124, 263, 149], [125, 354, 150], [126, 444, 151], [127, 535, 152], [128, 625, 153], [129, 4, 155], [130, 95, 156], [131, 188, 157], [132, 281, 158], [133, 307, 159], [134, 335, 160], [135, 362, 161], [136, 4, 163], [137, 27, 164], [138, 118, 165], [139, 211, 166], [140, 301, 167], [141, 4, 169], [142, 27, 170], [143, 118, 171], [144, 210, 172], [145, 4, 174], [146, 91, 175], [147, 175, 176], [148, 266, 177], [149, 355, 178], [150, 444, 179], [151, 535, 180], [152, 625, 181], [153, 4, 183], [154, 95, 184], [155, 188, 185], [156, 281, 186], [157, 307, 187], [158, 335, 188], [159, 362, 189], [160, 4, 191], [161, 91, 192], [162, 182, 193], [163, 273, 194], [164, 363, 195], [165, 4, 197], [166, 91, 198], [167, 182, 199], [168, 207, 200], [169, 298, 201], [170, 324, 202], [171, 4, 204], [172, 87, 205], [173, 178, 206], [174, 267, 207], [175, 357, 208], [176, 446, 209], [177, 4, 211], [178, 95, 212], [179, 187, 213], [180, 279, 214], [181, 305, 215], [182, 397, 216], [183, 423, 217], [184, 449, 218], [185, 4, 220], [186, 27, 221], [187, 118, 222], [188, 143, 223], [189, 233, 224], [190, 323, 225], [191, 348, 226], [192, 439, 227], [193, 4, 229], [194, 28, 230], [195, 120, 231], [196, 146, 232], [197, 172, 233], [198, 264, 234], [199, 289, 235], [200, 378, 236], [201, 469, 237], [202, 495, 238], [203, 521, 239], [204, 547, 240], [205, 573, 241], [206, 4, 243], [207, 95, 244], [208, 187, 245], [209, 279, 246], [210, 305, 247], [211, 397, 248], [212, 423, 249], [213, 449, 250], [214, 4, 252], [215, 27, 253], [216, 118, 254], [217, 143, 255], [218, 233, 256], [219, 323, 257], [220, 348, 258], [221, 439, 259], [222, 4, 261], [223, 28, 262], [224, 120, 263], [225, 146, 264], [226, 172, 265], [227, 264, 266], [228, 289, 267]]
[[2, 4, 13], [3, 93, 14], [4, 184, 15], [5, 273, 16], [6, 304, 17], [7, 329, 18], [8, 354, 19], [9, 444, 20], [10, 470, 21], [11, 4, 23], [12, 94, 24], [13, 185, 25], [14, 211, 26], [15, 235, 27], [16, 325, 28], [17, 357, 29], [18, 384, 30], [19, 409, 31], [20, 499, 32], [21, 4, 34], [22, 95, 35], [23, 122, 36], [24, 147, 37], [25, 173, 38], [26, 263, 39], [27, 4, 41], [28, 87, 42], [29, 178, 43], [30, 267, 44], [31, 357, 45], [32, 446, 46], [33, 536, 47], [34, 626, 48], [35, 716, 49], [36, 807, 50], [37, 4, 52], [38, 94, 53], [39, 186, 54], [40, 276, 55], [41, 308, 56], [42, 334, 57], [43, 360, 58], [44, 451, 59], [45, 478, 60], [46, 4, 62], [47, 94, 63], [48, 185, 64], [49, 211, 65], [50, 235, 66], [51, 325, 67], [52, 357, 68], [53, 384, 69], [54, 409, 70], [55, 499, 71], [56, 4, 73], [57, 95, 74], [58, 122, 75], [59, 147, 76], [60, 173, 77], [61, 263, 78], [62, 4, 80], [63, 87, 81], [64, 178, 82], [65, 267, 83], [66, 357, 84], [67, 446, 85], [68, 536, 86], [69, 4, 88], [70, 95, 89], [71, 187, 90], [72, 279, 91], [73, 305, 92], [74, 397, 93], [75, 423, 94], [76, 449, 95], [77, 4, 97], [78, 27, 98], [79, 118, 99], [80, 143, 100], [81, 233, 101], [82, 323, 102], [83, 348, 103], [84, 439, 104], [85, 4, 106], [86, 28, 107], [87, 120, 108], [88, 146, 109], [89, 172, 110], [90, 264, 111], [91, 289, 112], [92, 378, 113], [93, 469, 114], [94, 495, 115], [95, 521, 116], [96, 547, 117], [97, 573, 118], [98, 4, 120], [99, 95, 121], [100, 187, 122], [101, 280, 123], [102, 307, 124], [103, 400, 125], [104, 427, 126], [105, 454, 127], [106, 4, 129], [107, 28, 130], [108, 120, 131], [109, 146, 132], [110, 237, 133], [111, 328, 134], [112, 354, 135], [113, 446, 136], [114, 4, 138], [115, 29, 139], [116, 122, 140], [117, 149, 141], [118, 176, 142], [119, 269, 143], [120, 295, 144], [121, 4, 146], [122, 92, 147], [123, 176, 148], [124, 266, 149], [125, 358, 150], [126, 449, 151], [127, 541, 152], [128, 632, 153], [129, 4, 155], [130, 96, 156], [131, 190, 157], [132, 284, 158], [133, 311, 159], [134, 340, 160], [135, 368, 161], [136, 4, 163], [137, 28, 164], [138, 120, 165], [139, 214, 166], [140, 305, 167], [141, 4, 169], [142, 28, 170], [143, 120, 171], [144, 213, 172], [145, 4, 174], [146, 92, 175], [147, 177, 176], [148, 269, 177], [149, 359, 178], [150, 449, 179], [151, 541, 180], [152, 632, 181], [153, 4, 183], [154, 96, 184], [155, 190, 185], [156, 284, 186], [157, 311, 187], [158, 340, 188], [159, 368, 189], [160, 4, 191], [161, 92, 192], [162, 184, 193], [163, 276, 194], [164, 367, 195], [165, 4, 197], [166, 92, 198], [167, 184, 199], [168, 210, 200], [169, 302, 201], [170, 329, 202], [171, 4, 204], [172, 88, 205], [173, 180, 206], [174, 270, 207], [175, 361, 208], [176, 451, 209], [177, 4, 211], [178, 96, 212], [179, 189, 213], [180, 282, 214], [181, 309, 215], [182, 402, 216], [183, 429, 217], [184, 456, 218], [185, 4, 220], [186, 28, 221], [187, 120, 222], [188, 146, 223], [189, 237, 224], [190, 328, 225], [191, 354, 226], [192, 446, 227], [193, 4, 229], [194, 29, 230], [195, 122, 231], [196, 149, 232], [197, 176, 233], [198, 269, 234], [199, 295, 235], [200, 385, 236], [201, 477, 237], [202, 504, 238], [203, 531, 239], [204, 558, 240], [205, 585, 241], [206, 4, 243], [207, 96, 244], [208, 189, 245], [209, 282, 246], [210, 309, 247], [211, 402, 248], [212, 429, 249], [213, 456, 250], [214, 4, 252], [215, 28, 253], [216, 120, 254], [217, 146, 255], [218, 237, 256], [219, 328, 257], [220, 354, 258], [221, 446, 259], [222, 4, 261], [223, 29, 262], [224, 122, 263], [225, 149, 264], [226, 176, 265], [227, 269, 266], [228, 295, 267]]
Loading

0 comments on commit 06d2f36

Please sign in to comment.