{"commit":"95921bd0b3f35a8228ab20f0cb4ce7d235903a3d","subject":"#27 capitalize & kern out admin0 labels","message":"#27 capitalize & kern out admin0 labels\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Italic', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Bold Italic', 'Unifont Bold';\n\n@label_color_transport: #524c4c;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n\n@text_character_spacing_sm: 0.7;\n@text_character_spacing_md: 1.2;\n@text_character_spacing_lg: 1.7;\n@text_character_spacing_xlg: 2.2;\n\n@text_font_halo_radius_sm: 1.5;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: #F7F7E6;\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-character-spacing: @text_character_spacing_sm;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: 2;\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n \/\/ arbitrary default shield\n shield-file: url(images\/ca.svg);\n shield-fill: white;\n shield-transform: scale(0.052, 0.052);\n shield-face-name: \"Roadgeek 2005 Series D Regular\";\n shield-name: [ref];\n shield-min-distance: 250;\n shield-spacing: 250;\n \/\/ half the width of the shield to prevent from wrapping\n shield-min-padding: 10;\n\n [ref=~'I \\d+'] {\n shield-file: url(images\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n shield-fill: white;\n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(images\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n shield-fill: white;\n }\n\n [ref=~'US \\d+'] {\n shield-file: url(images\/us.svg);\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: #333;\n shield-text-dy: 1;\n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(images\/ca.svg);\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-fill: white;\n shield-text-dy: 2.5;\n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n \n text-face-name: @text_font_water_bold;\n text-wrap-width: 40;\n text-wrap-character: ' ';\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_xlg;\n text-align: center;\n\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][scalerank<4][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][scalerank<7][changed!='']\n{\n text-name: [name];\n\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n text-face-name: @text_font_water_bold;\n text-wrap-width: 50;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_lg;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80; \n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_sm;\n text-size: 18;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-size: 22;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-character-spacing: @text_character_spacing_sm;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_lg;\n text-size: 22;\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: 24;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: 34;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#aries-places-labels {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<6],\n [zoom=7][scalerank<7],\n [zoom=8][scalerank<8],\n [zoom=9][scalerank<9],\n [zoom=10][scalerank<10],\n [zoom=11][scalerank<11],\n [zoom=12][scalerank<12],\n [zoom=13][scalerank<13], \n [zoom=14][scalerank<14] \n [zoom>=15][scalerank<17]{\n\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-min-distance: 3;\n \/\/ text-min-padding: 5;\n text-dy: 5;\n text-dx: 5;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n \/\/ text-allow-overlap: true;\n text-placement-type: simple;\n \/\/ text-avoid-edges: true; \n\n [zoom>=4] {\n text-size: @text_font_size_xsm;\n text-placements: \"W,E,S\";\n \n [population>700000] {\n text-size: @text_font_size_xsm * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_xsm * 1.3;\n } \n }\n\n [zoom>=5]{\n text-size: @text_font_size_sm;\n text-placements: \"E,W,N\";\n text-min-distance: 5;\n \n [population>700000] {\n text-size: @text_font_size_sm * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_sm * 1.3;\n text-allow-overlap: true;\n } \n }\n\n [zoom>=6]{\n text-size: @text_font_size_medium;\n text-placements: \"W,E,N\";\n\n [population>700000] {\n text-size: @text_font_size_medium * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_medium * 1.5;\n } \n }\n\n [zoom>=10]{\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_halo_high;\n \n [population>700000] {\n text-size: @text_font_size_large * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_large * 1.5;\n } \n }\n\n }\n}\n\n#aries-places-points {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<6],\n [zoom=7][scalerank<7],\n [zoom=8][scalerank<8] {\n\n marker-fill: #2e2115;\n marker-line-width: 0;\n marker-width: 5;\n marker-ignore-placement: true;\n\n [population>700000] {\n marker-width: 7;\n }\n\n }\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n\n","old_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Italic', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Bold Italic', 'Unifont Bold';\n\n@label_color_transport: #524c4c;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n\n@text_character_spacing_sm: 0.7;\n@text_character_spacing_md: 1.2;\n@text_character_spacing_lg: 1.7;\n@text_character_spacing_xlg: 2.2;\n\n@text_font_halo_radius_sm: 1.5;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: #F7F7E6;\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-character-spacing: @text_character_spacing_sm;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: 2;\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n \/\/ arbitrary default shield\n shield-file: url(images\/ca.svg);\n shield-fill: white;\n shield-transform: scale(0.052, 0.052);\n shield-face-name: \"Roadgeek 2005 Series D Regular\";\n shield-name: [ref];\n shield-min-distance: 250;\n shield-spacing: 250;\n \/\/ half the width of the shield to prevent from wrapping\n shield-min-padding: 10;\n\n [ref=~'I \\d+'] {\n shield-file: url(images\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n shield-fill: white;\n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(images\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n shield-fill: white;\n }\n\n [ref=~'US \\d+'] {\n shield-file: url(images\/us.svg);\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: #333;\n shield-text-dy: 1;\n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(images\/ca.svg);\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-fill: white;\n shield-text-dy: 2.5;\n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n \n text-face-name: @text_font_water_bold;\n text-wrap-width: 40;\n text-wrap-character: ' ';\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_xlg;\n text-align: center;\n\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][scalerank<4][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][scalerank<7][changed!='']\n{\n text-name: [name];\n\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n text-face-name: @text_font_water_bold;\n text-wrap-width: 50;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_lg;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 18;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-size: 22;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 22;\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#aries-places-labels {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<6],\n [zoom=7][scalerank<7],\n [zoom=8][scalerank<8],\n [zoom=9][scalerank<9],\n [zoom=10][scalerank<10],\n [zoom=11][scalerank<11],\n [zoom=12][scalerank<12],\n [zoom=13][scalerank<13], \n [zoom=14][scalerank<14] \n [zoom>=15][scalerank<17]{\n\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-min-distance: 3;\n \/\/ text-min-padding: 5;\n text-dy: 5;\n text-dx: 5;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n \/\/ text-allow-overlap: true;\n text-placement-type: simple;\n \/\/ text-avoid-edges: true; \n\n [zoom>=4] {\n text-size: @text_font_size_xsm;\n text-placements: \"W,E\";\n \n [population>700000] {\n text-size: @text_font_size_xsm * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_xsm * 1.5;\n } \n }\n\n [zoom>=5]{\n text-size: @text_font_size_sm;\n text-placements: \"E,W\";\n \n [population>700000] {\n text-size: @text_font_size_sm * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_sm * 1.5;\n text-allow-overlap: true;\n } \n }\n\n [zoom>=6]{\n text-size: @text_font_size_medium;\n text-placements: \"W,E,N\";\n\n [population>700000] {\n text-size: @text_font_size_medium * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_medium * 1.5;\n } \n }\n\n [zoom>=10]{\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_halo_high;\n \n [population>700000] {\n text-size: @text_font_size_large * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_large * 1.5;\n } \n }\n\n }\n}\n\n#aries-places-points {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<6],\n [zoom=7][scalerank<7],\n [zoom=8][scalerank<8] {\n\n marker-fill: #2e2115;\n marker-line-width: 0;\n marker-width: 5;\n marker-ignore-placement: true;\n\n [population>700000] {\n marker-width: 7;\n }\n\n }\n}\n\n\/\/ #city_labels_z4,\n\/\/ #city_labels_z5,\n\/\/ #city_labels_z6 {\n\/\/ \/\/ for debugging\n\/\/ \/\/::outline {\n\/\/ \/\/ polygon-fill: #fff;\n\/\/ \/\/ polygon-opacity: 0.1;\n\/\/ \/\/}\n\/\/ text-name: [name];\n\/\/ text-face-name: @text_font_city;\n\/\/ text-fill: @label_color_city;\n\/\/ text-placement: interior;\n\/\/ text-vertical-alignment: bottom;\n\/\/ text-min-distance: 5;\n\/\/ text-dy: -5;\n\/\/ text-halo-radius: @text_font_halo_radius_sm;\n\/\/ text-halo-fill: @label_color_halo_low; \n\n\/\/ [justified='left'] {\n\/\/ \/\/text-horizontal-alignment: left;\n\/\/ text-horizontal-alignment: middle;\n\/\/ \/\/text-dx: 20;\n\/\/ }\n\n\/\/ [justified='right'] {\n\/\/ \/\/text-horizontal-alignment: right;\n\/\/ text-horizontal-alignment: middle;\n\/\/ \/\/text-dx: -20;\n\/\/ }\n\n\/\/ [zoom>=4] {\n\/\/ text-size: @text_font_size_xxsm;\n\/\/ }\n\n\/\/ [zoom>=5] {\n\/\/ text-size: @text_font_size_xsm;\n\/\/ }\n\n\/\/ [font_size>=14] {\n\/\/ text-size: @text_font_size_medium;\n\/\/ }\n\n\/\/ [font_size>=16] {\n\/\/ text-size: @text_font_size_medium_plus;\n\/\/ }\n\n\/\/ [font_size>=18] {\n\/\/ text-size: @text_font_size_large;\n\/\/ }\n\/\/ }\n\n\/\/ #city_labels_z7,\n\/\/ #city_labels_z8, {\n\/\/ \/\/ for debugging\n\/\/ \/\/::outline {\n\/\/ \/\/ polygon-fill: #fff;\n\/\/ \/\/ polygon-opacity: 0.3;\n\/\/ \/\/}\n\/\/ [justified='left'] {\n\/\/ text-horizontal-alignment: left;\n\/\/ text-dx: 15;\n\/\/ }\n\n\/\/ [justified='right'] {\n\/\/ text-horizontal-alignment: right;\n\/\/ text-dx: -15;\n\/\/ }\n\n\/\/ text-name: [name];\n\/\/ text-face-name: @text_font_city;\n\/\/ text-fill: @label_color_city;\n\/\/ text-size: @text_font_size_sm;\n\/\/ text-min-distance: 5;\n\/\/ text-allow-overlap: true;\n\/\/ text-halo-radius: @text_font_halo_radius_sm;\n\/\/ text-halo-fill: @label_color_halo_low; \n\n\/\/ [font_size>=14] {\n\/\/ text-size: @text_font_size_medium;\n\/\/ }\n\n\/\/ [font_size>=20] {\n\/\/ text-size: @text_font_size_large;\n\/\/ }\n\/\/ }\n\n\/\/ #city_labels_z9,\n\/\/ #city_labels_z10 {\n\/\/ text-name: [name];\n\/\/ text-face-name: @text_font_city;\n\/\/ text-fill: @label_color_city;\n\/\/ text-size: @text_font_size_medium_plus;\n\/\/ text-halo-radius: @text_font_halo_radius_large;\n\/\/ text-halo-fill: @label_color_halo_high;\n\/\/ text-halo-comp-op: overlay;\n\n\/\/ [font_size>=20] {\n\/\/ text-size: @text_font_size_large;\n\/\/ }\n \n\/\/ [zoom>=11] {\n\/\/ text-halo-fill: @label_color_places_halo_low;\n\/\/ }\n\/\/ }\n\n\/\/ #city_points_z4,\n\/\/ #city_points_z5, \n\/\/ #city_points_z6,\n\/\/ #city_points_z7,\n\/\/ #city_points_z8 {\n\/\/ marker-ignore-placement: true;\n\/\/ marker-width: 5;\n\/\/ marker-fill: #2e2115;\n\/\/ marker-line-width: 0;\n\/\/ }\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"8f20d848b5008c52e8a71981c4d723e26fb193cc","subject":"Fixed: @staff is now added to harm objects","message":"Fixed: @staff is now added to harm objects\n\nRefs: rism-ch\/verovio#280\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n\n \/\/ add chord symbols to the measure lines\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(chordsym._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n\n \/\/ add chord symbols to the measure lines\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(chordsym._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"de721fae5a8fff1c2aba34edeb7d9c9609a9c6f4","subject":"minor text fixes","message":"minor text fixes\n","repos":"silph-io\/osm-silph","old_file":"osm-bright\/palette.mss","new_file":"osm-bright\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";*\/\n\n\n@sans_lt_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans_bold: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_bold_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold Italic\",\"DejaVu Sans Bold Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #DCDCDC;\n@water: #8ec9fb;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #bedb9f;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n\n@building: #F4F4F4;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: @standard_line;\n@motorway_fill: @standard_fill;\n@motorway_case: @standard_case;\n\n@trunk_line: @standard_line;\n@trunk_fill: @standard_fill;\n@trunk_case: @standard_case;\n\n@primary_line: @standard_line;\n@primary_fill: @standard_fill;\n@primary_case: @standard_case;\n\n@secondary_line: @standard_line;\n@secondary_fill: @standard_fill;\n@secondary_case: @standard_case;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,34%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n@poi_text: #888;\n\n@road_text: #444;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";*\/\n\n\n@sans_lt_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans_bold: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_bold_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold Italic\",\"DejaVu Sans Bold Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #DCDCDC;\n@water: #8ec9fb;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #bedb9f;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n\n@building: #F4F4F4;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@highway_fill #e4c049;\n\n@motorway_line: @standard_line;\n@motorway_fill: @standard_fill;\n@motorway_case: @standard_case;\n\n@trunk_line: @standard_line;\n@trunk_fill: @standard_fill;\n@trunk_case: @standard_case;\n\n@primary_line: @standard_line;\n@primary_fill: @standard_fill;\n@primary_case: @standard_case;\n\n@secondary_line: @standard_line;\n@secondary_fill: @standard_fill;\n@secondary_case: @standard_case;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,34%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n@poi_text: #888;\n\n@road_text: #444;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"c1bb3593eba0ca8d4d3ffc2970222c82de4abf1c","subject":"Update palette.mss","message":"Update palette.mss","repos":"brelevenix\/osm-bright-tregor","old_file":"osm-bright\/palette.mss","new_file":"osm-bright\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Open Sans Regular\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_lt_italic: \"Open Sans Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans: \"Open Sans Semibold\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_italic: \"Open Sans Semibold Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans_bold: \"Open Sans Bold\",\"DejaVu Sans Bold\",\"unifont Medium\";\n@sans_bold_italic: \"Open Sans Bold Italic\",\"DejaVu Sans Bold Italic\",\"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* COLOR PALETTE\n\/* ================================================================== *\/\n\n@black: #000000; \n@white: #ffffff;\n\n@grey-light: #cccccc;\n@grey-medium: #999999;\n@grey-strong: #333333;\n\n@orange: #FF6600;\n\n@blue: #0000ff;\n\n@yellow: #ffff33;\n@yellow-light: #ffff99;\n\n@green: #006600;\n@green-light: #99ff99;\n\n@purple: #9164CD;\n@pink: #FFB4E6;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: @green-light;\n@water: @blue;\n@grass: @green;\n@beach: @yellow;\n@park: @green;\n@cemetery: @green-light;\n@wooded: @green;\n@agriculture: @green-light;\n\n@building: @grey-strong;\n@hospital: @green-light;\n@school: @green-light;\n@sports: @green-light;\n\n@residential: @green-light;\n@commercial: @green-light;\n@industrial: @green-light;\n@parking: @green-light;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: @white;\n@motorway_fill: lighten(@motorway_line,80%);\n@motorway_case: @motorway_line * 0.8;\n\n@trunk_line: @white;\n@trunk_fill: lighten(@trunk_line,70%);\n@trunk_case: @trunk_line * 0.7;\n\n@primary_line: @white;\n@primary_fill: lighten(@primary_line,60%);\n@primary_case: @primary_line * 0.6;\n\n@secondary_line: @white;\n@secondary_fill: lighten(@secondary_line,50%);\n@secondary_case: @secondary_line * 0.5;\n\n@standard_line: @white;\n@standard_fill: @white;\n@standard_case: @black;\n\n@pedestrian_line: @purple;\n@pedestrian_fill: @white;\n@pedestrian_case: @black;\n\n@cycle_line: @purple;\n@cycle_fill: @white;\n@cycle_case: @black;\n\n@rail_line: @black;\n@rail_fill: @black;\n@rail_case: @black;\n\n@aeroway: @black;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: @purple;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,0%);\n\n@country_text: @black;\n@country_halo: @place_halo;\n\n@state_text: @black;\n@state_halo: @place_halo;\n\n@city_text: @black;\n@city_halo: @place_halo;\n\n@town_text: @black;\n@town_halo: @place_halo;\n\n@poi_text: @black;\n\n@road_text: @black;\n@road_halo: @place_halo;\n\n@other_text: @black;\n@other_halo: @place_halo;\n\n@locality_text: @black;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: @black;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Open Sans Regular\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_lt_italic: \"Open Sans Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans: \"Open Sans Semibold\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_italic: \"Open Sans Semibold Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans_bold: \"Open Sans Bold\",\"DejaVu Sans Bold\",\"unifont Medium\";\n@sans_bold_italic: \"Open Sans Bold Italic\",\"DejaVu Sans Bold Italic\",\"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* COLOR PALETTE\n\/* ================================================================== *\/\n\n@black: #000000; \n@white: #ffffff;\n\n@grey-light: #cccccc;\n@grey-medium: #999999;\n@grey-strong: #333333;\n\n@orange: #FF6600;\n\n@blue: #0000ff;\n\n@yellow: #ffff33;\n@yellow-light: #ffff99;\n\n@green: #006600;\n@green-light: #99ff99;\n\n@purple: #9164CD;\n@pink: #FFB4E6;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: @green-light;\n@water: @blue;\n@grass: @green;\n@beach: @yellow;\n@park: @green;\n@cemetery: @green-light;\n@wooded: @green;\n@agriculture: @green-light;\n\n@building: @grey-strong;\n@hospital: @green-light;\n@school: @green-light;\n@sports: @green-light;\n\n@residential: @green-light;\n@commercial: @@green-light;\n@industrial: @green-light;\n@parking: @green-light;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: @white;\n@motorway_fill: lighten(@motorway_line,80%);\n@motorway_case: @motorway_line * 0.8;\n\n@trunk_line: @white;\n@trunk_fill: lighten(@trunk_line,70%);\n@trunk_case: @trunk_line * 0.7;\n\n@primary_line: @white;\n@primary_fill: lighten(@primary_line,60%);\n@primary_case: @primary_line * 0.6;\n\n@secondary_line: @white;\n@secondary_fill: lighten(@secondary_line,50%);\n@secondary_case: @secondary_line * 0.5;\n\n@standard_line: @white;\n@standard_fill: @white;\n@standard_case: @black;\n\n@pedestrian_line: @purple;\n@pedestrian_fill: @white;\n@pedestrian_case: @black;\n\n@cycle_line: @purple;\n@cycle_fill: @white;\n@cycle_case: @black;\n\n@rail_line: @black;\n@rail_fill: @black;\n@rail_case: @black;\n\n@aeroway: @black;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: @purple;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,0%);\n\n@country_text: @black;\n@country_halo: @place_halo;\n\n@state_text: @black;\n@state_halo: @place_halo;\n\n@city_text: @black;\n@city_halo: @place_halo;\n\n@town_text: @black;\n@town_halo: @place_halo;\n\n@poi_text: @black;\n\n@road_text: @black;\n@road_halo: @place_halo;\n\n@other_text: @black;\n@other_halo: @place_halo;\n\n@locality_text: @black;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: @black;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"349fd9f3303658559d9c03fe484e2d3f10af1f76","subject":"Fixed: Undefined bar object","message":"Fixed: Undefined bar object\n\nThis commit is an alternate fix for #61.\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportProcessors.mss","new_file":"src\/ExportProcessors.mss","new_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = sibmei2.GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = sibmei2.GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer) {\n \/\/$module(ExportProcessors.mss)\n ret = null;\n\n if (bobj.Duration < 256)\n {\n \/\/ if this object is an eighth note but is not beamed, and if the\n \/\/ active beam is set, null out the active beam and return null.\n if (bobj.Beam = NoBeam and layer._property:ActiveBeamId != null)\n {\n layer._property:ActiveBeamId = null;\n return ret;\n }\n\n \/*\n It's possible that Sibelius records a 'continue beam' at the start\n of a beamed group. Visually, this doesn't look out of place if the previous\n note was a quarter note or higher. \n \n The first check we do is if the note has a 'continue beam' attribute and\n the previous note has a duration higher than 256 (quarter) then we probably have\n a false negative (i.e., there is the start of a beam, but it isn't necessarily\n encoded correctly).\n *\/\n falseNegative = False;\n next_obj = bobj.NextItem(bobj.VoiceNumber, 'NoteRest');\n\n if ((bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam) and layer._property:ActiveBeamId = null)\n {\n \/\/ by all accounts this should be a beamed note, but we'll need to double-check.\n prev_obj = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n if (prev_obj != null and (prev_obj.Duration >= 256 or prev_obj.NoteCount = 0))\n {\n falseNegative = True;\n }\n }\n\n if (next_obj != null and (bobj.Beam = StartBeam or falseNegative = True) and next_obj.Beam = ContinueBeam and next_obj.Duration < 256)\n {\n \/\/ if:\n \/\/ - we're not at the end of the bar\n \/\/ - we have a start beam\n \/\/ - the next note is a continue beam\n \/\/ - the next note is a beamable duration (safeguard against quarter and longer\n \/\/ notes with Beam = ContinueBeam, which for some reason can actually occur)\n beam = libmei.Beam();\n layer._property:ActiveBeamId = beam._id;\n\n \/\/ return the beam so that we can add it to the tree.\n ret = beam;\n }\n\n if (layer._property:ActiveBeamId != null and (bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam))\n {\n beamid = layer._property:ActiveBeamId;\n beam = libmei.getElementById(beamid);\n ret = beam;\n }\n }\n else\n {\n if (layer._property:ActiveBeamId != null)\n {\n \/\/ this is a break in any active beam, so register it as such.\n layer._property:ActiveBeamId = null;\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction ProcessTuplet (bobj, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.ParentTupletIfAny = null)\n {\n return null;\n }\n\n if (layer._property:ActiveTupletId = null)\n {\n tupletObject = bobj.ParentTupletIfAny;\n\n tuplet = libmei.Tuplet();\n\n layer._property:ActiveTupletObject = tupletObject;\n layer._property:ActiveTupletId = tuplet._id;\n\n if (libmei.GetName(meielement) = 'beam')\n {\n \/\/ get the first child\n startid = meielement.children[0];\n }\n else\n {\n startid = meielement._id;\n }\n\n libmei.AddAttribute(tuplet, 'startid', '#' & startid);\n libmei.AddAttribute(tuplet, 'num', tupletObject.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObject.Right);\n\n tupletStyle = tupletObject.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObject.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n return tuplet;\n }\n else\n {\n tid = layer._property:ActiveTupletId;\n t = libmei.getElementById(tid);\n\n if (IsLastNoteInTuplet(bobj))\n {\n libmei.AddAttribute(t, 'endid', '#' & meielement._id);\n layer._property:ActiveTupletObject = null;\n layer._property:ActiveTupletId = null;\n }\n\n return t;\n }\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet, layer) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n \n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it \n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n tupletSpan._property:AddedToMeasure = False;\n\n layer._property:ActiveTupletId = tupletSpan._id;\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (j = 0)\n {\n libmei.AddAttribute(sylel, 'wordpos', 'i'); \/\/ 'initial'\n\n if (lyric_word.Length > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n\n syltext = libmei.GetText(sylel);\n\n if (utils.Pos('_', syltext) > -1)\n {\n \/\/ Syllable elision. split this syllable element by underscore.\n syllables = MSplitString(syltext, '_');\n sylarray = CreateSparseArray();\n\n \/\/ reset the text of the first syllable element to the first half of the syllable. \n libmei.SetText(sylel, syllables[0]);\n libmei.AddAttribute(sylel, 'con', 'b');\n\n for s = 1 to syllables.Length\n {\n esyl = libmei.Syl();\n libmei.SetText(esyl, syllables[s]);\n libmei.AddChild(verse, esyl);\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n if (name = 'chord')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'chord'));\n }\n\n libmei.AddChild(obj, verse);\n }\n else\n {\n Log('Could not find note object for syl ' & syl);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so \n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessTremolo (bobj) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.DoubleTremolos = 0)\n {\n return null;\n }\n\n Log('Fingered tremolo: ' & bobj.DoubleTremolos);\n tremEl = libmei.FTrem();\n libmei.AddAttribute(tremEl, 'slash', bobj.DoubleTremolos);\n libmei.AddAttribute(tremEl, 'measperf')\n \n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n \/\/ Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n \/\/ Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n case ('217')\n {\n \/\/ up-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('218')\n {\n \/\/ down-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('233')\n {\n \/\/ up-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('234')\n {\n \/\/ down-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('242')\n {\n \/\/ triple staccato\n return null;\n }\n case ('243')\n {\n \/\/ snap\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n libmei.AddAttributeValue(nobj, 'artic', 'snap');\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n }\n} \/\/$end\n","old_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = sibmei2.GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = sibmei2.GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer) {\n \/\/$module(ExportProcessors.mss)\n ret = null;\n\n if (bobj.Duration < 256)\n {\n \/\/ if this object is an eighth note but is not beamed, and if the\n \/\/ active beam is set, null out the active beam and return null.\n if (bobj.Beam = NoBeam and layer._property:ActiveBeamId != null)\n {\n layer._property:ActiveBeamId = null;\n return ret;\n }\n\n \/*\n It's possible that Sibelius records a 'continue beam' at the start\n of a beamed group. Visually, this doesn't look out of place if the previous\n note was a quarter note or higher. \n \n The first check we do is if the note has a 'continue beam' attribute and\n the previous note has a duration higher than 256 (quarter) then we probably have\n a false negative (i.e., there is the start of a beam, but it isn't necessarily\n encoded correctly).\n *\/\n falseNegative = False;\n next_obj = bobj.NextItem(bobj.VoiceNumber, 'NoteRest');\n\n if ((bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam) and layer._property:ActiveBeamId = null)\n {\n \/\/ by all accounts this should be a beamed note, but we'll need to double-check.\n prev_obj = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n if (prev_obj != null and (prev_obj.Duration >= 256 or prev_obj.NoteCount = 0))\n {\n falseNegative = True;\n }\n }\n\n if (next_obj != null and (bobj.Beam = StartBeam or falseNegative = True) and next_obj.Beam = ContinueBeam and next_obj.Duration < 256)\n {\n \/\/ if:\n \/\/ - we're not at the end of the bar\n \/\/ - we have a start beam\n \/\/ - the next note is a continue beam\n \/\/ - the next note is a beamable duration (safeguard against quarter and longer\n \/\/ notes with Beam = ContinueBeam, which for some reason can actually occur)\n beam = libmei.Beam();\n layer._property:ActiveBeamId = beam._id;\n\n \/\/ return the beam so that we can add it to the tree.\n ret = beam;\n }\n\n if (layer._property:ActiveBeamId != null and (bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam))\n {\n beamid = layer._property:ActiveBeamId;\n beam = libmei.getElementById(beamid);\n ret = beam;\n }\n }\n else\n {\n if (layer._property:ActiveBeamId != null)\n {\n \/\/ this is a break in any active beam, so register it as such.\n layer._property:ActiveBeamId = null;\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction ProcessTuplet (bobj, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.ParentTupletIfAny = null)\n {\n return null;\n }\n\n if (layer._property:ActiveTupletId = null)\n {\n tupletObject = bobj.ParentTupletIfAny;\n\n tuplet = libmei.Tuplet();\n\n layer._property:ActiveTupletObject = tupletObject;\n layer._property:ActiveTupletId = tuplet._id;\n\n if (libmei.GetName(meielement) = 'beam')\n {\n \/\/ get the first child\n startid = meielement.children[0];\n }\n else\n {\n startid = meielement._id;\n }\n\n libmei.AddAttribute(tuplet, 'startid', '#' & startid);\n libmei.AddAttribute(tuplet, 'num', tupletObject.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObject.Right);\n\n tupletStyle = tupletObject.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObject.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n return tuplet;\n }\n else\n {\n tid = layer._property:ActiveTupletId;\n t = libmei.getElementById(tid);\n\n if (IsLastNoteInTuplet(bobj))\n {\n libmei.AddAttribute(t, 'endid', '#' & meielement._id);\n layer._property:ActiveTupletObject = null;\n layer._property:ActiveTupletId = null;\n }\n\n return t;\n }\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet, layer) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n \n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it \n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n tupletSpan._property:AddedToMeasure = False;\n\n layer._property:ActiveTupletId = tupletSpan._id;\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (j = 0)\n {\n libmei.AddAttribute(sylel, 'wordpos', 'i'); \/\/ 'initial'\n\n if (lyric_word.Length > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n\n syltext = libmei.GetText(sylel);\n\n if (utils.Pos('_', syltext) > -1)\n {\n \/\/ Syllable elision. split this syllable element by underscore.\n syllables = MSplitString(syltext, '_');\n sylarray = CreateSparseArray();\n\n \/\/ reset the text of the first syllable element to the first half of the syllable. \n libmei.SetText(sylel, syllables[0]);\n libmei.AddAttribute(sylel, 'con', 'b');\n\n for s = 1 to syllables.Length\n {\n esyl = libmei.Syl();\n libmei.SetText(esyl, syllables[s]);\n libmei.AddChild(verse, esyl);\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n if (name = 'chord')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'chord'));\n }\n\n libmei.AddChild(obj, verse);\n }\n else\n {\n Log('Could not find note object for syl ' & syl);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so \n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessTremolo (bobj) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.DoubleTremolos = 0)\n {\n return null;\n }\n\n Log('Fingered tremolo: ' & bobj.DoubleTremolos);\n tremEl = libmei.FTrem();\n libmei.AddAttribute(tremEl, 'slash', bobj.DoubleTremolos);\n libmei.AddAttribute(tremEl, 'measperf')\n \n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n\n voicenum = sobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n case ('217')\n {\n \/\/ up-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('218')\n {\n \/\/ down-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('233')\n {\n \/\/ up-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('234')\n {\n \/\/ down-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('242')\n {\n \/\/ triple staccato\n return null;\n }\n case ('243')\n {\n \/\/ snap\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n libmei.AddAttributeValue(nobj, 'artic', 'snap');\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n }\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"3dc90a4322cbe26db3e3a1216392d109b89bd458","subject":"Improve layout of Dymo labels","message":"Improve layout of Dymo labels\n","repos":"Andrey-Pavlov\/toner-carto,stamen\/toner-carto","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport_bold: 'Arial Unicode MS Bold';\n@text_font_physical_bold: 'Arial Unicode MS Bold';\n@text_font_administrative: 'Arial Unicode MS Regular';\n@text_font_administrative_bold: 'Arial Unicode MS Bold';\n@text_font_water: 'Arial Unicode MS Italic';\n@text_font_water_bold: 'Arial Unicode MS Bold Italic';\n@text_font_city: 'Arial Unicode MS Regular';\n@text_font_city_bold: 'Arial Unicode MS Bold';\n@text_font_poi_bold: 'Arial Unicode MS Italic'; \/\/ n-dash is broken in Bold Italic\n\n@label_color_transport: #000;\n@label_color_transport_halo: #fff;\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_administrative: #000;\n@label_color_administrative_halo: #fff;\n@label_color_city: #000;\n@label_color_city_halo: #fff;\n@label_color_poi: #000;\n@label_color_poi_halo: #fff;\n\n@text_font_size_xxsm: 10;\n@text_font_size_xsm: 12;\n@text_font_size_sm: 13;\n@text_font_size_medium: 14;\n@text_font_size_medium_plus: 16;\n@text_font_size_large: 18;\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n\n#minor_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-avoid-edges: true;\n \n [zoom=16] {\n text-dy: 10; \n text-spacing: 124; \n text-size: @text_font_size_xxsm; \n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom=17] {\n text-dy: 13; \n text-spacing: 180; \n text-size: @text_font_size_xsm;\n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom>=18] {\n text-size: @text_font_size_xsm; \n text-spacing: 400; \n text-halo-radius: @text_font_halo_radius_large; \n }\n}\n\n#major_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-spacing: 100;\n text-avoid-edges: true;\n\n [zoom>=16][highway='primary'] {\n\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [is_tunnel=1][zoom>=15] {\n\ttext-fill: #777;\n }\n [zoom=12] {\n text-dy: 7;\n text-size: @text_font_size_xsm;\n text-min-distance: 4;\n }\n [zoom=13] {\n text-dy: 8;\n text-min-distance: 5;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_sm;\n }\n [highway='primary'] {\n\t\ttext-size: 13;\n }\n }\n\n [zoom=14] {\n text-min-distance: 5;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: 9;\n \ttext-size: @text_font_size_medium;\n } \n [highway='secondary'] {\n\t\ttext-dy: 7;\n \ttext-size: @text_font_size_xsm;\n text-halo-radius: 1.5;\n }\n }\n\n [zoom=15] {\n text-min-distance: 10;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: @text_font_size_xsm;\n \ttext-size: 15;\n }\n [highway='secondary'],[highway='tertiary'] {\n\t\ttext-dy: 11;\n \ttext-size: @text_font_size_sm;\n }\n }\n\n [zoom=16] {\n text-min-distance: 12;\n text-dy: 13;\n [highway='trunk'],[highway='primary'] { \n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'],[highway='tertiary'] {\t\n \ttext-spacing: 124;\n \ttext-size: @text_font_size_sm;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom=17] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-dy: 16;\n \ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-dy: 14;\n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-dy: 14; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_medium;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n\t\ttext-dy: 13; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_xsm; \n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom>=18] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-size: @text_font_size_medium; \n\t\ttext-spacing: 300;\n\t\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n text-size: @text_font_size_xsm;\n text-spacing: 400;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n}\n\n#poi_station_labels {\n [zoom>=16][railway='station'] {\n shield-name: \"[label]\";\n shield-face-name: @text_font_transport_bold;\n shield-fill: white;\n shield-size: 12;\n shield-file: url('images\/subway_shield_small.svg');\n }\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_physical_halo;\n text-halo-fill: @label_color_physical;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-fill: @label_color_physical;\n text-halo-fill: @label_color_physical_halo;\n \n text-line-spacing: -1;\n text-min-distance: 10;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n \n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=16] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#continents[zoom>=1][zoom<3]\n{\n \ttext-name: \"[name]\";\n text-face-name: @text_font_physical_bold;\n text-wrap-width: 32;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical;\n text-halo-radius: 3;\n text-halo-fill: @label_color_physical_halo;\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n \ttext-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n \ttext-min-distance: 1;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z4 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z5 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium_plus;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z6 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_large;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n\/\/ HACK! All the problematic water bodies with accents\n\/\/ e.g. \"Bahia de Campeche\" with an accented i,\n\/\/ have an empty \"changed\" string. So abuse this for now.\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \t[namealt!=''] {\n \t\ttext-name: [name] + '\\n(' + [namealt] + ')';\n }\n\ttext-face-name: @text_font_water_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][changed!='']\n{\n \ttext-name: [name];\n \t[namealt!=''] {\n \t\ttext-name: [name] + '\\n(' + [namealt] + ')';\n }\n text-face-name: @text_font_water;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-vertical-alignment: bottom;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo;\n text-min-distance: 0;\n\n [justified='left'] {\n text-horizontal-alignment: middle;\n text-dx: -5;\n }\n\n [justified='right'] {\n text-horizontal-alignment: middle;\n text-dx: 5;\n }\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n text-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo;\n text-size: @text_font_size_sm;\n\n [zoom=7] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size=18] {\n text-size: @text_font_size_large;\n }\n\n [font_size=20] {\n text-size: @text_font_size_large;\n }\n\n [justified='left'] {\n text-horizontal-alignment: middle;\n text-dx: -5;\n }\n\n [justified='right'] {\n text-horizontal-alignment: middle;\n text-dx: 5;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10,\n#city_labels_z11,\n#city_labels_z12, {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo; \n\ttext-size: @text_font_size_sm;\n [font_size=20] { text-size: @text_font_size_large; } \n}\n\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n \tmarker-ignore-placement: true;\n \tmarker-width: 7;\n \tmarker-fill: black;\n \tmarker-line-color: white;\n \tmarker-line-width: 2;\n}\n\n#airports[zoom>=10][zoom<=13] {\n marker-width: 18;\n\tmarker-file: url('images\/airplane.svg');\n}\n\n#airports[zoom>=13][scalerank<=12]\n{\n \ttext-name: \"[name]\";\n [name=\"Tacoma Int'l\"] {\n text-name: \"Seattle-\" + [name];\n }\n text-face-name: @text_font_poi_bold;\n text-fill: @label_color_poi;\n text-size: @text_font_size_medium;\n text-halo-fill: @label_color_poi_halo;\n text-halo-radius: @text_font_halo_radius_large;\n text-wrap-width: 128;\n text-dy: 14;\n text-allow-overlap: true;\n \n \t[zoom>=14] {\n \ttext-dy: 0;\n }\n}\n#airports {\n text-name: \"[name]\";\n text-face-name: @text_font_poi_bold;\n text-fill: red;\n }\n","old_contents":"@text_font_transport_bold: 'Arial Unicode MS Bold';\n@text_font_physical_bold: 'Arial Unicode MS Bold';\n@text_font_administrative: 'Arial Unicode MS Regular';\n@text_font_administrative_bold: 'Arial Unicode MS Bold';\n@text_font_water: 'Arial Unicode MS Italic';\n@text_font_water_bold: 'Arial Unicode MS Bold Italic';\n@text_font_city: 'Arial Unicode MS Regular';\n@text_font_city_bold: 'Arial Unicode MS Bold';\n@text_font_poi_bold: 'Arial Unicode MS Italic'; \/\/ n-dash is broken in Bold Italic\n\n@label_color_transport: #000;\n@label_color_transport_halo: #fff;\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_administrative: #000;\n@label_color_administrative_halo: #fff;\n@label_color_city: #000;\n@label_color_city_halo: #fff;\n@label_color_poi: #000;\n@label_color_poi_halo: #fff;\n\n@text_font_size_xxsm: 10;\n@text_font_size_xsm: 12;\n@text_font_size_sm: 13;\n@text_font_size_medium: 14;\n@text_font_size_medium_plus: 16;\n@text_font_size_large: 18;\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n\n#minor_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-avoid-edges: true;\n \n [zoom=16] {\n text-dy: 10; \n text-spacing: 124; \n text-size: @text_font_size_xxsm; \n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom=17] {\n text-dy: 13; \n text-spacing: 180; \n text-size: @text_font_size_xsm;\n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom>=18] {\n text-size: @text_font_size_xsm; \n text-spacing: 400; \n text-halo-radius: @text_font_halo_radius_large; \n }\n}\n\n#major_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-spacing: 100;\n text-avoid-edges: true;\n\n [zoom>=16][highway='primary'] {\n\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [is_tunnel=1][zoom>=15] {\n\ttext-fill: #777;\n }\n [zoom=12] {\n text-dy: 7;\n text-size: @text_font_size_xsm;\n text-min-distance: 4;\n }\n [zoom=13] {\n text-dy: 8;\n text-min-distance: 5;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_sm;\n }\n [highway='primary'] {\n\t\ttext-size: 13;\n }\n }\n\n [zoom=14] {\n text-min-distance: 5;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: 9;\n \ttext-size: @text_font_size_medium;\n } \n [highway='secondary'] {\n\t\ttext-dy: 7;\n \ttext-size: @text_font_size_xsm;\n text-halo-radius: 1.5;\n }\n }\n\n [zoom=15] {\n text-min-distance: 10;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: @text_font_size_xsm;\n \ttext-size: 15;\n }\n [highway='secondary'],[highway='tertiary'] {\n\t\ttext-dy: 11;\n \ttext-size: @text_font_size_sm;\n }\n }\n\n [zoom=16] {\n text-min-distance: 12;\n text-dy: 13;\n [highway='trunk'],[highway='primary'] { \n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'],[highway='tertiary'] {\t\n \ttext-spacing: 124;\n \ttext-size: @text_font_size_sm;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom=17] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-dy: 16;\n \ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-dy: 14;\n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-dy: 14; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_medium;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n\t\ttext-dy: 13; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_xsm; \n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom>=18] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-size: @text_font_size_medium; \n\t\ttext-spacing: 300;\n\t\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n text-size: @text_font_size_xsm;\n text-spacing: 400;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n}\n\n#poi_station_labels {\n [zoom>=16][railway='station'] {\n shield-name: \"[label]\";\n shield-face-name: @text_font_transport_bold;\n shield-fill: white;\n shield-size: 12;\n shield-file: url('images\/subway_shield_small.svg');\n }\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_physical_halo;\n text-halo-fill: @label_color_physical;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-fill: @label_color_physical;\n text-halo-fill: @label_color_physical_halo;\n \n text-line-spacing: -1;\n text-min-distance: 10;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n \n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=16] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#continents[zoom>=1][zoom<3]\n{\n \ttext-name: \"[name]\";\n text-face-name: @text_font_physical_bold;\n text-wrap-width: 32;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical;\n text-halo-radius: 3;\n text-halo-fill: @label_color_physical_halo;\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n \ttext-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n \ttext-min-distance: 1;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z4 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z5 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium_plus;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z6 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_large;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n\/\/ HACK! All the problematic water bodies with accents\n\/\/ e.g. \"Bahia de Campeche\" with an accented i,\n\/\/ have an empty \"changed\" string. So abuse this for now.\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \t[namealt!=''] {\n \t\ttext-name: [name] + '\\n(' + [namealt] + ')';\n }\n\ttext-face-name: @text_font_water_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][changed!='']\n{\n \ttext-name: [name];\n \t[namealt!=''] {\n \t\ttext-name: [name] + '\\n(' + [namealt] + ')';\n }\n text-face-name: @text_font_water;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-vertical-alignment: bottom;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo;\n text-min-distance: 5;\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n text-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo;\n text-size: @text_font_size_sm;\n\n [zoom=7] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size=18] {\n text-size: @text_font_size_large;\n }\n\n [font_size=20] {\n text-size: @text_font_size_large;\n }\n\n [justified='left'] {\n text-horizontal-alignment: middle;\n text-dx: -5;\n }\n\n [justified='right'] {\n text-horizontal-alignment: middle;\n text-dx: 5;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10,\n#city_labels_z11,\n#city_labels_z12, {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo; \n\ttext-size: @text_font_size_sm;\n [font_size=20] { text-size: @text_font_size_large; } \n}\n\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n \tmarker-ignore-placement: true;\n \tmarker-width: 7;\n \tmarker-fill: black;\n \tmarker-line-color: white;\n \tmarker-line-width: 2;\n}\n\n#airports[zoom>=10][zoom<=13] {\n marker-width: 18;\n\tmarker-file: url('images\/airplane.svg');\n}\n\n#airports[zoom>=13][scalerank<=12]\n{\n \ttext-name: \"[name]\";\n [name=\"Tacoma Int'l\"] {\n text-name: \"Seattle-\" + [name];\n }\n text-face-name: @text_font_poi_bold;\n text-fill: @label_color_poi;\n text-size: @text_font_size_medium;\n text-halo-fill: @label_color_poi_halo;\n text-halo-radius: @text_font_halo_radius_large;\n text-wrap-width: 128;\n text-dy: 14;\n text-allow-overlap: true;\n \n \t[zoom>=14] {\n \ttext-dy: 0;\n }\n}\n#airports {\n text-name: \"[name]\";\n text-face-name: @text_font_poi_bold;\n text-fill: red;\n }\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"12f117a07e986f64db9d3a25dc54d5aacaafc9ee","subject":"New: Add support for Glissando Lines","message":"New: Add support for Glissando Lines\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"38d8ca74f4cb55f4157b5c5fc6facab98b0e6d7a","subject":"optimized residential name after suburbs in karlshamn labled that way","message":"optimized residential name after suburbs in karlshamn labled that way\n","repos":"karlwettin\/tilemill-style-hydda,karlwettin\/tilemill-style-hydda","old_file":"hyddafull\/labels.mss","new_file":"hyddafull\/labels.mss","new_contents":"\/* LABELS.MSS CONTENTS:\n * - place names\n * - area labels\n * - waterway labels \n *\/\n\n\/* Font sets are defined in palette.mss *\/\n\n\/* Mapnik does not yet support character-spacing adjustments for \n labels placed along a line. We can fake this using the replace()\n function in the text-name parameter by replacing each character\n with itself followed by one or more spaces. *\/\n\n\/* ================================================================== *\/\n\/* PLACE NAMES\n\/* ================================================================== *\/\n\n#place::country[type='country'][zoom>3][zoom<9] {\n text-name:'[name]';\n text-face-name:@sans_bold;\n text-placement:point;\n text-fill:@country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n [zoom=3] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=4] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>4] {\n text-halo-radius: 2;\n }\n [zoom=5] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=6] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=7] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n#place::state[type='state'][zoom>=5][zoom<=10] {\n text-name:'[name]';\n text-face-name:@sans_bold_italic;\n text-placement:point;\n text-fill:@state_text;\n text-halo-fill: @state_halo;\n text-halo-radius: 1;\n [zoom=6] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=7] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>8] {\n text-halo-radius: 2;\n }\n [zoom=8] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=9] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=10] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n\/* ---- Cities ------------------------------------------------------ *\/\n\n#place::city[type='city'][zoom>=2][zoom<=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@city_text;\n text-halo-fill:@city_halo;\n text-halo-radius:2;\n [zoom<=8] {\n text-size: 10;\n text-halo-radius:1;\n }\n [zoom=9] {\n text-size:10;\n text-wrap-width: 60;\n }\n [zoom=10] {\n text-size:11;\n text-wrap-width: 70;\n }\n [zoom=11] {\n text-size:12;\n text-character-spacing: 1;\n text-wrap-width: 80;\n }\n [zoom=12] {\n text-size:13;\n text-character-spacing: 1;\n text-wrap-width: 100;\n }\n [zoom=13] {\n text-size:14;\n text-character-spacing: 2;\n text-wrap-width: 200;\n text-transform: uppercase;\n }\n [zoom=14] {\n text-size:15;\n text-character-spacing: 4;\n text-wrap-width: 300;\n text-transform: uppercase;\n }\n [zoom=15] {\n text-size:16;\n text-character-spacing: 6;\n text-wrap-width: 400;\n text-transform: uppercase;\n }\n}\n\n\/* ---- Towns ------------------------------------------------------- *\/\n\n#place::town[type='town'][zoom>=9][zoom<=17] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@town_text;\n text-size:9;\n text-halo-fill:@town_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n [zoom>=10] {\n text-halo-radius:2;\n text-size: 10;\n }\n [zoom>=11]{ text-size:11; }\n [zoom>=12]{\n text-size:12;\n text-line-spacing: 1;\n }\n [zoom>=13]{\n text-transform: uppercase;\n text-character-spacing: 1;\n text-line-spacing: 2;\n }\n [zoom>=14]{\n text-size:13;\n text-character-spacing: 2;\n text-line-spacing: 3;\n }\n [zoom>=15]{\n text-size:14;\n text-character-spacing: 3;\n text-line-spacing: 4;\n }\n [zoom>=15]{\n text-size:15;\n text-character-spacing: 4;\n text-line-spacing: 5;\n }\n [zoom>=17]{\n text-size:16;\n text-character-spacing: 5;\n text-line-spacing: 6;\n }\n}\n\n\/* ---- Other small places ------------------------------------------ *\/\n\n#place::small[type='village'][zoom>=13],\n#place::small[type='suburb'][zoom>=13],\n#place::small[type='hamlet'][zoom>=13]{\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@other_text;\n text-size:10;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=14] {\n text-size:11;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-line-spacing: 1;\n }\n [zoom>=15] {\n text-halo-radius: 2;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-wrap-width: 60; \n text-line-spacing: 1;\n }\n [zoom>=16] {\n text-size:12;\n text-character-spacing: 2;\n text-wrap-width: 120;\n text-line-spacing: 2;\n } \n [zoom>=17] {\n text-size:13; \n text-character-spacing: 3;\n text-wrap-width: 160;\n text-line-spacing: 4;\n }\n [zoom>=18] {\n text-size:14;\n text-character-spacing: 4;\n text-line-spacing: 6;\n }\n}\n\n#place::small[type='locality'][zoom>=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@locality_text;\n text-size:9;\n text-halo-fill:@locality_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=16] {\n text-size:10;\n text-wrap-width: 60;\n text-line-spacing: 1;\n }\n [zoom>=17] {\n text-size:11;\n text-wrap-width: 120;\n text-line-spacing: 2;\n }\n [zoom>=18] {\n text-size:12;\n text-character-spacing: 1;\n text-line-spacing: 4;\n }\n}\n\n\n\/* ================================================================== *\/\n\/* AREA LABELS\n\/* ================================================================== *\/\n\n#area_label[type='golf_course'][zoom>=10],\n#area_label[type='park'][zoom>=10] {\n text-name: \"''\";\n text-fill: @park * 0.6;\n text-halo-fill: fadeout(@park,25%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom>=15][area>1600000],\n [zoom>=16][area>80000],\n [zoom>=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='cemetery'][zoom>=10] {\n text-name: \"''\";\n text-fill: @cemetery * 0.6;\n text-halo-fill: fadeout(@cemetery,25%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='hospital'][zoom>=10] {\n text-name: \"''\";\n text-fill: @hospital * 0.6;\n text-halo-fill: fadeout(lighten(@hospital,10%),50%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='college'][zoom>=10],\n#area_label[type='school'][zoom>=10],\n#area_label[type='university'][zoom>=10] {\n text-name: \"''\";\n text-fill: @school * 0.6;\n text-halo-fill: fadeout(lighten(@school,10%),50%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='water'][zoom>=10] {\n text-name: \"''\";\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-face-name:@sans_italic;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n text-character-spacing: 1;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 2;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 3;\n text-wrap-width: 180;\n }\n}\n \n#poi[type='university'][zoom>=15],\n#poi[type='hospital'][zoom>=16],\n#poi[type='school'][zoom>=17],\n#poi[type='library'][zoom>=17] {\n text-name:\"[name]\";\n text-face-name:@sans;\n text-size:10;\n text-wrap-width:30;\n text-fill: @poi_text;\n}\n\n\n\n\n\/* Islands and islets *\/ \n\n\n#island_label_polygon {\n [zoom=10][area>2000000],\n [zoom=11][area>500000],\n [zoom=12][area>200000],\n [zoom=13][area>50000],\n [zoom=14][area>10000],\n [zoom=15][area>2500],\n [zoom>15][area>0] {\n text-name: \"[name]\";\n text-fill:@island_text;\n text-face-name:@sans;\n text-size:9;\n text-halo-fill:@island_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n text-placement: interior;\n }\n}\n\n\n\/\/ nodes with name and place=island\/islet \n#island_label_point {\n [zoom>=13] {\n text-name: \"[name]\";\n text-fill:@island_text;\n text-face-name:@sans;\n text-size:9;\n text-halo-fill:@island_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n text-placement: interior;\n }\n}\n\n\n\/* residential is often used as neighborhood name, block name and more*\/\n\n#area_label[type = 'residential']{ \n [zoom=12][area>1280000],\n [zoom=13][area>640000],\n [zoom=14][area>320000],\n [zoom=15][area>240000],\n [zoom=16][area>90000],\n [zoom=17][area>10000],\n [zoom=18][area>=0] {\n text-name: \"[name]\";\n text-fill:@other_text;\n text-face-name:@sans;\n text-size:9;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n text-placement: interior; \n }\n}\n\n\/* ================================================================== *\/\n\/* WATERWAY LABELS\n\/* ================================================================== *\/\n\n#waterway_label[type='river'][zoom>=13],\n#waterway_label[type='canal'][zoom>=15],\n#waterway_label[type='stream'][zoom>=17] {\n text-name: '[name]';\n text-face-name: @sans_italic;\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-placement: line;\n text-min-distance: 400;\n text-size: 10;\n [type='river'][zoom=14],\n [type='canal'][zoom=16],\n [type='stream'][zoom=18] {\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n }\n [type='river'][zoom=15],\n [type='canal'][zoom=17] {\n text-size: 11;\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n }\n [type='river'][zoom>=16],\n [type='canal'][zoom=18] {\n text-size: 14;\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n text-spacing: 300;\n }\n}\n\n\/* ================================================================== *\/\n\/* ROAD LABELS\n\/* ================================================================== *\/\n\n#motorway_label[zoom>=11][zoom<=14][reflen<=8] {\n shield-name: \"[ref]\";\n shield-size: 9;\n shield-face-name: @sans_bold;\n shield-fill: #fff;\n shield-file: url(img\/shield-motorway-1.png);\n [type='motorway'] {\n [reflen=1] { shield-file: url(img\/shield-motorway-1.png); }\n [reflen=2] { shield-file: url(img\/shield-motorway-2.png); }\n [reflen=3] { shield-file: url(img\/shield-motorway-3.png); }\n [reflen=4] { shield-file: url(img\/shield-motorway-4.png); }\n [reflen=5] { shield-file: url(img\/shield-motorway-5.png); }\n [reflen=6] { shield-file: url(img\/shield-motorway-6.png); }\n [reflen=7] { shield-file: url(img\/shield-motorway-7.png); }\n [reflen=8] { shield-file: url(img\/shield-motorway-8.png); }\n }\n [type='trunk'] {\n [reflen=1] { shield-file: url(img\/shield-trunk-1.png); }\n [reflen=2] { shield-file: url(img\/shield-trunk-2.png); }\n [reflen=3] { shield-file: url(img\/shield-trunk-3.png); }\n [reflen=4] { shield-file: url(img\/shield-trunk-4.png); }\n [reflen=5] { shield-file: url(img\/shield-trunk-5.png); }\n [reflen=6] { shield-file: url(img\/shield-trunk-6.png); }\n [reflen=7] { shield-file: url(img\/shield-trunk-7.png); }\n [reflen=8] { shield-file: url(img\/shield-trunk-8.png); }\n }\n [zoom=11] { shield-min-distance: 60; } \/\/50\n [zoom=12] { shield-min-distance: 80; } \/\/60\n [zoom=13] { shield-min-distance: 120; } \/\/120\n [zoom=14] { shield-min-distance: 180; }\n}\n\n#motorway_label[type='motorway'][zoom>9],\n#motorway_label[type='trunk'][zoom>9] {\n text-name:\"[name]\";\n text-face-name:@sans_bold;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:10;\n [zoom=11] { text-min-distance:70; }\n [zoom=12] { text-min-distance:80; }\n [zoom=13] { text-min-distance:100; }\n}\n\n#mainroad_label[type='primary'][zoom>12],\n#mainroad_label[type='secondary'][zoom>13],\n#mainroad_label[type='tertiary'][zoom>13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n#minorroad_label[zoom>14] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-size:9;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n\/* ================================================================== *\/\n\/* ONE-WAY ARROWS\n\/* ================================================================== *\/\n\n#motorway_label[oneway!=0][zoom>=16],\n#mainroad_label[oneway!=0][zoom>=16],\n#minorroad_label[oneway!=0][zoom>=16] {\n marker-placement:line;\n marker-max-error: 0.5;\n marker-spacing: 200;\n marker-file: url(img\/icon\/oneway.svg);\n [oneway=-1] { marker-file: url(img\/icon\/oneway-reverse.svg); }\n [zoom=16] { marker-transform: \"scale(0.5)\"; }\n [zoom=17] { marker-transform: \"scale(0.75)\"; }\n}\n\n\/* house names and numbers *\/\n\n#housenumbers {\n [zoom >= 18] {\n text-name: \"[addr:housenumber]\";\n text-placement: interior;\n text-min-distance: 1;\n text-wrap-width: 0;\n text-face-name: @sans_lt;\n text-fill: #444;\n text-size: 9;\n }\n}\n\n#housenames {\n [zoom >= 17] {\n text-name: \"[addr:housename]\";\n text-placement: interior;\n text-wrap-width: 20;\n text-face-name: @sans_lt;\n text-size: 8;\n text-fill: #444;\n [zoom >= 18] {\n text-size: 9;\n }\n }\n}\n\n\n\/* ****************************************************************** *\/\n","old_contents":"\/* LABELS.MSS CONTENTS:\n * - place names\n * - area labels\n * - waterway labels \n *\/\n\n\/* Font sets are defined in palette.mss *\/\n\n\/* Mapnik does not yet support character-spacing adjustments for \n labels placed along a line. We can fake this using the replace()\n function in the text-name parameter by replacing each character\n with itself followed by one or more spaces. *\/\n\n\/* ================================================================== *\/\n\/* PLACE NAMES\n\/* ================================================================== *\/\n\n#place::country[type='country'][zoom>3][zoom<9] {\n text-name:'[name]';\n text-face-name:@sans_bold;\n text-placement:point;\n text-fill:@country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n [zoom=3] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=4] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>4] {\n text-halo-radius: 2;\n }\n [zoom=5] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=6] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=7] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n#place::state[type='state'][zoom>=5][zoom<=10] {\n text-name:'[name]';\n text-face-name:@sans_bold_italic;\n text-placement:point;\n text-fill:@state_text;\n text-halo-fill: @state_halo;\n text-halo-radius: 1;\n [zoom=6] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=7] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>8] {\n text-halo-radius: 2;\n }\n [zoom=8] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=9] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=10] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n\/* ---- Cities ------------------------------------------------------ *\/\n\n#place::city[type='city'][zoom>=2][zoom<=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@city_text;\n text-halo-fill:@city_halo;\n text-halo-radius:2;\n [zoom<=8] {\n text-size: 10;\n text-halo-radius:1;\n }\n [zoom=9] {\n text-size:10;\n text-wrap-width: 60;\n }\n [zoom=10] {\n text-size:11;\n text-wrap-width: 70;\n }\n [zoom=11] {\n text-size:12;\n text-character-spacing: 1;\n text-wrap-width: 80;\n }\n [zoom=12] {\n text-size:13;\n text-character-spacing: 1;\n text-wrap-width: 100;\n }\n [zoom=13] {\n text-size:14;\n text-character-spacing: 2;\n text-wrap-width: 200;\n text-transform: uppercase;\n }\n [zoom=14] {\n text-size:15;\n text-character-spacing: 4;\n text-wrap-width: 300;\n text-transform: uppercase;\n }\n [zoom=15] {\n text-size:16;\n text-character-spacing: 6;\n text-wrap-width: 400;\n text-transform: uppercase;\n }\n}\n\n\/* ---- Towns ------------------------------------------------------- *\/\n\n#place::town[type='town'][zoom>=9][zoom<=17] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@town_text;\n text-size:9;\n text-halo-fill:@town_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n [zoom>=10] {\n text-halo-radius:2;\n text-size: 10;\n }\n [zoom>=11]{ text-size:11; }\n [zoom>=12]{\n text-size:12;\n text-line-spacing: 1;\n }\n [zoom>=13]{\n text-transform: uppercase;\n text-character-spacing: 1;\n text-line-spacing: 2;\n }\n [zoom>=14]{\n text-size:13;\n text-character-spacing: 2;\n text-line-spacing: 3;\n }\n [zoom>=15]{\n text-size:14;\n text-character-spacing: 3;\n text-line-spacing: 4;\n }\n [zoom>=15]{\n text-size:15;\n text-character-spacing: 4;\n text-line-spacing: 5;\n }\n [zoom>=17]{\n text-size:16;\n text-character-spacing: 5;\n text-line-spacing: 6;\n }\n}\n\n\/* ---- Other small places ------------------------------------------ *\/\n\n#place::small[type='village'][zoom>=13],\n#place::small[type='suburb'][zoom>=13],\n#place::small[type='hamlet'][zoom>=13]{\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@other_text;\n text-size:10;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=14] {\n text-size:11;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-line-spacing: 1;\n }\n [zoom>=15] {\n text-halo-radius: 2;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-wrap-width: 60; \n text-line-spacing: 1;\n }\n [zoom>=16] {\n text-size:12;\n text-character-spacing: 2;\n text-wrap-width: 120;\n text-line-spacing: 2;\n } \n [zoom>=17] {\n text-size:13; \n text-character-spacing: 3;\n text-wrap-width: 160;\n text-line-spacing: 4;\n }\n [zoom>=18] {\n text-size:14;\n text-character-spacing: 4;\n text-line-spacing: 6;\n }\n}\n\n#place::small[type='locality'][zoom>=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@locality_text;\n text-size:9;\n text-halo-fill:@locality_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=16] {\n text-size:10;\n text-wrap-width: 60;\n text-line-spacing: 1;\n }\n [zoom>=17] {\n text-size:11;\n text-wrap-width: 120;\n text-line-spacing: 2;\n }\n [zoom>=18] {\n text-size:12;\n text-character-spacing: 1;\n text-line-spacing: 4;\n }\n}\n\n\n\/* ================================================================== *\/\n\/* AREA LABELS\n\/* ================================================================== *\/\n\n#area_label[type='golf_course'][zoom>=10],\n#area_label[type='park'][zoom>=10] {\n text-name: \"''\";\n text-fill: @park * 0.6;\n text-halo-fill: fadeout(@park,25%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom>=15][area>1600000],\n [zoom>=16][area>80000],\n [zoom>=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='cemetery'][zoom>=10] {\n text-name: \"''\";\n text-fill: @cemetery * 0.6;\n text-halo-fill: fadeout(@cemetery,25%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='hospital'][zoom>=10] {\n text-name: \"''\";\n text-fill: @hospital * 0.6;\n text-halo-fill: fadeout(lighten(@hospital,10%),50%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='college'][zoom>=10],\n#area_label[type='school'][zoom>=10],\n#area_label[type='university'][zoom>=10] {\n text-name: \"''\";\n text-fill: @school * 0.6;\n text-halo-fill: fadeout(lighten(@school,10%),50%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='water'][zoom>=10] {\n text-name: \"''\";\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-face-name:@sans_italic;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n text-character-spacing: 1;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 2;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 3;\n text-wrap-width: 180;\n }\n}\n \n#poi[type='university'][zoom>=15],\n#poi[type='hospital'][zoom>=16],\n#poi[type='school'][zoom>=17],\n#poi[type='library'][zoom>=17] {\n text-name:\"[name]\";\n text-face-name:@sans;\n text-size:10;\n text-wrap-width:30;\n text-fill: @poi_text;\n}\n\n\n\n\n\/* Islands and islets *\/ \n\n\n#island_label_polygon {\n [zoom=10][area>2000000],\n [zoom=11][area>500000],\n [zoom=12][area>200000],\n [zoom=13][area>50000],\n [zoom=14][area>10000],\n [zoom=15][area>2500],\n [zoom>15][area>0] {\n text-name: \"[name]\";\n text-fill:@island_text;\n text-face-name:@sans;\n text-size:9;\n text-halo-fill:@island_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n text-placement: interior;\n }\n}\n\n\n\/\/ nodes with name and place=island\/islet \n#island_label_point {\n [zoom>=13] {\n text-name: \"[name]\";\n text-fill:@island_text;\n text-face-name:@sans;\n text-size:9;\n text-halo-fill:@island_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n text-placement: interior;\n }\n}\n\n\n\/* residential is often used as neighborhood name, block name and more*\/\n\n#area_label[type = 'residential']{ \n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>240000],\n [zoom=16][area>90000],\n [zoom=17][area>10000],\n [zoom=18][area>=0] {\n text-name: \"[name]\";\n text-fill:@other_text;\n text-face-name:@sans;\n text-size:9;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n text-placement: interior; \n }\n}\n\n\/* ================================================================== *\/\n\/* WATERWAY LABELS\n\/* ================================================================== *\/\n\n#waterway_label[type='river'][zoom>=13],\n#waterway_label[type='canal'][zoom>=15],\n#waterway_label[type='stream'][zoom>=17] {\n text-name: '[name]';\n text-face-name: @sans_italic;\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-placement: line;\n text-min-distance: 400;\n text-size: 10;\n [type='river'][zoom=14],\n [type='canal'][zoom=16],\n [type='stream'][zoom=18] {\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n }\n [type='river'][zoom=15],\n [type='canal'][zoom=17] {\n text-size: 11;\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n }\n [type='river'][zoom>=16],\n [type='canal'][zoom=18] {\n text-size: 14;\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n text-spacing: 300;\n }\n}\n\n\/* ================================================================== *\/\n\/* ROAD LABELS\n\/* ================================================================== *\/\n\n#motorway_label[zoom>=11][zoom<=14][reflen<=8] {\n shield-name: \"[ref]\";\n shield-size: 9;\n shield-face-name: @sans_bold;\n shield-fill: #fff;\n shield-file: url(img\/shield-motorway-1.png);\n [type='motorway'] {\n [reflen=1] { shield-file: url(img\/shield-motorway-1.png); }\n [reflen=2] { shield-file: url(img\/shield-motorway-2.png); }\n [reflen=3] { shield-file: url(img\/shield-motorway-3.png); }\n [reflen=4] { shield-file: url(img\/shield-motorway-4.png); }\n [reflen=5] { shield-file: url(img\/shield-motorway-5.png); }\n [reflen=6] { shield-file: url(img\/shield-motorway-6.png); }\n [reflen=7] { shield-file: url(img\/shield-motorway-7.png); }\n [reflen=8] { shield-file: url(img\/shield-motorway-8.png); }\n }\n [type='trunk'] {\n [reflen=1] { shield-file: url(img\/shield-trunk-1.png); }\n [reflen=2] { shield-file: url(img\/shield-trunk-2.png); }\n [reflen=3] { shield-file: url(img\/shield-trunk-3.png); }\n [reflen=4] { shield-file: url(img\/shield-trunk-4.png); }\n [reflen=5] { shield-file: url(img\/shield-trunk-5.png); }\n [reflen=6] { shield-file: url(img\/shield-trunk-6.png); }\n [reflen=7] { shield-file: url(img\/shield-trunk-7.png); }\n [reflen=8] { shield-file: url(img\/shield-trunk-8.png); }\n }\n [zoom=11] { shield-min-distance: 60; } \/\/50\n [zoom=12] { shield-min-distance: 80; } \/\/60\n [zoom=13] { shield-min-distance: 120; } \/\/120\n [zoom=14] { shield-min-distance: 180; }\n}\n\n#motorway_label[type='motorway'][zoom>9],\n#motorway_label[type='trunk'][zoom>9] {\n text-name:\"[name]\";\n text-face-name:@sans_bold;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:10;\n [zoom=11] { text-min-distance:70; }\n [zoom=12] { text-min-distance:80; }\n [zoom=13] { text-min-distance:100; }\n}\n\n#mainroad_label[type='primary'][zoom>12],\n#mainroad_label[type='secondary'][zoom>13],\n#mainroad_label[type='tertiary'][zoom>13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n#minorroad_label[zoom>14] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-size:9;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n\/* ================================================================== *\/\n\/* ONE-WAY ARROWS\n\/* ================================================================== *\/\n\n#motorway_label[oneway!=0][zoom>=16],\n#mainroad_label[oneway!=0][zoom>=16],\n#minorroad_label[oneway!=0][zoom>=16] {\n marker-placement:line;\n marker-max-error: 0.5;\n marker-spacing: 200;\n marker-file: url(img\/icon\/oneway.svg);\n [oneway=-1] { marker-file: url(img\/icon\/oneway-reverse.svg); }\n [zoom=16] { marker-transform: \"scale(0.5)\"; }\n [zoom=17] { marker-transform: \"scale(0.75)\"; }\n}\n\n\/* house names and numbers *\/\n\n#housenumbers {\n [zoom >= 18] {\n text-name: \"[addr:housenumber]\";\n text-placement: interior;\n text-min-distance: 1;\n text-wrap-width: 0;\n text-face-name: @sans_lt;\n text-fill: #444;\n text-size: 9;\n }\n}\n\n#housenames {\n [zoom >= 17] {\n text-name: \"[addr:housename]\";\n text-placement: interior;\n text-wrap-width: 20;\n text-face-name: @sans_lt;\n text-size: 8;\n text-fill: #444;\n [zoom >= 18] {\n text-size: 9;\n }\n }\n}\n\n\n\/* ****************************************************************** *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"4d9264be706d95f76e28672ad5412921a162c343","subject":"Update roads.mss","message":"Update roads.mss","repos":"brelevenix\/osm-bright-tregor","old_file":"osm-bright\/roads.mss","new_file":"osm-bright\/roads.mss","new_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 1.6; @rdz11_med: 0.8; @rdz11_min: 0.4;\n@rdz12_maj: 2.5; @rdz12_med: 1.2; @rdz12_min: 0.8;\n@rdz13_maj: 3; @rdz13_med: 1.5; @rdz13_min: 1;\n@rdz14_maj: 4; @rdz14_med: 2.5; @rdz14_min: 1.6;\n@rdz15_maj: 6; @rdz15_med: 4; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 14; @rdz17_med: 12; @rdz17_min: 10;\n@rdz18_maj: 20; @rdz18_med: 17; @rdz18_min: 14;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz11_maj+2; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz12_maj+2; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz13_maj+2; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz14_med+2; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz15_med }\n [stylegroup='minorroad']{ line-width: @rdz15_min ; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_maj+2; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj ;}\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min +; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz16_maj+2; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_maj+3; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_maj+4; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min ; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min ; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min ; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min ; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","old_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n#roads_low[zoom>=5][zoom<=8] {\n [type='motorway'] { line-color: @motorway_line; }\n [type='trunk'] { line-color: @trunk_line; }\n [zoom=5] {\n [type='motorway'] { line-width: 0.4; }\n [type='trunk'] { line-width: 0.2; } }\n [zoom=6] {\n [type='motorway'] { line-width: 0.5; }\n [type='trunk'] { line-width: 0.25; } }\n [zoom=7] {\n [type='motorway'] { line-width: 0.6; }\n [type='trunk'] { line-width: 0.3; } }\n [zoom=8] {\n [type='motorway'] { line-width: 1; }\n [type='trunk'] { line-width: 0.5; } }\n}\n\n\/* At mid-level scales start to show primary and secondary routes\nas well. *\/\n\n#roads_med[zoom>=9][zoom<=10] {\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_line;\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_line;\n }\n [type='primary'] { line-color: @primary_line; }\n [type='secondary'] { line-color: @secondary_line; }\n [type='tertiary'] { line-color: @standard_line; }\n [zoom=9] {\n [type='motorway'],[type='trunk'] { line-width: 1.4; }\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.6; }\n }\n [zoom=10] {\n [type='motorway'],[type='trunk'] { line-width: 1.8; }\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.8; }\n }\n}\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 1.6; @rdz11_med: 0.8; @rdz11_min: 0.4;\n@rdz12_maj: 2.5; @rdz12_med: 1.2; @rdz12_min: 0.8;\n@rdz13_maj: 3; @rdz13_med: 1.5; @rdz13_min: 1;\n@rdz14_maj: 4; @rdz14_med: 2.5; @rdz14_min: 1.6;\n@rdz15_maj: 6; @rdz15_med: 4; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 14; @rdz17_med: 12; @rdz17_min: 10;\n@rdz18_maj: 20; @rdz18_med: 17; @rdz18_min: 14;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz11_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz12_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz13_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz13_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz14_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz14_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz14_med; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz15_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz15_min + 2; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_min; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz16_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz16_min + 2; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz16_min; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj + 3; }\n [stylegroup='mainroad'] { line-width: @rdz17_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz17_min + 2; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_min; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj + 4; }\n [stylegroup='mainroad'] { line-width: @rdz18_med + 4; }\n [stylegroup='minorroad']{ line-width: @rdz18_min + 3.5; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_min; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min ; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min ; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min ; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min ; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"4313f4a1dfb9ce2363a07c0e18b42b608671fa46","subject":"Corrected minor errors","message":"Corrected minor errors","repos":"jeffaudi\/osm-hybrid","old_file":"osm-hybrid\/palette.mss","new_file":"osm-hybrid\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM HYBRID for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt:\t\"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \n\t\t\"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\",\n\t\t\"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\",\n\t\t\"unifont Medium\";\n\n@sans:\t\t\"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\",\n\t\t\"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\",\n\t\t\"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\",\n\t\t\"unifont Medium\";\n\n@sans_italic:\t\"Open Sans Semibold Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\",\n\t\t\"TSCu_Paranar Italic\", \"Mallige NormalItalic\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\",\n\t\t\"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold:\t\"Open Sans Bold\", \"DejaVu Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \n\t\t\"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\",\n\t\t\"Unifont Medium\", \"unifont Medium\"; \n\n\n@sans_lt_italic:\t\"Open Sans Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\",\n\t\t\t\"TSCu_Paranar Italic\", \"Mallige NormalItalic\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n\t\t\t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold_italic:\t\"Open Sans Bold Italic\", \"DejaVu Sans Bold Italic\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\",\n\t\t\t\"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\", \"DejaVu Sans Book\",\n\t\t\t\"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\",\n \t\"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #FCFBE7;\n@water: #C4DFF6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #DAF2C1;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n@building: #E4E0E0;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #E65C5C;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #E68A5C;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n@primary_line: #FFC859;\n@primary_fill: lighten(@primary_line,10%);\n@primary_case: @primary_line * 0.9;\n\n@secondary_line: #FFE873;\n@secondary_fill: lighten(@secondary_line,10%);\n@secondary_case: @secondary_line * 0.9;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #eee;\n@admin_3: #999;\n@admin_4: #60f;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_text: #fff;\n@place_halo: fadeout(#000,30%);\n\n@country_text: @place_text;\n@country_halo: @place_halo;\n\n@state_text: @place_text;\n@state_halo: @place_halo;\n\n@city_text: @place_text;\n@city_halo: @place_halo;\n\n@town_text: @place_text;\n@town_halo: @place_halo;\n\n@poi_text: #aaa;\n\n@road_text: #777;\n@road_halo: #fff;\n\n@other_text: #aaa;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #60f;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n\n\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM HYBRID for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt:\t\"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \n\t\t\"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\",\n\t\t\"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\",\n\t\t\"unifont Medium\";\n\n@sans:\t\t\"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\",\n\t\t\"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\",\n\t\t\"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\",\n\t\t\"unifont Medium\";\n\n@sans_italic:\t\"Open Sans Semibold Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\",\n\t\t\"TSCu_Paranar Italic\", \"Mallige NormalItalic\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\",\n\t\t\"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold:\t\"Open Sans Bold\", \"DejaVu Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \n\t\t\"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\",\n\t\t\"Unifont Medium\", \"unifont Medium\"; \n\n\n@sans_lt_italic:\t\"Open Sans Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\",\n\t\t\t\"TSCu_Paranar Italic\", \"Mallige NormalItalic\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n\t\t\t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold_italic:\t\"Open Sans Bold Italic\", \"DejaVu Sans Bold Italic\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\",\n\t\t\t\"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\", \"DejaVu Sans Book\",\n\t\t\t\"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\",\n \t\"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #FCFBE7;\n@water: #C4DFF6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #DAF2C1;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n@building: #E4E0E0;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #E65C5C;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #E68A5C;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n@primary_line: #FFC859;\n@primary_fill: lighten(@primary_line,10%);\n@primary_case: @primary_line * 0.9;\n\n@secondary_line: #FFE873;\n@secondary_fill: lighten(@secondary_line,10%);\n@secondary_case: @secondary_line * 0.9;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #eee;\n@admin_3: #999;\n@admin_4: #60f;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,30%);\n@place_halo: fadeout(#000,30%);\n\n@country_text: #eee;\n@country_halo: @place_halo;\n\n@state_text: #eee;\n@state_halo: @place_halo;\n\n@city_text: #eee;\n@city_halo: @place_halo;\n\n@town_text: #ccc;\n@town_halo: @place_halo;\n\n@poi_text: #aaa;\n\n@road_text: #777;\n@road_halo: #fff;\n\n@other_text: #aaa;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #60f;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n\n\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"e2fba11d885675b310c292ff910bb77b8c35f405","subject":"#30 add style for osm airport area fills","message":"#30 add style for osm airport area fills\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"map.mss","new_file":"map.mss","new_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_urban: #EDEDED; \/\/ 7% k\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999; \/\/ 40% K\n@color_transport_casing_z10: #ddd;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc; \/\/ 20% K\n@color_transport_hwy: #737373; \/\/ 55% K \n@color_transport_minor: #aaa; \n@color_transport_rail: #aaa; \/\/ 33% K\n@color_transport_path: #666; \/\/ 60% K\n@color_building: #ccc;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: #c8cebe; \/\/ hsl(82,8,81)\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_airport_area: lighten(@color_airport_runways,10);\n@color_green_areas: darken(#c0d3b5,18);\n\nMap {\n background-color: @color_water;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n \/* lighten background color, as we decrease landcover opacity *\/\n [zoom>=12] {\n polygon-fill: lighten(@color_physical,20);\n }\n [zoom>=14] {\n polygon-fill: lighten(@color_physical,40);\n }\n\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_50m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{ \n line-color: @color_water;\n line-width: 0;\n polygon-fill: @color_water;\n\n [zoom>=5]{\n line-width: 0.5;\n }\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=7][scalerank<=6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n\/**\n * Use OSM administrative boundaries at zooms >= 10\n * Filter out really small admin areas for features like \n * Indian Reservations at higher zooms \n **\/\n#admin1-lines-osm{\n [zoom>=10][area_km2>1000],\n [zoom>=12][area_km2>500],\n [zoom>=14][area_km2>0]{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=13][area> 10000],\n#green-areas-high[zoom>13],\n#green-areas-high[zoom>=13],\n{\n polygon-fill: @color_green_areas;\n \/\/ polygon-opacity: 0.5;\n polygon-comp-op: src;\n\n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n \/\/ polygon-opacity: 0.3;\n }\n}\n\n\/** \n * airport area fills\n**\/\n#aerodromes {\n [type='aerodrome'] {\n [zoom>=10] {\n polygon-fill: @color_airport_area;\n line-width: 0;\n }\n }\n}\n\n\/** \n * airport runways and taxiways\n**\/\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n \/\/ make sure airport fills don't render above features like roads\n [type='aerodrome'] {\n [zoom>=10] {\n polygon-opacity: 0;\n line-width: 0;\n }\n }\n\n [type='runway'] {\n [zoom=10] {\n line-width: 1;\n }\n [zoom=11] {\n line-width: 1.5;\n }\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n line-color: @color_transport_hwy;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n line-color: @color_transport_hwy;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{ \n [zoom>=9] {\n ::outline {\n line-width: 3;\n line-color: @color_transport_casing_z10;\n }\n\n line-width: 1.5; \n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 5;\n line-color: @color_transport_casing;\n }\n\n line-width: 3;\n line-color: @color_transport_hwy; \n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4; \n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 13;\n }\n\n line-width: 7.5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 39;\n } \n\n line-width: 28;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 49;\n \/\/ }\n\n \/\/ line-width: 35;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n\n [zoom<=12] {\n line-color: @color_transport; \n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n line-color: @color_transport_casing;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0;\/\/10;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 0; \/\/6;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=17] {\n ::outline {\n \/\/ line-width: 20;\n }\n\n line-width: 14;\n\n [is_link='yes'] {\n ::casing{\n \/\/ line-width: 14;\n }\n\n line-width: 7;\n }\n }\n\n [zoom>=18] {\n ::outline {\n \/\/ line-width: 25;\n }\n\n line-width: 17;\n\n [is_link='yes'] {\n ::casing {\n \/\/ line-width: 19;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 30;\n \/\/ }\n\n \/\/ line-width: 26;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 17;\n \/\/ }\n\n \/\/ line-width: 13;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 1;\n }\n\n [zoom>=11][highway='trunk'],\n [zoom>=11][highway='primary'],\n [zoom>=11][highway='secondary'] {\n ::casing{\n line-width: 1.9;\n line-color: @color_transport_casing;\n }\n line-width: 1.5;\n }\n\n [zoom>=12][highway='trunk'],\n [zoom>=12][highway='primary'],\n [zoom>=12][highway='secondary'],\n [zoom>=12][highway='tertiary'] {\n ::casing{\n line-width: 1.9;\n line-color: @color_transport_casing;\n }\n line-width: 1.5;\n }\n\n [zoom>=13] {\n line-width: 1.5;\n line-color: @color_transport;\n }\n\n [zoom>=14] {\n ::casing {\n line-width: 3.5;\n line-color: @color_transport_casing;\n }\n line-width: 2.5;\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 6.5;\n }\n line-width: 4;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0; \/\/7.5;\n } \n line-width: 4; \n }\n\n [zoom>=17] {\n ::casing {\n \/\/ line-width: 11.5;\n }\n line-width: 8;\n }\n\n [zoom>=18] {\n ::casing {\n \/\/ line-width: 14.5;\n } \n line-width: 11;\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15] {\n ::casing {\n line-width: 2.8; \n }\n\n line-width: 1.8;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n line-color: @color_transport_path;\n\n [zoom>=15] {\n line-width: 0.5;\n line-cap: butt;\n line-dasharray: 2, 3;\n }\n\n [zoom>=16] {\n line-width: 0.7;\n }\n\n [zoom>=17] {\n line-width: 1.2;\n line-dasharray: 4, 6;\n }\n}\n\n#lc500mMODIS_low {\n [zoom>=0][zoom<9] {\n raster-opacity:1;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(0,0);\n }\n [zoom>=7] { raster-opacity:0.9; }\n [zoom>=8] { raster-opacity:0.8; }\n}\n\n#lc500mMODIS_med {\n [zoom>=9] {\n raster-opacity:0.7;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(3,3);\n }\n [zoom>=10] { raster-opacity:0.6; }\n [zoom>=11] {\n raster-opacity:0.5;\n image-filters: agg-stack-blur(10,10);\n }\n [zoom>=12] { raster-opacity:0.4; }\n [zoom>=13] { raster-opacity:0.3; }\n}\n\n#lc500mMODIS_high {\n [zoom>=14] {\n raster-opacity:0.2;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(20,20);\n }\n [zoom>=15] { raster-opacity:0.2; }\n [zoom>=16] { raster-opacity:0.15; }\n [zoom>=17] { raster-opacity:0.1; }\n [zoom>=18] { raster-opacity:0.05; }\n}\n\n\/\/ A special landover raster with urban areas only, so we can keep them full opacity\n#lc500mMODIS_urban {\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(10,10);\n raster-opacity:1;\n}\n\n.urban-landuse {\n polygon-fill: @color_urban;\n image-filters: agg-stack-blur(10,10);\n}\n\n#land {\n polygon-fill: @color_physical;\n}\n","old_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_urban: #EDEDED; \/\/ 7% k\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999; \/\/ 40% K\n@color_transport_casing_z10: #ddd;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc; \/\/ 20% K\n@color_transport_hwy: #737373; \/\/ 55% K \n@color_transport_minor: #aaa; \n@color_transport_rail: #aaa; \/\/ 33% K\n@color_transport_path: #666; \/\/ 60% K\n@color_building: #ccc;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: #c8cebe; \/\/ hsl(82,8,81)\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_airport_area: lighten(@color_airport_runways,30);\n@color_green_areas: darken(#c0d3b5,18);\n\nMap {\n background-color: @color_water;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n \/* lighten background color, as we decrease landcover opacity *\/\n [zoom>=12] {\n polygon-fill: lighten(@color_physical,20);\n }\n [zoom>=14] {\n polygon-fill: lighten(@color_physical,40);\n }\n\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_50m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{ \n line-color: @color_water;\n line-width: 0;\n polygon-fill: @color_water;\n\n [zoom>=5]{\n line-width: 0.5;\n }\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=7][scalerank<=6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n\/**\n * Use OSM administrative boundaries at zooms >= 10\n * Filter out really small admin areas for features like \n * Indian Reservations at higher zooms \n **\/\n#admin1-lines-osm{\n [zoom>=10][area_km2>1000],\n [zoom>=12][area_km2>500],\n [zoom>=14][area_km2>0]{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=13][area> 10000],\n#green-areas-high[zoom>13],\n#green-areas-high[zoom>=13],\n{\n polygon-fill: @color_green_areas;\n \/\/ polygon-opacity: 0.5;\n polygon-comp-op: src;\n\n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n \/\/ polygon-opacity: 0.3;\n }\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [type='aerodrome'] {\n [zoom>=10] {\n \/\/ this currently doesn't render because \"aerodromes\" \n \/\/ are of geometry type line-string, not polygon\n polygon-fill: @color_airport_fill;\n }\n }\n\n [type='runway'] {\n [zoom=10] {\n line-width: 1;\n }\n [zoom=11] {\n line-width: 1.5;\n }\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n line-color: @color_transport_hwy;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n line-color: @color_transport_hwy;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{ \n [zoom>=9] {\n ::outline {\n line-width: 3;\n line-color: @color_transport_casing_z10;\n }\n\n line-width: 1.5; \n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 5;\n line-color: @color_transport_casing;\n }\n\n line-width: 3;\n line-color: @color_transport_hwy; \n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4; \n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 13;\n }\n\n line-width: 7.5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 39;\n } \n\n line-width: 28;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 49;\n \/\/ }\n\n \/\/ line-width: 35;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n\n [zoom<=12] {\n line-color: @color_transport; \n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n line-color: @color_transport_casing;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0;\/\/10;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 0; \/\/6;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=17] {\n ::outline {\n \/\/ line-width: 20;\n }\n\n line-width: 14;\n\n [is_link='yes'] {\n ::casing{\n \/\/ line-width: 14;\n }\n\n line-width: 7;\n }\n }\n\n [zoom>=18] {\n ::outline {\n \/\/ line-width: 25;\n }\n\n line-width: 17;\n\n [is_link='yes'] {\n ::casing {\n \/\/ line-width: 19;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 30;\n \/\/ }\n\n \/\/ line-width: 26;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 17;\n \/\/ }\n\n \/\/ line-width: 13;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 1;\n }\n\n [zoom>=11][highway='trunk'],\n [zoom>=11][highway='primary'],\n [zoom>=11][highway='secondary'] {\n ::casing{\n line-width: 1.9;\n line-color: @color_transport_casing;\n }\n line-width: 1.5;\n }\n\n [zoom>=12][highway='trunk'],\n [zoom>=12][highway='primary'],\n [zoom>=12][highway='secondary'],\n [zoom>=12][highway='tertiary'] {\n ::casing{\n line-width: 1.9;\n line-color: @color_transport_casing;\n }\n line-width: 1.5;\n }\n\n [zoom>=13] {\n line-width: 1.5;\n line-color: @color_transport;\n }\n\n [zoom>=14] {\n ::casing {\n line-width: 3.5;\n line-color: @color_transport_casing;\n }\n line-width: 2.5;\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 6.5;\n }\n line-width: 4;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0; \/\/7.5;\n } \n line-width: 4; \n }\n\n [zoom>=17] {\n ::casing {\n \/\/ line-width: 11.5;\n }\n line-width: 8;\n }\n\n [zoom>=18] {\n ::casing {\n \/\/ line-width: 14.5;\n } \n line-width: 11;\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15] {\n ::casing {\n line-width: 2.8; \n }\n\n line-width: 1.8;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n line-color: @color_transport_path;\n\n [zoom>=15] {\n line-width: 0.5;\n line-cap: butt;\n line-dasharray: 2, 3;\n }\n\n [zoom>=16] {\n line-width: 0.7;\n }\n\n [zoom>=17] {\n line-width: 1.2;\n line-dasharray: 4, 6;\n }\n}\n\n#lc500mMODIS_low {\n [zoom>=0][zoom<9] {\n raster-opacity:1;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(0,0);\n }\n [zoom>=7] { raster-opacity:0.9; }\n [zoom>=8] { raster-opacity:0.8; }\n}\n\n#lc500mMODIS_med {\n [zoom>=9] {\n raster-opacity:0.7;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(3,3);\n }\n [zoom>=10] { raster-opacity:0.6; }\n [zoom>=11] {\n raster-opacity:0.5;\n image-filters: agg-stack-blur(10,10);\n }\n [zoom>=12] { raster-opacity:0.4; }\n [zoom>=13] { raster-opacity:0.3; }\n}\n\n#lc500mMODIS_high {\n [zoom>=14] {\n raster-opacity:0.2;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(20,20);\n }\n [zoom>=15] { raster-opacity:0.2; }\n [zoom>=16] { raster-opacity:0.15; }\n [zoom>=17] { raster-opacity:0.1; }\n [zoom>=18] { raster-opacity:0.05; }\n}\n\n\/\/ A special landover raster with urban areas only, so we can keep them full opacity\n#lc500mMODIS_urban {\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(10,10);\n raster-opacity:1;\n}\n\n.urban-landuse {\n polygon-fill: @color_urban;\n image-filters: agg-stack-blur(10,10);\n}\n\n#land {\n polygon-fill: @color_physical;\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"3f719c853e899980da301f4e35a4c0421f69c394","subject":"WIP: Remove staff and layer from notes","message":"WIP: Remove staff and layer from notes\n\nThis commit removes staff and layer from note objects. Note: This also disables any cross-staff functionality (e.g, beaming) which we will need to find another solution to.\n\nCloses #43\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber + '-' + nobj.ParentNoteRest.VoiceNumber + '-' + pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) + '-' + nobj.ParentNoteRest.VoiceNumber + '-' + pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) + '-' + nobj.ParentNoteRest.VoiceNumber + '-' + pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n libmei.AddAttribute(n, 'staff', staff);\n libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber + '-' + nobj.ParentNoteRest.VoiceNumber + '-' + pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) + '-' + nobj.ParentNoteRest.VoiceNumber + '-' + pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) + '-' + nobj.ParentNoteRest.VoiceNumber + '-' + pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"03b83924b92a344866e263d5d9115392ab1d1073","subject":"Changed connectors and word position for monosyllabic words","message":"Changed connectors and word position for monosyllabic words\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/ExportProcessors.mss","new_file":"src\/ExportProcessors.mss","new_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = sibmei2.GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = sibmei2.GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer, normalizedBeamProp) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Returns the active beam, if any, and creates new beam elements\n at the start of a beam.\n *\/\n switch (normalizedBeamProp)\n {\n case (NoBeam)\n {\n if (bobj.GraceNote)\n {\n if (layer._property:ActiveGraceBeam != null)\n {\n layer._property:ActiveGraceBeam = null;\n }\n \/\/ If there is an active non-grace beam, we have a normal beam spanning\n \/\/ over a non-beamed grace note that will be added as a child of that beam.\n return GetNongraceParentBeam(bobj, layer);\n }\n else\n {\n if (layer._property:ActiveBeam != null)\n {\n layer._property:ActiveBeam = null;\n }\n return null;\n }\n }\n case (StartBeam)\n {\n newBeam = libmei.Beam();\n if (bobj.GraceNote)\n {\n layer._property:ActiveGraceBeam = newBeam;\n nonGraceParentBeam = GetNongraceParentBeam(bobj, layer);\n if (nonGraceParentBeam != null)\n {\n newBeam._property:ParentBeam = nonGraceParentBeam;\n }\n }\n else\n {\n layer._property:ActiveBeam = newBeam;\n }\n return newBeam;\n }\n default {\n \/\/ ContinueBeam and SingleBeam\n if (bobj.GraceNote)\n {\n return layer._property:ActiveGraceBeam;\n }\n else\n {\n return layer._property:ActiveBeam;\n }\n }\n }\n} \/\/$end\n\nfunction ProcessTuplet (noteRest, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (noteRest.ParentTupletIfAny = null)\n {\n return null;\n }\n\n \/*\n We encode inner tuplets of nested tuplet structures as s.\n Therefore we always return the outermost MEI tuplet for content to be added.\n Still, we need to keep track of the inner tuplets to assign the @endid.\n layer._property:ActiveMeiTuplet always points to the innermost tuplet.\n *\/\n activeMeiTuplet = layer._property:ActiveMeiTuplet;\n\n tupletIsContinued = activeMeiTuplet != null and TupletsEqual(noteRest.ParentTupletIfAny, activeMeiTuplet._property:SibTuplet);\n\n if (not(tupletIsContinued))\n {\n \/\/ New tuplets need to be added\n noteRestTupletStack = GetTupletStack(noteRest);\n sibTuplet = null;\n meiTupletDepth = GetMeiTupletDepth(layer);\n\n for i = meiTupletDepth to noteRestTupletStack.Length\n {\n sibTuplet = noteRestTupletStack[i];\n nextActiveMeiTuplet = GenerateTuplet(sibTuplet);\n if (meiTupletDepth > 0 or i > meiTupletDepth)\n {\n \/\/ We have an inner tuplet that we encode as \n nextActiveMeiTuplet = ShiftTupletToTupletSpan(nextActiveMeiTuplet, layer);\n }\n libmei.AddAttribute(nextActiveMeiTuplet, 'startid', '#' & meielement._id);\n \/\/ We basically create a linked list of tuplets\n nextActiveMeiTuplet._property:ParentTuplet = activeMeiTuplet;\n nextActiveMeiTuplet._property:SibTuplet = sibTuplet;\n activeMeiTuplet = nextActiveMeiTuplet;\n }\n layer._property:ActiveMeiTuplet = activeMeiTuplet;\n }\n\n meiTuplet = activeMeiTuplet;\n for i = 0 to CountTupletsEndingAtNoteRest(noteRest)\n {\n libmei.AddAttribute(meiTuplet, 'endid', '#' & meielement._id);\n meiTuplet = meiTuplet._property:ParentTuplet;\n }\n layer._property:ActiveMeiTuplet = meiTuplet;\n\n outermostMeiTuplet = activeMeiTuplet;\n while (outermostMeiTuplet._property:ParentTuplet)\n {\n outermostMeiTuplet = outermostMeiTuplet._property:ParentTuplet;\n }\n return outermostMeiTuplet;\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n\n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it\n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(tupletSpan._id);\n Self._property:MeasureObjects = mobjs;\n\n return tupletSpan;\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n \n if (lyricobj.Text = '')\n {\n return null;\n }\n \n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (j = 0)\n {\n \/\/add a wordpos only for partial words\n if (lyric_word.Length > 1)\n {\n libmei.AddAttribute(sylel, 'wordpos', 'i'); \/\/ 'initial'\n\n libmei.AddAttribute(sylel, 'con', 'd'); \/\/dash syllable connector\n }\n\n \/\/it is also possible, that an initial syllable has an underscore as an extender, if it is the only syllable of a word\n if (lyric_word.Length = 1)\n {\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n }\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n\n syltext = libmei.GetText(sylel);\n\n if (utils.Pos('_', syltext) > -1)\n {\n \/\/ Syllable elision. split this syllable element by underscore.\n syllables = MSplitString(syltext, '_');\n sylarray = CreateSparseArray();\n\n \/\/ reset the text of the first syllable element to the first half of the syllable.\n libmei.SetText(sylel, syllables[0]);\n libmei.AddAttribute(sylel, 'con', 'b');\n\n for s = 1 to syllables.Length\n {\n esyl = libmei.Syl();\n libmei.SetText(esyl, syllables[s]);\n libmei.AddChild(verse, esyl);\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n if (name = 'chord')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'chord'));\n }\n\n libmei.AddChild(obj, verse);\n }\n else\n {\n Log('Could not find note object for syl ' & syl);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so\n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessTremolo (bobj) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.DoubleTremolos = 0)\n {\n return null;\n }\n\n Log('Fingered tremolo: ' & bobj.DoubleTremolos);\n tremEl = libmei.FTrem();\n libmei.AddAttribute(tremEl, 'slash', bobj.DoubleTremolos);\n libmei.AddAttribute(tremEl, 'measperf')\n\n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n case ('52')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('53')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('54')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('55')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('160')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'stop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('162')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'open');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('163')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('164')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('165')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('166')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('212')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'ten');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('214')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'marc');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('217')\n {\n \/\/ up-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('218')\n {\n \/\/ down-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('233')\n {\n \/\/ up-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('234')\n {\n \/\/ down-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('240')\n {\n \/\/ double staccato\n return null;\n }\n case ('241')\n {\n \/\/ triple staccato\n return null;\n }\n case ('242')\n {\n \/\/ quadruple staccato\n return null;\n }\n case ('243')\n {\n \/\/ snap\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'snap');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('480')\n {\n \/\/scoop\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'scoop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('481')\n {\n \/\/fall\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fall');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('490')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fingernail');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('494')\n {\n \/\/doit\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'doit');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('495')\n {\n \/\/plop\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'plop');\n libmei.AddChild(nobj, artic);\n }\n\n }\n\n }\n} \/\/$end\n","old_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = sibmei2.GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = sibmei2.GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer, normalizedBeamProp) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Returns the active beam, if any, and creates new beam elements\n at the start of a beam.\n *\/\n switch (normalizedBeamProp)\n {\n case (NoBeam)\n {\n if (bobj.GraceNote)\n {\n if (layer._property:ActiveGraceBeam != null)\n {\n layer._property:ActiveGraceBeam = null;\n }\n \/\/ If there is an active non-grace beam, we have a normal beam spanning\n \/\/ over a non-beamed grace note that will be added as a child of that beam.\n return GetNongraceParentBeam(bobj, layer);\n }\n else\n {\n if (layer._property:ActiveBeam != null)\n {\n layer._property:ActiveBeam = null;\n }\n return null;\n }\n }\n case (StartBeam)\n {\n newBeam = libmei.Beam();\n if (bobj.GraceNote)\n {\n layer._property:ActiveGraceBeam = newBeam;\n nonGraceParentBeam = GetNongraceParentBeam(bobj, layer);\n if (nonGraceParentBeam != null)\n {\n newBeam._property:ParentBeam = nonGraceParentBeam;\n }\n }\n else\n {\n layer._property:ActiveBeam = newBeam;\n }\n return newBeam;\n }\n default {\n \/\/ ContinueBeam and SingleBeam\n if (bobj.GraceNote)\n {\n return layer._property:ActiveGraceBeam;\n }\n else\n {\n return layer._property:ActiveBeam;\n }\n }\n }\n} \/\/$end\n\nfunction ProcessTuplet (noteRest, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (noteRest.ParentTupletIfAny = null)\n {\n return null;\n }\n\n \/*\n We encode inner tuplets of nested tuplet structures as s.\n Therefore we always return the outermost MEI tuplet for content to be added.\n Still, we need to keep track of the inner tuplets to assign the @endid.\n layer._property:ActiveMeiTuplet always points to the innermost tuplet.\n *\/\n activeMeiTuplet = layer._property:ActiveMeiTuplet;\n\n tupletIsContinued = activeMeiTuplet != null and TupletsEqual(noteRest.ParentTupletIfAny, activeMeiTuplet._property:SibTuplet);\n\n if (not(tupletIsContinued))\n {\n \/\/ New tuplets need to be added\n noteRestTupletStack = GetTupletStack(noteRest);\n sibTuplet = null;\n meiTupletDepth = GetMeiTupletDepth(layer);\n\n for i = meiTupletDepth to noteRestTupletStack.Length\n {\n sibTuplet = noteRestTupletStack[i];\n nextActiveMeiTuplet = GenerateTuplet(sibTuplet);\n if (meiTupletDepth > 0 or i > meiTupletDepth)\n {\n \/\/ We have an inner tuplet that we encode as \n nextActiveMeiTuplet = ShiftTupletToTupletSpan(nextActiveMeiTuplet, layer);\n }\n libmei.AddAttribute(nextActiveMeiTuplet, 'startid', '#' & meielement._id);\n \/\/ We basically create a linked list of tuplets\n nextActiveMeiTuplet._property:ParentTuplet = activeMeiTuplet;\n nextActiveMeiTuplet._property:SibTuplet = sibTuplet;\n activeMeiTuplet = nextActiveMeiTuplet;\n }\n layer._property:ActiveMeiTuplet = activeMeiTuplet;\n }\n\n meiTuplet = activeMeiTuplet;\n for i = 0 to CountTupletsEndingAtNoteRest(noteRest)\n {\n libmei.AddAttribute(meiTuplet, 'endid', '#' & meielement._id);\n meiTuplet = meiTuplet._property:ParentTuplet;\n }\n layer._property:ActiveMeiTuplet = meiTuplet;\n\n outermostMeiTuplet = activeMeiTuplet;\n while (outermostMeiTuplet._property:ParentTuplet)\n {\n outermostMeiTuplet = outermostMeiTuplet._property:ParentTuplet;\n }\n return outermostMeiTuplet;\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n\n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it\n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(tupletSpan._id);\n Self._property:MeasureObjects = mobjs;\n\n return tupletSpan;\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n \n if (lyricobj.Text = '')\n {\n return null;\n }\n \n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (j = 0)\n {\n libmei.AddAttribute(sylel, 'wordpos', 'i'); \/\/ 'initial'\n\n if (lyric_word.Length > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n\n syltext = libmei.GetText(sylel);\n\n if (utils.Pos('_', syltext) > -1)\n {\n \/\/ Syllable elision. split this syllable element by underscore.\n syllables = MSplitString(syltext, '_');\n sylarray = CreateSparseArray();\n\n \/\/ reset the text of the first syllable element to the first half of the syllable.\n libmei.SetText(sylel, syllables[0]);\n libmei.AddAttribute(sylel, 'con', 'b');\n\n for s = 1 to syllables.Length\n {\n esyl = libmei.Syl();\n libmei.SetText(esyl, syllables[s]);\n libmei.AddChild(verse, esyl);\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n if (name = 'chord')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'chord'));\n }\n\n libmei.AddChild(obj, verse);\n }\n else\n {\n Log('Could not find note object for syl ' & syl);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so\n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessTremolo (bobj) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.DoubleTremolos = 0)\n {\n return null;\n }\n\n Log('Fingered tremolo: ' & bobj.DoubleTremolos);\n tremEl = libmei.FTrem();\n libmei.AddAttribute(tremEl, 'slash', bobj.DoubleTremolos);\n libmei.AddAttribute(tremEl, 'measperf')\n\n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n case ('52')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('53')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('54')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('55')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('160')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'stop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('162')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'open');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('163')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('164')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('165')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('166')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('212')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'ten');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('214')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'marc');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('217')\n {\n \/\/ up-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('218')\n {\n \/\/ down-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('233')\n {\n \/\/ up-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('234')\n {\n \/\/ down-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('240')\n {\n \/\/ double staccato\n return null;\n }\n case ('241')\n {\n \/\/ triple staccato\n return null;\n }\n case ('242')\n {\n \/\/ quadruple staccato\n return null;\n }\n case ('243')\n {\n \/\/ snap\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'snap');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('480')\n {\n \/\/scoop\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'scoop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('481')\n {\n \/\/fall\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fall');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('490')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fingernail');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('494')\n {\n \/\/doit\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'doit');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('495')\n {\n \/\/plop\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'plop');\n libmei.AddChild(nobj, artic);\n }\n\n }\n\n }\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"19538f50752ec1471d80ff0b8d412e1a099046c4","subject":"New: Key and Time Signature Changes","message":"New: Key and Time Signature Changes\n\nChanges to key and time signatures are now reflected in the MEI output.\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(line._id);\n Self._property:MeasureObjects = mlines;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(line._id);\n Self._property:MeasureObjects = mlines;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"f0b281bbcb0f4952e898172b17c81d574ed7140c","subject":"add Map buffer-size","message":"add Map buffer-size\n","repos":"andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto","old_file":"osmt\/style.mss","new_file":"osmt\/style.mss","new_contents":"\/*\n==Database level==\n* join adjacent way segments with same classification and name\n for labels layer and increase text-spacing so labels aren't\n repeated right next to each other\n\n* optimise queries as to select just what is required for rendering\n\n* select way area so can style bay names larger for larger bays\n\n==Style level==\n* ShieldSymbolizers for POIs with names at high zooms (eg police station\n icon with name)\n*\/\n\nMap {\n \/* Due to the use of extra large text for high zooms for suburb and\n place names, this style requires a fair bit of padding. *\/\n buffer-size: 256;\n}\n\n\/*\n Large labeled areas such as park, golf courses and schools.\n\n These labels are shown at z15-17, before we see POI features.\n\n We use the way_area to show labels for larger areas from lower zooms.\n\n By placing a point-file below all the text-* attributes mapnik will\n render a marker icon if it decides it can't fit the text due to other labels\n in the way.\n*\/\n\n@school_label_halo_colour: #241600;\n@park_label_halo_colour: #0e300e;\n@industrial_label_halo_colour: #380032;\n\n@area_label_opacity: 1.0;\n@area_label_halo_radius: 2.0;\n\n\/** Parks **\/\n\n\/* only show from z15+ where area > 30,000 *\/\n#park-labels[zoom > 14][way_area > 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @park_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\/* start showing on z16+ on area > 10,000 *\/\n#park-labels[zoom > 15][way_area >= 10000][way_area < 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @park_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\/* show the rest from z17+ *\/\n#park-labels[zoom > 16][way_area < 10000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @park_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\n\/** Golf Courses **\/\n\n\/* since most are large, just render all labels from zoom 15+ *\/\n#leisure[leisure='golf_course'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: #021402;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 50;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n \/* if mapnik can't place a label, try an icon instead *\/\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/golf.glow.000000.12.png');\n}\n\n\n\/** Schools **\/\n\n\/* only show from z15+ where area > 30,000 *\/\n#school-labels[zoom > 14][way_area > 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @school_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 30;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n \/* if mapnik can't place a label, try an icon instead *\/\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.12.png');\n}\n\n\/* start showing on z16+ on area > 10,000 *\/\n#school-labels[zoom > 15][way_area >= 10000][way_area < 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @school_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.16.png');\n}\n\n\/* show the rest from z17+ *\/\n#school-labels[zoom > 16][way_area < 10000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @school_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.20.png');\n}\n\n\/* building names *\/\n#building-label[zoom > 16] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n\n [zoom > 21] { text-size: 17; }\n [zoom = 21] { text-size: 16; }\n [zoom = 20] { text-size: 15; }\n [zoom = 19] { text-size: 14; }\n [zoom = 18] { text-size: 12; }\n [zoom = 17] { text-size: 10; }\n}\n\n\/** Industrial Areas **\/\n\n\/* only show from z14+ where area > 30,000 *\/\n#industrial-labels[zoom > 13][way_area > 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @industrial_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom < 16] { text-size: 11; }\n}\n\n\/* start showing on z16+ on area > 10,000 *\/\n#industrial-labels[zoom > 14][way_area >= 10000][way_area < 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @industrial_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom < 17] { text-size: 11; }\n}\n\n\/* show the rest from z17+ *\/\n#industrial-labels[zoom > 15][way_area < 10000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @industrial_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom < 17] { text-size: 11; }\n}\n\n\/*\n Miscellaneous items\n *\/\n\n\/* ferry routes *\/\n#ferry-route[zoom > 6][zoom < 12] {\n line-color: white;\n line-width: 0.7;\n line-opacity: 0.5;\n}\n\n#ferry-route[zoom > 11] {\n line-color: #00066f;\n line-dasharray: 6,6;\n\n [zoom = 12] { line-width: 0.8; }\n [zoom = 13] { line-width: 1.0; }\n [zoom = 14] { line-width: 1.3; }\n [zoom = 15] { line-width: 1.6; }\n [zoom > 15] { line-width: 2.0; }\n\n ::halo{\n line-color: white;\n line-width: 1.0;\n line-opacity: 0.5;\n\n [zoom = 13] { line-width: 1.2; }\n [zoom = 14] { line-width: 1.5; }\n [zoom = 15] { line-width: 1.8; }\n [zoom > 15] { line-width: 2.2; }\n }\n}\n\n#landuse[landuse='military'][zoom > 10] {\n ::outline {\n line-color: #f55000;\n line-width: 3;\n line-opacity: 0.329;\n }\n\n polygon-pattern-file: url('\/usr\/share\/icons\/osmt\/military-pattern.png');\n}\n","old_contents":"\/*\n==Database level==\n* join adjacent way segments with same classification and name\n for labels layer and increase text-spacing so labels aren't\n repeated right next to each other\n\n* optimise queries as to select just what is required for rendering\n\n* select way area so can style bay names larger for larger bays\n\n==Style level==\n* ShieldSymbolizers for POIs with names at high zooms (eg police station\n icon with name)\n*\/\n\n\/*\n Large labeled areas such as park, golf courses and schools.\n\n These labels are shown at z15-17, before we see POI features.\n\n We use the way_area to show labels for larger areas from lower zooms.\n\n By placing a point-file below all the text-* attributes mapnik will\n render a marker icon if it decides it can't fit the text due to other labels\n in the way.\n*\/\n\n@school_label_halo_colour: #241600;\n@park_label_halo_colour: #0e300e;\n@industrial_label_halo_colour: #380032;\n\n@area_label_opacity: 1.0;\n@area_label_halo_radius: 2.0;\n\n\/** Parks **\/\n\n\/* only show from z15+ where area > 30,000 *\/\n#park-labels[zoom > 14][way_area > 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @park_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\/* start showing on z16+ on area > 10,000 *\/\n#park-labels[zoom > 15][way_area >= 10000][way_area < 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @park_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\/* show the rest from z17+ *\/\n#park-labels[zoom > 16][way_area < 10000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @park_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\n\/** Golf Courses **\/\n\n\/* since most are large, just render all labels from zoom 15+ *\/\n#leisure[leisure='golf_course'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: #021402;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 50;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n \/* if mapnik can't place a label, try an icon instead *\/\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/golf.glow.000000.12.png');\n}\n\n\n\/** Schools **\/\n\n\/* only show from z15+ where area > 30,000 *\/\n#school-labels[zoom > 14][way_area > 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @school_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 30;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n \/* if mapnik can't place a label, try an icon instead *\/\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.12.png');\n}\n\n\/* start showing on z16+ on area > 10,000 *\/\n#school-labels[zoom > 15][way_area >= 10000][way_area < 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @school_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.16.png');\n}\n\n\/* show the rest from z17+ *\/\n#school-labels[zoom > 16][way_area < 10000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @school_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.20.png');\n}\n\n\/* building names *\/\n#building-label[zoom > 16] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n\n [zoom > 21] { text-size: 17; }\n [zoom = 21] { text-size: 16; }\n [zoom = 20] { text-size: 15; }\n [zoom = 19] { text-size: 14; }\n [zoom = 18] { text-size: 12; }\n [zoom = 17] { text-size: 10; }\n}\n\n\/** Industrial Areas **\/\n\n\/* only show from z14+ where area > 30,000 *\/\n#industrial-labels[zoom > 13][way_area > 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @industrial_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom < 16] { text-size: 11; }\n}\n\n\/* start showing on z16+ on area > 10,000 *\/\n#industrial-labels[zoom > 14][way_area >= 10000][way_area < 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @industrial_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom < 17] { text-size: 11; }\n}\n\n\/* show the rest from z17+ *\/\n#industrial-labels[zoom > 15][way_area < 10000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @industrial_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom < 17] { text-size: 11; }\n}\n\n\/*\n Miscellaneous items\n *\/\n\n\/* ferry routes *\/\n#ferry-route[zoom > 6][zoom < 12] {\n line-color: white;\n line-width: 0.7;\n line-opacity: 0.5;\n}\n\n#ferry-route[zoom > 11] {\n line-color: #00066f;\n line-dasharray: 6,6;\n\n [zoom = 12] { line-width: 0.8; }\n [zoom = 13] { line-width: 1.0; }\n [zoom = 14] { line-width: 1.3; }\n [zoom = 15] { line-width: 1.6; }\n [zoom > 15] { line-width: 2.0; }\n\n ::halo{\n line-color: white;\n line-width: 1.0;\n line-opacity: 0.5;\n\n [zoom = 13] { line-width: 1.2; }\n [zoom = 14] { line-width: 1.5; }\n [zoom = 15] { line-width: 1.8; }\n [zoom > 15] { line-width: 2.2; }\n }\n}\n\n#landuse[landuse='military'][zoom > 10] {\n ::outline {\n line-color: #f55000;\n line-width: 3;\n line-opacity: 0.329;\n }\n\n polygon-pattern-file: url('\/usr\/share\/icons\/osmt\/military-pattern.png');\n}\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"CartoCSS"} {"commit":"c92fb406c3a79a5781e31cfc277124b3d6934b78","subject":"Twiddled park and water colors to be slightly more recessive","message":"Twiddled park and water colors to be slightly more recessive\n\ngit-svn-id: 52b2958d923a603b3f48d22aabe6b5bf40478d2a@163 dbea3d40-3153-0410-b551-57805770c6e6\n","repos":"glampr\/Cascadenik,mapnik\/Cascadenik","old_file":"openstreetmap\/ground.mss","new_file":"openstreetmap\/ground.mss","new_contents":"Map\n{\n map-bgcolor: #8cb6d3;\n}\n\n.coast.edge.outer\n{\n line-width: 13;\n line-color: #a1cbea;\n line-join: round;\n}\n\n.coast.edge.inner\n{\n line-width: 5;\n line-color: #7eaac1;\n line-join: round;\n}\n\n.coast.edge.outer[zoom<=12] { line-width: 9; }\n.coast.edge.inner[zoom<=12] { line-width: 3; }\n\n.water.area\n{\n line-width: 2;\n line-color: #7eaac1;\n polygon-fill: #8cb6d3;\n line-join: round;\n}\n\n.coast.fill\n{\n polygon-fill: #dceee9;\n \/*\n line-width: 1;\n line-color: #dceee9;\n *\/\n}\n\n.citylike.area,\n.parking.area\n{\n polygon-fill: #d0d0d0;\n}\n\n.parklike.area\n{\n polygon-fill: #91b156;\n}\n\n.parklike.area[zoom>=16]\n{\n polygon-pattern-file: url('img\/trees-z.png');\n}\n\n.parklike.area[landuse=cemetery]\n{\n polygon-fill: #94b580;\n}\n\n.parklike.area[landuse=cemetery][zoom>=16]\n{\n polygon-pattern-file: url('img\/graveyard-z.png');\n}\n\n.parklike.area[zoom>=11]\n{\n line-width: 1;\n line-color: #6dbe3c;\n}\n\n.building.area[zoom>=13]\n{\n polygon-fill: #aaaaaa;\n}\n\n.building.area[zoom>=15]\n{\n line-width: 1;\n line-color: #808080;\n}\n\n.water.label name,\n.parklike.label name,\n.citylike.label name,\n.building.label name\n{\n text-face-name: \"DejaVu Sans Book\";\n text-fill: #000;\n text-placement: point;\n text-halo-radius: 2;\n}\n\n.water.label[zoom>=13][zoom<=15][size=large] name,\n.parklike.label[zoom>=13][zoom<=15][size=large] name,\n.citylike.label[zoom>=13][zoom<=15][size=large] name,\n.building.label[zoom>=13][zoom<=15][size=large] name,\n.water.label[zoom=15][size=medium] name,\n.parklike.label[zoom=15][size=medium] name,\n.citylike.label[zoom=15][size=medium] name,\n.building.label[zoom=15][size=medium] name\n{\n text-size: 9;\n text-wrap-width: 50;\n}\n\n.water.label[zoom>=16] name,\n.parklike.label[zoom>=16] name,\n.citylike.label[zoom>=16] name,\n.building.label[zoom>=16] name\n{\n text-wrap-width: 100;\n text-size: 12;\n}\n\n.water.label name\n{\n text-halo-fill: #affcff;\n}\n\n.parklike.label name\n{\n text-halo-fill: #d1ffb6;\n}\n\n.citylike.label name\n{\n text-halo-fill: #eeeeee;\n}\n\n.building.label name\n{\n text-halo-fill: #dddddd;\n}\n","old_contents":"Map\n{\n map-bgcolor: #81cee7;\n}\n\n.coast.edge.outer\n{\n line-width: 13;\n line-color: #89dbf6;\n line-join: round;\n}\n\n.coast.edge.inner\n{\n line-width: 5;\n line-color: #7eaac1;\n line-join: round;\n}\n\n.coast.edge.outer[zoom<=12] { line-width: 9; }\n.coast.edge.inner[zoom<=12] { line-width: 3; }\n\n.water.area\n{\n line-width: 2;\n line-color: #7eaac1;\n polygon-fill: #81cee7;\n line-join: round;\n}\n\n.coast.fill\n{\n polygon-fill: #dceee9;\n \/*\n line-width: 1;\n line-color: #dceee9;\n *\/\n}\n\n.citylike.area,\n.parking.area\n{\n polygon-fill: #d0d0d0;\n}\n\n.parklike.area\n{\n polygon-fill: #91da65;\n}\n\n.parklike.area[zoom>=16]\n{\n polygon-pattern-file: url('img\/trees-z.png');\n}\n\n.parklike.area[landuse=cemetery]\n{\n polygon-fill: #94b580;\n}\n\n.parklike.area[landuse=cemetery][zoom>=16]\n{\n polygon-pattern-file: url('img\/graveyard-z.png');\n}\n\n.parklike.area[zoom>=11]\n{\n line-width: 1;\n line-color: #6dbe3c;\n}\n\n.building.area[zoom>=13]\n{\n polygon-fill: #aaaaaa;\n}\n\n.building.area[zoom>=15]\n{\n line-width: 1;\n line-color: #808080;\n}\n\n.water.label name,\n.parklike.label name,\n.citylike.label name,\n.building.label name\n{\n text-face-name: \"DejaVu Sans Book\";\n text-fill: #000;\n text-placement: point;\n text-halo-radius: 2;\n}\n\n.water.label[zoom>=13][zoom<=15][size=large] name,\n.parklike.label[zoom>=13][zoom<=15][size=large] name,\n.citylike.label[zoom>=13][zoom<=15][size=large] name,\n.building.label[zoom>=13][zoom<=15][size=large] name,\n.water.label[zoom=15][size=medium] name,\n.parklike.label[zoom=15][size=medium] name,\n.citylike.label[zoom=15][size=medium] name,\n.building.label[zoom=15][size=medium] name\n{\n text-size: 9;\n text-wrap-width: 50;\n}\n\n.water.label[zoom>=16] name,\n.parklike.label[zoom>=16] name,\n.citylike.label[zoom>=16] name,\n.building.label[zoom>=16] name\n{\n text-wrap-width: 100;\n text-size: 12;\n}\n\n.water.label name\n{\n text-halo-fill: #affcff;\n}\n\n.parklike.label name\n{\n text-halo-fill: #d1ffb6;\n}\n\n.citylike.label name\n{\n text-halo-fill: #eeeeee;\n}\n\n.building.label name\n{\n text-halo-fill: #dddddd;\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"27f60b73e802c41e3c2574a0e6c02aff9736d447","subject":"fix cue","message":"fix cue\n\n","repos":"music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n\n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n \/\/encodingDesc must preceed workList in MEI 4.0\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = GenerateApplicationInfo();\n libmei.AddChild(encodingD, appI);\n\n \/\/generate workList\n workList = libmei.WorkList();\n Self._property:WorkListElement = workList;\n\n wd_work = libmei.Work();\n wd_title = libmei.Title();\n libmei.AddChild(wd_work, wd_title);\n libmei.AddChild(workList, wd_work);\n libmei.AddChild(header, workList);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.Composer();\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_work, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.Lyricist();\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_work, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.Arranger();\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_work, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n return header;\n} \/\/$end\n\nfunction GenerateApplicationInfo () {\n \/\/$module(ExportGenerators.mss)\n\n appI = libmei.AppInfo();\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return appI;\n\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:SlurResolver = CreateSparseArray();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n \/\/annot is valid as a child of score\n libmei.AddChild(sco, ano);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workList = Self._property:WorkListElement;\n workEl = libmei.Work();\n libmei.AddChild(workList, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n l = null;\n\n mobjs = Self._property:MeasureObjects;\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0 or (l = null and bobj.Type = 'Clef'))\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n\n l._property:CurrentPos = 0;\n }\n }\n\n obj = null;\n mobj = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n \/\/ Clefs are placed inside the musical flow like notes. Hence we also need to find\n \/\/ out whether they are part of beams or tuplets.\n clef = GenerateClef(bobj);\n\n prevNoteRest = PrevNormalOrGrace(bobj, false);\n\n if (prevNoteRest != null)\n {\n prevBeamProp = NormalizedBeamProp(prevNoteRest);\n\n switch (prevBeamProp)\n {\n case ('StartBeam')\n {\n beam = l._property:ActiveBeam;\n }\n case ('NoBeam')\n {\n beam = null;\n }\n default\n {\n \/\/ ContinueBeam and SingleBeam\n nextNoteRest = NextNormalOrGrace(bobj, false);\n if (nextNoteRest != null)\n {\n nextBeamProp = NormalizedBeamProp(nextNoteRest);\n if ((nextBeamProp = ContinueBeam) or (nextBeamProp = SingleBeam))\n {\n beam = l._property:ActiveBeam;\n }\n }\n }\n }\n\n tuplet = l._property:ActiveMeiTuplet;\n while (tuplet != null and tuplet._property:ParentTuplet != null)\n {\n tuplet = tuplet._property:ParentTuplet;\n }\n }\n\n AppendToLayer(clef, l, beam, tuplet);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n\n AppendToLayer(note, l, beam, tuplet);\n }\n\n if (bobj.ArpeggioType != ArpeggioTypeNone) {\n arpeg = GenerateArpeggio(bobj);\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(arpeg._id);\n Self._property:MeasureObjects = mobjs;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n }\n }\n\n for each bobj in bar\n {\n obj = null;\n mobj = null;\n chordsym = null;\n\n switch (bobj.Type)\n {\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n bobj._property:mobj = mobj;\n PushToHashedLayer(Self._property:SlurResolver, bobj.EndBarNumber, bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('ArpeggioLine')\n {\n mobj = GenerateArpeggio(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n if (mobj != null)\n {\n \/\/Try to get note at position of bracket and put id\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(mobj, 'startid', '#' & obj._id);\n }\n }\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n Self._property:MeasureObjects = mobjs;\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n ProcessEndingSlurs(bar);\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n else\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'cue', 'true');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n libmei.AddAttribute(nr, 'stem.mod', '1slash');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ppq', dur);\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMEI(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'cue', 'true');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pden & '.0' \/ pnum & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n vel = nobj.OriginalVelocity;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'vel', vel);\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', gesdur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n if (nobj.Dx != 0)\n {\n libmei.AddAttribute(n, 'ho', ConvertOffsetsToMEI(nobj.Dx));\n }\n\n if (nobj.Color != nobj.ParentNoteRest.Color)\n {\n note_color = ConvertColor(nobj);\n libmei.AddAttribute(n, 'color', note_color);\n }\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', dur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n \/\/ MEI now supports a four-bar repeat\n obj = libmei.MultiRpt();\n libmei.AddAttribute(obj, 'num', '4');\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n if (score.StaffCount > 0)\n {\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n }\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n diaTrans = s.InitialInstrumentType.DiatonicTransposition;\n semiTrans = s.InitialInstrumentType.ChromaticTransposition;\n if (diaTrans != 0 and semiTrans != 0)\n {\n libmei.AddAttribute(std, 'trans.semi', semiTrans);\n libmei.AddAttribute(std, 'trans.diat', diaTrans);\n }\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.FullInstrumentName != null)\n {\n label = libmei.Label();\n libmei.SetText(label, s.FullInstrumentName);\n libmei.AddChild(std, label);\n }\n\n if (s.ShortInstrumentName != null)\n {\n labelAbbr = libmei.LabelAbbr();\n libmei.SetText(labelAbbr, s.ShortInstrumentName);\n libmei.AddChild(std, labelAbbr);\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n \/\/brackets\n case ('bracket')\n {\n line = libmei.Line();\n bracketType = 'bracket';\n\n \/\/horizontal brackets\n if (linecomps.Length >= 3)\n {\n \/\/brackets above\n if (linecomps[3] = 'above')\n {\n libmei.AddAttribute(line, 'place', 'above');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleup');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angleup');\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n \/\/brackets below\n if (linecomps[3] = 'below')\n {\n libmei.AddAttribute(line, 'place', 'below');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angledown');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angledown');\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n \/\/vertical bracktes\n if (linecomps[3] = 'vertical')\n {\n bracketType = bracketType & ' vertical';\n\n \/\/Add direction of bracket: line.staff.bracket.vertical.2 opens to the right, line.staff.bracket.vertical opens to the left\n if (linecomps > 4)\n {\n if (linecomps[4] = '2')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleright');\n libmei.AddAttribute(line, 'endsym', 'angleright');\n }\n }\n\n else\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'startsym', 'angleleft');\n libmei.AddAttribute(line, 'endsym', 'angleleft');\n }\n }\n }\n\n \/\/add types of bracktes\n libmei.AddAttribute(line, 'type', bracketType);\n }\n \/\/solid vertical line\n case ('vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n libmei.AddAttribute(line,'type','vertical');\n }\n \/\/dashed lines\n case ('dashed')\n {\n \/\/dashed vertical line\n if (linecomps.Length > 3)\n {\n if (linecomps[3] = 'vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n libmei.AddAttribute(line,'type','vertical');\n }\n }\n \/\/dashed horizontal line\n else\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n }\n }\n \/\/dotted horizontal line\n case('dotted')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dotted');\n }\n \/\/solid horizontal line\n case('plain')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n }\n case ('vibrato')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'vibrato');\n libmei.AddAttribute(line, 'form', 'wavy');\n libmei.AddAttribute(line, 'place', 'above');\n\n }\n\n \/\/To catch diverse line types, set a default\n default\n {\n line = libmei.Line();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateArpeggio (bobj) {\n \/\/$module(ExportGenerators.mss)\n arpeg = libmei.Arpeg();\n orientation = null;\n\n switch (bobj.Type)\n {\n case ('NoteRest')\n {\n switch (bobj.ArpeggioType)\n {\n case (ArpeggioTypeUp)\n {\n orientation = 1;\n }\n case (ArpeggioTypeDown)\n {\n orientation = -1;\n }\n }\n if (bobj.ArpeggioBottomDy > bobj.ArpeggioTopDy)\n {\n \/\/ Arpeggio was manipulated to be upside down\n orientation = -1 * orientation;\n }\n }\n case ('ArpeggioLine')\n {\n if (bobj.StyleId != 'line.staff.arpeggio') {\n \/\/ This means: Line style is line.staff.arpeggio.up or\n \/\/ line.staff.arpeggio.down.\n \/\/ Strangely, the line style does not really matter for the\n \/\/ visual orientation of the arpeggio. As long as RhDy and\n \/\/ and Dy properties are identical, arpeggios look the same,\n \/\/ independant of the two line styles with arrowheads.\n orientation = bobj.RhDy - bobj.Dy;\n }\n }\n }\n\n if (orientation = null)\n {\n libmei.AddAttribute(arpeg, 'arrow', 'false');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'arrow', 'true');\n\n if (orientation > 0)\n {\n libmei.AddAttribute(arpeg, 'order', 'up');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'order', 'down');\n }\n }\n\n arpeg = AddBarObjectInfoToElement(bobj, arpeg);\n\n return arpeg;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'glyph.auth', 'smufl');\n libmei.AddAttribute(symbol, 'glyph.num', glyphnum);\n libmei.AddAttribute(symbol, 'glyph.name', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end\n","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n\n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n \/\/encodingDesc must preceed workList in MEI 4.0\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = GenerateApplicationInfo();\n libmei.AddChild(encodingD, appI);\n\n \/\/generate workList\n workList = libmei.WorkList();\n Self._property:WorkListElement = workList;\n\n wd_work = libmei.Work();\n wd_title = libmei.Title();\n libmei.AddChild(wd_work, wd_title);\n libmei.AddChild(workList, wd_work);\n libmei.AddChild(header, workList);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.Composer();\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_work, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.Lyricist();\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_work, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.Arranger();\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_work, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n return header;\n} \/\/$end\n\nfunction GenerateApplicationInfo () {\n \/\/$module(ExportGenerators.mss)\n\n appI = libmei.AppInfo();\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return appI;\n\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:SlurResolver = CreateSparseArray();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n \/\/annot is valid as a child of score\n libmei.AddChild(sco, ano);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workList = Self._property:WorkListElement;\n workEl = libmei.Work();\n libmei.AddChild(workList, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n l = null;\n\n mobjs = Self._property:MeasureObjects;\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0 or (l = null and bobj.Type = 'Clef'))\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n\n l._property:CurrentPos = 0;\n }\n }\n\n obj = null;\n mobj = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n \/\/ Clefs are placed inside the musical flow like notes. Hence we also need to find\n \/\/ out whether they are part of beams or tuplets.\n clef = GenerateClef(bobj);\n\n prevNoteRest = PrevNormalOrGrace(bobj, false);\n\n if (prevNoteRest != null)\n {\n prevBeamProp = NormalizedBeamProp(prevNoteRest);\n\n switch (prevBeamProp)\n {\n case ('StartBeam')\n {\n beam = l._property:ActiveBeam;\n }\n case ('NoBeam')\n {\n beam = null;\n }\n default\n {\n \/\/ ContinueBeam and SingleBeam\n nextNoteRest = NextNormalOrGrace(bobj, false);\n if (nextNoteRest != null)\n {\n nextBeamProp = NormalizedBeamProp(nextNoteRest);\n if ((nextBeamProp = ContinueBeam) or (nextBeamProp = SingleBeam))\n {\n beam = l._property:ActiveBeam;\n }\n }\n }\n }\n\n tuplet = l._property:ActiveMeiTuplet;\n while (tuplet != null and tuplet._property:ParentTuplet != null)\n {\n tuplet = tuplet._property:ParentTuplet;\n }\n }\n\n AppendToLayer(clef, l, beam, tuplet);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n\n AppendToLayer(note, l, beam, tuplet);\n }\n\n if (bobj.ArpeggioType != ArpeggioTypeNone) {\n arpeg = GenerateArpeggio(bobj);\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(arpeg._id);\n Self._property:MeasureObjects = mobjs;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n }\n }\n\n for each bobj in bar\n {\n obj = null;\n mobj = null;\n chordsym = null;\n\n switch (bobj.Type)\n {\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n bobj._property:mobj = mobj;\n PushToHashedLayer(Self._property:SlurResolver, bobj.EndBarNumber, bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('ArpeggioLine')\n {\n mobj = GenerateArpeggio(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n if (mobj != null)\n {\n \/\/Try to get note at position of bracket and put id\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(mobj, 'startid', '#' & obj._id);\n }\n }\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n Self._property:MeasureObjects = mobjs;\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n ProcessEndingSlurs(bar);\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n else\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n libmei.AddAttribute(nr, 'stem.mod', '1slash');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ppq', dur);\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMEI(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'cue', 'true');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pden & '.0' \/ pnum & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n vel = nobj.OriginalVelocity;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'vel', vel);\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', gesdur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n if (nobj.Dx != 0)\n {\n libmei.AddAttribute(n, 'ho', ConvertOffsetsToMEI(nobj.Dx));\n }\n\n if (nobj.Color != nobj.ParentNoteRest.Color)\n {\n note_color = ConvertColor(nobj);\n libmei.AddAttribute(n, 'color', note_color);\n }\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', dur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n \/\/ MEI now supports a four-bar repeat\n obj = libmei.MultiRpt();\n libmei.AddAttribute(obj, 'num', '4');\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n if (score.StaffCount > 0)\n {\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n }\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n diaTrans = s.InitialInstrumentType.DiatonicTransposition;\n semiTrans = s.InitialInstrumentType.ChromaticTransposition;\n if (diaTrans != 0 and semiTrans != 0)\n {\n libmei.AddAttribute(std, 'trans.semi', semiTrans);\n libmei.AddAttribute(std, 'trans.diat', diaTrans);\n }\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.FullInstrumentName != null)\n {\n label = libmei.Label();\n libmei.SetText(label, s.FullInstrumentName);\n libmei.AddChild(std, label);\n }\n\n if (s.ShortInstrumentName != null)\n {\n labelAbbr = libmei.LabelAbbr();\n libmei.SetText(labelAbbr, s.ShortInstrumentName);\n libmei.AddChild(std, labelAbbr);\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n \/\/brackets\n case ('bracket')\n {\n line = libmei.Line();\n bracketType = 'bracket';\n\n \/\/horizontal brackets\n if (linecomps.Length >= 3)\n {\n \/\/brackets above\n if (linecomps[3] = 'above')\n {\n libmei.AddAttribute(line, 'place', 'above');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleup');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angleup');\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n \/\/brackets below\n if (linecomps[3] = 'below')\n {\n libmei.AddAttribute(line, 'place', 'below');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angledown');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angledown');\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n \/\/vertical bracktes\n if (linecomps[3] = 'vertical')\n {\n bracketType = bracketType & ' vertical';\n\n \/\/Add direction of bracket: line.staff.bracket.vertical.2 opens to the right, line.staff.bracket.vertical opens to the left\n if (linecomps > 4)\n {\n if (linecomps[4] = '2')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleright');\n libmei.AddAttribute(line, 'endsym', 'angleright');\n }\n }\n\n else\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'startsym', 'angleleft');\n libmei.AddAttribute(line, 'endsym', 'angleleft');\n }\n }\n }\n\n \/\/add types of bracktes\n libmei.AddAttribute(line, 'type', bracketType);\n }\n \/\/solid vertical line\n case ('vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n libmei.AddAttribute(line,'type','vertical');\n }\n \/\/dashed lines\n case ('dashed')\n {\n \/\/dashed vertical line\n if (linecomps.Length > 3)\n {\n if (linecomps[3] = 'vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n libmei.AddAttribute(line,'type','vertical');\n }\n }\n \/\/dashed horizontal line\n else\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n }\n }\n \/\/dotted horizontal line\n case('dotted')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dotted');\n }\n \/\/solid horizontal line\n case('plain')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n }\n case ('vibrato')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'vibrato');\n libmei.AddAttribute(line, 'form', 'wavy');\n libmei.AddAttribute(line, 'place', 'above');\n\n }\n\n \/\/To catch diverse line types, set a default\n default\n {\n line = libmei.Line();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateArpeggio (bobj) {\n \/\/$module(ExportGenerators.mss)\n arpeg = libmei.Arpeg();\n orientation = null;\n\n switch (bobj.Type)\n {\n case ('NoteRest')\n {\n switch (bobj.ArpeggioType)\n {\n case (ArpeggioTypeUp)\n {\n orientation = 1;\n }\n case (ArpeggioTypeDown)\n {\n orientation = -1;\n }\n }\n if (bobj.ArpeggioBottomDy > bobj.ArpeggioTopDy)\n {\n \/\/ Arpeggio was manipulated to be upside down\n orientation = -1 * orientation;\n }\n }\n case ('ArpeggioLine')\n {\n if (bobj.StyleId != 'line.staff.arpeggio') {\n \/\/ This means: Line style is line.staff.arpeggio.up or\n \/\/ line.staff.arpeggio.down.\n \/\/ Strangely, the line style does not really matter for the\n \/\/ visual orientation of the arpeggio. As long as RhDy and\n \/\/ and Dy properties are identical, arpeggios look the same,\n \/\/ independant of the two line styles with arrowheads.\n orientation = bobj.RhDy - bobj.Dy;\n }\n }\n }\n\n if (orientation = null)\n {\n libmei.AddAttribute(arpeg, 'arrow', 'false');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'arrow', 'true');\n\n if (orientation > 0)\n {\n libmei.AddAttribute(arpeg, 'order', 'up');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'order', 'down');\n }\n }\n\n arpeg = AddBarObjectInfoToElement(bobj, arpeg);\n\n return arpeg;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'glyph.auth', 'smufl');\n libmei.AddAttribute(symbol, 'glyph.num', glyphnum);\n libmei.AddAttribute(symbol, 'glyph.name', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"97c00729b5ae94d22f2ea8d4bc912441375e2539","subject":"Add arpeggio support","message":"Add arpeggio support\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n \n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n workDesc = libmei.WorkDesc();\n Self._property:WorkDescElement = workDesc;\n\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n libmei.AddChild(header, workDesc);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = sibmei2.GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n libmei.AddChild(mdiv, ano);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workDesc = Self._property:WorkDescElement;\n workEl = libmei.Work();\n libmei.AddChild(workDesc, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/*\n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n parent = beam._property:ParentBeam;\n if (parent = null)\n {\n parent = l;\n }\n if (beam._parent != parent._id)\n {\n libmei.AddChild(parent, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n\n if (bobj.ArpeggioType != ArpeggioTypeNone) {\n arpeg = GenerateArpeggio(bobj);\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(arpeg._id);\n Self._property:MeasureObjects = mobjs;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('ArpeggioLine')\n {\n mobj = GenerateArpeggio(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.ges', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pnum & '.0' \/ pden & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', gesdur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.ges', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateArpeggio (bobj) {\n \/\/$module(ExportGenerators.mss)\n arpeg = libmei.Arpeg();\n orientation = null;\n\n switch (bobj.Type)\n {\n case ('NoteRest')\n {\n switch (bobj.ArpeggioType)\n {\n case (ArpeggioTypeUp)\n {\n orientation = 1;\n }\n case (ArpeggioTypeDown)\n {\n orientation = -1;\n }\n }\n if (bobj.ArpeggioBottomDy > bobj.ArpeggioTopDy)\n {\n \/\/ Arpeggio was manipulated to be upside down\n orientation = -1 * orientation;\n }\n }\n case ('ArpeggioLine')\n {\n if (bobj.StyleId != 'line.staff.arpeggio') {\n \/\/ This means: Line style is line.staff.arpeggio.up or\n \/\/ line.staff.arpeggio.down.\n \/\/ Strangely, the line style does not really matter for the\n \/\/ visual orientation of the arpeggio. As long as RhDy and\n \/\/ and Dy properties are identical, arpeggios look the same,\n \/\/ independant of the two line styles with arrowheads.\n orientation = bobj.RhDy - bobj.Dy;\n }\n }\n }\n\n if (orientation = null)\n {\n libmei.AddAttribute(arpeg, 'arrow', 'false');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'arrow', 'true');\n\n if (orientation > 0)\n {\n libmei.AddAttribute(arpeg, 'order', 'up');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'order', 'down');\n }\n }\n\n arpeg = AddBarObjectInfoToElement(bobj, arpeg);\n\n return arpeg;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'authority', 'SMuFL');\n libmei.AddAttribute(symbol, 'glyphnum', glyphnum);\n libmei.AddAttribute(symbol, 'glyphname', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n \n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n workDesc = libmei.WorkDesc();\n Self._property:WorkDescElement = workDesc;\n\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n libmei.AddChild(header, workDesc);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = sibmei2.GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n libmei.AddChild(mdiv, ano);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workDesc = Self._property:WorkDescElement;\n workEl = libmei.Work();\n libmei.AddChild(workDesc, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/*\n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n parent = beam._property:ParentBeam;\n if (parent = null)\n {\n parent = l;\n }\n if (beam._parent != parent._id)\n {\n libmei.AddChild(parent, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.ges', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pnum & '.0' \/ pden & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', gesdur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.ges', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'authority', 'SMuFL');\n libmei.AddAttribute(symbol, 'glyphnum', glyphnum);\n libmei.AddAttribute(symbol, 'glyphname', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"a27717078bcd526b1726502908035d8b60601ed2","subject":"Ignore empty lyric items","message":"Ignore empty lyric items\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/ExportProcessors.mss","new_file":"src\/ExportProcessors.mss","new_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = sibmei2.GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = sibmei2.GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer, normalizedBeamProp) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Returns the active beam, if any, and creates new beam elements\n at the start of a beam.\n *\/\n switch (normalizedBeamProp)\n {\n case (NoBeam)\n {\n if (bobj.GraceNote)\n {\n if (layer._property:ActiveGraceBeam != null)\n {\n layer._property:ActiveGraceBeam = null;\n }\n \/\/ If there is an active non-grace beam, we have a normal beam spanning\n \/\/ over a non-beamed grace note that will be added as a child of that beam.\n return GetNongraceParentBeam(bobj, layer);\n }\n else\n {\n if (layer._property:ActiveBeam != null)\n {\n layer._property:ActiveBeam = null;\n }\n return null;\n }\n }\n case (StartBeam)\n {\n newBeam = libmei.Beam();\n if (bobj.GraceNote)\n {\n layer._property:ActiveGraceBeam = newBeam;\n nonGraceParentBeam = GetNongraceParentBeam(bobj, layer);\n if (nonGraceParentBeam != null)\n {\n newBeam._property:ParentBeam = nonGraceParentBeam;\n }\n }\n else\n {\n layer._property:ActiveBeam = newBeam;\n }\n return newBeam;\n }\n default {\n \/\/ ContinueBeam and SingleBeam\n if (bobj.GraceNote)\n {\n return layer._property:ActiveGraceBeam;\n }\n else\n {\n return layer._property:ActiveBeam;\n }\n }\n }\n} \/\/$end\n\nfunction ProcessTuplet (noteRest, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (noteRest.ParentTupletIfAny = null)\n {\n return null;\n }\n\n \/*\n We encode inner tuplets of nested tuplet structures as s.\n Therefore we always return the outermost MEI tuplet for content to be added.\n Still, we need to keep track of the inner tuplets to assign the @endid.\n layer._property:ActiveMeiTuplet always points to the innermost tuplet.\n *\/\n\n activeMeiTuplet = layer._property:ActiveMeiTuplet;\n\n tupletIsContinued = activeMeiTuplet != null and TupletsEqual(noteRest.ParentTupletIfAny, activeMeiTuplet._property:SibTuplet);\n\n if (not(tupletIsContinued))\n {\n \/\/ New tuplets need to be added\n noteRestTupletStack = GetTupletStack(noteRest);\n sibTuplet = null;\n meiTupletDepth = GetMeiTupletDepth(layer);\n\n for i = meiTupletDepth to noteRestTupletStack.Length\n {\n sibTuplet = noteRestTupletStack[i];\n nextActiveMeiTuplet = GenerateTuplet(sibTuplet);\n if (meiTupletDepth > 0 or i > meiTupletDepth)\n {\n \/\/ We have an inner tuplet that we encode as \n nextActiveMeiTuplet = ShiftTupletToTupletSpan(nextActiveMeiTuplet, layer);\n }\n libmei.AddAttribute(nextActiveMeiTuplet, 'startid', '#' & meielement._id);\n \/\/ We basically create a linked list of tuplets\n nextActiveMeiTuplet._property:ParentTuplet = activeMeiTuplet;\n nextActiveMeiTuplet._property:SibTuplet = sibTuplet;\n activeMeiTuplet = nextActiveMeiTuplet;\n }\n layer._property:ActiveMeiTuplet = activeMeiTuplet;\n }\n\n meiTuplet = activeMeiTuplet;\n for i = 0 to CountTupletsEndingAtNoteRest(noteRest)\n {\n libmei.AddAttribute(meiTuplet, 'endid', '#' & meielement._id);\n meiTuplet = meiTuplet._property:ParentTuplet;\n }\n layer._property:ActiveMeiTuplet = meiTuplet;\n\n outermostMeiTuplet = activeMeiTuplet;\n while (outermostMeiTuplet._property:ParentTuplet)\n {\n outermostMeiTuplet = outermostMeiTuplet._property:ParentTuplet;\n }\n return outermostMeiTuplet;\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n\n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it\n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(tupletSpan._id);\n Self._property:MeasureObjects = mobjs;\n\n return tupletSpan;\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n \n if (lyricobj.Text = '')\n {\n return null;\n }\n \n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (j = 0)\n {\n libmei.AddAttribute(sylel, 'wordpos', 'i'); \/\/ 'initial'\n\n if (lyric_word.Length > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n\n syltext = libmei.GetText(sylel);\n\n if (utils.Pos('_', syltext) > -1)\n {\n \/\/ Syllable elision. split this syllable element by underscore.\n syllables = MSplitString(syltext, '_');\n sylarray = CreateSparseArray();\n\n \/\/ reset the text of the first syllable element to the first half of the syllable.\n libmei.SetText(sylel, syllables[0]);\n libmei.AddAttribute(sylel, 'con', 'b');\n\n for s = 1 to syllables.Length\n {\n esyl = libmei.Syl();\n libmei.SetText(esyl, syllables[s]);\n libmei.AddChild(verse, esyl);\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n if (name = 'chord')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'chord'));\n }\n\n libmei.AddChild(obj, verse);\n }\n else\n {\n Log('Could not find note object for syl ' & syl);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so\n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessTremolo (bobj) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.DoubleTremolos = 0)\n {\n return null;\n }\n\n Log('Fingered tremolo: ' & bobj.DoubleTremolos);\n tremEl = libmei.FTrem();\n libmei.AddAttribute(tremEl, 'slash', bobj.DoubleTremolos);\n libmei.AddAttribute(tremEl, 'measperf')\n\n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n case ('52')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('53')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('54')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('55')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('160')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'stop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('162')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'open');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('163')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('164')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('165')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('166')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('212')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'ten');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('214')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'marc');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('217')\n {\n \/\/ up-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('218')\n {\n \/\/ down-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('233')\n {\n \/\/ up-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('234')\n {\n \/\/ down-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('240')\n {\n \/\/ double staccato\n return null;\n }\n case ('241')\n {\n \/\/ triple staccato\n return null;\n }\n case ('242')\n {\n \/\/ quadruple staccato\n return null;\n }\n case ('243')\n {\n \/\/ snap\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'snap');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('480')\n {\n \/\/scoop\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'scoop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('481')\n {\n \/\/fall\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fall');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('490')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fingernail');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('494')\n {\n \/\/doit\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'doit');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('495')\n {\n \/\/plop\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'plop');\n libmei.AddChild(nobj, artic);\n }\n\n }\n\n }\n} \/\/$end\n","old_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = sibmei2.GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = sibmei2.GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer, normalizedBeamProp) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Returns the active beam, if any, and creates new beam elements\n at the start of a beam.\n *\/\n switch (normalizedBeamProp)\n {\n case (NoBeam)\n {\n if (bobj.GraceNote)\n {\n if (layer._property:ActiveGraceBeam != null)\n {\n layer._property:ActiveGraceBeam = null;\n }\n \/\/ If there is an active non-grace beam, we have a normal beam spanning\n \/\/ over a non-beamed grace note that will be added as a child of that beam.\n return GetNongraceParentBeam(bobj, layer);\n }\n else\n {\n if (layer._property:ActiveBeam != null)\n {\n layer._property:ActiveBeam = null;\n }\n return null;\n }\n }\n case (StartBeam)\n {\n newBeam = libmei.Beam();\n if (bobj.GraceNote)\n {\n layer._property:ActiveGraceBeam = newBeam;\n nonGraceParentBeam = GetNongraceParentBeam(bobj, layer);\n if (nonGraceParentBeam != null)\n {\n newBeam._property:ParentBeam = nonGraceParentBeam;\n }\n }\n else\n {\n layer._property:ActiveBeam = newBeam;\n }\n return newBeam;\n }\n default {\n \/\/ ContinueBeam and SingleBeam\n if (bobj.GraceNote)\n {\n return layer._property:ActiveGraceBeam;\n }\n else\n {\n return layer._property:ActiveBeam;\n }\n }\n }\n} \/\/$end\n\nfunction ProcessTuplet (noteRest, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (noteRest.ParentTupletIfAny = null)\n {\n return null;\n }\n\n \/*\n We encode inner tuplets of nested tuplet structures as s.\n Therefore we always return the outermost MEI tuplet for content to be added.\n Still, we need to keep track of the inner tuplets to assign the @endid.\n layer._property:ActiveMeiTuplet always points to the innermost tuplet.\n *\/\n\n activeMeiTuplet = layer._property:ActiveMeiTuplet;\n\n tupletIsContinued = activeMeiTuplet != null and TupletsEqual(noteRest.ParentTupletIfAny, activeMeiTuplet._property:SibTuplet);\n\n if (not(tupletIsContinued))\n {\n \/\/ New tuplets need to be added\n noteRestTupletStack = GetTupletStack(noteRest);\n sibTuplet = null;\n meiTupletDepth = GetMeiTupletDepth(layer);\n\n for i = meiTupletDepth to noteRestTupletStack.Length\n {\n sibTuplet = noteRestTupletStack[i];\n nextActiveMeiTuplet = GenerateTuplet(sibTuplet);\n if (meiTupletDepth > 0 or i > meiTupletDepth)\n {\n \/\/ We have an inner tuplet that we encode as \n nextActiveMeiTuplet = ShiftTupletToTupletSpan(nextActiveMeiTuplet, layer);\n }\n libmei.AddAttribute(nextActiveMeiTuplet, 'startid', '#' & meielement._id);\n \/\/ We basically create a linked list of tuplets\n nextActiveMeiTuplet._property:ParentTuplet = activeMeiTuplet;\n nextActiveMeiTuplet._property:SibTuplet = sibTuplet;\n activeMeiTuplet = nextActiveMeiTuplet;\n }\n layer._property:ActiveMeiTuplet = activeMeiTuplet;\n }\n\n meiTuplet = activeMeiTuplet;\n for i = 0 to CountTupletsEndingAtNoteRest(noteRest)\n {\n libmei.AddAttribute(meiTuplet, 'endid', '#' & meielement._id);\n meiTuplet = meiTuplet._property:ParentTuplet;\n }\n layer._property:ActiveMeiTuplet = meiTuplet;\n\n outermostMeiTuplet = activeMeiTuplet;\n while (outermostMeiTuplet._property:ParentTuplet)\n {\n outermostMeiTuplet = outermostMeiTuplet._property:ParentTuplet;\n }\n return outermostMeiTuplet;\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n\n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it\n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(tupletSpan._id);\n Self._property:MeasureObjects = mobjs;\n\n return tupletSpan;\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (j = 0)\n {\n libmei.AddAttribute(sylel, 'wordpos', 'i'); \/\/ 'initial'\n\n if (lyric_word.Length > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n\n syltext = libmei.GetText(sylel);\n\n if (utils.Pos('_', syltext) > -1)\n {\n \/\/ Syllable elision. split this syllable element by underscore.\n syllables = MSplitString(syltext, '_');\n sylarray = CreateSparseArray();\n\n \/\/ reset the text of the first syllable element to the first half of the syllable.\n libmei.SetText(sylel, syllables[0]);\n libmei.AddAttribute(sylel, 'con', 'b');\n\n for s = 1 to syllables.Length\n {\n esyl = libmei.Syl();\n libmei.SetText(esyl, syllables[s]);\n libmei.AddChild(verse, esyl);\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n if (name = 'chord')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'chord'));\n }\n\n libmei.AddChild(obj, verse);\n }\n else\n {\n Log('Could not find note object for syl ' & syl);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so\n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessTremolo (bobj) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.DoubleTremolos = 0)\n {\n return null;\n }\n\n Log('Fingered tremolo: ' & bobj.DoubleTremolos);\n tremEl = libmei.FTrem();\n libmei.AddAttribute(tremEl, 'slash', bobj.DoubleTremolos);\n libmei.AddAttribute(tremEl, 'measperf')\n\n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n case ('52')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('53')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('54')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('55')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('160')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'stop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('162')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'open');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('163')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('164')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('165')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('166')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('212')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'ten');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('214')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'marc');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('217')\n {\n \/\/ up-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('218')\n {\n \/\/ down-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('233')\n {\n \/\/ up-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('234')\n {\n \/\/ down-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('240')\n {\n \/\/ double staccato\n return null;\n }\n case ('241')\n {\n \/\/ triple staccato\n return null;\n }\n case ('242')\n {\n \/\/ quadruple staccato\n return null;\n }\n case ('243')\n {\n \/\/ snap\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'snap');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('480')\n {\n \/\/scoop\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'scoop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('481')\n {\n \/\/fall\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fall');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('490')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fingernail');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('494')\n {\n \/\/doit\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'doit');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('495')\n {\n \/\/plop\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'plop');\n libmei.AddChild(nobj, artic);\n }\n\n }\n\n }\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"0a78372f3991ea925631d6b6f305931b41464b0e","subject":"set vu.height","message":"set vu.height\n\n","repos":"music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n\n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n \/\/encodingDesc must preceed workList in MEI 4.0\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = GenerateApplicationInfo();\n libmei.AddChild(encodingD, appI);\n\n \/\/generate workList\n workList = libmei.WorkList();\n Self._property:WorkListElement = workList;\n\n wd_work = libmei.Work();\n wd_title = libmei.Title();\n libmei.AddChild(wd_work, wd_title);\n libmei.AddChild(workList, wd_work);\n libmei.AddChild(header, workList);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.Composer();\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_work, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.Lyricist();\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_work, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.Arranger();\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_work, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n return header;\n} \/\/$end\n\nfunction GenerateApplicationInfo () {\n \/\/$module(ExportGenerators.mss)\n\n appI = libmei.AppInfo();\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return appI;\n\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:SlurResolver = CreateSparseArray();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n \/\/annot is valid as a child of score\n libmei.AddChild(sco, ano);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workList = Self._property:WorkListElement;\n workEl = libmei.Work();\n libmei.AddChild(workList, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n l = null;\n\n mobjs = Self._property:MeasureObjects;\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0 or (l = null and bobj.Type = 'Clef'))\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n\n l._property:CurrentPos = 0;\n }\n }\n\n obj = null;\n mobj = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n \/\/ Clefs are placed inside the musical flow like notes. Hence we also need to find\n \/\/ out whether they are part of beams or tuplets.\n clef = GenerateClef(bobj);\n\n prevNoteRest = PrevNormalOrGrace(bobj, false);\n\n if (prevNoteRest != null)\n {\n prevBeamProp = NormalizedBeamProp(prevNoteRest);\n\n switch (prevBeamProp)\n {\n case ('StartBeam')\n {\n beam = l._property:ActiveBeam;\n }\n case ('NoBeam')\n {\n beam = null;\n }\n default\n {\n \/\/ ContinueBeam and SingleBeam\n nextNoteRest = NextNormalOrGrace(bobj, false);\n if (nextNoteRest != null)\n {\n nextBeamProp = NormalizedBeamProp(nextNoteRest);\n if ((nextBeamProp = ContinueBeam) or (nextBeamProp = SingleBeam))\n {\n beam = l._property:ActiveBeam;\n }\n }\n }\n }\n\n tuplet = l._property:ActiveMeiTuplet;\n while (tuplet != null and tuplet._property:ParentTuplet != null)\n {\n tuplet = tuplet._property:ParentTuplet;\n }\n }\n\n AppendToLayer(clef, l, beam, tuplet);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n\n AppendToLayer(note, l, beam, tuplet);\n }\n\n if (bobj.ArpeggioType != ArpeggioTypeNone) {\n arpeg = GenerateArpeggio(bobj);\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(arpeg._id);\n Self._property:MeasureObjects = mobjs;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n }\n }\n\n for each bobj in bar\n {\n obj = null;\n mobj = null;\n chordsym = null;\n\n switch (bobj.Type)\n {\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n bobj._property:mobj = mobj;\n PushToHashedLayer(Self._property:SlurResolver, bobj.EndBarNumber, bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('ArpeggioLine')\n {\n mobj = GenerateArpeggio(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n if (mobj != null)\n {\n \/\/Try to get note at position of bracket and put id\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(mobj, 'startid', '#' & obj._id);\n }\n }\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n Self._property:MeasureObjects = mobjs;\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n ProcessEndingSlurs(bar);\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n else\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n libmei.AddAttribute(nr, 'stem.mod', '1slash');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ppq', dur);\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMEI(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pden & '.0' \/ pnum & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n vel = nobj.OriginalVelocity;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'vel', vel);\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', gesdur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n if (nobj.Dx != 0)\n {\n libmei.AddAttribute(n, 'ho', ConvertOffsetsToMEI(nobj.Dx));\n }\n\n if (nobj.Color != nobj.ParentNoteRest.Color)\n {\n note_color = ConvertColor(nobj);\n libmei.AddAttribute(n, 'color', note_color);\n }\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', dur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n \/\/ MEI now supports a four-bar repeat\n obj = libmei.MultiRpt();\n libmei.AddAttribute(obj, 'num', '4');\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n vuval = docSettings.StaffSize \/ 8;\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n libmei.AddAttribute(scoredef, 'vu.height', vuval & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n if (score.StaffCount > 0)\n {\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n }\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n diaTrans = s.InitialInstrumentType.DiatonicTransposition;\n semiTrans = s.InitialInstrumentType.ChromaticTransposition;\n if (diaTrans != 0 and semiTrans != 0)\n {\n libmei.AddAttribute(std, 'trans.semi', semiTrans);\n libmei.AddAttribute(std, 'trans.diat', diaTrans);\n }\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.FullInstrumentName != null)\n {\n label = libmei.Label();\n libmei.SetText(label, s.FullInstrumentName);\n libmei.AddChild(std, label);\n }\n\n if (s.ShortInstrumentName != null)\n {\n labelAbbr = libmei.LabelAbbr();\n libmei.SetText(labelAbbr, s.ShortInstrumentName);\n libmei.AddChild(std, labelAbbr);\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n \/\/brackets\n case ('bracket')\n {\n line = libmei.Line();\n bracketType = 'bracket';\n\n \/\/horizontal brackets\n if (linecomps.Length >= 3)\n {\n \/\/brackets above\n if (linecomps[3] = 'above')\n {\n libmei.AddAttribute(line, 'place', 'above');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleup');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angleup');\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n \/\/brackets below\n if (linecomps[3] = 'below')\n {\n libmei.AddAttribute(line, 'place', 'below');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angledown');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angledown');\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n \/\/vertical bracktes\n if (linecomps[3] = 'vertical')\n {\n bracketType = bracketType & ' vertical';\n\n \/\/Add direction of bracket: line.staff.bracket.vertical.2 opens to the right, line.staff.bracket.vertical opens to the left\n if (linecomps > 4)\n {\n if (linecomps[4] = '2')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleright');\n libmei.AddAttribute(line, 'endsym', 'angleright');\n }\n }\n\n else\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'startsym', 'angleleft');\n libmei.AddAttribute(line, 'endsym', 'angleleft');\n }\n }\n }\n\n \/\/add types of bracktes\n libmei.AddAttribute(line, 'type', bracketType);\n }\n \/\/solid vertical line\n case ('vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n libmei.AddAttribute(line,'type','vertical');\n }\n \/\/dashed lines\n case ('dashed')\n {\n \/\/dashed vertical line\n if (linecomps.Length > 3)\n {\n if (linecomps[3] = 'vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n libmei.AddAttribute(line,'type','vertical');\n }\n }\n \/\/dashed horizontal line\n else\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n }\n }\n \/\/dotted horizontal line\n case('dotted')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dotted');\n }\n \/\/solid horizontal line\n case('plain')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n }\n case ('vibrato')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'vibrato');\n libmei.AddAttribute(line, 'form', 'wavy');\n libmei.AddAttribute(line, 'place', 'above');\n\n }\n\n \/\/To catch diverse line types, set a default\n default\n {\n line = libmei.Line();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateArpeggio (bobj) {\n \/\/$module(ExportGenerators.mss)\n arpeg = libmei.Arpeg();\n orientation = null;\n\n switch (bobj.Type)\n {\n case ('NoteRest')\n {\n switch (bobj.ArpeggioType)\n {\n case (ArpeggioTypeUp)\n {\n orientation = 1;\n }\n case (ArpeggioTypeDown)\n {\n orientation = -1;\n }\n }\n if (bobj.ArpeggioBottomDy > bobj.ArpeggioTopDy)\n {\n \/\/ Arpeggio was manipulated to be upside down\n orientation = -1 * orientation;\n }\n }\n case ('ArpeggioLine')\n {\n if (bobj.StyleId != 'line.staff.arpeggio') {\n \/\/ This means: Line style is line.staff.arpeggio.up or\n \/\/ line.staff.arpeggio.down.\n \/\/ Strangely, the line style does not really matter for the\n \/\/ visual orientation of the arpeggio. As long as RhDy and\n \/\/ and Dy properties are identical, arpeggios look the same,\n \/\/ independant of the two line styles with arrowheads.\n orientation = bobj.RhDy - bobj.Dy;\n }\n }\n }\n\n if (orientation = null)\n {\n libmei.AddAttribute(arpeg, 'arrow', 'false');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'arrow', 'true');\n\n if (orientation > 0)\n {\n libmei.AddAttribute(arpeg, 'order', 'up');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'order', 'down');\n }\n }\n\n arpeg = AddBarObjectInfoToElement(bobj, arpeg);\n\n return arpeg;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'glyph.auth', 'smufl');\n libmei.AddAttribute(symbol, 'glyph.num', glyphnum);\n libmei.AddAttribute(symbol, 'glyph.name', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end\n","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n\n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n \/\/encodingDesc must preceed workList in MEI 4.0\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = GenerateApplicationInfo();\n libmei.AddChild(encodingD, appI);\n\n \/\/generate workList\n workList = libmei.WorkList();\n Self._property:WorkListElement = workList;\n\n wd_work = libmei.Work();\n wd_title = libmei.Title();\n libmei.AddChild(wd_work, wd_title);\n libmei.AddChild(workList, wd_work);\n libmei.AddChild(header, workList);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.Composer();\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_work, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.Lyricist();\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_work, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.Arranger();\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_work, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n return header;\n} \/\/$end\n\nfunction GenerateApplicationInfo () {\n \/\/$module(ExportGenerators.mss)\n\n appI = libmei.AppInfo();\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return appI;\n\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:SlurResolver = CreateSparseArray();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n \/\/annot is valid as a child of score\n libmei.AddChild(sco, ano);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workList = Self._property:WorkListElement;\n workEl = libmei.Work();\n libmei.AddChild(workList, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n l = null;\n\n mobjs = Self._property:MeasureObjects;\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0 or (l = null and bobj.Type = 'Clef'))\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n\n l._property:CurrentPos = 0;\n }\n }\n\n obj = null;\n mobj = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n \/\/ Clefs are placed inside the musical flow like notes. Hence we also need to find\n \/\/ out whether they are part of beams or tuplets.\n clef = GenerateClef(bobj);\n\n prevNoteRest = PrevNormalOrGrace(bobj, false);\n\n if (prevNoteRest != null)\n {\n prevBeamProp = NormalizedBeamProp(prevNoteRest);\n\n switch (prevBeamProp)\n {\n case ('StartBeam')\n {\n beam = l._property:ActiveBeam;\n }\n case ('NoBeam')\n {\n beam = null;\n }\n default\n {\n \/\/ ContinueBeam and SingleBeam\n nextNoteRest = NextNormalOrGrace(bobj, false);\n if (nextNoteRest != null)\n {\n nextBeamProp = NormalizedBeamProp(nextNoteRest);\n if ((nextBeamProp = ContinueBeam) or (nextBeamProp = SingleBeam))\n {\n beam = l._property:ActiveBeam;\n }\n }\n }\n }\n\n tuplet = l._property:ActiveMeiTuplet;\n while (tuplet != null and tuplet._property:ParentTuplet != null)\n {\n tuplet = tuplet._property:ParentTuplet;\n }\n }\n\n AppendToLayer(clef, l, beam, tuplet);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n\n AppendToLayer(note, l, beam, tuplet);\n }\n\n if (bobj.ArpeggioType != ArpeggioTypeNone) {\n arpeg = GenerateArpeggio(bobj);\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(arpeg._id);\n Self._property:MeasureObjects = mobjs;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n }\n }\n\n for each bobj in bar\n {\n obj = null;\n mobj = null;\n chordsym = null;\n\n switch (bobj.Type)\n {\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n bobj._property:mobj = mobj;\n PushToHashedLayer(Self._property:SlurResolver, bobj.EndBarNumber, bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('ArpeggioLine')\n {\n mobj = GenerateArpeggio(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n if (mobj != null)\n {\n \/\/Try to get note at position of bracket and put id\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(mobj, 'startid', '#' & obj._id);\n }\n }\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n Self._property:MeasureObjects = mobjs;\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n ProcessEndingSlurs(bar);\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n else\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n libmei.AddAttribute(nr, 'stem.mod', '1slash');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ppq', dur);\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMEI(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pden & '.0' \/ pnum & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n vel = nobj.OriginalVelocity;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'vel', vel);\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', gesdur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n if (nobj.Dx != 0)\n {\n libmei.AddAttribute(n, 'ho', ConvertOffsetsToMEI(nobj.Dx));\n }\n\n if (nobj.Color != nobj.ParentNoteRest.Color)\n {\n note_color = ConvertColor(nobj);\n libmei.AddAttribute(n, 'color', note_color);\n }\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', dur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n \/\/ MEI now supports a four-bar repeat\n obj = libmei.MultiRpt();\n libmei.AddAttribute(obj, 'num', '4');\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n if (score.StaffCount > 0)\n {\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n }\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n diaTrans = s.InitialInstrumentType.DiatonicTransposition;\n semiTrans = s.InitialInstrumentType.ChromaticTransposition;\n if (diaTrans != 0 and semiTrans != 0)\n {\n libmei.AddAttribute(std, 'trans.semi', semiTrans);\n libmei.AddAttribute(std, 'trans.diat', diaTrans);\n }\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.FullInstrumentName != null)\n {\n label = libmei.Label();\n libmei.SetText(label, s.FullInstrumentName);\n libmei.AddChild(std, label);\n }\n\n if (s.ShortInstrumentName != null)\n {\n labelAbbr = libmei.LabelAbbr();\n libmei.SetText(labelAbbr, s.ShortInstrumentName);\n libmei.AddChild(std, labelAbbr);\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n \/\/brackets\n case ('bracket')\n {\n line = libmei.Line();\n bracketType = 'bracket';\n\n \/\/horizontal brackets\n if (linecomps.Length >= 3)\n {\n \/\/brackets above\n if (linecomps[3] = 'above')\n {\n libmei.AddAttribute(line, 'place', 'above');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleup');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angleup');\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n \/\/brackets below\n if (linecomps[3] = 'below')\n {\n libmei.AddAttribute(line, 'place', 'below');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angledown');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angledown');\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n \/\/vertical bracktes\n if (linecomps[3] = 'vertical')\n {\n bracketType = bracketType & ' vertical';\n\n \/\/Add direction of bracket: line.staff.bracket.vertical.2 opens to the right, line.staff.bracket.vertical opens to the left\n if (linecomps > 4)\n {\n if (linecomps[4] = '2')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleright');\n libmei.AddAttribute(line, 'endsym', 'angleright');\n }\n }\n\n else\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'startsym', 'angleleft');\n libmei.AddAttribute(line, 'endsym', 'angleleft');\n }\n }\n }\n\n \/\/add types of bracktes\n libmei.AddAttribute(line, 'type', bracketType);\n }\n \/\/solid vertical line\n case ('vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n libmei.AddAttribute(line,'type','vertical');\n }\n \/\/dashed lines\n case ('dashed')\n {\n \/\/dashed vertical line\n if (linecomps.Length > 3)\n {\n if (linecomps[3] = 'vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n libmei.AddAttribute(line,'type','vertical');\n }\n }\n \/\/dashed horizontal line\n else\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n }\n }\n \/\/dotted horizontal line\n case('dotted')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dotted');\n }\n \/\/solid horizontal line\n case('plain')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n }\n case ('vibrato')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'vibrato');\n libmei.AddAttribute(line, 'form', 'wavy');\n libmei.AddAttribute(line, 'place', 'above');\n\n }\n\n \/\/To catch diverse line types, set a default\n default\n {\n line = libmei.Line();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateArpeggio (bobj) {\n \/\/$module(ExportGenerators.mss)\n arpeg = libmei.Arpeg();\n orientation = null;\n\n switch (bobj.Type)\n {\n case ('NoteRest')\n {\n switch (bobj.ArpeggioType)\n {\n case (ArpeggioTypeUp)\n {\n orientation = 1;\n }\n case (ArpeggioTypeDown)\n {\n orientation = -1;\n }\n }\n if (bobj.ArpeggioBottomDy > bobj.ArpeggioTopDy)\n {\n \/\/ Arpeggio was manipulated to be upside down\n orientation = -1 * orientation;\n }\n }\n case ('ArpeggioLine')\n {\n if (bobj.StyleId != 'line.staff.arpeggio') {\n \/\/ This means: Line style is line.staff.arpeggio.up or\n \/\/ line.staff.arpeggio.down.\n \/\/ Strangely, the line style does not really matter for the\n \/\/ visual orientation of the arpeggio. As long as RhDy and\n \/\/ and Dy properties are identical, arpeggios look the same,\n \/\/ independant of the two line styles with arrowheads.\n orientation = bobj.RhDy - bobj.Dy;\n }\n }\n }\n\n if (orientation = null)\n {\n libmei.AddAttribute(arpeg, 'arrow', 'false');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'arrow', 'true');\n\n if (orientation > 0)\n {\n libmei.AddAttribute(arpeg, 'order', 'up');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'order', 'down');\n }\n }\n\n arpeg = AddBarObjectInfoToElement(bobj, arpeg);\n\n return arpeg;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'glyph.auth', 'smufl');\n libmei.AddAttribute(symbol, 'glyph.num', glyphnum);\n libmei.AddAttribute(symbol, 'glyph.name', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"6b43c801fd050ed9ed635b6c4945a159b7b50f24","subject":"fix grace notes","message":"fix grace notes\n\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n\n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n workDesc = libmei.WorkDesc();\n Self._property:WorkDescElement = workDesc;\n\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n libmei.AddChild(header, workDesc);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n libmei.AddChild(mdiv, ano);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workDesc = Self._property:WorkDescElement;\n workEl = libmei.Work();\n libmei.AddChild(workDesc, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/*\n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n parent = beam._property:ParentBeam;\n if (parent = null)\n {\n parent = l;\n }\n if (beam._parent != parent._id)\n {\n libmei.AddChild(parent, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n\n if (bobj.ArpeggioType != ArpeggioTypeNone) {\n arpeg = GenerateArpeggio(bobj);\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(arpeg._id);\n Self._property:MeasureObjects = mobjs;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('ArpeggioLine')\n {\n mobj = GenerateArpeggio(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n libmei.AddAttribute(nr, 'stem.mod', '1slash');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.ges', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pden & '.0' \/ pnum & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', gesdur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.ges', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateArpeggio (bobj) {\n \/\/$module(ExportGenerators.mss)\n arpeg = libmei.Arpeg();\n orientation = null;\n\n switch (bobj.Type)\n {\n case ('NoteRest')\n {\n switch (bobj.ArpeggioType)\n {\n case (ArpeggioTypeUp)\n {\n orientation = 1;\n }\n case (ArpeggioTypeDown)\n {\n orientation = -1;\n }\n }\n if (bobj.ArpeggioBottomDy > bobj.ArpeggioTopDy)\n {\n \/\/ Arpeggio was manipulated to be upside down\n orientation = -1 * orientation;\n }\n }\n case ('ArpeggioLine')\n {\n if (bobj.StyleId != 'line.staff.arpeggio') {\n \/\/ This means: Line style is line.staff.arpeggio.up or\n \/\/ line.staff.arpeggio.down.\n \/\/ Strangely, the line style does not really matter for the\n \/\/ visual orientation of the arpeggio. As long as RhDy and\n \/\/ and Dy properties are identical, arpeggios look the same,\n \/\/ independant of the two line styles with arrowheads.\n orientation = bobj.RhDy - bobj.Dy;\n }\n }\n }\n\n if (orientation = null)\n {\n libmei.AddAttribute(arpeg, 'arrow', 'false');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'arrow', 'true');\n\n if (orientation > 0)\n {\n libmei.AddAttribute(arpeg, 'order', 'up');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'order', 'down');\n }\n }\n\n arpeg = AddBarObjectInfoToElement(bobj, arpeg);\n\n return arpeg;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'authority', 'SMuFL');\n libmei.AddAttribute(symbol, 'glyphnum', glyphnum);\n libmei.AddAttribute(symbol, 'glyphname', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end\n","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n\n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n workDesc = libmei.WorkDesc();\n Self._property:WorkDescElement = workDesc;\n\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n libmei.AddChild(header, workDesc);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n libmei.AddChild(mdiv, ano);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workDesc = Self._property:WorkDescElement;\n workEl = libmei.Work();\n libmei.AddChild(workDesc, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/*\n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n parent = beam._property:ParentBeam;\n if (parent = null)\n {\n parent = l;\n }\n if (beam._parent != parent._id)\n {\n libmei.AddChild(parent, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n\n if (bobj.ArpeggioType != ArpeggioTypeNone) {\n arpeg = GenerateArpeggio(bobj);\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(arpeg._id);\n Self._property:MeasureObjects = mobjs;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('ArpeggioLine')\n {\n mobj = GenerateArpeggio(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.ges', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pden & '.0' \/ pnum & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', gesdur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.ges', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateArpeggio (bobj) {\n \/\/$module(ExportGenerators.mss)\n arpeg = libmei.Arpeg();\n orientation = null;\n\n switch (bobj.Type)\n {\n case ('NoteRest')\n {\n switch (bobj.ArpeggioType)\n {\n case (ArpeggioTypeUp)\n {\n orientation = 1;\n }\n case (ArpeggioTypeDown)\n {\n orientation = -1;\n }\n }\n if (bobj.ArpeggioBottomDy > bobj.ArpeggioTopDy)\n {\n \/\/ Arpeggio was manipulated to be upside down\n orientation = -1 * orientation;\n }\n }\n case ('ArpeggioLine')\n {\n if (bobj.StyleId != 'line.staff.arpeggio') {\n \/\/ This means: Line style is line.staff.arpeggio.up or\n \/\/ line.staff.arpeggio.down.\n \/\/ Strangely, the line style does not really matter for the\n \/\/ visual orientation of the arpeggio. As long as RhDy and\n \/\/ and Dy properties are identical, arpeggios look the same,\n \/\/ independant of the two line styles with arrowheads.\n orientation = bobj.RhDy - bobj.Dy;\n }\n }\n }\n\n if (orientation = null)\n {\n libmei.AddAttribute(arpeg, 'arrow', 'false');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'arrow', 'true');\n\n if (orientation > 0)\n {\n libmei.AddAttribute(arpeg, 'order', 'up');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'order', 'down');\n }\n }\n\n arpeg = AddBarObjectInfoToElement(bobj, arpeg);\n\n return arpeg;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'authority', 'SMuFL');\n libmei.AddAttribute(symbol, 'glyphnum', glyphnum);\n libmei.AddAttribute(symbol, 'glyphname', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"a3e6501fe744521267ce5da55783957c460aaba8","subject":"Fixed: Improper tie resolution","message":"Fixed: Improper tie resolution\n\nThis commit fixes a problem where ties would not be encoded correctly. It was fixed by adding an extra parameter to the tie resolution dictionary to further differentiate ties on different staves.\n\nIt also uses the concatenation operator instead of the addition operator. *facepalm*.\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber + '-' + nobj.ParentNoteRest.VoiceNumber + '-' + pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) + '-' + nobj.ParentNoteRest.VoiceNumber + '-' + pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) + '-' + nobj.ParentNoteRest.VoiceNumber + '-' + pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"9c903976fecca6ccba694838468320795843b5ff","subject":"Prevent lakes from being outlined at z5","message":"Prevent lakes from being outlined at z5\n","repos":"stamen\/toner-carto,Andrey-Pavlov\/toner-carto","old_file":"map.mss","new_file":"map.mss","new_contents":"@color_physical: #000;\n@color_physical_bright: #fff;\n@color_water: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #000;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc;\n@color_transport_minor: #ccc;\n@color_transport_rail: #444;\n@color_transport_path: #ededed;\n@color_building_outline: #000;\n@color_building_outline_special: #00aeef;\n@color_airport_runways: #eee;\n@color_airport_runways_detail: #f2f2f2;\n\nMap {\n background-color: @color_physical;\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#country-shapes-110m {\n line-width: 0.25;\n polygon-fill: @color_administrative_bright;\n}\n\n#land-shapes-110m,\n#country-shapes-50m,\n#country-shapes-10m,\n{\n line-width: 0.25;\n polygon-fill: @color_physical_bright;\n}\n\n.country-boundary-10m {\n ::whiteout {\n [zoom>=7] {\n line-color: @color_administrative_bright;\n line-width: 2;\n }\n }\n\n [zoom>=6] {\n line-color: @color_administrative_dark;\n line-width: 1.2;\n }\n\n [zoom>=7] {\n line-width: 1.2;\n line-dasharray: 3,7;\n line-cap: round;\n }\n}\n\n#admin1-lines-50m {\n line-width: 0.35;\n line-color: @color_administrative_dark;\n}\n\n#admin1-lines-10m {\n [zoom>=6] {\n line-width: 0.6;\n line-color: @color_administrative_dark;\n }\n\n [zoom>=7] {\n line-width: 1.5;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8] {\n line-width: 2.0;\n line-color: @color_administrative_medium_high;\n }\n\n [zoom>=9] {\n line-color: @color_administrative_medium_high2;\n }\n}\n\n#lakes-110m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 0;\n\n [zoom=7][scalerank<=7] {\n line-width: 2.25;\n }\n\n [zoom=8][scalerank<=8] {\n line-width: 3.25;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=6][scalerank>=3][scalerank<=6] {\n line-width: 0.1;\n }\n\n [zoom=7] {\n [scalerank<=6],\n [scalerank<=7][expressway=1],\n [scalerank<=7][type='Major Highway'],\n [scalerank<=7][type='Secondary Highway'],\n {\n line-width: 0.1;\n }\n\n [scalerank>=3][scalerank<=5] {\n line-width: 1.5;\n }\n }\n\n [zoom=8] {\n [scalerank<=8] {\n line-width: 0.1;\n }\n\n [type='Beltway'],\n [scalerank<=8][expressway=1],\n {\n line-width: 1.5;\n }\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n#land {\n \/\/ TODO polygon seams\n polygon-fill: @color_physical_bright;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n#buildings-med {\n [area>=40000] {\n polygon-pattern-file: url(\"images\/stripe_sm.png\");\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n}\n\n#buildings-high {\n [zoom>=14] {\n [area>=20000] {\n polygon-pattern-file: url(\"images\/stripe_med.png\");\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n [zoom>=16] {\n line-width: 0.5;\n }\n\n [zoom=15][area>=16000],\n [zoom=16][area>=8000],\n [zoom=17][area>=4000],\n [zoom>=18],\n {\n polygon-pattern-file: url(\"images\/stripe.png\");\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=45074542],\n [osm_id=224030635], \/\/ Seth's house\n {\n polygon-pattern-file: url(\"images\/stripe_color.png\");\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-pattern-alignment: global;\n polygon-pattern-file: url(\"images\/halftone2.png\");\n \n [type='nature_reserve'] {\n polygon-pattern-file: url(\"images\/halftone2-transparent.png\");\n }\n}\n\n#brown-areas-low[zoom=10][area>5000000],\n#brown-areas-med[zoom=11][area>1000000],\n#brown-areas-med[zoom=12][area> 500000],\n#brown-areas-med[zoom=12][area> 200000],\n#brown-areas-med[zoom=13][area> 75000],\n#brown-areas-high[zoom=14][area> 10000],\n#brown-areas-high[zoom>14],\n{\n polygon-pattern-alignment: global;\n polygon-pattern-file: url(\"images\/halftone2.png\");\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [zoom>=15] {\n line-color: @color_airport_runways_detail;\n }\n\n [aeroway='runway'] {\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [aeroway='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n.roads {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_tunnel='yes']\n {\n [zoom>=14]\n {\n ::casing {\n line-opacity: 0.5;\n }\n\n ::outline {\n line-opacity: 0.5;\n }\n }\n\n [zoom>=15]\n {\n line-opacity: 0; \/\/ vs. line-width: 0 to override subsequent styling\n }\n }\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n.roads[kind='highway']\n{\n [zoom>=9] {\n ::outline {\n line-width: 4.25;\n }\n\n line-width: 1.5;\n }\n\n [zoom>=10] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n line-width: 2.5;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n\n [is_bridge='yes'] {\n ::outline {\n line-width: 3;\n }\n }\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 8;\n }\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 2.5;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 6;\n }\n }\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::casing {\n line-color: @color_transport_casing;\n }\n }\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n }\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 42;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 44;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n line-color: @color_transport;\n }\n\n line-width: 10;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 15;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 49;\n line-color: @color_transport;\n }\n\n line-width: 35;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 51;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 21;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n }\n }\n }\n }\n}\n\n.roads[kind='major_road']\n{\n [zoom<=12] {\n line-color: #000;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n line-width: 1.5;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 1.9;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 6;\n }\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 1.9;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 6;\n }\n }\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.25;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::casing {\n line-color: @color_transport_casing;\n }\n }\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n }\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 24;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n line-color: @color_transport;\n }\n\n line-width: 9;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 14;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 32;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 17;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 18;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n }\n }\n }\n }\n}\n\n.roads[kind='minor_road']\n{\n [zoom<=14] {\n line-color: #999;\n }\n\n [zoom>=16] {\n line-color: @color_transport_minor;\n }\n\n [zoom>=10] {\n line-width: 0.2;\n }\n\n [zoom>=13] {\n line-width: 0.4;\n }\n\n [zoom>=14] {\n line-width: 0.8;\n }\n\n [zoom>=15] {\n line-width: 1.5;\n\n [is_tunnel='yes'] {\n ::casing {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n.roads[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 9;\n line-dasharray: 4,7;\n }\n\n line-width: 4;\n }\n}\n\n.roads[highway='service']\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 6;\n }\n\n line-width: 4;\n }\n}\n\n.roads[kind='path']\n{\n ::casing {\n line-color: @color_transport_path;\n }\n\n line-color: @color_transport_casing;\n\n [zoom>=15] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 1.5;\n line-cap: butt;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 3;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n","old_contents":"@color_physical: #000;\n@color_physical_bright: #fff;\n@color_water: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #000;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc;\n@color_transport_minor: #ccc;\n@color_transport_rail: #444;\n@color_transport_path: #ededed;\n@color_building_outline: #000;\n@color_building_outline_special: #00aeef;\n@color_airport_runways: #eee;\n@color_airport_runways_detail: #f2f2f2;\n\nMap {\n background-color: @color_physical;\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n line-cap: round;\n line-join: round;\n}\n\n#country-shapes-110m {\n line-width: 0.25;\n polygon-fill: @color_administrative_bright;\n}\n\n#land-shapes-110m,\n#country-shapes-50m,\n#country-shapes-10m,\n{\n line-width: 0.25;\n polygon-fill: @color_physical_bright;\n}\n\n.country-boundary-10m {\n ::whiteout {\n [zoom>=7] {\n line-color: @color_administrative_bright;\n line-width: 2;\n }\n }\n\n [zoom>=6] {\n line-color: @color_administrative_dark;\n line-width: 1.2;\n }\n\n [zoom>=7] {\n line-width: 1.2;\n line-dasharray: 3,7;\n line-cap: round;\n }\n}\n\n#admin1-lines-50m {\n line-width: 0.35;\n line-color: @color_administrative_dark;\n}\n\n#admin1-lines-10m {\n [zoom>=6] {\n line-width: 0.6;\n line-color: @color_administrative_dark;\n }\n\n [zoom>=7] {\n line-width: 1.5;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8] {\n line-width: 2.0;\n line-color: @color_administrative_medium_high;\n }\n\n [zoom>=9] {\n line-color: @color_administrative_medium_high2;\n }\n}\n\n#lakes-110m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 0;\n\n [zoom=7][scalerank<=7] {\n line-width: 2.25;\n }\n\n [zoom=8][scalerank<=8] {\n line-width: 3.25;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=6][scalerank>=3][scalerank<=6] {\n line-width: 0.1;\n }\n\n [zoom=7] {\n [scalerank<=6],\n [scalerank<=7][expressway=1],\n [scalerank<=7][type='Major Highway'],\n [scalerank<=7][type='Secondary Highway'],\n {\n line-width: 0.1;\n }\n\n [scalerank>=3][scalerank<=5] {\n line-width: 1.5;\n }\n }\n\n [zoom=8] {\n [scalerank<=8] {\n line-width: 0.1;\n }\n\n [type='Beltway'],\n [scalerank<=8][expressway=1],\n {\n line-width: 1.5;\n }\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n#land {\n \/\/ TODO polygon seams\n polygon-fill: @color_physical_bright;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n#buildings-med {\n [area>=40000] {\n polygon-pattern-file: url(\"images\/stripe_sm.png\");\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n}\n\n#buildings-high {\n [zoom>=14] {\n [area>=20000] {\n polygon-pattern-file: url(\"images\/stripe_med.png\");\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n [zoom>=16] {\n line-width: 0.5;\n }\n\n [zoom=15][area>=16000],\n [zoom=16][area>=8000],\n [zoom=17][area>=4000],\n [zoom>=18],\n {\n polygon-pattern-file: url(\"images\/stripe.png\");\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=45074542],\n [osm_id=224030635], \/\/ Seth's house\n {\n polygon-pattern-file: url(\"images\/stripe_color.png\");\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-pattern-alignment: global;\n polygon-pattern-file: url(\"images\/halftone2.png\");\n \n [type='nature_reserve'] {\n polygon-pattern-file: url(\"images\/halftone2-transparent.png\");\n }\n}\n\n#brown-areas-low[zoom=10][area>5000000],\n#brown-areas-med[zoom=11][area>1000000],\n#brown-areas-med[zoom=12][area> 500000],\n#brown-areas-med[zoom=12][area> 200000],\n#brown-areas-med[zoom=13][area> 75000],\n#brown-areas-high[zoom=14][area> 10000],\n#brown-areas-high[zoom>14],\n{\n polygon-pattern-alignment: global;\n polygon-pattern-file: url(\"images\/halftone2.png\");\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [zoom>=15] {\n line-color: @color_airport_runways_detail;\n }\n\n [aeroway='runway'] {\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [aeroway='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n.roads {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_tunnel='yes']\n {\n [zoom>=14]\n {\n ::casing {\n line-opacity: 0.5;\n }\n\n ::outline {\n line-opacity: 0.5;\n }\n }\n\n [zoom>=15]\n {\n line-opacity: 0; \/\/ vs. line-width: 0 to override subsequent styling\n }\n }\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n.roads[kind='highway']\n{\n [zoom>=9] {\n ::outline {\n line-width: 4.25;\n }\n\n line-width: 1.5;\n }\n\n [zoom>=10] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n line-width: 2.5;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n\n [is_bridge='yes'] {\n ::outline {\n line-width: 3;\n }\n }\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 8;\n }\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 2.5;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 6;\n }\n }\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::casing {\n line-color: @color_transport_casing;\n }\n }\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n }\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 42;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 44;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n line-color: @color_transport;\n }\n\n line-width: 10;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 15;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 49;\n line-color: @color_transport;\n }\n\n line-width: 35;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 51;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 21;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n }\n }\n }\n }\n}\n\n.roads[kind='major_road']\n{\n [zoom<=12] {\n line-color: #000;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n line-width: 1.5;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 1.9;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 6;\n }\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 1.9;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 6;\n }\n }\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.25;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::casing {\n line-color: @color_transport_casing;\n }\n }\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n }\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 24;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n line-color: @color_transport;\n }\n\n line-width: 9;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 14;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 32;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 17;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 18;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n }\n }\n }\n }\n}\n\n.roads[kind='minor_road']\n{\n [zoom<=14] {\n line-color: #999;\n }\n\n [zoom>=16] {\n line-color: @color_transport_minor;\n }\n\n [zoom>=10] {\n line-width: 0.2;\n }\n\n [zoom>=13] {\n line-width: 0.4;\n }\n\n [zoom>=14] {\n line-width: 0.8;\n }\n\n [zoom>=15] {\n line-width: 1.5;\n\n [is_tunnel='yes'] {\n ::casing {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n.roads[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 9;\n line-dasharray: 4,7;\n }\n\n line-width: 4;\n }\n}\n\n.roads[highway='service']\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 6;\n }\n\n line-width: 4;\n }\n}\n\n.roads[kind='path']\n{\n ::casing {\n line-color: @color_transport_path;\n }\n\n line-color: @color_transport_casing;\n\n [zoom>=15] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 1.5;\n line-cap: butt;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 3;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"812b039e2567f44fecacac5e2d7bc47373fb9db1","subject":"tweak halo color for #44","message":"tweak halo color for #44\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_shield: 'PT Sans Bold', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Bold', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_italic: 'PT Sans Italic', 'Unifont Medium';\n@text_font_bold_italic: 'PT Sans Bold Italic', 'Unifont Medium';\n\n@label_color_transport: #524c4c;\n@label_color_shield: #fff;\n@label_color_shield_fed: #333; \/\/ 80 K\n@label_color_administrative: #2e2115; \/\/\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n@text_font_size_xlg: 24;\n@text_font_size_xxlg: 34;\n\n@text_character_spacing_sm: 0.7;\n@text_character_spacing_md: 1.2;\n@text_character_spacing_lg: 1.7;\n@text_character_spacing_xlg: 2.2;\n\n@text_font_halo_radius_xsm: 1;\n@text_font_halo_radius_sm: 1.5;\n@text_font_halo_radius_md: 1.75;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: fadeout(@color_physical,30%);\n@label_color_transport_halo: desaturate(#F7F7E6,50%);\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #dee0be; \/\/ same as @color_physical, the land background\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#mountain_peaks_ne {\n [zoom>=6][comment =~'.*Highest.*'],\n [zoom>=6][comment =~'.*highest.*'],\n [zoom>=6][name =~'.*Vinson.*'],\n [zoom>=7][elevation>=2000],\n [zoom>=8][elevation>=1500],\n [zoom>=9][elevation>=1000],\n [zoom>=10][elevation>=500],\n [zoom>=11][elevation>0] {\n shield-name: [name] + '\\n' + [elevation] + 'm';\n shield-face-name: @text_font_italic;\n shield-size: @text_font_size_xxsm;\n shield-file: url('icons\/triangle-18.svg');\n shield-transform: scale(0.5,0.5);\n shield-unlock-image: true;\n shield-avoid-edges: true;\n shield-fill: @label_color_physical;\n shield-halo-fill: @label_color_physical_halo;\n shield-halo-radius: 1;\n \/\/shield-halo-opacity: 0.7; \/\/ Was causing mapnik errors\n shield-min-distance: 2;\n shield-placement-type: simple;\n shield-placements: 'NW,SE,N,S,E,W,NE,SW';\n shield-text-dy: 5;\n shield-text-dx: 5;\n shield-min-distance: 1000;\n shield-wrap-width: 30;\n shield-line-spacing: -2;\n\n [comment =~'.*Highest.*'],\n [comment =~'.*highest.*'],\n [name =~'.*Vinson.*'] {\n shield-face-name: @text_font_bold_italic; \/\/ special call out to the tallest peaks on each continent!\n shield-transform: scale(0.65,0.65);\n }\n\n [zoom>=8] {\n shield-size: @text_font_size_xsm;\n }\n\n [zoom>=10] {\n shield-size: @text_font_size_sm;\n shield-transform: scale(0.8,0.8);\n shield-text-dy: 7;\n shield-text-dx: 7;\n }\n\n \/\/ replace McKinley with Denali (not the dryest solution but TileMill is being weird...)\n [zoom>=6][zoom<=18][name=~'.*McKinley'] {\n shield-name: \"Denali\" + ' ' + [elevation] + 'm';\n shield-face-name: @text_font_bold_italic;\n shield-size: @text_font_size_xxsm;\n shield-file: url('icons\/triangle-18.svg');\n shield-transform: scale(0.5,0.5);\n shield-unlock-image: true;\n shield-avoid-edges: true;\n shield-fill: @label_color_physical;\n shield-halo-fill: @label_color_physical_halo;\n shield-halo-radius: 1;\n \/\/shield-halo-opacity: 0.7;\n shield-min-distance: 2;\n shield-placement-type: simple;\n shield-placements: 'NW,SE,N,S,E,W,NE,SW';\n shield-text-dy: 5;\n shield-text-dx: 5;\n shield-min-distance: 1000;\n shield-wrap-width: 30;\n shield-line-spacing: -2;\n\n [zoom>=8] {\n shield-size: @text_font_size_xsm; \n }\n\n [zoom>=10] {\n shield-size: @text_font_size_sm;\n shield-transform: scale(0.8,0.8);\n shield-text-dy: 7;\n shield-text-dx: 7;\n }\n }\n }\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-placement: line;\n text-label-position-tolerance: 2;\n text-max-char-angle-delta: 20;\n text-min-path-length: 30;\n text-fill: #444;\n text-spacing: 256;\n text-min-distance: 5;\n text-character-spacing: @text_character_spacing_sm;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: @text_font_halo_radius_md;\n\n [kind='major_road'] {\n text-size: @text_font_size_xxsm; \n } \n\n [zoom>=13] {\n text-size: @text_font_size_xxsm;\n \n [kind='major_road'] {\n text-size: @text_font_size_xxsm * 1.2; \n }\n }\n\n [zoom>=14] {\n text-min-distance: 10;\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_md;\n text-halo-radius: @text_font_halo_radius_large;\n \n [kind='major_road'] {\n text-size: @text_font_size_sm * 1.2; \n } \n }\n\n [zoom>=16]{\n text-min-distance: 100;\n text-character-spacing: @text_character_spacing_lg;\n }\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n [ref_length>0][ref_length<8] {\n \/\/ default rectangle shield\n shield-fill: @label_color_shield_fed;\n shield-transform: scale(1.1,1.1);\n shield-face-name: @text_font_shield;\n shield-name: [ref];\n shield-size: 10;\n shield-min-distance: 60;\n shield-spacing: 60;\n \/\/ half the width of the shield to prevent from wrapping\n shield-min-padding: 10;\n shield-file: url(shields\/default-rg.svg); \n\n [priority=4] {\n [ref_length>6][ref_length<8] {\n shield-file: url(shields\/default-lg.svg);\n }\n [ref_length<=4][ref_length>=3] {\n shield-file: url(shields\/default-sm.svg);\n }\n [ref_length<3][ref_length>0] {\n shield-file: url(shields\/default-xsm.svg); \n }\n }\n\n \/\/ hide state shields at lower zooms\n [zoom>=11][zoom<=12][highway='trunk'],\n [zoom>=11][zoom<=12][highway='primary'],\n [zoom>=11][zoom<=12][highway='secondary'],\n [zoom>=11][zoom<=12][highway='tertiary'] {\n shield-opacity: 0;\n shield-size: 0;\n }\n\n [ref=~'I \\d+'] {\n shield-file: url(shields\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 65;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 15;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(shields\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 65;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 13;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'US \\d+'] {\n shield-file: url(shields\/us.svg);\n shield-transform: scale(0.062, 0.062);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: @label_color_shield_fed;\n shield-text-dy: 1;\n shield-character-spacing: -1;\n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.075, 0.075);\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.088, 0.088);\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.091, 0.091);\n } \n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(shields\/ca.svg);\n shield-fill: @label_color_shield;\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-dy: -2.5;\n shield-character-spacing: -1;\n\n [zoom>=11][zoom<=12][highway='trunk'],\n [zoom>=11][zoom<=12][highway='primary'],\n [zoom>=11][zoom<=12][highway='secondary'],\n [zoom>=11][zoom<=12][highway='tertiary'] {\n shield-opacity: 0;\n shield-size: 0;\n } \n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.060, 0.060);\n shield-min-distance: 70;\n }\n\n [zoom>=14] {\n shield-min-distance: 80;\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.080, 0.080);\n shield-dy: -3.5;\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.090, 0.090); \n } \n }\n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n \n text-face-name: @text_font_bold_italic;\n text-wrap-width: 40;\n text-wrap-character: ' ';\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_xlg;\n text-align: center;\n\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_xsm;\n text-halo-fill: @label_color_water_halo;\n text-placement: interior;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][scalerank<4][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][scalerank<7][changed!='']\n{\n text-name: [name];\n\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n text-face-name: @text_font_bold_italic;\n text-wrap-width: 50;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_lg;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_xsm;\n text-halo-fill: @label_color_water_halo;\n text-placement: interior;\n text-align: center;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>1000000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_italic;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels { \n \/\/ [zoom>=4][scalerank<3],\n [zoom>=5][scalerank<=3][admin!='United States of America'][admin!='Canada'],\n [zoom>=6][scalerank<=5],\n [zoom>=7][scalerank>=6] {\n text-name: [name];\n text-transform: uppercase;\n text-face-name: @text_font_administrative; \n text-fill: #333; \/\/@label_color_administrative;\n text-halo-fill: @label_color_halo_low;\n text-halo-radius: @text_font_halo_radius_sm;\n text-size: @text_font_size_sm;\n text-wrap-width: 40;\n text-placement-type: simple;\n text-placements: 'E,N,W,S';\n text-allow-overlap: false;\n text-min-distance: 30;\n text-avoid-edges: true;\n text-min-padding: 5;\n \n [zoom>=5] {\n text-size: @text_font_size_xsm; \n text-character-spacing: 0;\n text-min-distance: 30;\n }\n\n [zoom>=6] {\n text-size: @text_font_size_xsm;\n text-character-spacing: 1;\n }\n\n [zoom>=7] {\n text-size: @text_font_size_sm;\n text-character-spacing: 2;\n } \n }\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n text-character-spacing: 1;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80; \n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n \/\/ text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n}\n\n\/\/ #admin1-labels-50m-z6 {\n\/\/ text-face-name: @text_font_administrative;\n\/\/ text-wrap-width: 80;\n\/\/ text-fill: @label_color_administrative;\n\/\/ text-halo-radius: @text_font_halo_radius_sm;\n\/\/ text-halo-fill: @label_color_halo_low; \n\/\/ text-name: \"[label_z6]\";\n\/\/ text-size: @text_font_size_medium;\n\/\/ text-character-spacing: 2;\n\/\/ }\n\n\/\/ #admin1-labels-50m-z7 {\n\/\/ text-face-name: @text_font_administrative;\n\/\/ text-wrap-width: 80;\n\/\/ text-fill: @label_color_administrative;\n\/\/ text-halo-radius: @text_font_halo_radius_sm;\n\/\/ text-halo-fill: @label_color_halo_low; \n\/\/ text-name: \"[label_z7]\";\n\/\/ text-size: @text_font_size_large;\n\/\/ text-character-spacing: 3;\n\/\/ }\n\n\/* Admin 0 labels *\/\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_sm;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-size: @text_font_size_large;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-character-spacing: @text_character_spacing_sm;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_lg;\n text-size: @text_font_size_large;\n [population<100] { text-size: @text_font_size_medium_plus; }\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xlg;\n [population<100] { text-size: @text_font_size_large; }\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xxlg;\n [population<100] { text-size: @text_font_size_xlg; }\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n\/* city labels - using hwy shields *\/\n#aries-places-labels {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<7],\n [zoom=7][scalerank<8],\n [zoom=8][scalerank<9][population>=50000],\n [zoom=9][scalerank<10][population>=50000],\n [zoom=10][scalerank<11][population>=50000],\n [zoom=11][scalerank<12][population>=20000],\n [zoom=12][scalerank<13],\n [zoom=13][scalerank<14], \n [zoom=14][scalerank<15] \n [zoom>=15][scalerank<15]{\n\n shield-file: url(shields\/circle-12.svg);\n shield-fill: @label_color_city;\n shield-halo-fill: @label_color_halo_low;\n shield-halo-radius: @text_font_halo_radius_sm;\n shield-unlock-image: true;\n shield-avoid-edges: true;\n shield-transform: scale(0.5, 0.5);\n shield-face-name: @text_font_city;\n shield-name: [name];\n shield-min-distance: 2;\n shield-placement-type: simple;\n shield-placements: 'NE,SW,NW,SE,E,W';\n shield-text-dy: 3;\n shield-text-dx: 3;\n shield-min-distance: 10;\n shield-wrap-width: 30;\n shield-line-spacing: -7;\n\n [zoom>=4] {\n shield-size: @text_font_size_xsm;\n \n [population>700000] {\n shield-size: @text_font_size_xsm * 1.2;\n shield-transform: scale(0.7, 0.7);\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xsm * 1.3;\n shield-transform: scale(0.8, 0.8);\n } \n }\n\n [zoom>=5]{\n shield-size: @text_font_size_sm; \n \n [population>700000] {\n shield-size: @text_font_size_sm * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_sm * 1.3;\n } \n }\n\n [zoom>=6]{\n shield-size: @text_font_size_medium; \n\n [population>700000] {\n shield-size: @text_font_size_medium * 1.2;\n shield-text-dy: 5;\n shield-text-dx: 5;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium * 1.4;\n } \n }\n\n [zoom>=8] {\n shield-line-spacing: -4;\n shield-halo-radius: @text_font_halo_radius_md;\n shield-transform: scale(0.75, 0.75);\n shield-text-dy: 5;\n shield-text-dx: 5;\n }\n\n [zoom>=10]{\n shield-size: @text_font_size_medium_plus; \n shield-halo-radius: @text_font_halo_radius_large;\n shield-halo-fill: @label_color_halo_high;\n shield-transform: scale(0.85, 0.85);\n shield-text-dy: 7;\n shield-text-dx: 7;\n\n [population>100000] {\n shield-size: @text_font_size_medium_plus * 1.2;\n shield-transform: scale(1, 1);\n shield-text-dy: 8;\n shield-text-dx: 8;\n }\n \n [population>700000] {\n shield-size: @text_font_size_medium_plus * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium_plus * 1.4;\n } \n }\n\n [zoom>=11] {\n shield-opacity: 0;\n }\n }\n}\n\n#aries-places-labels-high {\n [zoom=11][scalerank<12][population>=20000],\n [zoom=12][scalerank<13],\n [zoom=13][scalerank<14], \n [zoom=14][scalerank<15] \n [zoom>=15][scalerank<15]{\n text-name: [name];\n text-face-name: @text_font_city;\n text-size: @text_font_size_medium_plus;\n text-fill: @label_color_city;\n text-halo-fill: @label_color_halo_high;\n text-halo-radius: @text_font_halo_radius_large;\n text-avoid-edges: true;\n text-min-distance: 3;\n text-wrap-width: 20;\n text-line-spacing: -5;\n text-placement-type: simple;\n text-placements: 'NE,SW,NW,SE,E,W,N,S';\n\n [zoom>=12] {\n [population>100000] {\n text-size: @text_font_size_medium_plus * 1.2;\n }\n \n [population>700000] {\n text-size: @text_font_size_medium_plus * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_medium_plus * 1.4;\n } \n }\n\n [zoom>=13] {\n text-size: @text_font_size_large;\n \n [population>100000] {\n text-size: @text_font_size_large * 1.2;\n }\n \n [population>700000] {\n text-size: @text_font_size_large * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_large * 1.3;\n } \n }\n\n }\n}\n\n#airports { \n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n","old_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_shield: 'PT Sans Bold', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Bold', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_italic: 'PT Sans Italic', 'Unifont Medium';\n@text_font_bold_italic: 'PT Sans Bold Italic', 'Unifont Medium';\n\n@label_color_transport: #524c4c;\n@label_color_shield: #fff;\n@label_color_shield_fed: #333; \/\/ 80 K\n@label_color_administrative: #2e2115; \/\/\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n@text_font_size_xlg: 24;\n@text_font_size_xxlg: 34;\n\n@text_character_spacing_sm: 0.7;\n@text_character_spacing_md: 1.2;\n@text_character_spacing_lg: 1.7;\n@text_character_spacing_xlg: 2.2;\n\n@text_font_halo_radius_xsm: 1;\n@text_font_halo_radius_sm: 1.5;\n@text_font_halo_radius_md: 1.75;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: desaturate(#F7F7E6,50%);\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #dee0be; \/\/ same as @color_physical, the land background\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n\/** \n * These need to be filtered some how, else too many display\n *\/\n\/\/ #mountain_peaks {\n\/\/ [type='peak'] {\n\/\/ shield-name: [name];\n\/\/ shield-face-name: @text_font_italic;\n\/\/ shield-size: @text_font_size_xxsm;\n\/\/ shield-file: url('icons\/triangle-18.svg');\n\/\/ shield-transform: scale(0.5,0.5);\n\/\/ shield-unlock-image: true;\n\/\/ shield-avoid-edges: true;\n\/\/ shield-fill: @label_color_physical;\n\/\/ shield-halo-fill: @label_color_physical_halo;\n\/\/ shield-halo-radius: 1;\n\/\/ shield-halo-opacity: 0.7;\n\/\/ shield-min-distance: 2;\n\/\/ shield-placement-type: simple;\n\/\/ shield-placements: 'NE,SW,NW,SE,E,W';\n\/\/ shield-text-dy: 5;\n\/\/ shield-text-dx: 5;\n\/\/ shield-min-distance: 1000;\n\/\/ shield-wrap-width: 30;\n\/\/ shield-line-spacing: 0;\n\/\/ }\n\/\/ }\n\n#mountain_peaks_ne {\n [zoom>=6][comment =~'.*Highest.*'],\n [zoom>=6][comment =~'.*highest.*'],\n [zoom>=6][name =~'.*Vinson.*'],\n [zoom>=7][elevation>=2000],\n [zoom>=8][elevation>=1500],\n [zoom>=9][elevation>=1000],\n [zoom>=10][elevation>=500],\n [zoom>=11][elevation>0] {\n shield-name: [name] + ' ' + [elevation] + 'm';\n shield-face-name: @text_font_italic;\n shield-size: @text_font_size_xxsm;\n shield-file: url('icons\/triangle-18.svg');\n shield-transform: scale(0.5,0.5);\n shield-unlock-image: true;\n shield-avoid-edges: true;\n shield-fill: @label_color_physical;\n shield-halo-fill: @label_color_physical_halo;\n shield-halo-radius: 1;\n shield-halo-opacity: 0.7;\n shield-min-distance: 2;\n shield-placement-type: simple;\n shield-placements: 'NW,SE,N,S,E,W,NE,SW';\n shield-text-dy: 5;\n shield-text-dx: 5;\n shield-min-distance: 1000;\n shield-wrap-width: 30;\n shield-line-spacing: -2;\n\n [comment =~'.*Highest.*'],\n [comment =~'.*highest.*'],\n [name =~'.*Vinson.*'] {\n shield-face-name: @text_font_bold_italic; \/\/ special call out to the tallest peaks on each continent!\n shield-transform: scale(0.65,0.65);\n }\n \n [zoom>=8] {\n shield-size: @text_font_size_xsm; \n }\n\n [zoom>=10] {\n shield-size: @text_font_size_sm;\n shield-transform: scale(0.8,0.8);\n shield-text-dy: 7;\n shield-text-dx: 7;\n }\n \n \/\/ replace McKinley with Denali (not the dryest solution but TileMill is being weird...)\n [zoom>=6][zoom<=18][name=~'.*McKinley'] {\n shield-name: \"Denali\" + ' ' + [elevation] + 'm';\n shield-face-name: @text_font_bold_italic;\n shield-size: @text_font_size_xxsm;\n shield-file: url('icons\/triangle-18.svg');\n shield-transform: scale(0.5,0.5);\n shield-unlock-image: true;\n shield-avoid-edges: true;\n shield-fill: @label_color_physical;\n shield-halo-fill: @label_color_physical_halo;\n shield-halo-radius: 1;\n shield-halo-opacity: 0.7;\n shield-min-distance: 2;\n shield-placement-type: simple;\n shield-placements: 'NW,SE,N,S,E,W,NE,SW';\n shield-text-dy: 5;\n shield-text-dx: 5;\n shield-min-distance: 1000;\n shield-wrap-width: 30;\n shield-line-spacing: -2;\n\n [zoom>=8] {\n shield-size: @text_font_size_xsm; \n }\n\n [zoom>=10] {\n shield-size: @text_font_size_sm;\n shield-transform: scale(0.8,0.8);\n shield-text-dy: 7;\n shield-text-dx: 7;\n }\n }\n }\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-placement: line;\n text-label-position-tolerance: 2;\n text-max-char-angle-delta: 20;\n text-min-path-length: 30;\n text-fill: #444;\n text-spacing: 256;\n text-min-distance: 5;\n text-character-spacing: @text_character_spacing_sm;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: @text_font_halo_radius_md;\n\n [kind='major_road'] {\n text-size: @text_font_size_xxsm; \n } \n\n [zoom>=13] {\n text-size: @text_font_size_xxsm;\n \n [kind='major_road'] {\n text-size: @text_font_size_xxsm * 1.2; \n }\n }\n\n [zoom>=14] {\n text-min-distance: 10;\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_md;\n text-halo-radius: @text_font_halo_radius_large;\n \n [kind='major_road'] {\n text-size: @text_font_size_sm * 1.2; \n } \n }\n\n [zoom>=16]{\n text-min-distance: 100;\n text-character-spacing: @text_character_spacing_lg;\n }\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n [ref_length>0][ref_length<8] {\n \/\/ default rectangle shield\n shield-fill: @label_color_shield_fed;\n shield-transform: scale(1.1,1.1);\n shield-face-name: @text_font_shield;\n shield-name: [ref];\n shield-size: 10;\n shield-min-distance: 60;\n shield-spacing: 60;\n \/\/ half the width of the shield to prevent from wrapping\n shield-min-padding: 10;\n shield-file: url(shields\/default-rg.svg); \n\n [priority=4] {\n [ref_length>6][ref_length<8] {\n shield-file: url(shields\/default-lg.svg);\n }\n [ref_length<=4][ref_length>=3] {\n shield-file: url(shields\/default-sm.svg);\n }\n [ref_length<3][ref_length>0] {\n shield-file: url(shields\/default-xsm.svg); \n }\n }\n\n \/\/ hide state shields at lower zooms\n [zoom>=11][zoom<=12][highway='trunk'],\n [zoom>=11][zoom<=12][highway='primary'],\n [zoom>=11][zoom<=12][highway='secondary'],\n [zoom>=11][zoom<=12][highway='tertiary'] {\n shield-opacity: 0;\n shield-size: 0;\n }\n\n [ref=~'I \\d+'] {\n shield-file: url(shields\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 65;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 15;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(shields\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 65;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 13;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'US \\d+'] {\n shield-file: url(shields\/us.svg);\n shield-transform: scale(0.062, 0.062);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: @label_color_shield_fed;\n shield-text-dy: 1;\n shield-character-spacing: -1;\n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.075, 0.075);\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.088, 0.088);\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.091, 0.091);\n } \n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(shields\/ca.svg);\n shield-fill: @label_color_shield;\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-dy: -2.5;\n shield-character-spacing: -1;\n\n [zoom>=11][zoom<=12][highway='trunk'],\n [zoom>=11][zoom<=12][highway='primary'],\n [zoom>=11][zoom<=12][highway='secondary'],\n [zoom>=11][zoom<=12][highway='tertiary'] {\n shield-opacity: 0;\n shield-size: 0;\n } \n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.060, 0.060);\n shield-min-distance: 70;\n }\n\n [zoom>=14] {\n shield-min-distance: 80;\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.080, 0.080);\n shield-dy: -3.5;\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.090, 0.090); \n } \n }\n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n \n text-face-name: @text_font_bold_italic;\n text-wrap-width: 40;\n text-wrap-character: ' ';\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_xlg;\n text-align: center;\n\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_xsm;\n text-halo-fill: @label_color_water_halo;\n text-placement: interior;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][scalerank<4][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][scalerank<7][changed!='']\n{\n text-name: [name];\n\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n text-face-name: @text_font_bold_italic;\n text-wrap-width: 50;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_lg;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_xsm;\n text-halo-fill: @label_color_water_halo;\n text-placement: interior;\n text-align: center;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>1000000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_italic;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels { \n \/\/ [zoom>=4][scalerank<3],\n [zoom>=5][scalerank<=3][admin!='United States of America'][admin!='Canada'],\n [zoom>=6][scalerank<=5],\n [zoom>=7][scalerank>=6] {\n text-name: [name];\n text-transform: uppercase;\n text-face-name: @text_font_administrative; \n text-fill: #333; \/\/@label_color_administrative;\n text-halo-fill: @label_color_halo_low;\n text-halo-radius: @text_font_halo_radius_sm;\n text-size: @text_font_size_sm;\n text-wrap-width: 40;\n text-placement-type: simple;\n text-placements: 'E,N,W,S';\n text-allow-overlap: false;\n text-min-distance: 30;\n text-avoid-edges: true;\n text-min-padding: 5;\n \n [zoom>=5] {\n text-size: @text_font_size_xsm; \n text-character-spacing: 0;\n text-min-distance: 30;\n }\n\n [zoom>=6] {\n text-size: @text_font_size_xsm;\n text-character-spacing: 1;\n }\n\n [zoom>=7] {\n text-size: @text_font_size_sm;\n text-character-spacing: 2;\n } \n }\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n text-character-spacing: 1;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80; \n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n \/\/ text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n}\n\n\/\/ #admin1-labels-50m-z6 {\n\/\/ text-face-name: @text_font_administrative;\n\/\/ text-wrap-width: 80;\n\/\/ text-fill: @label_color_administrative;\n\/\/ text-halo-radius: @text_font_halo_radius_sm;\n\/\/ text-halo-fill: @label_color_halo_low; \n\/\/ text-name: \"[label_z6]\";\n\/\/ text-size: @text_font_size_medium;\n\/\/ text-character-spacing: 2;\n\/\/ }\n\n\/\/ #admin1-labels-50m-z7 {\n\/\/ text-face-name: @text_font_administrative;\n\/\/ text-wrap-width: 80;\n\/\/ text-fill: @label_color_administrative;\n\/\/ text-halo-radius: @text_font_halo_radius_sm;\n\/\/ text-halo-fill: @label_color_halo_low; \n\/\/ text-name: \"[label_z7]\";\n\/\/ text-size: @text_font_size_large;\n\/\/ text-character-spacing: 3;\n\/\/ }\n\n\/* Admin 0 labels *\/\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_sm;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-size: @text_font_size_large;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-character-spacing: @text_character_spacing_sm;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_lg;\n text-size: @text_font_size_large;\n [population<100] { text-size: @text_font_size_medium_plus; }\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xlg;\n [population<100] { text-size: @text_font_size_large; }\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xxlg;\n [population<100] { text-size: @text_font_size_xlg; }\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n\/* city labels - using hwy shields *\/\n#aries-places-labels {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<7],\n [zoom=7][scalerank<8],\n [zoom=8][scalerank<9][population>=50000],\n [zoom=9][scalerank<10][population>=50000],\n [zoom=10][scalerank<11][population>=50000],\n [zoom=11][scalerank<12][population>=20000],\n [zoom=12][scalerank<13],\n [zoom=13][scalerank<14], \n [zoom=14][scalerank<15] \n [zoom>=15][scalerank<15]{\n\n shield-file: url(shields\/circle-12.svg);\n shield-fill: @label_color_city;\n shield-halo-fill: @label_color_halo_low;\n shield-halo-radius: @text_font_halo_radius_sm;\n shield-unlock-image: true;\n shield-avoid-edges: true;\n shield-transform: scale(0.5, 0.5);\n shield-face-name: @text_font_city;\n shield-name: [name];\n shield-min-distance: 2;\n shield-placement-type: simple;\n shield-placements: 'NE,SW,NW,SE,E,W';\n shield-text-dy: 3;\n shield-text-dx: 3;\n shield-min-distance: 10;\n shield-wrap-width: 30;\n shield-line-spacing: -7;\n\n [zoom>=4] {\n shield-size: @text_font_size_xsm;\n \n [population>700000] {\n shield-size: @text_font_size_xsm * 1.2;\n shield-transform: scale(0.7, 0.7);\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xsm * 1.3;\n shield-transform: scale(0.8, 0.8);\n } \n }\n\n [zoom>=5]{\n shield-size: @text_font_size_sm; \n \n [population>700000] {\n shield-size: @text_font_size_sm * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_sm * 1.3;\n } \n }\n\n [zoom>=6]{\n shield-size: @text_font_size_medium; \n\n [population>700000] {\n shield-size: @text_font_size_medium * 1.2;\n shield-text-dy: 5;\n shield-text-dx: 5;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium * 1.4;\n } \n }\n\n [zoom>=8] {\n shield-line-spacing: -4;\n shield-halo-radius: @text_font_halo_radius_md;\n shield-transform: scale(0.75, 0.75);\n shield-text-dy: 5;\n shield-text-dx: 5;\n }\n\n [zoom>=10]{\n shield-size: @text_font_size_medium_plus; \n shield-halo-radius: @text_font_halo_radius_large;\n shield-halo-fill: @label_color_halo_high;\n shield-transform: scale(0.85, 0.85);\n shield-text-dy: 7;\n shield-text-dx: 7;\n\n [population>100000] {\n shield-size: @text_font_size_medium_plus * 1.2;\n shield-transform: scale(1, 1);\n shield-text-dy: 8;\n shield-text-dx: 8;\n }\n \n [population>700000] {\n shield-size: @text_font_size_medium_plus * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium_plus * 1.4;\n } \n }\n\n [zoom>=11] {\n shield-opacity: 0;\n }\n }\n}\n\n#aries-places-labels-high {\n [zoom=11][scalerank<12][population>=20000],\n [zoom=12][scalerank<13],\n [zoom=13][scalerank<14], \n [zoom=14][scalerank<15] \n [zoom>=15][scalerank<15]{\n text-name: [name];\n text-face-name: @text_font_city;\n text-size: @text_font_size_medium_plus;\n text-fill: @label_color_city;\n text-halo-fill: @label_color_halo_high;\n text-halo-radius: @text_font_halo_radius_large;\n text-avoid-edges: true;\n text-min-distance: 3;\n text-wrap-width: 20;\n text-line-spacing: -5;\n text-placement-type: simple;\n text-placements: 'NE,SW,NW,SE,E,W,N,S';\n\n [zoom>=12] {\n [population>100000] {\n text-size: @text_font_size_medium_plus * 1.2;\n }\n \n [population>700000] {\n text-size: @text_font_size_medium_plus * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_medium_plus * 1.4;\n } \n }\n\n [zoom>=13] {\n text-size: @text_font_size_large;\n \n [population>100000] {\n text-size: @text_font_size_large * 1.2;\n }\n \n [population>700000] {\n text-size: @text_font_size_large * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_large * 1.3;\n } \n }\n\n }\n}\n\n#airports { \n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"82711eb443abf538d7502d7895fb77ed1587dee7","subject":"fix typo in land-low layer selector","message":"fix typo in land-low layer selector\n","repos":"brelevenix\/osm-bright-tregor,mapbox\/osm-bright,silph-io\/osm-silph,Sweetymeow\/osm-bright,jeffaudi\/osm-hybrid,pinkflozd\/osm-bright,raumobil\/osm-bright,saydulk\/osm-bright","old_file":"osm-bright\/base.mss","new_file":"osm-bright\/base.mss","new_contents":"\/* BASE.MSS CONTENTS\n * - Landuse & landcover\n * - Water areas\n * - Water ways\n * - Administrative Boundaries\n *\n *\/\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER\n\/* ================================================================== *\/\n\n#land-low[zoom>=0][zoom<10],\n#land-high[zoom>=10] {\n polygon-fill: @land;\n polygon-gamma: 0.75;\n}\n\n#landuse_gen0[zoom>3][zoom<=9],\n#landuse_gen1[zoom>9][zoom<=12],\n#landuse[zoom>12] {\n [type='cemetery'] { polygon-fill: @cemetery; }\n [type='college'] { polygon-fill: @school; }\n [type='commercial'] { polygon-fill: @industrial; }\n [type='common'] { polygon-fill: @park; }\n [type='forest'] { polygon-fill: @wooded; }\n [type='golf_course'] { polygon-fill: @sports; }\n [type='grass'] { polygon-fill: @grass; }\n [type='hospital'] { polygon-fill: @hospital; }\n [type='industrial'] { polygon-fill: @industrial; }\n [type='park'] { polygon-fill: @park; }\n [type='parking'] { polygon-fill: @parking; }\n [type='pedestrian'] { polygon-fill: @pedestrian_fill; }\n [type='pitch'] { polygon-fill: @sports; }\n [type='residential'] { polygon-fill: @residential; }\n [type='school'] { polygon-fill: @school; }\n [type='sports_center'] { polygon-fill: @sports; }\n [type='stadium'] { polygon-fill: @sports; }\n [type='university'] { polygon-fill: @school; }\n [type='wood'] { polygon-fill: @wooded; }\n}\n\n#landuse_overlays[type='nature_reserve'][zoom>6] {\n line-color: darken(@wooded,25%);\n line-opacity: 0.3;\n line-dasharray: 1,1;\n polygon-fill: darken(@wooded,25%);\n polygon-opacity: 0.1;\n [zoom=7] { line-width: 0.4; }\n [zoom=8] { line-width: 0.6; }\n [zoom=9] { line-width: 0.8; }\n [zoom=10] { line-width: 1.0; }\n [zoom=11] { line-width: 1.5; }\n [zoom>=12] { line-width: 2.0; }\n}\n \n#landuse_overlays[type='wetland'][zoom>11] {\n [zoom>11][zoom<=14] { polygon-pattern-file:url(img\/marsh-16.png); }\n [zoom>14] { polygon-pattern-file:url(img\/marsh-32.png);}\n }\n\n\/* ---- BUILDINGS ---- *\/\n#buildings[zoom>=12][zoom<=16] {\n polygon-fill:@building;\n [zoom>=14] {\n line-color:darken(@building,5%);\n line-width:0.2;\n }\n [zoom>=16] {\n line-color:darken(@building,10%);\n line-width:0.4;\n }\n}\n\/\/ At the highest zoom levels, render buildings in fancy pseudo-3D.\n\/\/ Ordering polygons by their Y-position is necessary for this effect\n\/\/ so we use a separate layer that does this for us.\n#buildings[zoom>=17][type != 'hedge'] {\n building-fill:@building;\n building-height:1.25;\n}\n\n#buildings[zoom>=17][type = 'hedge'] {\n building-fill:@wooded;\n building-height:1.25;\n}\n\n\/* ================================================================== *\/\n\/* WATER AREAS\n\/* ================================================================== *\/\n\nMap { background-color: @water; }\n\n#water_gen0[zoom>3][zoom<=9],\n#water_gen1[zoom>9][zoom<=12],\n#water[zoom>12] {\n polygon-fill: @water;\n}\n\n\/* ================================================================== *\/\n\/* WATER WAYS\n\/* ================================================================== *\/\n\n#waterway_low[zoom>=8][zoom<=12] {\n line-color: @water;\n [zoom=8] { line-width: 0.1; }\n [zoom=9] { line-width: 0.2; }\n [zoom=10]{ line-width: 0.4; }\n [zoom=11]{ line-width: 0.6; }\n [zoom=12]{ line-width: 0.8; }\n}\n\n#waterway_med[zoom>=13][zoom<=14] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=13]{ line-width: 1; }\n [zoom=14]{ line-width: 1.5; }\n }\n [type='stream'] {\n [zoom=13]{ line-width: 0.2; }\n [zoom=14]{ line-width: 0.4; }\n }\n}\n \n#waterway_high[zoom>=15] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=15]{ line-width: 2; }\n [zoom=16]{ line-width: 3; }\n [zoom=17]{ line-width: 4; }\n [zoom=18]{ line-width: 5; }\n [zoom=19]{ line-width: 6; }\n [zoom>19]{ line-width: 7; }\n }\n [type='stream'] {\n [zoom=15]{ line-width: 0.6; }\n [zoom=16]{ line-width: 0.8; }\n [zoom=17]{ line-width: 1; }\n [zoom=18]{ line-width: 1.5; }\n [zoom>18]{ line-width: 2; }\n }\n [type='ditch'],\n [type='drain'] {\n [zoom=15]{ line-width: 0.1; }\n [zoom=16]{ line-width: 0.3; }\n [zoom=17]{ line-width: 0.5; }\n [zoom=18]{ line-width: 0.7; }\n [zoom=19]{ line-width: 1; }\n [zoom>19]{ line-width: 1.5; }\n }\n}\n\n\/* ================================================================== *\/\n\/* ADMINISTRATIVE BOUNDARIES\n\/* ================================================================== *\/\n\n\n#admin[admin_level=2][zoom>1] {\n line-color:@admin_2;\n line-width:0.5;\n [zoom=2] { line-opacity: 0.25; }\n [zoom=3] { line-opacity: 0.3; }\n [zoom=4] { line-opacity: 0.4; }\n}\n\n\/* ================================================================== *\/\n\/* BARRIER POINTS\n\/* ================================================================== *\/\n\n\n#barrier_points[zoom>=17][stylegroup = 'divider'] {\n marker-height: 2;\n marker-fill: #c7c7c7;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n\n\/* ================================================================== *\/\n\/* BARRIER LINES\n\/* ================================================================== *\/\n\n#barrier_lines[zoom>=17][stylegroup = 'gate'] {\n line-width:2.5;\n line-color:#aab;\n line-dasharray:3,2;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'fence'] {\n line-width:1.75;\n line-color:#aab;\n line-dasharray:1,1;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'hedge'] {\n line-width:3;\n line-color:darken(@park,5%);\n\n}\n","old_contents":"\/* BASE.MSS CONTENTS\n * - Landuse & landcover\n * - Water areas\n * - Water ways\n * - Administrative Boundaries\n *\n *\/\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER\n\/* ================================================================== *\/\n\n#land-low[zoom>=0][zoom<6],\n#land-high[zoom>=10] {\n polygon-fill: @land;\n polygon-gamma: 0.75;\n}\n\n#landuse_gen0[zoom>3][zoom<=9],\n#landuse_gen1[zoom>9][zoom<=12],\n#landuse[zoom>12] {\n [type='cemetery'] { polygon-fill: @cemetery; }\n [type='college'] { polygon-fill: @school; }\n [type='commercial'] { polygon-fill: @industrial; }\n [type='common'] { polygon-fill: @park; }\n [type='forest'] { polygon-fill: @wooded; }\n [type='golf_course'] { polygon-fill: @sports; }\n [type='grass'] { polygon-fill: @grass; }\n [type='hospital'] { polygon-fill: @hospital; }\n [type='industrial'] { polygon-fill: @industrial; }\n [type='park'] { polygon-fill: @park; }\n [type='parking'] { polygon-fill: @parking; }\n [type='pedestrian'] { polygon-fill: @pedestrian_fill; }\n [type='pitch'] { polygon-fill: @sports; }\n [type='residential'] { polygon-fill: @residential; }\n [type='school'] { polygon-fill: @school; }\n [type='sports_center'] { polygon-fill: @sports; }\n [type='stadium'] { polygon-fill: @sports; }\n [type='university'] { polygon-fill: @school; }\n [type='wood'] { polygon-fill: @wooded; }\n}\n\n#landuse_overlays[type='nature_reserve'][zoom>6] {\n line-color: darken(@wooded,25%);\n line-opacity: 0.3;\n line-dasharray: 1,1;\n polygon-fill: darken(@wooded,25%);\n polygon-opacity: 0.1;\n [zoom=7] { line-width: 0.4; }\n [zoom=8] { line-width: 0.6; }\n [zoom=9] { line-width: 0.8; }\n [zoom=10] { line-width: 1.0; }\n [zoom=11] { line-width: 1.5; }\n [zoom>=12] { line-width: 2.0; }\n}\n \n#landuse_overlays[type='wetland'][zoom>11] {\n [zoom>11][zoom<=14] { polygon-pattern-file:url(img\/marsh-16.png); }\n [zoom>14] { polygon-pattern-file:url(img\/marsh-32.png);}\n }\n\n\/* ---- BUILDINGS ---- *\/\n#buildings[zoom>=12][zoom<=16] {\n polygon-fill:@building;\n [zoom>=14] {\n line-color:darken(@building,5%);\n line-width:0.2;\n }\n [zoom>=16] {\n line-color:darken(@building,10%);\n line-width:0.4;\n }\n}\n\/\/ At the highest zoom levels, render buildings in fancy pseudo-3D.\n\/\/ Ordering polygons by their Y-position is necessary for this effect\n\/\/ so we use a separate layer that does this for us.\n#buildings[zoom>=17][type != 'hedge'] {\n building-fill:@building;\n building-height:1.25;\n}\n\n#buildings[zoom>=17][type = 'hedge'] {\n building-fill:@wooded;\n building-height:1.25;\n}\n\n\/* ================================================================== *\/\n\/* WATER AREAS\n\/* ================================================================== *\/\n\nMap { background-color: @water; }\n\n#water_gen0[zoom>3][zoom<=9],\n#water_gen1[zoom>9][zoom<=12],\n#water[zoom>12] {\n polygon-fill: @water;\n}\n\n\/* ================================================================== *\/\n\/* WATER WAYS\n\/* ================================================================== *\/\n\n#waterway_low[zoom>=8][zoom<=12] {\n line-color: @water;\n [zoom=8] { line-width: 0.1; }\n [zoom=9] { line-width: 0.2; }\n [zoom=10]{ line-width: 0.4; }\n [zoom=11]{ line-width: 0.6; }\n [zoom=12]{ line-width: 0.8; }\n}\n\n#waterway_med[zoom>=13][zoom<=14] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=13]{ line-width: 1; }\n [zoom=14]{ line-width: 1.5; }\n }\n [type='stream'] {\n [zoom=13]{ line-width: 0.2; }\n [zoom=14]{ line-width: 0.4; }\n }\n}\n \n#waterway_high[zoom>=15] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=15]{ line-width: 2; }\n [zoom=16]{ line-width: 3; }\n [zoom=17]{ line-width: 4; }\n [zoom=18]{ line-width: 5; }\n [zoom=19]{ line-width: 6; }\n [zoom>19]{ line-width: 7; }\n }\n [type='stream'] {\n [zoom=15]{ line-width: 0.6; }\n [zoom=16]{ line-width: 0.8; }\n [zoom=17]{ line-width: 1; }\n [zoom=18]{ line-width: 1.5; }\n [zoom>18]{ line-width: 2; }\n }\n [type='ditch'],\n [type='drain'] {\n [zoom=15]{ line-width: 0.1; }\n [zoom=16]{ line-width: 0.3; }\n [zoom=17]{ line-width: 0.5; }\n [zoom=18]{ line-width: 0.7; }\n [zoom=19]{ line-width: 1; }\n [zoom>19]{ line-width: 1.5; }\n }\n}\n\n\/* ================================================================== *\/\n\/* ADMINISTRATIVE BOUNDARIES\n\/* ================================================================== *\/\n\n\n#admin[admin_level=2][zoom>1] {\n line-color:@admin_2;\n line-width:0.5;\n [zoom=2] { line-opacity: 0.25; }\n [zoom=3] { line-opacity: 0.3; }\n [zoom=4] { line-opacity: 0.4; }\n}\n\n\/* ================================================================== *\/\n\/* BARRIER POINTS\n\/* ================================================================== *\/\n\n\n#barrier_points[zoom>=17][stylegroup = 'divider'] {\n marker-height: 2;\n marker-fill: #c7c7c7;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n\n\/* ================================================================== *\/\n\/* BARRIER LINES\n\/* ================================================================== *\/\n\n#barrier_lines[zoom>=17][stylegroup = 'gate'] {\n line-width:2.5;\n line-color:#aab;\n line-dasharray:3,2;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'fence'] {\n line-width:1.75;\n line-color:#aab;\n line-dasharray:1,1;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'hedge'] {\n line-width:3;\n line-color:darken(@park,5%);\n\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"529cfa7d3b9e6b71253ed7c1b0a0fa78cf3fa963","subject":"Changed text-placement to line","message":"Changed text-placement to line\n","repos":"OpenBounds\/MapStyles","old_file":"PublicLands.tm2\/style.mss","new_file":"PublicLands.tm2\/style.mss","new_contents":"Map { font-directory: url(\".\/fonts\"); }\n\n#lands {\n\tpolygon-opacity:1;\n line-width:1;\n line-color:black;\n\t[adminLevel='state'] {\n \tpolygon-fill:green;\n\t}\n\t[adminLevel='county'] {\n \tpolygon-fill:yellow;\n\t}\n\t[adminLevel='local'] {\n \tpolygon-fill:blue;\n\t}\n\t[adminAgency='Bureau of Land Management'] {\n\t\tpolygon-fill: red;\n\t}\n\t[adminAgency='Bureau of Reclamation']{\n\t\tpolygon-fill: #0080FF;\n\t}\n\t[adminAgency='Forest Service']{\n\t\tpolygon-fill: #238b45;\n\t}\n\t[adminAgency='National Park Service']{\n\t\tpolygon-fill: #01DF01;\n\t}\n\t[adminAgency='Department of Defense']{\n\t\tpolygon-fill: #67000d;\n\t}\n\t[adminAgency='Army Corps of Engineers'] {\n\t\tpolygon-fill: #a50f15;\n\t}\n\t[adminAgency='Army'] {\n polygon-fill: #5E610B;\n }\n\t[adminAgency='Air Force'] {\n polygon-fill: #A9F5F2;\n }\n\t[adminAgency='Navy'] {\n polygon-fill: #01DFD7;\n }\t\n\t[adminAgency='Department of Energy']{\n\t\tpolygon-fill: #F5A9F2;\n\t}\n\t[adminAgency='Department of Agriculture']{\n\t\tpolygon-fill: #FF8000;\n\t}\n\t[adminAgency='Coast Guard']{\n\t\tpolygon-fill: #0000FF;\n\t}\n\t[adminAgency='Department of Transportation']{\n\t\tpolygon-fill: #636363;\n\t}\n\t[adminAgency='Fish & Wildlife Service']{\n\t\tpolygon-fill: #a1d99b;\n\t}\n\t[adminAgency='National Aeronautics and Space Administration']{\n\t\tpolygon-fill: #000;\n\t}\n\t[adminAgency='International Boundary & Water Commission']{\n\t\tpolygon-fill: #49006a;\n\t}\n\t[adminAgency='Tennessee Valley Authority']{\n\t\tpolygon-fill: #7a0177;\n\t}\n\t[adminAgency='Bureau of Indian Affairs']{\n\t\tpolygon-fill: #e34a33;\n\t}\n\t[adminAgency='Department of the Interior']{\n\t\tpolygon-fill: #02818a;\n\t}\n\t[adminAgency='National Center for Atmospheric Research']{\n\t\tpolygon-fill: #d0d1e6;\n\t}\n\t[adminAgency='National Institute of Standards and Technology']{\n\t\tpolygon-fill: #ef3b2c;\n\t}\n\t[adminAgency='Department of Justice']{\n polygon-fill: #FE2E64;\n }\n\t[adminAgency='Department of Commerce']{\n polygon-fill: #CEF6D8;\n }\n\t[adminAgency='Department of Veterans Affairs']{\n polygon-fill: #61380B;\n }\n\t[adminAgency='Federal Aviation Administration']{\n polygon-fill: #fff;\n }\n\t[adminAgency='Bureau of Indian Affairs'] {\n polygon-fill: #F6CECE;\n }\n\t[adminAgency='Bonneville Power Administration'] {\n polygon-fill: #F7BE81;\n }\n\t[adminAgency='Federal Government'] {\n polygon-fill: #49006a;\n }\n\t[adminAgency='Federal Highway Administration'] {\n polygon-fill: #210B61;\n }\n\t[adminAgency='Fire Administration'] {\n polygon-fill: #21610B;\n }\n\t[adminAgency='International Boundary & Water Commission'] {\n polygon-fill: #424242;\n }\n\t[adminAgency='Marine Corps'] {\n polygon-fill: #AEB404;\n }\n\t[adminAgency='National Marine Fisheries Service'] {\n polygon-fill: #088A85;\n }\n\t[adminAgency='Natural Resources Conservation Service'] {\n polygon-fill: #3B170B;\n }\n\t[adminAgency='Smithsonian'] {\n polygon-fill: #DF01D7;\n }\n\t[adminAgency='Smithsonian Environmental Research Center'] {\n polygon-fill: #DF01D7;\n }\n}\n\n#lands_label {\n text-face-name: 'Noto Sans Regular';\n text-name:'[loc_nm]';\n text-size: 12;\n text-placement:line;\n text-fill:black;\n text-min-padding:1;\n text-wrap-width:100;\n}\n\n","old_contents":"Map { font-directory: url(\".\/fonts\"); }\n\n#lands {\n\tpolygon-opacity:1;\n line-width:1;\n line-color:black;\n\t[adminLevel='state'] {\n \tpolygon-fill:green;\n\t}\n\t[adminLevel='county'] {\n \tpolygon-fill:yellow;\n\t}\n\t[adminLevel='local'] {\n \tpolygon-fill:blue;\n\t}\n\t[adminAgency='Bureau of Land Management'] {\n\t\tpolygon-fill: red;\n\t}\n\t[adminAgency='Bureau of Reclamation']{\n\t\tpolygon-fill: #0080FF;\n\t}\n\t[adminAgency='Forest Service']{\n\t\tpolygon-fill: #238b45;\n\t}\n\t[adminAgency='National Park Service']{\n\t\tpolygon-fill: #01DF01;\n\t}\n\t[adminAgency='Department of Defense']{\n\t\tpolygon-fill: #67000d;\n\t}\n\t[adminAgency='Army Corps of Engineers'] {\n\t\tpolygon-fill: #a50f15;\n\t}\n\t[adminAgency='Army'] {\n polygon-fill: #5E610B;\n }\n\t[adminAgency='Air Force'] {\n polygon-fill: #A9F5F2;\n }\n\t[adminAgency='Navy'] {\n polygon-fill: #01DFD7;\n }\t\n\t[adminAgency='Department of Energy']{\n\t\tpolygon-fill: #F5A9F2;\n\t}\n\t[adminAgency='Department of Agriculture']{\n\t\tpolygon-fill: #FF8000;\n\t}\n\t[adminAgency='Coast Guard']{\n\t\tpolygon-fill: #0000FF;\n\t}\n\t[adminAgency='Department of Transportation']{\n\t\tpolygon-fill: #636363;\n\t}\n\t[adminAgency='Fish & Wildlife Service']{\n\t\tpolygon-fill: #a1d99b;\n\t}\n\t[adminAgency='National Aeronautics and Space Administration']{\n\t\tpolygon-fill: #000;\n\t}\n\t[adminAgency='International Boundary & Water Commission']{\n\t\tpolygon-fill: #49006a;\n\t}\n\t[adminAgency='Tennessee Valley Authority']{\n\t\tpolygon-fill: #7a0177;\n\t}\n\t[adminAgency='Bureau of Indian Affairs']{\n\t\tpolygon-fill: #e34a33;\n\t}\n\t[adminAgency='Department of the Interior']{\n\t\tpolygon-fill: #02818a;\n\t}\n\t[adminAgency='National Center for Atmospheric Research']{\n\t\tpolygon-fill: #d0d1e6;\n\t}\n\t[adminAgency='National Institute of Standards and Technology']{\n\t\tpolygon-fill: #ef3b2c;\n\t}\n\t[adminAgency='Department of Justice']{\n polygon-fill: #FE2E64;\n }\n\t[adminAgency='Department of Commerce']{\n polygon-fill: #CEF6D8;\n }\n\t[adminAgency='Department of Veterans Affairs']{\n polygon-fill: #61380B;\n }\n\t[adminAgency='Federal Aviation Administration']{\n polygon-fill: #fff;\n }\n\t[adminAgency='Bureau of Indian Affairs'] {\n polygon-fill: #F6CECE;\n }\n\t[adminAgency='Bonneville Power Administration'] {\n polygon-fill: #F7BE81;\n }\n\t[adminAgency='Federal Government'] {\n polygon-fill: #49006a;\n }\n\t[adminAgency='Federal Highway Administration'] {\n polygon-fill: #210B61;\n }\n\t[adminAgency='Fire Administration'] {\n polygon-fill: #21610B;\n }\n\t[adminAgency='International Boundary & Water Commission'] {\n polygon-fill: #424242;\n }\n\t[adminAgency='Marine Corps'] {\n polygon-fill: #AEB404;\n }\n\t[adminAgency='National Marine Fisheries Service'] {\n polygon-fill: #088A85;\n }\n\t[adminAgency='Natural Resources Conservation Service'] {\n polygon-fill: #3B170B;\n }\n\t[adminAgency='Smithsonian'] {\n polygon-fill: #DF01D7;\n }\n\t[adminAgency='Smithsonian Environmental Research Center'] {\n polygon-fill: #DF01D7;\n }\n}\n\n#lands_label {\n text-face-name: 'Noto Sans Regular';\n text-name:'[loc_nm]';\n text-size: 12;\n text-placement:point;\n text-fill:black;\n text-min-padding:1;\n text-wrap-width:100;\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"a1e8df56884618009d892f990aa780fa957c9aea","subject":"#11 adjust labeling for appropriate zoom level","message":"#11 adjust labeling for appropriate zoom level\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Narrow Regular', 'Unifont Medium';\n\n@label_color_transport: #524c4c;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n@label_color_green_area: #374c30;\n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-avoid-edges: true;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=11] {\n text-fill: #586e50;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n\n [zoom>=11] {\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_green_area_halo;\n }\n [zoom>=15] {\n text-halo-radius: @text_font_halo_radius_large;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 18;\n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-size: 22;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 22;\n text-min-distance: 15;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.1;\n \/\/}\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-placement: interior;\n text-vertical-alignment: bottom;\n text-min-distance: 5;\n text-dy: -5;\n\n [justified='left'] {\n \/\/text-horizontal-alignment: left;\n text-horizontal-alignment: middle;\n \/\/text-dx: 20;\n }\n\n [justified='right'] {\n \/\/text-horizontal-alignment: right;\n text-horizontal-alignment: middle;\n \/\/text-dx: -20;\n }\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size>=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.3;\n \/\/}\n [justified='left'] {\n text-horizontal-alignment: left;\n text-dx: 15;\n }\n\n [justified='right'] {\n text-horizontal-alignment: right;\n text-dx: -15;\n }\n\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_sm;\n text-min-distance: 5;\n text-allow-overlap: true;\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: 2;\n text-halo-fill: fadeout(rgba(255,255,255, 0.7), 30%);\n \/\/ text-comp-op: src;\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n \n [zoom>=11] {\n text-halo-fill: fadeout(rgba(255,255,255, 1), 30%);\n }\n}\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n marker-ignore-placement: true;\n marker-width: 5;\n marker-fill: #2e2115;\n marker-line-width: 0;\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: #f7f7e6;\n text-halo-radius: 2;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n\n \/\/ [zoom=8][natlscale>2.3],\n \/\/ [zoom=9][natlscale>1.2],\n \/\/ [zoom=10][natlscale>.57],\n \/\/ [zoom=11][natlscale>.29],\n \/\/ [zoom=12][natlscale>.29],\n \/\/ [zoom=13][natlscale>.29]\n \/\/ {\n \/\/ point-file: url('icons\/airport_small_l.png');\n \/\/ }\n\n \/\/ [zoom=14][natlscale>.29],\n \/\/ [zoom=15][natlscale>.29],\n \/\/ [zoom>=16][natlscale>.29]\n \/\/ {\n \/\/ point-file: url('icons\/airport_small_xl.png');\n \/\/ }\n \n}\n\n","old_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Narrow Regular', 'Unifont Medium';\n\n@label_color_transport: #524c4c;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n@label_color_green_area: #374c30;\n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-avoid-edges: true;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=11] {\n text-fill: #586e50;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n\n [zoom>=11] {\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_green_area_halo;\n }\n [zoom>=15] {\n text-halo-radius: @text_font_halo_radius_large;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 18;\n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-size: 22;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 22;\n text-min-distance: 15;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.1;\n \/\/}\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-placement: interior;\n text-vertical-alignment: bottom;\n text-min-distance: 5;\n text-dy: -5;\n\n [justified='left'] {\n \/\/text-horizontal-alignment: left;\n text-horizontal-alignment: middle;\n \/\/text-dx: 20;\n }\n\n [justified='right'] {\n \/\/text-horizontal-alignment: right;\n text-horizontal-alignment: middle;\n \/\/text-dx: -20;\n }\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size>=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.3;\n \/\/}\n [justified='left'] {\n text-horizontal-alignment: left;\n text-dx: 15;\n }\n\n [justified='right'] {\n text-horizontal-alignment: right;\n text-dx: -15;\n }\n\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_sm;\n text-min-distance: 5;\n text-allow-overlap: true;\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: 2;\n text-halo-fill: fadeout(rgba(255,255,255, 0.7), 30%);\n \/\/ text-comp-op: src;\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n \n [zoom>=11] {\n text-halo-fill: fadeout(rgba(255,255,255, 1), 30%);\n }\n}\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n marker-ignore-placement: true;\n marker-width: 5;\n marker-fill: #2e2115;\n marker-line-width: 0;\n}\n\n#airports {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: #f7f7e6;\n text-halo-radius: 2;\n \n text-wrap-width: 128;\n text-dy: 12;\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n\n \/\/ [zoom=8][natlscale>2.3],\n \/\/ [zoom=9][natlscale>1.2],\n \/\/ [zoom=10][natlscale>.57],\n \/\/ [zoom=11][natlscale>.29],\n \/\/ [zoom=12][natlscale>.29],\n \/\/ [zoom=13][natlscale>.29]\n \/\/ {\n \/\/ point-file: url('icons\/airport_little_l.png');\n \/\/ }\n\n \/\/ [zoom=14][natlscale>.29],\n \/\/ [zoom=15][natlscale>.29],\n \/\/ [zoom>=16][natlscale>.29]\n \/\/ {\n \/\/ point-file: url('icons\/airport_little_xl.png');\n \/\/ }\n \n}\n\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"2b986d086e0ea056a303bfeef03096059ea82975","subject":"make building labels look more like residential road labels","message":"make building labels look more like residential road labels\n","repos":"andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto","old_file":"osmt\/style.mss","new_file":"osmt\/style.mss","new_contents":"\/*\n==Database level==\n* join adjacent way segments with same classification and name\n for labels layer and increase text-spacing so labels aren't\n repeated right next to each other\n\n* optimise queries as to select just what is required for rendering\n\n* select way area so can style bay names larger for larger bays\n\n==Style level==\n* ShieldSymbolizers for POIs with names at high zooms (eg police station\n icon with name)\n*\/\n\n\/* only show from z15+ where area > 30,000 *\/\n#park-labels[zoom > 14][way_area > 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: #0e300e;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n text-opacity: 0.75;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\/* start showing on z16+ on area > 10,000 *\/\n#park-labels[zoom > 15][way_area >= 10000][way_area < 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: #0e300e;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n text-opacity: 0.75;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\/* show the rest from z17+ *\/\n#park-labels[zoom > 16][way_area < 10000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: #0e300e;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n text-opacity: 0.75;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n#building-label[zoom > 16] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: black;\n text-halo-radius: 1.0;\n text-wrap-width: 20;\n \n [zoom > 21] { text-size: 15; }\n [zoom = 21] { text-size: 14; }\n [zoom = 20] { text-size: 13; }\n [zoom = 19] { text-size: 12; }\n [zoom = 18] { text-size: 11; }\n [zoom = 17] { text-size: 10; }\n}","old_contents":"\/*\n==Database level==\n* join adjacent way segments with same classification and name\n for labels layer and increase text-spacing so labels aren't\n repeated right next to each other\n\n* optimise queries as to select just what is required for rendering\n\n* select way area so can style bay names larger for larger bays\n\n==Style level==\n* ShieldSymbolizers for POIs with names at high zooms (eg police station\n icon with name)\n*\/\n\n\/* only show from z15+ where area > 30,000 *\/\n#park-labels[zoom > 14][way_area > 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: #0e300e;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n text-opacity: 0.75;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\/* start showing on z16+ on area > 10,000 *\/\n#park-labels[zoom > 15][way_area >= 10000][way_area < 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: #0e300e;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n text-opacity: 0.75;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\/* show the rest from z17+ *\/\n#park-labels[zoom > 16][way_area < 10000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: #0e300e;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n text-opacity: 0.75;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n#building-label[zoom > 16] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: black;\n text-placement: interior;\n text-halo-fill: white;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n \n [zoom > 21] { text-size: 15; }\n [zoom = 21] { text-size: 14; }\n [zoom = 20] { text-size: 13; }\n [zoom = 19] { text-size: 12; }\n [zoom = 18] { text-size: 11; }\n [zoom = 17] { text-size: 10; }\n}","returncode":0,"stderr":"","license":"cc0-1.0","lang":"CartoCSS"} {"commit":"8d25179bfe5dbfc701b70bbe0315ee3f3ac7b28a","subject":"Fixed: Tuplet spans may not have been correctly added","message":"Fixed: Tuplet spans may not have been correctly added\n\nA variable name was missed during refactoring which means that a tupletspan element may not have been added to the output.\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n mobj = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"93127c2a77eddb4349392d378a1e3ef5d8944904","subject":"Fixed: Lyric symbols have dash connectors","message":"Fixed: Lyric symbols have dash connectors\n\nThis commit adds the dash connector to multi-syllable words.\n\nFixes #44\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportProcessors.mss","new_file":"src\/ExportProcessors.mss","new_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = sibmei2.GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = sibmei2.GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer) {\n \/\/$module(ExportProcessors.mss)\n ret = null;\n\n if (bobj.Duration < 256)\n {\n \/\/ if this object is an eighth note but is not beamed, and if the\n \/\/ active beam is set, null out the active beam and return null.\n if (bobj.Beam = NoBeam and layer._property:ActiveBeamId != null)\n {\n layer._property:ActiveBeamId = null;\n return ret;\n }\n\n \/*\n It's possible that Sibelius records a 'continue beam' at the start\n of a beamed group. Visually, this doesn't look out of place if the previous\n note was a quarter note or higher. \n \n The first check we do is if the note has a 'continue beam' attribute and\n the previous note has a duration higher than 256 (quarter) then we probably have\n a false negative (i.e., there is the start of a beam, but it isn't necessarily\n encoded correctly).\n *\/\n falseNegative = False;\n next_obj = bobj.NextItem(bobj.VoiceNumber, 'NoteRest');\n\n if ((bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam) and layer._property:ActiveBeamId = null)\n {\n \/\/ by all accounts this should be a beamed note, but we'll need to double-check.\n prev_obj = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n if (prev_obj != null and (prev_obj.Duration >= 256))\n {\n falseNegative = True;\n }\n }\n\n if (next_obj != null and (bobj.Beam = StartBeam or falseNegative = True) and next_obj.Beam = ContinueBeam)\n {\n \/\/ if:\n \/\/ - we're not at the end of the bar\n \/\/ - we have a start beam\n \/\/ - the next note is a continue beam\n beam = libmei.Beam();\n layer._property:ActiveBeamId = beam._id;\n\n \/\/ return the beam so that we can add it to the tree.\n ret = beam;\n }\n\n if (layer._property:ActiveBeamId != null and (bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam))\n {\n beamid = layer._property:ActiveBeamId;\n beam = libmei.getElementById(beamid);\n ret = beam;\n }\n }\n else\n {\n if (layer._property:ActiveBeamId != null)\n {\n \/\/ this is a break in any active beam, so register it as such.\n layer._property:ActiveBeamId = null;\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction ProcessTuplet (bobj, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.ParentTupletIfAny = null)\n {\n return null;\n }\n\n if (layer._property:ActiveTupletId = null)\n {\n tupletObject = bobj.ParentTupletIfAny;\n\n tuplet = libmei.Tuplet();\n\n layer._property:ActiveTupletObject = tupletObject;\n layer._property:ActiveTupletId = tuplet._id;\n\n if (libmei.GetName(meielement) = 'beam')\n {\n \/\/ get the first child\n startid = meielement.children[0];\n }\n else\n {\n startid = meielement._id;\n }\n\n libmei.AddAttribute(tuplet, 'startid', '#' & startid);\n libmei.AddAttribute(tuplet, 'num', tupletObject.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObject.Right);\n\n tupletStyle = tupletObject.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObject.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n return tuplet;\n }\n else\n {\n tid = layer._property:ActiveTupletId;\n t = libmei.getElementById(tid);\n\n if (IsLastNoteInTuplet(bobj))\n {\n libmei.AddAttribute(t, 'endid', '#' & meielement._id);\n layer._property:ActiveTupletObject = null;\n layer._property:ActiveTupletId = null;\n }\n\n return t;\n }\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet, layer) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n \n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it \n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n tupletSpan._property:AddedToMeasure = False;\n\n layer._property:ActiveTupletId = tupletSpan._id;\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (j = 0)\n {\n libmei.AddAttribute(sylel, 'wordpos', 'i'); \/\/ 'initial'\n\n if (lyric_word.Length > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n if (name = 'chord')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'chord'));\n }\n\n libmei.AddChild(obj, verse);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so \n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessSymbol (sobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureLines;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mlines = Self._property:MeasureLines;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mlines = Self._property:MeasureLines;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureLines;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureLines;\n mlines.Push(turn._id);\n }\n\n case ('242')\n {\n \/\/ triple staccato\n return null;\n }\n }\n} \/\/$end\n","old_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = sibmei2.GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = sibmei2.GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer) {\n \/\/$module(ExportProcessors.mss)\n ret = null;\n\n if (bobj.Duration < 256)\n {\n \/\/ if this object is an eighth note but is not beamed, and if the\n \/\/ active beam is set, null out the active beam and return null.\n if (bobj.Beam = NoBeam and layer._property:ActiveBeamId != null)\n {\n layer._property:ActiveBeamId = null;\n return ret;\n }\n\n \/*\n It's possible that Sibelius records a 'continue beam' at the start\n of a beamed group. Visually, this doesn't look out of place if the previous\n note was a quarter note or higher. \n \n The first check we do is if the note has a 'continue beam' attribute and\n the previous note has a duration higher than 256 (quarter) then we probably have\n a false negative (i.e., there is the start of a beam, but it isn't necessarily\n encoded correctly).\n *\/\n falseNegative = False;\n next_obj = bobj.NextItem(bobj.VoiceNumber, 'NoteRest');\n\n if ((bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam) and layer._property:ActiveBeamId = null)\n {\n \/\/ by all accounts this should be a beamed note, but we'll need to double-check.\n prev_obj = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n if (prev_obj != null and (prev_obj.Duration >= 256))\n {\n falseNegative = True;\n }\n }\n\n if (next_obj != null and (bobj.Beam = StartBeam or falseNegative = True) and next_obj.Beam = ContinueBeam)\n {\n \/\/ if:\n \/\/ - we're not at the end of the bar\n \/\/ - we have a start beam\n \/\/ - the next note is a continue beam\n beam = libmei.Beam();\n layer._property:ActiveBeamId = beam._id;\n\n \/\/ return the beam so that we can add it to the tree.\n ret = beam;\n }\n\n if (layer._property:ActiveBeamId != null and (bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam))\n {\n beamid = layer._property:ActiveBeamId;\n beam = libmei.getElementById(beamid);\n ret = beam;\n }\n }\n else\n {\n if (layer._property:ActiveBeamId != null)\n {\n \/\/ this is a break in any active beam, so register it as such.\n layer._property:ActiveBeamId = null;\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction ProcessTuplet (bobj, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.ParentTupletIfAny = null)\n {\n return null;\n }\n\n if (layer._property:ActiveTupletId = null)\n {\n tupletObject = bobj.ParentTupletIfAny;\n\n tuplet = libmei.Tuplet();\n\n layer._property:ActiveTupletObject = tupletObject;\n layer._property:ActiveTupletId = tuplet._id;\n\n if (libmei.GetName(meielement) = 'beam')\n {\n \/\/ get the first child\n startid = meielement.children[0];\n }\n else\n {\n startid = meielement._id;\n }\n\n libmei.AddAttribute(tuplet, 'startid', '#' & startid);\n libmei.AddAttribute(tuplet, 'num', tupletObject.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObject.Right);\n\n tupletStyle = tupletObject.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObject.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n return tuplet;\n }\n else\n {\n tid = layer._property:ActiveTupletId;\n t = libmei.getElementById(tid);\n\n if (IsLastNoteInTuplet(bobj))\n {\n libmei.AddAttribute(t, 'endid', '#' & meielement._id);\n layer._property:ActiveTupletObject = null;\n layer._property:ActiveTupletId = null;\n }\n\n return t;\n }\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet, layer) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n \n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it \n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n tupletSpan._property:AddedToMeasure = False;\n\n layer._property:ActiveTupletId = tupletSpan._id;\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (j = 0)\n {\n libmei.AddAttribute(sylel, 'wordpos', 'i'); \/\/ 'initial'\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n if (name = 'chord')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'chord'));\n }\n\n libmei.AddChild(obj, verse);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so \n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessSymbol (sobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureLines;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mlines = Self._property:MeasureLines;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mlines = Self._property:MeasureLines;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureLines;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureLines;\n mlines.Push(turn._id);\n }\n\n case ('242')\n {\n \/\/ triple staccato\n return null;\n }\n }\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"75903a9b8ac44dbac128884e776dc3707bc3342e","subject":"Added start and end offset for lines","message":"Added start and end offset for lines\n\nLine objects can have a right hand offset as well. Added @startvo\/@startho and @endvo\/@endho for lines and generate @ho and @vo only if the object is not a Line.","repos":"music-encoding\/sibmei","old_file":"src\/Utilities.mss","new_file":"src\/Utilities.mss","new_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in\n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/*\n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction LayerHash (barInfo, voiceInfo) {\n \/\/$module(Utilities.mss)\n \/\/ `barInfo` is either a bar number or a `Bar` object.\n \/\/ `voiceInfo` is either a voice number or a `BarObject` from which the\n \/\/ `VoiceNumber` info would be used.\n \/\/ At least one of the two arguments must be an object.\n \/\/\n \/\/ Calculates a numeric identifier from the implied bar number, voice number\n \/\/ and staff number.\n \/\/ `barInfo` is needed because we might either want the hash of the layer an\n \/\/ objects starts in, or the hash of the layer it ends in (where we'd supply\n \/\/ bobj.EndBarNumber).\n \/\/\n \/\/ We call the generated number 'Layer'Hash because it is unique to each\n \/\/ MEI `` element that will aggregate all elements originating from a\n \/\/ specific staff, bar and voice.\n\n staff = null;\n if (IsObject(voiceInfo))\n {\n voiceNumber = voiceInfo.VoiceNumber;\n staff = voiceInfo.ParentBar.ParentStaff;\n }\n else\n {\n voiceNumber = voiceInfo;\n }\n\n if (IsObject(barInfo))\n {\n barNumber = barInfo.BarNumber;\n staff = barInfo.ParentStaff;\n }\n else\n {\n barNumber = barInfo;\n }\n if (staff = null) {\n Trace('At least one of the arguments to LayerHash() must be an object');\n ExitPlugin();\n }\n\n hash = staff.StaffNum;\n \/\/ For each addition, we multiply by the maximum value to make enough space\n \/\/ in the 'lower digits' so that the hash actually is unique and we could\n \/\/ in principle invert the calculation.\n hash = (staff.BarCount + 1) * hash + barNumber;\n hash = 5 * hash + voiceNumber;\n return hash;\n} \/\/$end\n\nfunction PushToHashedLayer (hashedLayers, bar, bobj) {\n \/\/$module(Utilities.mss)\n \/\/ hashedLayers is a SparseArray where indices are hashes for layers\n \/\/ calculated by LayerHash(). Under each hash, there is a SparseArray where\n \/\/ objects associated with the layer can be added by this function.\n \/\/ Argument `bar` can be either a bar number or a Bar object.\n hash = LayerHash(bar, bobj);\n layerArray = hashedLayers[hash];\n if (layerArray = null)\n {\n layerArray = CreateSparseArray();\n hashedLayers[hash] = layerArray;\n }\n layerArray.Push(bobj);\n} \/\/$end\n\nfunction GetNoteObjectAtEndPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a bar object, and returns the NoteRest object closest to the end position.\n \/\/ If one isn't found exactly at the end position, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n \/\/ NB: This will probably only work for line objects, since they are the only ones with the EndPosition attribute.\n \/\/ Returns the MEI element closest to that position.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n \/\/ bar_num = bobj.ParentBar.BarNumber;\n bar_num = bobj.EndBarNumber;\n Log('bar_num: ' & bar_num);\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n if (barObjectPositions = null) {\n \/\/ TODO: We have a line that continues into a 'future' bar. Track these\n \/\/ lines and add IDs when we've reached the end NoteRest and know its ID\n return null;\n }\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions = null)\n {\n \/\/ theres not much we can do here. Bail.\n Log('Bailing due to insufficient voice information');\n return null;\n }\n\n if (voiceObjectPositions.PropertyExists(bobj.EndPosition))\n {\n obj_id = voiceObjectPositions[bobj.EndPosition];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a bar object, and returns the NoteRest object closest to its position.\n \/\/ If one isn't found exactly at the end position, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions = null)\n {\n \/\/ theres not much we can do here. Bail.\n Log('Bailing due to insufficient voice information');\n return null;\n }\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (tstamps, etc.) to an element.\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Bar object'));\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bar));\n\n switch (bobj.Type)\n {\n case('SymbolItem')\n {\n start_obj = GetNoteObjectAtPosition(bobj);\n if (start_obj != null)\n {\n libmei.AddAttribute(element, 'startid', '#' & start_obj._id);\n }\n }\n case('NoteRest')\n {\n start_obj = GetNoteObjectAtPosition(bobj);\n if (start_obj != null)\n {\n libmei.AddAttribute(element, 'startid', '#' & start_obj._id);\n }\n }\n case('ArpeggioLine')\n {\n start_obj = GetNoteObjectAtPosition(bobj);\n if (start_obj != null)\n {\n libmei.AddAttribute(element, 'startid', '#' & start_obj._id);\n }\n }\n \/\/ at default add tstamp2 and try to find startid and endid\n default\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n start_obj = GetNoteObjectAtPosition(bobj);\n end_obj = GetNoteObjectAtEndPosition(bobj);\n if (start_obj != null)\n {\n libmei.AddAttribute(element, 'startid', '#' & start_obj._id);\n }\n\n if (end_obj != null)\n {\n libmei.AddAttribute(element, 'endid', '#' & end_obj._id);\n }\n }\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n if (bobj.Duration > 0)\n {\n libmei.AddAttribute(element, 'dur.ppq', bobj.Duration);\n }\n\n \/\/ lines have a left hand and a right hand offset\n \/\/ left hand offset\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'startho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'startvo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n \/\/ right hand offset\n if (bobj.RhDx > 0)\n {\n libmei.AddAttribute(element, 'endho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n if (bobj.RhDy > 0)\n {\n libmei.AddAttribute(element, 'endvo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n }\n else\n {\n \/\/ other types only have a left hand offset\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n }\n\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction GetTupletStack (bobj) {\n \/\/$module(Utilities.mss)\n tupletStack = CreateSparseArray();\n parentTuplet = bobj.ParentTupletIfAny;\n while (parentTuplet != null)\n {\n tupletStack.Push(parentTuplet);\n parentTuplet = parentTuplet.ParentTupletIfAny;\n }\n tupletStack.Reverse();\n return tupletStack;\n} \/\/$end\n\nfunction CountTupletsEndingAtNoteRest(noteRest) {\n \/\/$module(Utilities.mss)\n tuplet = noteRest.ParentTupletIfAny;\n\n if (tuplet = null)\n {\n return 0;\n }\n\n nextNoteRest = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n\n if (nextNoteRest = null or nextNoteRest.ParentTupletIfAny = null)\n {\n tupletStack = GetTupletStack(noteRest);\n return tupletStack.Length;\n }\n\n if (TupletsEqual(tuplet, nextNoteRest.ParentTupletIfAny))\n {\n return 0;\n }\n\n tupletStack = GetTupletStack(noteRest);\n nextTupletStack = GetTupletStack(nextNoteRest);\n\n \/\/ We are looking for the highest index where both stacks are identical.\n index = utils.min(tupletStack.Length, nextTupletStack.Length) - 1;\n\n while (index >= 0 and not(TupletsEqual(tupletStack[index], nextTupletStack[index])))\n {\n index = index - 1;\n }\n\n return tupletStack.Length - 1 - index;\n} \/\/$end\n\nfunction GetMeiTupletDepth (layer) {\n \/\/$module(Utilities.mss)\n depth = 0;\n tuplet = layer._property:ActiveMeiTuplet;\n while (tuplet != null)\n {\n depth = depth + 1;\n tuplet = tuplet._property:ParentTuplet;\n }\n return depth;\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n Sibelius.AppendLineToFile(Self._property:Logfile, message, True);\n} \/\/$end\n\nfunction NormalizedBeamProp (noteRest) {\n \/\/$module(Utilities.mss)\n \/*\n Sibelius' Beam properties can't be trusted. We need to look at the context,\n check whether they make sense and if they don't, find out the value we'd expect.\n Problems can e.g. be that Sibelius reports\n * a ContinueBeam at the start of a beam (we'd expect StartBeam)\n * a property other than NoBeam on a quarter or longer un-beamable duration\n (we'd expect NoBeam)\n * ... (almost any combinations imaginable)\n *\/\n if (noteRest.Beam = NoBeam or noteRest.Duration >= 256)\n {\n return NoBeam;\n }\n\n \/\/ At this point, we're only dealing with ContinueBeam and SingleBeam.\n \/\/ We need to look at the preceding note to see whether there's any\n \/\/ beam to continue.\n\n if (noteRest.Beam != StartBeam)\n {\n prev_obj = PrevNormalOrGrace(noteRest, noteRest.GraceNote);\n\n if (prev_obj != null and prev_obj.Beam != NoBeam and prev_obj.Duration < 256)\n {\n \/\/ We actually have a beam we can continue.\n if (noteRest.Beam = SingleBeam and noteRest.Duration < 128 and prev_obj.Duration < 128)\n {\n \/\/ SingleBeam only makes sense if we actually have secondary beams between the\n \/\/ previous note and the current note.\n return SingleBeam;\n }\n return ContinueBeam;\n }\n }\n\n \/\/ At this point, we know there is no previous beam we can continue because we have a\n \/\/ StartBeam or the above test for a previous beam failed.\n \/\/ We still need to check whether there is a following note that we can beam to.\n\n next_obj = NextNormalOrGrace(noteRest, noteRest.GraceNote);\n if (next_obj != null and next_obj.Duration < 256 and (next_obj.Beam = ContinueBeam or next_obj.Beam = SingleBeam))\n {\n return StartBeam;\n }\n else\n {\n return NoBeam;\n }\n} \/\/$end\n\nfunction NextNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n When given a 'normal' NoteRest, this function returns the next 'normal' NoteRest\n in the same voice.\n When given a grace NoteRest, this function returns the immediately adjacent\n following grace NoteRest, if existant.\n This function is basically a duplicate of PrevNormalOrGrace() with\n 'Previous' replaced by 'Next'.\n *\/\n next_obj = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (next_obj != null and not(next_obj.GraceNote))\n {\n next_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (next_obj != null and next_obj.GraceNote)\n {\n next_obj = next_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return next_obj;\n} \/\/$end\n\nfunction PrevNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n For a description, see NextNormalOrGrace().\n This function is basically a duplicate of PrevNormalOrGrace() with\n 'Next' replaced by 'Previous'.\n *\/\n prev_obj = noteRest.PreviousItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (prev_obj != null and not(prev_obj.GraceNote))\n {\n prev_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (prev_obj and prev_obj.GraceNote)\n {\n prev_obj = prev_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return prev_obj;\n} \/\/$end\n\nfunction GetNongraceParentBeam (noteRest, layer) {\n \/\/$module(Utilities.mss)\n \/*\n This function is used to find out whether a non-grace beam spans over a grace\n NoteRest that is either unbeamed or at the start of a grace beam.\n *\/\n if (layer._property:ActiveBeam != null)\n {\n \/\/ Only if the active non-grace beam continues to the next normal note, the\n \/\/ grace note is truly placed under the non-grace beam.\n nextNongraceNoteRest = NextNormalOrGrace(noteRest, false);\n if (nextNongraceNoteRest != null)\n {\n nextNormalBeamProp = NormalizedBeamProp(nextNongraceNoteRest);\n }\n else\n {\n nextNormalBeamProp = NoBeam;\n }\n if (nextNormalBeamProp = ContinueBeam or nextNormalBeamProp = SingleBeam)\n {\n return layer._property:ActiveBeam;\n }\n }\n return null;\n} \/\/$end\n\nfunction GetTempDir () {\n \/\/$module(Utilities.mss)\n if (Sibelius.PathSeparator = '\/')\n {\n tempFolder = '\/tmp\/';\n }\n else\n {\n appDataFolder = Sibelius.GetUserApplicationDataFolder();\n \/\/ appDataFolder usually looks like C:\\Users\\{username}\\AppData\\Roaming\\\n \/\/ We strip the trailing bit until the second to last backslash\n i = Length(appDataFolder) - 2;\n while (i >= 0 and CharAt(appDataFolder, i) != '\\\\')\n {\n i = i - 1;\n }\n \/\/ tempFolder usually looks like C:\\Users\\USERNAME\\AppData\\Local\\Temp\\\n \/\/ So we replace the trailing 'Roaming' with 'Local\\Temp'\n tempFolder = Substring(appDataFolder, 0, i) & '\\\\Local\\\\Temp\\\\';\n }\n if (Sibelius.FolderExists(tempFolder))\n {\n return tempFolder;\n }\n} \/\/$end\n\nfunction InitFigbassCharMap () {\n \/\/$module(Utilities.mss)\n map = CreateDictionary(\n '\u00a7', '\u266e',\n '#', '\u266f',\n '!', '\u266d',\n '?', '\ud834\udd2a',\n '%', '\ud834\udd2b',\n 'a', '(2)',\n 'i', '[2]',\n 'w', '2\u266e',\n 's', '2\u266f',\n 'x', '2\u266d',\n 'W', '\u266e2',\n 'S', '\u266f2',\n 'X', '\u266d2',\n 'k', '2+',\n 'p', '(3)',\n 'q', '[3]',\n 'e', '3\u266e',\n 'd', '3\u266f',\n 'c', '3\u266d',\n 'E', '\u266e3',\n 'D', '\u266f3',\n 'C', '\u266d3',\n 'z', '3+',\n 'A', '(4)',\n 'I', '[4]',\n 'r', '4\u266e',\n 'f', '4\u266f',\n 'v', '4\u266d',\n 'R', '\u266e4',\n 'F', '\u266f4',\n 'V', '\u266d4',\n 'K', '4+',\n 'P', '(5)',\n 'Q', '[5]',\n 't', '5\u266e',\n 'g', '5\u266f',\n 'b', '5\u266d',\n 'T', '\u266e5',\n 'G', '\u266f5',\n 'B', '\u266d5',\n 'Z', '5+',\n '$', '(6)',\n '\u00a8', '[6]',\n 'y', '6\u266e',\n 'h', '6\u266f',\n 'n', '6\u266d',\n 'Y', '\u266e6',\n 'H', '\u266f6',\n 'N', '\u266d6',\n ',', '6+',\n '\u00c2', '(7)',\n ';', '[7]',\n 'u', '7\u266e',\n 'j', '7\u266f',\n 'm', '7\u266d',\n 'U', '\u266e7',\n 'J', '\u266f7',\n 'M', '\u266d7',\n '<', '7+',\n '>', '+7',\n '=', '(8)',\n '\u00d6', '[8]',\n '\u00c0', '(9)',\n '{', '[9]',\n 'o', '9\u266e',\n 'l', '9\u266f',\n '\u00eb', '9\u266d',\n 'O', '\u266e9',\n 'L', '\u266f9',\n ':', '\u266d9',\n '}', '9+',\n '\u00c5', '|',\n '\u00fc', '_',\n '\u00a9', CreateSparseArray('2\u266f', 'U+EA53', 'figbass2Raised' ), \/\/ 2 with slashed foot\n '\u00c4', CreateSparseArray('4\u266f', 'U+EA56', 'figbass4Raised' ), \/\/ 4 with slashed horizontal line\n '\u00cb', CreateSparseArray('5\u266f', 'U+EA58', 'figbass5Raised1'), \/\/ 5 with straight slash through head\n '\u00cf', CreateSparseArray('5\u266f', 'U+EA59', 'figbass5Raised2'), \/\/ 5 with angled slash through head\n '\u00ef', CreateSparseArray('5\u266f', 'U+EA5A', 'figbass5Raised3'), \/\/ 5 with slashed foot\n '\u00b4', CreateSparseArray('6\u266f', 'U+EA6F', 'figbass6Raised' ), \/\/ 6 with slashed head\n '\u00e4', CreateSparseArray('7\u266f', 'U+EA5E', 'figbass7Raised1'), \/\/ 7 with slashed head\n '&', CreateSparseArray('7\u266f', 'U+EA5F', 'figbass8Raised2'), \/\/ 7 with slashed stem\n \/\/ (Sibelius\/Opus and SMuFL\/Bravura don't match 100% for the slashed 9:\n \/\/ Opus slashes the stem, Bravura the head)\n '\u00f6', CreateSparseArray('9#', 'U+EA62', 'figbass9Raised') \/\/ slashed 9\n );\n literalChars = '0123456789[]_-+.';\n for i = 0 to Length(literalChars)\n {\n char = CharAt(literalChars, i);\n map[char] = char;\n }\n\n return map;\n} \/\/$end\n","old_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in\n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/*\n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction LayerHash (barInfo, voiceInfo) {\n \/\/$module(Utilities.mss)\n \/\/ `barInfo` is either a bar number or a `Bar` object.\n \/\/ `voiceInfo` is either a voice number or a `BarObject` from which the\n \/\/ `VoiceNumber` info would be used.\n \/\/ At least one of the two arguments must be an object.\n \/\/\n \/\/ Calculates a numeric identifier from the implied bar number, voice number\n \/\/ and staff number.\n \/\/ `barInfo` is needed because we might either want the hash of the layer an\n \/\/ objects starts in, or the hash of the layer it ends in (where we'd supply\n \/\/ bobj.EndBarNumber).\n \/\/\n \/\/ We call the generated number 'Layer'Hash because it is unique to each\n \/\/ MEI `` element that will aggregate all elements originating from a\n \/\/ specific staff, bar and voice.\n\n staff = null;\n if (IsObject(voiceInfo))\n {\n voiceNumber = voiceInfo.VoiceNumber;\n staff = voiceInfo.ParentBar.ParentStaff;\n }\n else\n {\n voiceNumber = voiceInfo;\n }\n\n if (IsObject(barInfo))\n {\n barNumber = barInfo.BarNumber;\n staff = barInfo.ParentStaff;\n }\n else\n {\n barNumber = barInfo;\n }\n if (staff = null) {\n Trace('At least one of the arguments to LayerHash() must be an object');\n ExitPlugin();\n }\n\n hash = staff.StaffNum;\n \/\/ For each addition, we multiply by the maximum value to make enough space\n \/\/ in the 'lower digits' so that the hash actually is unique and we could\n \/\/ in principle invert the calculation.\n hash = (staff.BarCount + 1) * hash + barNumber;\n hash = 5 * hash + voiceNumber;\n return hash;\n} \/\/$end\n\nfunction PushToHashedLayer (hashedLayers, bar, bobj) {\n \/\/$module(Utilities.mss)\n \/\/ hashedLayers is a SparseArray where indices are hashes for layers\n \/\/ calculated by LayerHash(). Under each hash, there is a SparseArray where\n \/\/ objects associated with the layer can be added by this function.\n \/\/ Argument `bar` can be either a bar number or a Bar object.\n hash = LayerHash(bar, bobj);\n layerArray = hashedLayers[hash];\n if (layerArray = null)\n {\n layerArray = CreateSparseArray();\n hashedLayers[hash] = layerArray;\n }\n layerArray.Push(bobj);\n} \/\/$end\n\nfunction GetNoteObjectAtEndPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a bar object, and returns the NoteRest object closest to the end position.\n \/\/ If one isn't found exactly at the end position, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n \/\/ NB: This will probably only work for line objects, since they are the only ones with the EndPosition attribute.\n \/\/ Returns the MEI element closest to that position.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n \/\/ bar_num = bobj.ParentBar.BarNumber;\n bar_num = bobj.EndBarNumber;\n Log('bar_num: ' & bar_num);\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n if (barObjectPositions = null) {\n \/\/ TODO: We have a line that continues into a 'future' bar. Track these\n \/\/ lines and add IDs when we've reached the end NoteRest and know its ID\n return null;\n }\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions = null)\n {\n \/\/ theres not much we can do here. Bail.\n Log('Bailing due to insufficient voice information');\n return null;\n }\n\n if (voiceObjectPositions.PropertyExists(bobj.EndPosition))\n {\n obj_id = voiceObjectPositions[bobj.EndPosition];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a bar object, and returns the NoteRest object closest to its position.\n \/\/ If one isn't found exactly at the end position, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions = null)\n {\n \/\/ theres not much we can do here. Bail.\n Log('Bailing due to insufficient voice information');\n return null;\n }\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (tstamps, etc.) to an element.\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Bar object'));\n }\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n if (bobj.Duration > 0)\n {\n libmei.AddAttribute(element, 'dur.ppq', bobj.Duration);\n }\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bar));\n\n switch (bobj.Type)\n {\n case('SymbolItem')\n {\n start_obj = GetNoteObjectAtPosition(bobj);\n if (start_obj != null)\n {\n libmei.AddAttribute(element, 'startid', '#' & start_obj._id);\n }\n }\n case('NoteRest')\n {\n start_obj = GetNoteObjectAtPosition(bobj);\n if (start_obj != null)\n {\n libmei.AddAttribute(element, 'startid', '#' & start_obj._id);\n }\n }\n case('ArpeggioLine')\n {\n start_obj = GetNoteObjectAtPosition(bobj);\n if (start_obj != null)\n {\n libmei.AddAttribute(element, 'startid', '#' & start_obj._id);\n }\n }\n \/\/ at default add tstamp2 and try to find startid and endid\n default\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n start_obj = GetNoteObjectAtPosition(bobj);\n end_obj = GetNoteObjectAtEndPosition(bobj);\n if (start_obj != null)\n {\n libmei.AddAttribute(element, 'startid', '#' & start_obj._id);\n }\n\n if (end_obj != null)\n {\n libmei.AddAttribute(element, 'endid', '#' & end_obj._id);\n }\n }\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction GetTupletStack (bobj) {\n \/\/$module(Utilities.mss)\n tupletStack = CreateSparseArray();\n parentTuplet = bobj.ParentTupletIfAny;\n while (parentTuplet != null)\n {\n tupletStack.Push(parentTuplet);\n parentTuplet = parentTuplet.ParentTupletIfAny;\n }\n tupletStack.Reverse();\n return tupletStack;\n} \/\/$end\n\nfunction CountTupletsEndingAtNoteRest(noteRest) {\n \/\/$module(Utilities.mss)\n tuplet = noteRest.ParentTupletIfAny;\n\n if (tuplet = null)\n {\n return 0;\n }\n\n nextNoteRest = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n\n if (nextNoteRest = null or nextNoteRest.ParentTupletIfAny = null)\n {\n tupletStack = GetTupletStack(noteRest);\n return tupletStack.Length;\n }\n\n if (TupletsEqual(tuplet, nextNoteRest.ParentTupletIfAny))\n {\n return 0;\n }\n\n tupletStack = GetTupletStack(noteRest);\n nextTupletStack = GetTupletStack(nextNoteRest);\n\n \/\/ We are looking for the highest index where both stacks are identical.\n index = utils.min(tupletStack.Length, nextTupletStack.Length) - 1;\n\n while (index >= 0 and not(TupletsEqual(tupletStack[index], nextTupletStack[index])))\n {\n index = index - 1;\n }\n\n return tupletStack.Length - 1 - index;\n} \/\/$end\n\nfunction GetMeiTupletDepth (layer) {\n \/\/$module(Utilities.mss)\n depth = 0;\n tuplet = layer._property:ActiveMeiTuplet;\n while (tuplet != null)\n {\n depth = depth + 1;\n tuplet = tuplet._property:ParentTuplet;\n }\n return depth;\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n Sibelius.AppendLineToFile(Self._property:Logfile, message, True);\n} \/\/$end\n\nfunction NormalizedBeamProp (noteRest) {\n \/\/$module(Utilities.mss)\n \/*\n Sibelius' Beam properties can't be trusted. We need to look at the context,\n check whether they make sense and if they don't, find out the value we'd expect.\n Problems can e.g. be that Sibelius reports\n * a ContinueBeam at the start of a beam (we'd expect StartBeam)\n * a property other than NoBeam on a quarter or longer un-beamable duration\n (we'd expect NoBeam)\n * ... (almost any combinations imaginable)\n *\/\n if (noteRest.Beam = NoBeam or noteRest.Duration >= 256)\n {\n return NoBeam;\n }\n\n \/\/ At this point, we're only dealing with ContinueBeam and SingleBeam.\n \/\/ We need to look at the preceding note to see whether there's any\n \/\/ beam to continue.\n\n if (noteRest.Beam != StartBeam)\n {\n prev_obj = PrevNormalOrGrace(noteRest, noteRest.GraceNote);\n\n if (prev_obj != null and prev_obj.Beam != NoBeam and prev_obj.Duration < 256)\n {\n \/\/ We actually have a beam we can continue.\n if (noteRest.Beam = SingleBeam and noteRest.Duration < 128 and prev_obj.Duration < 128)\n {\n \/\/ SingleBeam only makes sense if we actually have secondary beams between the\n \/\/ previous note and the current note.\n return SingleBeam;\n }\n return ContinueBeam;\n }\n }\n\n \/\/ At this point, we know there is no previous beam we can continue because we have a\n \/\/ StartBeam or the above test for a previous beam failed.\n \/\/ We still need to check whether there is a following note that we can beam to.\n\n next_obj = NextNormalOrGrace(noteRest, noteRest.GraceNote);\n if (next_obj != null and next_obj.Duration < 256 and (next_obj.Beam = ContinueBeam or next_obj.Beam = SingleBeam))\n {\n return StartBeam;\n }\n else\n {\n return NoBeam;\n }\n} \/\/$end\n\nfunction NextNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n When given a 'normal' NoteRest, this function returns the next 'normal' NoteRest\n in the same voice.\n When given a grace NoteRest, this function returns the immediately adjacent\n following grace NoteRest, if existant.\n This function is basically a duplicate of PrevNormalOrGrace() with\n 'Previous' replaced by 'Next'.\n *\/\n next_obj = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (next_obj != null and not(next_obj.GraceNote))\n {\n next_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (next_obj != null and next_obj.GraceNote)\n {\n next_obj = next_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return next_obj;\n} \/\/$end\n\nfunction PrevNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n For a description, see NextNormalOrGrace().\n This function is basically a duplicate of PrevNormalOrGrace() with\n 'Next' replaced by 'Previous'.\n *\/\n prev_obj = noteRest.PreviousItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (prev_obj != null and not(prev_obj.GraceNote))\n {\n prev_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (prev_obj and prev_obj.GraceNote)\n {\n prev_obj = prev_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return prev_obj;\n} \/\/$end\n\nfunction GetNongraceParentBeam (noteRest, layer) {\n \/\/$module(Utilities.mss)\n \/*\n This function is used to find out whether a non-grace beam spans over a grace\n NoteRest that is either unbeamed or at the start of a grace beam.\n *\/\n if (layer._property:ActiveBeam != null)\n {\n \/\/ Only if the active non-grace beam continues to the next normal note, the\n \/\/ grace note is truly placed under the non-grace beam.\n nextNongraceNoteRest = NextNormalOrGrace(noteRest, false);\n if (nextNongraceNoteRest != null)\n {\n nextNormalBeamProp = NormalizedBeamProp(nextNongraceNoteRest);\n }\n else\n {\n nextNormalBeamProp = NoBeam;\n }\n if (nextNormalBeamProp = ContinueBeam or nextNormalBeamProp = SingleBeam)\n {\n return layer._property:ActiveBeam;\n }\n }\n return null;\n} \/\/$end\n\nfunction GetTempDir () {\n \/\/$module(Utilities.mss)\n if (Sibelius.PathSeparator = '\/')\n {\n tempFolder = '\/tmp\/';\n }\n else\n {\n appDataFolder = Sibelius.GetUserApplicationDataFolder();\n \/\/ appDataFolder usually looks like C:\\Users\\{username}\\AppData\\Roaming\\\n \/\/ We strip the trailing bit until the second to last backslash\n i = Length(appDataFolder) - 2;\n while (i >= 0 and CharAt(appDataFolder, i) != '\\\\')\n {\n i = i - 1;\n }\n \/\/ tempFolder usually looks like C:\\Users\\USERNAME\\AppData\\Local\\Temp\\\n \/\/ So we replace the trailing 'Roaming' with 'Local\\Temp'\n tempFolder = Substring(appDataFolder, 0, i) & '\\\\Local\\\\Temp\\\\';\n }\n if (Sibelius.FolderExists(tempFolder))\n {\n return tempFolder;\n }\n} \/\/$end\n\nfunction InitFigbassCharMap () {\n \/\/$module(Utilities.mss)\n map = CreateDictionary(\n '\u00a7', '\u266e',\n '#', '\u266f',\n '!', '\u266d',\n '?', '\ud834\udd2a',\n '%', '\ud834\udd2b',\n 'a', '(2)',\n 'i', '[2]',\n 'w', '2\u266e',\n 's', '2\u266f',\n 'x', '2\u266d',\n 'W', '\u266e2',\n 'S', '\u266f2',\n 'X', '\u266d2',\n 'k', '2+',\n 'p', '(3)',\n 'q', '[3]',\n 'e', '3\u266e',\n 'd', '3\u266f',\n 'c', '3\u266d',\n 'E', '\u266e3',\n 'D', '\u266f3',\n 'C', '\u266d3',\n 'z', '3+',\n 'A', '(4)',\n 'I', '[4]',\n 'r', '4\u266e',\n 'f', '4\u266f',\n 'v', '4\u266d',\n 'R', '\u266e4',\n 'F', '\u266f4',\n 'V', '\u266d4',\n 'K', '4+',\n 'P', '(5)',\n 'Q', '[5]',\n 't', '5\u266e',\n 'g', '5\u266f',\n 'b', '5\u266d',\n 'T', '\u266e5',\n 'G', '\u266f5',\n 'B', '\u266d5',\n 'Z', '5+',\n '$', '(6)',\n '\u00a8', '[6]',\n 'y', '6\u266e',\n 'h', '6\u266f',\n 'n', '6\u266d',\n 'Y', '\u266e6',\n 'H', '\u266f6',\n 'N', '\u266d6',\n ',', '6+',\n '\u00c2', '(7)',\n ';', '[7]',\n 'u', '7\u266e',\n 'j', '7\u266f',\n 'm', '7\u266d',\n 'U', '\u266e7',\n 'J', '\u266f7',\n 'M', '\u266d7',\n '<', '7+',\n '>', '+7',\n '=', '(8)',\n '\u00d6', '[8]',\n '\u00c0', '(9)',\n '{', '[9]',\n 'o', '9\u266e',\n 'l', '9\u266f',\n '\u00eb', '9\u266d',\n 'O', '\u266e9',\n 'L', '\u266f9',\n ':', '\u266d9',\n '}', '9+',\n '\u00c5', '|',\n '\u00fc', '_',\n '\u00a9', CreateSparseArray('2\u266f', 'U+EA53', 'figbass2Raised' ), \/\/ 2 with slashed foot\n '\u00c4', CreateSparseArray('4\u266f', 'U+EA56', 'figbass4Raised' ), \/\/ 4 with slashed horizontal line\n '\u00cb', CreateSparseArray('5\u266f', 'U+EA58', 'figbass5Raised1'), \/\/ 5 with straight slash through head\n '\u00cf', CreateSparseArray('5\u266f', 'U+EA59', 'figbass5Raised2'), \/\/ 5 with angled slash through head\n '\u00ef', CreateSparseArray('5\u266f', 'U+EA5A', 'figbass5Raised3'), \/\/ 5 with slashed foot\n '\u00b4', CreateSparseArray('6\u266f', 'U+EA6F', 'figbass6Raised' ), \/\/ 6 with slashed head\n '\u00e4', CreateSparseArray('7\u266f', 'U+EA5E', 'figbass7Raised1'), \/\/ 7 with slashed head\n '&', CreateSparseArray('7\u266f', 'U+EA5F', 'figbass8Raised2'), \/\/ 7 with slashed stem\n \/\/ (Sibelius\/Opus and SMuFL\/Bravura don't match 100% for the slashed 9:\n \/\/ Opus slashes the stem, Bravura the head)\n '\u00f6', CreateSparseArray('9#', 'U+EA62', 'figbass9Raised') \/\/ slashed 9\n );\n literalChars = '0123456789[]_-+.';\n for i = 0 to Length(literalChars)\n {\n char = CharAt(literalChars, i);\n map[char] = char;\n }\n\n return map;\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"ebc91d420854cff0db2502814a23dcd48c7c5df1","subject":"railway tweaks","message":"railway tweaks\n","repos":"andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto","old_file":"osmt\/railway.mss","new_file":"osmt\/railway.mss","new_contents":"\/* rail *\/\n\n#railway-line[railway='rail'][zoom > 11] {\n line-opacity: 0.5;\n line-color: #AAAAAA;\n\n [zoom > 17] { line-width: 5; }\n [zoom = 17] { line-width: 3; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 2; }\n [zoom = 14] { line-width: 2; line-opacity: 0.9 }\n [zoom = 13] { line-width: 2; line-opacity: 0.9 }\n [zoom = 12] { line-width: 1; line-opacity: 0.9 }\n\n \/* the dotted part *\/\n ::track{\n line-opacity: 0.75;\n line-color: #000000;\n line-cap: butt;\n line-dasharray: 3,4;\n\n [zoom > 17] { line-width: 5; }\n [zoom = 17] { line-width: 3; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 2; }\n [zoom = 14] { line-width: 2; }\n [zoom = 13] { line-width: 2; }\n [zoom = 12] { line-width: 1; }\n }\n}\n\n#railway-station {\n ::label[zoom > 14]{\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-halo-fill: white;\n text-halo-radius: 1.5;\n text-opacity: 0.9;\n\n [zoom > 16] { text-dy: -15; }\n [zoom = 16] { text-dy: -10; }\n [zoom = 15] { text-dy: -8; }\n [zoom = 14] { text-dy: -6; }\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 14; }\n [zoom = 17] { text-size: 13; }\n [zoom = 16] { text-size: 12; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n }\n\n ::icon[zoom > 12]{\n point-allow-overlap: true; \/* always show the icon *\/\n\n [zoom > 16] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/train_station.glow.AC39AC.24.png');\n }\n [zoom = 16] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/train_station.glow.AC39AC.20.png');\n }\n [zoom = 15] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/train_station.glow.AC39AC.16.png');\n }\n [zoom = 14],[zoom = 13] {\n point-file: url('\/usr\/share\/icons\/osmt\/station-dot.png');\n }\n }\n}\n","old_contents":"\/* rail *\/\n\n#railway-line[railway='rail'][zoom > 11] {\n line-opacity: 0.5;\n line-color: #AAAAAA;\n\n [zoom > 17] { line-width: 5; }\n [zoom = 17] { line-width: 3; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 2; }\n [zoom = 14] { line-width: 2; line-opacity: 0.9 }\n [zoom = 13] { line-width: 2; line-opacity: 0.9 }\n [zoom = 12] { line-width: 1; line-opacity: 0.9 }\n\n \/* the dotted part *\/\n ::track{\n line-opacity: 0.75;\n line-color: #000000;\n line-cap: butt;\n line-dasharray: 3,4;\n\n [zoom > 17] { line-width: 5; }\n [zoom = 17] { line-width: 3; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 2; }\n [zoom = 14] { line-width: 2; }\n [zoom = 13] { line-width: 2; }\n [zoom = 12] { line-width: 1; }\n }\n}\n\n#railway-station {\n ::label[zoom > 13]{\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-allow-overlap: true;\n text-halo-fill: white;\n text-halo-radius: 1.0;\n\n [zoom > 16] { text-dy: -15; }\n [zoom = 16] { text-dy: -10; }\n [zoom = 15] { text-dy: -8; }\n [zoom = 14] { text-dy: -6; }\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n }\n\n ::dot[zoom > 12]{\n point-allow-overlap: true;\n\n [zoom > 16] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/train_station.glow.AC39AC.24.png');\n }\n [zoom = 16] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/train_station.glow.AC39AC.20.png');\n }\n [zoom = 15] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/train_station.glow.AC39AC.16.png');\n }\n [zoom = 14],[zoom = 13] {\n point-file: url('\/usr\/share\/icons\/osmt\/station-dot.png');\n point-opacity: 0.75;\n }\n }\n}\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"CartoCSS"} {"commit":"9cf52583b5c4f3d1ab5a3332d5d71caff382bf30","subject":"Changing halo for texts","message":"Changing halo for texts\n","repos":"jeffaudi\/osm-hybrid","old_file":"osm-hybrid\/palette.mss","new_file":"osm-hybrid\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM HYBRID for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_lt_italic: \"Open Sans Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \t\"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans: \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_italic: \"Open Sans Semibold Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \t\"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold: \"Open Sans Bold\", \"DejaVu Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\",\n\t\t\t\t\t\"Mallige Bold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold_italic: \"Open Sans Bold Italic\", \"DejaVu Sans Bold Italic\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\",\n\t\t\t\t\t\"TSCu_Paranar Bold\", \"Mallige Bold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #FCFBE7;\n@water: #C4DFF6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #DAF2C1;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n@building: #E4E0E0;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #E65C5C;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #E68A5C;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n@primary_line: #FFC859;\n@primary_fill: lighten(@primary_line,10%);\n@primary_case: @primary_line * 0.9;\n\n@secondary_line: #FFE873;\n@secondary_fill: lighten(@secondary_line,10%);\n@secondary_case: @secondary_line * 0.9;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #eee;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,15%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #333;\n@city_halo: @place_halo;\n\n@town_text: #444;\n@town_halo: @place_halo;\n\n@poi_text: #666;\n\n@road_text: #777;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n\n\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM HYBRID for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_lt_italic: \"Open Sans Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \t\"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans: \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_italic: \"Open Sans Semibold Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \t\"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold: \"Open Sans Bold\", \"DejaVu Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\",\n\t\t\t\t\t\"Mallige Bold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold_italic: \"Open Sans Bold Italic\", \"DejaVu Sans Bold Italic\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\",\n\t\t\t\t\t\"TSCu_Paranar Bold\", \"Mallige Bold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #FCFBE7;\n@water: #C4DFF6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #DAF2C1;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n@building: #E4E0E0;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #E65C5C;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #E68A5C;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n@primary_line: #FFC859;\n@primary_fill: lighten(@primary_line,10%);\n@primary_case: @primary_line * 0.9;\n\n@secondary_line: #FFE873;\n@secondary_fill: lighten(@secondary_line,10%);\n@secondary_case: @secondary_line * 0.9;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #eee;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,34%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #333;\n@city_halo: @place_halo;\n\n@town_text: #444;\n@town_halo: @place_halo;\n\n@poi_text: #666;\n\n@road_text: #777;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n\n\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"950b30871b5a1bad2c0995858f6b23828545675a","subject":"Fixed: Remove log statement","message":"Fixed: Remove log statement\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0)\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n libmei.AddAttribute(n, 'staff', staff);\n libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber + '-' + pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) + '-' + pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) + '-' + pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'rend', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(octl, 'dis', octrend[0]);\n libmei.AddAttribute(octl, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0)\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n libmei.AddAttribute(n, 'staff', staff);\n libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber + '-' + pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) + '-' + pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) + '-' + pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'rend', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(octl, 'dis', octrend[0]);\n libmei.AddAttribute(octl, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n Log('A vertical line was found.');\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"744016ce8eced9476838d1c314720fc64aad9fff","subject":"base updates","message":"base updates\n","repos":"silph-io\/osm-silph,jeffaudi\/osm-hybrid,pinkflozd\/osm-bright,Sweetymeow\/osm-bright,saydulk\/osm-bright,mapbox\/osm-bright,raumobil\/osm-bright,brelevenix\/osm-bright-tregor,makinacorpus\/osm-makina,yohanboniface\/osm-bright","old_file":"osm-bright\/base.mss","new_file":"osm-bright\/base.mss","new_contents":"\/* BASE.MSS CONTENTS\n * - Landuse & landcover\n * - Water areas\n * - Water ways\n * - Administrative Boundaries\n *\n *\/\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER\n\/* ================================================================== *\/\n\n#land[zoom>=0][zoom<6],\n#shoreline_300[zoom>=6][zoom<10],\n#processed_p[zoom>=10] {\n polygon-fill: @land;\n polygon-gamma: 0.75;\n}\n\n#landuse_gen0[zoom>3][zoom<=9],\n#landuse_gen1[zoom>9][zoom<=12],\n#landuse[zoom>12] {\n [type='cemetery'] { polygon-fill: @cemetery; }\n [type='college'] { polygon-fill: @school; }\n [type='commercial'] { polygon-fill: @industrial; }\n [type='common'] { polygon-fill: @park; }\n [type='forest'] { polygon-fill: @wooded; }\n [type='golf_course'] { polygon-fill: @park; }\n [type='grass'] { polygon-fill: @grass; }\n [type='hospital'] { polygon-fill: @hospital; }\n [type='industrial'] { polygon-fill: @industrial; }\n [type='park'] { polygon-fill: @park; }\n [type='parking'] { polygon-fill: @parking; }\n [type='pedestrian'] { polygon-fill: @pedestrian_fill; }\n [type='pitch'] { polygon-fill: @sports; }\n [type='residential'] { polygon-fill: @residential; }\n [type='school'] { polygon-fill: @school; }\n [type='sports_center'] { polygon-fill: @sports; }\n [type='stadium'] { polygon-fill: @sports; }\n [type='university'] { polygon-fill: @school; }\n [type='wood'] { polygon-fill: @wooded; }\n}\n\n#landuse_overlays[type='nature_reserve'][zoom>6] {\n line-color: darken(@wooded,25%);\n line-opacity: 0.3;\n line-dasharray: 1,1;\n polygon-fill: darken(@wooded,25%);\n polygon-opacity: 0.1;\n [zoom=7] { line-width: 0.4; }\n [zoom=8] { line-width: 0.6; }\n [zoom=9] { line-width: 0.8; }\n [zoom=10] { line-width: 1.0; }\n [zoom=11] { line-width: 1.5; }\n [zoom>=12] { line-width: 2.0; }\n}\n \n#landuse_overlays[type='wetland'][zoom>11] {\n [zoom>11][zoom<=14] { polygon-pattern-file:url(img\/swamp-16.png); }\n [zoom>14] { polygon-pattern-file:url(img\/swamp-32.png);}\n }\n\n\/* ---- BUILDINGS ---- *\/\n#buildings[zoom>=12][zoom<=16] {\n polygon-fill:@building;\n [zoom>=14] {\n line-color:darken(@building,5);\n line-width:0.2;\n }\n [zoom>=16] {\n line-color:darken(@building,10);\n line-width:0.4;\n }\n}\n\/\/ At the highest zoom levels, render buildings in fancy pseudo-3D.\n\/\/ Ordering polygons by their Y-position is necessary for this effect\n\/\/ so we use a separate layer that does this for us.\n#buildings_ordered[zoom>=17][type != 'hedge'] {\n building-fill:@building;\n building-height:1.25;\n}\n\n#buildings_ordered[zoom>=17][type = 'hedge'] {\n building-fill:@wooded;\n building-height:1.25;\n}\n\n\/* ================================================================== *\/\n\/* WATER AREAS\n\/* ================================================================== *\/\n\nMap { background-color: @water; }\n\n#water_gen0[zoom>3][zoom<=9],\n#water_gen1[zoom>9][zoom<=12],\n#water[zoom>12] {\n polygon-fill: @water;\n}\n\n\/* ================================================================== *\/\n\/* WATER WAYS\n\/* ================================================================== *\/\n\n#waterway_low[zoom>=8][zoom<=12] {\n line-color: @water;\n [zoom=8] { line-width: 0.1; }\n [zoom=9] { line-width: 0.2; }\n [zoom=10]{ line-width: 0.4; }\n [zoom=11]{ line-width: 0.6; }\n [zoom=12]{ line-width: 0.8; }\n}\n\n#waterway_med[zoom>=13][zoom<=14] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=13]{ line-width: 1; }\n [zoom=14]{ line-width: 1.5; }\n }\n [type='stream'] {\n [zoom=13]{ line-width: 0.2; }\n [zoom=14]{ line-width: 0.4; }\n }\n}\n \n#waterway_high[zoom>=15] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=15]{ line-width: 2; }\n [zoom=16]{ line-width: 3; }\n [zoom=17]{ line-width: 4; }\n [zoom=18]{ line-width: 5; }\n [zoom=19]{ line-width: 6; }\n [zoom>19]{ line-width: 7; }\n }\n [type='stream'] {\n [zoom=15]{ line-width: 0.6; }\n [zoom=16]{ line-width: 0.8; }\n [zoom=17]{ line-width: 1; }\n [zoom=18]{ line-width: 1.5; }\n [zoom>18]{ line-width: 2; }\n }\n [type='ditch'],\n [type='drain'] {\n [zoom=15]{ line-width: 0.1; }\n [zoom=16]{ line-width: 0.3; }\n [zoom=17]{ line-width: 0.5; }\n [zoom=18]{ line-width: 0.7; }\n [zoom=19]{ line-width: 1; }\n [zoom>19]{ line-width: 1.5; }\n }\n}\n\n\/* ================================================================== *\/\n\/* ADMINISTRATIVE BOUNDARIES\n\/* ================================================================== *\/\n\n\n#admin[admin_level=2][zoom>1] {\n line-color:@admin_2;\n line-width:0.5;\n [zoom=2] { line-opacity: 0.25; }\n [zoom=3] { line-opacity: 0.3; }\n [zoom=4] { line-opacity: 0.4; }\n}\n\n\/* ================================================================== *\/\n\/* BARRIER POINTS\n\/* ================================================================== *\/\n\n\n#barrier_points[zoom>=17][stylegroup = 'divider'] {\n marker-height: 2;\n marker-fill: #c7c7c7;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n\n\/* ================================================================== *\/\n\/* BARRIER LINES\n\/* ================================================================== *\/\n\n#barrier_lines[zoom>=17][stylegroup = 'gate'] {\n line-width:2.5;\n line-color:#aab;\n line-dasharray:3,2;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'fence'] {\n line-width:1.75;\n line-color:#aab;\n line-dasharray:1,1;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'hedge'] {\n line-width:3;\n line-color:darken(@park,5);\n\n}","old_contents":"\/* BASE.MSS CONTENTS\n * - Landuse & landcover\n * - Water areas\n * - Water ways\n * - Administrative Boundaries\n *\n *\/\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER\n\/* ================================================================== *\/\n\n#land[zoom>=0][zoom<6],\n#shoreline_300[zoom>=6][zoom<10],\n#processed_p[zoom>=10] {\n polygon-fill: @land;\n polygon-gamma: 0.75;\n}\n\n#landuse_gen0[zoom>3][zoom<=9],\n#landuse_gen1[zoom>9][zoom<=12],\n#landuse[zoom>12] {\n [type='cemetery'] { polygon-fill: @cemetery; }\n [type='college'] { polygon-fill: @school; }\n [type='commercial'] { polygon-fill: @industrial; }\n [type='forest'] { polygon-fill: @wooded; }\n [type='golf_course'] { polygon-fill: @park; }\n [type='grass'] { polygon-fill: @park; }\n [type='hospital'] { polygon-fill: @hospital; }\n [type='industrial'] { polygon-fill: @industrial; }\n [type='park'] { polygon-fill: @park; }\n [type='parking'] { polygon-fill: @parking; }\n [type='pedestrian'] { polygon-fill: @pedestrian_fill; }\n [type='pitch'] { polygon-fill: @sports; }\n [type='residential'] { polygon-fill: @residential; }\n [type='school'] { polygon-fill: @school; }\n [type='sports_center'] { polygon-fill: @sports; }\n [type='stadium'] { polygon-fill: @sports; }\n [type='university'] { polygon-fill: @school; }\n [type='wood'] { polygon-fill: @wooded; }\n}\n\n#landuse_overlays[type='nature_reserve'][zoom>6] {\n line-color: darken(@wooded,25%);\n line-opacity: 0.3;\n line-dasharray: 1,1;\n polygon-fill: darken(@wooded,25%);\n polygon-opacity: 0.1;\n [zoom=7] { line-width: 0.4; }\n [zoom=8] { line-width: 0.6; }\n [zoom=9] { line-width: 0.8; }\n [zoom=10] { line-width: 1.0; }\n [zoom=11] { line-width: 1.5; }\n [zoom>=12] { line-width: 2.0; }\n}\n \n#landuse_overlays[type='wetland'][zoom>11] {\n [zoom>11][zoom<=14] { polygon-pattern-file:url(img\/swamp-16.png); }\n [zoom>14] { polygon-pattern-file:url(img\/swamp-32.png);}\n }\n\n\/* ---- BUILDINGS ---- *\/\n#buildings[zoom>10][zoom<=16] {\n polygon-fill:@building;\n [zoom>13] {\n line-color:darken(@building,5);\n line-width:0.2;\n }\n [zoom>15] {\n line-color:darken(@building,10);\n line-width:0.4;\n }\n}\n\/* At the highest zoom levels, render buildings in fancy pseudo-3D *\/\n#buildings[zoom>=17][type != 'hedge'] {\n building-fill:@building;\n building-height:1.25;\n}\n\n#buildings[zoom>=17][type = 'hedge'] {\n building-fill:@wooded;\n building-height:1.25;\n}\n\n\/* ================================================================== *\/\n\/* WATER AREAS\n\/* ================================================================== *\/\n\nMap { background-color: @water; }\n\n#water_gen0[zoom>3][zoom<=9],\n#water_gen1[zoom>9][zoom<=12],\n#water[zoom>12] {\n polygon-fill: @water;\n}\n\n\/* ================================================================== *\/\n\/* WATER WAYS\n\/* ================================================================== *\/\n\n#waterway_low[zoom>=8][zoom<=12] {\n line-color: @water;\n [zoom=8] { line-width: 0.1; }\n [zoom=9] { line-width: 0.2; }\n [zoom=10]{ line-width: 0.4; }\n [zoom=11]{ line-width: 0.6; }\n [zoom=12]{ line-width: 0.8; }\n}\n\n#waterway_med[zoom>=13][zoom<=14] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=13]{ line-width: 1; }\n [zoom=14]{ line-width: 1.5; }\n }\n [type='stream'] {\n [zoom=13]{ line-width: 0.2; }\n [zoom=14]{ line-width: 0.4; }\n }\n}\n \n#waterway_high[zoom>=15] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=15]{ line-width: 2; }\n [zoom=16]{ line-width: 3; }\n [zoom=17]{ line-width: 4; }\n [zoom=18]{ line-width: 5; }\n [zoom=19]{ line-width: 6; }\n [zoom>19]{ line-width: 7; }\n }\n [type='stream'] {\n [zoom=15]{ line-width: 0.6; }\n [zoom=16]{ line-width: 0.8; }\n [zoom=17]{ line-width: 1; }\n [zoom=18]{ line-width: 1.5; }\n [zoom>18]{ line-width: 2; }\n }\n [type='ditch'],\n [type='drain'] {\n [zoom=15]{ line-width: 0.1; }\n [zoom=16]{ line-width: 0.3; }\n [zoom=17]{ line-width: 0.5; }\n [zoom=18]{ line-width: 0.7; }\n [zoom=19]{ line-width: 1; }\n [zoom>19]{ line-width: 1.5; }\n }\n}\n\n\/* ================================================================== *\/\n\/* ADMINISTRATIVE BOUNDARIES\n\/* ================================================================== *\/\n\n\n#admin[admin_level=2][zoom>1] {\n line-color:@admin_2;\n line-width:0.5;\n [zoom=2] { line-opacity: 0.25; }\n [zoom=3] { line-opacity: 0.3; }\n [zoom=4] { line-opacity: 0.4; }\n}\n\n\/* ================================================================== *\/\n\/* BARRIER POINTS\n\/* ================================================================== *\/\n\n\n#barrier_points[zoom>=17][stylegroup = 'divider'] {\n marker-height: 2;\n marker-fill: #c7c7c7;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n\n\/* ================================================================== *\/\n\/* BARRIER LINES\n\/* ================================================================== *\/\n\n#barrier_lines[zoom>=17][stylegroup = 'gate'] {\n line-width:2.5;\n line-color:#aab;\n line-dasharray:3,2;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'fence'] {\n line-width:1.75;\n line-color:#aab;\n line-dasharray:1,1;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'hedge'] {\n line-width:3;\n line-color:darken(@park,5);\n\n}","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"e2eb7f40601749093f119e1ea27c5bacc9ef155b","subject":"New: Get Note Object at End Position","message":"New: Get Note Object at End Position\n\nUsed for slurs as symbols.\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/Utilities.mss","new_file":"src\/Utilities.mss","new_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in\n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/*\n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction GetNoteObjectAtEndPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a bar object, and returns the NoteRest object closest to the end position.\n \/\/ If one isn't found exactly at the end position, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n \/\/ NB: This will probably only work for line objects, since they are the only ones with the EndPosition attribute.\n \/\/ Returns the MEI element closest to that position.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n \/\/ bar_num = bobj.ParentBar.BarNumber;\n bar_num = bobj.EndBarNumber;\n Log('bar_num: ' & bar_num);\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions = null)\n {\n \/\/ theres not much we can do here. Bail.\n Log('Bailing due to insufficient voice information');\n return null;\n }\n\n if (voiceObjectPositions.PropertyExists(bobj.EndPosition))\n {\n obj_id = voiceObjectPositions[bobj.EndPosition];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a bar object, and returns the NoteRest object closest to its position.\n \/\/ If one isn't found exactly at the end position, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions = null)\n {\n \/\/ theres not much we can do here. Bail.\n Log('Bailing due to insufficient voice information');\n return null;\n }\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (tstamps, etc.) to an element.\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Bar object'));\n }\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n if (bobj.Duration > 0)\n {\n libmei.AddAttribute(element, 'dur.ges', bobj.Duration & 'p');\n }\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bar));\n\n switch (bobj.Type)\n {\n case('Line')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Slur')\n {\n \/\/ libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n start_obj = GetNoteObjectAtPosition(bobj);\n end_obj = GetNoteObjectAtEndPosition(bobj);\n if (start_obj != null)\n {\n libmei.AddAttribute(element, 'startid', '#' & start_obj._id);\n }\n\n if (end_obj != null)\n {\n libmei.AddAttribute(element, 'endid', '#' & end_obj._id);\n }\n\n }\n case('DiminuendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('CrescendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('GlissandoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Trill')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction GetTupletStack (bobj) {\n \/\/$module(Utilities.mss)\n tupletStack = CreateSparseArray();\n parentTuplet = bobj.ParentTupletIfAny;\n while (parentTuplet != null)\n {\n tupletStack.Push(parentTuplet);\n parentTuplet = parentTuplet.ParentTupletIfAny;\n }\n tupletStack.Reverse();\n return tupletStack;\n} \/\/$end\n\nfunction CountTupletsEndingAtNoteRest(noteRest) {\n \/\/$module(Utilities.mss)\n tuplet = noteRest.ParentTupletIfAny;\n\n if (tuplet = null)\n {\n return 0;\n }\n\n nextNoteRest = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n\n if (nextNoteRest = null or nextNoteRest.ParentTupletIfAny = null)\n {\n tupletStack = GetTupletStack(noteRest);\n return tupletStack.Length;\n }\n\n if (TupletsEqual(tuplet, nextNoteRest.ParentTupletIfAny))\n {\n return 0;\n }\n\n tupletStack = GetTupletStack(noteRest);\n nextTupletStack = GetTupletStack(nextNoteRest);\n\n \/\/ We are looking for the highest index where both stacks are identical.\n index = utils.min(tupletStack.Length, nextTupletStack.Length) - 1;\n\n while (index >= 0 and not(TupletsEqual(tupletStack[index], nextTupletStack[index])))\n {\n index = index - 1;\n }\n\n return tupletStack.Length - 1 - index;\n} \/\/$end\n\nfunction GetMeiTupletDepth (layer) {\n \/\/$module(Utilities.mss)\n depth = 0;\n tuplet = layer._property:ActiveMeiTuplet;\n while (tuplet != null)\n {\n depth = depth + 1;\n tuplet = tuplet._property:ParentTuplet;\n }\n return depth;\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n Sibelius.AppendLineToFile(LOGFILE, message, True);\n} \/\/$end\n\nfunction NormalizedBeamProp (noteRest) {\n \/\/$module(Utilities.mss)\n \/*\n Sibelius' Beam properties can't be trusted. We need to look at the context,\n check whether they make sense and if they don't, find out the value we'd expect.\n Problems can e.g. be that Sibelius reports\n * a ContinueBeam at the start of a beam (we'd expect StartBeam)\n * a property other than NoBeam on a quarter or longer un-beamable duration\n (we'd expect NoBeam)\n * ... (almost any combinations imaginable)\n *\/\n if (noteRest.Beam = NoBeam or noteRest.Duration >= 256)\n {\n return NoBeam;\n }\n\n \/\/ At this point, we're only dealing with ContinueBeam and SingleBeam.\n \/\/ We need to look at the preceding note to see whether there's any\n \/\/ beam to continue.\n\n if (noteRest.Beam != StartBeam)\n {\n prev_obj = PrevNormalOrGrace(noteRest, noteRest.GraceNote);\n\n if (prev_obj != null and prev_obj.Beam != NoBeam and prev_obj.Duration < 256)\n {\n \/\/ We actually have a beam we can continue.\n if (noteRest.Beam = SingleBeam and noteRest.Duration < 128 and prev_obj.Duration < 128)\n {\n \/\/ SingleBeam only makes sense if we actually have secondary beams between the\n \/\/ previous note and the current note.\n return SingleBeam;\n }\n return ContinueBeam;\n }\n }\n\n \/\/ At this point, we know there is no previous beam we can continue because we have a\n \/\/ StartBeam or the above test for a previous beam failed.\n \/\/ We still need to check whether there is a following note that we can beam to.\n\n next_obj = NextNormalOrGrace(noteRest, noteRest.GraceNote);\n if (next_obj != null and next_obj.Duration < 256 and (next_obj.Beam = ContinueBeam or next_obj.Beam = SingleBeam))\n {\n return StartBeam;\n }\n else\n {\n return NoBeam;\n }\n} \/\/$end\n\nfunction NextNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n When given a 'normal' NoteRest, this function returns the next 'normal' NoteRest\n in the same voice.\n When given a grace NoteRest, this function returns the immediately adjacent\n following grace NoteRest, if existant.\n This function is basically a duplicate of PrevNormalOrGrace() with\n 'Previous' replaced by 'Next'.\n *\/\n next_obj = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (next_obj != null and not(next_obj.GraceNote))\n {\n next_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (next_obj != null and next_obj.GraceNote)\n {\n next_obj = next_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return next_obj;\n} \/\/$end\n\nfunction PrevNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n For a description, see NextNormalOrGrace().\n This function is basically a duplicate of PrevNormalOrGrace() with\n 'Next' replaced by 'Previous'.\n *\/\n prev_obj = noteRest.PreviousItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (prev_obj != null and not(prev_obj.GraceNote))\n {\n prev_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (prev_obj and prev_obj.GraceNote)\n {\n prev_obj = prev_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return prev_obj;\n} \/\/$end\n\nfunction GetNongraceParentBeam (noteRest, layer) {\n \/\/$module(Utilities.mss)\n \/*\n This function is used to find out whether a non-grace beam spans over a grace\n NoteRest that is either unbeamed or at the start of a grace beam.\n *\/\n if (layer._property:ActiveBeam != null)\n {\n \/\/ Only if the active non-grace beam continues to the next normal note, the\n \/\/ grace note is truly placed under the non-grace beam.\n nextNongraceNoteRest = NextNormalOrGrace(noteRest, false);\n if (nextNongraceNoteRest != null)\n {\n nextNormalBeamProp = NormalizedBeamProp(nextNongraceNoteRest);\n }\n else\n {\n nextNormalBeamProp = NoBeam;\n }\n if (nextNormalBeamProp = ContinueBeam or nextNormalBeamProp = SingleBeam)\n {\n return layer._property:ActiveBeam;\n }\n }\n return null;\n} \/\/$end\n\nfunction InitFigbassCharMap () {\n \/\/$module(Utilities.mss)\n map = CreateDictionary(\n '\u00a7', '\u266e',\n '#', '\u266f',\n '!', '\u266d',\n '?', '\ud834\udd2a',\n '%', '\ud834\udd2b',\n 'a', '(2)',\n 'i', '[2]',\n 'w', '2\u266e',\n 's', '2\u266f',\n 'x', '2\u266d',\n 'W', '\u266e2',\n 'S', '\u266f2',\n 'X', '\u266d2',\n 'k', '2+',\n 'p', '(3)',\n 'q', '[3]',\n 'e', '3\u266e',\n 'd', '3\u266f',\n 'c', '3\u266d',\n 'E', '\u266e3',\n 'D', '\u266f3',\n 'C', '\u266d3',\n 'z', '3+',\n 'A', '(4)',\n 'I', '[4]',\n 'r', '4\u266e',\n 'f', '4\u266f',\n 'v', '4\u266d',\n 'R', '\u266e4',\n 'F', '\u266f4',\n 'V', '\u266d4',\n 'K', '4+',\n 'P', '(5)',\n 'Q', '[5]',\n 't', '5\u266e',\n 'g', '5\u266f',\n 'b', '5\u266d',\n 'T', '\u266e5',\n 'G', '\u266f5',\n 'B', '\u266d5',\n 'Z', '5+',\n '$', '(6)',\n '\u00a8', '[6]',\n 'y', '6\u266e',\n 'h', '6\u266f',\n 'n', '6\u266d',\n 'Y', '\u266e6',\n 'H', '\u266f6',\n 'N', '\u266d6',\n ',', '6+',\n '\u00c2', '(7)',\n ';', '[7]',\n 'u', '7\u266e',\n 'j', '7\u266f',\n 'm', '7\u266d',\n 'U', '\u266e7',\n 'J', '\u266f7',\n 'M', '\u266d7',\n '<', '7+',\n '>', '+7',\n '=', '(8)',\n '\u00d6', '[8]',\n '\u00c0', '(9)',\n '{', '[9]',\n 'o', '9\u266e',\n 'l', '9\u266f',\n '\u00eb', '9\u266d',\n 'O', '\u266e9',\n 'L', '\u266f9',\n ':', '\u266d9',\n '}', '9+',\n '\u00c5', '|',\n '\u00fc', '_',\n '\u00a9', CreateSparseArray('2\u266f', 'U+EA53', 'figbass2Raised' ), \/\/ 2 with slashed foot\n '\u00c4', CreateSparseArray('4\u266f', 'U+EA56', 'figbass4Raised' ), \/\/ 4 with slashed horizontal line\n '\u00cb', CreateSparseArray('5\u266f', 'U+EA58', 'figbass5Raised1'), \/\/ 5 with straight slash through head\n '\u00cf', CreateSparseArray('5\u266f', 'U+EA59', 'figbass5Raised2'), \/\/ 5 with angled slash through head\n '\u00ef', CreateSparseArray('5\u266f', 'U+EA5A', 'figbass5Raised3'), \/\/ 5 with slashed foot\n '\u00b4', CreateSparseArray('6\u266f', 'U+EA6F', 'figbass6Raised' ), \/\/ 6 with slashed head\n '\u00e4', CreateSparseArray('7\u266f', 'U+EA5E', 'figbass7Raised1'), \/\/ 7 with slashed head\n '&', CreateSparseArray('7\u266f', 'U+EA5F', 'figbass8Raised2'), \/\/ 7 with slashed stem\n \/\/ (Sibelius\/Opus and SMuFL\/Bravura don't match 100% for the slashed 9:\n \/\/ Opus slashes the stem, Bravura the head)\n '\u00f6', CreateSparseArray('9#', 'U+EA62', 'figbass9Raised') \/\/ slashed 9\n );\n literalChars = '0123456789[]_-+.';\n for i = 0 to Length(literalChars)\n {\n char = CharAt(literalChars, i);\n map[char] = char;\n }\n\n return map;\n} \/\/$end\n","old_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in\n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/*\n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a dictionary of {pos:id} mappings for a given\n \/\/ voice, and returns the NoteRest object. If one isn't found\n \/\/ exactly at `position`, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions = null)\n {\n \/\/ theres not much we can do here. Bail.\n Log('Bailing due to insufficient voice information');\n return null;\n }\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (tstamps, etc.) to an element.\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Bar object'));\n }\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n if (bobj.Duration > 0)\n {\n libmei.AddAttribute(element, 'dur.ges', bobj.Duration & 'p');\n }\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bar));\n\n switch (bobj.Type)\n {\n case('Line')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Slur')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('DiminuendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('CrescendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('GlissandoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Trill')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction GetTupletStack (bobj) {\n \/\/$module(Utilities.mss)\n tupletStack = CreateSparseArray();\n parentTuplet = bobj.ParentTupletIfAny;\n while (parentTuplet != null)\n {\n tupletStack.Push(parentTuplet);\n parentTuplet = parentTuplet.ParentTupletIfAny;\n }\n tupletStack.Reverse();\n return tupletStack;\n} \/\/$end\n\nfunction CountTupletsEndingAtNoteRest(noteRest) {\n \/\/$module(Utilities.mss)\n tuplet = noteRest.ParentTupletIfAny;\n\n if (tuplet = null)\n {\n return 0;\n }\n\n nextNoteRest = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n\n if (nextNoteRest = null or nextNoteRest.ParentTupletIfAny = null)\n {\n tupletStack = GetTupletStack(noteRest);\n return tupletStack.Length;\n }\n\n if (TupletsEqual(tuplet, nextNoteRest.ParentTupletIfAny))\n {\n return 0;\n }\n\n tupletStack = GetTupletStack(noteRest);\n nextTupletStack = GetTupletStack(nextNoteRest);\n\n \/\/ We are looking for the highest index where both stacks are identical.\n index = utils.min(tupletStack.Length, nextTupletStack.Length) - 1;\n\n while (index >= 0 and not(TupletsEqual(tupletStack[index], nextTupletStack[index])))\n {\n index = index - 1;\n }\n\n return tupletStack.Length - 1 - index;\n} \/\/$end\n\nfunction GetMeiTupletDepth (layer) {\n \/\/$module(Utilities.mss)\n depth = 0;\n tuplet = layer._property:ActiveMeiTuplet;\n while (tuplet != null)\n {\n depth = depth + 1;\n tuplet = tuplet._property:ParentTuplet;\n }\n return depth;\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n Sibelius.AppendLineToFile(LOGFILE, message, True);\n} \/\/$end\n\nfunction NormalizedBeamProp (noteRest) {\n \/\/$module(Utilities.mss)\n \/*\n Sibelius' Beam properties can't be trusted. We need to look at the context,\n check whether they make sense and if they don't, find out the value we'd expect.\n Problems can e.g. be that Sibelius reports\n * a ContinueBeam at the start of a beam (we'd expect StartBeam)\n * a property other than NoBeam on a quarter or longer un-beamable duration\n (we'd expect NoBeam)\n * ... (almost any combinations imaginable)\n *\/\n if (noteRest.Beam = NoBeam or noteRest.Duration >= 256)\n {\n return NoBeam;\n }\n\n \/\/ At this point, we're only dealing with ContinueBeam and SingleBeam.\n \/\/ We need to look at the preceding note to see whether there's any\n \/\/ beam to continue.\n\n if (noteRest.Beam != StartBeam)\n {\n prev_obj = PrevNormalOrGrace(noteRest, noteRest.GraceNote);\n\n if (prev_obj != null and prev_obj.Beam != NoBeam and prev_obj.Duration < 256)\n {\n \/\/ We actually have a beam we can continue.\n if (noteRest.Beam = SingleBeam and noteRest.Duration < 128 and prev_obj.Duration < 128)\n {\n \/\/ SingleBeam only makes sense if we actually have secondary beams between the\n \/\/ previous note and the current note.\n return SingleBeam;\n }\n return ContinueBeam;\n }\n }\n\n \/\/ At this point, we know there is no previous beam we can continue because we have a\n \/\/ StartBeam or the above test for a previous beam failed.\n \/\/ We still need to check whether there is a following note that we can beam to.\n\n next_obj = NextNormalOrGrace(noteRest, noteRest.GraceNote);\n if (next_obj != null and next_obj.Duration < 256 and (next_obj.Beam = ContinueBeam or next_obj.Beam = SingleBeam))\n {\n return StartBeam;\n }\n else\n {\n return NoBeam;\n }\n} \/\/$end\n\nfunction NextNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n When given a 'normal' NoteRest, this function returns the next 'normal' NoteRest\n in the same voice.\n When given a grace NoteRest, this function returns the immediately adjacent\n following grace NoteRest, if existant.\n This function is basically a duplicate of PrevNormalOrGrace() with\n 'Previous' replaced by 'Next'.\n *\/\n next_obj = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (next_obj != null and not(next_obj.GraceNote))\n {\n next_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (next_obj != null and next_obj.GraceNote)\n {\n next_obj = next_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return next_obj;\n} \/\/$end\n\nfunction PrevNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n For a description, see NextNormalOrGrace().\n This function is basically a duplicate of PrevNormalOrGrace() with\n 'Next' replaced by 'Previous'.\n *\/\n prev_obj = noteRest.PreviousItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (prev_obj != null and not(prev_obj.GraceNote))\n {\n prev_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (prev_obj and prev_obj.GraceNote)\n {\n prev_obj = prev_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return prev_obj;\n} \/\/$end\n\nfunction GetNongraceParentBeam (noteRest, layer) {\n \/\/$module(Utilities.mss)\n \/*\n This function is used to find out whether a non-grace beam spans over a grace\n NoteRest that is either unbeamed or at the start of a grace beam.\n *\/\n if (layer._property:ActiveBeam != null)\n {\n \/\/ Only if the active non-grace beam continues to the next normal note, the\n \/\/ grace note is truly placed under the non-grace beam.\n nextNongraceNoteRest = NextNormalOrGrace(noteRest, false);\n if (nextNongraceNoteRest != null)\n {\n nextNormalBeamProp = NormalizedBeamProp(nextNongraceNoteRest);\n }\n else\n {\n nextNormalBeamProp = NoBeam;\n }\n if (nextNormalBeamProp = ContinueBeam or nextNormalBeamProp = SingleBeam)\n {\n return layer._property:ActiveBeam;\n }\n }\n return null;\n} \/\/$end\n\nfunction InitFigbassCharMap () {\n \/\/$module(Utilities.mss)\n map = CreateDictionary(\n '\u00a7', '\u266e',\n '#', '\u266f',\n '!', '\u266d',\n '?', '\ud834\udd2a',\n '%', '\ud834\udd2b',\n 'a', '(2)',\n 'i', '[2]',\n 'w', '2\u266e',\n 's', '2\u266f',\n 'x', '2\u266d',\n 'W', '\u266e2',\n 'S', '\u266f2',\n 'X', '\u266d2',\n 'k', '2+',\n 'p', '(3)',\n 'q', '[3]',\n 'e', '3\u266e',\n 'd', '3\u266f',\n 'c', '3\u266d',\n 'E', '\u266e3',\n 'D', '\u266f3',\n 'C', '\u266d3',\n 'z', '3+',\n 'A', '(4)',\n 'I', '[4]',\n 'r', '4\u266e',\n 'f', '4\u266f',\n 'v', '4\u266d',\n 'R', '\u266e4',\n 'F', '\u266f4',\n 'V', '\u266d4',\n 'K', '4+',\n 'P', '(5)',\n 'Q', '[5]',\n 't', '5\u266e',\n 'g', '5\u266f',\n 'b', '5\u266d',\n 'T', '\u266e5',\n 'G', '\u266f5',\n 'B', '\u266d5',\n 'Z', '5+',\n '$', '(6)',\n '\u00a8', '[6]',\n 'y', '6\u266e',\n 'h', '6\u266f',\n 'n', '6\u266d',\n 'Y', '\u266e6',\n 'H', '\u266f6',\n 'N', '\u266d6',\n ',', '6+',\n '\u00c2', '(7)',\n ';', '[7]',\n 'u', '7\u266e',\n 'j', '7\u266f',\n 'm', '7\u266d',\n 'U', '\u266e7',\n 'J', '\u266f7',\n 'M', '\u266d7',\n '<', '7+',\n '>', '+7',\n '=', '(8)',\n '\u00d6', '[8]',\n '\u00c0', '(9)',\n '{', '[9]',\n 'o', '9\u266e',\n 'l', '9\u266f',\n '\u00eb', '9\u266d',\n 'O', '\u266e9',\n 'L', '\u266f9',\n ':', '\u266d9',\n '}', '9+',\n '\u00c5', '|',\n '\u00fc', '_',\n '\u00a9', CreateSparseArray('2\u266f', 'U+EA53', 'figbass2Raised' ), \/\/ 2 with slashed foot\n '\u00c4', CreateSparseArray('4\u266f', 'U+EA56', 'figbass4Raised' ), \/\/ 4 with slashed horizontal line\n '\u00cb', CreateSparseArray('5\u266f', 'U+EA58', 'figbass5Raised1'), \/\/ 5 with straight slash through head\n '\u00cf', CreateSparseArray('5\u266f', 'U+EA59', 'figbass5Raised2'), \/\/ 5 with angled slash through head\n '\u00ef', CreateSparseArray('5\u266f', 'U+EA5A', 'figbass5Raised3'), \/\/ 5 with slashed foot\n '\u00b4', CreateSparseArray('6\u266f', 'U+EA6F', 'figbass6Raised' ), \/\/ 6 with slashed head\n '\u00e4', CreateSparseArray('7\u266f', 'U+EA5E', 'figbass7Raised1'), \/\/ 7 with slashed head\n '&', CreateSparseArray('7\u266f', 'U+EA5F', 'figbass8Raised2'), \/\/ 7 with slashed stem\n \/\/ (Sibelius\/Opus and SMuFL\/Bravura don't match 100% for the slashed 9:\n \/\/ Opus slashes the stem, Bravura the head)\n '\u00f6', CreateSparseArray('9#', 'U+EA62', 'figbass9Raised') \/\/ slashed 9\n );\n literalChars = '0123456789[]_-+.';\n for i = 0 to Length(literalChars)\n {\n char = CharAt(literalChars, i);\n map[char] = char;\n }\n\n return map;\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"7f278fa77c6f1c796f1a472a2a0a8bce1cfc17f9","subject":"#16 add admin1 labels for US & CAN","message":"#16 add admin1 labels for US & CAN\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Narrow Regular', 'Unifont Medium';\n\n@label_color_transport: #524c4c;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n\n@label_color_administrative_halo: #fff;\n@label_color_transport_halo: #F7F7E6;\n@text_font_halo_places_fill_low: fadeout(rgba(255,255,255, 0.7), 30%);\n@text_font_halo_places_fill_high: fadeout(rgba(255,255,255, 1), 30%);\n\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: 2;\n}\n\n#shields { \n [zoom>=11] {\n\n \/* tmp place holder for hwy shields *\/\n\n }\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=11] {\n text-fill: #586e50;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n\n [zoom>=11] {\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_green_area_halo;\n }\n [zoom>=15] {\n text-halo-radius: @text_font_halo_radius_large;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 18;\n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-size: 22;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 22;\n text-min-distance: 15;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.1;\n \/\/}\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-placement: interior;\n text-vertical-alignment: bottom;\n text-min-distance: 5;\n text-dy: -5;\n\n [justified='left'] {\n \/\/text-horizontal-alignment: left;\n text-horizontal-alignment: middle;\n \/\/text-dx: 20;\n }\n\n [justified='right'] {\n \/\/text-horizontal-alignment: right;\n text-horizontal-alignment: middle;\n \/\/text-dx: -20;\n }\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size>=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.3;\n \/\/}\n [justified='left'] {\n text-horizontal-alignment: left;\n text-dx: 15;\n }\n\n [justified='right'] {\n text-horizontal-alignment: right;\n text-dx: -15;\n }\n\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_sm;\n text-min-distance: 5;\n text-allow-overlap: true;\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: 2;\n text-halo-fill: @text_font_halo_places_fill_high;\n \/\/ text-comp-op: src;\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n \n [zoom>=11] {\n text-halo-fill: @text_font_halo_places_fill_low;\n }\n}\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n marker-ignore-placement: true;\n marker-width: 5;\n marker-fill: #2e2115;\n marker-line-width: 0;\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: #f7f7e6;\n text-halo-radius: 2;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n\n","old_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Narrow Regular', 'Unifont Medium';\n\n@label_color_transport: #524c4c;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n@text_font_halo_transport_fill: #F7F7E6;\n@text_font_halo_places_fill_low: fadeout(rgba(255,255,255, 0.7), 30%);\n@text_font_halo_places_fill_high: fadeout(rgba(255,255,255, 1), 30%);\n\n\n@label_color_green_area: #374c30;\n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-avoid-edges: true;\n text-halo-fill: @text_font_halo_transport_fill;\n text-halo-radius: 2;\n}\n\n#shields {\n\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=11] {\n text-fill: #586e50;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n\n [zoom>=11] {\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_green_area_halo;\n }\n [zoom>=15] {\n text-halo-radius: @text_font_halo_radius_large;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 18;\n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-size: 22;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 22;\n text-min-distance: 15;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.1;\n \/\/}\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-placement: interior;\n text-vertical-alignment: bottom;\n text-min-distance: 5;\n text-dy: -5;\n\n [justified='left'] {\n \/\/text-horizontal-alignment: left;\n text-horizontal-alignment: middle;\n \/\/text-dx: 20;\n }\n\n [justified='right'] {\n \/\/text-horizontal-alignment: right;\n text-horizontal-alignment: middle;\n \/\/text-dx: -20;\n }\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size>=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.3;\n \/\/}\n [justified='left'] {\n text-horizontal-alignment: left;\n text-dx: 15;\n }\n\n [justified='right'] {\n text-horizontal-alignment: right;\n text-dx: -15;\n }\n\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_sm;\n text-min-distance: 5;\n text-allow-overlap: true;\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: 2;\n text-halo-fill: @text_font_halo_places_fill_high;\n \/\/ text-comp-op: src;\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n \n [zoom>=11] {\n text-halo-fill: @text_font_halo_places_fill_low;\n }\n}\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n marker-ignore-placement: true;\n marker-width: 5;\n marker-fill: #2e2115;\n marker-line-width: 0;\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: #f7f7e6;\n text-halo-radius: 2;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"9345cada2f7ed4dcb0ce7e2ee744bb4c6aa248e0","subject":"fix building pattern","message":"fix building pattern\n","repos":"Andrey-Pavlov\/toner-carto,stamen\/toner-carto","old_file":"map.mss","new_file":"map.mss","new_contents":"@color_physical: #000;\n@color_physical_bright: #fff;\n@color_water: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #000;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc;\n@color_transport_minor: #ccc;\n@color_transport_rail: #444;\n@color_transport_path: #ededed;\n@color_building_outline: #000;\n@color_building_outline_special: #00aeef;\n@color_airport_runways: #eee;\n@color_airport_runways_detail: #f2f2f2;\n\nMap {\n background-color: @color_physical;\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#country-shapes-110m {\n line-width: 0.25;\n polygon-fill: @color_administrative_bright;\n}\n\n#land-shapes-110m,\n#country-shapes-50m,\n#country-shapes-10m,\n{\n line-width: 0.25;\n polygon-fill: @color_physical_bright;\n}\n\n.country-boundary-10m {\n ::whiteout {\n [zoom>=7] {\n line-color: @color_administrative_bright;\n line-width: 2;\n }\n }\n\n [zoom>=6] {\n line-color: @color_administrative_dark;\n line-width: 1.2;\n }\n\n [zoom>=7] {\n line-width: 1.2;\n line-dasharray: 3,7;\n line-cap: round;\n }\n}\n\n#admin1-lines-50m {\n line-width: 0.35;\n line-color: @color_administrative_dark;\n}\n\n#admin1-lines-10m {\n [zoom>=6] {\n line-width: 0.6;\n line-color: @color_administrative_dark;\n }\n\n [zoom>=7] {\n line-width: 1.5;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8] {\n line-width: 2.0;\n line-color: @color_administrative_medium_high;\n }\n\n [zoom>=9] {\n line-color: @color_administrative_medium_high2;\n }\n}\n\n#lakes-110m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 0;\n\n [zoom=7][scalerank<=7] {\n line-width: 2.25;\n }\n\n [zoom=8][scalerank<=8] {\n line-width: 3.25;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=6][scalerank>=3][scalerank<=6] {\n line-width: 0.1;\n }\n\n [zoom=7] {\n [scalerank<=6],\n [scalerank<=7][expressway=1],\n [scalerank<=7][type='Major Highway'],\n [scalerank<=7][type='Secondary Highway'],\n {\n line-width: 0.1;\n }\n\n [scalerank>=3][scalerank<=5] {\n line-width: 1.5;\n }\n }\n\n [zoom=8] {\n [scalerank<=8] {\n line-width: 0.1;\n }\n\n [type='Beltway'],\n [scalerank<=8][expressway=1],\n {\n line-width: 1.5;\n }\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n#land {\n \/\/ TODO polygon seams\n polygon-fill: @color_physical_bright;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n#buildings-med {\n [area>=40000] {\n polygon-pattern-file: url(\"images\/stripe_sm.png\");\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n}\n\n#buildings-high {\n [zoom>=14] {\n [area>=20000] {\n polygon-pattern-file: url(\"images\/stripe_med.png\");\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n [zoom>=16] {\n line-width: 0.5;\n }\n\n [zoom=15][area>=16000],\n [zoom=16][area>=8000],\n [zoom=17][area>=4000],\n [zoom>=18],\n {\n polygon-pattern-file: url(\"images\/stripe.png\");\n polygon-pattern-alignment: global;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=45074542],\n [osm_id=224030635], \/\/ Seth's house\n {\n polygon-pattern-file: url(\"images\/stripe_color.png\");\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-pattern-alignment: global;\n polygon-pattern-file: url(\"images\/halftone2.png\");\n \n [type='nature_reserve'] {\n polygon-pattern-file: url(\"images\/halftone2-transparent.png\");\n }\n}\n\n#brown-areas-low[zoom=10][area>5000000],\n#brown-areas-med[zoom=11][area>1000000],\n#brown-areas-med[zoom=12][area> 500000],\n#brown-areas-med[zoom=12][area> 200000],\n#brown-areas-med[zoom=13][area> 75000],\n#brown-areas-high[zoom=14][area> 10000],\n#brown-areas-high[zoom>14],\n{\n polygon-pattern-alignment: global;\n polygon-pattern-file: url(\"images\/halftone2.png\");\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [zoom>=15] {\n line-color: @color_airport_runways_detail;\n }\n\n [aeroway='runway'] {\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [aeroway='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n.roads {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_tunnel='yes']\n {\n [zoom>=14]\n {\n ::casing {\n line-opacity: 0.5;\n }\n\n ::outline {\n line-opacity: 0.5;\n }\n }\n\n [zoom>=15]\n {\n line-opacity: 0; \/\/ vs. line-width: 0 to override subsequent styling\n }\n }\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n.roads[kind='highway']\n{\n [zoom>=9] {\n ::outline {\n line-width: 4.25;\n }\n\n line-width: 1.5;\n }\n\n [zoom>=10] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n line-width: 2.5;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n\n [is_bridge='yes'] {\n ::outline {\n line-width: 3;\n }\n }\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 8;\n }\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 2.5;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 6;\n }\n }\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::casing {\n line-color: @color_transport_casing;\n }\n }\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n }\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 42;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 44;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n line-color: @color_transport;\n }\n\n line-width: 10;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 15;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 49;\n line-color: @color_transport;\n }\n\n line-width: 35;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 51;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 21;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n }\n }\n }\n }\n}\n\n.roads[kind='major_road']\n{\n [zoom<=12] {\n line-color: #000;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n line-width: 1.5;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 1.9;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 6;\n }\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 1.9;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 6;\n }\n }\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.25;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::casing {\n line-color: @color_transport_casing;\n }\n }\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n }\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 24;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n line-color: @color_transport;\n }\n\n line-width: 9;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 14;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 32;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 17;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 18;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n }\n }\n }\n }\n}\n\n.roads[kind='minor_road']\n{\n [zoom<=14] {\n line-color: #999;\n }\n\n [zoom>=16] {\n line-color: @color_transport_minor;\n }\n\n [zoom>=10] {\n line-width: 0.2;\n }\n\n [zoom>=13] {\n line-width: 0.4;\n }\n\n [zoom>=14] {\n line-width: 0.8;\n }\n\n [zoom>=15] {\n line-width: 1.5;\n\n [is_tunnel='yes'] {\n ::casing {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n.roads[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 9;\n line-dasharray: 4,7;\n }\n\n line-width: 4;\n }\n}\n\n.roads[highway='service']\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 6;\n }\n\n line-width: 4;\n }\n}\n\n.roads[kind='path']\n{\n ::casing {\n line-color: @color_transport_path;\n }\n\n line-color: @color_transport_casing;\n\n [zoom>=15] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 1.5;\n line-cap: butt;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 3;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n\n","old_contents":"@color_physical: #000;\n@color_physical_bright: #fff;\n@color_water: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #000;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc;\n@color_transport_minor: #ccc;\n@color_transport_rail: #444;\n@color_transport_path: #ededed;\n@color_building_outline: #000;\n@color_building_outline_special: #00aeef;\n@color_airport_runways: #eee;\n@color_airport_runways_detail: #f2f2f2;\n\nMap {\n background-color: @color_physical;\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#country-shapes-110m {\n line-width: 0.25;\n polygon-fill: @color_administrative_bright;\n}\n\n#land-shapes-110m,\n#country-shapes-50m,\n#country-shapes-10m,\n{\n line-width: 0.25;\n polygon-fill: @color_physical_bright;\n}\n\n.country-boundary-10m {\n ::whiteout {\n [zoom>=7] {\n line-color: @color_administrative_bright;\n line-width: 2;\n }\n }\n\n [zoom>=6] {\n line-color: @color_administrative_dark;\n line-width: 1.2;\n }\n\n [zoom>=7] {\n line-width: 1.2;\n line-dasharray: 3,7;\n line-cap: round;\n }\n}\n\n#admin1-lines-50m {\n line-width: 0.35;\n line-color: @color_administrative_dark;\n}\n\n#admin1-lines-10m {\n [zoom>=6] {\n line-width: 0.6;\n line-color: @color_administrative_dark;\n }\n\n [zoom>=7] {\n line-width: 1.5;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8] {\n line-width: 2.0;\n line-color: @color_administrative_medium_high;\n }\n\n [zoom>=9] {\n line-color: @color_administrative_medium_high2;\n }\n}\n\n#lakes-110m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 0;\n\n [zoom=7][scalerank<=7] {\n line-width: 2.25;\n }\n\n [zoom=8][scalerank<=8] {\n line-width: 3.25;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=6][scalerank>=3][scalerank<=6] {\n line-width: 0.1;\n }\n\n [zoom=7] {\n [scalerank<=6],\n [scalerank<=7][expressway=1],\n [scalerank<=7][type='Major Highway'],\n [scalerank<=7][type='Secondary Highway'],\n {\n line-width: 0.1;\n }\n\n [scalerank>=3][scalerank<=5] {\n line-width: 1.5;\n }\n }\n\n [zoom=8] {\n [scalerank<=8] {\n line-width: 0.1;\n }\n\n [type='Beltway'],\n [scalerank<=8][expressway=1],\n {\n line-width: 1.5;\n }\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n#land {\n \/\/ TODO polygon seams\n polygon-fill: @color_physical_bright;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n#buildings-med {\n [area>=40000] {\n polygon-pattern-file: url(\"images\/stripe_sm.png\");\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n}\n\n#buildings-high {\n [zoom>=14] {\n [area>=20000] {\n polygon-pattern-file: url(\"images\/stripe_med.png\");\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n [zoom>=16] {\n line-width: 0.5;\n }\n\n [zoom=15][area>=16000],\n [zoom=16][area>=8000],\n [zoom=17][area>=4000],\n [zoom>=18],\n {\n polygon-pattern-file: url(\"images\/stripe2.png\");\n polygon-pattern-alignment: global;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=45074542],\n [osm_id=224030635], \/\/ Seth's house\n {\n polygon-pattern-file: url(\"images\/stripe_color.png\");\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-pattern-alignment: global;\n polygon-pattern-file: url(\"images\/halftone2.png\");\n \n [type='nature_reserve'] {\n polygon-pattern-file: url(\"images\/halftone2-transparent.png\");\n }\n}\n\n#brown-areas-low[zoom=10][area>5000000],\n#brown-areas-med[zoom=11][area>1000000],\n#brown-areas-med[zoom=12][area> 500000],\n#brown-areas-med[zoom=12][area> 200000],\n#brown-areas-med[zoom=13][area> 75000],\n#brown-areas-high[zoom=14][area> 10000],\n#brown-areas-high[zoom>14],\n{\n polygon-pattern-alignment: global;\n polygon-pattern-file: url(\"images\/halftone2.png\");\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [zoom>=15] {\n line-color: @color_airport_runways_detail;\n }\n\n [aeroway='runway'] {\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [aeroway='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n.roads {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_tunnel='yes']\n {\n [zoom>=14]\n {\n ::casing {\n line-opacity: 0.5;\n }\n\n ::outline {\n line-opacity: 0.5;\n }\n }\n\n [zoom>=15]\n {\n line-opacity: 0; \/\/ vs. line-width: 0 to override subsequent styling\n }\n }\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n.roads[kind='highway']\n{\n [zoom>=9] {\n ::outline {\n line-width: 4.25;\n }\n\n line-width: 1.5;\n }\n\n [zoom>=10] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n line-width: 2.5;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n\n [is_bridge='yes'] {\n ::outline {\n line-width: 3;\n }\n }\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 8;\n }\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 2.5;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 6;\n }\n }\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::casing {\n line-color: @color_transport_casing;\n }\n }\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n }\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 42;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 44;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n line-color: @color_transport;\n }\n\n line-width: 10;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 15;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 49;\n line-color: @color_transport;\n }\n\n line-width: 35;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 51;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 21;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n }\n }\n }\n }\n}\n\n.roads[kind='major_road']\n{\n [zoom<=12] {\n line-color: #000;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n line-width: 1.5;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 1.9;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 6;\n }\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 1.9;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 6;\n }\n }\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.25;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::casing {\n line-color: @color_transport_casing;\n }\n }\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n }\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 24;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n line-color: @color_transport;\n }\n\n line-width: 9;\n line-color: @color_transport_inline;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 14;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 32;\n }\n }\n\n [is_link='yes'] {\n ::casing {\n line-width: 17;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n\n [is_bridge='yes'] {\n ::casing {\n line-width: 18;\n }\n }\n }\n\n [is_tunnel='yes'] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n }\n }\n }\n }\n}\n\n.roads[kind='minor_road']\n{\n [zoom<=14] {\n line-color: #999;\n }\n\n [zoom>=16] {\n line-color: @color_transport_minor;\n }\n\n [zoom>=10] {\n line-width: 0.2;\n }\n\n [zoom>=13] {\n line-width: 0.4;\n }\n\n [zoom>=14] {\n line-width: 0.8;\n }\n\n [zoom>=15] {\n line-width: 1.5;\n\n [is_tunnel='yes'] {\n ::casing {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n.roads[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 9;\n line-dasharray: 4,7;\n }\n\n line-width: 4;\n }\n}\n\n.roads[highway='service']\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 6;\n }\n\n line-width: 4;\n }\n}\n\n.roads[kind='path']\n{\n ::casing {\n line-color: @color_transport_path;\n }\n\n line-color: @color_transport_casing;\n\n [zoom>=15] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 1.5;\n line-cap: butt;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 3;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"7b2a555ca95c188cb5601baa656c2866fc3bd36d","subject":"more abstraction of stylesheet. less labels at low zooms. change opacity of roads at low zooms making them more visible.","message":"more abstraction of stylesheet. less labels at low zooms. change opacity of roads at low zooms making them more visible.\n","repos":"andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto","old_file":"osmt\/highway.mss","new_file":"osmt\/highway.mss","new_contents":"\n@path_halo_opacity: 0.7;\n@path_halo_colour: white;\n\n\n\n\/* highway labels *\/\n@highway_face_name: \"Liberation Sans Regular\";\n@highway_text_fill: white;\n@highway_halo_fill: black;\n@highway_halo_radius: 2.0;\n\n#highway-labels[highway='footway'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='cycleway'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='path'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='track'][zoom > 13] { \n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n#highway-labels[highway='service'][zoom > 16] { \n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='residential'][zoom > 15] { \n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='unclassified'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='tertiary'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='secondary'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='primary'][zoom > 13] { \n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='trunk'][zoom > 12] { \n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='motorway'][zoom > 11] { \n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n\/* default style for all path, footway, track, cycleways and roads *\/\n.highway {\n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n \n line-width: 1;\n}\n\n\/* defaults for roads with cars *\/\n.road[zoom > 11] {\n ::oneway_arrow[oneway='yes'][zoom > 14] {\n marker-type: arrow;\n \n marker-width: 2;\n marker-line-width: 2;\n \n marker-opacity: 1.0;\n marker-line-opacity: 1.0;\n \n marker-fill: white;\n marker-line-color: white;\n \n marker-spacing: 100;\n }\n \n line-color: #000000;\n line-join: round;\n line-cap: round;\n \n line-width: 1;\n \n [zoom > 17] { line-width: 15; line-opacity: 0.5; }\n [zoom = 17] { line-width: 10; line-opacity: 0.5; }\n [zoom = 16] { line-width: 5; line-opacity: 0.5; }\n [zoom = 15] { line-width: 2.25; line-opacity: 0.6; }\n [zoom = 14] { line-width: 1.5; line-opacity: 0.7; }\n [zoom = 13] { line-width: 1; line-opacity: 0.8; }\n [zoom = 12] { line-width: 0.5; line-opacity: 0.8; }\n \n ::bridge[bridge='yes'] {\n \/*\n ideally we would draw two lines outside the existing line,\n but the current compositing method in mapnik won't allow this\n so easily with transparency\n \n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n \n [zoom > 17] { line-width: 20; }\n [zoom = 17] { line-width: 15; }\n [zoom = 16] { line-width: 7; }\n [zoom = 15] { line-width: 3; }\n [zoom = 14] { line-width: 2; }\n [zoom = 13] { line-width: 1.5; }\n [zoom = 12] { line-width: 0.75; }\n *\/\n }\n \n}\n\n.highway#footway[zoom > 13] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n \n line-color: #FF0000;\n line-dasharray: 2,2;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom < 17] { line-width: 1.5; line-dasharray: 1,2 }\n \n [highway='steps']{\n line-cap: butt;\n \n [zoom > 18] { line-dasharray: 3,4 }\n [zoom = 18] { line-dasharray: 2,3 }\n [zoom < 18] { line-dasharray: 1,2 }\n }\n \n}\n\n.highway#path[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n line-color: #000000;\n line-dasharray: 2,2;\n line-opacity: 1.0;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom < 17] { line-width: 1.5; line-dasharray: 1,2 }\n \n}\n\n.highway#track[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 16 }\n [zoom = 18] { line-width: 10 }\n [zoom = 17] { line-width: 6 }\n [zoom = 16] { line-width: 4.5 }\n [zoom = 15] { line-width: 3.2 }\n [zoom = 14] { line-width: 3 }\n [zoom = 13] { line-width: 2.4 }\n }\n \n line-color: #6d4f15;\n line-opacity: 1.0;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 3,4 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 3,4 }\n [zoom = 16] { line-width: 2.1; line-dasharray: 3,4 }\n [zoom = 15] { line-width: 1.8; line-dasharray: 3,4 }\n [zoom = 14] { line-width: 1.5; line-dasharray: 3,4 }\n [zoom = 13] { line-width: 1.2 ; line-dasharray: 3,4 }\n\n}\n\n.highway#cycleway[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n \n line-color: #0900ff;\n line-dasharray: 2,2;\n line-opacity: 1.0;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom < 17] { line-width: 1.5; line-dasharray: 1,2 }\n\n}\n\n.road#service[zoom > 11] {\n [zoom > 17] { line-width: 7.5; }\n [zoom = 17] { line-width: 5; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 1; }\n [zoom = 14] { line-width: 0.75; }\n [zoom = 13] { line-width: 0.5; }\n [zoom = 12] { line-width: 0.25; }\n \n [service='parking_aisle'][zoom > 14] {\n [zoom > 17] { line-width: 3; }\n [zoom = 17] { line-width: 2.5; }\n [zoom = 16] { line-width: 1.25; }\n [zoom = 15] { line-width: 0.25; }\n }\n}\n\n#turning-circle[zoom > 11] {\n marker-type: ellipse;\n marker-placement: point;\n \n marker-fill: #000000;\n marker-opacity: 0.5;\n marker-line-width: 0;\n \n [zoom > 17] { marker-width: 10; }\n [zoom = 17] { marker-width: 7.5; }\n [zoom = 16] { marker-width: 3.5; }\n [zoom = 15] { marker-width: 1.75; }\n [zoom = 14] { marker-width: 1; }\n [zoom = 13] { marker-width: 0.75; }\n [zoom = 12] { marker-width: 0.3; }\n}\n\n.road#residential[zoom > 11] {\n ::living_street[highway='living_street'][zoom > 14] {\n line-cap: square;\n line-dasharray: 3,3;\n line-color: #76d276;\n \n [zoom > 17] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n }\n \n [zoom > 17] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n \n}\n\n.road#unclassified{\n}\n\n.road#tertiary{\n line-color: #faf555;\n}\n\n.road#secondary{\n line-color: #d46833;\n}\n\n.road#primary{\n line-color: #cc3737;\n}\n\n.road#trunk{\n line-color: #243a7a;\n}\n\n.road#motorway{\n line-color: #7a2424;\n}","old_contents":"\n@path_halo_opacity: 0.7;\n@path_halo_colour: white;\n\n\/* highway labels *\/\n#highway-labels[highway='footway'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='cycleway'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='path'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='track'][zoom > 13] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n#highway-labels[highway='service'][zoom > 16] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='residential'][zoom > 15] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='unclassified'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='tertiary'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='secondary'][zoom > 13] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='primary'][zoom > 12] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='trunk'][zoom > 12] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='motorway'][zoom > 11] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n\n.highway {\n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n \n line-width: 1;\n}\n\n.road[zoom > 11] {\n ::oneway_arrow[oneway='yes'][zoom > 14] {\n marker-type: arrow;\n \n marker-width: 2;\n marker-line-width: 2;\n \n marker-opacity: 1.0;\n marker-line-opacity: 1.0;\n \n marker-fill: white;\n marker-line-color: white;\n \n marker-spacing: 100;\n }\n \n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n \n line-width: 1;\n \n [zoom > 17] { line-width: 15; }\n [zoom = 17] { line-width: 10; }\n [zoom = 16] { line-width: 5; }\n [zoom = 15] { line-width: 2.25; }\n [zoom = 14] { line-width: 1.5; }\n [zoom = 13] { line-width: 1; }\n [zoom = 12] { line-width: 0.5; }\n \n ::bridge[bridge='yes'] {\n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n \n [zoom > 17] { line-width: 20; }\n [zoom = 17] { line-width: 15; }\n [zoom = 16] { line-width: 7; }\n [zoom = 15] { line-width: 3; }\n [zoom = 14] { line-width: 2; }\n [zoom = 13] { line-width: 1.5; }\n [zoom = 12] { line-width: 0.75; }\n }\n \n}\n\n.highway#footway[zoom > 9] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n \n line-color: #FF0000;\n line-dasharray: 2,2;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom < 17] { line-width: 1.5; line-dasharray: 1,2 }\n \n [footway='sidewalk']{\n line-color: #0000FF;\n }\n \n [highway='steps']{\n line-cap: butt;\n \n [zoom > 18] { line-dasharray: 3,4 }\n [zoom = 18] { line-dasharray: 2,3 }\n [zoom < 18] { line-dasharray: 1,2 }\n }\n \n}\n\n.highway#path[zoom > 9] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n line-color: #000000;\n line-dasharray: 2,2;\n line-opacity: 1.0;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom < 17] { line-width: 1.5; line-dasharray: 1,2 }\n \n}\n\n.highway#track[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 16 }\n [zoom = 18] { line-width: 10 }\n [zoom = 17] { line-width: 6 }\n [zoom = 16] { line-width: 4.5 }\n [zoom = 15] { line-width: 3.2 }\n [zoom = 14] { line-width: 3 }\n [zoom = 13] { line-width: 2.4 }\n }\n \n line-color: #6d4f15;\n line-opacity: 1.0;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 3,4 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 3,4 }\n [zoom = 16] { line-width: 2.1; line-dasharray: 3,4 }\n [zoom = 15] { line-width: 1.8; line-dasharray: 3,4 }\n [zoom = 14] { line-width: 1.5; line-dasharray: 3,4 }\n [zoom = 13] { line-width: 1.2 ; line-dasharray: 3,4 }\n\n}\n\n.highway#cycleway[zoom > 9] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n \n line-color: #0900ff;\n line-dasharray: 2,2;\n line-opacity: 1.0;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom < 17] { line-width: 1.5; line-dasharray: 1,2 }\n\n}\n\n.road#service[zoom > 11] {\n [zoom > 17] { line-width: 7.5; }\n [zoom = 17] { line-width: 5; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 1; }\n [zoom = 14] { line-width: 0.75; }\n [zoom = 13] { line-width: 0.5; }\n [zoom = 12] { line-width: 0.25; }\n \n [service='parking_aisle'][zoom > 14] {\n [zoom > 17] { line-width: 3; }\n [zoom = 17] { line-width: 2.5; }\n [zoom = 16] { line-width: 1.25; }\n [zoom = 15] { line-width: 0.25; }\n }\n}\n\n#turning-circle[zoom > 11] {\n marker-type: ellipse;\n marker-placement: point;\n \n marker-fill: #000000;\n marker-opacity: 0.5;\n marker-line-width: 0;\n \n [zoom > 17] { marker-width: 10; }\n [zoom = 17] { marker-width: 7.5; }\n [zoom = 16] { marker-width: 3.5; }\n [zoom = 15] { marker-width: 1.75; }\n [zoom = 14] { marker-width: 1; }\n [zoom = 13] { marker-width: 0.75; }\n [zoom = 12] { marker-width: 0.3; }\n}\n\n.road#residential[zoom > 11] {\n [highway='living_street'] {\n line-color: #76d276;\n }\n \n [zoom > 17] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n \n}\n\n.road#unclassified{\n}\n\n.road#tertiary{\n line-color: #faf555;\n}\n\n.road#secondary{\n line-color: #d46833;\n}\n\n.road#primary{\n line-color: #cc3737;\n}\n\n.road#trunk{\n line-color: #243a7a;\n}\n\n.road#motorway{\n line-color: #7a2424;\n}","returncode":0,"stderr":"","license":"cc0-1.0","lang":"CartoCSS"} {"commit":"aefaf953c36af15ea88fad9c6d357c949e5c1db4","subject":"Fix broken link in geography-class.","message":"Fix broken link in geography-class.\n","repos":"MappingKat\/tilemill,Zhao-Qi\/tilemill,Teino1978-Corp\/Teino1978-Corp-tilemill,tilemill-project\/tilemill,Teino1978-Corp\/Teino1978-Corp-tilemill,nyimbi\/tilemill,tizzybec\/tilemill,mbrukman\/tilemill,tilemill-project\/tilemill,nyimbi\/tilemill,Teino1978-Corp\/Teino1978-Corp-tilemill,tizzybec\/tilemill,tilemill-project\/tilemill,MappingKat\/tilemill,fxtentacle\/tilemill,mbrukman\/tilemill,Zhao-Qi\/tilemill,paulovieira\/tilemill-clima,paulovieira\/tilemill-clima,tizzybec\/tilemill,MappingKat\/tilemill,nyimbi\/tilemill,fxtentacle\/tilemill,florianf\/tileoven,mbrukman\/tilemill,Zhao-Qi\/tilemill,paulovieira\/tilemill-clima,Teino1978-Corp\/Teino1978-Corp-tilemill,fxtentacle\/tilemill,Zhao-Qi\/tilemill,tizzybec\/tilemill,paulovieira\/tilemill-clima,Zhao-Qi\/tilemill,florianf\/tileoven,nyimbi\/tilemill,MappingKat\/tilemill,florianf\/tileoven,MappingKat\/tilemill,Teino1978-Corp\/Teino1978-Corp-tilemill,mbrukman\/tilemill,paulovieira\/tilemill-clima,fxtentacle\/tilemill,tizzybec\/tilemill,mbrukman\/tilemill,nyimbi\/tilemill,fxtentacle\/tilemill","old_file":"examples\/geography-class\/style.mss","new_file":"examples\/geography-class\/style.mss","new_contents":"\/**********************************************************\n\n'Geography Class'\n=================\n\nNote that this map doing some rather complex things thus\nslowish rendering should not be surprising. A pre-rendered\ndemo is online at \n\nHover Interaction & Embedded Data\n---------------------------------\n\nWhen you move your cursor around the map you should see the \nname and flag of the country you are hovering over appear\nin the top right. You can pull any attributes from a data\nlayer to form tooltips like this. Here, we are pulling a \ntext attribute and a base64-encoded PNG image from a GeoJSON\nfile of country polygons. Click on the settings wrench at the\ntop right, then on the 'Tooltips' tab to see how this was\nset up.\n\nLayers overview\n---------------\n\n### country-interaction [countries_interaction.geojson]\n\nThis is an invisible layer used to add hover interactivity\nto the map. It is derived fro the 1:50M resolution Natural\nEarth dataset. GeoJSON was chosen over shapefile in this\ninstance to allow for the inclusion of base64-encoded PNG\ndata (not possible in a DBF due to the limit of\n255 bytes per cell).\n\n### paper [world_extent_merc.geojson]\n\nThe shapefile is a rectangle extending to the bounds of the \nmap filled with a repeating transparent pattern to give the \nmap a folded paper texture.\n\n### cities [populated_places_by_pop.zip]\n\nThis is essentially Natural Earth's Populated Places \nshapefile, but the elements have been reordered such by\npopulation (descending). This is to take advantage of the \nfact that Mapnik will give priority to elements stored first\nin the datasource. Using various classification attributes \nin the shapefile, only certain cities will be shown at \ncertain zoom levels.\n\n### country-name [country-labels.zip]\n\nLabeled points of the world's country names. Derived from \nNatural Earth Data but hand-tweaked by MapBox.\n\n### geo-lines [geographic-lines.zip]\n\nImportant lines such as the equator, Arctic and Antarctic \ncircles, and the international date line.\n\n### admin-0-line-land [admin-0-line-land.zip]\n\nThese are international borders that occur over land or \nlakes. International maritime borders are a separate layer.\n\n### lakes [lakes.zip]\n\nThe world's lakes. The style is designed such that smaller \nlakes only appear as you zoom in.\n\n### rivers [rivers_lake_centerlines_scale_ranks.zip]\n\n### country [admin_0_countries.zip]\n\nCountries - the rainbow.mss stylesheet colors each of these\nindividually.\n\n### land-glow [admin_0_countries.zip]\n\nA copy of the country layer providing the shadow\/glow around\nthe continents.\n \n***********************************************************************\/\n\n@water: #ddeeff;\n@land: #ffffdd;\n@line: #226688;\n\n\/* Water bodies *\/\nMap { \n background-color: @water;\n}\n\n\/* Required to 'activate' the polygons for interactivity *\/\n#country-interaction { \n polygon-opacity:0;\n}\n\n#lakes[ScaleRank<3][zoom=3],\n#lakes[ScaleRank<4][zoom=4],\n#lakes[ScaleRank<5][zoom=5],\n#lakes[ScaleRank<6][zoom>=6] {\n polygon-fill:@water;\n line-color:darken(@water, 20%);\n line-width:0.3;\n}\n#lakes[ScaleRank<3][zoom=3] {\n line-width:0.4;\n}\n#lakes[ScaleRank<4][zoom=4] {\n line-width:0.5;\n}\n#lakes[ScaleRank<5][zoom=5] {\n line-width:0.6;\n}\n#lakes[ScaleRank<6][zoom>=6] {\n line-width:0.8;\n}\n\n#rivers[SCALERANK=1][zoom>=3],\n#rivers[SCALERANK=2][zoom>=4],\n#rivers[SCALERANK=3][zoom>=5],\n#rivers[SCALERANK=4][zoom>=5],\n#rivers[SCALERANK=5][zoom>=6],\n#rivers[SCALERANK=6][zoom>=6],\n#rivers[SCALERANK=7][zoom>=7],\n#rivers[SCALERANK=8][zoom>=7],\n#rivers[SCALERANK=9][zoom>=8] {\n line-color:@line * 1.5;\n line-join:round;\n}\n#rivers[SCALERANK=1][zoom=3],\n#rivers[SCALERANK=2][zoom=4],\n#rivers[SCALERANK=3][zoom=5],\n#rivers[SCALERANK=4][zoom=5],\n#rivers[SCALERANK=5][zoom=6],\n#rivers[SCALERANK=6][zoom=6],\n#rivers[SCALERANK=7][zoom=7],\n#rivers[SCALERANK=8][zoom=7],\n#rivers[SCALERANK=9][zoom=8] {\n line-width:0.2;\n line-opacity:0.4;\n}\n#rivers[SCALERANK=1][zoom=4],\n#rivers[SCALERANK=2][zoom=5],\n#rivers[SCALERANK=3][zoom=6],\n#rivers[SCALERANK=4][zoom=6],\n#rivers[SCALERANK=5][zoom=7],\n#rivers[SCALERANK=6][zoom=7],\n#rivers[SCALERANK=7][zoom=8],\n#rivers[SCALERANK=8][zoom=8],\n#rivers[SCALERANK=9][zoom=9] {\n line-width:0.4;\n line-opacity:0.6;\n}\n#rivers[SCALERANK=1][zoom=5],\n#rivers[SCALERANK=2][zoom=6],\n#rivers[SCALERANK=3][zoom=7],\n#rivers[SCALERANK=4][zoom=7],\n#rivers[SCALERANK=5][zoom=8],\n#rivers[SCALERANK=6][zoom=8],\n#rivers[SCALERANK=7][zoom=9],\n#rivers[SCALERANK=8][zoom=9],\n#rivers[SCALERANK=9][zoom=10] {\n line-width:0.6;\n line-opacity:0.8;\n}\n#rivers[SCALERANK=1][zoom=6],\n#rivers[SCALERANK=2][zoom=7],\n#rivers[SCALERANK=3][zoom=8],\n#rivers[SCALERANK=4][zoom=8],\n#rivers[SCALERANK=5][zoom=9],\n#rivers[SCALERANK=6][zoom=9],\n#rivers[SCALERANK=7][zoom=10],\n#rivers[SCALERANK=8][zoom=10],\n#rivers[SCALERANK=9][zoom=11] {\n line-width:0.8;\n line-opacity:1;\n}\n\n#glacier { \n polygon-fill:#fff;\n polygon-opacity:0.5;\n}\n\n\/* Useful\/significant lines *\/\n#geo-lines[ScaleRank<10] {\n line-color:@line;\n line-dasharray:6,2;\n [zoom=0] { line-width:0.2; }\n [zoom=1] { line-width:0.4; }\n [zoom=2] { line-width:0.6; }\n [zoom=3] { line-width:0.8; }\n [zoom>3] { line-width:1; }\n}\n\n.border.country[zoom>1],\n.border.disputed[zoom>2] {\n line-width:1;\n line-color:#fff;\n line-join:round;\n .country[FeatureCla='Disputed (please verify)'] {\n [zoom=3] { line-dasharray:4,1; }\n [zoom=4] { line-dasharray:5,2; }\n [zoom=5] { line-dasharray:6,2; }\n [zoom=6] { line-dasharray:8,3; }\n [zoom>6] { line-dasharray:10,3; }\n }\n .disputed[FeatureCla='Breakaway'] {\n [zoom=3] { line-dasharray: 3,2; }\n [zoom=4] { line-dasharray: 4,4; }\n [zoom=5] { line-dasharray: 5,5; }\n [zoom=6] { line-dasharray: 6,6; }\n [zoom>6] { line-dasharray: 8,8; }\n }\n .disputed[FeatureCla='Claim boundary'] { \n line-dasharray: 1,3;\n [zoom>6] { line-dasharray: 2,4; }\n }\n .country[FeatureCla='Indefinite (please verify)'] {\n line-dasharray: 6,1;\n }\n}\n\n#state[ADM0_A3=\"USA\"],\n#state[ADM0_A3=\"CAN\"],\n#state[ADM0_A3=\"AUS\"] {\n [zoom>3] {\n line-color:@line;\n line-opacity:0.25;\n line-width:1.2;\n line-dasharray:6,2,2,2;\n }\n}\n\n\/* Transparent PNG overlay for paper texture *\/\n#paper[zoom<2] { \n polygon-pattern-file:url(textures\/paperfolds_256.png);\n}\n#paper[zoom>1] { \n polygon-pattern-file:url(textures\/paperfolds_512.png);\n}\n","old_contents":"\/**********************************************************\n\n'Geography Class'\n=================\n\nNote that this map doing some rather complex things thus\nslowish rendering should not be surprising. A pre-rendered\ndemo is online at \n\nHover Interaction & Embedded Data\n---------------------------------\n\nWhen you move your cursor around the map you should see the \nname and flag of the country you are hovering over appear\nin the top right. You can pull any attributes from a data\nlayer to form tooltips like this. Here, we are pulling a \ntext attribute and a base64-encoded PNG image from a GeoJSON\nfile of country polygons. Click on the settings wrench at the\ntop right, then on the 'Tooltips' tab to see how this was\nset up.\n\nLayers overview\n---------------\n\n### country-interaction [countries_interaction.geojson]\n\nThis is an invisible layer used to add hover interactivity\nto the map. It is derived fro the 1:50M resolution Natural\nEarth dataset. GeoJSON was chosen over shapefile in this\ninstance to allow for the inclusion of base64-encoded PNG\ndata (not possible in a DBF due to the limit of\n255 bytes per cell).\n\n### paper [world_extent_merc.geojson]\n\nThe shapefile is a rectangle extending to the bounds of the \nmap filled with a repeating transparent pattern to give the \nmap a folded paper texture.\n\n### cities [populated_places_by_pop.zip]\n\nThis is essentially Natural Earth's Populated Places \nshapefile, but the elements have been reordered such by\npopulation (descending). This is to take advantage of the \nfact that Mapnik will give priority to elements stored first\nin the datasource. Using various classification attributes \nin the shapefile, only certain cities will be shown at \ncertain zoom levels.\n\n### country-name [country-labels.zip]\n\nLabeled points of the world's country names. Derived from \nNatural Earth Data but hand-tweaked by MapBox.\n\n### geo-lines [geographic-lines.zip]\n\nImportant lines such as the equator, Arctic and Antarctic \ncircles, and the international date line.\n\n### admin-0-line-land [admin-0-line-land.zip]\n\nThese are international borders that occur over land or \nlakes. International maritime borders are a separate layer.\n\n### lakes [lakes.zip]\n\nThe world's lakes. The style is designed such that smaller \nlakes only appear as you zoom in.\n\n### rivers [rivers_lake_centerlines_scale_ranks.zip]\n\n### country [admin_0_countries.zip]\n\nCountries - the rainbow.mss stylesheet colors each of these\nindividually.\n\n### land-glow [admin_0_countries.zip]\n\nA copy of the country layer providing the shadow\/glow around\nthe continents.\n \n***********************************************************************\/\n\n@water: #ddeeff;\n@land: #ffffdd;\n@line: #226688;\n\n\/* Water bodies *\/\nMap { \n background-color: @water;\n}\n\n\/* Required to 'activate' the polygons for interactivity *\/\n#country-interaction { \n polygon-opacity:0;\n}\n\n#lakes[ScaleRank<3][zoom=3],\n#lakes[ScaleRank<4][zoom=4],\n#lakes[ScaleRank<5][zoom=5],\n#lakes[ScaleRank<6][zoom>=6] {\n polygon-fill:@water;\n line-color:darken(@water, 20%);\n line-width:0.3;\n}\n#lakes[ScaleRank<3][zoom=3] {\n line-width:0.4;\n}\n#lakes[ScaleRank<4][zoom=4] {\n line-width:0.5;\n}\n#lakes[ScaleRank<5][zoom=5] {\n line-width:0.6;\n}\n#lakes[ScaleRank<6][zoom>=6] {\n line-width:0.8;\n}\n\n#rivers[SCALERANK=1][zoom>=3],\n#rivers[SCALERANK=2][zoom>=4],\n#rivers[SCALERANK=3][zoom>=5],\n#rivers[SCALERANK=4][zoom>=5],\n#rivers[SCALERANK=5][zoom>=6],\n#rivers[SCALERANK=6][zoom>=6],\n#rivers[SCALERANK=7][zoom>=7],\n#rivers[SCALERANK=8][zoom>=7],\n#rivers[SCALERANK=9][zoom>=8] {\n line-color:@line * 1.5;\n line-join:round;\n}\n#rivers[SCALERANK=1][zoom=3],\n#rivers[SCALERANK=2][zoom=4],\n#rivers[SCALERANK=3][zoom=5],\n#rivers[SCALERANK=4][zoom=5],\n#rivers[SCALERANK=5][zoom=6],\n#rivers[SCALERANK=6][zoom=6],\n#rivers[SCALERANK=7][zoom=7],\n#rivers[SCALERANK=8][zoom=7],\n#rivers[SCALERANK=9][zoom=8] {\n line-width:0.2;\n line-opacity:0.4;\n}\n#rivers[SCALERANK=1][zoom=4],\n#rivers[SCALERANK=2][zoom=5],\n#rivers[SCALERANK=3][zoom=6],\n#rivers[SCALERANK=4][zoom=6],\n#rivers[SCALERANK=5][zoom=7],\n#rivers[SCALERANK=6][zoom=7],\n#rivers[SCALERANK=7][zoom=8],\n#rivers[SCALERANK=8][zoom=8],\n#rivers[SCALERANK=9][zoom=9] {\n line-width:0.4;\n line-opacity:0.6;\n}\n#rivers[SCALERANK=1][zoom=5],\n#rivers[SCALERANK=2][zoom=6],\n#rivers[SCALERANK=3][zoom=7],\n#rivers[SCALERANK=4][zoom=7],\n#rivers[SCALERANK=5][zoom=8],\n#rivers[SCALERANK=6][zoom=8],\n#rivers[SCALERANK=7][zoom=9],\n#rivers[SCALERANK=8][zoom=9],\n#rivers[SCALERANK=9][zoom=10] {\n line-width:0.6;\n line-opacity:0.8;\n}\n#rivers[SCALERANK=1][zoom=6],\n#rivers[SCALERANK=2][zoom=7],\n#rivers[SCALERANK=3][zoom=8],\n#rivers[SCALERANK=4][zoom=8],\n#rivers[SCALERANK=5][zoom=9],\n#rivers[SCALERANK=6][zoom=9],\n#rivers[SCALERANK=7][zoom=10],\n#rivers[SCALERANK=8][zoom=10],\n#rivers[SCALERANK=9][zoom=11] {\n line-width:0.8;\n line-opacity:1;\n}\n\n#glacier { \n polygon-fill:#fff;\n polygon-opacity:0.5;\n}\n\n\/* Useful\/significant lines *\/\n#geo-lines[ScaleRank<10] {\n line-color:@line;\n line-dasharray:6,2;\n [zoom=0] { line-width:0.2; }\n [zoom=1] { line-width:0.4; }\n [zoom=2] { line-width:0.6; }\n [zoom=3] { line-width:0.8; }\n [zoom>3] { line-width:1; }\n}\n\n.border.country[zoom>1],\n.border.disputed[zoom>2] {\n line-width:1;\n line-color:#fff;\n line-join:round;\n .country[FeatureCla='Disputed (please verify)'] {\n [zoom=3] { line-dasharray:4,1; }\n [zoom=4] { line-dasharray:5,2; }\n [zoom=5] { line-dasharray:6,2; }\n [zoom=6] { line-dasharray:8,3; }\n [zoom>6] { line-dasharray:10,3; }\n }\n .disputed[FeatureCla='Breakaway'] {\n [zoom=3] { line-dasharray: 3,2; }\n [zoom=4] { line-dasharray: 4,4; }\n [zoom=5] { line-dasharray: 5,5; }\n [zoom=6] { line-dasharray: 6,6; }\n [zoom>6] { line-dasharray: 8,8; }\n }\n .disputed[FeatureCla='Claim boundary'] { \n line-dasharray: 1,3;\n [zoom>6] { line-dasharray: 2,4; }\n }\n .country[FeatureCla='Indefinite (please verify)'] {\n line-dasharray: 6,1;\n }\n}\n\n#state[ADM0_A3=\"USA\"],\n#state[ADM0_A3=\"CAN\"],\n#state[ADM0_A3=\"AUS\"] {\n [zoom>3] {\n line-color:@line;\n line-opacity:0.25;\n line-width:1.2;\n line-dasharray:6,2,2,2;\n }\n}\n\n\/* Transparent PNG overlay for paper texture *\/\n#paper[zoom<2] { \n polygon-pattern-file:url(textures\/paperfolds_256.png);\n}\n#paper[zoom>1] { \n polygon-pattern-file:url(textures\/paperfolds_512.png);\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"3a854319758315b3907d8c7edd69a4b37214c09d","subject":"minor text fixes","message":"minor text fixes\n","repos":"silph-io\/osm-silph","old_file":"osm-bright\/roads.mss","new_file":"osm-bright\/roads.mss","new_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n#roads_low[zoom>=5][zoom<=8] {\n [type='motorway'] { line-color: #e4c049; }\n [type='trunk'] { line-color: #e4c049; }\n [zoom=5] {\n [type='motorway'] { line-width: 0.8; }\n [type='trunk'] { line-width: 0.4; } }\n [zoom=6] {\n [type='motorway'] { line-width: 1.0; }\n [type='trunk'] { line-width: 0.5; } }\n [zoom=7] {\n [type='motorway'] { line-width: 1.2; }\n [type='trunk'] { line-width: 0.6; } }\n [zoom=8] {\n [type='motorway'] { line-width: 2; }\n [type='trunk'] { line-width: 1.0; } }\n}\n\n\/* At mid-level scales start to show primary and secondary routes\nas well. *\/\n\n#roads_med[zoom>=9][zoom<=10] {\n [type='motorway'],\n [type='motorway_link'] {\n line-color: #e4c049;\n }\n\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_line;\n }\n\n [zoom=9] {\n [type='motorway'],[type='trunk'] { line-width: 2.4; }\n \/*\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.6; }\n *\/\n }\n [zoom=10] {\n [type='motorway'],[type='trunk'] { line-width: 2.8; }\n [type='primary'],[type='motorway_link'],[type='trunk_link'] { line-width: 0.8; }\n [type='primary'] { line-color: @primary_line; }\n }\n}\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 1.6; @rdz11_med: 0.8; @rdz11_min: 0.4;\n@rdz12_maj: 2.5; @rdz12_med: 1.2; @rdz12_min: 0.8;\n@rdz13_maj: 3; @rdz13_med: 1.5; @rdz13_min: 1;\n@rdz14_maj: 4; @rdz14_med: 2.5; @rdz14_min: 1.6;\n@rdz15_maj: 6; @rdz15_med: 4; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 14; @rdz17_med: 12; @rdz17_min: 10;\n@rdz18_maj: 20; @rdz18_med: 17; @rdz18_min: 14;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz11_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz12_med + 2; }\n [stylegroup='minorroad']{ line-width: 0 }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz13_med + 2; }\n [stylegroup='minorroad']{ line-width: 0; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz14_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz14_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz15_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz15_min + 2; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz16_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz16_min + 2; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: 0 }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj + 3; }\n [stylegroup='mainroad'] { line-width: @rdz17_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz17_min + 2; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 4; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj + 4; }\n [stylegroup='mainroad'] { line-width: @rdz18_med + 4; }\n [stylegroup='minorroad']{ line-width: @rdz18_min + 3.5; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 6; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; line-color: #e4c049; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4; line-dasharray: 2,1; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4; line-dasharray: 2,2; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4; line-dasharray: 3,3; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","old_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n#roads_low[zoom>=5][zoom<=8] {\n [type='motorway'] { line-color: #e4c049; }\n [type='trunk'] { line-color: @trunk_line; }\n [zoom=5] {\n [type='motorway'] { line-width: 0.8; }\n [type='trunk'] { line-width: 0.2; } }\n [zoom=6] {\n [type='motorway'] { line-width: 1.0; }\n [type='trunk'] { line-width: 0.25; } }\n [zoom=7] {\n [type='motorway'] { line-width: 1.2; }\n [type='trunk'] { line-width: 0.3; } }\n [zoom=8] {\n [type='motorway'] { line-width: 2; }\n [type='trunk'] { line-width: 0.5; } }\n}\n\n\/* At mid-level scales start to show primary and secondary routes\nas well. *\/\n\n#roads_med[zoom>=9][zoom<=10] {\n [type='motorway'],\n [type='motorway_link'] {\n line-color: #e4c049;\n }\n\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_line;\n }\n\n [zoom=9] {\n [type='motorway'],[type='trunk'] { line-width: 2.4; }\n \/*\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.6; }\n *\/\n }\n [zoom=10] {\n [type='motorway'],[type='trunk'] { line-width: 2.8; }\n [type='primary'],[type='motorway_link'],[type='trunk_link'] { line-width: 0.8; }\n [type='primary'] { line-color: @primary_line; }\n }\n}\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 1.6; @rdz11_med: 0.8; @rdz11_min: 0.4;\n@rdz12_maj: 2.5; @rdz12_med: 1.2; @rdz12_min: 0.8;\n@rdz13_maj: 3; @rdz13_med: 1.5; @rdz13_min: 1;\n@rdz14_maj: 4; @rdz14_med: 2.5; @rdz14_min: 1.6;\n@rdz15_maj: 6; @rdz15_med: 4; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 14; @rdz17_med: 12; @rdz17_min: 10;\n@rdz18_maj: 20; @rdz18_med: 17; @rdz18_min: 14;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz11_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz12_med + 2; }\n [stylegroup='minorroad']{ line-width: 0 }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz13_med + 2; }\n [stylegroup='minorroad']{ line-width: 0; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz14_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz14_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz15_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz15_min + 2; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz16_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz16_min + 2; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: 0 }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj + 3; }\n [stylegroup='mainroad'] { line-width: @rdz17_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz17_min + 2; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 4; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj + 4; }\n [stylegroup='mainroad'] { line-width: @rdz18_med + 4; }\n [stylegroup='minorroad']{ line-width: @rdz18_min + 3.5; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 6; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; line-color: #e4c049; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4; line-dasharray: 2,1; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4; line-dasharray: 2,2; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4; line-dasharray: 3,3; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"72abdebc036de4913a144ab883437ea746d45ada","subject":"add midi velocity to notes","message":"add midi velocity to notes\n\n","repos":"music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n\n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n \/\/encodingDesc must preceed workList in MEI 4.0\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = GenerateApplicationInfo();\n libmei.AddChild(encodingD, appI);\n\n \/\/generate workList\n workList = libmei.WorkList();\n Self._property:WorkListElement = workList;\n\n wd_work = libmei.Work();\n wd_title = libmei.Title();\n libmei.AddChild(wd_work, wd_title);\n libmei.AddChild(workList, wd_work);\n libmei.AddChild(header, workList);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.Composer();\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_work, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.Lyricist();\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_work, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.Arranger();\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_work, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n return header;\n} \/\/$end\n\nfunction GenerateApplicationInfo () {\n \/\/$module(ExportGenerators.mss)\n\n appI = libmei.AppInfo();\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return appI;\n\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:SlurResolver = CreateSparseArray();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n \/\/annot is valid as a child of score\n libmei.AddChild(sco, ano);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workList = Self._property:WorkListElement;\n workEl = libmei.Work();\n libmei.AddChild(workList, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n l = null;\n\n mobjs = Self._property:MeasureObjects;\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0 or (l = null and bobj.Type = 'Clef'))\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n\n l._property:CurrentPos = 0;\n }\n }\n\n obj = null;\n mobj = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n \/\/ Clefs are placed inside the musical flow like notes. Hence we also need to find\n \/\/ out whether they are part of beams or tuplets.\n clef = GenerateClef(bobj);\n\n prevNoteRest = PrevNormalOrGrace(bobj, false);\n\n if (prevNoteRest != null)\n {\n prevBeamProp = NormalizedBeamProp(prevNoteRest);\n\n switch (prevBeamProp)\n {\n case ('StartBeam')\n {\n beam = l._property:ActiveBeam;\n }\n case ('NoBeam')\n {\n beam = null;\n }\n default\n {\n \/\/ ContinueBeam and SingleBeam\n nextNoteRest = NextNormalOrGrace(bobj, false);\n if (nextNoteRest != null)\n {\n nextBeamProp = NormalizedBeamProp(nextNoteRest);\n if ((nextBeamProp = ContinueBeam) or (nextBeamProp = SingleBeam))\n {\n beam = l._property:ActiveBeam;\n }\n }\n }\n }\n\n tuplet = l._property:ActiveMeiTuplet;\n while (tuplet != null and tuplet._property:ParentTuplet != null)\n {\n tuplet = tuplet._property:ParentTuplet;\n }\n }\n\n AppendToLayer(clef, l, beam, tuplet);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n\n AppendToLayer(note, l, beam, tuplet);\n }\n\n if (bobj.ArpeggioType != ArpeggioTypeNone) {\n arpeg = GenerateArpeggio(bobj);\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(arpeg._id);\n Self._property:MeasureObjects = mobjs;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n }\n }\n\n for each bobj in bar\n {\n obj = null;\n mobj = null;\n chordsym = null;\n\n switch (bobj.Type)\n {\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n bobj._property:mobj = mobj;\n PushToHashedLayer(Self._property:SlurResolver, bobj.EndBarNumber, bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('ArpeggioLine')\n {\n mobj = GenerateArpeggio(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n if (mobj != null)\n {\n \/\/Try to get note at position of bracket and put id\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(mobj, 'startid', '#' & obj._id);\n }\n }\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n Self._property:MeasureObjects = mobjs;\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n ProcessEndingSlurs(bar);\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n else\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n libmei.AddAttribute(nr, 'stem.mod', '1slash');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ppq', dur);\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMEI(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pden & '.0' \/ pnum & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n vel = nobj.OriginalVelocity;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'vel', vel);\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', gesdur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n if (nobj.Dx != 0)\n {\n libmei.AddAttribute(n, 'ho', ConvertOffsetsToMEI(nobj.Dx));\n }\n\n if (nobj.Color != nobj.ParentNoteRest.Color)\n {\n note_color = ConvertColor(nobj);\n libmei.AddAttribute(n, 'color', note_color);\n }\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', dur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n \/\/ MEI now supports a four-bar repeat\n obj = libmei.MultiRpt();\n libmei.AddAttribute(obj, 'num', '4');\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n if (score.StaffCount > 0)\n {\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n }\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.FullInstrumentName != null)\n {\n label = libmei.Label();\n libmei.SetText(label, s.FullInstrumentName);\n libmei.AddChild(std, label);\n }\n\n if (s.ShortInstrumentName != null)\n {\n labelAbbr = libmei.LabelAbbr();\n libmei.SetText(labelAbbr, s.ShortInstrumentName);\n libmei.AddChild(std, labelAbbr);\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n \/\/brackets\n case ('bracket')\n {\n line = libmei.Line();\n bracketType = 'bracket';\n\n \/\/horizontal brackets\n if (linecomps.Length >= 3)\n {\n \/\/brackets above\n if (linecomps[3] = 'above')\n {\n libmei.AddAttribute(line, 'place', 'above');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleup');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angleup');\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n \/\/brackets below\n if (linecomps[3] = 'below')\n {\n libmei.AddAttribute(line, 'place', 'below');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angledown');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angledown');\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n \/\/vertical bracktes\n if (linecomps[3] = 'vertical')\n {\n bracketType = bracketType & ' vertical';\n\n \/\/Add direction of bracket: line.staff.bracket.vertical.2 opens to the right, line.staff.bracket.vertical opens to the left\n if (linecomps > 4)\n {\n if (linecomps[4] = '2')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleright');\n libmei.AddAttribute(line, 'endsym', 'angleright');\n }\n }\n\n else\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'startsym', 'angleleft');\n libmei.AddAttribute(line, 'endsym', 'angleleft');\n }\n }\n }\n\n \/\/add types of bracktes\n libmei.AddAttribute(line, 'type', bracketType);\n }\n \/\/solid vertical line\n case ('vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n libmei.AddAttribute(line,'type','vertical');\n }\n \/\/dashed lines\n case ('dashed')\n {\n \/\/dashed vertical line\n if (linecomps.Length > 3)\n {\n if (linecomps[3] = 'vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n libmei.AddAttribute(line,'type','vertical');\n }\n }\n \/\/dashed horizontal line\n else\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n }\n }\n \/\/dotted horizontal line\n case('dotted')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dotted');\n }\n \/\/solid horizontal line\n case('plain')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n }\n case ('vibrato')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'vibrato');\n libmei.AddAttribute(line, 'form', 'wavy');\n libmei.AddAttribute(line, 'place', 'above');\n\n }\n\n \/\/To catch diverse line types, set a default\n default\n {\n line = libmei.Line();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateArpeggio (bobj) {\n \/\/$module(ExportGenerators.mss)\n arpeg = libmei.Arpeg();\n orientation = null;\n\n switch (bobj.Type)\n {\n case ('NoteRest')\n {\n switch (bobj.ArpeggioType)\n {\n case (ArpeggioTypeUp)\n {\n orientation = 1;\n }\n case (ArpeggioTypeDown)\n {\n orientation = -1;\n }\n }\n if (bobj.ArpeggioBottomDy > bobj.ArpeggioTopDy)\n {\n \/\/ Arpeggio was manipulated to be upside down\n orientation = -1 * orientation;\n }\n }\n case ('ArpeggioLine')\n {\n if (bobj.StyleId != 'line.staff.arpeggio') {\n \/\/ This means: Line style is line.staff.arpeggio.up or\n \/\/ line.staff.arpeggio.down.\n \/\/ Strangely, the line style does not really matter for the\n \/\/ visual orientation of the arpeggio. As long as RhDy and\n \/\/ and Dy properties are identical, arpeggios look the same,\n \/\/ independant of the two line styles with arrowheads.\n orientation = bobj.RhDy - bobj.Dy;\n }\n }\n }\n\n if (orientation = null)\n {\n libmei.AddAttribute(arpeg, 'arrow', 'false');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'arrow', 'true');\n\n if (orientation > 0)\n {\n libmei.AddAttribute(arpeg, 'order', 'up');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'order', 'down');\n }\n }\n\n arpeg = AddBarObjectInfoToElement(bobj, arpeg);\n\n return arpeg;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'glyph.auth', 'smufl');\n libmei.AddAttribute(symbol, 'glyph.num', glyphnum);\n libmei.AddAttribute(symbol, 'glyph.name', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end\n","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n\n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n \/\/encodingDesc must preceed workList in MEI 4.0\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = GenerateApplicationInfo();\n libmei.AddChild(encodingD, appI);\n\n \/\/generate workList\n workList = libmei.WorkList();\n Self._property:WorkListElement = workList;\n\n wd_work = libmei.Work();\n wd_title = libmei.Title();\n libmei.AddChild(wd_work, wd_title);\n libmei.AddChild(workList, wd_work);\n libmei.AddChild(header, workList);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.Composer();\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_work, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.Lyricist();\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_work, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.Arranger();\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_work, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n return header;\n} \/\/$end\n\nfunction GenerateApplicationInfo () {\n \/\/$module(ExportGenerators.mss)\n\n appI = libmei.AppInfo();\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return appI;\n\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:SlurResolver = CreateSparseArray();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n \/\/annot is valid as a child of score\n libmei.AddChild(sco, ano);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workList = Self._property:WorkListElement;\n workEl = libmei.Work();\n libmei.AddChild(workList, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n l = null;\n\n mobjs = Self._property:MeasureObjects;\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0 or (l = null and bobj.Type = 'Clef'))\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n\n l._property:CurrentPos = 0;\n }\n }\n\n obj = null;\n mobj = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n \/\/ Clefs are placed inside the musical flow like notes. Hence we also need to find\n \/\/ out whether they are part of beams or tuplets.\n clef = GenerateClef(bobj);\n\n prevNoteRest = PrevNormalOrGrace(bobj, false);\n\n if (prevNoteRest != null)\n {\n prevBeamProp = NormalizedBeamProp(prevNoteRest);\n\n switch (prevBeamProp)\n {\n case ('StartBeam')\n {\n beam = l._property:ActiveBeam;\n }\n case ('NoBeam')\n {\n beam = null;\n }\n default\n {\n \/\/ ContinueBeam and SingleBeam\n nextNoteRest = NextNormalOrGrace(bobj, false);\n if (nextNoteRest != null)\n {\n nextBeamProp = NormalizedBeamProp(nextNoteRest);\n if ((nextBeamProp = ContinueBeam) or (nextBeamProp = SingleBeam))\n {\n beam = l._property:ActiveBeam;\n }\n }\n }\n }\n\n tuplet = l._property:ActiveMeiTuplet;\n while (tuplet != null and tuplet._property:ParentTuplet != null)\n {\n tuplet = tuplet._property:ParentTuplet;\n }\n }\n\n AppendToLayer(clef, l, beam, tuplet);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n\n AppendToLayer(note, l, beam, tuplet);\n }\n\n if (bobj.ArpeggioType != ArpeggioTypeNone) {\n arpeg = GenerateArpeggio(bobj);\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(arpeg._id);\n Self._property:MeasureObjects = mobjs;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n }\n }\n\n for each bobj in bar\n {\n obj = null;\n mobj = null;\n chordsym = null;\n\n switch (bobj.Type)\n {\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n bobj._property:mobj = mobj;\n PushToHashedLayer(Self._property:SlurResolver, bobj.EndBarNumber, bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('ArpeggioLine')\n {\n mobj = GenerateArpeggio(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n if (mobj != null)\n {\n \/\/Try to get note at position of bracket and put id\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(mobj, 'startid', '#' & obj._id);\n }\n }\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n Self._property:MeasureObjects = mobjs;\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n ProcessEndingSlurs(bar);\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n else\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n libmei.AddAttribute(nr, 'stem.mod', '1slash');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ppq', dur);\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMEI(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pden & '.0' \/ pnum & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', gesdur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n if (nobj.Dx != 0)\n {\n libmei.AddAttribute(n, 'ho', ConvertOffsetsToMEI(nobj.Dx));\n }\n\n if (nobj.Color != nobj.ParentNoteRest.Color)\n {\n note_color = ConvertColor(nobj);\n libmei.AddAttribute(n, 'color', note_color);\n }\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', dur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n \/\/ MEI now supports a four-bar repeat\n obj = libmei.MultiRpt();\n libmei.AddAttribute(obj, 'num', '4');\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n if (score.StaffCount > 0)\n {\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n }\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.FullInstrumentName != null)\n {\n label = libmei.Label();\n libmei.SetText(label, s.FullInstrumentName);\n libmei.AddChild(std, label);\n }\n\n if (s.ShortInstrumentName != null)\n {\n labelAbbr = libmei.LabelAbbr();\n libmei.SetText(labelAbbr, s.ShortInstrumentName);\n libmei.AddChild(std, labelAbbr);\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n \/\/brackets\n case ('bracket')\n {\n line = libmei.Line();\n bracketType = 'bracket';\n\n \/\/horizontal brackets\n if (linecomps.Length >= 3)\n {\n \/\/brackets above\n if (linecomps[3] = 'above')\n {\n libmei.AddAttribute(line, 'place', 'above');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleup');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angleup');\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n \/\/brackets below\n if (linecomps[3] = 'below')\n {\n libmei.AddAttribute(line, 'place', 'below');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angledown');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angledown');\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n \/\/vertical bracktes\n if (linecomps[3] = 'vertical')\n {\n bracketType = bracketType & ' vertical';\n\n \/\/Add direction of bracket: line.staff.bracket.vertical.2 opens to the right, line.staff.bracket.vertical opens to the left\n if (linecomps > 4)\n {\n if (linecomps[4] = '2')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleright');\n libmei.AddAttribute(line, 'endsym', 'angleright');\n }\n }\n\n else\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'startsym', 'angleleft');\n libmei.AddAttribute(line, 'endsym', 'angleleft');\n }\n }\n }\n\n \/\/add types of bracktes\n libmei.AddAttribute(line, 'type', bracketType);\n }\n \/\/solid vertical line\n case ('vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n libmei.AddAttribute(line,'type','vertical');\n }\n \/\/dashed lines\n case ('dashed')\n {\n \/\/dashed vertical line\n if (linecomps.Length > 3)\n {\n if (linecomps[3] = 'vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n libmei.AddAttribute(line,'type','vertical');\n }\n }\n \/\/dashed horizontal line\n else\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n }\n }\n \/\/dotted horizontal line\n case('dotted')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dotted');\n }\n \/\/solid horizontal line\n case('plain')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n }\n case ('vibrato')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'vibrato');\n libmei.AddAttribute(line, 'form', 'wavy');\n libmei.AddAttribute(line, 'place', 'above');\n\n }\n\n \/\/To catch diverse line types, set a default\n default\n {\n line = libmei.Line();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateArpeggio (bobj) {\n \/\/$module(ExportGenerators.mss)\n arpeg = libmei.Arpeg();\n orientation = null;\n\n switch (bobj.Type)\n {\n case ('NoteRest')\n {\n switch (bobj.ArpeggioType)\n {\n case (ArpeggioTypeUp)\n {\n orientation = 1;\n }\n case (ArpeggioTypeDown)\n {\n orientation = -1;\n }\n }\n if (bobj.ArpeggioBottomDy > bobj.ArpeggioTopDy)\n {\n \/\/ Arpeggio was manipulated to be upside down\n orientation = -1 * orientation;\n }\n }\n case ('ArpeggioLine')\n {\n if (bobj.StyleId != 'line.staff.arpeggio') {\n \/\/ This means: Line style is line.staff.arpeggio.up or\n \/\/ line.staff.arpeggio.down.\n \/\/ Strangely, the line style does not really matter for the\n \/\/ visual orientation of the arpeggio. As long as RhDy and\n \/\/ and Dy properties are identical, arpeggios look the same,\n \/\/ independant of the two line styles with arrowheads.\n orientation = bobj.RhDy - bobj.Dy;\n }\n }\n }\n\n if (orientation = null)\n {\n libmei.AddAttribute(arpeg, 'arrow', 'false');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'arrow', 'true');\n\n if (orientation > 0)\n {\n libmei.AddAttribute(arpeg, 'order', 'up');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'order', 'down');\n }\n }\n\n arpeg = AddBarObjectInfoToElement(bobj, arpeg);\n\n return arpeg;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'glyph.auth', 'smufl');\n libmei.AddAttribute(symbol, 'glyph.num', glyphnum);\n libmei.AddAttribute(symbol, 'glyph.name', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"3d8e6030dcd6d1163e88fcd1e6afb958c311ee49","subject":"Tweak city labels","message":"Tweak city labels\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport: 'PT Sans Narrow Regular';\n@text_font_administrative: 'PT Sans Narrow Regular';\n@text_font_city: 'PT Sans Narrow Regular';\n@text_font_parks: 'PT Sans Narrow Regular';\n\n@label_color_transport: #524c4c;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-avoid-edges: true;\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: #374c30;\n text-size: 15;\n\n [zoom>=11] {\n text-fill: #586e50;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 18;\n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-size: 22;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 22;\n text-min-distance: 15;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.1;\n \/\/}\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-placement: interior;\n text-vertical-alignment: bottom;\n text-min-distance: 5;\n text-dy: -5;\n\n [justified='left'] {\n \/\/text-horizontal-alignment: left;\n text-horizontal-alignment: middle;\n \/\/text-dx: 20;\n }\n\n [justified='right'] {\n \/\/text-horizontal-alignment: right;\n text-horizontal-alignment: middle;\n \/\/text-dx: -20;\n }\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.1;\n \/\/}\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_sm;\n text-min-distance: 5;\n text-allow-overlap: true;\n\n [zoom>=7] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size=18] {\n text-size: @text_font_size_large;\n }\n\n [font_size=20] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_medium_plus;\n\n [font_size=20] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n marker-ignore-placement: true;\n marker-width: 5;\n marker-fill: #2e2115;\n marker-line-width: 0;\n}\n\n","old_contents":"@text_font_transport: 'PT Sans Narrow Regular';\n@text_font_administrative: 'PT Sans Narrow Regular';\n@text_font_city: 'PT Sans Narrow Regular';\n@text_font_parks: 'PT Sans Narrow Regular';\n\n\/*\n@text_font_transport: 'CaslonAntiqueVL Regular';\n@text_font_administrative: 'CaslonAntiqueVL Regular';\n@text_font_city: 'CaslonAntiqueVL Regular';\n@text_font_parks: 'Caslon Antique Italic';\n*\/\n\n@label_color_transport: #524c4c;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n\/\/ Currently very small font sizes, just for testing\n@text_font_size_xxsm: 4;\n@text_font_size_xsm: 8;\n@text_font_size_sm: 8;\n@text_font_size_medium: 8;\n@text_font_size_medium_plus: 8;\n@text_font_size_large: 10;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-avoid-edges: true;\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: #374c30;\n text-size: 15;\n\n [zoom>=11] {\n text-fill: #586e50;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 32;\n text-line-spacing: -12;\n text-fill: #2e2115;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 18;\n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-size: 24;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-min-distance: 15;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n \/\/ for debugging\n ::outline {\n polygon-fill: #fff;\n polygon-opacity: 0.1;\n }\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-placement: interior;\n text-vertical-alignment: bottom;\n text-min-distance: 5;\n\n [justified='left'] {\n text-horizontal-alignment: left;\n \/\/text-horizontal-alignment: middle;\n \/\/text-dx: -5;\n }\n\n [justified='right'] {\n text-horizontal-alignment: right;\n \/\/text-horizontal-alignment: middle;\n \/\/text-dx: 5;\n }\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n \/\/ for debugging\n ::outline {\n polygon-fill: #fff;\n polygon-opacity: 0.1;\n }\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_sm;\n text-min-distance: 5;\n text-allow-overlap: true;\n\n [zoom>=7] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size=18] {\n text-size: @text_font_size_large;\n }\n\n [font_size=20] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: 18;\n\n [font_size=20] {\n text-size: 32;\n }\n}\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n marker-ignore-placement: true;\n marker-width: 5;\n marker-fill: #2e2115;\n marker-line-width: 0;\n}\n\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"00be40ae68b064eba6eddfc5c279771e92cccb04","subject":"#18 lighten rail lines to 35% K","message":"#18 lighten rail lines to 35% K\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"map.mss","new_file":"map.mss","new_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999;\n@color_transport_casing: #ddd;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc;\n@color_transport_minor: #ccc;\n@color_transport_rail: #aaa; \/\/ 35% K\n@color_transport_path: #666; \/\/ 60% K\n@color_building: #cdd;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: @color_transport;\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_green_areas: darken(#c0d3b5,20);\n\nMap {\n background-color: @color_physical;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n \/* lighten background color, as we decrease landcover opacity *\/\n [zoom>=12] {\n polygon-fill: lighten(@color_physical,20);\n }\n [zoom>=14] {\n polygon-fill: lighten(@color_physical,40);\n }\n\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_10m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{\n \/\/line-width: 0.5;\n line-color: @color_water;\n polygon-fill: @color_water;\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.5;\n\n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.3;\n }\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [zoom>=15] {\n line-color: @color_airport_runways_detail;\n }\n\n [type='runway'] {\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{\n [zoom>=9] {\n ::outline {\n line-width: 4.25;\n }\n\n line-width: 1.5;\n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 2.5;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n line-width: 28;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 49;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n [zoom<=12] {\n line-color: @color_transport;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n line-width: 1.5;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n line-width: 12;\n\n [is_link='yes'] {\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n line-width: 18;\n\n [is_link='yes'] {\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 17;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 0.2;\n }\n\n [zoom>=13] {\n line-width: 0.4;\n }\n\n [zoom>=14] {\n line-width: 0.8;\n }\n\n [zoom>=15] {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n line-width: 7;\n }\n\n [zoom>=18] {\n line-width: 13;\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n line-color: @color_transport_path;\n\n [zoom>=15] {\n line-width: 0.5;\n line-cap: butt;\n line-dasharray: 2, 3;\n }\n\n [zoom>=16] {\n line-width: 0.7;\n }\n\n [zoom>=17] {\n line-width: 1.2;\n line-dasharray: 4, 6;\n }\n}\n\n.landcoverraster {\n raster-opacity:1;\n raster-scaling:gaussian;\n\n \/* blur landcover as it becomes too pixelated *\/\n\/*\n [zoom>=10] {\n image-filters: agg-stack-blur(5,5);\n }\n [zoom>=12] {\n image-filters: agg-stack-blur(10,10);\n opacity: 0.8;\n }\n [zoom>=14] {\n image-filters: agg-stack-blur(20,20);\n opacity: 0.6;\n }\n*\/\n}\n","old_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999;\n@color_transport_casing: #ddd;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc;\n@color_transport_minor: #ccc;\n@color_transport_rail: #444;\n@color_transport_path: #666; \/\/ 60% K\n@color_building: #cdd;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: @color_transport;\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_green_areas: darken(#c0d3b5,20);\n\nMap {\n background-color: @color_physical;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n \/* lighten background color, as we decrease landcover opacity *\/\n [zoom>=12] {\n polygon-fill: lighten(@color_physical,20);\n }\n [zoom>=14] {\n polygon-fill: lighten(@color_physical,40);\n }\n\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_10m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{\n \/\/line-width: 0.5;\n line-color: @color_water;\n polygon-fill: @color_water;\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.5;\n\n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.3;\n }\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [zoom>=15] {\n line-color: @color_airport_runways_detail;\n }\n\n [type='runway'] {\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{\n [zoom>=9] {\n ::outline {\n line-width: 4.25;\n }\n\n line-width: 1.5;\n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 2.5;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n line-width: 28;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 49;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n [zoom<=12] {\n line-color: @color_transport;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n line-width: 1.5;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n line-width: 12;\n\n [is_link='yes'] {\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n line-width: 18;\n\n [is_link='yes'] {\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 17;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 0.2;\n }\n\n [zoom>=13] {\n line-width: 0.4;\n }\n\n [zoom>=14] {\n line-width: 0.8;\n }\n\n [zoom>=15] {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n line-width: 7;\n }\n\n [zoom>=18] {\n line-width: 13;\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n line-color: @color_transport_path;\n\n [zoom>=15] {\n line-width: 0.5;\n line-cap: butt;\n line-dasharray: 2, 3;\n }\n\n [zoom>=16] {\n line-width: 0.7;\n }\n\n [zoom>=17] {\n line-width: 1.2;\n line-dasharray: 4, 6;\n }\n}\n\n.landcoverraster {\n raster-opacity:1;\n raster-scaling:gaussian;\n\n \/* blur landcover as it becomes too pixelated *\/\n\/*\n [zoom>=10] {\n image-filters: agg-stack-blur(5,5);\n }\n [zoom>=12] {\n image-filters: agg-stack-blur(10,10);\n opacity: 0.8;\n }\n [zoom>=14] {\n image-filters: agg-stack-blur(20,20);\n opacity: 0.6;\n }\n*\/\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"a90be4716c4d95b97fdad08d3d156aee1cc29538","subject":"#9 set building fill to 20% K","message":"#9 set building fill to 20% K\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"map.mss","new_file":"map.mss","new_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999; \/\/ 40% K\n@color_transport_casing_z10: #ddd;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc; \/\/ 20% K\n@color_transport_hwy: #737373; \/\/ 55% K \n@color_transport_minor: #aaa; \n@color_transport_rail: #aaa; \/\/ 33% K\n@color_transport_path: #666; \/\/ 60% K\n@color_building: #ccc;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: @color_transport;\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_green_areas: darken(#c0d3b5,20);\n\nMap {\n background-color: @color_physical;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n \/* lighten background color, as we decrease landcover opacity *\/\n [zoom>=12] {\n polygon-fill: lighten(@color_physical,20);\n }\n [zoom>=14] {\n polygon-fill: lighten(@color_physical,40);\n }\n\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_10m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{\n \/\/line-width: 0.5;\n line-color: @color_water;\n polygon-fill: @color_water;\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.5;\n\n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.3;\n }\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [zoom>=15] {\n line-color: @color_airport_runways_detail;\n }\n\n [type='runway'] {\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n line-color: @color_transport_hwy;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n line-color: @color_transport_hwy;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{ \n [zoom>=9] {\n ::outline {\n line-width: 3;\n line-color: @color_transport_casing_z10;\n }\n\n line-width: 1.5; \n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 5;\n line-color: @color_transport_casing;\n }\n\n line-width: 3;\n line-color: @color_transport_hwy; \n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4; \n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 13;\n }\n\n line-width: 7.5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 39;\n } \n\n line-width: 28;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 49;\n \/\/ }\n\n \/\/ line-width: 35;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n\n [zoom<=12] {\n line-color: @color_transport;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 10;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 14;\n\n [is_link='yes'] {\n ::casing{\n line-width: 14;\n }\n\n line-width: 7;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 25;\n }\n\n line-width: 17;\n\n [is_link='yes'] {\n ::casing {\n line-width: 19;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 30;\n \/\/ }\n\n \/\/ line-width: 26;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 17;\n \/\/ }\n\n \/\/ line-width: 13;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 1;\n }\n\n [zoom>=13] {\n line-width: 1.5;\n line-color: @color_transport;\n }\n\n [zoom>=14] {\n ::casing {\n line-width: 3.5;\n line-color: @color_transport_casing;\n }\n line-width: 2.5;\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 6;\n }\n line-width: 4;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 6.5;\n } \n line-width: 4; \n }\n\n [zoom>=17] {\n ::casing {\n line-width: 11.5;\n }\n line-width: 8;\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 14.5;\n } \n line-width: 11;\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n line-color: @color_transport_path;\n\n [zoom>=15] {\n line-width: 0.5;\n line-cap: butt;\n line-dasharray: 2, 3;\n }\n\n [zoom>=16] {\n line-width: 0.7;\n }\n\n [zoom>=17] {\n line-width: 1.2;\n line-dasharray: 4, 6;\n }\n}\n\n.landcoverraster {\n raster-opacity:1;\n raster-scaling:gaussian;\n\n \/* blur landcover as it becomes too pixelated *\/\n \/\/ [zoom<10] {\n \/\/ image-filters: agg-stack-blur(0,0);\n \/\/ }\n\n \/\/ [zoom>=10] {\n \/\/ image-filters: agg-stack-blur(5,5);\n \/\/ }\n \/\/ [zoom>=12] {\n \/\/ image-filters: agg-stack-blur(10,10);\n \/\/ opacity: 0.8;\n \/\/ }\n \/\/ [zoom>=14] {\n \/\/ image-filters: agg-stack-blur(30,30);\n \/\/ opacity: 0.6;\n \/\/ }\n\n}\n","old_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999; \/\/ 40% K\n@color_transport_casing_z10: #ddd;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc; \/\/ 20% K\n@color_transport_hwy: #737373; \/\/ 55% K \n@color_transport_minor: #aaa; \n@color_transport_rail: #aaa; \/\/ 33% K\n@color_transport_path: #666; \/\/ 60% K\n@color_building: #b0c0be;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: @color_transport;\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_green_areas: darken(#c0d3b5,20);\n\nMap {\n background-color: @color_physical;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n \/* lighten background color, as we decrease landcover opacity *\/\n [zoom>=12] {\n polygon-fill: lighten(@color_physical,20);\n }\n [zoom>=14] {\n polygon-fill: lighten(@color_physical,40);\n }\n\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_10m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{\n \/\/line-width: 0.5;\n line-color: @color_water;\n polygon-fill: @color_water;\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.5;\n\n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.3;\n }\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [zoom>=15] {\n line-color: @color_airport_runways_detail;\n }\n\n [type='runway'] {\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n line-color: @color_transport_hwy;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n line-color: @color_transport_hwy;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{ \n [zoom>=9] {\n ::outline {\n line-width: 3;\n line-color: @color_transport_casing_z10;\n }\n\n line-width: 1.5; \n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 5;\n line-color: @color_transport_casing;\n }\n\n line-width: 3;\n line-color: @color_transport_hwy; \n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4; \n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 13;\n }\n\n line-width: 7.5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 39;\n } \n\n line-width: 28;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 49;\n \/\/ }\n\n \/\/ line-width: 35;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n\n [zoom<=12] {\n line-color: @color_transport;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 10;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 14;\n\n [is_link='yes'] {\n ::casing{\n line-width: 14;\n }\n\n line-width: 7;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 25;\n }\n\n line-width: 17;\n\n [is_link='yes'] {\n ::casing {\n line-width: 19;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 30;\n \/\/ }\n\n \/\/ line-width: 26;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 17;\n \/\/ }\n\n \/\/ line-width: 13;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 1;\n }\n\n [zoom>=13] {\n line-width: 1.5;\n line-color: @color_transport;\n }\n\n [zoom>=14] {\n ::casing {\n line-width: 3.5;\n line-color: @color_transport_casing;\n }\n line-width: 2.5;\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 6;\n }\n line-width: 4;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 6.5;\n } \n line-width: 4; \n }\n\n [zoom>=17] {\n ::casing {\n line-width: 11.5;\n }\n line-width: 8;\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 14.5;\n } \n line-width: 11;\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n line-color: @color_transport_path;\n\n [zoom>=15] {\n line-width: 0.5;\n line-cap: butt;\n line-dasharray: 2, 3;\n }\n\n [zoom>=16] {\n line-width: 0.7;\n }\n\n [zoom>=17] {\n line-width: 1.2;\n line-dasharray: 4, 6;\n }\n}\n\n.landcoverraster {\n raster-opacity:1;\n raster-scaling:gaussian;\n\n \/* blur landcover as it becomes too pixelated *\/\n\/*\n [zoom>=10] {\n image-filters: agg-stack-blur(5,5);\n }\n [zoom>=12] {\n image-filters: agg-stack-blur(10,10);\n opacity: 0.8;\n }\n [zoom>=14] {\n image-filters: agg-stack-blur(20,20);\n opacity: 0.6;\n }\n*\/\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"03af2b0adcb671a137f3c99854cf86e3e1a6cdf0","subject":"Change colour of paths which are probable rights of way from #0a0 to #3b3","message":"Change colour of paths which are probable rights of way from #0a0 to #3b3\n","repos":"gregrs-uk\/gb-leisure-carto,gregrs-uk\/gb-leisure-carto","old_file":"style.mss","new_file":"style.mss","new_contents":"\/\/ https:\/\/github.com\/gregrs-uk\/gb-leisure-carto\/\n\nMap {\n background-color: white;\n}\n\n#landuse {\n [natural='woodland'], \n [natural='wood'],\n [landuse='forest'] {\n polygon-fill:#cfc;\n }\n [landuse='residential'], [landuse='industrial'],\n [landuse='retail'], [landuse='commercial'],\n [landuse='farmyard'] {\n polygon-fill:#f0f0f0;\n }\n}\n\n#water {\n \/\/ natural=water and waterway=riverbank\n polygon-fill:#eff;\n line-width:1;\n line-color:#bcf;\n}\n\n#waterways {\n [waterway='stream'],[waterway='drain'],[waterway='ditch'] {\n line-width:1;\n line-color:#bcf;\n }\n [waterway='river'],[waterway='canal'] {\n ::outer {\n line-width:4;\n line-color:#bcf;\n line-cap:round;\n line-join:bevel;\n }\n ::inner {\n line-width:2;\n line-color:#eff;\n line-cap:round;\n line-join:bevel;\n }\n }\n}\n\n@motorway_width: 4;\n@primary_width: 3;\n@secondary_width: 3;\n@minor_width: 2;\n@outer_width: 1;\n\n#roads {\n ::outer {\n line-cap:round;\n line-join:bevel;\n [highway='motorway'],[highway='motorway_link'] {\n line-width:@motorway_width+@outer_width;\n }\n [highway='trunk'],[highway='trunk_link'],\n [highway='primary'],[highway='primary_link'] {\n line-width:@primary_width+@outer_width;\n line-color:#922;\n }\n [highway='secondary'],[highway='secondary_link'] {\n line-width:@secondary_width+@outer_width;\n line-color:#960;\n }\n [highway='tertiary'],[highway='tertiary_link'] {\n line-width:@secondary_width+@outer_width;\n line-color:#990;\n }\n [highway='unclassified'],[highway='residential'] {\n line-width:@minor_width+@outer_width;\n line-color:#333;\n }\n [highway='service'],\n [highway='track'][tracktype='grade1'],\n [highway='track'][tracktype='grade2'] {\n line-width:@minor_width+@outer_width;\n line-color:#aaa;\n }\n [highway='track'][tracktype!='grade1'][tracktype!='grade2'] {\n line-width:@minor_width+@outer_width;\n line-color:#aaa;\n line-dasharray:6,2;\n line-cap:butt;\n }\n }\n\n ::inner {\n line-cap:round;\n line-join:bevel;\n line-color:white;\n [highway='motorway'],[highway='motorway_link'] {\n line-width:@motorway_width;\n line-color:blue;\n }\n [highway='trunk'],[highway='trunk_link'],\n [highway='primary'],[highway='primary_link'] {\n line-width:@primary_width;\n line-color:#fbf;\n }\n [highway='secondary'],[highway='secondary_link'] {\n line-width:@secondary_width;\n line-color:#fc5;\n }\n [highway='tertiary'],[highway='tertiary_link'] {\n line-width:@secondary_width;\n line-color:#ff5;\n }\n [highway='unclassified'],[highway='residential'],\n [highway='service'],[highway='track'] {\n line-width:@minor_width;\n }\n }\n}\n\n#railway {\n line-width:1;\n line-color:black;\n line-cap:butt;\n line-join:bevel;\n}\n\n#buildings {\n polygon-fill:#eb6;\n}\n\n#paths {\n \/\/ from db: highway=footway\/bridleway\/cycleway\n \/\/ or anything with designation tag set\n line-width: 1.5;\n line-color:#999;\n line-dasharray:4,2;\n line-cap:butt;\n line-join:bevel;\n \/\/ probably public rights of way but no designation set\n [foot='designated'],[access='designated'],\n [foot='permissive'],[access='permissive'],\n [foot='yes'],[access='yes'] {\n line-color: #3b3;\n }\n \/\/ override colour if designation is explicitly set\n [designation='public_footpath'] {\n line-color: #f70;\n }\n [designation='public_bridleway'] {\n line-color: #66f;\n }\n [designation='restricted_byway'] {\n line-color: purple;\n }\n [designation='byway_open_to_all_traffic'] {\n line-color: red;\n }\n}\n\n#boundaries {\n line-width:0.5;\n [barrier='fence'] { line-color:#b83; }\n [barrier='hedge'] { line-color:#7b7; }\n [barrier='wall'] { line-color:#999; }\n}\n\n#contours {\n line-width:0.5;\n line-color:#f0f;\n line-opacity:0.8;\n line-cap:butt;\n line-dasharray:1,1;\n}\n\n#labels {\n text-name:[name];\n text-face-name:'Arial Regular';\n text-halo-fill: white; \/\/fadeout(white,40%);\n text-size:8pt;\n text-halo-radius:1.5;\n text-fill: black; \/\/#777;\n text-opacity:0.3;\n [place='city'] {\n text-size:35pt;\n }\n [place='town'] {\n text-size:28pt;\n }\n [place='suburb'],[place='neighbourhood']\n {\n text-size:21pt;\n }\n [place='village'],[place='hamlet'],\n [place='island'] {\n text-size:14pt;\n }\n [amenity='school'] {\n text-name:\"'Sch'\"\n }\n [amenity='place_of_worship'][religion='christian'] {\n text-name:\"'Ch'\"\n }\n [amenity='pub'] {\n text-name:\"'Pub'\"\n }\n [landuse='farmyard'], [place='farm'] {\n text-dy: -13;\n }\n}\n\n#grid {\n line-color:cyan;\n line-width:0.5;\n line-opacity:0.25;\n}\n","old_contents":"\/\/ https:\/\/github.com\/gregrs-uk\/gb-leisure-carto\/\n\nMap {\n background-color: white;\n}\n\n#landuse {\n [natural='woodland'], \n [natural='wood'],\n [landuse='forest'] {\n polygon-fill:#cfc;\n }\n [landuse='residential'], [landuse='industrial'],\n [landuse='retail'], [landuse='commercial'],\n [landuse='farmyard'] {\n polygon-fill:#f0f0f0;\n }\n}\n\n#water {\n \/\/ natural=water and waterway=riverbank\n polygon-fill:#eff;\n line-width:1;\n line-color:#bcf;\n}\n\n#waterways {\n [waterway='stream'],[waterway='drain'],[waterway='ditch'] {\n line-width:1;\n line-color:#bcf;\n }\n [waterway='river'],[waterway='canal'] {\n ::outer {\n line-width:4;\n line-color:#bcf;\n line-cap:round;\n line-join:bevel;\n }\n ::inner {\n line-width:2;\n line-color:#eff;\n line-cap:round;\n line-join:bevel;\n }\n }\n}\n\n@motorway_width: 4;\n@primary_width: 3;\n@secondary_width: 3;\n@minor_width: 2;\n@outer_width: 1;\n\n#roads {\n ::outer {\n line-cap:round;\n line-join:bevel;\n [highway='motorway'],[highway='motorway_link'] {\n line-width:@motorway_width+@outer_width;\n }\n [highway='trunk'],[highway='trunk_link'],\n [highway='primary'],[highway='primary_link'] {\n line-width:@primary_width+@outer_width;\n line-color:#922;\n }\n [highway='secondary'],[highway='secondary_link'] {\n line-width:@secondary_width+@outer_width;\n line-color:#960;\n }\n [highway='tertiary'],[highway='tertiary_link'] {\n line-width:@secondary_width+@outer_width;\n line-color:#990;\n }\n [highway='unclassified'],[highway='residential'] {\n line-width:@minor_width+@outer_width;\n line-color:#333;\n }\n [highway='service'],\n [highway='track'][tracktype='grade1'],\n [highway='track'][tracktype='grade2'] {\n line-width:@minor_width+@outer_width;\n line-color:#aaa;\n }\n [highway='track'][tracktype!='grade1'][tracktype!='grade2'] {\n line-width:@minor_width+@outer_width;\n line-color:#aaa;\n line-dasharray:6,2;\n line-cap:butt;\n }\n }\n\n ::inner {\n line-cap:round;\n line-join:bevel;\n line-color:white;\n [highway='motorway'],[highway='motorway_link'] {\n line-width:@motorway_width;\n line-color:blue;\n }\n [highway='trunk'],[highway='trunk_link'],\n [highway='primary'],[highway='primary_link'] {\n line-width:@primary_width;\n line-color:#fbf;\n }\n [highway='secondary'],[highway='secondary_link'] {\n line-width:@secondary_width;\n line-color:#fc5;\n }\n [highway='tertiary'],[highway='tertiary_link'] {\n line-width:@secondary_width;\n line-color:#ff5;\n }\n [highway='unclassified'],[highway='residential'],\n [highway='service'],[highway='track'] {\n line-width:@minor_width;\n }\n }\n}\n\n#railway {\n line-width:1;\n line-color:black;\n line-cap:butt;\n line-join:bevel;\n}\n\n#buildings {\n polygon-fill:#eb6;\n}\n\n#paths {\n \/\/ from db: highway=footway\/bridleway\/cycleway\n \/\/ or anything with designation tag set\n line-width: 1.5;\n line-color:#999;\n line-dasharray:4,2;\n line-cap:butt;\n line-join:bevel;\n \/\/ probably public rights of way but no designation set\n [foot='designated'],[access='designated'],\n [foot='permissive'],[access='permissive'],\n [foot='yes'],[access='yes'] {\n line-color: #0a0;\n }\n \/\/ override colour if designation is explicitly set\n [designation='public_footpath'] {\n line-color: #f70;\n }\n [designation='public_bridleway'] {\n line-color: #66f;\n }\n [designation='restricted_byway'] {\n line-color: purple;\n }\n [designation='byway_open_to_all_traffic'] {\n line-color: red;\n }\n}\n\n#boundaries {\n line-width:0.5;\n [barrier='fence'] { line-color:#b83; }\n [barrier='hedge'] { line-color:#7b7; }\n [barrier='wall'] { line-color:#999; }\n}\n\n#contours {\n line-width:0.5;\n line-color:#f0f;\n line-opacity:0.8;\n line-cap:butt;\n line-dasharray:1,1;\n}\n\n#labels {\n text-name:[name];\n text-face-name:'Arial Regular';\n text-halo-fill: white; \/\/fadeout(white,40%);\n text-size:8pt;\n text-halo-radius:1.5;\n text-fill: black; \/\/#777;\n text-opacity:0.3;\n [place='city'] {\n text-size:35pt;\n }\n [place='town'] {\n text-size:28pt;\n }\n [place='suburb'],[place='neighbourhood']\n {\n text-size:21pt;\n }\n [place='village'],[place='hamlet'],\n [place='island'] {\n text-size:14pt;\n }\n [amenity='school'] {\n text-name:\"'Sch'\"\n }\n [amenity='place_of_worship'][religion='christian'] {\n text-name:\"'Ch'\"\n }\n [amenity='pub'] {\n text-name:\"'Pub'\"\n }\n [landuse='farmyard'], [place='farm'] {\n text-dy: -13;\n }\n}\n\n#grid {\n line-color:cyan;\n line-width:0.5;\n line-opacity:0.25;\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"CartoCSS"} {"commit":"fd662bac4ef9c3b5829358cbabdfc68949cb1528","subject":"Update roads.mss","message":"Update roads.mss","repos":"brelevenix\/osm-bright-tregor","old_file":"osm-bright\/roads.mss","new_file":"osm-bright\/roads.mss","new_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 0.3; @rdz11_med: 0.2; @rdz11_min: 0.1;\n@rdz12_maj: 0.5; @rdz12_med: 0.4; @rdz12_min: 0.2;\n@rdz13_maj: 1; @rdz13_med: 0.8; @rdz13_min: 0.5;\n@rdz14_maj: 2; @rdz14_med: 1.5; @rdz14_min: 1;\n@rdz15_maj: 4; @rdz15_med: 3; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 16; @rdz17_med: 12; @rdz17_min: 8;\n@rdz18_maj: 32; @rdz18_med: 24; @rdz18_min: 16;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz11_maj+2; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz12_maj+2; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz13_maj+2; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz14_med+2; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz15_med }\n [stylegroup='minorroad']{ line-width: @rdz15_min ; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_maj+2; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj ;}\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz16_maj+2; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_maj+3; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_maj+4; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min ; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min ; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min ; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min ; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","old_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 1.6; @rdz11_med: 0.8; @rdz11_min: 0.4;\n@rdz12_maj: 2.5; @rdz12_med: 1.2; @rdz12_min: 0.8;\n@rdz13_maj: 3; @rdz13_med: 1.5; @rdz13_min: 1;\n@rdz14_maj: 4; @rdz14_med: 2.5; @rdz14_min: 1.6;\n@rdz15_maj: 6; @rdz15_med: 4; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 14; @rdz17_med: 12; @rdz17_min: 10;\n@rdz18_maj: 20; @rdz18_med: 17; @rdz18_min: 14;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz11_maj+2; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz12_maj+2; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz13_maj+2; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz14_med+2; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz15_med }\n [stylegroup='minorroad']{ line-width: @rdz15_min ; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_maj+2; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj ;}\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz16_maj+2; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_maj+3; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_maj+4; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min ; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min ; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min ; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min ; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"dd3782e1dbfb85d49b7607669b8e2a06babfa44b","subject":"Updated fonts and colors","message":"Updated fonts and colors\n","repos":"silph-io\/osm-silph","old_file":"osm-bright\/palette.mss","new_file":"osm-bright\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Ubuntu Regular\";\n\n\/* \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";*\/\n\n\n@sans_lt_italic: \"Ubuntu Regular\";\n\n\/* \"Open Sans Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans: \"Ubuntu Regular\";\n\n\/* \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_italic: \"Ubuntu Regular\";\n\n\/* \"Open Sans Semibold Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans_bold: \"Ubuntu Regular\";\n\n\/* \"Open Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_bold_italic: \"Ubuntu Regular\";\n\n\/* \"Open Sans Bold Italic\",\"DejaVu Sans Bold Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #F0EDE5;\n@water: #C4DFF6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #DAF2C1;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n@building: #E2DED2;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #E65C5C;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #E68A5C;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n@primary_line: #FFC859;\n@primary_fill: lighten(@primary_line,10%);\n@primary_case: @primary_line * 0.9;\n\n@secondary_line: #FFE873;\n@secondary_fill: lighten(@secondary_line,10%);\n@secondary_case: @secondary_line * 0.9;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,34%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n@poi_text: #888;\n\n@road_text: #777;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n\n\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n\n@sans_lt_italic: \"Open Sans Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n\n@sans: \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_italic: \"Open Sans Semibold Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n\n@sans_bold: \"Open Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold_italic: \"Open Sans Bold Italic\",\"DejaVu Sans Bold Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #FCFBE7;\n@water: #C4DFF6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #DAF2C1;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n@building: #E4E0E0;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #E65C5C;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #E68A5C;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n@primary_line: #FFC859;\n@primary_fill: lighten(@primary_line,10%);\n@primary_case: @primary_line * 0.9;\n\n@secondary_line: #FFE873;\n@secondary_fill: lighten(@secondary_line,10%);\n@secondary_case: @secondary_line * 0.9;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,34%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n@poi_text: #888;\n\n@road_text: #777;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n\n\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"5f237ac3d16f3c12aeb848fdaa33f486224ceb6c","subject":"remove replace() character spacing hack. refs #56","message":"remove replace() character spacing hack. refs #56\n","repos":"silph-io\/osm-silph,saydulk\/osm-bright,Sweetymeow\/osm-bright,mapbox\/osm-bright,raumobil\/osm-bright,jeffaudi\/osm-hybrid,brelevenix\/osm-bright-tregor,pinkflozd\/osm-bright","old_file":"osm-bright\/labels.mss","new_file":"osm-bright\/labels.mss","new_contents":"\/* LABELS.MSS CONTENTS:\n * - place names\n * - area labels\n * - waterway labels \n *\/\n\n\/* Font sets are defined in palette.mss *\/\n\n\/* ================================================================== *\/\n\/* PLACE NAMES\n\/* ================================================================== *\/\n\n#place::country[type='country'][zoom>3][zoom<9] {\n text-name:'[name]';\n text-face-name:@sans_bold;\n text-placement:point;\n text-fill:@country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n [zoom=3] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=4] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>4] {\n text-halo-radius: 2;\n }\n [zoom=5] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=6] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=7] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n#place::state[type='state'][zoom>=5][zoom<=10] {\n text-name:'[name]';\n text-face-name:@sans_bold_italic;\n text-placement:point;\n text-fill:@state_text;\n text-halo-fill: @state_halo;\n text-halo-radius: 1;\n [zoom=6] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=7] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>8] {\n text-halo-radius: 2;\n }\n [zoom=8] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=9] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=10] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n\/* ---- Cities ------------------------------------------------------ *\/\n\n#place::city[type='city'][zoom>=8][zoom<=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@city_text;\n text-halo-fill:@city_halo;\n text-halo-radius:2;\n [zoom<=8] {\n text-size: 10;\n text-halo-radius:1;\n }\n [zoom=9] {\n text-size:10;\n text-wrap-width: 60;\n }\n [zoom=10] {\n text-size:11;\n text-wrap-width: 70;\n }\n [zoom=11] {\n text-size:12;\n text-character-spacing: 1;\n text-wrap-width: 80;\n }\n [zoom=12] {\n text-size:13;\n text-character-spacing: 1;\n text-wrap-width: 100;\n }\n [zoom=13] {\n text-size:14;\n text-character-spacing: 2;\n text-wrap-width: 200;\n text-transform: uppercase;\n }\n [zoom=14] {\n text-size:15;\n text-character-spacing: 4;\n text-wrap-width: 300;\n text-transform: uppercase;\n }\n [zoom=15] {\n text-size:16;\n text-character-spacing: 6;\n text-wrap-width: 400;\n text-transform: uppercase;\n }\n}\n\n\/* ---- Towns ------------------------------------------------------- *\/\n\n#place::town[type='town'][zoom>=9][zoom<=17] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@town_text;\n text-size:9;\n text-halo-fill:@town_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n [zoom>=10] {\n text-halo-radius:2;\n text-size: 10;\n }\n [zoom>=11]{ text-size:11; }\n [zoom>=12]{\n text-size:12;\n text-line-spacing: 1;\n }\n [zoom>=13]{\n text-transform: uppercase;\n text-character-spacing: 1;\n text-line-spacing: 2;\n }\n [zoom>=14]{\n text-size:13;\n text-character-spacing: 2;\n text-line-spacing: 3;\n }\n [zoom>=15]{\n text-size:14;\n text-character-spacing: 3;\n text-line-spacing: 4;\n }\n [zoom>=15]{\n text-size:15;\n text-character-spacing: 4;\n text-line-spacing: 5;\n }\n [zoom>=17]{\n text-size:16;\n text-character-spacing: 5;\n text-line-spacing: 6;\n }\n}\n\n\/* ---- Other small places ------------------------------------------ *\/\n\n#place::small[type='village'][zoom>=13],\n#place::small[type='suburb'][zoom>=13],\n#place::small[type='hamlet'][zoom>=13],\n#place::small[type='neighbourhood'][zoom>=13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@other_text;\n text-size:10;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=14] {\n text-size:11;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-line-spacing: 1;\n }\n [zoom>=15] {\n text-halo-radius: 2;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-wrap-width: 60; \n text-line-spacing: 1;\n }\n [zoom>=16] {\n text-size:12;\n text-character-spacing: 2;\n text-wrap-width: 120;\n text-line-spacing: 2;\n } \n [zoom>=17] {\n text-size:13; \n text-character-spacing: 3;\n text-wrap-width: 160;\n text-line-spacing: 4;\n }\n [zoom>=18] {\n text-size:14;\n text-character-spacing: 4;\n text-line-spacing: 6;\n }\n}\n\n#place::small[type='locality'][zoom>=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@locality_text;\n text-size:9;\n text-halo-fill:@locality_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=16] {\n text-size:10;\n text-wrap-width: 60;\n text-line-spacing: 1;\n }\n [zoom>=17] {\n text-size:11;\n text-wrap-width: 120;\n text-line-spacing: 2;\n }\n [zoom>=18] {\n text-size:12;\n text-character-spacing: 1;\n text-line-spacing: 4;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ AREA LABELS\n\/\/ =====================================================================\n\n#area_label {\n \/\/ Bring in labels gradually as one zooms in, bases on polygon area\n [zoom>=10][area>102400000],\n [zoom>=11][area>25600000],\n [zoom>=13][area>1600000],\n [zoom>=14][area>320000],\n [zoom>=15][area>80000],\n [zoom>=16][area>20000],\n [zoom>=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n text-halo-radius: 1.5;\n text-face-name:@sans;\n text-size: 11;\n text-wrap-width:30;\n text-fill: #888;\n text-halo-fill: #fff;\n \/\/ Specific style overrides for different types of areas:\n [type='park'][zoom>=10] {\n text-face-name: @sans_lt_italic;\n text-fill: @park * 0.6;\n text-halo-fill: lighten(@park, 10);\n }\n [type='golf_course'][zoom>=10] {\n text-fill: @sports * 0.6;\n text-halo-fill: lighten(@sports, 10);\n }\n [type='cemetery'][zoom>=10] {\n text-fill: @cemetery * 0.6;\n text-halo-fill: lighten(@cemetery, 10);\n }\n [type='hospital'][zoom>=10] {\n text-fill: @hospital * 0.6;\n text-halo-fill: lighten(@hospital, 10);\n }\n [type='college'][zoom>=10],\n [type='school'][zoom>=10],\n [type='university'][zoom>=10] {\n text-fill: @school * 0.6;\n text-halo-fill: lighten(@school, 10);\n }\n [type='water'][zoom>=10] {\n text-fill: @water * 0.6;\n text-halo-fill: lighten(@water, 10);\n }\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom=18][area>5000] {\n text-name: \"[name]\";\n text-size: 13;\n text-wrap-width: 60;\n text-character-spacing: 1;\n text-halo-radius: 2;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom=18][area>20000] {\n text-size: 15;\n text-character-spacing: 2;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 20;\n text-character-spacing: 3;\n text-wrap-width: 180;\n }\n}\n \n#poi[type='university'][zoom>=15],\n#poi[type='hospital'][zoom>=16],\n#poi[type='school'][zoom>=17],\n#poi[type='library'][zoom>=17] {\n text-name:\"[name]\";\n text-face-name:@sans;\n text-size:10;\n text-wrap-width:30;\n text-fill: @poi_text;\n}\n\n\n\/* ================================================================== *\/\n\/* WATERWAY LABELS\n\/* ================================================================== *\/\n\n#waterway_label[type='river'][zoom>=13],\n#waterway_label[type='canal'][zoom>=15],\n#waterway_label[type='stream'][zoom>=17] {\n text-name: '[name]';\n text-face-name: @sans_italic;\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-placement: line;\n text-min-distance: 400;\n text-size: 10;\n [type='river'][zoom=15],\n [type='canal'][zoom=17] {\n text-size: 11;\n }\n [type='river'][zoom>=16],\n [type='canal'][zoom=18] {\n text-size: 14;\n text-spacing: 300;\n }\n}\n\n\/* ================================================================== *\/\n\/* ROAD LABELS\n\/* ================================================================== *\/\n\n#motorway_label[zoom>=11][zoom<=14][reflen<=8] {\n shield-name: \"[ref]\";\n shield-size: 9;\n shield-face-name: @sans_bold;\n shield-fill: #fff;\n shield-file: url(img\/shield-motorway-1.png);\n [type='motorway'] {\n [reflen=1] { shield-file: url(img\/shield-motorway-1.png); }\n [reflen=2] { shield-file: url(img\/shield-motorway-2.png); }\n [reflen=3] { shield-file: url(img\/shield-motorway-3.png); }\n [reflen=4] { shield-file: url(img\/shield-motorway-4.png); }\n [reflen=5] { shield-file: url(img\/shield-motorway-5.png); }\n [reflen=6] { shield-file: url(img\/shield-motorway-6.png); }\n [reflen=7] { shield-file: url(img\/shield-motorway-7.png); }\n [reflen=8] { shield-file: url(img\/shield-motorway-8.png); }\n }\n [type='trunk'] {\n [reflen=1] { shield-file: url(img\/shield-trunk-1.png); }\n [reflen=2] { shield-file: url(img\/shield-trunk-2.png); }\n [reflen=3] { shield-file: url(img\/shield-trunk-3.png); }\n [reflen=4] { shield-file: url(img\/shield-trunk-4.png); }\n [reflen=5] { shield-file: url(img\/shield-trunk-5.png); }\n [reflen=6] { shield-file: url(img\/shield-trunk-6.png); }\n [reflen=7] { shield-file: url(img\/shield-trunk-7.png); }\n [reflen=8] { shield-file: url(img\/shield-trunk-8.png); }\n }\n [zoom=11] { shield-min-distance: 60; } \/\/50\n [zoom=12] { shield-min-distance: 80; } \/\/60\n [zoom=13] { shield-min-distance: 120; } \/\/120\n [zoom=14] { shield-min-distance: 180; }\n}\n\n#motorway_label[type='motorway'][zoom>9],\n#motorway_label[type='trunk'][zoom>9] {\n text-name:\"[name]\";\n text-face-name:@sans_bold;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:10;\n [zoom=11] { text-min-distance:70; }\n [zoom=12] { text-min-distance:80; }\n [zoom=13] { text-min-distance:100; }\n}\n\n#mainroad_label[type='primary'][zoom>12],\n#mainroad_label[type='secondary'][zoom>13],\n#mainroad_label[type='tertiary'][zoom>13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n#minorroad_label[zoom>14] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-size:9;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n\/* ================================================================== *\/\n\/* ONE-WAY ARROWS\n\/* ================================================================== *\/\n\n#motorway_label[oneway!=0][zoom>=16],\n#mainroad_label[oneway!=0][zoom>=16],\n#minorroad_label[oneway!=0][zoom>=16] {\n marker-placement:line;\n marker-max-error: 0.5;\n marker-spacing: 200;\n marker-file: url(img\/icon\/oneway.svg);\n [oneway=-1] { marker-file: url(img\/icon\/oneway-reverse.svg); }\n [zoom=16] { marker-transform: \"scale(0.5)\"; }\n [zoom=17] { marker-transform: \"scale(0.75)\"; }\n}\n\n\n\/* ****************************************************************** *\/\n","old_contents":"\/* LABELS.MSS CONTENTS:\n * - place names\n * - area labels\n * - waterway labels \n *\/\n\n\/* Font sets are defined in palette.mss *\/\n\n\/* Mapnik does not yet support character-spacing adjustments for \n labels placed along a line. We can fake this using the replace()\n function in the text-name parameter by replacing each character\n with itself followed by one or more spaces. *\/\n\n\/* ================================================================== *\/\n\/* PLACE NAMES\n\/* ================================================================== *\/\n\n#place::country[type='country'][zoom>3][zoom<9] {\n text-name:'[name]';\n text-face-name:@sans_bold;\n text-placement:point;\n text-fill:@country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n [zoom=3] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=4] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>4] {\n text-halo-radius: 2;\n }\n [zoom=5] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=6] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=7] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n#place::state[type='state'][zoom>=5][zoom<=10] {\n text-name:'[name]';\n text-face-name:@sans_bold_italic;\n text-placement:point;\n text-fill:@state_text;\n text-halo-fill: @state_halo;\n text-halo-radius: 1;\n [zoom=6] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=7] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>8] {\n text-halo-radius: 2;\n }\n [zoom=8] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=9] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=10] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n\/* ---- Cities ------------------------------------------------------ *\/\n\n#place::city[type='city'][zoom>=8][zoom<=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@city_text;\n text-halo-fill:@city_halo;\n text-halo-radius:2;\n [zoom<=8] {\n text-size: 10;\n text-halo-radius:1;\n }\n [zoom=9] {\n text-size:10;\n text-wrap-width: 60;\n }\n [zoom=10] {\n text-size:11;\n text-wrap-width: 70;\n }\n [zoom=11] {\n text-size:12;\n text-character-spacing: 1;\n text-wrap-width: 80;\n }\n [zoom=12] {\n text-size:13;\n text-character-spacing: 1;\n text-wrap-width: 100;\n }\n [zoom=13] {\n text-size:14;\n text-character-spacing: 2;\n text-wrap-width: 200;\n text-transform: uppercase;\n }\n [zoom=14] {\n text-size:15;\n text-character-spacing: 4;\n text-wrap-width: 300;\n text-transform: uppercase;\n }\n [zoom=15] {\n text-size:16;\n text-character-spacing: 6;\n text-wrap-width: 400;\n text-transform: uppercase;\n }\n}\n\n\/* ---- Towns ------------------------------------------------------- *\/\n\n#place::town[type='town'][zoom>=9][zoom<=17] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@town_text;\n text-size:9;\n text-halo-fill:@town_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n [zoom>=10] {\n text-halo-radius:2;\n text-size: 10;\n }\n [zoom>=11]{ text-size:11; }\n [zoom>=12]{\n text-size:12;\n text-line-spacing: 1;\n }\n [zoom>=13]{\n text-transform: uppercase;\n text-character-spacing: 1;\n text-line-spacing: 2;\n }\n [zoom>=14]{\n text-size:13;\n text-character-spacing: 2;\n text-line-spacing: 3;\n }\n [zoom>=15]{\n text-size:14;\n text-character-spacing: 3;\n text-line-spacing: 4;\n }\n [zoom>=15]{\n text-size:15;\n text-character-spacing: 4;\n text-line-spacing: 5;\n }\n [zoom>=17]{\n text-size:16;\n text-character-spacing: 5;\n text-line-spacing: 6;\n }\n}\n\n\/* ---- Other small places ------------------------------------------ *\/\n\n#place::small[type='village'][zoom>=13],\n#place::small[type='suburb'][zoom>=13],\n#place::small[type='hamlet'][zoom>=13],\n#place::small[type='neighbourhood'][zoom>=13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@other_text;\n text-size:10;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=14] {\n text-size:11;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-line-spacing: 1;\n }\n [zoom>=15] {\n text-halo-radius: 2;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-wrap-width: 60; \n text-line-spacing: 1;\n }\n [zoom>=16] {\n text-size:12;\n text-character-spacing: 2;\n text-wrap-width: 120;\n text-line-spacing: 2;\n } \n [zoom>=17] {\n text-size:13; \n text-character-spacing: 3;\n text-wrap-width: 160;\n text-line-spacing: 4;\n }\n [zoom>=18] {\n text-size:14;\n text-character-spacing: 4;\n text-line-spacing: 6;\n }\n}\n\n#place::small[type='locality'][zoom>=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@locality_text;\n text-size:9;\n text-halo-fill:@locality_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=16] {\n text-size:10;\n text-wrap-width: 60;\n text-line-spacing: 1;\n }\n [zoom>=17] {\n text-size:11;\n text-wrap-width: 120;\n text-line-spacing: 2;\n }\n [zoom>=18] {\n text-size:12;\n text-character-spacing: 1;\n text-line-spacing: 4;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ AREA LABELS\n\/\/ =====================================================================\n\n#area_label {\n \/\/ Bring in labels gradually as one zooms in, bases on polygon area\n [zoom>=10][area>102400000],\n [zoom>=11][area>25600000],\n [zoom>=13][area>1600000],\n [zoom>=14][area>320000],\n [zoom>=15][area>80000],\n [zoom>=16][area>20000],\n [zoom>=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n text-halo-radius: 1.5;\n text-face-name:@sans;\n text-size: 11;\n text-wrap-width:30;\n text-fill: #888;\n text-halo-fill: #fff;\n \/\/ Specific style overrides for different types of areas:\n [type='park'][zoom>=10] {\n text-face-name: @sans_lt_italic;\n text-fill: @park * 0.6;\n text-halo-fill: lighten(@park, 10);\n }\n [type='golf_course'][zoom>=10] {\n text-fill: @sports * 0.6;\n text-halo-fill: lighten(@sports, 10);\n }\n [type='cemetery'][zoom>=10] {\n text-fill: @cemetery * 0.6;\n text-halo-fill: lighten(@cemetery, 10);\n }\n [type='hospital'][zoom>=10] {\n text-fill: @hospital * 0.6;\n text-halo-fill: lighten(@hospital, 10);\n }\n [type='college'][zoom>=10],\n [type='school'][zoom>=10],\n [type='university'][zoom>=10] {\n text-fill: @school * 0.6;\n text-halo-fill: lighten(@school, 10);\n }\n [type='water'][zoom>=10] {\n text-fill: @water * 0.6;\n text-halo-fill: lighten(@water, 10);\n }\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom=18][area>5000] {\n text-name: \"[name]\";\n text-size: 13;\n text-wrap-width: 60;\n text-character-spacing: 1;\n text-halo-radius: 2;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom=18][area>20000] {\n text-size: 15;\n text-character-spacing: 2;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 20;\n text-character-spacing: 3;\n text-wrap-width: 180;\n }\n}\n \n#poi[type='university'][zoom>=15],\n#poi[type='hospital'][zoom>=16],\n#poi[type='school'][zoom>=17],\n#poi[type='library'][zoom>=17] {\n text-name:\"[name]\";\n text-face-name:@sans;\n text-size:10;\n text-wrap-width:30;\n text-fill: @poi_text;\n}\n\n\n\/* ================================================================== *\/\n\/* WATERWAY LABELS\n\/* ================================================================== *\/\n\n#waterway_label[type='river'][zoom>=13],\n#waterway_label[type='canal'][zoom>=15],\n#waterway_label[type='stream'][zoom>=17] {\n text-name: '[name]';\n text-face-name: @sans_italic;\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-placement: line;\n text-min-distance: 400;\n text-size: 10;\n [type='river'][zoom=14],\n [type='canal'][zoom=16],\n [type='stream'][zoom=18] {\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n }\n [type='river'][zoom=15],\n [type='canal'][zoom=17] {\n text-size: 11;\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n }\n [type='river'][zoom>=16],\n [type='canal'][zoom=18] {\n text-size: 14;\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n text-spacing: 300;\n }\n}\n\n\/* ================================================================== *\/\n\/* ROAD LABELS\n\/* ================================================================== *\/\n\n#motorway_label[zoom>=11][zoom<=14][reflen<=8] {\n shield-name: \"[ref]\";\n shield-size: 9;\n shield-face-name: @sans_bold;\n shield-fill: #fff;\n shield-file: url(img\/shield-motorway-1.png);\n [type='motorway'] {\n [reflen=1] { shield-file: url(img\/shield-motorway-1.png); }\n [reflen=2] { shield-file: url(img\/shield-motorway-2.png); }\n [reflen=3] { shield-file: url(img\/shield-motorway-3.png); }\n [reflen=4] { shield-file: url(img\/shield-motorway-4.png); }\n [reflen=5] { shield-file: url(img\/shield-motorway-5.png); }\n [reflen=6] { shield-file: url(img\/shield-motorway-6.png); }\n [reflen=7] { shield-file: url(img\/shield-motorway-7.png); }\n [reflen=8] { shield-file: url(img\/shield-motorway-8.png); }\n }\n [type='trunk'] {\n [reflen=1] { shield-file: url(img\/shield-trunk-1.png); }\n [reflen=2] { shield-file: url(img\/shield-trunk-2.png); }\n [reflen=3] { shield-file: url(img\/shield-trunk-3.png); }\n [reflen=4] { shield-file: url(img\/shield-trunk-4.png); }\n [reflen=5] { shield-file: url(img\/shield-trunk-5.png); }\n [reflen=6] { shield-file: url(img\/shield-trunk-6.png); }\n [reflen=7] { shield-file: url(img\/shield-trunk-7.png); }\n [reflen=8] { shield-file: url(img\/shield-trunk-8.png); }\n }\n [zoom=11] { shield-min-distance: 60; } \/\/50\n [zoom=12] { shield-min-distance: 80; } \/\/60\n [zoom=13] { shield-min-distance: 120; } \/\/120\n [zoom=14] { shield-min-distance: 180; }\n}\n\n#motorway_label[type='motorway'][zoom>9],\n#motorway_label[type='trunk'][zoom>9] {\n text-name:\"[name]\";\n text-face-name:@sans_bold;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:10;\n [zoom=11] { text-min-distance:70; }\n [zoom=12] { text-min-distance:80; }\n [zoom=13] { text-min-distance:100; }\n}\n\n#mainroad_label[type='primary'][zoom>12],\n#mainroad_label[type='secondary'][zoom>13],\n#mainroad_label[type='tertiary'][zoom>13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n#minorroad_label[zoom>14] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-size:9;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n\/* ================================================================== *\/\n\/* ONE-WAY ARROWS\n\/* ================================================================== *\/\n\n#motorway_label[oneway!=0][zoom>=16],\n#mainroad_label[oneway!=0][zoom>=16],\n#minorroad_label[oneway!=0][zoom>=16] {\n marker-placement:line;\n marker-max-error: 0.5;\n marker-spacing: 200;\n marker-file: url(img\/icon\/oneway.svg);\n [oneway=-1] { marker-file: url(img\/icon\/oneway-reverse.svg); }\n [zoom=16] { marker-transform: \"scale(0.5)\"; }\n [zoom=17] { marker-transform: \"scale(0.75)\"; }\n}\n\n\n\/* ****************************************************************** *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"e3c641e81fc52a24c9f9e81d381bbc6db8824be9","subject":"minor text fixes","message":"minor text fixes\n","repos":"silph-io\/osm-silph","old_file":"osm-bright\/roads.mss","new_file":"osm-bright\/roads.mss","new_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n#roads_low[zoom>=5][zoom<=8] {\n [type='motorway'] { line-color: @highway_fill; }\n [type='trunk'] { line-color: @trunk_line; }\n [zoom=5] {\n [type='motorway'] { line-width: 0.4; }\n [type='trunk'] { line-width: 0.2; } }\n [zoom=6] {\n [type='motorway'] { line-width: 0.5; }\n [type='trunk'] { line-width: 0.25; } }\n [zoom=7] {\n [type='motorway'] { line-width: 0.6; }\n [type='trunk'] { line-width: 0.3; } }\n [zoom=8] {\n [type='motorway'] { line-width: 1; }\n [type='trunk'] { line-width: 0.5; } }\n}\n\n\/* At mid-level scales start to show primary and secondary routes\nas well. *\/\n\n#roads_med[zoom>=9][zoom<=10] {\n [type='motorway'] { line-color: @highway_fill; }\n [type='motorway_link'] {\n line-color: @motorway_line;\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_line;\n }\n [type='primary'] { line-color: @primary_line; }\n [type='secondary'] { line-color: @secondary_line; }\n [type='tertiary'] { line-color: @standard_line; }\n [zoom=9] {\n [type='motorway'],[type='trunk'] { line-width: 1.4; }\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.6; }\n }\n [zoom=10] {\n [type='motorway'],[type='trunk'] { line-width: 1.8; }\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.8; }\n }\n}\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 1.6; @rdz11_med: 0.8; @rdz11_min: 0.4;\n@rdz12_maj: 2.5; @rdz12_med: 1.2; @rdz12_min: 0.8;\n@rdz13_maj: 3; @rdz13_med: 1.5; @rdz13_min: 1;\n@rdz14_maj: 4; @rdz14_med: 2.5; @rdz14_min: 1.6;\n@rdz15_maj: 6; @rdz15_med: 4; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 14; @rdz17_med: 12; @rdz17_min: 10;\n@rdz18_maj: 20; @rdz18_med: 17; @rdz18_min: 14;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz11_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz12_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz13_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz13_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz14_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz14_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz15_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz15_min + 2; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz16_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz16_min + 2; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: 0 }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj + 3; }\n [stylegroup='mainroad'] { line-width: @rdz17_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz17_min + 2; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 4; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj + 4; }\n [stylegroup='mainroad'] { line-width: @rdz18_med + 4; }\n [stylegroup='minorroad']{ line-width: @rdz18_min + 3.5; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 6; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4; line-dasharray: 2,1; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4; line-dasharray: 2,2; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4; line-dasharray: 3,3; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","old_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n#roads_low[zoom>=5][zoom<=8] {\n [type='motorway'] {\n ::fill {\n line-color: @highway_fill;\n }\n }\n [type='trunk'] { line-color: @trunk_line; }\n [zoom=5] {\n [type='motorway'] { line-width: 0.4; }\n [type='trunk'] { line-width: 0.2; } }\n [zoom=6] {\n [type='motorway'] { line-width: 0.5; }\n [type='trunk'] { line-width: 0.25; } }\n [zoom=7] {\n [type='motorway'] { line-width: 0.6; }\n [type='trunk'] { line-width: 0.3; } }\n [zoom=8] {\n [type='motorway'] { line-width: 1; }\n [type='trunk'] { line-width: 0.5; } }\n}\n\n\/* At mid-level scales start to show primary and secondary routes\nas well. *\/\n\n#roads_med[zoom>=9][zoom<=10] {\n [type='motorway'] {\n ::fill {\n line-color: @highway_fill;\n }\n }\n [type='motorway_link'] {\n line-color: @motorway_line;\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_line;\n }\n [type='primary'] { line-color: @primary_line; }\n [type='secondary'] { line-color: @secondary_line; }\n [type='tertiary'] { line-color: @standard_line; }\n [zoom=9] {\n [type='motorway'],[type='trunk'] { line-width: 1.4; }\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.6; }\n }\n [zoom=10] {\n [type='motorway'],[type='trunk'] { line-width: 1.8; }\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.8; }\n }\n}\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 1.6; @rdz11_med: 0.8; @rdz11_min: 0.4;\n@rdz12_maj: 2.5; @rdz12_med: 1.2; @rdz12_min: 0.8;\n@rdz13_maj: 3; @rdz13_med: 1.5; @rdz13_min: 1;\n@rdz14_maj: 4; @rdz14_med: 2.5; @rdz14_min: 1.6;\n@rdz15_maj: 6; @rdz15_med: 4; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 14; @rdz17_med: 12; @rdz17_min: 10;\n@rdz18_maj: 20; @rdz18_med: 17; @rdz18_min: 14;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz11_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz12_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz13_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz13_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz14_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz14_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz15_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz15_min + 2; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz16_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz16_min + 2; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: 0 }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj + 3; }\n [stylegroup='mainroad'] { line-width: @rdz17_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz17_min + 2; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 4; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj + 4; }\n [stylegroup='mainroad'] { line-width: @rdz18_med + 4; }\n [stylegroup='minorroad']{ line-width: @rdz18_min + 3.5; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 6; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4; line-dasharray: 2,1; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4; line-dasharray: 2,2; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4; line-dasharray: 3,3; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"3d01a6adc9a0f67612b61ed6ad2d7d4f2af8d5b3","subject":"Added reference to MeiFactory in SymbolHandlers","message":"Added reference to MeiFactory in SymbolHandlers\n\n","repos":"music-encoding\/sibmei","old_file":"src\/SymbolHandler.mss","new_file":"src\/SymbolHandler.mss","new_contents":"\/\/ TODO: Missing symbols\n\/\/ '240' double staccato\n\/\/ '241' tripe staccato\n\/\/ '242' quadruple staccato\n\nfunction InitSymbolHandlers () {\n \/\/$module(SymbolHandler.mss)\n\n symbolHandlers = CreateDictionary(\n 'Index', CreateDictionary(),\n 'Name', CreateDictionary()\n );\n\n RegisterHandlers(symbolHandlers, CreateDictionary(\n 'Index', CreateDictionary(\n '36', 'HandleControlEvent', \/\/inverted mordent\n '37', 'HandleControlEvent', \/\/mordent\n '38', 'HandleControlEvent', \/\/turn\n '39', 'HandleControlEvent', \/\/inverted turn\n '52', 'HandleModifier', \/\/heel\n '53', 'HandleModifier', \/\/heel (2) (was toe in previous version, but this seems to be wrong)\n '54', 'HandleModifier', \/\/toe\n '160', 'HandleModifier', \/\/stop\n '162', 'HandleModifier', \/\/open\n '163', 'HandleModifier', \/\/damp\n '164', 'HandleModifier', \/\/damp (2)\n '165', 'HandleModifier', \/\/damp (3)\n '166', 'HandleModifier', \/\/damp (4)\n '212', 'HandleModifier', \/\/ten above\n '214', 'HandleModifier', \/\/marc above\n '217', 'HandleModifier', \/\/upbow above\n '218', 'HandleModifier', \/\/dnbow above\n '233', 'HandleModifier', \/\/upbow below\n '234', 'HandleModifier', \/\/dnbow below\n '243', 'HandleModifier', \/\/snap\n '480', 'HandleModifier', \/\/scoop\n '481', 'HandleModifier', \/\/fall\n '490', 'HandleModifier', \/\/fingernail\n '494', 'HandleModifier', \/\/doit\n '495', 'HandleModifier' \/\/plop\n ),\n 'Name', CreateDictionary(\n 'Pedal', 'HandleControlEvent'\n )\n ), Self);\n\n return symbolHandlers;\n\n}\/\/$end\n\nfunction InitSymbolMap () {\n \/\/$module(SymbolHandler.mss)\n \/\/ Create a dictionary with symbol index number as key (sobj.Index) and a value that determines the element that has to be created\n \/\/ 0th element in SparseArray is the element name as function call\n \/\/ see for further instructions Utilities\/MeiFactory()\n\n return CreateDictionary(\n '36', CreateSparseArray('Mordent', CreateDictionary('form', 'lower')), \/\/inverted mordent\n '37', CreateSparseArray('Mordent', CreateDictionary('form','upper')), \/\/mordent\n '38', CreateSparseArray('Turn', CreateDictionary('form', 'upper')), \/\/turn\n '39', CreateSparseArray('Turn', CreateDictionary('form', 'lower')), \/\/inverted turn\n '52', CreateSparseArray('Artic', CreateDictionary('artic','heel')), \/\/heel\n '53', CreateSparseArray('Artic', CreateDictionary('artic','heel')), \/\/heel (2) (was toe in previous version, but this seems to be wrong)\n '54', CreateSparseArray('Artic', CreateDictionary('artic','toe')), \/\/toe\n '160', CreateSparseArray('Artic', CreateDictionary('artic','stop')), \/\/stop\n '162', CreateSparseArray('Artic', CreateDictionary('artic','open')), \/\/open\n '163', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp\n '164', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp (2)\n '165', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp (3)\n '166', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp (4)\n '212', CreateSparseArray('Artic', CreateDictionary('artic','ten', 'place','above')), \/\/ten above\n '214', CreateSparseArray('Artic', CreateDictionary('artic','marc', 'place','above')), \/\/marc above\n '217', CreateSparseArray('Artic', CreateDictionary('artic','upbow', 'place','above')), \/\/upbow above\n '218', CreateSparseArray('Artic', CreateDictionary('artic','dnbow', 'place','above')), \/\/dnbow above\n '233', CreateSparseArray('Artic', CreateDictionary('artic','upbow', 'place','below')), \/\/upbow below\n '234', CreateSparseArray('Artic', CreateDictionary('artic','dnbow', 'place','below')), \/\/dnbow below\n '243', CreateSparseArray('Artic', CreateDictionary('artic','snap')), \/\/snap\n '480', CreateSparseArray('Artic', CreateDictionary('artic','scoop')), \/\/scoop\n '481', CreateSparseArray('Artic', CreateDictionary('artic','fall')), \/\/fall\n '490', CreateSparseArray('Artic', CreateDictionary('artic','fingernail')), \/\/fingernail\n '494', CreateSparseArray('Artic', CreateDictionary('artic','doit')), \/\/doit\n '495', CreateSparseArray('Artic', CreateDictionary('artic','plop')), \/\/plop\n 'Pedal', CreateSparseArray('Pedal', CreateDictionary('dir', 'down', 'func', 'sustain')) \/\/Pedal\n ); \n\n} \/\/$end\n\n\nfunction HandleSymbol (sobj) {\n \/\/$module(SymbolHandler.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n \/\/ trills are special\n if (sobj.Index = '32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n \/\/ get SymbolIndexHandlers and SymbolIndexMap\n symbolHandlers = Self._property:SymbolHandlers;\n symbolMap = Self._property:SymbolMap;\n\n \/\/ look for symbol index in symbolHandlers.Index\n if(symbolHandlers.Index.MethodExists(sobj.Index))\n {\n symbId = sobj.Index;\n symbolHandlers.Index.@symbId(sobj, symbolMap[symbId]);\n }\n else\n {\n \/\/ look for symbol name in symbolHandlers.Name\n if(symbolHandlers.Name.MethodExists(sobj.Name))\n {\n symbName = sobj.Name;\n symbolHandlers.Name.@symbName(sobj, symbolMap[symbName]);\n }\n }\n \n} \/\/$end\n\nfunction HandleModifier(this, sobj, mapValue){\n \/\/$module(SymbolHandler.mss)\n\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n modifier = DataToMEI(mapValue);\n\n libmei.AddChild(nobj, modifier);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n\n} \/\/$end\n\nfunction HandleControlEvent(this, sobj, mapValue){\n \/\/$module(SymbolHandler.mss)\n\n symbol = DataToMEI(mapValue);\n\n symbol = AddBarObjectInfoToElement(sobj, symbol);\n mlines = Self._property:MeasureObjects;\n mlines.Push(symbol._id);\n\n} \/\/$end","old_contents":"\/\/ TODO: Missing symbols\n\/\/ '240' double staccato\n\/\/ '241' tripe staccato\n\/\/ '242' quadruple staccato\n\nfunction InitSymbolHandlers () {\n \/\/$module(SymbolHandler.mss)\n\n symbolHandlers = CreateDictionary(\n 'Index', CreateDictionary(),\n 'Name', CreateDictionary()\n );\n\n RegisterHandlers(symbolHandlers, CreateDictionary(\n 'Index', CreateDictionary(\n '36', 'HandleControlEvent', \/\/inverted mordent\n '37', 'HandleControlEvent', \/\/mordent\n '38', 'HandleControlEvent', \/\/turn\n '39', 'HandleControlEvent', \/\/inverted turn\n '52', 'HandleModifier', \/\/heel\n '53', 'HandleModifier', \/\/heel (2) (was toe in previous version, but this seems to be wrong)\n '54', 'HandleModifier', \/\/toe\n '160', 'HandleModifier', \/\/stop\n '162', 'HandleModifier', \/\/open\n '163', 'HandleModifier', \/\/damp\n '164', 'HandleModifier', \/\/damp (2)\n '165', 'HandleModifier', \/\/damp (3)\n '166', 'HandleModifier', \/\/damp (4)\n '212', 'HandleModifier', \/\/ten above\n '214', 'HandleModifier', \/\/marc above\n '217', 'HandleModifier', \/\/upbow above\n '218', 'HandleModifier', \/\/dnbow above\n '233', 'HandleModifier', \/\/upbow below\n '234', 'HandleModifier', \/\/dnbow below\n '243', 'HandleModifier', \/\/snap\n '480', 'HandleModifier', \/\/scoop\n '481', 'HandleModifier', \/\/fall\n '490', 'HandleModifier', \/\/fingernail\n '494', 'HandleModifier', \/\/doit\n '495', 'HandleModifier' \/\/plop\n ),\n 'Name', CreateDictionary(\n 'Pedal', 'HandleControlEvent'\n )\n ), Self);\n\n return symbolHandlers;\n\n}\/\/$end\n\nfunction InitSymbolMap () {\n \/\/$module(SymbolHandler.mss)\n \/\/ Create a dictionary with symbol index number as key (sobj.Index) and a value that determines the element that has to be created\n \/\/ 0th element in SparseArray is the element name as function call\n \/\/ following Dictionary contains attributes\n \/\/ TODO: key, CreateDictionary(Element, CreateDictionary(attname, attvalue))\n\n return CreateDictionary(\n '36', CreateSparseArray('Mordent', CreateDictionary('form', 'lower')), \/\/inverted mordent\n '37', CreateSparseArray('Mordent', CreateDictionary('form','upper')), \/\/mordent\n '38', CreateSparseArray('Turn', CreateDictionary('form', 'upper')), \/\/turn\n '39', CreateSparseArray('Turn', CreateDictionary('form', 'lower')), \/\/inverted turn\n '52', CreateSparseArray('Artic', CreateDictionary('artic','heel')), \/\/heel\n '53', CreateSparseArray('Artic', CreateDictionary('artic','heel')), \/\/heel (2) (was toe in previous version, but this seems to be wrong)\n '54', CreateSparseArray('Artic', CreateDictionary('artic','toe')), \/\/toe\n '160', CreateSparseArray('Artic', CreateDictionary('artic','stop')), \/\/stop\n '162', CreateSparseArray('Artic', CreateDictionary('artic','open')), \/\/open\n '163', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp\n '164', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp (2)\n '165', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp (3)\n '166', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp (4)\n '212', CreateSparseArray('Artic', CreateDictionary('artic','ten', 'place','above')), \/\/ten above\n '214', CreateSparseArray('Artic', CreateDictionary('artic','marc', 'place','above')), \/\/marc above\n '217', CreateSparseArray('Artic', CreateDictionary('artic','upbow', 'place','above')), \/\/upbow above\n '218', CreateSparseArray('Artic', CreateDictionary('artic','dnbow', 'place','above')), \/\/dnbow above\n '233', CreateSparseArray('Artic', CreateDictionary('artic','upbow', 'place','below')), \/\/upbow below\n '234', CreateSparseArray('Artic', CreateDictionary('artic','dnbow', 'place','below')), \/\/dnbow below\n '243', CreateSparseArray('Artic', CreateDictionary('artic','snap')), \/\/snap\n '480', CreateSparseArray('Artic', CreateDictionary('artic','scoop')), \/\/scoop\n '481', CreateSparseArray('Artic', CreateDictionary('artic','fall')), \/\/fall\n '490', CreateSparseArray('Artic', CreateDictionary('artic','fingernail')), \/\/fingernail\n '494', CreateSparseArray('Artic', CreateDictionary('artic','doit')), \/\/doit\n '495', CreateSparseArray('Artic', CreateDictionary('artic','plop')), \/\/plop\n 'Pedal', CreateSparseArray('Pedal', CreateDictionary('dir', 'down', 'func', 'sustain')) \/\/Pedal\n ); \n\n} \/\/$end\n\n\nfunction HandleSymbol (sobj) {\n \/\/$module(SymbolHandler.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n \/\/ trills are special\n if (sobj.Index = '32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n \/\/ get SymbolIndexHandlers and SymbolIndexMap\n symbolHandlers = Self._property:SymbolHandlers;\n symbolMap = Self._property:SymbolMap;\n\n \/\/ look for symbol index in symbolHandlers.Index\n if(symbolHandlers.Index.MethodExists(sobj.Index))\n {\n symbId = sobj.Index;\n symbolHandlers.Index.@symbId(sobj, symbolMap[symbId]);\n }\n else\n {\n \/\/ look for symbol name in symbolHandlers.Name\n if(symbolHandlers.Name.MethodExists(sobj.Name))\n {\n symbName = sobj.Name;\n symbolHandlers.Name.@symbName(sobj, symbolMap[symbName]);\n }\n }\n \n} \/\/$end\n\nfunction HandleModifier(this, sobj, mapValue){\n \/\/$module(SymbolHandler.mss)\n\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n modifier = DataToMEI(mapValue);\n\n libmei.AddChild(nobj, modifier);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n\n} \/\/$end\n\nfunction HandleControlEvent(this, sobj, mapValue){\n \/\/$module(SymbolHandler.mss)\n\n symbol = DataToMEI(mapValue);\n\n symbol = AddBarObjectInfoToElement(sobj, symbol);\n mlines = Self._property:MeasureObjects;\n mlines.Push(symbol._id);\n\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"97d50beb035cbcc3ed61701732acc5d9fe6feadc","subject":"Forest & grass zoom level adjustments.","message":"Forest & grass zoom level adjustments.\n","repos":"mapbox\/open-streets-style","old_file":"open-streets\/style.mss","new_file":"open-streets\/style.mss","new_contents":"\/*\n\nOPEN STREETS\n============\n\nA TileMill map style for OpenStreetMap. For PostGIS databases created \nby osm2pgsql with a default style file, or style that is compatible \nwith the default.\n\nUse the included `configure.py` script to customize your database and\nextent settings. See the README for more info.\n\n\n\n*\/\n\n\/* ---- PALETTE ---- *\/\n\n@water: #c0d8ff;\n@land: #f4f6f0;\n@forest: #c7e6a8;\n@agriculture:#f4f0e0;\n@grass: lighten(@forest,5);\n@park: lighten(@forest,10);\n@beach: #ffeec7;\n@building: darken(#e8e4e4,8);\n\n\/* ---- NATURAL & LANDUSE ---- *\/\n\nMap { background-color: @water; }\n\n#world[zoom<6],\n#shoreline_300[zoom>=6][zoom<10],\n#processed_p[zoom>=10] {\n polygon-fill: @land;\n}\n\n#ne-lakes[zoom<6],\n.water[zoom>5] {\n polygon-fill:@water;\n polygon-gamma:0.8;\n}\n.water-outline[zoom>11] {\n line-color:darken(@water,10);\n [zoom=12] { line-width:0.8; }\n [zoom=13] { line-width:1.2; }\n [zoom=14] { line-width:1.4; }\n [zoom=15] { line-width:1.6; }\n [zoom=16] { line-width:1.8; }\n [zoom>16] { line-width:2; }\n}\n\n.wetland[zoom>10] {\n polygon-pattern-file:url(..\/project\/open-streets\/res\/wetland-8.png);\n [zoom>13] { polygon-pattern-file:url(..\/project\/open-streets\/res\/wetland-16.png); }\n [zoom>15] { polygon-pattern-file:url(..\/project\/open-streets\/res\/wetland-32.png); }\n polygon-pattern-alignment: global;\n}\n\n.forest[zoom>6][size='huge'],\n.forest[zoom>7][size='large'],\n.forest[zoom>8][size='medium'],\n.forest[zoom>9][size='small'] {\n \/* At lower zoom levels forests are dense and distracting. \n Ramp them in gradually. *\/\n [zoom=7] { polygon-fill:lighten(@forest,14); }\n [zoom=8] { polygon-fill:lighten(@forest,12); }\n [zoom=9] { polygon-fill:lighten(@forest,9); }\n [zoom=10]{ polygon-fill:lighten(@forest,6); }\n [zoom=11]{ polygon-fill:lighten(@forest,3); }\n [zoom>11] { polygon-fill:@forest; }\n \/* These outlines create a slight faux-blur effect. *\/\n [zoom>14] {\n line-color:@forest;\n line-opacity:0.4;\n line-join:round; }\n [zoom=15] { line-width:1.6; }\n [zoom=16] { line-width:2.6; }\n [zoom=17] { line-width:3.6; }\n [zoom>=18] { line-width:4.6; }\n \/* a second outline for addtional blur *\/\n ::xtra {\n [zoom>16] {\n line-color:@forest;\n line-opacity:0.2;\n line-join:round; }\n [zoom=17] { line-width:7; }\n [zoom>=18] { line-width:9; }\n }\n}\n\n.agriculture[zoom>9] {\n polygon-fill:@agriculture;\n}\n\n.beach[zoom>9] {\n polygon-fill:@beach;\n}\n\n.grass[zoom>9][size='huge'],\n.grass[zoom>10][size='large'],\n.grass[zoom>11][size='medium'],\n.grass[zoom>12][size='small'] {\n \/* lighten relative to forest ramping *\/\n [zoom=10]{ polygon-fill:lighten(@grass,6); }\n [zoom=11]{ polygon-fill:lighten(@grass,3); }\n polygon-fill:@grass;\n}\n\n.park[zoom>9] {\n polygon-fill:@park;\n [zoom>13] { line-color:darken(@park,20); }\n [zoom=14] { line-width:0.6; }\n [zoom=15] { line-width:0.8; }\n [zoom>15] { line-width:1.2; }\n}\n\n\/* ---- CAMPUSES ---- *\/\n\/* Note that amenity=school, amenity=hospital, etc are ideally polygons of the\n *campus*, but are occasionally applied to the physical building instead. *\/\n@campus: #ECF;\n.campus[zoom>10] {\n polygon-opacity:0.2;\n polygon-fill:@campus;\n [zoom>12] {\n line-opacity:0.4;\n line-color:spin(darken(@campus,20),20);\n }\n [zoom=13] { line-width:0.3; }\n [zoom=14] { line-width:0.5; }\n [zoom=15] { line-width:0.7; }\n [zoom=16] { line-width:0.8; }\n [zoom=17] { line-width:0.9; }\n [zoom=18] { line-width:1.0; }\n}\n\n\/* ---- BUILDINGS ---- *\/\n\/* Transparent buildings account for situations where routes go\n in or under them *\/\n.building[zoom>10][zoom<17] {\n polygon-fill:@building,8;\n [zoom=11] { polygon-opacity:0.1; }\n [zoom=12] { polygon-opacity:0.2; }\n [zoom=13] { polygon-opacity:0.3; }\n [zoom>13] {\n polygon-opacity:0.4;\n line-color:darken(@building,5);\n line-width:0.2;\n }\n [zoom>15] {\n line-color:darken(@building,10);\n line-width:0.4;\n }\n}\n.building[zoom>=17] {\n building-fill:lighten(@building,4);\n building-fill-opacity: 0.8;\n building-height:1.2;\n}","old_contents":"\/*\n\nOPEN STREETS\n============\n\nA TileMill map style for OpenStreetMap. For PostGIS databases created \nby osm2pgsql with a default style file, or style that is compatible \nwith the default.\n\nUse the included `configure.py` script to customize your database and\nextent settings. See the README for more info.\n\n\n\n*\/\n\n\/* ---- PALETTE ---- *\/\n\n@water: #c0d8ff;\n@land: #f4f6f0;\n@forest: #c7e6a8;\n@agriculture:#f4f0e0;\n@grass: lighten(@forest,5);\n@park: lighten(@forest,10);\n@beach: #ffeec7;\n@building: darken(#e8e4e4,8);\n\n\/* ---- NATURAL & LANDUSE ---- *\/\n\nMap { background-color: @water; }\n\n#world[zoom<6],\n#shoreline_300[zoom>=6][zoom<10],\n#processed_p[zoom>=10] {\n polygon-fill: @land;\n}\n\n#ne-lakes[zoom<6],\n.water[zoom>5] {\n polygon-fill:@water;\n polygon-gamma:0.8;\n}\n.water-outline[zoom>11] {\n line-color:darken(@water,10);\n [zoom=12] { line-width:0.8; }\n [zoom=13] { line-width:1.2; }\n [zoom=14] { line-width:1.4; }\n [zoom=15] { line-width:1.6; }\n [zoom=16] { line-width:1.8; }\n [zoom>16] { line-width:2; }\n}\n\n.wetland[zoom>10] {\n polygon-pattern-file:url(..\/project\/open-streets\/res\/wetland-8.png);\n [zoom>13] { polygon-pattern-file:url(..\/project\/open-streets\/res\/wetland-16.png); }\n [zoom>15] { polygon-pattern-file:url(..\/project\/open-streets\/res\/wetland-32.png); }\n polygon-pattern-alignment: global;\n}\n\n.forest[zoom>7] {\n \/* At lower zoom levels forests are dense and distracting. \n Ramp them in gradually. *\/\n [zoom=8] { polygon-fill:lighten(@forest,12); }\n [zoom=9] { polygon-fill:lighten(@forest,9); }\n [zoom=10]{ polygon-fill:lighten(@forest,6); }\n [zoom=11]{ polygon-fill:lighten(@forest,3); }\n [zoom>11] { polygon-fill:@forest; }\n \/* These outlines create a slight faux-blur effect. *\/\n [zoom>14] {\n line-color:@forest;\n line-opacity:0.4;\n line-join:round; }\n [zoom=15] { line-width:1.6; }\n [zoom=16] { line-width:2.6; }\n [zoom=17] { line-width:3.6; }\n [zoom>=18] { line-width:4.6; }\n \/* a second outline for addtional blur *\/\n ::xtra {\n [zoom>16] {\n line-color:@forest;\n line-opacity:0.2;\n line-join:round; }\n [zoom=17] { line-width:7; }\n [zoom>=18] { line-width:9; }\n }\n}\n\n.agriculture[zoom>9] {\n polygon-fill:@agriculture;\n}\n\n.beach[zoom>9] {\n polygon-fill:@beach;\n}\n\n.grass[zoom>9] {\n polygon-fill:@grass;\n}\n\n.park[zoom>9] {\n polygon-fill:@park;\n [zoom>13] { line-color:darken(@park,20); }\n [zoom=14] { line-width:0.6; }\n [zoom=15] { line-width:0.8; }\n [zoom>15] { line-width:1.2; }\n}\n\n\/* ---- CAMPUSES ---- *\/\n\/* Note that amenity=school, amenity=hospital, etc are ideally polygons of the\n *campus*, but are occasionally applied to the physical building instead. *\/\n@campus: #ECF;\n.campus[zoom>10] {\n polygon-opacity:0.2;\n polygon-fill:@campus;\n [zoom>12] {\n line-opacity:0.4;\n line-color:spin(darken(@campus,20),20);\n }\n [zoom=13] { line-width:0.3; }\n [zoom=14] { line-width:0.5; }\n [zoom=15] { line-width:0.7; }\n [zoom=16] { line-width:0.8; }\n [zoom=17] { line-width:0.9; }\n [zoom=18] { line-width:1.0; }\n}\n\n\/* ---- BUILDINGS ---- *\/\n\/* Transparent buildings account for situations where routes go\n in or under them *\/\n.building[zoom>10][zoom<17] {\n polygon-fill:@building,8;\n [zoom=11] { polygon-opacity:0.1; }\n [zoom=12] { polygon-opacity:0.2; }\n [zoom=13] { polygon-opacity:0.3; }\n [zoom>13] {\n polygon-opacity:0.4;\n line-color:darken(@building,5);\n line-width:0.2;\n }\n [zoom>15] {\n line-color:darken(@building,10);\n line-width:0.4;\n }\n}\n.building[zoom>=17] {\n building-fill:lighten(@building,4);\n building-fill-opacity: 0.8;\n building-height:1.2;\n}","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"422a28f08544f1f18596697aaea47a1316633806","subject":"minor text fixes","message":"minor text fixes\n","repos":"silph-io\/osm-silph","old_file":"osm-bright\/palette.mss","new_file":"osm-bright\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";*\/\n\n\n@sans_lt_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans_bold: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_bold_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold Italic\",\"DejaVu Sans Bold Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #DCDCDC;\n@water: #138AB6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #91c082;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n\n@building: #F4F4F4;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #FFFFFF;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #FFFFFF;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n@primary_line: #FFFFFF;\n@primary_fill: lighten(@primary_line,10%);\n@primary_case: @primary_line * 0.9;\n\n@primary_line: @secondary_line;\n@primary_fill: @secondary_fill;\n\n@secondary_line: #FFFFFF;\n@secondary_fill: #DDDDDD;\n@secondary_case: @secondary_line * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,34%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n@poi_text: #888;\n\n@road_text: #444;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";*\/\n\n\n@sans_lt_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans_bold: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_bold_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold Italic\",\"DejaVu Sans Bold Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #dcdcdc;\n@water: #138ab6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #91c082;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n\n@building: #f4f4f4;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #FFFFFF;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #FFFFFF;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n@primary_line: #FFFFFF;\n@primary_fill: lighten(@primary_line,10%);\n@primary_case: @primary_line * 0.9;\n\n@primary_line: @secondary_line;\n@primary_fill: @secondary_fill;\n\n@secondary_line: #FFFFFF;\n@secondary_fill: #DDDDDD;\n@secondary_case: @secondary_line * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,34%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n@poi_text: #888;\n\n@road_text: #444;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"975080b4f48cf3fc2c2cd2a8954ca5d7f989db9c","subject":"Color tweaks","message":"Color tweaks\n","repos":"saydulk\/osm-bright,raumobil\/osm-bright,makinacorpus\/osm-makina,Sweetymeow\/osm-bright,yohanboniface\/osm-bright,pinkflozd\/osm-bright,silph-io\/osm-silph,brelevenix\/osm-bright-tregor,jeffaudi\/osm-hybrid,mapbox\/osm-bright","old_file":"osm-bright\/palette.mss","new_file":"osm-bright\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for ImpOSM *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Open Sans Regular\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans: \"Open Sans Semibold\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_bold: \"Open Sans Bold\",\"DejaVu Sans Bold\",\"unifont Medium\";\n@sans_italic: \"Open Sans Semibold Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans_bold_italic: \"Open Sans Bold Italic\",\"DejaVu Sans Bold Italic\",\"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #fcfbe7;\n@water: #c4dff6;\n\n@agriculture: #f4f0e0;\n@beach: #ffeec7;\n@building: #e4e0e0;\n@cemetery: #D6DED2;\n@forest: #C3D9AD;\n@grass: lighten(@forest,5);\n@hospital: rgb(229,198,195);\n@industrial: #e8e8e8;\n@park: lighten(@forest,10);\n@parking: #eee;\n@residential: desaturate(darken(@land,5),10);\n@school: #FEA;\n@sports: #DED1AB;\n@transport: rgb(200,200,200);\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #4888d8;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: darken(@motorway_line,20%);\n\n@trunk_line: @motorway_line;\n@trunk_fill: @motorway_fill;\n@trunk_case: @motorway_case;\n\n@primary_line: darken(#f9cf66,20%);\n@primary_fill: lighten(#f9cf66,20%);\n@primary_case: @primary_line;\n\n@secondary_line: @primary_line;\n@secondary_fill: @primary_fill;\n@secondary_case: @primary_case;\n\n@standard_line: @land * 0.9;\n@standard_fill: #fff;\n@standard_case: fadeout(#000,90%);\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @standard_case;\n\n@bridge_case: rgba(0,0,0,0.33);\n\n@track: #aaa;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: #999;\n\n@aeroway: rgb(180,180,180);\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,25%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for ImpOSM *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Open Sans Regular\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans: \"Open Sans Semibold\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_bold: \"Open Sans Bold\",\"DejaVu Sans Bold\",\"unifont Medium\";\n@sans_italic: \"Open Sans Semibold Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans_bold_italic: \"Open Sans Bold Italic\",\"DejaVu Sans Bold Italic\",\"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #fcfbe7;\n@water: #c4dff2;\n\n@agriculture: #f4f0e0;\n@beach: #ffeec7;\n@building: #e4e0e0;\n@cemetery: #d1d1d1;\n@forest: #C3D9AD;\n@grass: lighten(@forest,5);\n@hospital: rgb(229,198,195);\n@industrial: #e8e8e8;\n@park: lighten(@forest,10);\n@parking: #eee;\n@residential: desaturate(darken(@land,5),10);\n@school: #FEA;\n@sports: #DED1AB;\n@transport: rgb(200,200,200);\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #4888d8;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: darken(@motorway_line,20%);\n\n@trunk_line: @motorway_line;\n@trunk_fill: @motorway_fill;\n@trunk_case: @motorway_case;\n\n@primary_line: darken(#f9cf66,20%);\n@primary_fill: lighten(#f9cf66,20%);\n@primary_case: @primary_line;\n\n@secondary_line: @primary_line;\n@secondary_fill: @primary_fill;\n@secondary_case: @primary_case;\n\n@standard_line: @land * 0.9;\n@standard_fill: #fff;\n@standard_case: fadeout(#000,90%);\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @standard_case;\n\n@bridge_case: rgba(0,0,0,0.33);\n\n@track: #aaa;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: #999;\n\n@aeroway: rgb(180,180,180);\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,25%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"490de1f1ca4b13d162656ff42a163d110ec8d8a1","subject":"minor text fixes","message":"minor text fixes\n","repos":"silph-io\/osm-silph","old_file":"osm-bright\/palette.mss","new_file":"osm-bright\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";*\/\n\n\n@sans_lt_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans_bold: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_bold_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold Italic\",\"DejaVu Sans Bold Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #DCDCDC;\n@water: #138AB6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #bedb9f;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n\n@building: #F4F4F4;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: @standard_line;\n@motorway_fill: @standard_fill;\n@motorway_case: @standard_case;\n\n@trunk_line: @standard_line;\n@trunk_fill: @standard_fill;\n@trunk_case: @standard_case;\n\n@primary_line: @standard_line;\n@primary_fill: @standard_fill;\n@primary_case: @standard_case;\n\n@secondary_line: @standard_line;\n@secondary_fill: @standard_fill;\n@secondary_case: @standard_case;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,34%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n@poi_text: #888;\n\n@road_text: #444;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";*\/\n\n\n@sans_lt_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans_bold: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_bold_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold Italic\",\"DejaVu Sans Bold Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #DCDCDC;\n@water: #138AB6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #91c082;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n\n@building: #F4F4F4;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: @standard_line;\n@motorway_fill: @standard_fill;\n@motorway_case: @standard_case;\n\n@trunk_line: @standard_line;\n@trunk_fill: @standard_fill;\n@trunk_case: @standard_case;\n\n@primary_line: @standard_line;\n@primary_fill: @standard_fill;\n@primary_case: @standard_case;\n\n@secondary_line: @standard_line;\n@secondary_fill: @standard_fill;\n@secondary_case: @standard_case;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,34%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n@poi_text: #888;\n\n@road_text: #444;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"7bd8600cfe949daedb93adb4cf8e772a3a7a6800","subject":"Fixed: Bug in method renaming","message":"Fixed: Bug in method renaming\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/Utilities.mss","new_file":"src\/Utilities.mss","new_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in \n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/* \n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a dictionary of {pos:id} mappings for a given\n \/\/ voice, and returns the NoteRest object. If one isn't found\n \/\/ exactly at `position`, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (startids, endids, tstamps, etc.) to an element\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n libmei.AddAttribute(element, 'dur.ges', bobj.Duration & 'p');\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n\n if (bobj.Type = 'Line')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionToTimestamp(bobj.EndPosition, bar));\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction IsLastNoteInTuplet (bobj) {\n \/\/$module(Utilities.mss)\n if (bobj.ParentTupletIfAny = null)\n {\n return false;\n }\n\n tuplet = bobj.ParentTupletIfAny;\n\n if (bobj.PositionInTuplet >= tuplet.Duration)\n {\n return true;\n }\n\n return false;\n\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n Sibelius.AppendLineToFile(LOGFILE, message, True);\n} \/\/$end","old_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in \n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/* \n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a dictionary of {pos:id} mappings for a given\n \/\/ voice, and returns the NoteRest object. If one isn't found\n \/\/ exactly at `position`, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (startids, endids, tstamps, etc.) to an element\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n libmei.AddAttribute(element, 'dur.ges', bobj.Duration & 'p');\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n\n if (bobj.Type = 'Line')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionToTimestamp(bobj.EndPosition, bar));\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsets(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsets(bobj.Dy));\n }\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction IsLastNoteInTuplet (bobj) {\n \/\/$module(Utilities.mss)\n if (bobj.ParentTupletIfAny = null)\n {\n return false;\n }\n\n tuplet = bobj.ParentTupletIfAny;\n\n if (bobj.PositionInTuplet >= tuplet.Duration)\n {\n return true;\n }\n\n return false;\n\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n Sibelius.AppendLineToFile(LOGFILE, message, True);\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"14947909cd3337ea8153d4167612ad074fecb033","subject":"#5 first pass at adding halos to place labels","message":"#5 first pass at adding halos to place labels\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Narrow Regular', 'Unifont Medium';\n\n@label_color_transport: #524c4c;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n@label_color_green_area: #374c30;\n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-avoid-edges: true;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=11] {\n text-fill: #586e50;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n\n [zoom>=11] {\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_green_area_halo;\n }\n [zoom>=15] {\n text-halo-radius: @text_font_halo_radius_large;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 18;\n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-size: 22;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 22;\n text-min-distance: 15;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.1;\n \/\/}\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-placement: interior;\n text-vertical-alignment: bottom;\n text-min-distance: 5;\n text-dy: -5;\n\n [justified='left'] {\n \/\/text-horizontal-alignment: left;\n text-horizontal-alignment: middle;\n \/\/text-dx: 20;\n }\n\n [justified='right'] {\n \/\/text-horizontal-alignment: right;\n text-horizontal-alignment: middle;\n \/\/text-dx: -20;\n }\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size>=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.3;\n \/\/}\n [justified='left'] {\n text-horizontal-alignment: left;\n text-dx: 15;\n }\n\n [justified='right'] {\n text-horizontal-alignment: right;\n text-dx: -15;\n }\n\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_sm;\n text-min-distance: 5;\n text-allow-overlap: true;\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: 2;\n text-halo-fill: fadeout(rgba(255,255,255, 0.7), 30%);\n \/\/ text-comp-op: src;\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n \n [zoom>=11] {\n text-halo-fill: fadeout(rgba(255,255,255, 1), 30%);\n }\n}\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n marker-ignore-placement: true;\n marker-width: 5;\n marker-fill: #2e2115;\n marker-line-width: 0;\n}\n\n","old_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Narrow Regular', 'Unifont Medium';\n\n@label_color_transport: #524c4c;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n@label_color_green_area: #374c30;\n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-avoid-edges: true;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=11] {\n text-fill: #586e50;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n\n [zoom>=11] {\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_green_area_halo;\n }\n [zoom>=15] {\n text-halo-radius: @text_font_halo_radius_large;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 18;\n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-size: 22;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 22;\n text-min-distance: 15;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-fill: @label_color_administrative;\n}\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.1;\n \/\/}\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-placement: interior;\n text-vertical-alignment: bottom;\n text-min-distance: 5;\n text-dy: -5;\n\n [justified='left'] {\n \/\/text-horizontal-alignment: left;\n text-horizontal-alignment: middle;\n \/\/text-dx: 20;\n }\n\n [justified='right'] {\n \/\/text-horizontal-alignment: right;\n text-horizontal-alignment: middle;\n \/\/text-dx: -20;\n }\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size>=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.3;\n \/\/}\n [justified='left'] {\n text-horizontal-alignment: left;\n text-dx: 15;\n }\n\n [justified='right'] {\n text-horizontal-alignment: right;\n text-dx: -15;\n }\n\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_sm;\n text-min-distance: 5;\n text-allow-overlap: true;\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_medium_plus;\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n marker-ignore-placement: true;\n marker-width: 5;\n marker-fill: #2e2115;\n marker-line-width: 0;\n}\n\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"7dc36b2e4fb4412b6fd7dc110774e1150b5456e7","subject":"Fixed: Remove duplicate articulation handler","message":"Fixed: Remove duplicate articulation handler\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n mobj = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pnum & '.0' \/ pden & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', gesdur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n mobj = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pnum & '.0' \/ pden & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', gesdur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"d360c4e8888372bb57a64e28a123b3c1b2045e7d","subject":"#10 use rectangle svg icon for default shield","message":"#10 use rectangle svg icon for default shield\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_shield: 'PT Sans Bold', 'Unifont';\n@text_font_administrative: 'PT Sans Bold', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Italic', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Bold Italic', 'Unifont Bold';\n\n@label_color_transport: #524c4c;\n@label_color_shield: #fff;\n@label_color_shield_fed: #333;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n@text_font_size_xlg: 22;\n@text_font_size_xxlg: 34;\n\n@text_character_spacing_sm: 0.7;\n@text_character_spacing_md: 1.2;\n@text_character_spacing_lg: 1.7;\n@text_character_spacing_xlg: 2.2;\n\n@text_font_halo_radius_sm: 1.5;\n@text_font_halo_radius_md: 1.75;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: #F7F7E6;\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_shield;\n text-size: 14;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-character-spacing: @text_character_spacing_sm;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: 2;\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n \/\/ default rectangle shield\n shield-file: url(shields\/default.svg);\n shield-fill: @label_color_shield_fed; \n shield-transform: scale(0.2,0.2);\n shield-face-name: @text_font_shield;\n shield-name: [ref];\n shield-size: 10;\n shield-min-distance: 44;\n shield-spacing: 20;\n \/\/ half the width of the shield to prevent from wrapping\n shield-min-padding: 10;\n\n [ref=~'I \\d+'] {\n shield-file: url(shields\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 65;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 15;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(shields\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 40;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 13;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'US \\d+'] {\n shield-file: url(shields\/us.svg);\n shield-transform: scale(0.062, 0.062);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: @label_color_shield_fed;\n shield-text-dy: 1;\n shield-character-spacing: -1;\n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.075, 0.075);\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.088, 0.088);\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.091, 0.091);\n } \n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(shields\/ca.svg);\n shield-fill: @label_color_shield;\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-dy: -2.5;\n shield-character-spacing: -1;\n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.060, 0.060);\n shield-min-distance: 50;\n }\n\n [zoom>=14] {\n shield-min-distance: 80;\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.080, 0.080);\n shield-dy: -3.5;\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.090, 0.090); \n } \n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n \n text-face-name: @text_font_water_bold;\n text-wrap-width: 40;\n text-wrap-character: ' ';\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_xlg;\n text-align: center;\n\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][scalerank<4][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][scalerank<7][changed!='']\n{\n text-name: [name];\n\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n text-face-name: @text_font_water_bold;\n text-wrap-width: 50;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_lg;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels { \n \/\/ [zoom>=4][scalerank<3],\n [zoom>=5][scalerank<3][admin!='United States of America'][admin!='Canada'],\n [zoom>=6][scalerank<5],\n [zoom>=7][scalerank>=5] {\n text-name: [name];\n text-transform: uppercase;\n text-face-name: @text_font_administrative; \n text-face-name: @text_font_administrative;\n text-fill: @label_color_administrative;\n text-halo-fill: @label_color_halo_low;\n text-halo-radius: @text_font_halo_radius_sm;\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-placement-type: simple;\n text-placements: 'E,N,W,S';\n \n [zoom>=5] {\n text-size: @text_font_size_sm; \n }\n\n [zoom>=6] {\n text-size: @text_font_size_medium;\n text-character-spacing: 2;\n }\n\n [zoom>=7] {\n text-size: @text_font_size_large;\n text-character-spacing: 3;\n } \n }\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n text-character-spacing: 1;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80; \n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n \/\/ text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_medium;\n text-character-spacing: 2;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n text-character-spacing: 3;\n}\n\n\/* Admin 0 labels *\/\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_sm;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-size: @text_font_size_large;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-character-spacing: @text_character_spacing_sm;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_lg;\n text-size: @text_font_size_large;\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xlg;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xxlg;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n\/* city labels *\/\n\n#aries-places-labels {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<7],\n [zoom=7][scalerank<8],\n [zoom=8][scalerank<9],\n [zoom=9][scalerank<10],\n [zoom=10][scalerank<11],\n [zoom=11][scalerank<12],\n [zoom=12][scalerank<13],\n [zoom=13][scalerank<14], \n [zoom=14][scalerank<15] \n [zoom>=15][scalerank<15]{\n\n shield-file: url(shields\/circle-12.svg);\n shield-fill: @label_color_city;\n shield-halo-fill: @label_color_halo_low;\n shield-halo-radius: @text_font_halo_radius_sm;\n shield-unlock-image: true; \n shield-transform: scale(0.5, 0.5);\n shield-face-name: @text_font_city;\n shield-name: [name]; \n shield-min-distance: 2; \n shield-placement-type: simple;\n shield-placements: 'NE, N, NW, SE, S, SW';\n shield-justify-alignment: auto;\n shield-horizontal-alignment: auto;\n\n [zoom>=4] {\n shield-size: @text_font_size_xsm;\n shield-text-dy: -7;\n \n [population>700000] {\n shield-size: @text_font_size_xsm * 1.2;\n shield-transform: scale(0.7, 0.7);\n shield-text-dy: -9;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xsm * 1.3;\n shield-transform: scale(0.8, 0.8);\n shield-text-dy: -10;\n } \n }\n\n [zoom>=5]{\n shield-size: @text_font_size_sm; \n shield-text-dy: -7; \n \n [population>700000] {\n shield-size: @text_font_size_sm * 1.2;\n shield-text-dy: -9;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_sm * 1.3;\n } \n }\n\n [zoom>=6]{\n shield-size: @text_font_size_medium; \n shield-text-dy: -8;\n\n [population>700000] {\n shield-size: @text_font_size_medium * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium * 1.5;\n } \n }\n\n [zoom>=8] {\n shield-halo-radius: @text_font_halo_radius_md;\n }\n\n [zoom>=10]{\n shield-size: @text_font_size_medium_plus; \n shield-halo-radius: @text_font_halo_radius_large;\n shield-halo-fill: @label_color_halo_high;\n \n [population>700000] {\n shield-size: @text_font_size_medium_plus * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium_plus * 1.3;\n } \n }\n\n [zoom>=11] {\n shield-opacity: 0;\n }\n }\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n\n","old_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_shield: 'PT Sans Bold', 'Unifont';\n@text_font_administrative: 'PT Sans Bold', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Italic', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Bold Italic', 'Unifont Bold';\n\n@label_color_transport: #524c4c;\n@label_color_shield: #fff;\n@label_color_shield_fed: #333;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n@text_font_size_xlg: 22;\n@text_font_size_xxlg: 34;\n\n@text_character_spacing_sm: 0.7;\n@text_character_spacing_md: 1.2;\n@text_character_spacing_lg: 1.7;\n@text_character_spacing_xlg: 2.2;\n\n@text_font_halo_radius_sm: 1.5;\n@text_font_halo_radius_md: 1.75;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: #F7F7E6;\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_shield;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-character-spacing: @text_character_spacing_sm;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: 2;\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n \/\/ arbitrary default shield\n shield-file: url(shields\/state-25.png);\n shield-fill: @label_color_shield_fed; \n shield-transform: scale(1.2, 1.2);\n shield-face-name: @text_font_shield;\n shield-name: [ref];\n shield-size: 10;\n shield-min-distance: 44;\n shield-spacing: 20;\n \/\/ half the width of the shield to prevent from wrapping\n shield-min-padding: 10;\n\n [ref=~'I \\d+'] {\n shield-file: url(shields\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 65;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 15;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(shields\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 40;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 13;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'US \\d+'] {\n shield-file: url(shields\/us.svg);\n shield-transform: scale(0.062, 0.062);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: @label_color_shield_fed;\n shield-text-dy: 1;\n shield-character-spacing: -1;\n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.075, 0.075);\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.088, 0.088);\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.091, 0.091);\n } \n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(shields\/ca.svg);\n shield-fill: @label_color_shield;\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-dy: -2.5;\n shield-character-spacing: -1;\n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.060, 0.060);\n shield-min-distance: 50;\n }\n\n [zoom>=14] {\n shield-min-distance: 80;\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.080, 0.080);\n shield-dy: -3.5;\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.090, 0.090); \n } \n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n \n text-face-name: @text_font_water_bold;\n text-wrap-width: 40;\n text-wrap-character: ' ';\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_xlg;\n text-align: center;\n\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][scalerank<4][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][scalerank<7][changed!='']\n{\n text-name: [name];\n\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n text-face-name: @text_font_water_bold;\n text-wrap-width: 50;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_lg;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels { \n \/\/ [zoom>=4][scalerank<3],\n [zoom>=5][scalerank<3][admin!='United States of America'][admin!='Canada'],\n [zoom>=6][scalerank<5],\n [zoom>=7][scalerank>=5] {\n text-name: [name];\n text-transform: uppercase;\n text-face-name: @text_font_administrative; \n text-face-name: @text_font_administrative;\n text-fill: @label_color_administrative;\n text-halo-fill: @label_color_halo_low;\n text-halo-radius: @text_font_halo_radius_sm;\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-placement-type: simple;\n text-placements: 'E,N,W,S';\n \n [zoom>=5] {\n text-size: @text_font_size_sm; \n }\n\n [zoom>=6] {\n text-size: @text_font_size_medium;\n text-character-spacing: 2;\n }\n\n [zoom>=7] {\n text-size: @text_font_size_large;\n text-character-spacing: 3;\n } \n }\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n text-character-spacing: 1;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80; \n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_medium;\n text-character-spacing: 2;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n text-character-spacing: 3;\n}\n\n\/* Admin 0 labels *\/\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_sm;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-size: @text_font_size_large;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-character-spacing: @text_character_spacing_sm;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_lg;\n text-size: @text_font_size_large;\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xlg;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xxlg;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n\/* city labels *\/\n\n#aries-places-labels {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<7],\n [zoom=7][scalerank<8],\n [zoom=8][scalerank<9],\n [zoom=9][scalerank<10],\n [zoom=10][scalerank<11],\n [zoom=11][scalerank<12],\n [zoom=12][scalerank<13],\n [zoom=13][scalerank<14], \n [zoom=14][scalerank<15] \n [zoom>=15][scalerank<15]{\n\n shield-file: url(shields\/circle-12.svg);\n shield-fill: @label_color_city;\n shield-halo-fill: @label_color_halo_low;\n shield-halo-radius: @text_font_halo_radius_sm;\n shield-unlock-image: true; \n shield-transform: scale(0.5, 0.5);\n shield-face-name: @text_font_city;\n shield-name: [name]; \n shield-min-distance: 2; \n shield-placement-type: simple;\n shield-placements: 'NE, N, NW, SE, S, SW';\n shield-justify-alignment: auto;\n shield-horizontal-alignment: auto;\n\n [zoom>=4] {\n shield-size: @text_font_size_xsm;\n shield-text-dy: -7;\n \n [population>700000] {\n shield-size: @text_font_size_xsm * 1.2;\n shield-transform: scale(0.7, 0.7);\n shield-text-dy: -9;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xsm * 1.3;\n shield-transform: scale(0.8, 0.8);\n shield-text-dy: -10;\n } \n }\n\n [zoom>=5]{\n shield-size: @text_font_size_sm; \n shield-text-dy: -7; \n \n [population>700000] {\n shield-size: @text_font_size_sm * 1.2;\n shield-text-dy: -9;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_sm * 1.3;\n } \n }\n\n [zoom>=6]{\n shield-size: @text_font_size_medium; \n shield-text-dy: -8;\n\n [population>700000] {\n shield-size: @text_font_size_medium * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium * 1.5;\n } \n }\n\n [zoom>=8] {\n shield-halo-radius: @text_font_halo_radius_md;\n }\n\n [zoom>=10]{\n shield-size: @text_font_size_medium_plus; \n shield-halo-radius: @text_font_halo_radius_large;\n shield-halo-fill: @label_color_halo_high;\n \n [population>700000] {\n shield-size: @text_font_size_medium_plus * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium_plus * 1.3;\n } \n }\n\n [zoom>=11] {\n shield-opacity: 0;\n }\n }\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"f3f41e4a0a525cde428fcf45571346f6b2aed5e4","subject":"Using new inline properties for freeway centerlines, yay they layer correctly","message":"Using new inline properties for freeway centerlines, yay they layer correctly\n\ngit-svn-id: 52b2958d923a603b3f48d22aabe6b5bf40478d2a@482 dbea3d40-3153-0410-b551-57805770c6e6\n","repos":"glampr\/Cascadenik,mapnik\/Cascadenik","old_file":"openstreetmap\/roads.mss","new_file":"openstreetmap\/roads.mss","new_contents":".road\n{\n line-cap: round;\n line-join: miter;\n outline-cap: butt;\n outline-join: miter;\n}\n\n.road.outline[tunnel=yes],\n.road.outline[tunnel=true]\n{\n line-cap: butt;\n line-dasharray: 4,6;\n}\n\n.road.inline[zoom>=14][prominence=major][bridge=true],\n.road.inline[zoom>=14][prominence=major][bridge=yes],\n.road.inline[zoom>=16][bridge=true],\n.road.inline[zoom>=16][bridge=yes]\n{\n outline-width: 1;\n}\n\n\/*\n.road.inline[zoom>=13][prominence=major][bridge=yes],\n.road.inline[zoom>=13][prominence=major][bridge=true]\n{\n outline-width: 1;\n outline-color: #888;\n}\n*\/\n\n\/** Road Weights **\/\n\n.motorway.inline[zoom>=9][zoom<=11][highway=trunk] { line-width: 2; }\n.motorway.outline[zoom>=9][zoom<=11][highway=trunk] { line-width: 4; }\n.motorway.inline[zoom>=7][zoom<=11][highway=motorway] { line-width: 2; }\n.motorway.outline[zoom>=7][zoom<=11][highway=motorway] { line-width: 4; }\n\n.road.inline[zoom>=7][zoom<=11][prominence=major][highway=motoryway] { line-width: 2; }\n.road.outline[zoom>=7][zoom<=11][prominence=major][highway=motoryway] { line-width: 4; }\n\n.road.texture[zoom>=7][zoom<=10] { line-width: 1; } \/* general background fuzz *\/\n\n.road.inline[zoom>=7][zoom<=10][prominence=major][highway=motorway] { line-width: 2; }\n.road.inline[zoom>=11][zoom<=12][prominence=major][highway!=motorway_link] { line-width: 2; }\n.road.outline[zoom>=11][zoom<=12][prominence=major][highway!=motorway_link] { line-width: 4; }\n\n.road.texture[zoom>=11][zoom<=12] { line-width: 1; }\n\n.road.inline[zoom=13][prominence=major] { line-width: 5; }\n.road.outline[zoom=13][prominence=major] { line-width: 7; }\n.road.inline[zoom=13][prominence=major][highway=motorway_link] { line-width: 2; }\n.road.outline[zoom=13][prominence=major][highway=motorway_link] { line-width: 4; }\n\n.road.texture[zoom=13] { line-width: 1; }\n\n.road.inline[zoom=14][prominence=major] { line-width: 7; }\n.road.outline[zoom=14][prominence=major] { line-width: 9; }\n.road.inline[zoom=14][prominence=major][highway=motorway_link] { line-width: 2; }\n.road.outline[zoom=14][prominence=major][highway=motorway_link] { line-width: 4; }\n\n.road.inline[zoom=14][prominence=minor][highway=tertiary] { line-width: 3; }\n.road.outline[zoom=14][prominence=minor][highway=tertiary] { line-width: 5; }\n.road.texture[zoom=14] { line-width: 2; }\n\n.road.inline[zoom=15][prominence=major] { line-width: 11; }\n.road.outline[zoom=15][prominence=major] { line-width: 13; }\n.road.inline[zoom=15][prominence=major][highway=motorway_link] { line-width: 4; }\n.road.outline[zoom=15][prominence=major][highway=motorway_link] { line-width: 6; }\n\n.road.inline[zoom=15][prominence=minor][highway=tertiary] { line-width: 6; }\n.road.outline[zoom=15][prominence=minor][highway=tertiary] { line-width: 8; }\n.road.inline[zoom=15][prominence=minor][highway!=tertiary][highway!=service] { line-width: 4; }\n.road.outline[zoom=15][prominence=minor][highway!=tertiary][highway!=service] { line-width: 6; }\n.road.inline[zoom=15][prominence=minor][highway=service] { line-width: 2; }\n.road.outline[zoom=15][prominence=minor][highway=service] { line-width: 4; }\n\n.road.inline[zoom=16][prominence=major] { line-width: 13; }\n.road.outline[zoom=16][prominence=major] { line-width: 15; }\n.road.outline[zoom=16][prominence=major][highway=motorway] { line-width: 17; }\n.road.inline[zoom=16][prominence=major][highway=motorway_link] { line-width: 8; }\n.road.outline[zoom=16][prominence=major][highway=motorway_link] { line-width: 10; }\n\n.road.inline[zoom=16][prominence=minor][highway!=service] { line-width: 8; }\n.road.outline[zoom=16][prominence=minor][highway!=service] { line-width: 10; }\n.road.inline[zoom=16][prominence=minor][highway=service] { line-width: 6; }\n.road.outline[zoom=16][prominence=minor][highway=service] { line-width: 8; }\n\n.road.inline[zoom>=17] { line-width: 15; }\n.road.outline[zoom>=17] { line-width: 17; }\n.road.outline[zoom>=17][highway=motorway] { line-width: 19; }\n.road.inline[zoom>=17][highway=service],\n.road.inline[zoom>=17][highway=motorway_link] { line-width: 10; }\n.road.outline[zoom>=17][highway=service],\n.road.outline[zoom>=17][highway=motorway_link] { line-width: 12; }\n\n\n\n.road.label[zoom>=15][oneway=1][highway!=motorway],\n.road.label[zoom>=15][oneway=yes][highway!=motorway],\n.road.label[zoom>=15][oneway=true][highway!=motorway]\n{\n line-pattern-file: url('img\/oneway-arrow.png');\n}\n\n.road.inline[highway=motorway][zoom>=15]\n{\n inline-width: 1;\n inline-color: #ff9460;\n inline-dasharray: 12, 12;\n}\n\n.road.inline[highway=motorway][zoom=16]\n{\n inline-color: #ffad78;\n}\n\n.road.inline[highway=motorway][zoom>=17]\n{\n inline-color: #f9c38d;\n}\n\n\n\n\/** Road Labels **\/\n\n.road.label.major[zoom=12][highway=trunk] name,\n.road.label.major[zoom=12][highway=primary] name,\n.road.label.major[zoom=12][highway=secondary] name,\n.road.label.major[zoom>=13][zoom<=14][highway!=motorway][highway!=motorway_link] name,\n.road.label.minor[zoom=13][highway=tertiary] name,\n.road.label[zoom>=14][highway!=motorway][highway!=motorway_link] name\n{\n text-face-name: \"DejaVu Sans Book\";\n text-size: 9;\n text-fill: #000;\n text-placement: line;\n text-halo-radius: 1;\n text-halo-fill: #fff;\n text-max-char-angle-delta: 20;\n text-min-distance: 50;\n text-spacing: 400;\n}\n\n.road.label.minor[zoom>=13][zoom<=14] name\n{\n text-halo-fill: #dceee9 !important;\n}\n\n.road.label[zoom>=17][highway!=motorway][highway!=motorway_link] name \n{\n text-size: 12 !important;\n}\n\n.road.label.major[zoom>=9][highway=trunk] ref_content,\n.road.label.major[zoom>=11][highway=primary] ref_content,\n.road.label.major[zoom>=7][highway=motorway] ref_content\n{\n shield-face-name: \"DejaVu Sans Bold\";\n shield-min-distance: 100;\n shield-size: 9;\n shield-fill: #000;\n}\n\n.road.label.major[zoom>=9][ref_length=2][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=2][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=2][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-2.png'); }\n.road.label.major[zoom>=9][ref_length=3][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=3][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=3][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-3.png'); }\n.road.label.major[zoom>=9][ref_length=4][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=4][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=4][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-4.png'); }\n.road.label.major[zoom>=9][ref_length=5][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=5][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=5][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-5.png'); }\n.road.label.major[zoom>=9][ref_length=6][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=6][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=6][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-6.png'); }\n.road.label.major[zoom>=9][ref_length=7][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=7][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=7][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-7.png'); }\n.road.label.major[zoom>=9][ref_length=8][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=8][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=8][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-8.png'); }\n.road.label.major[zoom>=9][ref_length=9][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=9][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=9][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-9.png'); }\n\n\n\n\/** Road Colors **\/\n\n.road.inline\n{\n line-color: #f8f8f8;\n line-opacity: 1;\n}\n\n.road.outline\n{\n line-color: #d2d2d2;\n line-opacity: 1;\n}\n\n.road.inline[highway=tertiary]\n{\n line-color: #ffffff;\n}\n\n.road.outline[highway=tertiary]\n{\n line-color: #c3c3c3;\n}\n\n.road.inline[highway=secondary]\n{\n line-color: #fdffdd;\n}\n\n.road.outline[highway=secondary]\n{\n line-color: #b5b880;\n}\n\n.motorway.inline[highway=trunk],\n.road.inline[highway=trunk],\n.road.inline[highway=primary]\n{\n line-color: #ffec9f;\n}\n\n.motorway.outline[highway=trunk],\n.road.outline[highway=trunk],\n.road.outline[highway=primary]\n{\n line-color: #b1a67b;\n}\n\n.road.inline[highway=motorway_link]\n{\n line-color: #ff9460;\n}\n\n.road.outline[highway=motorway_link]\n{\n line-color: #6d8aa7;\n}\n\n.motorway.inline[highway=motorway],\n.road.inline[highway=motorway]\n{\n line-color: #ff5559;\n}\n\n.motorway.outline[highway=motorway],\n.road.outline[highway=motorway]\n{\n line-color: #03317d;\n}\n\n\/* lighten the motorways up a bit at higher zoom levels *\/\n.road.inline[zoom=16][highway=motorway] { line-color: #ff7775; }\n.road.inline[zoom>=17][highway=motorway] { line-color: #ff9d98; }\n.road.outline[zoom>=16][highway=motorway] { line-color: #6c7dd5; }\n.road.inline[zoom=16][highway=motorway_link] { line-color: #ffad78; }\n.road.inline[zoom>=17][highway=motorway_link] { line-color: #f9c38d; }\n\n\/* all repeated from above but applicable to bridges specifically *\/\n.road.inline { outline-color: #d2d2d2; }\n.road.inline[highway=tertiary] { outline-color: #c3c3c3; }\n.road.inline[highway=secondary] { outline-color: #b5b880; }\n.motorway.inline[highway=trunk], .road.inline[highway=trunk], .road.inline[highway=primary] { outline-color: #b1a67b; }\n.road.inline[highway=motorway_link] { outline-color: #6d8aa7; }\n.motorway.inline[highway=motorway], .road.inline[highway=motorway] { outline-color: #03317d; }\n.road.inline[highway=motorway] { outline-color: #03317d; }\n.road.inline[zoom>=16][highway=motorway] { outline-color: #6c7dd5; }\n\n\n\n.road.texture[zoom>=7][zoom<=11]\n{\n line-color: #b6cccb;\n line-opacity: 1;\n}\n\n.road.texture[zoom>=12][zoom<=14]\n{\n line-color: #5f6e6d;\n line-opacity: 0.37;\n}\n","old_contents":".road\n{\n line-cap: round;\n line-join: miter;\n outline-cap: butt;\n outline-join: miter;\n}\n\n.road.outline[tunnel=yes],\n.road.outline[tunnel=true]\n{\n line-cap: butt;\n line-dasharray: 4,6;\n}\n\n.road.inline[zoom>=14][prominence=major][bridge=true],\n.road.inline[zoom>=14][prominence=major][bridge=yes],\n.road.inline[zoom>=16][bridge=true],\n.road.inline[zoom>=16][bridge=yes]\n{\n outline-width: 1;\n}\n\n\/*\n.road.inline[zoom>=13][prominence=major][bridge=yes],\n.road.inline[zoom>=13][prominence=major][bridge=true]\n{\n outline-width: 1;\n outline-color: #888;\n}\n*\/\n\n\/** Road Weights **\/\n\n.motorway.inline[zoom>=9][zoom<=11][highway=trunk] { line-width: 2; }\n.motorway.outline[zoom>=9][zoom<=11][highway=trunk] { line-width: 4; }\n.motorway.inline[zoom>=7][zoom<=11][highway=motorway] { line-width: 2; }\n.motorway.outline[zoom>=7][zoom<=11][highway=motorway] { line-width: 4; }\n\n.road.inline[zoom>=7][zoom<=11][prominence=major][highway=motoryway] { line-width: 2; }\n.road.outline[zoom>=7][zoom<=11][prominence=major][highway=motoryway] { line-width: 4; }\n\n.road.texture[zoom>=7][zoom<=10] { line-width: 1; } \/* general background fuzz *\/\n\n.road.inline[zoom>=7][zoom<=10][prominence=major][highway=motorway] { line-width: 2; }\n.road.inline[zoom>=11][zoom<=12][prominence=major][highway!=motorway_link] { line-width: 2; }\n.road.outline[zoom>=11][zoom<=12][prominence=major][highway!=motorway_link] { line-width: 4; }\n\n.road.texture[zoom>=11][zoom<=12] { line-width: 1; }\n\n.road.inline[zoom=13][prominence=major] { line-width: 5; }\n.road.outline[zoom=13][prominence=major] { line-width: 7; }\n.road.inline[zoom=13][prominence=major][highway=motorway_link] { line-width: 2; }\n.road.outline[zoom=13][prominence=major][highway=motorway_link] { line-width: 4; }\n\n.road.texture[zoom=13] { line-width: 1; }\n\n.road.inline[zoom=14][prominence=major] { line-width: 7; }\n.road.outline[zoom=14][prominence=major] { line-width: 9; }\n.road.inline[zoom=14][prominence=major][highway=motorway_link] { line-width: 2; }\n.road.outline[zoom=14][prominence=major][highway=motorway_link] { line-width: 4; }\n\n.road.inline[zoom=14][prominence=minor][highway=tertiary] { line-width: 3; }\n.road.outline[zoom=14][prominence=minor][highway=tertiary] { line-width: 5; }\n.road.texture[zoom=14] { line-width: 2; }\n\n.road.inline[zoom=15][prominence=major] { line-width: 11; }\n.road.outline[zoom=15][prominence=major] { line-width: 13; }\n.road.inline[zoom=15][prominence=major][highway=motorway_link] { line-width: 4; }\n.road.outline[zoom=15][prominence=major][highway=motorway_link] { line-width: 6; }\n\n.road.inline[zoom=15][prominence=minor][highway=tertiary] { line-width: 6; }\n.road.outline[zoom=15][prominence=minor][highway=tertiary] { line-width: 8; }\n.road.inline[zoom=15][prominence=minor][highway!=tertiary][highway!=service] { line-width: 4; }\n.road.outline[zoom=15][prominence=minor][highway!=tertiary][highway!=service] { line-width: 6; }\n.road.inline[zoom=15][prominence=minor][highway=service] { line-width: 2; }\n.road.outline[zoom=15][prominence=minor][highway=service] { line-width: 4; }\n\n.road.inline[zoom=16][prominence=major] { line-width: 13; }\n.road.outline[zoom=16][prominence=major] { line-width: 15; }\n.road.outline[zoom=16][prominence=major][highway=motorway] { line-width: 17; }\n.road.inline[zoom=16][prominence=major][highway=motorway_link] { line-width: 8; }\n.road.outline[zoom=16][prominence=major][highway=motorway_link] { line-width: 10; }\n\n.road.inline[zoom=16][prominence=minor][highway!=service] { line-width: 8; }\n.road.outline[zoom=16][prominence=minor][highway!=service] { line-width: 10; }\n.road.inline[zoom=16][prominence=minor][highway=service] { line-width: 6; }\n.road.outline[zoom=16][prominence=minor][highway=service] { line-width: 8; }\n\n.road.inline[zoom>=17] { line-width: 15; }\n.road.outline[zoom>=17] { line-width: 17; }\n.road.outline[zoom>=17][highway=motorway] { line-width: 19; }\n.road.inline[zoom>=17][highway=service],\n.road.inline[zoom>=17][highway=motorway_link] { line-width: 10; }\n.road.outline[zoom>=17][highway=service],\n.road.outline[zoom>=17][highway=motorway_link] { line-width: 12; }\n\n\n\n.road.label[zoom>=15][oneway=1][highway!=motorway],\n.road.label[zoom>=15][oneway=yes][highway!=motorway],\n.road.label[zoom>=15][oneway=true][highway!=motorway]\n{\n line-pattern-file: url('img\/oneway-arrow.png');\n}\n\n.motorway.inline[highway=motorway][zoom>=15]\n{\n line-width: 1;\n line-color: #ff9460;\n line-dasharray: 12, 12;\n}\n\n.motorway.inline[highway=motorway][zoom=16]\n{\n line-color: #ffad78;\n}\n\n.motorway.inline[highway=motorway][zoom>=17]\n{\n line-color: #f9c38d;\n}\n\n\n\n\/** Road Labels **\/\n\n.road.label.major[zoom=12][highway=trunk] name,\n.road.label.major[zoom=12][highway=primary] name,\n.road.label.major[zoom=12][highway=secondary] name,\n.road.label.major[zoom>=13][zoom<=14][highway!=motorway][highway!=motorway_link] name,\n.road.label.minor[zoom=13][highway=tertiary] name,\n.road.label[zoom>=14][highway!=motorway][highway!=motorway_link] name\n{\n text-face-name: \"DejaVu Sans Book\";\n text-size: 9;\n text-fill: #000;\n text-placement: line;\n text-halo-radius: 1;\n text-halo-fill: #fff;\n text-max-char-angle-delta: 20;\n text-min-distance: 50;\n text-spacing: 400;\n}\n\n.road.label.minor[zoom>=13][zoom<=14] name\n{\n text-halo-fill: #dceee9 !important;\n}\n\n.road.label[zoom>=17][highway!=motorway][highway!=motorway_link] name \n{\n text-size: 12 !important;\n}\n\n.road.label.major[zoom>=9][highway=trunk] ref_content,\n.road.label.major[zoom>=11][highway=primary] ref_content,\n.road.label.major[zoom>=7][highway=motorway] ref_content\n{\n shield-face-name: \"DejaVu Sans Bold\";\n shield-min-distance: 100;\n shield-size: 9;\n shield-fill: #000;\n}\n\n.road.label.major[zoom>=9][ref_length=2][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=2][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=2][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-2.png'); }\n.road.label.major[zoom>=9][ref_length=3][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=3][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=3][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-3.png'); }\n.road.label.major[zoom>=9][ref_length=4][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=4][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=4][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-4.png'); }\n.road.label.major[zoom>=9][ref_length=5][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=5][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=5][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-5.png'); }\n.road.label.major[zoom>=9][ref_length=6][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=6][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=6][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-6.png'); }\n.road.label.major[zoom>=9][ref_length=7][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=7][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=7][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-7.png'); }\n.road.label.major[zoom>=9][ref_length=8][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=8][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=8][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-8.png'); }\n.road.label.major[zoom>=9][ref_length=9][highway=trunk] ref_content,\n.road.label.major[zoom>=11][ref_length=9][highway=primary] ref_content,\n.road.label.major[zoom>=7][ref_length=9][highway=motorway] ref_content { shield-file: url('img\/horizontal-shield-9.png'); }\n\n\n\n\/** Road Colors **\/\n\n.road.inline\n{\n line-color: #f8f8f8;\n line-opacity: 1;\n}\n\n.road.outline\n{\n line-color: #d2d2d2;\n line-opacity: 1;\n}\n\n.road.inline[highway=tertiary]\n{\n line-color: #ffffff;\n}\n\n.road.outline[highway=tertiary]\n{\n line-color: #c3c3c3;\n}\n\n.road.inline[highway=secondary]\n{\n line-color: #fdffdd;\n}\n\n.road.outline[highway=secondary]\n{\n line-color: #b5b880;\n}\n\n.motorway.inline[highway=trunk],\n.road.inline[highway=trunk],\n.road.inline[highway=primary]\n{\n line-color: #ffec9f;\n}\n\n.motorway.outline[highway=trunk],\n.road.outline[highway=trunk],\n.road.outline[highway=primary]\n{\n line-color: #b1a67b;\n}\n\n.road.inline[highway=motorway_link]\n{\n line-color: #ff9460;\n}\n\n.road.outline[highway=motorway_link]\n{\n line-color: #6d8aa7;\n}\n\n.motorway.inline[highway=motorway],\n.road.inline[highway=motorway]\n{\n line-color: #ff5559;\n}\n\n.motorway.outline[highway=motorway],\n.road.outline[highway=motorway]\n{\n line-color: #03317d;\n}\n\n\/* lighten the motorways up a bit at higher zoom levels *\/\n.road.inline[zoom=16][highway=motorway] { line-color: #ff7775; }\n.road.inline[zoom>=17][highway=motorway] { line-color: #ff9d98; }\n.road.outline[zoom>=16][highway=motorway] { line-color: #6c7dd5; }\n.road.inline[zoom=16][highway=motorway_link] { line-color: #ffad78; }\n.road.inline[zoom>=17][highway=motorway_link] { line-color: #f9c38d; }\n\n\/* all repeated from above but applicable to bridges specifically *\/\n.road.inline { outline-color: #d2d2d2; }\n.road.inline[highway=tertiary] { outline-color: #c3c3c3; }\n.road.inline[highway=secondary] { outline-color: #b5b880; }\n.motorway.inline[highway=trunk], .road.inline[highway=trunk], .road.inline[highway=primary] { outline-color: #b1a67b; }\n.road.inline[highway=motorway_link] { outline-color: #6d8aa7; }\n.motorway.inline[highway=motorway], .road.inline[highway=motorway] { outline-color: #03317d; }\n.road.inline[highway=motorway] { outline-color: #03317d; }\n.road.inline[zoom>=16][highway=motorway] { outline-color: #6c7dd5; }\n\n\n\n.road.texture[zoom>=7][zoom<=11]\n{\n line-color: #b6cccb;\n line-opacity: 1;\n}\n\n.road.texture[zoom>=12][zoom<=14]\n{\n line-color: #5f6e6d;\n line-opacity: 0.37;\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"f8044be01d64fb36b86c43c11def669f87f88278","subject":"#10 alter carto for rendering hwy shields","message":"#10 alter carto for rendering hwy shields\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Italic', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Bold Italic', 'Unifont Bold';\n\n@label_color_transport: #524c4c;\n@label_color_shield: #fff;\n@label_color_shield_fed: #333;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n\n@text_character_spacing_sm: 0.7;\n@text_character_spacing_md: 1.2;\n@text_character_spacing_lg: 1.7;\n@text_character_spacing_xlg: 2.2;\n\n@text_font_halo_radius_sm: 1.5;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: #F7F7E6;\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-character-spacing: @text_character_spacing_sm;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: 2;\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n \/\/ arbitrary default shield\n shield-file: url(shields\/ca.svg);\n shield-fill: @label_color_shield;\n shield-transform: scale(0.052, 0.052);\n shield-face-name: @text_font_transport;\n shield-name: [ref];\n shield-min-distance: 50;\n \/\/ shield-spacing: 250;\n \/\/ half the width of the shield to prevent from wrapping\n \/\/ shield-min-padding: 10;\n\n [ref=~'I \\d+'] {\n shield-file: url(shields\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(shields\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n }\n\n [ref=~'US \\d+'] {\n shield-file: url(shields\/us.svg);\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: @label_color_shield_fed;\n shield-text-dy: 1;\n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(shields\/ca.svg);\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-text-dy: 2.5;\n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n \n text-face-name: @text_font_water_bold;\n text-wrap-width: 40;\n text-wrap-character: ' ';\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_xlg;\n text-align: center;\n\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][scalerank<4][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][scalerank<7][changed!='']\n{\n text-name: [name];\n\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n text-face-name: @text_font_water_bold;\n text-wrap-width: 50;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_lg;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80; \n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_sm;\n text-size: 18;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-size: 22;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-character-spacing: @text_character_spacing_sm;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_lg;\n text-size: 22;\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: 24;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: 34;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#aries-places-labels {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<6],\n [zoom=7][scalerank<7],\n [zoom=8][scalerank<8],\n [zoom=9][scalerank<9],\n [zoom=10][scalerank<10],\n [zoom=11][scalerank<11],\n [zoom=12][scalerank<12],\n [zoom=13][scalerank<13], \n [zoom=14][scalerank<14] \n [zoom>=15][scalerank<17]{\n\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-min-distance: 3;\n \/\/ text-min-padding: 5;\n text-dy: 5;\n text-dx: 5;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n \/\/ text-allow-overlap: true;\n text-placement-type: simple;\n \/\/ text-avoid-edges: true; \n\n [zoom>=4] {\n text-size: @text_font_size_xsm;\n text-placements: \"W,E,S\";\n \n [population>700000] {\n text-size: @text_font_size_xsm * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_xsm * 1.3;\n } \n }\n\n [zoom>=5]{\n text-size: @text_font_size_sm;\n text-placements: \"E,W,N\";\n text-min-distance: 5;\n \n [population>700000] {\n text-size: @text_font_size_sm * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_sm * 1.3;\n text-allow-overlap: true;\n } \n }\n\n [zoom>=6]{\n text-size: @text_font_size_medium;\n text-placements: \"W,E,N\";\n\n [population>700000] {\n text-size: @text_font_size_medium * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_medium * 1.5;\n } \n }\n\n [zoom>=10]{\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_halo_high;\n \n [population>700000] {\n text-size: @text_font_size_large * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_large * 1.5;\n } \n }\n\n }\n}\n\n#aries-places-points {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<6],\n [zoom=7][scalerank<7],\n [zoom=8][scalerank<8] {\n\n marker-fill: #2e2115;\n marker-line-width: 0;\n marker-width: 5;\n marker-ignore-placement: true;\n\n [population>700000] {\n marker-width: 7;\n }\n\n }\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n\n","old_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Italic', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Bold Italic', 'Unifont Bold';\n\n@label_color_transport: #524c4c;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n\n@text_character_spacing_sm: 0.7;\n@text_character_spacing_md: 1.2;\n@text_character_spacing_lg: 1.7;\n@text_character_spacing_xlg: 2.2;\n\n@text_font_halo_radius_sm: 1.5;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: #F7F7E6;\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-character-spacing: @text_character_spacing_sm;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: 2;\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n \/\/ arbitrary default shield\n shield-file: url(images\/ca.svg);\n shield-fill: white;\n shield-transform: scale(0.052, 0.052);\n shield-face-name: \"Roadgeek 2005 Series D Regular\";\n shield-name: [ref];\n shield-min-distance: 250;\n shield-spacing: 250;\n \/\/ half the width of the shield to prevent from wrapping\n shield-min-padding: 10;\n\n [ref=~'I \\d+'] {\n shield-file: url(images\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n shield-fill: white;\n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(images\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n shield-fill: white;\n }\n\n [ref=~'US \\d+'] {\n shield-file: url(images\/us.svg);\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: #333;\n shield-text-dy: 1;\n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(images\/ca.svg);\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-fill: white;\n shield-text-dy: 2.5;\n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n \n text-face-name: @text_font_water_bold;\n text-wrap-width: 40;\n text-wrap-character: ' ';\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_xlg;\n text-align: center;\n\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][scalerank<4][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][scalerank<7][changed!='']\n{\n text-name: [name];\n\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n text-face-name: @text_font_water_bold;\n text-wrap-width: 50;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_lg;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80; \n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_sm;\n text-size: 18;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-size: 22;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-character-spacing: @text_character_spacing_sm;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_lg;\n text-size: 22;\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: 24;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: 34;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#aries-places-labels {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<6],\n [zoom=7][scalerank<7],\n [zoom=8][scalerank<8],\n [zoom=9][scalerank<9],\n [zoom=10][scalerank<10],\n [zoom=11][scalerank<11],\n [zoom=12][scalerank<12],\n [zoom=13][scalerank<13], \n [zoom=14][scalerank<14] \n [zoom>=15][scalerank<17]{\n\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-min-distance: 3;\n \/\/ text-min-padding: 5;\n text-dy: 5;\n text-dx: 5;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n \/\/ text-allow-overlap: true;\n text-placement-type: simple;\n \/\/ text-avoid-edges: true; \n\n [zoom>=4] {\n text-size: @text_font_size_xsm;\n text-placements: \"W,E,S\";\n \n [population>700000] {\n text-size: @text_font_size_xsm * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_xsm * 1.3;\n } \n }\n\n [zoom>=5]{\n text-size: @text_font_size_sm;\n text-placements: \"E,W,N\";\n text-min-distance: 5;\n \n [population>700000] {\n text-size: @text_font_size_sm * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_sm * 1.3;\n text-allow-overlap: true;\n } \n }\n\n [zoom>=6]{\n text-size: @text_font_size_medium;\n text-placements: \"W,E,N\";\n\n [population>700000] {\n text-size: @text_font_size_medium * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_medium * 1.5;\n } \n }\n\n [zoom>=10]{\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_halo_high;\n \n [population>700000] {\n text-size: @text_font_size_large * 1.2;\n }\n\n [population>7000000] {\n text-size: @text_font_size_large * 1.5;\n } \n }\n\n }\n}\n\n#aries-places-points {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<6],\n [zoom=7][scalerank<7],\n [zoom=8][scalerank<8] {\n\n marker-fill: #2e2115;\n marker-line-width: 0;\n marker-width: 5;\n marker-ignore-placement: true;\n\n [population>700000] {\n marker-width: 7;\n }\n\n }\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"683bcf835c4635fb3722e9a47bdf8b1f4070ff57","subject":"Tweak bg color","message":"Tweak bg color\n","repos":"MappingKat\/tilemill,paulovieira\/tilemill-clima,fxtentacle\/tilemill,tilemill-project\/tilemill,fxtentacle\/tilemill,fxtentacle\/tilemill,tilemill-project\/tilemill,paulovieira\/tilemill-clima,Zhao-Qi\/tilemill,florianf\/tileoven,mbrukman\/tilemill,MappingKat\/tilemill,mbrukman\/tilemill,Zhao-Qi\/tilemill,MappingKat\/tilemill,florianf\/tileoven,fxtentacle\/tilemill,mbrukman\/tilemill,nyimbi\/tilemill,tizzybec\/tilemill,mbrukman\/tilemill,Teino1978-Corp\/Teino1978-Corp-tilemill,paulovieira\/tilemill-clima,MappingKat\/tilemill,paulovieira\/tilemill-clima,nyimbi\/tilemill,Teino1978-Corp\/Teino1978-Corp-tilemill,fxtentacle\/tilemill,Teino1978-Corp\/Teino1978-Corp-tilemill,MappingKat\/tilemill,Zhao-Qi\/tilemill,tizzybec\/tilemill,nyimbi\/tilemill,Teino1978-Corp\/Teino1978-Corp-tilemill,mbrukman\/tilemill,tizzybec\/tilemill,nyimbi\/tilemill,nyimbi\/tilemill,paulovieira\/tilemill-clima,tizzybec\/tilemill,tilemill-project\/tilemill,tizzybec\/tilemill,Zhao-Qi\/tilemill,florianf\/tileoven,Teino1978-Corp\/Teino1978-Corp-tilemill,Zhao-Qi\/tilemill","old_file":"examples\/open-streets-dc\/style.mss","new_file":"examples\/open-streets-dc\/style.mss","new_contents":"\/**********************************************************\n\nOpen Streets, DC\n================\n\n*An example of street-level map design.*\n\nData used by this map is \u00a9 OpenStreetMap contributors and\ndistributed under the terms of the Open Database License.\nSee for details.\n\nPattern images derived from designs by Subtle Patterns and \nlicensed CC-BY-SA. See for details.\n\nThe shapefiles used in this project are based on those\nprovided by Mike Migurski at .\nYou can swap out the DC data for any other city there by\ndownloading the Imposm shapefile package.\n\n***********************************************************\/\n\n\/* ---- PALETTE ---- *\/\n\n@water:#c0d8ff;\n@park:#cea;\n@land:#f5fdf0;\n\nMap {\n background-color:@land;\n}\n\n#water {\n polygon-fill:@water;\n polygon-gamma:0.5; \/\/ reduces gaps between shapes\n polygon-pattern-file:url(images\/water.png);\n polygon-pattern-comp-op:color-burn;\n polygon-pattern-alignment:global; \/\/ keeps it seamless\n}\n\n#landusages[zoom>6] {\n [type='forest'],\n [type='wood'] {\n polygon-fill:@park;\n polygon-pattern-file:url(images\/wood.png);\n polygon-pattern-comp-op:multiply;\n }\n [type='cemetery'],\n [type='common'],\n [type='golf_course'],\n [type='park'],\n [type='pitch'],\n [type='recreation_ground'],\n [type='village_green'] {\n polygon-fill:@park;\n }\n}\n\n#landusages[zoom>=12] {\n [type='school'],\n [type='college'],\n [type='university'] {\n polygon-fill: #f8e8c8;\n }\n}\n","old_contents":"\/**********************************************************\n\nOpen Streets, DC\n================\n\n*An example of street-level map design.*\n\nData used by this map is \u00a9 OpenStreetMap contributors and\ndistributed under the terms of the Open Database License.\nSee for details.\n\nPattern images derived from designs by Subtle Patterns and \nlicensed CC-BY-SA. See for details.\n\nThe shapefiles used in this project are based on those\nprovided by Mike Migurski at .\nYou can swap out the DC data for any other city there by\ndownloading the Imposm shapefile package.\n\n***********************************************************\/\n\n\/* ---- PALETTE ---- *\/\n\n@water:#c0d8ff;\n@park:#cea;\n@land:#f3faff;\n\nMap {\n background-color:@land;\n}\n\n#water {\n polygon-fill:@water;\n polygon-gamma:0.5; \/\/ reduces gaps between shapes\n polygon-pattern-file:url(images\/water.png);\n polygon-pattern-comp-op:color-burn;\n polygon-pattern-alignment:global; \/\/ keeps it seamless\n}\n\n#landusages[zoom>6] {\n [type='forest'],\n [type='wood'] {\n polygon-fill:@park;\n polygon-pattern-file:url(images\/wood.png);\n polygon-pattern-comp-op:multiply;\n }\n [type='cemetery'],\n [type='common'],\n [type='golf_course'],\n [type='park'],\n [type='pitch'],\n [type='recreation_ground'],\n [type='village_green'] {\n polygon-fill:@park;\n }\n}\n\n#landusages[zoom>=12] {\n [type='school'],\n [type='college'],\n [type='university'] {\n polygon-fill: #f8e8c8;\n }\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"ac9ec341bbf05e20d567eb15d4fa9916133d91c3","subject":"minor text fixes","message":"minor text fixes\n","repos":"silph-io\/osm-silph","old_file":"osm-bright\/palette.mss","new_file":"osm-bright\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";*\/\n\n\n@sans_lt_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans_bold: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_bold_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold Italic\",\"DejaVu Sans Bold Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #F0EDE5;\n@water: #C4DFF6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #DAF2C1;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n@building: #E2DED2;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #E65C5C;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #E65822;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n\/*\n@primary_line: #FFC859;\n@primary_fill: lighten(@primary_line,10%);\n*\/\n@primary_case: @primary_line * 0.9;\n\n@primary_line: @secondary_line;\n@primary_fill: @secondary_fill;\n\n@secondary_line: #CD9120;\n@secondary_fill: #E4C049;\n@secondary_case: @secondary_line * 0.9;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,34%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n@poi_text: #888;\n\n@road_text: #444;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n\n\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";*\/\n\n\n@sans_lt_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans_bold: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_bold_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold Italic\",\"DejaVu Sans Bold Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #F0EDE5;\n@water: #C4DFF6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #DAF2C1;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n@building: #E2DED2;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #E65C5C;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #E65822;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n\/*\n@primary_line: #FFC859;\n@primary_fill: lighten(@primary_line,10%);\n*\/\n@primary_case: @primary_line * 0.9;\n\n@primary_line: @secondary_line;\n@primary_fill: @secondary_fill;\n\n@secondary_line: #CD9120;\n@secondary_fill: #E4C049;\n@secondary_case: @secondary_line * 0.9;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,34%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n@poi_text: #888;\n\n@road_text: #fff;\n@road_halo: #333;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n\n\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"1790ff29c24bdc25abd0e56a7de2efe157fa5886","subject":"Update palette.mss","message":"Update palette.mss","repos":"brelevenix\/osm-bright-tregor","old_file":"osm-bright\/palette.mss","new_file":"osm-bright\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Open Sans Regular\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_lt_italic: \"Open Sans Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans: \"Open Sans Semibold\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_italic: \"Open Sans Semibold Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans_bold: \"Open Sans Bold\",\"DejaVu Sans Bold\",\"unifont Medium\";\n@sans_bold_italic: \"Open Sans Bold Italic\",\"DejaVu Sans Bold Italic\",\"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* COLOR PALETTE\n\/* ================================================================== *\/\n\n@black: #000000; \n@white: #ffffff;\n\n@grey-light: #cccccc;\n@grey-medium: #999999;\n@grey-strong: #777777;\n\n@orange: #FF6600;\n\n@blue: #0000ff;\n\n@yellow: #ffff33;\n@yellow-light: #ffff99;\n\n@green: #006600;\n@green-light: #D7EFD9;\n\n@purple: #9164CD;\n@pink: #FFB4E6;\n\n@brown: #D7EFD9;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: @green-light;\n@water: @blue;\n@grass: @green;\n@beach: @yellow;\n@park: @green;\n@cemetery: @grey-light;\n@wooded: @green;\n@agriculture: @green-light;\n\n@building: @grey-strong;\n@hospital: @grey-light;\n@school: @grey-light;\n@sports: @grey-light;\n\n@residential: @grey-light;\n@commercial: @grey-light;\n@industrial: @grey-light;\n@parking: @grey-light;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: @white;\n@motorway_fill: @white;\n@motorway_case: @white;\n\n@trunk_line: @white;\n@trunk_fill: @white;\n@trunk_case: @white;\n\n@primary_line: @white;\n@primary_fill: @white;\n@primary_case: @white;\n\n@secondary_line: @white;\n@secondary_fill: @white;\n@secondary_case: @white;\n\n@standard_line: @white;\n@standard_fill: @white;\n@standard_case: @white;\n\n@pedestrian_line: @purple;\n@pedestrian_fill: @purple;\n@pedestrian_case: @purple;\n\n@cycle_line: @purple;\n@cycle_fill: @purple;\n@cycle_case: @purple;\n\n@rail_line: @black;\n@rail_fill: @black;\n@rail_case: @black;\n\n@aeroway: @black;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: @purple;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,0%);\n\n@country_text: @black;\n@country_halo: @place_halo;\n\n@state_text: @black;\n@state_halo: @place_halo;\n\n@city_text: @black;\n@city_halo: @place_halo;\n\n@town_text: @black;\n@town_halo: @place_halo;\n\n@poi_text: @black;\n\n@road_text: @black;\n@road_halo: @place_halo;\n\n@other_text: @black;\n@other_halo: @place_halo;\n\n@locality_text: @black;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: @black;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Open Sans Regular\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_lt_italic: \"Open Sans Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans: \"Open Sans Semibold\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_italic: \"Open Sans Semibold Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans_bold: \"Open Sans Bold\",\"DejaVu Sans Bold\",\"unifont Medium\";\n@sans_bold_italic: \"Open Sans Bold Italic\",\"DejaVu Sans Bold Italic\",\"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* COLOR PALETTE\n\/* ================================================================== *\/\n\n@black: #000000; \n@white: #ffffff;\n\n@grey-light: #cccccc;\n@grey-medium: #999999;\n@grey-strong: #777777;\n\n@orange: #FF6600;\n\n@blue: #0000ff;\n\n@yellow: #ffff33;\n@yellow-light: #ffff99;\n\n@green: #006600;\n@green-light: #D7EFD9;\n\n@purple: #9164CD;\n@pink: #FFB4E6;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: @green-light;\n@water: @blue;\n@grass: @green;\n@beach: @yellow;\n@park: @green;\n@cemetery: @grey-light;\n@wooded: @green;\n@agriculture: @green-light;\n\n@building: @grey-strong;\n@hospital: @grey-light;\n@school: @grey-light;\n@sports: @grey-light;\n\n@residential: @grey-light;\n@commercial: @grey-light;\n@industrial: @grey-light;\n@parking: @grey-light;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: @white;\n@motorway_fill: @white;\n@motorway_case: @white;\n\n@trunk_line: @white;\n@trunk_fill: @white;\n@trunk_case: @white;\n\n@primary_line: @white;\n@primary_fill: @white;\n@primary_case: @white;\n\n@secondary_line: @white;\n@secondary_fill: @white;\n@secondary_case: @white;\n\n@standard_line: @white;\n@standard_fill: @white;\n@standard_case: @white;\n\n@pedestrian_line: @purple;\n@pedestrian_fill: @purple;\n@pedestrian_case: @purple;\n\n@cycle_line: @purple;\n@cycle_fill: @purple;\n@cycle_case: @purple;\n\n@rail_line: @black;\n@rail_fill: @black;\n@rail_case: @black;\n\n@aeroway: @black;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: @purple;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,0%);\n\n@country_text: @black;\n@country_halo: @place_halo;\n\n@state_text: @black;\n@state_halo: @place_halo;\n\n@city_text: @black;\n@city_halo: @place_halo;\n\n@town_text: @black;\n@town_halo: @place_halo;\n\n@poi_text: @black;\n\n@road_text: @black;\n@road_halo: @place_halo;\n\n@other_text: @black;\n@other_halo: @place_halo;\n\n@locality_text: @black;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: @black;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"b7ebe33281b7ada5fd548392cea2cf5f4ab892db","subject":"Fixing turning circles at z18","message":"Fixing turning circles at z18\n","repos":"mapbox\/open-streets-style","old_file":"open-streets\/highway.mss","new_file":"open-streets\/highway.mss","new_contents":"\/* ---- PALETTE ---- *\/\n\n@motorway_fill: #a8bae0; \/*#93b5d9;*\/\n@motorway_line: spin(darken(@motorway_fill,25),-10);\n@trunk_fill: #a7dea5;\/*#fabd7d;*\/\n@trunk_line: spin(darken(@trunk_fill,25),-10);\n@primary_fill: #fcf7bd;\n@primary_line: spin(darken(@primary_fill,25),-10);\n@secondary_fill:@primary_fill;\n@secondary_line:spin(darken(@secondary_fill,25),-10);\n@road_fill: #fff;\n@road_line: #bbb;\n@access_fill: @road_fill;\n@access_line: @road_line;\n@track: @road;\n@footway: #6B9;\n@cycleway: #69B;\n@bridge: rgba(64,64,64,0.66);\n\n\/* ---- ROADS ---- *\/\n\n\/* Service\/Access *\/\n.route.line[highway='service'] {\n [zoom>12]{ line-color:@access_line; line-cap:square; line-join:round; }\n [zoom=13]{ line-width:0.2; line-opacity:0.4; }\n [zoom=14]{ line-width:0.4; line-opacity:0.6; }\n [zoom=15]{ line-width:1; line-opacity:0.8; }\n [zoom=16]{ line-width:1.6 + 2; }\n [zoom=17]{ line-width:4 + 2; }\n [zoom=18]{ line-width:7 + 3; }\n}\n.route.fill[highway='service'] {\n [zoom>15]{ line-color:@access_fill; line-cap:square; line-join:round; }\n [zoom=16]{ line-width:1.6; }\n [zoom=17]{ line-width:4; }\n [zoom=18]{ line-width:7; }\n}\n\n\/* Motorway Links *\/\n.route.line[highway='motorway_link'][tunnel='no'],\n.route.tunnel[highway='motorway_link'] {\n [zoom>6] { line-color:@motorway_line; line-cap:round; line-join:round; }\n .tunnel[zoom>6] { line-dasharray:4,2; line-cap:butt; }\n [zoom=7] { line-width:0.2; line-opacity:0.6; }\n [zoom=8] { line-width:0.4; line-opacity:0.8; }\n [zoom=9] { line-width:0.6; }\n [zoom=10]{ line-width:0.8; }\n [zoom=11]{ line-width:1; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2 + 2; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:5 + 2.5; }\n [zoom=17]{ line-width:6 + 2.5; }\n [zoom=18]{ line-width:14 + 2.5; }\n}\n.route.bridge::b[highway='motorway_link'] {\n [zoom>6] { line-color:darken(@motorway_line,15); line-cap:butt; line-join:round; }\n [zoom=7] { line-width:0.2; line-opacity:0.6 + 1; }\n [zoom=8] { line-width:0.4; line-opacity:0.8 + 1; }\n [zoom=9] { line-width:0.6 + 1; }\n [zoom=10]{ line-width:0.8 + 1; }\n [zoom=11]{ line-width:1; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2 + 2; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:5 + 2.5; }\n [zoom=17]{ line-width:6 + 2.5; }\n [zoom=18]{ line-width:14 + 2.5; }\n}\n.route.fill[highway='motorway_link'] {\n [zoom>11]{ line-color:@motorway_fill; line-cap:round; line-join:round; }\n [zoom>11][tunnel='yes'] { line-color:lighten(@motorway_fill,10); }\n \/*[zoom=11]{ line-width:0.8; }*\/\n [zoom=12]{ line-width:1.0; }\n [zoom=13]{ line-width:1.2; }\n [zoom=14]{ line-width:2; }\n [zoom=15]{ line-width:3.5; }\n [zoom=16]{ line-width:5; }\n [zoom=17]{ line-width:6; }\n [zoom=18]{ line-width:14; }\n}\n\n\/* Standard\/Unknown *\/\n.route.line[highway='living_street'],\n.route.line[highway='residential'],\n.route.line[highway='road'],\n.route.line[highway='tertiary'],\n.route.line[highway='tertiary_link'],\n.route.line[highway='unclassified'] {\n [zoom>9] { line-color:@road_line; line-cap:round; line-join:round; }\n [zoom=10]{ line-width:0.2; line-opacity:0.4; }\n [zoom=11]{ line-width:0.4; line-opacity:0.6; }\n [zoom=12]{ line-width:0.6; line-opacity:0.8; }\n [zoom=13]{ line-width:0.8; }\n [zoom=14]{ line-width:1.0 + 1.8; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:6 + 2; }\n [zoom=17]{ line-width:8 + 2; }\n [zoom=18]{ line-width:10 + 3; }\n}\n.route.bridge::b[highway='living_street'],\n.route.bridge::b[highway='residential'],\n.route.bridge::b[highway='road'],\n.route.bridge::b[highway='tertiary'],\n.route.bridge::b[highway='tertiary_link'],\n.route.bridge::b[highway='unclassified'] {\n [zoom>9] { line-color:spin(darken(@road_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=10]{ line-width:0.2 + 1; line-opacity:0.4; }\n [zoom=11]{ line-width:0.4 + 1; line-opacity:0.6; }\n [zoom=12]{ line-width:0.6 + 1; line-opacity:0.8; }\n [zoom=13]{ line-width:0.8 + 1; }\n [zoom=14]{ line-width:1.0 + 1.8; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:6 + 2; }\n [zoom=17]{ line-width:8 + 2; }\n [zoom=18]{ line-width:10 + 3; }\n}\n.route.fill[highway='living_street'],\n.route.fill[highway='residential'],\n.route.fill[highway='road'],\n.route.fill[highway='tertiary'],\n.route.fill[highway='tertiary_link'],\n.route.fill[highway='unclassified'] {\n [zoom>13]{ line-color:@road_fill; line-cap:round; line-join:round; }\n [zoom=14]{ line-width:1.0; }\n [zoom=15]{ line-width:3.5; }\n [zoom=16]{ line-width:6; }\n [zoom=17]{ line-width:8; }\n [zoom=18]{ line-width:10; }\n}\n\n\/* Secondary *\/\n.route.line[highway='secondary'] {\n [zoom>7] { line-color:@road_line; line-cap:round; line-join:round; }\n [zoom=8] { line-width:0.3; line-opacity:0.8; }\n [zoom=9] { line-width:0.5; }\n [zoom=10]{ line-width:0.7; }\n [zoom=11]{ line-width:0.9; }\n [zoom>11]{ line-color:@secondary_line; }\n [zoom=12]{ line-width:0.9 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2.6 + 2; }\n [zoom=15]{ line-width:4 + 2; }\n [zoom=16]{ line-width:6 + 2.5; }\n [zoom=17]{ line-width:8 + 3; }\n [zoom=18]{ line-width:16 + 3; }\n}\n.route.bridge::b[highway='secondary'] {\n [zoom>7] { line-color:spin(darken(@road_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=8] { line-width:0.3; line-opacity:0.8; }\n [zoom=9] { line-width:0.5; }\n [zoom=10]{ line-width:0.7; }\n [zoom=11]{ line-width:0.9; }\n [zoom>11]{ line-color:spin(darken(@secondary_line,15),-10); }\n [zoom=12]{ line-width:0.9 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2.6 + 2; }\n [zoom=15]{ line-width:4 + 2; }\n [zoom=16]{ line-width:6 + 2.5; }\n [zoom=17]{ line-width:8 + 3; }\n [zoom=18]{ line-width:16 + 3; }\n}\n.route.fill[highway='secondary'] {\n [zoom>11]{ line-color:@secondary_fill; line-cap:round; line-join:round; }\n [zoom=12]{ line-width:0.9; }\n [zoom=13]{ line-width:1.2; }\n [zoom=14]{ line-width:2.6; }\n [zoom=15]{ line-width:4; }\n [zoom=16]{ line-width:6; }\n [zoom=17]{ line-width:8; }\n [zoom=18]{ line-width:16; }\n}\n\n\/* Primary *\/\n.route.line[highway='primary'] {\n [zoom>6] { line-color:@primary_line; line-cap:round; line-join:round; }\n [zoom=7] { line-width:0.2; line-opacity:0.6; }\n [zoom=8] { line-width:0.4; line-opacity:0.8; }\n [zoom=9] { line-width:0.6; }\n [zoom=10]{ line-width:0.8; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.bridge::b[highway='primary'] {\n [zoom>6] { line-color:spin(darken(@primary_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=7] { line-width:0.2 + 1; line-opacity:0.6; }\n [zoom=8] { line-width:0.4 + 1; line-opacity:0.8; }\n [zoom=9] { line-width:0.6 + 1; }\n [zoom=10]{ line-width:0.8 + 1; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.fill[highway='primary'] {\n [zoom>10]{ line-color:@primary_fill; line-cap:round; line-join:round; }\n [zoom=11]{ line-width:0.8; }\n [zoom=12]{ line-width:1.0; }\n [zoom=13]{ line-width:1.4; }\n [zoom=14]{ line-width:3; }\n [zoom=15]{ line-width:5; }\n [zoom=16]{ line-width:7; }\n [zoom=17]{ line-width:9; }\n [zoom=18]{ line-width:18; }\n}\n\n\/* Trunk *\/\n.route.line[highway='trunk'] {\n [zoom>6] { line-color:@trunk_line; line-cap:round; line-join:round; }\n [zoom=7] { line-width:0.3; line-opacity:0.6; }\n [zoom=8] { line-width:0.5; line-opacity:0.8; }\n [zoom=9] { line-width:0.7; }\n [zoom=10]{ line-width:0.8; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.bridge::b[highway='trunk'] {\n [zoom>6] { line-color:spin(darken(@trunk_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=7] { line-width:0.3; line-opacity:0.6 + 1; }\n [zoom=8] { line-width:0.5; line-opacity:0.8 + 1; }\n [zoom=9] { line-width:0.7 + 1; }\n [zoom=10]{ line-width:0.8 + 1; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.fill[highway='trunk'] {\n [zoom>10]{ line-color:@trunk_fill; line-cap:round; line-join:round; }\n [zoom=11]{ line-width:0.8; }\n [zoom=12]{ line-width:1.0; }\n [zoom=13]{ line-width:1.4; }\n [zoom=14]{ line-width:3; }\n [zoom=15]{ line-width:5; }\n [zoom=16]{ line-width:7; }\n [zoom=17]{ line-width:9; }\n [zoom=18]{ line-width:18; }\n}\n\n\/* Motorway *\/\n.route.line[highway='motorway'][tunnel='no'],\n.route.tunnel[highway='motorway'] {\n [zoom>6] { line-color:@motorway_line; line-cap:round; line-join:round; }\n .tunnel[zoom>6] { line-dasharray:4,2; line-cap:butt; }\n [zoom=7] { line-width:0.4; line-opacity:0.6; }\n [zoom=8] { line-width:0.6; line-opacity:0.8; }\n [zoom=9] { line-width:0.8; }\n [zoom=10]{ line-width:1.0; }\n [zoom=11]{ line-width:1.0 + 1.8; }\n [zoom=12]{ line-width:1.2 + 2; }\n [zoom=13]{ line-width:2 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:6 + 2; }\n [zoom=16]{ line-width:8 + 2.5; }\n [zoom=17]{ line-width:10 + 3; }\n [zoom=18]{ line-width:20 + 3; }\n}\n.route.bridge::b[highway='motorway'] {\n [zoom>6] { line-color:spin(darken(@motorway_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=7] { line-width:0.4; line-opacity:0.6 + 1; }\n [zoom=8] { line-width:0.6; line-opacity:0.8 + 1; }\n [zoom=9] { line-width:0.8 + 1; }\n [zoom=10]{ line-width:1.0 + 1; }\n [zoom=11]{ line-width:1.0 + 1.8; }\n [zoom=12]{ line-width:1.2 + 2; }\n [zoom=13]{ line-width:2 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:6 + 2; }\n [zoom=16]{ line-width:8 + 2.5; }\n [zoom=17]{ line-width:10 + 3; }\n [zoom=18]{ line-width:20 + 3; }\n}\n.route.fill[highway='motorway'] {\n [zoom>10]{ line-color:@motorway_fill; line-cap:round; line-join:round; }\n [zoom>10][tunnel='yes'] { line-color:lighten(@motorway_fill,10); }\n [zoom=11]{ line-width:1.0; }\n [zoom=12]{ line-width:1.2; }\n [zoom=13]{ line-width:2; }\n [zoom=14]{ line-width:3; }\n [zoom=15]{ line-width:6; }\n [zoom=16]{ line-width:8; }\n [zoom=17]{ line-width:10; }\n [zoom=18]{ line-width:20; }\n}\n\n\/* ---- TURNING CIRCLES ---- *\/\n\n.turning-circle[zoom>=14] {\n marker-fill:@road_fill;\n marker-line-color:@road_line;\n marker-line-width:1;\n [zoom=14] { marker-width: 1.5; }\n [zoom=15] { marker-width: 3; }\n [zoom=16] { marker-width: 6; }\n [zoom=17] { marker-width: 8; }\n [zoom=18] { marker-width: 12; marker-line-width: 1.5; }\n}\n\n\/* ---- ONE WAY ARROWS ---- *\/\n\/* FIXME *\/\n\/*.route.label::arrow[oneway='yes'][zoom>15] {\n marker-type:arrow;\n marker-line-width:1;\n marker-line-opacity:0.5;\n marker-line-color:#fff;\n marker-spacing: 300;\n marker-fill:darken(@motorway_line,10);\n marker-opacity:0.8;\n [zoom=16] {\n marker-transform:\"scale(0)\";\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'],\n [highway='secondary'] { marker-transform:\"scale(0.8)\"; }\n }\n [zoom=17] {\n marker-transform:\"scale(0.8)\";\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'],\n [highway='secondary'] { marker-transform:\"scale(0.9)\"; }\n }\n [zoom=18] {\n marker-transform:\"scale(1)\";\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'],\n [highway='secondary'] { marker-transform:\"scale(1.2)\"; }\n }\n}*\/\n","old_contents":"\/* ---- PALETTE ---- *\/\n\n@motorway_fill: #a8bae0; \/*#93b5d9;*\/\n@motorway_line: spin(darken(@motorway_fill,25),-10);\n@trunk_fill: #a7dea5;\/*#fabd7d;*\/\n@trunk_line: spin(darken(@trunk_fill,25),-10);\n@primary_fill: #fcf7bd;\n@primary_line: spin(darken(@primary_fill,25),-10);\n@secondary_fill:@primary_fill;\n@secondary_line:spin(darken(@secondary_fill,25),-10);\n@road_fill: #fff;\n@road_line: #bbb;\n@access_fill: @road_fill;\n@access_line: @road_line;\n@track: @road;\n@footway: #6B9;\n@cycleway: #69B;\n@bridge: rgba(64,64,64,0.66);\n\n\/* ---- ROADS ---- *\/\n\n\/* Service\/Access *\/\n.route.line[highway='service'] {\n [zoom>12]{ line-color:@access_line; line-cap:square; line-join:round; }\n [zoom=13]{ line-width:0.2; line-opacity:0.4; }\n [zoom=14]{ line-width:0.4; line-opacity:0.6; }\n [zoom=15]{ line-width:1; line-opacity:0.8; }\n [zoom=16]{ line-width:1.6 + 2; }\n [zoom=17]{ line-width:4 + 2; }\n [zoom=18]{ line-width:7 + 3; }\n}\n.route.fill[highway='service'] {\n [zoom>15]{ line-color:@access_fill; line-cap:square; line-join:round; }\n [zoom=16]{ line-width:1.6; }\n [zoom=17]{ line-width:4; }\n [zoom=18]{ line-width:7; }\n}\n\n\/* Motorway Links *\/\n.route.line[highway='motorway_link'][tunnel='no'],\n.route.tunnel[highway='motorway_link'] {\n [zoom>6] { line-color:@motorway_line; line-cap:round; line-join:round; }\n .tunnel[zoom>6] { line-dasharray:4,2; line-cap:butt; }\n [zoom=7] { line-width:0.2; line-opacity:0.6; }\n [zoom=8] { line-width:0.4; line-opacity:0.8; }\n [zoom=9] { line-width:0.6; }\n [zoom=10]{ line-width:0.8; }\n [zoom=11]{ line-width:1; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2 + 2; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:5 + 2.5; }\n [zoom=17]{ line-width:6 + 2.5; }\n [zoom=18]{ line-width:14 + 2.5; }\n}\n.route.bridge::b[highway='motorway_link'] {\n [zoom>6] { line-color:darken(@motorway_line,15); line-cap:butt; line-join:round; }\n [zoom=7] { line-width:0.2; line-opacity:0.6 + 1; }\n [zoom=8] { line-width:0.4; line-opacity:0.8 + 1; }\n [zoom=9] { line-width:0.6 + 1; }\n [zoom=10]{ line-width:0.8 + 1; }\n [zoom=11]{ line-width:1; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2 + 2; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:5 + 2.5; }\n [zoom=17]{ line-width:6 + 2.5; }\n [zoom=18]{ line-width:14 + 2.5; }\n}\n.route.fill[highway='motorway_link'] {\n [zoom>11]{ line-color:@motorway_fill; line-cap:round; line-join:round; }\n [zoom>11][tunnel='yes'] { line-color:lighten(@motorway_fill,10); }\n \/*[zoom=11]{ line-width:0.8; }*\/\n [zoom=12]{ line-width:1.0; }\n [zoom=13]{ line-width:1.2; }\n [zoom=14]{ line-width:2; }\n [zoom=15]{ line-width:3.5; }\n [zoom=16]{ line-width:5; }\n [zoom=17]{ line-width:6; }\n [zoom=18]{ line-width:14; }\n}\n\n\/* Standard\/Unknown *\/\n.route.line[highway='living_street'],\n.route.line[highway='residential'],\n.route.line[highway='road'],\n.route.line[highway='tertiary'],\n.route.line[highway='tertiary_link'],\n.route.line[highway='unclassified'] {\n [zoom>9] { line-color:@road_line; line-cap:round; line-join:round; }\n [zoom=10]{ line-width:0.2; line-opacity:0.4; }\n [zoom=11]{ line-width:0.4; line-opacity:0.6; }\n [zoom=12]{ line-width:0.6; line-opacity:0.8; }\n [zoom=13]{ line-width:0.8; }\n [zoom=14]{ line-width:1.0 + 1.8; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:6 + 2; }\n [zoom=17]{ line-width:8 + 2; }\n [zoom=18]{ line-width:10 + 3; }\n}\n.route.bridge::b[highway='living_street'],\n.route.bridge::b[highway='residential'],\n.route.bridge::b[highway='road'],\n.route.bridge::b[highway='tertiary'],\n.route.bridge::b[highway='tertiary_link'],\n.route.bridge::b[highway='unclassified'] {\n [zoom>9] { line-color:spin(darken(@road_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=10]{ line-width:0.2 + 1; line-opacity:0.4; }\n [zoom=11]{ line-width:0.4 + 1; line-opacity:0.6; }\n [zoom=12]{ line-width:0.6 + 1; line-opacity:0.8; }\n [zoom=13]{ line-width:0.8 + 1; }\n [zoom=14]{ line-width:1.0 + 1.8; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:6 + 2; }\n [zoom=17]{ line-width:8 + 2; }\n [zoom=18]{ line-width:10 + 3; }\n}\n.route.fill[highway='living_street'],\n.route.fill[highway='residential'],\n.route.fill[highway='road'],\n.route.fill[highway='tertiary'],\n.route.fill[highway='tertiary_link'],\n.route.fill[highway='unclassified'] {\n [zoom>13]{ line-color:@road_fill; line-cap:round; line-join:round; }\n [zoom=14]{ line-width:1.0; }\n [zoom=15]{ line-width:3.5; }\n [zoom=16]{ line-width:6; }\n [zoom=17]{ line-width:8; }\n [zoom=18]{ line-width:10; }\n}\n\n\/* Secondary *\/\n.route.line[highway='secondary'] {\n [zoom>7] { line-color:@road_line; line-cap:round; line-join:round; }\n [zoom=8] { line-width:0.3; line-opacity:0.8; }\n [zoom=9] { line-width:0.5; }\n [zoom=10]{ line-width:0.7; }\n [zoom=11]{ line-width:0.9; }\n [zoom>11]{ line-color:@secondary_line; }\n [zoom=12]{ line-width:0.9 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2.6 + 2; }\n [zoom=15]{ line-width:4 + 2; }\n [zoom=16]{ line-width:6 + 2.5; }\n [zoom=17]{ line-width:8 + 3; }\n [zoom=18]{ line-width:16 + 3; }\n}\n.route.bridge::b[highway='secondary'] {\n [zoom>7] { line-color:spin(darken(@road_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=8] { line-width:0.3; line-opacity:0.8; }\n [zoom=9] { line-width:0.5; }\n [zoom=10]{ line-width:0.7; }\n [zoom=11]{ line-width:0.9; }\n [zoom>11]{ line-color:spin(darken(@secondary_line,15),-10); }\n [zoom=12]{ line-width:0.9 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2.6 + 2; }\n [zoom=15]{ line-width:4 + 2; }\n [zoom=16]{ line-width:6 + 2.5; }\n [zoom=17]{ line-width:8 + 3; }\n [zoom=18]{ line-width:16 + 3; }\n}\n.route.fill[highway='secondary'] {\n [zoom>11]{ line-color:@secondary_fill; line-cap:round; line-join:round; }\n [zoom=12]{ line-width:0.9; }\n [zoom=13]{ line-width:1.2; }\n [zoom=14]{ line-width:2.6; }\n [zoom=15]{ line-width:4; }\n [zoom=16]{ line-width:6; }\n [zoom=17]{ line-width:8; }\n [zoom=18]{ line-width:16; }\n}\n\n\/* Primary *\/\n.route.line[highway='primary'] {\n [zoom>6] { line-color:@primary_line; line-cap:round; line-join:round; }\n [zoom=7] { line-width:0.2; line-opacity:0.6; }\n [zoom=8] { line-width:0.4; line-opacity:0.8; }\n [zoom=9] { line-width:0.6; }\n [zoom=10]{ line-width:0.8; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.bridge::b[highway='primary'] {\n [zoom>6] { line-color:spin(darken(@primary_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=7] { line-width:0.2 + 1; line-opacity:0.6; }\n [zoom=8] { line-width:0.4 + 1; line-opacity:0.8; }\n [zoom=9] { line-width:0.6 + 1; }\n [zoom=10]{ line-width:0.8 + 1; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.fill[highway='primary'] {\n [zoom>10]{ line-color:@primary_fill; line-cap:round; line-join:round; }\n [zoom=11]{ line-width:0.8; }\n [zoom=12]{ line-width:1.0; }\n [zoom=13]{ line-width:1.4; }\n [zoom=14]{ line-width:3; }\n [zoom=15]{ line-width:5; }\n [zoom=16]{ line-width:7; }\n [zoom=17]{ line-width:9; }\n [zoom=18]{ line-width:18; }\n}\n\n\/* Trunk *\/\n.route.line[highway='trunk'] {\n [zoom>6] { line-color:@trunk_line; line-cap:round; line-join:round; }\n [zoom=7] { line-width:0.3; line-opacity:0.6; }\n [zoom=8] { line-width:0.5; line-opacity:0.8; }\n [zoom=9] { line-width:0.7; }\n [zoom=10]{ line-width:0.8; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.bridge::b[highway='trunk'] {\n [zoom>6] { line-color:spin(darken(@trunk_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=7] { line-width:0.3; line-opacity:0.6 + 1; }\n [zoom=8] { line-width:0.5; line-opacity:0.8 + 1; }\n [zoom=9] { line-width:0.7 + 1; }\n [zoom=10]{ line-width:0.8 + 1; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.fill[highway='trunk'] {\n [zoom>10]{ line-color:@trunk_fill; line-cap:round; line-join:round; }\n [zoom=11]{ line-width:0.8; }\n [zoom=12]{ line-width:1.0; }\n [zoom=13]{ line-width:1.4; }\n [zoom=14]{ line-width:3; }\n [zoom=15]{ line-width:5; }\n [zoom=16]{ line-width:7; }\n [zoom=17]{ line-width:9; }\n [zoom=18]{ line-width:18; }\n}\n\n\/* Motorway *\/\n.route.line[highway='motorway'][tunnel='no'],\n.route.tunnel[highway='motorway'] {\n [zoom>6] { line-color:@motorway_line; line-cap:round; line-join:round; }\n .tunnel[zoom>6] { line-dasharray:4,2; line-cap:butt; }\n [zoom=7] { line-width:0.4; line-opacity:0.6; }\n [zoom=8] { line-width:0.6; line-opacity:0.8; }\n [zoom=9] { line-width:0.8; }\n [zoom=10]{ line-width:1.0; }\n [zoom=11]{ line-width:1.0 + 1.8; }\n [zoom=12]{ line-width:1.2 + 2; }\n [zoom=13]{ line-width:2 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:6 + 2; }\n [zoom=16]{ line-width:8 + 2.5; }\n [zoom=17]{ line-width:10 + 3; }\n [zoom=18]{ line-width:20 + 3; }\n}\n.route.bridge::b[highway='motorway'] {\n [zoom>6] { line-color:spin(darken(@motorway_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=7] { line-width:0.4; line-opacity:0.6 + 1; }\n [zoom=8] { line-width:0.6; line-opacity:0.8 + 1; }\n [zoom=9] { line-width:0.8 + 1; }\n [zoom=10]{ line-width:1.0 + 1; }\n [zoom=11]{ line-width:1.0 + 1.8; }\n [zoom=12]{ line-width:1.2 + 2; }\n [zoom=13]{ line-width:2 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:6 + 2; }\n [zoom=16]{ line-width:8 + 2.5; }\n [zoom=17]{ line-width:10 + 3; }\n [zoom=18]{ line-width:20 + 3; }\n}\n.route.fill[highway='motorway'] {\n [zoom>10]{ line-color:@motorway_fill; line-cap:round; line-join:round; }\n [zoom>10][tunnel='yes'] { line-color:lighten(@motorway_fill,10); }\n [zoom=11]{ line-width:1.0; }\n [zoom=12]{ line-width:1.2; }\n [zoom=13]{ line-width:2; }\n [zoom=14]{ line-width:3; }\n [zoom=15]{ line-width:6; }\n [zoom=16]{ line-width:8; }\n [zoom=17]{ line-width:10; }\n [zoom=18]{ line-width:20; }\n}\n\n\/* ---- TURNING CIRCLES ---- *\/\n\n.turning-circle[zoom>=14] {\n marker-fill:@road_fill;\n marker-line-color:@road_line;\n marker-line-width:1;\n [zoom=14] { marker-width: 1.5; }\n [zoom=15] { marker-width: 3; }\n [zoom=16] { marker-width: 6; }\n [zoom=17] { marker-width: 8; }\n [zoom=17] { marker-width: 10; }\n}\n\n\/* ---- ONE WAY ARROWS ---- *\/\n\/* FIXME *\/\n\/*.route.label::arrow[oneway='yes'][zoom>15] {\n marker-type:arrow;\n marker-line-width:1;\n marker-line-opacity:0.5;\n marker-line-color:#fff;\n marker-spacing: 300;\n marker-fill:darken(@motorway_line,10);\n marker-opacity:0.8;\n [zoom=16] {\n marker-transform:\"scale(0)\";\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'],\n [highway='secondary'] { marker-transform:\"scale(0.8)\"; }\n }\n [zoom=17] {\n marker-transform:\"scale(0.8)\";\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'],\n [highway='secondary'] { marker-transform:\"scale(0.9)\"; }\n }\n [zoom=18] {\n marker-transform:\"scale(1)\";\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'],\n [highway='secondary'] { marker-transform:\"scale(1.2)\"; }\n }\n}*\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"1a928cea8ffc2892541bd7d9c3e041b044313649","subject":"Simplify stem.dir writing","message":"Simplify stem.dir writing\n","repos":"music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n\n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n \/\/encodingDesc must preceed workList in MEI 4.0\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = GenerateApplicationInfo();\n libmei.AddChild(encodingD, appI);\n\n \/\/generate workList\n workList = libmei.WorkList();\n Self._property:WorkListElement = workList;\n\n wd_work = libmei.Work();\n wd_title = libmei.Title();\n libmei.AddChild(wd_work, wd_title);\n libmei.AddChild(workList, wd_work);\n libmei.AddChild(header, workList);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.Composer();\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_work, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.Lyricist();\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_work, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.Arranger();\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_work, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n return header;\n} \/\/$end\n\nfunction GenerateApplicationInfo () {\n \/\/$module(ExportGenerators.mss)\n\n appI = libmei.AppInfo();\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return appI;\n\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:SlurResolver = CreateSparseArray();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n \/\/annot is valid as a child of score\n libmei.AddChild(sco, ano);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workList = Self._property:WorkListElement;\n workEl = libmei.Work();\n libmei.AddChild(workList, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n mobjs = Self._property:MeasureObjects;\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/*\n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n parent = beam._property:ParentBeam;\n if (parent = null)\n {\n parent = l;\n }\n if (beam._parent != parent._id)\n {\n libmei.AddChild(parent, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n\n if (bobj.ArpeggioType != ArpeggioTypeNone) {\n arpeg = GenerateArpeggio(bobj);\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(arpeg._id);\n Self._property:MeasureObjects = mobjs;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n }\n }\n\n for each bobj in bar\n {\n obj = null;\n mobj = null;\n chordsym = null;\n\n switch (bobj.Type)\n {\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n bobj._property:mobj = mobj;\n PushToHashedLayer(Self._property:SlurResolver, bobj.EndBarNumber, bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('ArpeggioLine')\n {\n mobj = GenerateArpeggio(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n if (mobj != null)\n {\n \/\/Try to get note at position of bracket and put id\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(mobj, 'startid', '#' & obj._id);\n }\n }\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n Self._property:MeasureObjects = mobjs;\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n ProcessEndingSlurs(bar);\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n else\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n libmei.AddAttribute(nr, 'stem.mod', '1slash');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ppq', dur);\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMEI(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pden & '.0' \/ pnum & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', gesdur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n if (nobj.Dx != 0)\n {\n libmei.AddAttribute(n, 'ho', ConvertOffsetsToMEI(nobj.Dx));\n }\n\n if (nobj.Color != nobj.ParentNoteRest.Color)\n {\n note_color = ConvertColor(nobj);\n libmei.AddAttribute(n, 'color', note_color);\n }\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', dur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n \/\/ MEI now supports a four-bar repeat\n obj = libmei.MultiRpt();\n libmei.AddAttribute(obj, 'num', '4');\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n if (score.StaffCount > 0)\n {\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n }\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n \/\/brackets\n case ('bracket')\n {\n line = libmei.Line();\n bracketType = 'bracket';\n\n \/\/horizontal brackets\n if (linecomps.Length >= 3)\n {\n \/\/brackets above\n if (linecomps[3] = 'above')\n {\n libmei.AddAttribute(line, 'place', 'above');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleup');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angleup');\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n \/\/brackets below\n if (linecomps[3] = 'below')\n {\n libmei.AddAttribute(line, 'place', 'below');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angledown');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angledown');\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n \/\/vertical bracktes\n if (linecomps[3] = 'vertical')\n {\n bracketType = bracketType & ' vertical';\n\n \/\/Add direction of bracket: line.staff.bracket.vertical.2 opens to the right, line.staff.bracket.vertical opens to the left\n if (linecomps > 4)\n {\n if (linecomps[4] = '2')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleright');\n libmei.AddAttribute(line, 'endsym', 'angleright');\n }\n }\n\n else\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'startsym', 'angleleft');\n libmei.AddAttribute(line, 'endsym', 'angleleft');\n }\n }\n }\n\n \/\/add types of bracktes\n libmei.AddAttribute(line, 'type', bracketType);\n }\n \/\/solid vertical line\n case ('vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n libmei.AddAttribute(line,'type','vertical');\n }\n \/\/dashed lines\n case ('dashed')\n {\n \/\/dashed vertical line\n if (linecomps.Length > 3)\n {\n if (linecomps[3] = 'vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n libmei.AddAttribute(line,'type','vertical');\n }\n }\n \/\/dashed horizontal line\n else\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n }\n }\n \/\/dotted horizontal line\n case('dotted')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dotted');\n }\n \/\/solid horizontal line\n case('plain')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n }\n case ('vibrato')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'vibrato');\n libmei.AddAttribute(line, 'form', 'wavy');\n libmei.AddAttribute(line, 'place', 'above');\n\n }\n\n \/\/To catch diverse line types, set a default\n default\n {\n line = libmei.Line();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateArpeggio (bobj) {\n \/\/$module(ExportGenerators.mss)\n arpeg = libmei.Arpeg();\n orientation = null;\n\n switch (bobj.Type)\n {\n case ('NoteRest')\n {\n switch (bobj.ArpeggioType)\n {\n case (ArpeggioTypeUp)\n {\n orientation = 1;\n }\n case (ArpeggioTypeDown)\n {\n orientation = -1;\n }\n }\n if (bobj.ArpeggioBottomDy > bobj.ArpeggioTopDy)\n {\n \/\/ Arpeggio was manipulated to be upside down\n orientation = -1 * orientation;\n }\n }\n case ('ArpeggioLine')\n {\n if (bobj.StyleId != 'line.staff.arpeggio') {\n \/\/ This means: Line style is line.staff.arpeggio.up or\n \/\/ line.staff.arpeggio.down.\n \/\/ Strangely, the line style does not really matter for the\n \/\/ visual orientation of the arpeggio. As long as RhDy and\n \/\/ and Dy properties are identical, arpeggios look the same,\n \/\/ independant of the two line styles with arrowheads.\n orientation = bobj.RhDy - bobj.Dy;\n }\n }\n }\n\n if (orientation = null)\n {\n libmei.AddAttribute(arpeg, 'arrow', 'false');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'arrow', 'true');\n\n if (orientation > 0)\n {\n libmei.AddAttribute(arpeg, 'order', 'up');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'order', 'down');\n }\n }\n\n arpeg = AddBarObjectInfoToElement(bobj, arpeg);\n\n return arpeg;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'glyph.auth', 'smufl');\n libmei.AddAttribute(symbol, 'glyph.num', glyphnum);\n libmei.AddAttribute(symbol, 'glyph.name', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end\n","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n\n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n \/\/encodingDesc must preceed workList in MEI 4.0\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = GenerateApplicationInfo();\n libmei.AddChild(encodingD, appI);\n\n \/\/generate workList\n workList = libmei.WorkList();\n Self._property:WorkListElement = workList;\n\n wd_work = libmei.Work();\n wd_title = libmei.Title();\n libmei.AddChild(wd_work, wd_title);\n libmei.AddChild(workList, wd_work);\n libmei.AddChild(header, workList);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.Composer();\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_work, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.Lyricist();\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_work, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.Arranger();\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_work, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n return header;\n} \/\/$end\n\nfunction GenerateApplicationInfo () {\n \/\/$module(ExportGenerators.mss)\n\n appI = libmei.AppInfo();\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return appI;\n\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:SlurResolver = CreateSparseArray();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n \/\/annot is valid as a child of score\n libmei.AddChild(sco, ano);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workList = Self._property:WorkListElement;\n workEl = libmei.Work();\n libmei.AddChild(workList, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n mobjs = Self._property:MeasureObjects;\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/*\n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n parent = beam._property:ParentBeam;\n if (parent = null)\n {\n parent = l;\n }\n if (beam._parent != parent._id)\n {\n libmei.AddChild(parent, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n\n if (bobj.ArpeggioType != ArpeggioTypeNone) {\n arpeg = GenerateArpeggio(bobj);\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(arpeg._id);\n Self._property:MeasureObjects = mobjs;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n }\n }\n\n for each bobj in bar\n {\n obj = null;\n mobj = null;\n chordsym = null;\n\n switch (bobj.Type)\n {\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n bobj._property:mobj = mobj;\n PushToHashedLayer(Self._property:SlurResolver, bobj.EndBarNumber, bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('ArpeggioLine')\n {\n mobj = GenerateArpeggio(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n if (mobj != null)\n {\n \/\/Try to get note at position of bracket and put id\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(mobj, 'startid', '#' & obj._id);\n }\n }\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n Self._property:MeasureObjects = mobjs;\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n ProcessEndingSlurs(bar);\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n libmei.AddAttribute(nr, 'stem.mod', '1slash');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ppq', dur);\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMEI(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pden & '.0' \/ pnum & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', gesdur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n if (nobj.Dx != 0)\n {\n libmei.AddAttribute(n, 'ho', ConvertOffsetsToMEI(nobj.Dx));\n }\n\n if (nobj.Color != nobj.ParentNoteRest.Color)\n {\n note_color = ConvertColor(nobj);\n libmei.AddAttribute(n, 'color', note_color);\n }\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', dur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n \/\/ MEI now supports a four-bar repeat\n obj = libmei.MultiRpt();\n libmei.AddAttribute(obj, 'num', '4');\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n if (score.StaffCount > 0)\n {\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n }\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n \/\/brackets\n case ('bracket')\n {\n line = libmei.Line();\n bracketType = 'bracket';\n\n \/\/horizontal brackets\n if (linecomps.Length >= 3)\n {\n \/\/brackets above\n if (linecomps[3] = 'above')\n {\n libmei.AddAttribute(line, 'place', 'above');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleup');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angleup');\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n \/\/brackets below\n if (linecomps[3] = 'below')\n {\n libmei.AddAttribute(line, 'place', 'below');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angledown');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angledown');\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n \/\/vertical bracktes\n if (linecomps[3] = 'vertical')\n {\n bracketType = bracketType & ' vertical';\n\n \/\/Add direction of bracket: line.staff.bracket.vertical.2 opens to the right, line.staff.bracket.vertical opens to the left\n if (linecomps > 4)\n {\n if (linecomps[4] = '2')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleright');\n libmei.AddAttribute(line, 'endsym', 'angleright');\n }\n }\n\n else\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'startsym', 'angleleft');\n libmei.AddAttribute(line, 'endsym', 'angleleft');\n }\n }\n }\n\n \/\/add types of bracktes\n libmei.AddAttribute(line, 'type', bracketType);\n }\n \/\/solid vertical line\n case ('vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n libmei.AddAttribute(line,'type','vertical');\n }\n \/\/dashed lines\n case ('dashed')\n {\n \/\/dashed vertical line\n if (linecomps.Length > 3)\n {\n if (linecomps[3] = 'vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n libmei.AddAttribute(line,'type','vertical');\n }\n }\n \/\/dashed horizontal line\n else\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n }\n }\n \/\/dotted horizontal line\n case('dotted')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dotted');\n }\n \/\/solid horizontal line\n case('plain')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n }\n case ('vibrato')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'vibrato');\n libmei.AddAttribute(line, 'form', 'wavy');\n libmei.AddAttribute(line, 'place', 'above');\n\n }\n\n \/\/To catch diverse line types, set a default\n default\n {\n line = libmei.Line();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateArpeggio (bobj) {\n \/\/$module(ExportGenerators.mss)\n arpeg = libmei.Arpeg();\n orientation = null;\n\n switch (bobj.Type)\n {\n case ('NoteRest')\n {\n switch (bobj.ArpeggioType)\n {\n case (ArpeggioTypeUp)\n {\n orientation = 1;\n }\n case (ArpeggioTypeDown)\n {\n orientation = -1;\n }\n }\n if (bobj.ArpeggioBottomDy > bobj.ArpeggioTopDy)\n {\n \/\/ Arpeggio was manipulated to be upside down\n orientation = -1 * orientation;\n }\n }\n case ('ArpeggioLine')\n {\n if (bobj.StyleId != 'line.staff.arpeggio') {\n \/\/ This means: Line style is line.staff.arpeggio.up or\n \/\/ line.staff.arpeggio.down.\n \/\/ Strangely, the line style does not really matter for the\n \/\/ visual orientation of the arpeggio. As long as RhDy and\n \/\/ and Dy properties are identical, arpeggios look the same,\n \/\/ independant of the two line styles with arrowheads.\n orientation = bobj.RhDy - bobj.Dy;\n }\n }\n }\n\n if (orientation = null)\n {\n libmei.AddAttribute(arpeg, 'arrow', 'false');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'arrow', 'true');\n\n if (orientation > 0)\n {\n libmei.AddAttribute(arpeg, 'order', 'up');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'order', 'down');\n }\n }\n\n arpeg = AddBarObjectInfoToElement(bobj, arpeg);\n\n return arpeg;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'glyph.auth', 'smufl');\n libmei.AddAttribute(symbol, 'glyph.num', glyphnum);\n libmei.AddAttribute(symbol, 'glyph.name', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"fee710ae5f12dc24ce4eb3fcfa6e846feed47608","subject":"Updated color for state","message":"Updated color for state\n","repos":"OpenBounds\/MapStyles","old_file":"PublicLands.tm2\/style.mss","new_file":"PublicLands.tm2\/style.mss","new_contents":"Map { font-directory: url(\".\/fonts\"); }\n\n@default_text_halo: white;\n@default_text_color: black;\n@default_text_halo_radius: 2;\n\n#lands {\n polygon-opacity:1; \n [zoom >= 14] {\n text-face-name: 'Noto Sans Regular';\n text-name:'[name]';\n [name=''],[name=null] { \n text-name: '[adminAgency]';\n }\n text-size: 12;\n text-placement:line;\n text-fill:black;\n text-halo-fill: @default_text_halo;\n text-halo-radius: @default_text_halo_radius;\n text-dy:-5;\n text-min-padding:1;\n text-max-char-angle-delta : 10;\n text-min-distance:50;\n \/\/Border line\n line-width:1;\n line-color:black;\n }\n [adminlevel='federal'] {\n polygon-fill:#984ea3;\n }\n [adminLevel='state'] {\n polygon-fill:#eed3ee;\n }\n [adminLevel='county'] {\n polygon-fill:#ffff33;\n }\n [adminLevel='local'] {\n polygon-fill:#00ffff;\n }\n [adminAgency='Bureau of Land Management'] {\n polygon-fill: #e41a1c;\n }\n [adminAgency='Forest Service'] {\n polygon-fill: #4daf4a;\n }\n [adminAgency='U.S. Forest Service'] {\n polygon-fill: #4daf4a;\n }\n [adminAgency='National Park Service'] {\n polygon-fill: #a65628;\n }\n [adminAgency='Department of Defense'],[adminAgency='Army Corps of Engineers'],[adminAgency='Army'],[adminAgency='Air Force'],[adminAgency='Navy'],[adminAgency='Marine Corps'],[adminAgency='Coast Guard'],[adminAgency='Fish & Wildlife Service'] {\n polygon-fill: #0489B1;\n }\n}\n","old_contents":"Map { font-directory: url(\".\/fonts\"); }\n\n@default_text_halo: white;\n@default_text_color: black;\n@default_text_halo_radius: 2;\n\n#lands {\n polygon-opacity:1; \n [zoom >= 14] {\n text-face-name: 'Noto Sans Regular';\n text-name:'[name]';\n [name=''],[name=null] { \n text-name: '[adminAgency]';\n }\n text-size: 12;\n text-placement:line;\n text-fill:black;\n text-halo-fill: @default_text_halo;\n text-halo-radius: @default_text_halo_radius;\n text-dy:-5;\n text-min-padding:1;\n text-max-char-angle-delta : 10;\n text-min-distance:50;\n \/\/Border line\n line-width:1;\n line-color:black;\n }\n [adminlevel='federal'] {\n polygon-fill:#984ea3;\n }\n [adminLevel='state'] {\n polygon-fill:#dda0dd;\n }\n [adminLevel='county'] {\n polygon-fill:#ffff33;\n }\n [adminLevel='local'] {\n polygon-fill:#00ffff;\n }\n [adminAgency='Bureau of Land Management'] {\n polygon-fill: #e41a1c;\n }\n [adminAgency='Forest Service'] {\n polygon-fill: #4daf4a;\n }\n [adminAgency='U.S. Forest Service'] {\n polygon-fill: #4daf4a;\n }\n [adminAgency='National Park Service'] {\n polygon-fill: #a65628;\n }\n [adminAgency='Department of Defense'],[adminAgency='Army Corps of Engineers'],[adminAgency='Army'],[adminAgency='Air Force'],[adminAgency='Navy'],[adminAgency='Marine Corps'],[adminAgency='Coast Guard'],[adminAgency='Fish & Wildlife Service'] {\n polygon-fill: #0489B1;\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"508722bc9894593e4d502fceee5e14f3bacc3098","subject":"Update palette.mss","message":"Update palette.mss","repos":"brelevenix\/osm-bright-tregor","old_file":"osm-bright\/palette.mss","new_file":"osm-bright\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Open Sans Regular\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_lt_italic: \"Open Sans Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans: \"Open Sans Semibold\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_italic: \"Open Sans Semibold Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans_bold: \"Open Sans Bold\",\"DejaVu Sans Bold\",\"unifont Medium\";\n@sans_bold_italic: \"Open Sans Bold Italic\",\"DejaVu Sans Bold Italic\",\"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* COLOR PALETTE\n\/* ================================================================== *\/\n@grey1: #595959;\n@black: #000000; \n@white: #ffffff;\n@grey2: #8F8F8F;\n@grey3: #D6D6D6;\n@orange: #FF6600;\n@blue: #4BB4E6;\n@yellow: #FFDC00;\n@green: #50BE87;\n@purple: #9164CD;\n@pink: #FFB4E6;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: @white;\n@water: @blue;\n@grass: @green;\n@beach: @yellow;\n@park: @green;\n@cemetery: @white;\n@wooded: @green;\n@agriculture: @white;\n\n@building: @orange;\n@hospital: @white;\n@school: @white;\n@sports: @green;\n\n@residential: @white;\n@commercial: @white;\n@industrial: @white;\n@parking: @white;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: @black;\n@motorway_fill: lighten(@motorway_line,80%);\n@motorway_case: @motorway_line * 0.8;\n\n@trunk_line: @black;\n@trunk_fill: lighten(@trunk_line,70%);\n@trunk_case: @trunk_line * 0.7;\n\n@primary_line: @black;\n@primary_fill: lighten(@primary_line,60%);\n@primary_case: @primary_line * 0.6;\n\n@secondary_line: @black;\n@secondary_fill: lighten(@secondary_line,50%);\n@secondary_case: @secondary_line * 0.5;\n\n@standard_line: @black;\n@standard_fill: @white;\n@standard_case: @black;\n\n@pedestrian_line: @black;\n@pedestrian_fill: @white;\n@pedestrian_case: @black;\n\n@cycle_line: @black;\n@cycle_fill: @white;\n@cycle_case: @black;\n\n@rail_line: @black;\n@rail_fill: @black;\n@rail_case: @black;\n\n@aeroway: @black;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: @purple;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,0%);\n\n@country_text: @black;\n@country_halo: @place_halo;\n\n@state_text: @black;\n@state_halo: @place_halo;\n\n@city_text: @black;\n@city_halo: @place_halo;\n\n@town_text: @black;\n@town_halo: @place_halo;\n\n@poi_text: @black;\n\n@road_text: @black;\n@road_halo: @place_halo;\n\n@other_text: @black;\n@other_halo: @place_halo;\n\n@locality_text: @black;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: @black;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Open Sans Regular\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_lt_italic: \"Open Sans Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans: \"Open Sans Semibold\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_italic: \"Open Sans Semibold Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans_bold: \"Open Sans Bold\",\"DejaVu Sans Bold\",\"unifont Medium\";\n@sans_bold_italic: \"Open Sans Bold Italic\",\"DejaVu Sans Bold Italic\",\"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* COLOR PALETTE\n\/* ================================================================== *\/\n@grey1: #595959;\n@black: #000000; \n@white: #ffffff;\n@grey2: #8F8F8F;\n@grey3: #D6D6D6;\n@orange: #FF6600;\n@blue: #4BB4E6;\n@yellow: #FFDC00;\n@green: #50BE87;\n@purple: #9164CD;\n@pink: #FFB4E6;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: @white;\n@water: @blue;\n@grass: @green;\n@beach: @yellow;\n@park: @green;\n@cemetery: @white;\n@wooded: @green;\n@agriculture: @white;\n\n@building: @orange;\n@hospital: @white;\n@school: @white;\n@sports: @green;\n\n@residential: @white;\n@commercial: @white;\n@industrial: @white;\n@parking: @white;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: @black;\n@motorway_fill: lighten(@motorway_line,80%);\n@motorway_case: @motorway_line * 0.8;\n\n@trunk_line: @black;\n@trunk_fill: lighten(@trunk_line,70%);\n@trunk_case: @trunk_line * 0.7;\n\n@primary_line: @black;\n@primary_fill: lighten(@primary_line,60%);\n@primary_case: @primary_line * 0.6;\n\n@secondary_line: @black;\n@secondary_fill: lighten(@secondary_line,50%);\n@secondary_case: @secondary_line * 0.5;\n\n@standard_line: @black;\n@standard_fill: @white;\n@standard_case: @black;\n\n@pedestrian_line: @black;\n@pedestrian_fill: @white;\n@pedestrian_case: @black;\n\n@cycle_line: @black;\n@cycle_fill: @white;\n@cycle_case: @black;\n\n@rail_line: @black;\n@rail_fill: @black;\n@rail_case: @black;\n\n@aeroway: @black;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: @purple;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,0%);\n\n@country_text: @black;\n@country_halo: @place_halo;\n\n@state_text: @black;\n@state_halo: @place_halo;\n\n@city_text: @black;\n@city_halo: @place_halo;\n\n@town_text: @black;\n@town_halo: @place_halo;\n\n@poi_text: @black;\n\n@road_text: @black;\n@road_halo: @place_halo;\n\n@other_text: @place_halo;\n@other_halo: @place_halo;\n\n@locality_text: @place_halo;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: @black;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"37f9a8d1e26ad87e0686859a0495699959745468","subject":"WIP: Supporting more symbols","message":"WIP: Supporting more symbols\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/ExportProcessors.mss","new_file":"src\/ExportProcessors.mss","new_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = sibmei2.GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = sibmei2.GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer) {\n \/\/$module(ExportProcessors.mss)\n ret = null;\n\n if (bobj.Duration < 256)\n {\n \/\/ if this object is an eighth note but is not beamed, and if the\n \/\/ active beam is set, null out the active beam and return null.\n if (bobj.Beam = NoBeam and layer._property:ActiveBeamId != null)\n {\n layer._property:ActiveBeamId = null;\n return ret;\n }\n\n \/*\n It's possible that Sibelius records a 'continue beam' at the start\n of a beamed group. Visually, this doesn't look out of place if the previous\n note was a quarter note or higher. \n \n The first check we do is if the note has a 'continue beam' attribute and\n the previous note has a duration higher than 256 (quarter) then we probably have\n a false negative (i.e., there is the start of a beam, but it isn't necessarily\n encoded correctly).\n *\/\n falseNegative = False;\n next_obj = bobj.NextItem(bobj.VoiceNumber, 'NoteRest');\n\n if ((bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam) and layer._property:ActiveBeamId = null)\n {\n \/\/ by all accounts this should be a beamed note, but we'll need to double-check.\n prev_obj = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n if (prev_obj != null and (prev_obj.Duration >= 256 or prev_obj.NoteCount = 0))\n {\n falseNegative = True;\n }\n }\n\n if (next_obj != null and (bobj.Beam = StartBeam or falseNegative = True) and next_obj.Beam = ContinueBeam and next_obj.Duration < 256)\n {\n \/\/ if:\n \/\/ - we're not at the end of the bar\n \/\/ - we have a start beam\n \/\/ - the next note is a continue beam\n \/\/ - the next note is a beamable duration (safeguard against quarter and longer\n \/\/ notes with Beam = ContinueBeam, which for some reason can actually occur)\n beam = libmei.Beam();\n layer._property:ActiveBeamId = beam._id;\n\n \/\/ return the beam so that we can add it to the tree.\n ret = beam;\n }\n\n if (layer._property:ActiveBeamId != null and (bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam))\n {\n beamid = layer._property:ActiveBeamId;\n beam = libmei.getElementById(beamid);\n ret = beam;\n }\n }\n else\n {\n if (layer._property:ActiveBeamId != null)\n {\n \/\/ this is a break in any active beam, so register it as such.\n layer._property:ActiveBeamId = null;\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction ProcessTuplet (bobj, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.ParentTupletIfAny = null)\n {\n return null;\n }\n\n if (layer._property:ActiveTupletId = null)\n {\n tupletObject = bobj.ParentTupletIfAny;\n\n tuplet = libmei.Tuplet();\n\n layer._property:ActiveTupletObject = tupletObject;\n layer._property:ActiveTupletId = tuplet._id;\n\n if (libmei.GetName(meielement) = 'beam')\n {\n \/\/ get the first child\n startid = meielement.children[0];\n }\n else\n {\n startid = meielement._id;\n }\n\n libmei.AddAttribute(tuplet, 'startid', '#' & startid);\n libmei.AddAttribute(tuplet, 'num', tupletObject.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObject.Right);\n\n tupletStyle = tupletObject.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObject.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n return tuplet;\n }\n else\n {\n tid = layer._property:ActiveTupletId;\n t = libmei.getElementById(tid);\n\n if (IsLastNoteInTuplet(bobj))\n {\n libmei.AddAttribute(t, 'endid', '#' & meielement._id);\n layer._property:ActiveTupletObject = null;\n layer._property:ActiveTupletId = null;\n }\n\n return t;\n }\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet, layer) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n \n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it \n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n tupletSpan._property:AddedToMeasure = False;\n\n layer._property:ActiveTupletId = tupletSpan._id;\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (j = 0)\n {\n libmei.AddAttribute(sylel, 'wordpos', 'i'); \/\/ 'initial'\n\n if (lyric_word.Length > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n\n syltext = libmei.GetText(sylel);\n\n if (utils.Pos('_', syltext) > -1)\n {\n \/\/ Syllable elision. split this syllable element by underscore.\n syllables = MSplitString(syltext, '_');\n sylarray = CreateSparseArray();\n\n \/\/ reset the text of the first syllable element to the first half of the syllable. \n libmei.SetText(sylel, syllables[0]);\n libmei.AddAttribute(sylel, 'con', 'b');\n\n for s = 1 to syllables.Length\n {\n esyl = libmei.Syl();\n libmei.SetText(esyl, syllables[s]);\n libmei.AddChild(verse, esyl);\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n if (name = 'chord')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'chord'));\n }\n\n libmei.AddChild(obj, verse);\n }\n else\n {\n Log('Could not find note object for syl ' & syl);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so \n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessTremolo (bobj) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.DoubleTremolos = 0)\n {\n return null;\n }\n\n Log('Fingered tremolo: ' & bobj.DoubleTremolos);\n tremEl = libmei.FTrem();\n libmei.AddAttribute(tremEl, 'slash', bobj.DoubleTremolos);\n libmei.AddAttribute(tremEl, 'measperf')\n \n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n case ('52')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('53')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('54')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('55')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('160')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'stop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('162')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'open');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('163')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('164')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('165')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('166')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('212')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'ten');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('214')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'marc');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('217')\n {\n \/\/ up-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('218')\n {\n \/\/ down-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('233')\n {\n \/\/ up-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('234')\n {\n \/\/ down-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('240')\n {\n \/\/ double staccato\n return null;\n }\n case ('241')\n {\n \/\/ triple staccato\n return null;\n }\n case ('242')\n {\n \/\/ quadruple staccato\n return null;\n }\n case ('243')\n {\n \/\/ snap\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'snap');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('480')\n {\n \/\/scoop\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'scoop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('481')\n {\n \/\/fall\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fall');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('490')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fingernail');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('494')\n {\n \/\/doit\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'doit');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('495')\n {\n \/\/plop\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'plop');\n libmei.AddChild(nobj, artic);\n }\n\n }\n\n }\n} \/\/$end\n","old_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = sibmei2.GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = sibmei2.GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer) {\n \/\/$module(ExportProcessors.mss)\n ret = null;\n\n if (bobj.Duration < 256)\n {\n \/\/ if this object is an eighth note but is not beamed, and if the\n \/\/ active beam is set, null out the active beam and return null.\n if (bobj.Beam = NoBeam and layer._property:ActiveBeamId != null)\n {\n layer._property:ActiveBeamId = null;\n return ret;\n }\n\n \/*\n It's possible that Sibelius records a 'continue beam' at the start\n of a beamed group. Visually, this doesn't look out of place if the previous\n note was a quarter note or higher. \n \n The first check we do is if the note has a 'continue beam' attribute and\n the previous note has a duration higher than 256 (quarter) then we probably have\n a false negative (i.e., there is the start of a beam, but it isn't necessarily\n encoded correctly).\n *\/\n falseNegative = False;\n next_obj = bobj.NextItem(bobj.VoiceNumber, 'NoteRest');\n\n if ((bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam) and layer._property:ActiveBeamId = null)\n {\n \/\/ by all accounts this should be a beamed note, but we'll need to double-check.\n prev_obj = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n if (prev_obj != null and (prev_obj.Duration >= 256 or prev_obj.NoteCount = 0))\n {\n falseNegative = True;\n }\n }\n\n if (next_obj != null and (bobj.Beam = StartBeam or falseNegative = True) and next_obj.Beam = ContinueBeam and next_obj.Duration < 256)\n {\n \/\/ if:\n \/\/ - we're not at the end of the bar\n \/\/ - we have a start beam\n \/\/ - the next note is a continue beam\n \/\/ - the next note is a beamable duration (safeguard against quarter and longer\n \/\/ notes with Beam = ContinueBeam, which for some reason can actually occur)\n beam = libmei.Beam();\n layer._property:ActiveBeamId = beam._id;\n\n \/\/ return the beam so that we can add it to the tree.\n ret = beam;\n }\n\n if (layer._property:ActiveBeamId != null and (bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam))\n {\n beamid = layer._property:ActiveBeamId;\n beam = libmei.getElementById(beamid);\n ret = beam;\n }\n }\n else\n {\n if (layer._property:ActiveBeamId != null)\n {\n \/\/ this is a break in any active beam, so register it as such.\n layer._property:ActiveBeamId = null;\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction ProcessTuplet (bobj, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.ParentTupletIfAny = null)\n {\n return null;\n }\n\n if (layer._property:ActiveTupletId = null)\n {\n tupletObject = bobj.ParentTupletIfAny;\n\n tuplet = libmei.Tuplet();\n\n layer._property:ActiveTupletObject = tupletObject;\n layer._property:ActiveTupletId = tuplet._id;\n\n if (libmei.GetName(meielement) = 'beam')\n {\n \/\/ get the first child\n startid = meielement.children[0];\n }\n else\n {\n startid = meielement._id;\n }\n\n libmei.AddAttribute(tuplet, 'startid', '#' & startid);\n libmei.AddAttribute(tuplet, 'num', tupletObject.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObject.Right);\n\n tupletStyle = tupletObject.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObject.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n return tuplet;\n }\n else\n {\n tid = layer._property:ActiveTupletId;\n t = libmei.getElementById(tid);\n\n if (IsLastNoteInTuplet(bobj))\n {\n libmei.AddAttribute(t, 'endid', '#' & meielement._id);\n layer._property:ActiveTupletObject = null;\n layer._property:ActiveTupletId = null;\n }\n\n return t;\n }\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet, layer) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n \n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it \n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n tupletSpan._property:AddedToMeasure = False;\n\n layer._property:ActiveTupletId = tupletSpan._id;\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (j = 0)\n {\n libmei.AddAttribute(sylel, 'wordpos', 'i'); \/\/ 'initial'\n\n if (lyric_word.Length > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n\n syltext = libmei.GetText(sylel);\n\n if (utils.Pos('_', syltext) > -1)\n {\n \/\/ Syllable elision. split this syllable element by underscore.\n syllables = MSplitString(syltext, '_');\n sylarray = CreateSparseArray();\n\n \/\/ reset the text of the first syllable element to the first half of the syllable. \n libmei.SetText(sylel, syllables[0]);\n libmei.AddAttribute(sylel, 'con', 'b');\n\n for s = 1 to syllables.Length\n {\n esyl = libmei.Syl();\n libmei.SetText(esyl, syllables[s]);\n libmei.AddChild(verse, esyl);\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n if (name = 'chord')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'chord'));\n }\n\n libmei.AddChild(obj, verse);\n }\n else\n {\n Log('Could not find note object for syl ' & syl);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so \n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessTremolo (bobj) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.DoubleTremolos = 0)\n {\n return null;\n }\n\n Log('Fingered tremolo: ' & bobj.DoubleTremolos);\n tremEl = libmei.FTrem();\n libmei.AddAttribute(tremEl, 'slash', bobj.DoubleTremolos);\n libmei.AddAttribute(tremEl, 'measperf')\n \n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n \/\/ Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n \/\/ Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n case ('217')\n {\n \/\/ up-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('218')\n {\n \/\/ down-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('233')\n {\n \/\/ up-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('234')\n {\n \/\/ down-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('242')\n {\n \/\/ triple staccato\n return null;\n }\n case ('243')\n {\n \/\/ snap\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n libmei.AddAttributeValue(nobj, 'artic', 'snap');\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n }\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"e7d04f1564594fa98935a47fe6308ce8168e1553","subject":"Dropped outlines until zoom 14 and added 'U.S.' Forest Service lands temporarily, until new PR removing the US prefix is merged.","message":"Dropped outlines until zoom 14 and added 'U.S.' Forest Service lands temporarily, until new PR removing the US prefix is merged.\n","repos":"OpenBounds\/MapStyles","old_file":"PublicLands.tm2\/style.mss","new_file":"PublicLands.tm2\/style.mss","new_contents":"Map { font-directory: url(\".\/fonts\"); }\n\n#lands {\n\ttext-face-name: 'Noto Sans Regular';\n text-name:'[loc_nm]';\n text-size: 12;\n text-placement:line;\n text-fill:black;\n text-min-padding:1;\n \ttext-wrap-width:100;\n\tpolygon-opacity:1;\n\t[zoom >= 14] {\n \tline-width:1;\n \tline-color:black;\n\t}\n\t[adminLevel='state'] {\n \tpolygon-fill:#f781bf;\n\t}\n\t[adminLevel='county'] {\n \tpolygon-fill:#ffff33;\n\t}\n\t[adminLevel='local'] {\n \tpolygon-fill:#377eb8;\n\t}\n\t[adminAgency='Bureau of Land Management'][type!='wilderness area'] {\n\t\tpolygon-fill: #e41a1c;\n\t}\n\t[adminAgency='Bureau of Reclamation'][type!='wilderness area'] {\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='Forest Service'][type!='wilderness area'] {\n\t\tpolygon-fill: #4daf4a;\n\t}\n\t[adminAgency='U.S. Forest Service'][type!='wilderness area'] {\n polygon-fill: #4daf4a;\n }\n\t[adminAgency='National Park Service'][type!='wilderness area'] {\n\t\tpolygon-fill: #a65628;\n\t}\n\t[adminAgency='Department of Defense']{\n\t\tpolygon-fill: #ff7f00;\n\t}\n\t[adminAgency='Army Corps of Engineers'] {\n\t\tpolygon-fill: #ff7f00;\n\t}\n\t[adminAgency='Army'] {\n polygon-fill: #ff7f00;\n }\n\t[adminAgency='Air Force'] {\n polygon-fill: #ff7f00;\n }\n\t[adminAgency='Navy'] {\n polygon-fill: #ff7f00;\n }\t\n\t[adminAgency='Marine Corps'] {\n polygon-fill: #ff7f00;\n }\n\t[adminAgency='Coast Guard']{\n polygon-fill: #ff7f00;\n }\n\t[adminAgency='Department of Energy']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='Department of Agriculture']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='Fish & Wildlife Service'][type!='wilderness area'] {\n\t\tpolygon-fill: #0489B1;\n\t}\n\t[adminAgency='National Aeronautics and Space Administration']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='International Boundary & Water Commission']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='Tennessee Valley Authority']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='Bureau of Indian Affairs']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='Department of the Interior'][type!='wilderness area'] {\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='National Center for Atmospheric Research']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='National Institute of Standards and Technology']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='Department of Justice']{\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Department of Commerce']{\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Department of Veterans Affairs']{\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Federal Aviation Administration']{\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Bureau of Indian Affairs'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Bonneville Power Administration'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Federal Government'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Federal Highway Administration'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Fire Administration'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='National Marine Fisheries Service'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Natural Resources Conservation Service'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Smithsonian'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Smithsonian Environmental Research Center'] {\n polygon-fill: #984ea3;\n }\n}\n","old_contents":"Map { font-directory: url(\".\/fonts\"); }\n\n#lands {\n\ttext-face-name: 'Noto Sans Regular';\n text-name:'[loc_nm]';\n text-size: 12;\n text-placement:line;\n text-fill:black;\n text-min-padding:1;\n \ttext-wrap-width:100;\n\tpolygon-opacity:1;\n line-width:1;\n line-color:black;\n\t[adminLevel='state'] {\n \tpolygon-fill:#f781bf;\n\t}\n\t[adminLevel='county'] {\n \tpolygon-fill:#ffff33;\n\t}\n\t[adminLevel='local'] {\n \tpolygon-fill:#377eb8;\n\t}\n\t[adminAgency='Bureau of Land Management'][type!='wilderness area'] {\n\t\tpolygon-fill: #e41a1c;\n\t}\n\t[adminAgency='Bureau of Reclamation'][type!='wilderness area'] {\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='Forest Service'][type!='wilderness area'] {\n\t\tpolygon-fill: #4daf4a;\n\t}\n\t[adminAgency='National Park Service'][type!='wilderness area'] {\n\t\tpolygon-fill: #a65628;\n\t}\n\t[adminAgency='Department of Defense']{\n\t\tpolygon-fill: #ff7f00;\n\t}\n\t[adminAgency='Army Corps of Engineers'] {\n\t\tpolygon-fill: #ff7f00;\n\t}\n\t[adminAgency='Army'] {\n polygon-fill: #ff7f00;\n }\n\t[adminAgency='Air Force'] {\n polygon-fill: #ff7f00;\n }\n\t[adminAgency='Navy'] {\n polygon-fill: #ff7f00;\n }\t\n\t[adminAgency='Marine Corps'] {\n polygon-fill: #ff7f00;\n }\n\t[adminAgency='Coast Guard']{\n polygon-fill: #ff7f00;\n }\n\t[adminAgency='Department of Energy']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='Department of Agriculture']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='Fish & Wildlife Service'][type!='wilderness area'] {\n\t\tpolygon-fill: #0489B1;\n\t}\n\t[adminAgency='National Aeronautics and Space Administration']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='International Boundary & Water Commission']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='Tennessee Valley Authority']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='Bureau of Indian Affairs']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='Department of the Interior'][type!='wilderness area'] {\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='National Center for Atmospheric Research']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='National Institute of Standards and Technology']{\n\t\tpolygon-fill: #984ea3;\n\t}\n\t[adminAgency='Department of Justice']{\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Department of Commerce']{\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Department of Veterans Affairs']{\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Federal Aviation Administration']{\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Bureau of Indian Affairs'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Bonneville Power Administration'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Federal Government'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Federal Highway Administration'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Fire Administration'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='National Marine Fisheries Service'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Natural Resources Conservation Service'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Smithsonian'] {\n polygon-fill: #984ea3;\n }\n\t[adminAgency='Smithsonian Environmental Research Center'] {\n polygon-fill: #984ea3;\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"698bf4085eb86271ba7e26c58d360f55cad33128","subject":"Update roads.mss","message":"Update roads.mss","repos":"brelevenix\/osm-bright-tregor","old_file":"osm-bright\/roads.mss","new_file":"osm-bright\/roads.mss","new_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 0.3; @rdz11_med: 0.2; @rdz11_min: 0.1;\n@rdz12_maj: 0.5; @rdz12_med: 0.4; @rdz12_min: 0.2;\n@rdz13_maj: 1; @rdz13_med: 0.8; @rdz13_min: 0.5;\n@rdz14_maj: 2; @rdz14_med: 1.5; @rdz14_min: 1;\n@rdz15_maj: 4; @rdz15_med: 3; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 16; @rdz17_med: 12; @rdz17_min: 8;\n@rdz18_maj: 32; @rdz18_med: 24; @rdz18_min: 16;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz11_maj; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz12_maj; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz13_maj; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz14_med; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz15_med }\n [stylegroup='minorroad']{ line-width: @rdz15_min ; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_maj; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj ;}\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz16_maj; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_maj; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_maj; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n line-color: @black;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz11_maj ; line-color: @black; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz12_maj ; line-color: @black; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_maj ; line-color: @black;}\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_maj; line-color: @black; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_maj; line-color: @black; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_maj ; line-color: @black;}\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_maj ; line-color: @black;}\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_maj ; line-color: @black; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","old_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 0.3; @rdz11_med: 0.2; @rdz11_min: 0.1;\n@rdz12_maj: 0.5; @rdz12_med: 0.4; @rdz12_min: 0.2;\n@rdz13_maj: 1; @rdz13_med: 0.8; @rdz13_min: 0.5;\n@rdz14_maj: 2; @rdz14_med: 1.5; @rdz14_min: 1;\n@rdz15_maj: 4; @rdz15_med: 3; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 16; @rdz17_med: 12; @rdz17_min: 8;\n@rdz18_maj: 32; @rdz18_med: 24; @rdz18_min: 16;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz11_maj; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz12_maj; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz13_maj; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz14_med; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz15_med }\n [stylegroup='minorroad']{ line-width: @rdz15_min ; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_maj; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj ;}\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz16_maj; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_maj; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_maj; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz11_maj ; line-color: @brown; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz12_maj ; line-color: @brown; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_maj ; line-color: @brown;}\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_maj; line-color: @brown; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_maj; line-color: @brown; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_maj ; line-color: @brown;}\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_maj ; line-color: @brown;}\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_maj ; line-color: @brown; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"8d32d265ed0dd47db4190c424dcfbf4fe8782fa9","subject":"Renamed HandleControlEvents to HandleControlEvent","message":"Renamed HandleControlEvents to HandleControlEvent\n\n","repos":"music-encoding\/sibmei","old_file":"src\/SymbolStyles.mss","new_file":"src\/SymbolStyles.mss","new_contents":"\/\/ TODO: Missing symbols\n\/\/ '240' double staccato\n\/\/ '241' tripe staccato\n\/\/ '242' quadruple staccato\n\nfunction InitSymbolHandlers () {\n \/\/$module(SymbolStyles.mss)\n\n symbIndexHandler = CreateDictionary(\n '36', 'HandleControlEvent', \/\/inverted mordent\n '37', 'HandleControlEvent', \/\/mordent\n '38', 'HandleControlEvent', \/\/turn\n '39', 'HandleControlEvent', \/\/inverted turn\n '52', 'HandleModifier', \/\/heel\n '53', 'HandleModifier', \/\/heel (2) (was toe in previous version, but this seems to be wrong)\n '54', 'HandleModifier', \/\/toe\n '160', 'HandleModifier', \/\/stop\n '162', 'HandleModifier', \/\/open\n '163', 'HandleModifier', \/\/damp\n '164', 'HandleModifier', \/\/damp (2)\n '165', 'HandleModifier', \/\/damp (3)\n '166', 'HandleModifier', \/\/damp (4)\n '212', 'HandleModifier', \/\/ten above\n '214', 'HandleModifier', \/\/marc above\n '217', 'HandleModifier', \/\/upbow above\n '218', 'HandleModifier', \/\/dnbow above\n '233', 'HandleModifier', \/\/upbow below\n '234', 'HandleModifier', \/\/dnbow below\n '243', 'HandleModifier', \/\/snap\n '480', 'HandleModifier', \/\/scoop\n '481', 'HandleModifier', \/\/fall\n '490', 'HandleModifier', \/\/fingernail\n '494', 'HandleModifier', \/\/doit\n '495', 'HandleModifier' \/\/plop\n );\n\n if(Self._property:SymbolIndexHandlers = null)\n {\n \/*symbMethods = CreateDictionary();\n\n for each Pair symb in symbIndexHandler\n {\n symbMethods.SetMethod(symb.Name, Self, symb.Value);\n }*\/\n\n Self._property:SymbolIndexHandlers = symbIndexHandler;\n }\n\n \/\/ Create a dictionary with symbol index number as key (sobj.Index) and a value that determines the element that has to be created\n \/\/ 0th element in SparseArray is the element name as function call\n \/\/ following Dictionary contains attributes\n \/\/ TODO: key, CreateDictionary(Element, CreateDictionary(attname, attvalue))\n\n symbIndexMap = CreateDictionary(\n '36', CreateSparseArray('Mordent', CreateDictionary('form', 'lower')), \/\/inverted mordent\n '37', CreateSparseArray('Mordent', CreateDictionary('form','upper')), \/\/mordent\n '38', CreateSparseArray('Turn', CreateDictionary('form', 'upper')), \/\/turn\n '39', CreateSparseArray('Turn', CreateDictionary('form', 'lower')), \/\/inverted turn\n '52', CreateSparseArray('Artic', CreateDictionary('artic','heel')), \/\/heel\n '53', CreateSparseArray('Artic', CreateDictionary('artic','heel')), \/\/heel (2) (was toe in previous version, but this seems to be wrong)\n '54', CreateSparseArray('Artic', CreateDictionary('artic','toe')), \/\/toe\n '160', CreateSparseArray('Artic', CreateDictionary('artic','stop')), \/\/stop\n '162', CreateSparseArray('Artic', CreateDictionary('artic','open')), \/\/open\n '163', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp\n '164', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp (2)\n '165', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp (3)\n '166', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp (4)\n '212', CreateSparseArray('Artic', CreateDictionary('artic','ten', 'place','above')), \/\/ten above\n '214', CreateSparseArray('Artic', CreateDictionary('artic','marc', 'place','above')), \/\/marc above\n '217', CreateSparseArray('Artic', CreateDictionary('artic','upbow', 'place','above')), \/\/upbow above\n '218', CreateSparseArray('Artic', CreateDictionary('artic','dnbow', 'place','above')), \/\/dnbow above\n '233', CreateSparseArray('Artic', CreateDictionary('artic','upbow', 'place','below')), \/\/upbow below\n '234', CreateSparseArray('Artic', CreateDictionary('artic','dnbow', 'place','below')), \/\/dnbow below\n '243', CreateSparseArray('Artic', CreateDictionary('artic','snap')), \/\/snap\n '480', CreateSparseArray('Artic', CreateDictionary('artic','scoop')), \/\/scoop\n '481', CreateSparseArray('Artic', CreateDictionary('artic','fall')), \/\/fall\n '490', CreateSparseArray('Artic', CreateDictionary('artic','fingernail')), \/\/fingernail\n '494', CreateSparseArray('Artic', CreateDictionary('artic','doit')), \/\/doit\n '495', CreateSparseArray('Artic', CreateDictionary('artic','plop')) \/\/plop\n ); \n\n if(Self._property:SymbolIndexMap = null)\n {\n Self._property:SymbolIndexMap = symbIndexMap;\n }\n\n \/\/ Dictionary to handle symbols by name\n Self._property:SymbolNameHandlers = CreateDictionary();\n Self._property:SymbolNameMap = CreateDictionary();\n\n}\/\/$end\n\n\nfunction HandleSymbol (sobj) {\n \/\/$module(SymbolStyles.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n \/\/ trills are special\n if (sobj.Index = '32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n \/\/ get SymbolIndexHandlers and SymbolIndexMap\n symbolHandlers = Self._property:SymbolIndexHandlers;\n symbolMap = Self._property:SymbolIndexMap;\n\n \/\/ look for symbol in SymbolIndexHandlers\n if(symbolHandlers.PropertyExists(sobj.Index))\n {\n handler = symbolHandlers[sobj.Index];\n @handler(sobj, symbolMap[sobj.Index]);\n }\n \n} \/\/$end\n\nfunction HandleModifier(sobj, mapValue){\n \/\/$module(SymbolStyles.mss)\n\n makeElement = mapValue[0];\n\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n modifier = libmei.@makeElement();\n\n \/\/ add attributes\n if (mapValue.Length = 2)\n {\n atts = mapValue[1];\n for each Pair att in atts\n {\n libmei.AddAttribute(modifier, att.Name, att.Value);\n }\n }\n\n libmei.AddChild(nobj, modifier);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n\n} \/\/$end\n\nfunction HandleControlEvent(sobj, mapValue){\n \/\/$module(SymbolStyles.mss)\n\n makeElement = mapValue[0];\n\n symbol = libmei.@makeElement();\n\n \/\/ add attributes if necessary\n if (mapValue.Length = 2)\n {\n atts = mapValue[1];\n for each Pair att in atts\n {\n libmei.AddAttribute(symbol, att.Name, att.Value);\n }\n }\n\n symbol = AddBarObjectInfoToElement(sobj, symbol);\n mlines = Self._property:MeasureObjects;\n mlines.Push(symbol._id);\n\n} \/\/$end","old_contents":"\/\/ TODO: Missing symbols\n\/\/ '240' double staccato\n\/\/ '241' tripe staccato\n\/\/ '242' quadruple staccato\n\nfunction InitSymbolHandlers () {\n \/\/$module(SymbolStyles.mss)\n\n symbIndexHandler = CreateDictionary(\n '36', 'HandleControlEvents', \/\/inverted mordent\n '37', 'HandleControlEvents', \/\/mordent\n '38', 'HandleControlEvents', \/\/turn\n '39', 'HandleControlEvents', \/\/inverted turn\n '52', 'HandleModifier', \/\/heel\n '53', 'HandleModifier', \/\/heel (2) (was toe in previous version, but this seems to be wrong)\n '54', 'HandleModifier', \/\/toe\n '160', 'HandleModifier', \/\/stop\n '162', 'HandleModifier', \/\/open\n '163', 'HandleModifier', \/\/damp\n '164', 'HandleModifier', \/\/damp (2)\n '165', 'HandleModifier', \/\/damp (3)\n '166', 'HandleModifier', \/\/damp (4)\n '212', 'HandleModifier', \/\/ten above\n '214', 'HandleModifier', \/\/marc above\n '217', 'HandleModifier', \/\/upbow above\n '218', 'HandleModifier', \/\/dnbow above\n '233', 'HandleModifier', \/\/upbow below\n '234', 'HandleModifier', \/\/dnbow below\n '243', 'HandleModifier', \/\/snap\n '480', 'HandleModifier', \/\/scoop\n '481', 'HandleModifier', \/\/fall\n '490', 'HandleModifier', \/\/fingernail\n '494', 'HandleModifier', \/\/doit\n '495', 'HandleModifier' \/\/plop\n );\n\n if(Self._property:SymbolIndexHandlers = null)\n {\n \/*symbMethods = CreateDictionary();\n\n for each Pair symb in symbIndexHandler\n {\n symbMethods.SetMethod(symb.Name, Self, symb.Value);\n }*\/\n\n Self._property:SymbolIndexHandlers = symbIndexHandler;\n }\n\n \/\/ Create a dictionary with symbol index number as key (sobj.Index) and a value that determines the element that has to be created\n \/\/ 0th element in SparseArray is the element name as function call\n \/\/ following Dictionary contains attributes\n \/\/ TODO: key, CreateDictionary(Element, CreateDictionary(attname, attvalue))\n\n symbIndexMap = CreateDictionary(\n '36', CreateSparseArray('Mordent', CreateDictionary('form', 'lower')), \/\/inverted mordent\n '37', CreateSparseArray('Mordent', CreateDictionary('form','upper')), \/\/mordent\n '38', CreateSparseArray('Turn', CreateDictionary('form', 'upper')), \/\/turn\n '39', CreateSparseArray('Turn', CreateDictionary('form', 'lower')), \/\/inverted turn\n '52', CreateSparseArray('Artic', CreateDictionary('artic','heel')), \/\/heel\n '53', CreateSparseArray('Artic', CreateDictionary('artic','heel')), \/\/heel (2) (was toe in previous version, but this seems to be wrong)\n '54', CreateSparseArray('Artic', CreateDictionary('artic','toe')), \/\/toe\n '160', CreateSparseArray('Artic', CreateDictionary('artic','stop')), \/\/stop\n '162', CreateSparseArray('Artic', CreateDictionary('artic','open')), \/\/open\n '163', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp\n '164', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp (2)\n '165', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp (3)\n '166', CreateSparseArray('Artic', CreateDictionary('artic','damp')), \/\/damp (4)\n '212', CreateSparseArray('Artic', CreateDictionary('artic','ten', 'place','above')), \/\/ten above\n '214', CreateSparseArray('Artic', CreateDictionary('artic','marc', 'place','above')), \/\/marc above\n '217', CreateSparseArray('Artic', CreateDictionary('artic','upbow', 'place','above')), \/\/upbow above\n '218', CreateSparseArray('Artic', CreateDictionary('artic','dnbow', 'place','above')), \/\/dnbow above\n '233', CreateSparseArray('Artic', CreateDictionary('artic','upbow', 'place','below')), \/\/upbow below\n '234', CreateSparseArray('Artic', CreateDictionary('artic','dnbow', 'place','below')), \/\/dnbow below\n '243', CreateSparseArray('Artic', CreateDictionary('artic','snap')), \/\/snap\n '480', CreateSparseArray('Artic', CreateDictionary('artic','scoop')), \/\/scoop\n '481', CreateSparseArray('Artic', CreateDictionary('artic','fall')), \/\/fall\n '490', CreateSparseArray('Artic', CreateDictionary('artic','fingernail')), \/\/fingernail\n '494', CreateSparseArray('Artic', CreateDictionary('artic','doit')), \/\/doit\n '495', CreateSparseArray('Artic', CreateDictionary('artic','plop')) \/\/plop\n ); \n\n if(Self._property:SymbolIndexMap = null)\n {\n Self._property:SymbolIndexMap = symbIndexMap;\n }\n\n \/\/ Dictionary to handle symbols by name\n Self._property:SymbolNameHandlers = CreateDictionary();\n Self._property:SymbolNameMap = CreateDictionary();\n\n}\/\/$end\n\n\nfunction HandleSymbol (sobj) {\n \/\/$module(SymbolStyles.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n \/\/ trills are special\n if (sobj.Index = '32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n \/\/ get SymbolIndexHandlers and SymbolIndexMap\n symbolHandlers = Self._property:SymbolIndexHandlers;\n symbolMap = Self._property:SymbolIndexMap;\n\n \/\/ look for symbol in SymbolIndexHandlers\n if(symbolHandlers.PropertyExists(sobj.Index))\n {\n handler = symbolHandlers[sobj.Index];\n @handler(sobj, symbolMap[sobj.Index]);\n }\n \n} \/\/$end\n\nfunction HandleModifier(sobj, mapValue){\n \/\/$module(SymbolStyles.mss)\n\n makeElement = mapValue[0];\n\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n modifier = libmei.@makeElement();\n\n \/\/ add attributes\n if (mapValue.Length = 2)\n {\n atts = mapValue[1];\n for each Pair att in atts\n {\n libmei.AddAttribute(modifier, att.Name, att.Value);\n }\n }\n\n libmei.AddChild(nobj, modifier);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n\n} \/\/$end\n\nfunction HandleControlEvents(sobj, mapValue){\n \/\/$module(SymbolStyles.mss)\n\n makeElement = mapValue[0];\n\n symbol = libmei.@makeElement();\n\n \/\/ add attributes if necessary\n if (mapValue.Length = 2)\n {\n atts = mapValue[1];\n for each Pair att in atts\n {\n libmei.AddAttribute(symbol, att.Name, att.Value);\n }\n }\n\n symbol = AddBarObjectInfoToElement(sobj, symbol);\n mlines = Self._property:MeasureObjects;\n mlines.Push(symbol._id);\n\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"4befab010df4e2ec64ba37fee573875cd45be31f","subject":"make landcover progressively more transparent for #41","message":"make landcover progressively more transparent for #41\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"map.mss","new_file":"map.mss","new_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999; \/\/ 40% K\n@color_transport_casing_z10: #ddd;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc; \/\/ 20% K\n@color_transport_hwy: #737373; \/\/ 55% K \n@color_transport_minor: #aaa; \n@color_transport_rail: #aaa; \/\/ 33% K\n@color_transport_path: #666; \/\/ 60% K\n@color_building: #ccc;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: #c8cebe; \/\/ hsl(82,8,81)\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_green_areas: darken(#c0d3b5,18);\n\nMap {\n background-color: @color_water;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n \/* lighten background color, as we decrease landcover opacity *\/\n [zoom>=12] {\n polygon-fill: lighten(@color_physical,20);\n }\n [zoom>=14] {\n polygon-fill: lighten(@color_physical,40);\n }\n\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_50m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{ \n line-color: @color_water;\n line-width: 0;\n polygon-fill: @color_water;\n\n [zoom>=5]{\n line-width: 0.5;\n }\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=7][scalerank<=6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n\/**\n * Use OSM administrative boundaries at zooms >= 10\n * Filter out really small admin areas for features like \n * Indian Reservations at higher zooms \n **\/\n#admin1-lines-osm{\n [zoom>=10][area_km2>1000],\n [zoom>=12][area_km2>500],\n [zoom>=14][area_km2>0]{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=13][area> 10000],\n#green-areas-high[zoom>13],\n#green-areas-high[zoom>=13],\n{\n polygon-fill: @color_green_areas;\n \/\/ polygon-opacity: 0.5;\n polygon-comp-op: src;\n\n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n \/\/ polygon-opacity: 0.3;\n }\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [type='runway'] {\n [zoom=10] {\n line-width: 1;\n }\n [zoom=11] {\n line-width: 1.5;\n }\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n line-color: @color_transport_hwy;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n line-color: @color_transport_hwy;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{ \n [zoom>=9] {\n ::outline {\n line-width: 3;\n line-color: @color_transport_casing_z10;\n }\n\n line-width: 1.5; \n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 5;\n line-color: @color_transport_casing;\n }\n\n line-width: 3;\n line-color: @color_transport_hwy; \n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4; \n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 13;\n }\n\n line-width: 7.5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 39;\n } \n\n line-width: 28;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 49;\n \/\/ }\n\n \/\/ line-width: 35;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n\n [zoom<=12] {\n line-color: @color_transport; \n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n line-color: @color_transport_casing;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0;\/\/10;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 0; \/\/6;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=17] {\n ::outline {\n \/\/ line-width: 20;\n }\n\n line-width: 14;\n\n [is_link='yes'] {\n ::casing{\n \/\/ line-width: 14;\n }\n\n line-width: 7;\n }\n }\n\n [zoom>=18] {\n ::outline {\n \/\/ line-width: 25;\n }\n\n line-width: 17;\n\n [is_link='yes'] {\n ::casing {\n \/\/ line-width: 19;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 30;\n \/\/ }\n\n \/\/ line-width: 26;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 17;\n \/\/ }\n\n \/\/ line-width: 13;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 1;\n }\n\n [zoom>=11][highway='trunk'],\n [zoom>=11][highway='primary'],\n [zoom>=11][highway='secondary'] {\n ::casing{\n line-width: 1.9;\n line-color: @color_transport_casing;\n }\n line-width: 1.5;\n }\n\n [zoom>=12][highway='trunk'],\n [zoom>=12][highway='primary'],\n [zoom>=12][highway='secondary'],\n [zoom>=12][highway='tertiary'] {\n ::casing{\n line-width: 1.9;\n line-color: @color_transport_casing;\n }\n line-width: 1.5;\n }\n\n [zoom>=13] {\n line-width: 1.5;\n line-color: @color_transport;\n }\n\n [zoom>=14] {\n ::casing {\n line-width: 3.5;\n line-color: @color_transport_casing;\n }\n line-width: 2.5;\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 6.5;\n }\n line-width: 4;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0; \/\/7.5;\n } \n line-width: 4; \n }\n\n [zoom>=17] {\n ::casing {\n \/\/ line-width: 11.5;\n }\n line-width: 8;\n }\n\n [zoom>=18] {\n ::casing {\n \/\/ line-width: 14.5;\n } \n line-width: 11;\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15] {\n ::casing {\n line-width: 2.8; \n }\n\n line-width: 1.8;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n line-color: @color_transport_path;\n\n [zoom>=15] {\n line-width: 0.5;\n line-cap: butt;\n line-dasharray: 2, 3;\n }\n\n [zoom>=16] {\n line-width: 0.7;\n }\n\n [zoom>=17] {\n line-width: 1.2;\n line-dasharray: 4, 6;\n }\n}\n\n#lc500mMODIS_low {\n [zoom>=0][zoom<9] {\n raster-opacity:1;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(0,0);\n }\n [zoom>=7] { raster-opacity:0.9; }\n [zoom>=8] { raster-opacity:0.8; }\n}\n\n#lc500mMODIS_med {\n [zoom>=9] {\n raster-opacity:0.7;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(3,3);\n }\n [zoom>=10] { raster-opacity:0.6; }\n [zoom>=11] {\n raster-opacity:0.5;\n image-filters: agg-stack-blur(10,10);\n }\n [zoom>=12] { raster-opacity:0.4; }\n [zoom>=13] { raster-opacity:0.3; }\n}\n\n#lc500mMODIS_high {\n [zoom>=14] {\n raster-opacity:0.2;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(20,20);\n }\n [zoom>=15] { raster-opacity:0.2; }\n [zoom>=16] { raster-opacity:0.15; }\n [zoom>=17] { raster-opacity:0.1; }\n [zoom>=18] { raster-opacity:0.05; }\n}\n\n#land {\n polygon-fill: @color_physical;\n}\n","old_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999; \/\/ 40% K\n@color_transport_casing_z10: #ddd;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc; \/\/ 20% K\n@color_transport_hwy: #737373; \/\/ 55% K \n@color_transport_minor: #aaa; \n@color_transport_rail: #aaa; \/\/ 33% K\n@color_transport_path: #666; \/\/ 60% K\n@color_building: #ccc;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: #c8cebe; \/\/ hsl(82,8,81)\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_green_areas: darken(#c0d3b5,18);\n\nMap {\n background-color: @color_water;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n \/* lighten background color, as we decrease landcover opacity *\/\n [zoom>=12] {\n polygon-fill: lighten(@color_physical,20);\n }\n [zoom>=14] {\n polygon-fill: lighten(@color_physical,40);\n }\n\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_50m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{ \n line-color: @color_water;\n line-width: 0;\n polygon-fill: @color_water;\n\n [zoom>=5]{\n line-width: 0.5;\n }\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=7][scalerank<=6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n\/**\n * Use OSM administrative boundaries at zooms >= 10\n * Filter out really small admin areas for features like \n * Indian Reservations at higher zooms \n **\/\n#admin1-lines-osm{\n [zoom>=10][area_km2>1000],\n [zoom>=12][area_km2>500],\n [zoom>=14][area_km2>0]{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=13][area> 10000],\n#green-areas-high[zoom>13],\n#green-areas-high[zoom>=13],\n{\n polygon-fill: @color_green_areas;\n \/\/ polygon-opacity: 0.5;\n polygon-comp-op: src;\n\n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n \/\/ polygon-opacity: 0.3;\n }\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [type='runway'] {\n [zoom=10] {\n line-width: 1;\n }\n [zoom=11] {\n line-width: 1.5;\n }\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n line-color: @color_transport_hwy;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n line-color: @color_transport_hwy;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{ \n [zoom>=9] {\n ::outline {\n line-width: 3;\n line-color: @color_transport_casing_z10;\n }\n\n line-width: 1.5; \n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 5;\n line-color: @color_transport_casing;\n }\n\n line-width: 3;\n line-color: @color_transport_hwy; \n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4; \n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 13;\n }\n\n line-width: 7.5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 39;\n } \n\n line-width: 28;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 49;\n \/\/ }\n\n \/\/ line-width: 35;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n\n [zoom<=12] {\n line-color: @color_transport; \n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n line-color: @color_transport_casing;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0;\/\/10;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 0; \/\/6;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=17] {\n ::outline {\n \/\/ line-width: 20;\n }\n\n line-width: 14;\n\n [is_link='yes'] {\n ::casing{\n \/\/ line-width: 14;\n }\n\n line-width: 7;\n }\n }\n\n [zoom>=18] {\n ::outline {\n \/\/ line-width: 25;\n }\n\n line-width: 17;\n\n [is_link='yes'] {\n ::casing {\n \/\/ line-width: 19;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 30;\n \/\/ }\n\n \/\/ line-width: 26;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 17;\n \/\/ }\n\n \/\/ line-width: 13;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 1;\n }\n\n [zoom>=11][highway='trunk'],\n [zoom>=11][highway='primary'],\n [zoom>=11][highway='secondary'] {\n ::casing{\n line-width: 1.9;\n line-color: @color_transport_casing;\n }\n line-width: 1.5;\n }\n\n [zoom>=12][highway='trunk'],\n [zoom>=12][highway='primary'],\n [zoom>=12][highway='secondary'],\n [zoom>=12][highway='tertiary'] {\n ::casing{\n line-width: 1.9;\n line-color: @color_transport_casing;\n }\n line-width: 1.5;\n }\n\n [zoom>=13] {\n line-width: 1.5;\n line-color: @color_transport;\n }\n\n [zoom>=14] {\n ::casing {\n line-width: 3.5;\n line-color: @color_transport_casing;\n }\n line-width: 2.5;\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 6.5;\n }\n line-width: 4;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0; \/\/7.5;\n } \n line-width: 4; \n }\n\n [zoom>=17] {\n ::casing {\n \/\/ line-width: 11.5;\n }\n line-width: 8;\n }\n\n [zoom>=18] {\n ::casing {\n \/\/ line-width: 14.5;\n } \n line-width: 11;\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15] {\n ::casing {\n line-width: 2.8; \n }\n\n line-width: 1.8;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n line-color: @color_transport_path;\n\n [zoom>=15] {\n line-width: 0.5;\n line-cap: butt;\n line-dasharray: 2, 3;\n }\n\n [zoom>=16] {\n line-width: 0.7;\n }\n\n [zoom>=17] {\n line-width: 1.2;\n line-dasharray: 4, 6;\n }\n}\n\n#lc500mMODIS_low {\n [zoom>=0][zoom<9] {\n raster-opacity:1;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(0,0); \n }\n}\n\n#lc500mMODIS_med {\n [zoom>=9] {\n raster-opacity:1;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(3,3);\n }\n}\n\n#lc500mMODIS_high {\n [zoom>=14] {\n raster-opacity:0.8;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(20,20); \n }\n}\n\n#land {\n polygon-fill: @color_physical;\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"a9fa28ade40f2c360873433181e831ca67426f2d","subject":"limit display of highway labels at low zooms","message":"limit display of highway labels at low zooms\n","repos":"andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto","old_file":"osmt\/highway.mss","new_file":"osmt\/highway.mss","new_contents":"\n@path_halo_opacity: 0.7;\n@path_halo_colour: white;\n\n\/* highway labels *\/\n#highway-labels[highway='footway'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='cycleway'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='path'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='track'][zoom > 13] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n#highway-labels[highway='service'][zoom > 16] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='residential'][zoom > 15] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='unclassified'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='tertiary'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='secondary'][zoom > 13] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='primary'][zoom > 12] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='trunk'][zoom > 12] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='motorway'][zoom > 11] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n\n.highway {\n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n \n line-width: 1;\n}\n\n.road[zoom > 11] {\n ::oneway_arrow[oneway='yes'][zoom > 14] {\n marker-type: arrow;\n \n marker-width: 2;\n marker-line-width: 2;\n \n marker-opacity: 1.0;\n marker-line-opacity: 1.0;\n \n marker-fill: white;\n marker-line-color: white;\n \n marker-spacing: 100;\n }\n \n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n \n line-width: 1;\n \n [zoom > 17] { line-width: 15; }\n [zoom = 17] { line-width: 10; }\n [zoom = 16] { line-width: 5; }\n [zoom = 15] { line-width: 2.25; }\n [zoom = 14] { line-width: 1.5; }\n [zoom = 13] { line-width: 1; }\n [zoom = 12] { line-width: 0.5; }\n \n ::bridge[bridge='yes'] {\n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n \n [zoom > 17] { line-width: 20; }\n [zoom = 17] { line-width: 15; }\n [zoom = 16] { line-width: 7; }\n [zoom = 15] { line-width: 3; }\n [zoom = 14] { line-width: 2; }\n [zoom = 13] { line-width: 1.5; }\n [zoom = 12] { line-width: 0.75; }\n }\n \n}\n\n.highway#footway[zoom > 9] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n \n line-color: #FF0000;\n line-dasharray: 2,2;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom < 17] { line-width: 1.5; line-dasharray: 1,2 }\n \n [footway='sidewalk']{\n line-color: #0000FF;\n }\n \n [highway='steps']{\n line-cap: butt;\n \n [zoom > 18] { line-dasharray: 3,4 }\n [zoom = 18] { line-dasharray: 2,3 }\n [zoom < 18] { line-dasharray: 1,2 }\n }\n \n}\n\n.highway#path[zoom > 9] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n line-color: #000000;\n line-dasharray: 2,2;\n line-opacity: 1.0;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom < 17] { line-width: 1.5; line-dasharray: 1,2 }\n \n}\n\n.highway#track[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 16 }\n [zoom = 18] { line-width: 10 }\n [zoom = 17] { line-width: 6 }\n [zoom = 16] { line-width: 4.5 }\n [zoom = 15] { line-width: 3.2 }\n [zoom = 14] { line-width: 3 }\n [zoom = 13] { line-width: 2.4 }\n }\n \n line-color: #6d4f15;\n line-opacity: 1.0;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 3,4 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 3,4 }\n [zoom = 16] { line-width: 2.1; line-dasharray: 3,4 }\n [zoom = 15] { line-width: 1.8; line-dasharray: 3,4 }\n [zoom = 14] { line-width: 1.5; line-dasharray: 3,4 }\n [zoom = 13] { line-width: 1.2 ; line-dasharray: 3,4 }\n\n}\n\n.highway#cycleway[zoom > 9] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n \n line-color: #0900ff;\n line-dasharray: 2,2;\n line-opacity: 1.0;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom < 17] { line-width: 1.5; line-dasharray: 1,2 }\n\n}\n\n.road#service[zoom > 11] {\n [zoom > 17] { line-width: 7.5; }\n [zoom = 17] { line-width: 5; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 1; }\n [zoom = 14] { line-width: 0.75; }\n [zoom = 13] { line-width: 0.5; }\n [zoom = 12] { line-width: 0.25; }\n \n [service='parking_aisle'][zoom > 14] {\n [zoom > 17] { line-width: 3; }\n [zoom = 17] { line-width: 2.5; }\n [zoom = 16] { line-width: 1.25; }\n [zoom = 15] { line-width: 0.25; }\n }\n}\n\n#turning-circle[zoom > 11] {\n marker-type: ellipse;\n marker-placement: point;\n \n marker-fill: #000000;\n marker-opacity: 0.5;\n marker-line-width: 0;\n \n [zoom > 17] { marker-width: 10; }\n [zoom = 17] { marker-width: 7.5; }\n [zoom = 16] { marker-width: 3.5; }\n [zoom = 15] { marker-width: 1.75; }\n [zoom = 14] { marker-width: 1; }\n [zoom = 13] { marker-width: 0.75; }\n [zoom = 12] { marker-width: 0.3; }\n}\n\n.road#residential[zoom > 11] {\n [highway='living_street'] {\n line-color: #76d276;\n }\n \n [zoom > 17] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n \n}\n\n.road#unclassified{\n}\n\n.road#tertiary{\n line-color: #faf555;\n}\n\n.road#secondary{\n line-color: #d46833;\n}\n\n.road#primary{\n line-color: #cc3737;\n}\n\n.road#trunk{\n line-color: #243a7a;\n}\n\n.road#motorway{\n line-color: #7a2424;\n}","old_contents":"\n@path_halo_opacity: 0.7;\n@path_halo_colour: white;\n\n\/* highway labels *\/\n#highway-labels[highway='footway'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='cycleway'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='path'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='track'][zoom > 13] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n#highway-labels[highway='service'][zoom > 16] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='residential'][zoom > 15] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='unclassified'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='tertiary'][zoom > 14] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='secondary'][zoom > 13] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='primary'][zoom > 11] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='trunk'][zoom > 10] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='motorway'][zoom > 9] { \n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: line;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n \n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n\n.highway {\n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n \n line-width: 1;\n}\n\n.road[zoom > 11] {\n ::oneway_arrow[oneway='yes'] {\n marker-type: arrow;\n \n marker-width: 2;\n marker-line-width: 2;\n \n marker-opacity: 1.0;\n marker-line-opacity: 1.0;\n \n marker-fill: white;\n marker-line-color: white;\n \n marker-spacing: 100;\n }\n \n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n \n line-width: 1;\n \n [zoom > 17] { line-width: 15; }\n [zoom = 17] { line-width: 10; }\n [zoom = 16] { line-width: 5; }\n [zoom = 15] { line-width: 2.25; }\n [zoom = 14] { line-width: 1.5; }\n [zoom = 13] { line-width: 1; }\n [zoom = 12] { line-width: 0.5; }\n \n ::bridge[bridge='yes'] {\n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n \n [zoom > 17] { line-width: 20; }\n [zoom = 17] { line-width: 15; }\n [zoom = 16] { line-width: 7; }\n [zoom = 15] { line-width: 3; }\n [zoom = 14] { line-width: 2; }\n [zoom = 13] { line-width: 1.5; }\n [zoom = 12] { line-width: 0.75; }\n }\n \n}\n\n.highway#footway[zoom > 9] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n \n line-color: #FF0000;\n line-dasharray: 2,2;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom < 17] { line-width: 1.5; line-dasharray: 1,2 }\n \n [footway='sidewalk']{\n line-color: #0000FF;\n }\n \n [highway='steps']{\n line-cap: butt;\n \n [zoom > 18] { line-dasharray: 3,4 }\n [zoom = 18] { line-dasharray: 2,3 }\n [zoom < 18] { line-dasharray: 1,2 }\n }\n \n}\n\n.highway#path[zoom > 9] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n line-color: #000000;\n line-dasharray: 2,2;\n line-opacity: 1.0;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom < 17] { line-width: 1.5; line-dasharray: 1,2 }\n \n}\n\n.highway#track[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 16 }\n [zoom = 18] { line-width: 10 }\n [zoom = 17] { line-width: 6 }\n [zoom = 16] { line-width: 4.5 }\n [zoom = 15] { line-width: 3.2 }\n [zoom = 14] { line-width: 3 }\n [zoom = 13] { line-width: 2.4 }\n }\n \n line-color: #6d4f15;\n line-opacity: 1.0;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 3,4 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 3,4 }\n [zoom = 16] { line-width: 2.1; line-dasharray: 3,4 }\n [zoom = 15] { line-width: 1.8; line-dasharray: 3,4 }\n [zoom = 14] { line-width: 1.5; line-dasharray: 3,4 }\n [zoom = 13] { line-width: 1.2 ; line-dasharray: 3,4 }\n\n}\n\n.highway#cycleway[zoom > 9] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n \n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n \n line-color: #0900ff;\n line-dasharray: 2,2;\n line-opacity: 1.0;\n \n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom < 17] { line-width: 1.5; line-dasharray: 1,2 }\n\n}\n\n.road#service[zoom > 11] {\n [zoom > 17] { line-width: 7.5; }\n [zoom = 17] { line-width: 5; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 1; }\n [zoom = 14] { line-width: 0.75; }\n [zoom = 13] { line-width: 0.5; }\n [zoom = 12] { line-width: 0.25; }\n \n [service='parking_aisle'][zoom > 14] {\n [zoom > 17] { line-width: 3; }\n [zoom = 17] { line-width: 2.5; }\n [zoom = 16] { line-width: 1.25; }\n [zoom = 15] { line-width: 0.25; }\n }\n}\n\n#turning-circle[zoom > 11] {\n marker-type: ellipse;\n marker-placement: point;\n \n marker-fill: #000000;\n marker-opacity: 0.5;\n marker-line-width: 0;\n \n [zoom > 17] { marker-width: 10; }\n [zoom = 17] { marker-width: 7.5; }\n [zoom = 16] { marker-width: 3.5; }\n [zoom = 15] { marker-width: 1.75; }\n [zoom = 14] { marker-width: 1; }\n [zoom = 13] { marker-width: 0.75; }\n [zoom = 12] { marker-width: 0.3; }\n}\n\n.road#residential[zoom > 11] {\n [highway='living_street'] {\n line-color: #76d276;\n }\n \n [zoom > 17] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n \n}\n\n.road#unclassified{\n}\n\n.road#tertiary{\n line-color: #faf555;\n}\n\n.road#secondary{\n line-color: #d46833;\n}\n\n.road#primary{\n line-color: #cc3737;\n}\n\n.road#trunk{\n line-color: #243a7a;\n}\n\n.road#motorway{\n line-color: #7a2424;\n}","returncode":0,"stderr":"","license":"cc0-1.0","lang":"CartoCSS"} {"commit":"68f51640ab6709a60ae6a1c33f3a8e26dddaf545","subject":"rework country & state labels for v6","message":"rework country & state labels for v6\n","repos":"mapbox\/mapbox-studio-streets-basic.tm2,mapbox\/mapbox-studio-streets-basic.tm2","old_file":"label.mss","new_file":"label.mss","new_contents":"\/\/ LABEL.MSS CONTENTS:\n\/\/ 1__ Ocean & Marine Labels\n\/\/ 2__ Place Names\n\/\/ 2_1__ Countries\n\/\/ 2_2__ States\n\/\/ 2_3__ Cities\n\/\/ 2_4__ Towns\n\/\/ 2_5__ Villages\n\/\/ 2_6__ Suburbs\n\/\/ 2_7__ Neighbourhoods & Hamlets\n\/\/ 4__ Water Labels \n\/\/ 5__ Road Labels\n\n\/\/ Font sets are defined in vars.mss\n\n\/\/ =====================================================================\n\/\/ 1__ OCEAN & MARINE LABELS\n\/\/ =====================================================================\n\n\n#marine_label[zoom>=2][\"mapnik::geometry_type\"=1],\n#marine_label[zoom>=2][\"mapnik::geometry_type\"=2] {\n text-name: @name;\n text-face-name: @sans_lt_italic;\n text-fill: lighten(@water,20);\n [\"mapnik::geometry_type\"=1] {\n text-placement: point;\n text-wrap-width: 30;\n }\n [\"mapnik::geometry_type\"=2] {\n text-placement: line;\n }\n [labelrank=1][zoom>=2],\n [labelrank=2][zoom>=3],\n [labelrank=3][zoom>=4],\n [labelrank=4][zoom>=5],\n [labelrank=5][zoom>=6],\n [labelrank=6][zoom>=7] {\n text-size: 13;\n text-character-spacing: 1;\n }\n [labelrank=1][zoom>=3],\n [labelrank=2][zoom>=4],\n [labelrank=3][zoom>=5],\n [labelrank=4][zoom>=6],\n [labelrank=5][zoom>=7],\n [labelrank=6][zoom>=8] {\n text-size: 16;\n text-character-spacing: 2;\n }\n [labelrank=1][zoom>=4],\n [labelrank=2][zoom>=5],\n [labelrank=3][zoom>=6] {\n text-size: 20;\n text-character-spacing: 4;\n }\n [labelrank=1][zoom>=5],\n [labelrank=2][zoom>=6],\n [labelrank=3][zoom>=7] {\n text-size: 24;\n text-character-spacing: 8;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ 2__ PLACE NAMES\n\/\/ =====================================================================\n\n\/\/ 2_1__ Countries _____________________________________________________\n\n#country_label[zoom>=2][zoom<=10] {\n text-name: @name;\n text-face-name: @sans_bold;\n [zoom=2] { text-face-name: @sans; }\n text-placement: point;\n text-size: 9;\n text-fill: @country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-wrap-width: 20;\n text-wrap-before: true;\n text-line-spacing: -3;\n [scalerank=1] {\n [zoom=3] { text-size: 13; text-wrap-width: 60; }\n [zoom=4] { text-size: 14; text-wrap-width: 90; }\n [zoom=5] { text-size: 20; text-wrap-width: 120; }\n [zoom>=6] { text-size: 20; text-wrap-width: 120; }\n }\n [scalerank=2] {\n [zoom=2] { text-name: [abbr]; }\n [zoom=3] { text-size: 12; }\n [zoom=4] { text-size: 13; }\n [zoom=5] { text-size: 17; }\n [zoom>=6] { text-size: 20; }\n }\n [scalerank=3] {\n [zoom=3] { text-name: [abbr]; }\n [zoom=4] { text-size: 11; }\n [zoom=5] { text-size: 15; }\n [zoom=6] { text-size: 17; }\n [zoom=7] { text-size: 18; text-wrap-width: 60; }\n [zoom>=8] { text-size: 20; text-wrap-width: 120; }\n }\n [scalerank=4] {\n [zoom=5] { text-size: 13; }\n [zoom=6] { text-size: 15; text-wrap-width: 60 }\n [zoom=7] { text-size: 16; text-wrap-width: 90; }\n [zoom=8] { text-size: 18; text-wrap-width: 120; }\n [zoom>=9] { text-size: 20; text-wrap-width: 120; }\n }\n [scalerank=5] {\n [zoom=5] { text-size: 11; }\n [zoom=6] { text-size: 13; }\n [zoom=7] { text-size: 14; text-wrap-width: 60; }\n [zoom=8] { text-size: 16; text-wrap-width: 90; }\n [zoom>=9] { text-size: 18; text-wrap-width: 120; }\n }\n [scalerank>=6] {\n [zoom=7] { text-size: 12; }\n [zoom=8] { text-size: 14; }\n [zoom>=9] { text-size: 16; }\n }\n}\n\n\n\/\/ 2_2__ States ________________________________________________________\n\n#state_label[zoom>=4][zoom<=10] {\n text-name: [abbr];\n text-face-name: @sans_lt;\n text-placement: point;\n text-fill: @state_text;\n text-halo-fill: fadeout(@land,50%);\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-size: 10;\n [zoom>=4][area>100000],\n [zoom>=5][area>50000],\n [zoom>=6][area>10000],\n [zoom>=7][area<=10000] {\n text-name: [abbr];\n }\n [zoom>=5][area>100000],\n [zoom>=6][area>50000],\n [zoom>=7][area>10000],\n [zoom>=8][area<=10000] {\n text-name: @name;\n }\n [zoom>=5][zoom<=6] {\n [area>10000] { text-size: 12; }\n [area>50000] { text-size: 14; }\n text-wrap-width: 40;\n }\n [zoom>=7][zoom<=8] {\n text-size: 14;\n [area>50000] { text-size: 16; text-character-spacing: 1; }\n [area>100000] { text-size: 18; text-character-spacing: 3; }\n text-wrap-width: 60;\n }\n [zoom>=9][zoom<=10] {\n text-halo-radius: 2;\n text-size: 16;\n text-character-spacing: 2;\n [area>50000] { text-size: 18; text-character-spacing: 2; }\n text-wrap-width: 100;\n }\n}\n\n\/\/ 2_3__ Cities ________________________________________________________\n\n\/\/ City labels with dots for low zoom levels.\n\/\/ The separate attachment keeps the size of the XML down.\n#place_label::citydots[zoom>=4][zoom<=7][localrank<=2] {\n \/\/ explicitly defining all the `ldir` values wer'e going\n \/\/ to use shaves a bit off the final project.xml size\n [ldir='N'],[ldir='S'],[ldir='E'],[ldir='W'],\n [ldir='NE'],[ldir='SE'],[ldir='SW'],[ldir='NW'] {\n shield-file: url(\"img\/icon\/dot-small.png\");\n shield-unlock-image: true;\n shield-name: @name;\n shield-face-name: @sans;\n shield-placement: point;\n shield-fill: @city_text;\n shield-halo-fill: #fff;\n shield-halo-radius: 1.5;\n shield-min-distance: 3;\n shield-wrap-width: 40;\n shield-line-spacing: -4;\n shield-size: 11;\n [zoom>=5] {\n [scalerank>=0][scalerank<=2] { shield-size: 13; }\n [scalerank>=3][scalerank<=5] { shield-size: 12; }\n }\n [zoom>=6] {\n [scalerank>=0][scalerank<=2] { shield-size: 14; }\n [scalerank>=3][scalerank<=5] { shield-size: 12; }\n }\n [zoom=7] {\n [scalerank>=0][scalerank<=2] { shield-size: 15; }\n [scalerank>=3][scalerank<=5] { shield-size: 13; }\n [scalerank>=6] { shield-size: 12; }\n }\n [ldir='E'] { shield-text-dx: 5; }\n [ldir='W'] { shield-text-dx: -5; }\n [ldir='N'] { shield-text-dy: -5; }\n [ldir='S'] { shield-text-dy: 8; }\n [ldir='NE'] { shield-text-dx: 4; shield-text-dy: -3; }\n [ldir='SE'] { shield-text-dx: 4; shield-text-dy: 5; }\n [ldir='SW'] { shield-text-dx: -4; shield-text-dy: 5; }\n [ldir='NW'] { shield-text-dx: -4; shield-text-dy: -3; }\n }\n}\n\n\/\/ For medium to high zoom levels we do away with the dot\n\/\/ and center place labels on their point location.\n#place_label[type='city'][zoom>=8][zoom<=15][localrank<=2] {\n text-name: @name;\n text-face-name: @sans;\n text-placement: point;\n text-fill: @city_text;\n text-halo-fill: #fff;\n text-halo-radius: 2;\n text-halo-rasterizer: fast;\n text-wrap-width: 40;\n text-line-spacing: -4;\n \/\/ We keep the scalerank filters the same for each zoom level.\n \/\/ This is slightly inefficient-looking CartoCSS, but it saves\n \/\/ some space in the project.xml\n [zoom=8] {\n text-size: 13;\n text-wrap-width: 60;\n [scalerank>=0][scalerank<=1] { text-size: 18; }\n [scalerank>=2][scalerank<=3] { text-size: 16; }\n [scalerank>=4][scalerank<=5] { text-size: 15; }\n [scalerank>=6] { text-size: 13; }\n }\n [zoom=9] {\n text-size: 14;\n text-wrap-width: 60;\n [scalerank>=0][scalerank<=1] { text-size: 19; }\n [scalerank>=2][scalerank<=3] { text-size: 17; }\n [scalerank>=4][scalerank<=5] { text-size: 16; }\n [scalerank>=6] { text-size: 14; }\n }\n [zoom=10] {\n text-size: 15;\n text-wrap-width: 70;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 17; }\n [scalerank>=6] { text-size: 15; }\n }\n [zoom=11] {\n text-size: 16;\n text-wrap-width: 80;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 17; }\n [scalerank>=6] { text-size: 16; }\n }\n [zoom=12] {\n text-size: 17;\n text-wrap-width: 100;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 18; }\n [scalerank>=6] { text-size: 17; }\n }\n [zoom=13] {\n text-size: 18;\n text-wrap-width: 200;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 19; }\n [scalerank>=6] { text-size: 17; }\n }\n [zoom=14] {\n text-fill: lighten(@city_text,10);\n text-size: 19;\n text-wrap-width: 300;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 20; }\n [scalerank>=4][scalerank<=5] { text-size: 19; }\n [scalerank>=6] { text-size: 18; }\n }\n [zoom=15] {\n text-fill: lighten(@city_text,10);\n text-size: 20;\n text-wrap-width: 400;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 20; }\n [scalerank>=4][scalerank<=5] { text-size: 20; }\n [scalerank>=6] { text-size: 19; }\n }\n}\n\n\/\/ 2_4__ Towns _________________________________________________________\n\n#place_label[type='town'][zoom>=8][zoom<=17][localrank<=2] {\n text-name: @name;\n text-face-name: @sans;\n text-placement: point;\n text-fill: @town_text;\n text-halo-fill: @town_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-wrap-width: 75;\n text-wrap-before: true;\n text-line-spacing: -4;\n text-size: 11;\n [zoom>=8] { text-size: 12; }\n [zoom>=10] { text-size: 13; text-halo-radius: 2; }\n [zoom>=11] { text-size: 14; }\n [zoom>=12] { text-size: 15; text-wrap-width: 80; }\n [zoom>=13] { text-size: 16; text-wrap-width: 120; }\n [zoom>=14] { text-size: 18; text-wrap-width: 160; }\n [zoom>=15] { text-size: 20; text-wrap-width: 200; }\n [zoom>=16] { text-size: 22; text-wrap-width: 240; }\n}\n\n\/\/ 2_5 Villages ______________________________________________________\n\n#place_label[type='village'][zoom>=10][zoom<=14][localrank<=2],\n#place_label[type='village'][zoom>=15][zoom<=17] {\n text-name: @name;\n text-face-name: @sans;\n text-placement: point;\n text-fill: @town_text;\n text-size: 11;\n text-halo-fill: @town_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-wrap-width: 60;\n text-wrap-before: true;\n text-line-spacing: -4;\n [zoom>=12] { text-size: 12; }\n [zoom>=13] { text-wrap-width: 80; }\n [zoom>=14] { text-size: 14; text-wrap-width: 100; }\n [zoom>=15] { text-size: 16; text-wrap-width: 120; }\n [zoom>=16] { text-size: 18; text-wrap-width: 160; }\n [zoom=17] { text-size: 20; text-wrap-width: 200; }\n}\n\n\/\/ 2_6__ Suburbs _______________________________________________________\n\n#place_label[type='suburb'][zoom>=12][zoom<=14][localrank<=1],\n#place_label[type='suburb'][zoom>=15][zoom<=18] {\n text-name: @name;\n text-face-name: @sans_lt;\n text-placement: point;\n text-fill: @other_text;\n text-size: 11;\n text-halo-fill: @other_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-wrap-width: 60;\n text-wrap-before: true;\n text-line-spacing: -2;\n [zoom>=13] { text-size: 12; text-min-distance: 20; }\n [zoom>=14] { text-size: 13; text-wrap-width: 80; }\n [zoom>=15] { text-size: 14; text-wrap-width: 120; }\n [zoom>=16] { text-size: 16; text-wrap-width: 160; }\n [zoom>=17] { text-size: 20; text-wrap-width: 200; }\n}\n\n\/\/ 2_7__ Neighbourhoods & Hamlets ______________________________________\n\n#place_label[zoom>=13][zoom<=14][localrank<=1],\n#place_label[zoom>=15][zoom<=18] {\n [type='hamlet'],\n [type='neighbourhood'] {\n text-name: @name;\n text-face-name: @sans_lt;\n text-placement: point;\n text-fill: @other_text;\n text-size: 11;\n text-halo-fill: @other_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-wrap-width: 60;\n text-wrap-before: true;\n text-line-spacing: -2;\n [zoom>=14] { text-size: 12; text-wrap-width: 80; }\n [zoom>=16] { text-size: 14; text-wrap-width: 100; }\n [zoom>=17] { text-size: 16; text-wrap-width: 130; }\n [zoom>=18] { text-size: 18; text-wrap-width: 160; }\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ 4__ WATER LABELS\n\/\/ =====================================================================\n\n#water_label {\n [zoom<=15][area>200000],\n [zoom=16][area>50000],\n [zoom=17][area>10000],\n [zoom>=18][area>0]{\n text-name: @name;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-size: 11;\n text-wrap-width: 50;\n text-wrap-before: true;\n text-halo-fill: #fff;\n text-line-spacing: -2;\n text-face-name: @sans_italic;\n text-fill: @water * 0.75;\n }\n [zoom>=14][area>3200000],\n [zoom>=15][area>800000],\n [zoom>=16][area>200000],\n [zoom>=17][area>50000],\n [zoom>=18][area>10000] {\n text-size: 12;\n text-wrap-width: 75;\n }\n [zoom>=15][area>3200000],\n [zoom>=16][area>800000],\n [zoom>=17][area>200000],\n [zoom>=18][area>50000] {\n text-size: 14;\n text-wrap-width: 100;\n text-halo-radius: 2;\n }\n [zoom>=16][area>3200000],\n [zoom>=17][area>800000],\n [zoom>=18][area>200000] {\n text-size: 16;\n text-wrap-width: 125;\n }\n [zoom>=17][area>3200000],\n [zoom>=18][area>800000] {\n text-size: 18;\n text-wrap-width: 150;\n }\n}\n\n#waterway_label[class='river'][zoom>=13],\n#waterway_label[class='canal'][zoom>=15],\n#waterway_label[class='stream'][zoom>=17],\n#waterway_label[class='stream_intermittent'][zoom>=17] {\n text-avoid-edges: true;\n text-name: @name;\n text-face-name: @sans_italic;\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(#fff,80%);\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-placement: line;\n text-size: 10;\n text-character-spacing: 1;\n [class='river'][zoom=14],\n [class='canal'][zoom=16],\n [class='stream'][zoom>=18],\n [class='stream_intermittent'][zoom>=18] {\n text-size: 10;\n }\n [class='river'][zoom=15],\n [class='canal'][zoom>=17] {\n text-size: 11;\n }\n [class='river'][zoom>=16],\n [class='canal'][zoom>=18] {\n text-size: 14;\n text-spacing: 300;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ 5__ ROAD LABELS\n\/\/ =====================================================================\n\n\/\/ highway shield\n#road_label::shield-pt[zoom<=10][localrank=1],\n#road_label::shield-ln[zoom>=11] {\n shield-name: \"[ref].replace('\u00b7', '\\n')\";\n shield-size: 9;\n shield-line-spacing: -4;\n shield-file: url('img\/shield\/[shield]-[reflen].svg');\n shield-face-name: @sans;\n shield-fill: #333;\n [zoom>=14] {\n shield-transform: scale(1.25,1.25);\n shield-size: 11;\n }\n}\n#road_label::shield-pt[zoom<=10][localrank=1] {\n shield-placement: point;\n shield-avoid-edges: false;\n}\n#road_label::shield-ln[zoom>=11] {\n shield-placement: line;\n shield-spacing: 400;\n shield-min-distance: 40;\n shield-avoid-edges: true;\n [zoom>=14] {\n shield-min-distance: 100;\n }\n}\n\n\/\/ regular labels\n#road_label['mapnik::geometry_type'=2] {\n \/\/ Longer roads get a label earlier as they are likely to be more\n \/\/ important. This especially helps label density in rural\/remote areas.\n \/\/ This z14 filter is *not* redundant to logic in SQL queries. Because z14\n \/\/ includes all data for z14+ via overzooming, the streets included in a\n \/\/ z14 vector tile include more features than ideal for optimal performance.\n [class='motorway'][zoom>=12],\n [class='main'][zoom>=12],\n [class='street'][zoom<=14][len>2500],\n [class='street'][zoom>=15],\n [class='street_limited'] {\n text-avoid-edges: true;\n text-transform: uppercase;\n text-name: @name;\n text-character-spacing: 0.25;\n text-placement: line;\n text-face-name: @sans;\n text-fill: #444;\n text-size: 8;\n text-halo-fill: @road_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-min-distance: 200; \/\/ only for labels w\/ the same name\n [zoom>=14] { text-size: 9; }\n [zoom>=16] { text-size: 11; }\n [zoom>=18] { text-size: 12; }\n [class='motorway'],\n [class='main'] {\n [zoom>=14] { text-size: 10; }\n [zoom>=16] { text-size: 11; text-face-name: @sans_bold; }\n [zoom>=17] { text-size: 12; }\n [zoom>=18] { text-size: 14; }\n }\n }\n}\n\n\/\/ less prominent labels for all other types, by length\n#road_label['mapnik::geometry_type'=2]\n[class!='motorway']\n[class!='main']\n[class!='street']\n[class!='street_limited'] {\n [len>10000][zoom>=12],\n [len>5000][zoom>=13],\n [len>2500][zoom>=14],\n [len>1200][zoom>=15],\n [len>0][zoom>=16] {\n text-avoid-edges: true;\n text-name: @name;\n text-character-spacing: 0.25;\n text-placement: line;\n text-face-name: @sans;\n text-fill: #666;\n text-size: 9;\n text-halo-fill: @road_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-min-distance: 200; \/\/ only for labels w\/ the same name\n [zoom>=17] { text-size: 10; }\n [zoom>=18] { text-size: 11; }\n }\n}\n\n\/\/ =====================================================================\n\/\/ ADDRESS LABELS\n\/\/ =====================================================================\n\n#housenum_label[zoom>=18] {\n text-name:'[house_num]';\n text-face-name: @sans_lt_italic;\n text-fill: darken(@building, 20%);\n text-wrap-width: 50;\n text-wrap-before: true;\n text-placement:point;\n text-size: 9;\n [zoom>=19] {\n text-size: 11;\n text-character-spacing: -0.5;\n }\n}\n\n\n\/**\/\n","old_contents":"\/\/ LABEL.MSS CONTENTS:\n\/\/ 1__ Ocean & Marine Labels\n\/\/ 2__ Place Names\n\/\/ 2_1__ Countries\n\/\/ 2_2__ States\n\/\/ 2_3__ Cities\n\/\/ 2_4__ Towns\n\/\/ 2_5__ Villages\n\/\/ 2_6__ Suburbs\n\/\/ 2_7__ Neighbourhoods & Hamlets\n\/\/ 4__ Water Labels \n\/\/ 5__ Road Labels\n\n\/\/ Font sets are defined in vars.mss\n\n\/\/ =====================================================================\n\/\/ 1__ OCEAN & MARINE LABELS\n\/\/ =====================================================================\n\n\n#marine_label[zoom>=2][\"mapnik::geometry_type\"=1],\n#marine_label[zoom>=2][\"mapnik::geometry_type\"=2] {\n text-name: @name;\n text-face-name: @sans_lt_italic;\n text-fill: lighten(@water,20);\n [\"mapnik::geometry_type\"=1] {\n text-placement: point;\n text-wrap-width: 30;\n }\n [\"mapnik::geometry_type\"=2] {\n text-placement: line;\n }\n [labelrank=1][zoom>=2],\n [labelrank=2][zoom>=3],\n [labelrank=3][zoom>=4],\n [labelrank=4][zoom>=5],\n [labelrank=5][zoom>=6],\n [labelrank=6][zoom>=7] {\n text-size: 13;\n text-character-spacing: 1;\n }\n [labelrank=1][zoom>=3],\n [labelrank=2][zoom>=4],\n [labelrank=3][zoom>=5],\n [labelrank=4][zoom>=6],\n [labelrank=5][zoom>=7],\n [labelrank=6][zoom>=8] {\n text-size: 16;\n text-character-spacing: 2;\n }\n [labelrank=1][zoom>=4],\n [labelrank=2][zoom>=5],\n [labelrank=3][zoom>=6] {\n text-size: 20;\n text-character-spacing: 4;\n }\n [labelrank=1][zoom>=5],\n [labelrank=2][zoom>=6],\n [labelrank=3][zoom>=7] {\n text-size: 24;\n text-character-spacing: 8;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ 2__ PLACE NAMES\n\/\/ =====================================================================\n\n\/\/ 2_1__ Countries _____________________________________________________\n\n#country_label_line {\n line-color: @admin_2;\n line-opacity: 0.8;\n line-width: 0.8;\n line-dasharray: 5,2;\n}\n\n#country_label[zoom<=10] {\n text-name: @name;\n text-face-name: @sans_bold;\n text-placement: point;\n [zoom=2] { text-opacity: 0.75; }\n text-size: 10;\n text-fill: @country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-wrap-width: 30;\n text-line-spacing: -2;\n [scalerank=1] {\n [zoom=2] { text-size: 12; text-wrap-width: 60; }\n [zoom=3] { text-size: 13; text-wrap-width: 60; }\n [zoom=4] { text-size: 14; text-wrap-width: 90; }\n [zoom=5] { text-size: 20; text-wrap-width: 120; }\n [zoom>=6] { text-size: 20; text-wrap-width: 120; }\n }\n [scalerank=2] {\n [zoom=3] { text-size: 12; }\n [zoom=4] { text-size: 13; }\n [zoom=5] { text-size: 17; }\n [zoom>=6] { text-size: 20; }\n }\n [scalerank=3] {\n [zoom=4] { text-size: 11; }\n [zoom=5] { text-size: 15; }\n [zoom=6] { text-size: 17; }\n [zoom=7] { text-size: 18; text-wrap-width: 60; }\n [zoom>=8] { text-size: 20; text-wrap-width: 120; }\n }\n [scalerank=4] {\n [zoom=5] { text-size: 13; }\n [zoom=6] { text-size: 15; text-wrap-width: 60 }\n [zoom=7] { text-size: 16; text-wrap-width: 90; }\n [zoom=8] { text-size: 18; text-wrap-width: 120; }\n [zoom>=9] { text-size: 20; text-wrap-width: 120; }\n }\n [scalerank=5] {\n [zoom=5] { text-size: 12; }\n [zoom=6] { text-size: 13; }\n [zoom=7] { text-size: 14; text-wrap-width: 60; }\n [zoom=8] { text-size: 16; text-wrap-width: 90; }\n [zoom>=9] { text-size: 18; text-wrap-width: 120; }\n }\n [scalerank>=6] {\n [zoom=6] { text-size: 11; }\n [zoom=7] { text-size: 12; }\n [zoom=8] { text-size: 14; }\n [zoom>=9] { text-size: 16; }\n }\n}\n\n\n\/\/ 2_2__ States ________________________________________________________\n\n#state_label[zoom>=4][zoom<=10] {\n text-name: @name;\n text-face-name: @sans_lt;\n text-placement: point;\n text-fill: @state_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-size: 10;\n [zoom>=5][zoom<=6] {\n [area>10000] { text-size: 12; }\n [area>50000] { text-size: 14; }\n text-wrap-width: 40;\n }\n [zoom>=7][zoom<=8] {\n text-size: 14;\n [area>50000] { text-size: 16; text-character-spacing: 1; }\n [area>100000] { text-size: 18; text-character-spacing: 3; }\n text-wrap-width: 60;\n }\n [zoom>=9][zoom<=10] {\n text-halo-radius: 2;\n text-size: 16;\n text-character-spacing: 2;\n [area>50000] { text-size: 18; text-character-spacing: 2; }\n text-wrap-width: 100;\n }\n}\n\n\/\/ 2_3__ Cities ________________________________________________________\n\n\/\/ City labels with dots for low zoom levels.\n\/\/ The separate attachment keeps the size of the XML down.\n#place_label::citydots[zoom>=4][zoom<=7][localrank<=2] {\n \/\/ explicitly defining all the `ldir` values wer'e going\n \/\/ to use shaves a bit off the final project.xml size\n [ldir='N'],[ldir='S'],[ldir='E'],[ldir='W'],\n [ldir='NE'],[ldir='SE'],[ldir='SW'],[ldir='NW'] {\n shield-file: url(\"img\/icon\/dot-small.png\");\n shield-unlock-image: true;\n shield-name: @name;\n shield-face-name: @sans;\n shield-placement: point;\n shield-fill: @city_text;\n shield-halo-fill: #fff;\n shield-halo-radius: 1.5;\n shield-min-distance: 3;\n shield-wrap-width: 40;\n shield-line-spacing: -4;\n shield-size: 11;\n [zoom>=5] {\n [scalerank>=0][scalerank<=2] { shield-size: 13; }\n [scalerank>=3][scalerank<=5] { shield-size: 12; }\n }\n [zoom>=6] {\n [scalerank>=0][scalerank<=2] { shield-size: 14; }\n [scalerank>=3][scalerank<=5] { shield-size: 12; }\n }\n [zoom=7] {\n [scalerank>=0][scalerank<=2] { shield-size: 15; }\n [scalerank>=3][scalerank<=5] { shield-size: 13; }\n [scalerank>=6] { shield-size: 12; }\n }\n [ldir='E'] { shield-text-dx: 5; }\n [ldir='W'] { shield-text-dx: -5; }\n [ldir='N'] { shield-text-dy: -5; }\n [ldir='S'] { shield-text-dy: 8; }\n [ldir='NE'] { shield-text-dx: 4; shield-text-dy: -3; }\n [ldir='SE'] { shield-text-dx: 4; shield-text-dy: 5; }\n [ldir='SW'] { shield-text-dx: -4; shield-text-dy: 5; }\n [ldir='NW'] { shield-text-dx: -4; shield-text-dy: -3; }\n }\n}\n\n\/\/ For medium to high zoom levels we do away with the dot\n\/\/ and center place labels on their point location.\n#place_label[type='city'][zoom>=8][zoom<=15][localrank<=2] {\n text-name: @name;\n text-face-name: @sans;\n text-placement: point;\n text-fill: @city_text;\n text-halo-fill: #fff;\n text-halo-radius: 2;\n text-halo-rasterizer: fast;\n text-wrap-width: 40;\n text-line-spacing: -4;\n \/\/ We keep the scalerank filters the same for each zoom level.\n \/\/ This is slightly inefficient-looking CartoCSS, but it saves\n \/\/ some space in the project.xml\n [zoom=8] {\n text-size: 13;\n text-wrap-width: 60;\n [scalerank>=0][scalerank<=1] { text-size: 18; }\n [scalerank>=2][scalerank<=3] { text-size: 16; }\n [scalerank>=4][scalerank<=5] { text-size: 15; }\n [scalerank>=6] { text-size: 13; }\n }\n [zoom=9] {\n text-size: 14;\n text-wrap-width: 60;\n [scalerank>=0][scalerank<=1] { text-size: 19; }\n [scalerank>=2][scalerank<=3] { text-size: 17; }\n [scalerank>=4][scalerank<=5] { text-size: 16; }\n [scalerank>=6] { text-size: 14; }\n }\n [zoom=10] {\n text-size: 15;\n text-wrap-width: 70;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 17; }\n [scalerank>=6] { text-size: 15; }\n }\n [zoom=11] {\n text-size: 16;\n text-wrap-width: 80;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 17; }\n [scalerank>=6] { text-size: 16; }\n }\n [zoom=12] {\n text-size: 17;\n text-wrap-width: 100;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 18; }\n [scalerank>=6] { text-size: 17; }\n }\n [zoom=13] {\n text-size: 18;\n text-wrap-width: 200;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 19; }\n [scalerank>=6] { text-size: 17; }\n }\n [zoom=14] {\n text-fill: lighten(@city_text,10);\n text-size: 19;\n text-wrap-width: 300;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 20; }\n [scalerank>=4][scalerank<=5] { text-size: 19; }\n [scalerank>=6] { text-size: 18; }\n }\n [zoom=15] {\n text-fill: lighten(@city_text,10);\n text-size: 20;\n text-wrap-width: 400;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 20; }\n [scalerank>=4][scalerank<=5] { text-size: 20; }\n [scalerank>=6] { text-size: 19; }\n }\n}\n\n\/\/ 2_4__ Towns _________________________________________________________\n\n#place_label[type='town'][zoom>=8][zoom<=17][localrank<=2] {\n text-name: @name;\n text-face-name: @sans;\n text-placement: point;\n text-fill: @town_text;\n text-halo-fill: @town_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-wrap-width: 75;\n text-wrap-before: true;\n text-line-spacing: -4;\n text-size: 11;\n [zoom>=8] { text-size: 12; }\n [zoom>=10] { text-size: 13; text-halo-radius: 2; }\n [zoom>=11] { text-size: 14; }\n [zoom>=12] { text-size: 15; text-wrap-width: 80; }\n [zoom>=13] { text-size: 16; text-wrap-width: 120; }\n [zoom>=14] { text-size: 18; text-wrap-width: 160; }\n [zoom>=15] { text-size: 20; text-wrap-width: 200; }\n [zoom>=16] { text-size: 22; text-wrap-width: 240; }\n}\n\n\/\/ 2_5 Villages ______________________________________________________\n\n#place_label[type='village'][zoom>=10][zoom<=14][localrank<=2],\n#place_label[type='village'][zoom>=15][zoom<=17] {\n text-name: @name;\n text-face-name: @sans;\n text-placement: point;\n text-fill: @town_text;\n text-size: 11;\n text-halo-fill: @town_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-wrap-width: 60;\n text-wrap-before: true;\n text-line-spacing: -4;\n [zoom>=12] { text-size: 12; }\n [zoom>=13] { text-wrap-width: 80; }\n [zoom>=14] { text-size: 14; text-wrap-width: 100; }\n [zoom>=15] { text-size: 16; text-wrap-width: 120; }\n [zoom>=16] { text-size: 18; text-wrap-width: 160; }\n [zoom=17] { text-size: 20; text-wrap-width: 200; }\n}\n\n\/\/ 2_6__ Suburbs _______________________________________________________\n\n#place_label[type='suburb'][zoom>=12][zoom<=14][localrank<=1],\n#place_label[type='suburb'][zoom>=15][zoom<=18] {\n text-name: @name;\n text-face-name: @sans_lt;\n text-placement: point;\n text-fill: @other_text;\n text-size: 11;\n text-halo-fill: @other_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-wrap-width: 60;\n text-wrap-before: true;\n text-line-spacing: -2;\n [zoom>=13] { text-size: 12; text-min-distance: 20; }\n [zoom>=14] { text-size: 13; text-wrap-width: 80; }\n [zoom>=15] { text-size: 14; text-wrap-width: 120; }\n [zoom>=16] { text-size: 16; text-wrap-width: 160; }\n [zoom>=17] { text-size: 20; text-wrap-width: 200; }\n}\n\n\/\/ 2_7__ Neighbourhoods & Hamlets ______________________________________\n\n#place_label[zoom>=13][zoom<=14][localrank<=1],\n#place_label[zoom>=15][zoom<=18] {\n [type='hamlet'],\n [type='neighbourhood'] {\n text-name: @name;\n text-face-name: @sans_lt;\n text-placement: point;\n text-fill: @other_text;\n text-size: 11;\n text-halo-fill: @other_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-wrap-width: 60;\n text-wrap-before: true;\n text-line-spacing: -2;\n [zoom>=14] { text-size: 12; text-wrap-width: 80; }\n [zoom>=16] { text-size: 14; text-wrap-width: 100; }\n [zoom>=17] { text-size: 16; text-wrap-width: 130; }\n [zoom>=18] { text-size: 18; text-wrap-width: 160; }\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ 4__ WATER LABELS\n\/\/ =====================================================================\n\n#water_label {\n [zoom<=15][area>200000],\n [zoom=16][area>50000],\n [zoom=17][area>10000],\n [zoom>=18][area>0]{\n text-name: @name;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-size: 11;\n text-wrap-width: 50;\n text-wrap-before: true;\n text-halo-fill: #fff;\n text-line-spacing: -2;\n text-face-name: @sans_italic;\n text-fill: @water * 0.75;\n }\n [zoom>=14][area>3200000],\n [zoom>=15][area>800000],\n [zoom>=16][area>200000],\n [zoom>=17][area>50000],\n [zoom>=18][area>10000] {\n text-size: 12;\n text-wrap-width: 75;\n }\n [zoom>=15][area>3200000],\n [zoom>=16][area>800000],\n [zoom>=17][area>200000],\n [zoom>=18][area>50000] {\n text-size: 14;\n text-wrap-width: 100;\n text-halo-radius: 2;\n }\n [zoom>=16][area>3200000],\n [zoom>=17][area>800000],\n [zoom>=18][area>200000] {\n text-size: 16;\n text-wrap-width: 125;\n }\n [zoom>=17][area>3200000],\n [zoom>=18][area>800000] {\n text-size: 18;\n text-wrap-width: 150;\n }\n}\n\n#waterway_label[class='river'][zoom>=13],\n#waterway_label[class='canal'][zoom>=15],\n#waterway_label[class='stream'][zoom>=17],\n#waterway_label[class='stream_intermittent'][zoom>=17] {\n text-avoid-edges: true;\n text-name: @name;\n text-face-name: @sans_italic;\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(#fff,80%);\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-placement: line;\n text-size: 10;\n text-character-spacing: 1;\n [class='river'][zoom=14],\n [class='canal'][zoom=16],\n [class='stream'][zoom>=18],\n [class='stream_intermittent'][zoom>=18] {\n text-size: 10;\n }\n [class='river'][zoom=15],\n [class='canal'][zoom>=17] {\n text-size: 11;\n }\n [class='river'][zoom>=16],\n [class='canal'][zoom>=18] {\n text-size: 14;\n text-spacing: 300;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ 5__ ROAD LABELS\n\/\/ =====================================================================\n\n\/\/ highway shield\n#road_label::shield-pt[zoom<=10][localrank=1],\n#road_label::shield-ln[zoom>=11] {\n shield-name: \"[ref].replace('\u00b7', '\\n')\";\n shield-size: 9;\n shield-line-spacing: -4;\n shield-file: url('img\/shield\/[shield]-[reflen].svg');\n shield-face-name: @sans;\n shield-fill: #333;\n [zoom>=14] {\n shield-transform: scale(1.25,1.25);\n shield-size: 11;\n }\n}\n#road_label::shield-pt[zoom<=10][localrank=1] {\n shield-placement: point;\n shield-avoid-edges: false;\n}\n#road_label::shield-ln[zoom>=11] {\n shield-placement: line;\n shield-spacing: 400;\n shield-min-distance: 40;\n shield-avoid-edges: true;\n [zoom>=14] {\n shield-min-distance: 100;\n }\n}\n\n\/\/ regular labels\n#road_label['mapnik::geometry_type'=2] {\n \/\/ Longer roads get a label earlier as they are likely to be more\n \/\/ important. This especially helps label density in rural\/remote areas.\n \/\/ This z14 filter is *not* redundant to logic in SQL queries. Because z14\n \/\/ includes all data for z14+ via overzooming, the streets included in a\n \/\/ z14 vector tile include more features than ideal for optimal performance.\n [class='motorway'][zoom>=12],\n [class='main'][zoom>=12],\n [class='street'][zoom<=14][len>2500],\n [class='street'][zoom>=15],\n [class='street_limited'] {\n text-avoid-edges: true;\n text-transform: uppercase;\n text-name: @name;\n text-character-spacing: 0.25;\n text-placement: line;\n text-face-name: @sans;\n text-fill: #444;\n text-size: 8;\n text-halo-fill: @road_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-min-distance: 200; \/\/ only for labels w\/ the same name\n [zoom>=14] { text-size: 9; }\n [zoom>=16] { text-size: 11; }\n [zoom>=18] { text-size: 12; }\n [class='motorway'],\n [class='main'] {\n [zoom>=14] { text-size: 10; }\n [zoom>=16] { text-size: 11; text-face-name: @sans_bold; }\n [zoom>=17] { text-size: 12; }\n [zoom>=18] { text-size: 14; }\n }\n }\n}\n\n\/\/ less prominent labels for all other types, by length\n#road_label['mapnik::geometry_type'=2]\n[class!='motorway']\n[class!='main']\n[class!='street']\n[class!='street_limited'] {\n [len>10000][zoom>=12],\n [len>5000][zoom>=13],\n [len>2500][zoom>=14],\n [len>1200][zoom>=15],\n [len>0][zoom>=16] {\n text-avoid-edges: true;\n text-name: @name;\n text-character-spacing: 0.25;\n text-placement: line;\n text-face-name: @sans;\n text-fill: #666;\n text-size: 9;\n text-halo-fill: @road_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-min-distance: 200; \/\/ only for labels w\/ the same name\n [zoom>=17] { text-size: 10; }\n [zoom>=18] { text-size: 11; }\n }\n}\n\n\/\/ =====================================================================\n\/\/ ADDRESS LABELS\n\/\/ =====================================================================\n\n#housenum_label[zoom>=18] {\n text-name:'[house_num]';\n text-face-name: @sans_lt_italic;\n text-fill: darken(@building, 20%);\n text-wrap-width: 50;\n text-wrap-before: true;\n text-placement:point;\n text-size: 9;\n [zoom>=19] {\n text-size: 11;\n text-character-spacing: -0.5;\n }\n}\n\n\n\/**\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"de3f38d943630588ffe2126338525626c38bd092","subject":"noname comments","message":"noname comments\n","repos":"andrewharvey\/osm-debug-stylesheets,andrewharvey\/osm-debug-stylesheets,andrewharvey\/osm-debug-stylesheets","old_file":"noname\/noname.mss","new_file":"noname\/noname.mss","new_contents":"\/* \n * Author: Andrew Harvey \n * License: CC0 http:\/\/creativecommons.org\/publicdomain\/zero\/1.0\/\n * To the extent possible under law, the person who associated CC0\n * with this work has waived all copyright and related or neighboring\n * rights to this work.\n *\/\n \n#noname {\n \/* transparent red line where noname is present when we thing there should be one *\/\n line-color: red;\n line-opacity: 0.6;\n\n [zoom<11] { line-width: 2 }\n [zoom=11] { line-width: 2 }\n [zoom=12] { line-width: 2 }\n [zoom=13] { line-width: 2 }\n [zoom=14] { line-width: 4 }\n [zoom=15] { line-width: 4 }\n [zoom=16] { line-width: 6 }\n [zoom=17] { line-width: 7 }\n [zoom>17] { line-width: 12 }\n\n}\n\n\/* For all ways identifed as noname, we also render a dot on the way at low\n zooms. This makes it easier to see those very short ways. *\/\n#noname_dot[zoom < 15] {\n point-file: url('symbols\/red-dot-16.png');\n}\n\n","old_contents":"\/* \n * Author: Andrew Harvey \n * License: CC0 http:\/\/creativecommons.org\/publicdomain\/zero\/1.0\/\n * To the extent possible under law, the person who associated CC0\n * with this work has waived all copyright and related or neighboring\n * rights to this work.\n *\/\n \n#noname {\n \/* transparent red line where noname is present when we thing there should be one *\/\n line-color: red;\n line-opacity: 0.6;\n\n [zoom<11] { line-width: 2 }\n [zoom=11] { line-width: 2 }\n [zoom=12] { line-width: 2 }\n [zoom=13] { line-width: 2 }\n [zoom=14] { line-width: 4 }\n [zoom=15] { line-width: 4 }\n [zoom=16] { line-width: 6 }\n [zoom=17] { line-width: 7 }\n [zoom>17] { line-width: 12 }\n\n}\n\n#noname_dot[zoom < 15] {\n point-file: url('symbols\/red-dot-16.png');\n}\n\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"CartoCSS"} {"commit":"e01202b7dab4bc4686c64ab919ec52dadfc8a4b2","subject":"make line caps prettier in style","message":"make line caps prettier in style\n","repos":"pdxmele\/PDX-bike-map-public,pdxmele\/PDX-bike-map-public","old_file":"supporting_files\/style.mss","new_file":"supporting_files\/style.mss","new_contents":"Map {} \/* transparent background *\/\n\n\/* Bike routes on roadways *\/\n\n\/\/ designated bikeways, nothing else\n#data [\"bicycle\"='designated']{\n line-color:#00ffcc;\n line-width:10;\n opacity: .6;\n line-cap: round;\n [zoom = 16]{line-width:6;}\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;} \/\/ 12 and 13\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ bike lanes\n#data [\"cycleway\"='lane']{\n line-color:#2500ff;\n line-width:10;\n opacity: .6;\n line-cap: round;\n [zoom = 16]{line-width:6;}\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ sharrows\n#data [\"cycleway\"='shared_lane']{\n line-color:#01df23;\n line-width:10;\n opacity: .6;\n line-cap: round;\n [zoom = 16]{line-width:6;}\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ cycle tracks\n#data [\"cycleway\"='track']{\n line-color:#ff6cf0;\n line-width:10;\n opacity: .6;\n line-cap: round;\n [zoom = 16]{line-width:6;}\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ shared bus lanes\n#data [\"cycleway\"='share_busway']{\n line-color:#f99326;\n line-width:10;\n opacity: .6;\n line-cap: round;\n [zoom = 16]{line-width:6;}\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ RLIS caution area\n#data [\"RLIS:bicycle\"='caution_area']{\n line-color:#fa5324;\n line-width:10;\n opacity: .6;\n line-cap: round;\n [zoom = 16]{line-width:6;}\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ CCGIS caution area\n#data [\"CCGIS:bicycle\"='caution_area']{\n line-color:#fa5324;\n line-width:10;\n opacity: .6;\n line-cap: round;\n [zoom = 16]{line-width:6;}\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/* Separated routes *\/\n\n\/\/ general path\n#data [\"highway\"='path']{\n line-color:#d7008c;\n line-width:10;\n line-dasharray: 2,2,2;\n line-cap: butt;\n opacity: .6;\n [zoom > 15]{\n line-dasharray: 4,4,4;\n line-width:6;\n }\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ cycleway\n#data [\"highway\"='cycleway']{\n line-color:#d7008c;\n line-width:10;\n line-dasharray: 2,2,2;\n line-cap: butt;\n opacity: .6;\n [zoom > 15]{\n line-dasharray: 4,4,4;\n line-width:6;\n }\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ footways where bikes are designated or allowed\n#data [\"highway\"='footway'][\"bicycle\"='designated']{\n line-color:#d7008c;\n line-width:10;\n line-dasharray: 2,2,2;\n line-cap: butt;\n opacity: .6;\n [zoom > 15]{\n line-dasharray: 4,4,4;\n line-width:6;\n }\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n} \n#data [\"highway\"='footway'][\"bicycle\"='yes']{\n line-color:#d7008c;\n line-width:10;\n line-dasharray: 2,2,2;\n line-cap: butt;\n opacity: .6;\n [zoom > 15]{\n line-dasharray: 4,4,4;\n line-width:6;\n }\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}","old_contents":"Map {} \/* transparent background *\/\n\n\/* Bike routes on roadways *\/\n\n\/\/ designated bikeways, nothing else\n#data [\"bicycle\"='designated']{\n line-color:#00ffcc;\n line-width:10;\n opacity: .6;\n line-join:round;\n [zoom = 16]{line-width:6;}\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;} \/\/ 12 and 13\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ bike lanes\n#data [\"cycleway\"='lane']{\n line-color:#2500ff;\n line-width:10;\n opacity: .6;\n line-join:round;\n [zoom = 16]{line-width:6;}\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ sharrows\n#data [\"cycleway\"='shared_lane']{\n line-color:#01df23;\n line-width:10;\n opacity: .6;\n line-join:round;\n [zoom = 16]{line-width:6;}\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ cycle tracks\n#data [\"cycleway\"='track']{\n line-color:#ff6cf0;\n line-width:10;\n opacity: .6;\n line-join:round;\n [zoom = 16]{line-width:6;}\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ shared bus lanes\n#data [\"cycleway\"='share_busway']{\n line-color:#f99326;\n line-width:10;\n opacity: .6;\n line-join:round;\n [zoom = 16]{line-width:6;}\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ RLIS caution area\n#data [\"RLIS:bicycle\"='caution_area']{\n line-color:#fa5324;\n line-width:10;\n opacity: .6;\n line-join:round;\n [zoom = 16]{line-width:6;}\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ CCGIS caution area\n#data [\"CCGIS:bicycle\"='caution_area']{\n line-color:#fa5324;\n line-width:10;\n opacity: .6;\n line-join:round;\n [zoom = 16]{line-width:6;}\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/* Separated routes *\/\n\n\/\/ general path\n#data [\"highway\"='path']{\n line-color:#d7008c;\n line-width:10;\n line-dasharray: 2,2,2;\n opacity: .6;\n [zoom > 15]{\n line-dasharray: 4,4,4;\n line-width:6;\n }\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ cycleway\n#data [\"highway\"='cycleway']{\n line-color:#d7008c;\n line-width:10;\n line-dasharray: 2,2,2;\n opacity: .6;\n [zoom > 15]{\n line-dasharray: 4,4,4;\n line-width:6;\n }\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n\n\/\/ footways where bikes are designated or allowed\n#data [\"highway\"='footway'][\"bicycle\"='designated']{\n line-color:#d7008c;\n line-width:10;\n line-dasharray: 2,2,2;\n opacity: .6;\n [zoom > 15]{\n line-dasharray: 4,4,4;\n line-width:6;\n }\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n} \n#data [\"highway\"='footway'][\"bicycle\"='yes']{\n line-color:#d7008c;\n line-width:10;\n line-dasharray: 2,2,2;\n opacity: .6;\n [zoom > 15]{\n line-dasharray: 4,4,4;\n line-width:6;\n }\n [zoom = 15]{line-width:4;}\n [zoom = 14]{line-width:3;}\n [zoom > 11][zoom < 14]{line-width:2;}\n [zoom = 11]{line-width:1;}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"4e618330347fee926d2434c436660a5aa81c842f","subject":"country labels style","message":"country labels style\n","repos":"mapbox\/natural-earth-tm2,klokantech\/natural-earth-tm2","old_file":"natural-earth.tm2\/labels.mss","new_file":"natural-earth.tm2\/labels.mss","new_contents":"#country_labels {\n text-name: [name];\n text-face-name: \"PT Sans Caption Regular\";\n text-transform: uppercase;\n text-character-spacing: 1;\n text-placement: point;\n text-fill: #602;\n text-halo-fill: fadeout(#fff,90%);\n text-halo-radius: 2;\n text-halo-rasterizer: fast;\n}\n\n#places {\n text-name: [name];\n text-face-name: \"PT Sans Regular\";\n [scalerank<=1] { text-face-name: \"PT Sans Bold\"; }\n text-fill: #044;\n text-halo-radius: 2;\n text-halo-fill: fadeout(white,80%);\n text-halo-rasterizer: fast;\n [scalerank<=7] { text-size: 11; }\n [scalerank<=5] { text-size: 12; }\n [scalerank<=3] { text-size: 13; }\n [scalerank<=2] { text-size: 14; }\n [scalerank<=1] { text-size: 15; }\n [zoom=5] {\n [scalerank<=7] { text-size: 12; }\n [scalerank<=5] { text-size: 13; }\n [scalerank<=3] { text-size: 14; }\n [scalerank<=2] { text-size: 15; }\n [scalerank<=1] { text-size: 16; }\n }\n [zoom=6] {\n [scalerank<=7] { text-size: 13; }\n [scalerank<=5] { text-size: 14; }\n [scalerank<=3] { text-size: 16; }\n [scalerank<=2] { text-size: 17; }\n [scalerank<=1] { text-size: 18; }\n }\n [zoom>=7] {\n [scalerank<=8] { text-size: 14; }\n [scalerank<=7] { text-size: 15; }\n [scalerank<=5] { text-size: 16; }\n [scalerank<=4] { text-size: 17; }\n [scalerank<=3] { text-size: 18; }\n [scalerank<=2] { text-size: 19; }\n [scalerank<=1] { text-size: 20; }\n }\n}","old_contents":"#places {\n text-name: [name];\n text-face-name: \"PT Sans Regular\";\n [scalerank<=1] { text-face-name: \"PT Sans Bold\"; }\n text-fill: #044;\n text-halo-radius: 2;\n text-halo-fill: fadeout(white,80%);\n text-halo-rasterizer: fast;\n [scalerank<=7] { text-size: 11; }\n [scalerank<=5] { text-size: 12; }\n [scalerank<=3] { text-size: 13; }\n [scalerank<=2] { text-size: 14; }\n [scalerank<=1] { text-size: 15; }\n [zoom=5] {\n [scalerank<=7] { text-size: 12; }\n [scalerank<=5] { text-size: 13; }\n [scalerank<=3] { text-size: 14; }\n [scalerank<=2] { text-size: 15; }\n [scalerank<=1] { text-size: 16; }\n }\n [zoom=6] {\n [scalerank<=7] { text-size: 13; }\n [scalerank<=5] { text-size: 14; }\n [scalerank<=3] { text-size: 16; }\n [scalerank<=2] { text-size: 17; }\n [scalerank<=1] { text-size: 18; }\n }\n [zoom>=7] {\n [scalerank<=8] { text-size: 14; }\n [scalerank<=7] { text-size: 15; }\n [scalerank<=5] { text-size: 16; }\n [scalerank<=4] { text-size: 17; }\n [scalerank<=3] { text-size: 18; }\n [scalerank<=2] { text-size: 19; }\n [scalerank<=1] { text-size: 20; }\n }\n}","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"41b4cc4bb4829c2ceeb1fc64aac1daf672a864de","subject":"Special case SeaTac, and change font to avoid missing ndash. Closes #44","message":"Special case SeaTac, and change font to avoid missing ndash. Closes #44\n","repos":"Andrey-Pavlov\/toner-carto,stamen\/toner-carto","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport_bold: 'Arial Unicode MS Bold';\n@text_font_physical_bold: 'Arial Unicode MS Bold';\n@text_font_administrative: 'Arial Unicode MS Regular';\n@text_font_administrative_bold: 'Arial Unicode MS Bold';\n@text_font_water: 'Arial Unicode MS Italic';\n@text_font_water_bold: 'Arial Unicode MS Bold Italic';\n@text_font_city: 'Arial Unicode MS Regular';\n@text_font_city_bold: 'Arial Unicode MS Bold';\n@text_font_poi_bold: 'Arial Unicode MS Italic'; \/\/ n-dash is broken in Bold Italic\n\n@label_color_transport: #000;\n@label_color_transport_halo: #fff;\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_administrative: #000;\n@label_color_administrative_halo: #fff;\n@label_color_city: #000;\n@label_color_city_halo: #fff;\n@label_color_poi: #000;\n@label_color_poi_halo: #fff;\n\n@text_font_size_xxsm: 10;\n@text_font_size_xsm: 12;\n@text_font_size_sm: 13;\n@text_font_size_medium: 14;\n@text_font_size_medium_plus: 16;\n@text_font_size_large: 18;\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n\n#minor_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-avoid-edges: true;\n \n [zoom=16] {\n text-dy: 10; \n text-spacing: 124; \n text-size: @text_font_size_xxsm; \n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom=17] {\n text-dy: 13; \n text-spacing: 180; \n text-size: @text_font_size_xsm;\n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom>=18] {\n text-size: @text_font_size_xsm; \n text-spacing: 400; \n text-halo-radius: @text_font_halo_radius_large; \n }\n}\n\n#major_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-spacing: 100;\n text-avoid-edges: true;\n\n [zoom>=16][highway='primary'] {\n\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [is_tunnel=1][zoom>=15] {\n\ttext-fill: #777;\n }\n [zoom=12] {\n text-dy: 7;\n text-size: @text_font_size_xsm;\n text-min-distance: 4;\n }\n [zoom=13] {\n text-dy: 8;\n text-min-distance: 5;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_sm;\n }\n [highway='primary'] {\n\t\ttext-size: 13;\n }\n }\n\n [zoom=14] {\n text-min-distance: 5;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: 9;\n \ttext-size: @text_font_size_medium;\n } \n [highway='secondary'] {\n\t\ttext-dy: 7;\n \ttext-size: @text_font_size_xsm;\n text-halo-radius: 1.5;\n }\n }\n\n [zoom=15] {\n text-min-distance: 10;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: @text_font_size_xsm;\n \ttext-size: 15;\n }\n [highway='secondary'],[highway='tertiary'] {\n\t\ttext-dy: 11;\n \ttext-size: @text_font_size_sm;\n }\n }\n\n [zoom=16] {\n text-min-distance: 12;\n text-dy: 13;\n [highway='trunk'],[highway='primary'] { \n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'],[highway='tertiary'] {\t\n \ttext-spacing: 124;\n \ttext-size: @text_font_size_sm;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom=17] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-dy: 16;\n \ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-dy: 14;\n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-dy: 14; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_medium;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n\t\ttext-dy: 13; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_xsm; \n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom>=18] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-size: @text_font_size_medium; \n\t\ttext-spacing: 300;\n\t\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n text-size: @text_font_size_xsm;\n text-spacing: 400;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n}\n\n#poi_station_labels {\n [zoom>=16][railway='station'] {\n shield-name: \"[label]\";\n shield-face-name: @text_font_transport_bold;\n shield-fill: white;\n shield-size: 12;\n shield-file: url('images\/subway_shield_small.svg');\n }\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_physical_halo;\n text-halo-fill: @label_color_physical;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-fill: @label_color_physical;\n text-halo-fill: @label_color_physical_halo;\n \n text-line-spacing: -1;\n text-min-distance: 10;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n \n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=16] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#continents[zoom>=1][zoom<3]\n{\n \ttext-name: \"[name]\";\n text-face-name: @text_font_physical_bold;\n text-wrap-width: 32;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical;\n text-halo-radius: 3;\n text-halo-fill: @label_color_physical_halo;\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n \ttext-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n \ttext-min-distance: 1;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z4 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z5 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium_plus;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z6 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_large;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n\/\/ HACK! All the problematic water bodies with accents\n\/\/ e.g. \"Bahia de Campeche\" with an accented i,\n\/\/ have an empty \"changed\" string. So abuse this for now.\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \t[namealt!=''] {\n \t\ttext-name: [name] + '\\n(' + [namealt] + ')';\n }\n\ttext-face-name: @text_font_water_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][changed!='']\n{\n \ttext-name: [name];\n \t[namealt!=''] {\n \t\ttext-name: [name] + '\\n(' + [namealt] + ')';\n }\n text-face-name: @text_font_water;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-vertical-alignment: bottom;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo;\n text-min-distance: 5;\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n text-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo;\n text-size: @text_font_size_sm;\n\n [zoom=7] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size=18] {\n text-size: @text_font_size_large;\n }\n\n [font_size=20] {\n text-size: @text_font_size_large;\n }\n\n [justified='left'] {\n text-horizontal-alignment: middle;\n text-dx: -5;\n }\n\n [justified='right'] {\n text-horizontal-alignment: middle;\n text-dx: 5;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10,\n#city_labels_z11,\n#city_labels_z12, {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo; \n\ttext-size: @text_font_size_sm;\n [font_size=20] { text-size: @text_font_size_large; } \n}\n\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n \tmarker-ignore-placement: true;\n \tmarker-width: 7;\n \tmarker-fill: black;\n \tmarker-line-color: white;\n \tmarker-line-width: 2;\n}\n\n#airports[zoom>=10][zoom<=13] {\n marker-width: 18;\n\tmarker-file: url('images\/airplane.svg');\n}\n\n#airports[zoom>=13][scalerank<=12]\n{\n \ttext-name: \"[name]\";\n [name=\"Tacoma Int'l\"] {\n text-name: \"Seattle-\" + [name];\n }\n text-face-name: @text_font_poi_bold;\n text-fill: @label_color_poi;\n text-size: @text_font_size_medium;\n text-halo-fill: @label_color_poi_halo;\n text-halo-radius: @text_font_halo_radius_large;\n text-wrap-width: 128;\n text-dy: 14;\n text-allow-overlap: true;\n \n \t[zoom>=14] {\n \ttext-dy: 0;\n }\n}\n#airports {\n text-name: \"[name]\";\n text-face-name: @text_font_poi_bold;\n text-fill: red;\n }\n","old_contents":"@text_font_transport_bold: 'Arial Unicode MS Bold';\n@text_font_physical_bold: 'Arial Unicode MS Bold';\n@text_font_administrative: 'Arial Unicode MS Regular';\n@text_font_administrative_bold: 'Arial Unicode MS Bold';\n@text_font_water: 'Arial Unicode MS Italic';\n@text_font_water_bold: 'Arial Unicode MS Bold Italic';\n@text_font_city: 'Arial Unicode MS Regular';\n@text_font_city_bold: 'Arial Unicode MS Bold';\n@text_font_poi_bold: 'Arial Unicode MS Bold Italic';\n\n@label_color_transport: #000;\n@label_color_transport_halo: #fff;\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_administrative: #000;\n@label_color_administrative_halo: #fff;\n@label_color_city: #000;\n@label_color_city_halo: #fff;\n@label_color_poi: #000;\n@label_color_poi_halo: #fff;\n\n@text_font_size_xxsm: 10;\n@text_font_size_xsm: 12;\n@text_font_size_sm: 13;\n@text_font_size_medium: 14;\n@text_font_size_medium_plus: 16;\n@text_font_size_large: 18;\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n\n#minor_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-avoid-edges: true;\n \n [zoom=16] {\n text-dy: 10; \n text-spacing: 124; \n text-size: @text_font_size_xxsm; \n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom=17] {\n text-dy: 13; \n text-spacing: 180; \n text-size: @text_font_size_xsm;\n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom>=18] {\n text-size: @text_font_size_xsm; \n text-spacing: 400; \n text-halo-radius: @text_font_halo_radius_large; \n }\n}\n\n#major_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-spacing: 100;\n text-avoid-edges: true;\n\n [zoom>=16][highway='primary'] {\n\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [is_tunnel=1][zoom>=15] {\n\ttext-fill: #777;\n }\n [zoom=12] {\n text-dy: 7;\n text-size: @text_font_size_xsm;\n text-min-distance: 4;\n }\n [zoom=13] {\n text-dy: 8;\n text-min-distance: 5;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_sm;\n }\n [highway='primary'] {\n\t\ttext-size: 13;\n }\n }\n\n [zoom=14] {\n text-min-distance: 5;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: 9;\n \ttext-size: @text_font_size_medium;\n } \n [highway='secondary'] {\n\t\ttext-dy: 7;\n \ttext-size: @text_font_size_xsm;\n text-halo-radius: 1.5;\n }\n }\n\n [zoom=15] {\n text-min-distance: 10;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: @text_font_size_xsm;\n \ttext-size: 15;\n }\n [highway='secondary'],[highway='tertiary'] {\n\t\ttext-dy: 11;\n \ttext-size: @text_font_size_sm;\n }\n }\n\n [zoom=16] {\n text-min-distance: 12;\n text-dy: 13;\n [highway='trunk'],[highway='primary'] { \n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'],[highway='tertiary'] {\t\n \ttext-spacing: 124;\n \ttext-size: @text_font_size_sm;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom=17] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-dy: 16;\n \ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-dy: 14;\n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-dy: 14; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_medium;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n\t\ttext-dy: 13; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_xsm; \n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom>=18] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-size: @text_font_size_medium; \n\t\ttext-spacing: 300;\n\t\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n text-size: @text_font_size_xsm;\n text-spacing: 400;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n}\n\n#poi_station_labels {\n [zoom>=16][railway='station'] {\n shield-name: \"[label]\";\n shield-face-name: @text_font_transport_bold;\n shield-fill: white;\n shield-size: 12;\n shield-file: url('images\/subway_shield_small.svg');\n }\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_physical_halo;\n text-halo-fill: @label_color_physical;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-fill: @label_color_physical;\n text-halo-fill: @label_color_physical_halo;\n \n text-line-spacing: -1;\n text-min-distance: 10;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n \n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=16] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#continents[zoom>=1][zoom<3]\n{\n \ttext-name: \"[name]\";\n text-face-name: @text_font_physical_bold;\n text-wrap-width: 32;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical;\n text-halo-radius: 3;\n text-halo-fill: @label_color_physical_halo;\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n \ttext-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n \ttext-min-distance: 1;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z4 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z5 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium_plus;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z6 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_large;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n\/\/ HACK! All the problematic water bodies with accents\n\/\/ e.g. \"Bahia de Campeche\" with an accented i,\n\/\/ have an empty \"changed\" string. So abuse this for now.\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \t[namealt!=''] {\n \t\ttext-name: [name] + '\\n(' + [namealt] + ')';\n }\n\ttext-face-name: @text_font_water_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][changed!='']\n{\n \ttext-name: [name];\n \t[namealt!=''] {\n \t\ttext-name: [name] + '\\n(' + [namealt] + ')';\n }\n text-face-name: @text_font_water;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-vertical-alignment: bottom;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo;\n text-min-distance: 5;\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n text-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo;\n text-size: @text_font_size_sm;\n\n [zoom=7] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size=18] {\n text-size: @text_font_size_large;\n }\n\n [font_size=20] {\n text-size: @text_font_size_large;\n }\n\n [justified='left'] {\n text-horizontal-alignment: middle;\n text-dx: -5;\n }\n\n [justified='right'] {\n text-horizontal-alignment: middle;\n text-dx: 5;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10,\n#city_labels_z11,\n#city_labels_z12, {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo; \n\ttext-size: @text_font_size_sm;\n [font_size=20] { text-size: @text_font_size_large; } \n}\n\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n \tmarker-ignore-placement: true;\n \tmarker-width: 7;\n \tmarker-fill: black;\n \tmarker-line-color: white;\n \tmarker-line-width: 2;\n}\n\n#airports[zoom>=10][zoom<=13] {\n marker-width: 18;\n\tmarker-file: url('images\/airplane.svg');\n}\n\n#airports[zoom>=13][scalerank<=12]\n{\n \ttext-name: \"[name]\";\n text-face-name: @text_font_poi_bold;\n text-fill: @label_color_poi;\n text-size: @text_font_size_medium;\n text-halo-fill: @label_color_poi_halo;\n text-halo-radius: @text_font_halo_radius_large;\n text-wrap-width: 128;\n text-dy: 14;\n text-allow-overlap: true;\n \n \t[zoom>=14] {\n \ttext-dy: 0;\n }\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"3d870a559010bfc3f8feed502769beec1a69c703","subject":"remove blur from terrain to fix seams in #41","message":"remove blur from terrain to fix seams in #41\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"map.mss","new_file":"map.mss","new_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_urban: #EDEDED; \/\/ 7% k\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999; \/\/ 40% K\n@color_transport_casing_z10: #ddd;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc; \/\/ 20% K\n@color_transport_hwy: #737373; \/\/ 55% K \n@color_transport_minor: #aaa; \n@color_transport_rail: #aaa; \/\/ 33% K\n@color_transport_path: #666; \/\/ 60% K\n@color_building: #ccc;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: #c8cebe; \/\/ hsl(82,8,81)\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_airport_area: lighten(@color_airport_runways,10);\n@color_green_areas: darken(#c0d3b5,18);\n\nMap {\n background-color: @color_water;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n \/* lighten background color, as we decrease landcover opacity *\/\n [zoom>=12] {\n polygon-fill: lighten(@color_physical,20);\n }\n [zoom>=14] {\n polygon-fill: lighten(@color_physical,40);\n }\n\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_50m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{ \n line-color: @color_water;\n line-width: 0;\n polygon-fill: @color_water;\n\n [zoom>=5]{\n line-width: 0.5;\n }\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=7][scalerank<=6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n\/**\n * Use OSM administrative boundaries at zooms >= 10\n * Filter out really small admin areas for features like \n * Indian Reservations at higher zooms \n **\/\n#admin1-lines-osm{\n [zoom>=10][area_km2>1000],\n [zoom>=12][area_km2>500],\n [zoom>=14][area_km2>0]{\n line-width: 2.0;\n opacity: 0.2; \/\/ apply to layer, not line. Helps overlaps.\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n ::glow {\n line-color: @color_administrative_dark;\n opacity: 0.08;\n line-width: 4;\n line-dasharray: 1,5;\n }\n }\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=13][area> 10000],\n#green-areas-high[zoom>13],\n#green-areas-high[zoom>=13],\n{\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.7;\n\n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.5;\n }\n}\n\n#brown-areas-low[zoom=10][area>5000000],\n#brown-areas-med[zoom=11][area>1000000],\n#brown-areas-med[zoom=12][area> 500000],\n#brown-areas-med[zoom=12][area> 200000],\n#brown-areas-med[zoom=13][area> 75000],\n#brown-areas-high[zoom=13][area> 10000],\n#brown-areas-high[zoom>13],\n#brown-areas-high[zoom>=13],\n{\n \/\/ DO NOT match wetlands color in landcover .vrt\n \/\/ This includes a mix of brownfields, mud, and wetlands. Needs to be neutral brownish\n polygon-fill: #b8b894;\n polygon-opacity: 0.6;\n\n [type='wetland'] {\n polygon-fill: darken(#a0b8c8,10%); \/\/ more blueish\n polygon-opacity: 0.4;\n }\n}\n\n.landcover[type='parking'] {\n polygon-fill: #ddd;\n polygon-opacity: 0.5;\n}\n\n.landcover[type='scrub'],\n.landcover[type='grassland'],\n.landcover[type='heath'],\n.landcover[type='grass'],\n.landcover[type='meadow'] {\n polygon-fill: #d4daaa; \/\/ Greener than grasslands color in landcover .vrt\n}\n\n.landcover[type='beach'],\n.landcover[type='sand'] {\n polygon-fill: #fff0b9;\n polygon-opacity: 0.7;\n}\n\n.landcover[type='rock'],\n.landcover[type='bare_rock'],\n.landcover[type='scree'],\n.landcover[type='fell'] {\n polygon-fill: rgb(240,240,210); \/\/ Match bare rock color in landcover .vrt\n}\n\n.landcover[type='glacier'] {\n polygon-fill: rgb(244,255,255); \/\/ Match snow and ice color in landcover .vrt\n}\n\n.landcover[type='orchard'] {\n polygon-fill: rgb(209,226,172); \/\/ Match cropand\/natural mosiac color in landcover .vrt\n}\n\n.landcover[type='farmland'],\n.landcover[type='farmyard'],\n.landcover[type='farm'],\n.landcover[type='orchard'],\n.landcover[type='vineyard'] {\n polygon-fill: rgb(228,229,195); \/\/ Match croplands color in landcover .vrt\n}\n\n\n\/** \n * airport area fills\n**\/\n#aerodromes {\n [type='aerodrome'] {\n [zoom>=10] {\n polygon-fill: @color_airport_area;\n line-width: 0;\n }\n }\n}\n\n\/** \n * airport runways and taxiways\n**\/\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n \/\/ make sure airport fills don't render above features like roads\n [type='aerodrome'] {\n [zoom>=10] {\n polygon-opacity: 0;\n line-width: 0;\n }\n }\n\n [type='runway'] {\n [zoom=10] {\n line-width: 1;\n }\n [zoom=11] {\n line-width: 1.5;\n }\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n line-color: @color_transport_hwy;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n line-color: @color_transport_hwy;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{ \n [zoom>=9] {\n ::outline {\n line-width: 3;\n line-color: @color_transport_casing_z10;\n }\n\n line-width: 1.5; \n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 5;\n line-color: @color_transport_casing;\n }\n\n line-width: 3;\n line-color: @color_transport_hwy; \n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4; \n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 13;\n }\n\n line-width: 7.5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 39;\n } \n\n line-width: 28;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 49;\n \/\/ }\n\n \/\/ line-width: 35;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n\n [zoom<=12] {\n line-color: @color_transport; \n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n line-color: @color_transport_casing;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0;\/\/10;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 0; \/\/6;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=17] {\n ::outline {\n \/\/ line-width: 20;\n }\n\n line-width: 14;\n\n [is_link='yes'] {\n ::casing{\n \/\/ line-width: 14;\n }\n\n line-width: 7;\n }\n }\n\n [zoom>=18] {\n ::outline {\n \/\/ line-width: 25;\n }\n\n line-width: 17;\n\n [is_link='yes'] {\n ::casing {\n \/\/ line-width: 19;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 30;\n \/\/ }\n\n \/\/ line-width: 26;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 17;\n \/\/ }\n\n \/\/ line-width: 13;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 1;\n }\n\n [zoom>=11][highway='trunk'],\n [zoom>=11][highway='primary'],\n [zoom>=11][highway='secondary'] {\n ::casing{\n line-width: 1.9;\n line-color: @color_transport_casing;\n }\n line-width: 1.5;\n }\n\n [zoom>=12][highway='trunk'],\n [zoom>=12][highway='primary'],\n [zoom>=12][highway='secondary'],\n [zoom>=12][highway='tertiary'] {\n ::casing{\n line-width: 1.9;\n line-color: @color_transport_casing;\n }\n line-width: 1.5;\n }\n\n [zoom>=13] {\n line-width: 1.5;\n line-color: @color_transport;\n }\n\n [zoom>=14] {\n ::casing {\n line-width: 3.5;\n line-color: @color_transport_casing;\n }\n line-width: 2.5;\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 6.5;\n }\n line-width: 4;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0; \/\/7.5;\n } \n line-width: 4; \n }\n\n [zoom>=17] {\n ::casing {\n \/\/ line-width: 11.5;\n }\n line-width: 8;\n }\n\n [zoom>=18] {\n ::casing {\n \/\/ line-width: 14.5;\n } \n line-width: 11;\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15] {\n ::casing {\n line-width: 2.8; \n }\n\n line-width: 1.8;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n line-color: @color_transport_path;\n\n [zoom>=15] {\n line-width: 0.5;\n line-cap: butt;\n line-dasharray: 2, 3;\n }\n\n [zoom>=16] {\n line-width: 0.7;\n }\n\n [zoom>=17] {\n line-width: 1.2;\n line-dasharray: 4, 6;\n }\n}\n\n#lc500mMODIS_low {\n [zoom>=0][zoom<9] {\n raster-opacity:1;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(0,0);\n }\n [zoom>=7] { raster-opacity:0.9; }\n [zoom>=8] { raster-opacity:0.8; }\n}\n\n#lc500mMODIS_med {\n [zoom>=9] {\n raster-opacity:0.7;\n raster-scaling:gaussian;\n \/\/image-filters: agg-stack-blur(3,3); \/\/ causes discontinuities at metatile boundaries\n }\n [zoom>=10] { raster-opacity:0.6; }\n [zoom>=11] {\n raster-opacity:0.5;\n \/\/image-filters: agg-stack-blur(10,10); \/\/ causes discontinuities at metatile boundaries\n }\n [zoom>=12] { raster-opacity:0.4; }\n [zoom>=13] { raster-opacity:0.3; }\n}\n\n#lc500mMODIS_high {\n [zoom>=14] {\n raster-opacity:0.2;\n raster-scaling:gaussian;\n \/\/image-filters: agg-stack-blur(20,20); \/\/ causes discontinuities at metatile boundaries\n }\n [zoom>=15] { raster-opacity:0.2; }\n [zoom>=16] { raster-opacity:0.15; }\n [zoom>=17] { raster-opacity:0.1; }\n [zoom>=18] { raster-opacity:0.05; }\n}\n\n\/\/ A special landover raster with urban areas only, so we can keep them full opacity\n#lc500mMODIS_urban {\n raster-scaling:gaussian;\n \/\/image-filters: agg-stack-blur(10,10); \/\/ causes discontinuities at metatile boundaries\n raster-opacity:1;\n}\n\n.urban-landuse {\n polygon-fill: @color_urban;\n image-filters: agg-stack-blur(10,10);\n}\n\n#land {\n polygon-fill: @color_physical;\n}\n","old_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_urban: #EDEDED; \/\/ 7% k\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999; \/\/ 40% K\n@color_transport_casing_z10: #ddd;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc; \/\/ 20% K\n@color_transport_hwy: #737373; \/\/ 55% K \n@color_transport_minor: #aaa; \n@color_transport_rail: #aaa; \/\/ 33% K\n@color_transport_path: #666; \/\/ 60% K\n@color_building: #ccc;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: #c8cebe; \/\/ hsl(82,8,81)\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_airport_area: lighten(@color_airport_runways,10);\n@color_green_areas: darken(#c0d3b5,18);\n\nMap {\n background-color: @color_water;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n \/* lighten background color, as we decrease landcover opacity *\/\n [zoom>=12] {\n polygon-fill: lighten(@color_physical,20);\n }\n [zoom>=14] {\n polygon-fill: lighten(@color_physical,40);\n }\n\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_50m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{ \n line-color: @color_water;\n line-width: 0;\n polygon-fill: @color_water;\n\n [zoom>=5]{\n line-width: 0.5;\n }\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=7][scalerank<=6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n\/**\n * Use OSM administrative boundaries at zooms >= 10\n * Filter out really small admin areas for features like \n * Indian Reservations at higher zooms \n **\/\n#admin1-lines-osm{\n [zoom>=10][area_km2>1000],\n [zoom>=12][area_km2>500],\n [zoom>=14][area_km2>0]{\n line-width: 2.0;\n opacity: 0.2; \/\/ apply to layer, not line. Helps overlaps.\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n ::glow {\n line-color: @color_administrative_dark;\n opacity: 0.08;\n line-width: 4;\n line-dasharray: 1,5;\n }\n }\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=13][area> 10000],\n#green-areas-high[zoom>13],\n#green-areas-high[zoom>=13],\n{\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.7;\n\n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.5;\n }\n}\n\n#brown-areas-low[zoom=10][area>5000000],\n#brown-areas-med[zoom=11][area>1000000],\n#brown-areas-med[zoom=12][area> 500000],\n#brown-areas-med[zoom=12][area> 200000],\n#brown-areas-med[zoom=13][area> 75000],\n#brown-areas-high[zoom=13][area> 10000],\n#brown-areas-high[zoom>13],\n#brown-areas-high[zoom>=13],\n{\n \/\/ DO NOT match wetlands color in landcover .vrt\n \/\/ This includes a mix of brownfields, mud, and wetlands. Needs to be neutral brownish\n polygon-fill: #b8b894;\n polygon-opacity: 0.6;\n\n [type='wetland'] {\n polygon-fill: darken(#a0b8c8,10%); \/\/ more blueish\n polygon-opacity: 0.4;\n }\n}\n\n.landcover[type='parking'] {\n polygon-fill: #ddd;\n polygon-opacity: 0.5;\n}\n\n.landcover[type='scrub'],\n.landcover[type='grassland'],\n.landcover[type='heath'],\n.landcover[type='grass'],\n.landcover[type='meadow'] {\n polygon-fill: #d4daaa; \/\/ Greener than grasslands color in landcover .vrt\n}\n\n.landcover[type='beach'],\n.landcover[type='sand'] {\n polygon-fill: #fff0b9;\n polygon-opacity: 0.7;\n}\n\n.landcover[type='rock'],\n.landcover[type='bare_rock'],\n.landcover[type='scree'],\n.landcover[type='fell'] {\n polygon-fill: rgb(240,240,210); \/\/ Match bare rock color in landcover .vrt\n}\n\n.landcover[type='glacier'] {\n polygon-fill: rgb(244,255,255); \/\/ Match snow and ice color in landcover .vrt\n}\n\n.landcover[type='orchard'] {\n polygon-fill: rgb(209,226,172); \/\/ Match cropand\/natural mosiac color in landcover .vrt\n}\n\n.landcover[type='farmland'],\n.landcover[type='farmyard'],\n.landcover[type='farm'],\n.landcover[type='orchard'],\n.landcover[type='vineyard'] {\n polygon-fill: rgb(228,229,195); \/\/ Match croplands color in landcover .vrt\n}\n\n\n\/** \n * airport area fills\n**\/\n#aerodromes {\n [type='aerodrome'] {\n [zoom>=10] {\n polygon-fill: @color_airport_area;\n line-width: 0;\n }\n }\n}\n\n\/** \n * airport runways and taxiways\n**\/\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n \/\/ make sure airport fills don't render above features like roads\n [type='aerodrome'] {\n [zoom>=10] {\n polygon-opacity: 0;\n line-width: 0;\n }\n }\n\n [type='runway'] {\n [zoom=10] {\n line-width: 1;\n }\n [zoom=11] {\n line-width: 1.5;\n }\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n line-color: @color_transport_hwy;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n line-color: @color_transport_hwy;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{ \n [zoom>=9] {\n ::outline {\n line-width: 3;\n line-color: @color_transport_casing_z10;\n }\n\n line-width: 1.5; \n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 5;\n line-color: @color_transport_casing;\n }\n\n line-width: 3;\n line-color: @color_transport_hwy; \n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4; \n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 13;\n }\n\n line-width: 7.5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 39;\n } \n\n line-width: 28;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 49;\n \/\/ }\n\n \/\/ line-width: 35;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n\n [zoom<=12] {\n line-color: @color_transport; \n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n line-color: @color_transport_casing;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0;\/\/10;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 0; \/\/6;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=17] {\n ::outline {\n \/\/ line-width: 20;\n }\n\n line-width: 14;\n\n [is_link='yes'] {\n ::casing{\n \/\/ line-width: 14;\n }\n\n line-width: 7;\n }\n }\n\n [zoom>=18] {\n ::outline {\n \/\/ line-width: 25;\n }\n\n line-width: 17;\n\n [is_link='yes'] {\n ::casing {\n \/\/ line-width: 19;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 30;\n \/\/ }\n\n \/\/ line-width: 26;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 17;\n \/\/ }\n\n \/\/ line-width: 13;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 1;\n }\n\n [zoom>=11][highway='trunk'],\n [zoom>=11][highway='primary'],\n [zoom>=11][highway='secondary'] {\n ::casing{\n line-width: 1.9;\n line-color: @color_transport_casing;\n }\n line-width: 1.5;\n }\n\n [zoom>=12][highway='trunk'],\n [zoom>=12][highway='primary'],\n [zoom>=12][highway='secondary'],\n [zoom>=12][highway='tertiary'] {\n ::casing{\n line-width: 1.9;\n line-color: @color_transport_casing;\n }\n line-width: 1.5;\n }\n\n [zoom>=13] {\n line-width: 1.5;\n line-color: @color_transport;\n }\n\n [zoom>=14] {\n ::casing {\n line-width: 3.5;\n line-color: @color_transport_casing;\n }\n line-width: 2.5;\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 6.5;\n }\n line-width: 4;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0; \/\/7.5;\n } \n line-width: 4; \n }\n\n [zoom>=17] {\n ::casing {\n \/\/ line-width: 11.5;\n }\n line-width: 8;\n }\n\n [zoom>=18] {\n ::casing {\n \/\/ line-width: 14.5;\n } \n line-width: 11;\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15] {\n ::casing {\n line-width: 2.8; \n }\n\n line-width: 1.8;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 0;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n line-color: @color_transport_path;\n\n [zoom>=15] {\n line-width: 0.5;\n line-cap: butt;\n line-dasharray: 2, 3;\n }\n\n [zoom>=16] {\n line-width: 0.7;\n }\n\n [zoom>=17] {\n line-width: 1.2;\n line-dasharray: 4, 6;\n }\n}\n\n#lc500mMODIS_low {\n [zoom>=0][zoom<9] {\n raster-opacity:1;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(0,0);\n }\n [zoom>=7] { raster-opacity:0.9; }\n [zoom>=8] { raster-opacity:0.8; }\n}\n\n#lc500mMODIS_med {\n [zoom>=9] {\n raster-opacity:0.7;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(3,3);\n }\n [zoom>=10] { raster-opacity:0.6; }\n [zoom>=11] {\n raster-opacity:0.5;\n image-filters: agg-stack-blur(10,10);\n }\n [zoom>=12] { raster-opacity:0.4; }\n [zoom>=13] { raster-opacity:0.3; }\n}\n\n#lc500mMODIS_high {\n [zoom>=14] {\n raster-opacity:0.2;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(20,20);\n }\n [zoom>=15] { raster-opacity:0.2; }\n [zoom>=16] { raster-opacity:0.15; }\n [zoom>=17] { raster-opacity:0.1; }\n [zoom>=18] { raster-opacity:0.05; }\n}\n\n\/\/ A special landover raster with urban areas only, so we can keep them full opacity\n#lc500mMODIS_urban {\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(10,10);\n raster-opacity:1;\n}\n\n.urban-landuse {\n polygon-fill: @color_urban;\n image-filters: agg-stack-blur(10,10);\n}\n\n#land {\n polygon-fill: @color_physical;\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"bacd0c0b38be3cb18c7b978eba76312017dc3eec","subject":"Show adminAgency if name is null","message":"Show adminAgency if name is null\n","repos":"OpenBounds\/MapStyles","old_file":"PublicLands.tm2\/style.mss","new_file":"PublicLands.tm2\/style.mss","new_contents":"Map { font-directory: url(\".\/fonts\"); }\n\n@default_text_halo: white;\n@default_text_color: black;\n@default_text_halo_radius: 2;\n\n#lands {\n polygon-opacity:1; \n [zoom >= 14] {\n text-face-name: 'Noto Sans Regular';\n text-name:'[name]';\n [name=''],[name=null] { \n text-name: '[adminAgency]';\n }\n text-size: 12;\n text-placement:line;\n text-fill:black;\n text-halo-fill: @default_text_halo;\n text-halo-radius: @default_text_halo_radius;\n text-dy:-5;\n text-min-padding:1;\n text-max-char-angle-delta : 10;\n text-min-distance:50;\n \/\/Border line\n line-width:1;\n line-color:black;\n }\n [adminlevel='federal'] {\n polygon-fill:#984ea3;\n }\n [adminLevel='state'] {\n polygon-fill:#f781bf;\n }\n [adminLevel='county'] {\n polygon-fill:#ffff33;\n }\n [adminLevel='local'] {\n polygon-fill:#377eb8;\n }\n [adminAgency='Bureau of Land Management'] {\n polygon-fill: #e41a1c;\n }\n [adminAgency='Forest Service'] {\n polygon-fill: #4daf4a;\n }\n [adminAgency='U.S. Forest Service'] {\n polygon-fill: #4daf4a;\n }\n [adminAgency='National Park Service'] {\n polygon-fill: #a65628;\n }\n [adminAgency='Department of Defense'],[adminAgency='Army Corps of Engineers'],[adminAgency='Army'],[adminAgency='Air Force'],[adminAgency='Navy'],[adminAgency='Marine Corps'],[adminAgency='Coast Guard'],[adminAgency='Fish & Wildlife Service'] {\n polygon-fill: #0489B1;\n }\n}\n","old_contents":"Map { font-directory: url(\".\/fonts\"); }\n\n@default_text_halo: white;\n@default_text_color: black;\n@default_text_halo_radius: 2;\n\n#lands {\n\tpolygon-opacity:1;\t\n\t[zoom >= 14] {\n \t\ttext-face-name: 'Noto Sans Regular';\n \ttext-name:'[name]';\n\t\t[name=''],[name=NULL] { text-name: '[adminLevel]'; }\n \ttext-size: 12;\n \ttext-placement:interior;\n \ttext-fill:black;\n \ttext-halo-fill: @default_text_halo;\n \ttext-halo-radius: @default_text_halo_radius;\n \ttext-min-padding:1;\n \ttext-wrap-width:100;\n\t\tline-width:1;\n \tline-color:black;\n\t}\n\t[adminlevel='federal'] {\n\t\tpolygon-fill:#984ea3;\n\t}\n\t[adminLevel='state'] {\n \tpolygon-fill:#f781bf;\n\t}\n\t[adminLevel='county'] {\n \tpolygon-fill:#ffff33;\n\t}\n\t[adminLevel='local'] {\n \tpolygon-fill:#377eb8;\n\t}\n\t[adminAgency='Bureau of Land Management'] {\n\t\tpolygon-fill: #e41a1c;\n\t}\n\t[adminAgency='Forest Service'] {\n\t\tpolygon-fill: #4daf4a;\n\t}\n\t[adminAgency='U.S. Forest Service'] {\n polygon-fill: #4daf4a;\n }\n\t[adminAgency='National Park Service'] {\n\t\tpolygon-fill: #a65628;\n\t}\n\t[adminAgency='Department of Defense'],[adminAgency='Army Corps of Engineers'],[adminAgency='Army'],[adminAgency='Air Force'],[adminAgency='Navy'],[adminAgency='Marine Corps'],[adminAgency='Coast Guard'],[adminAgency='Fish & Wildlife Service'] {\n\t\tpolygon-fill: #0489B1;\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"a9b9da543ed780704213e3f27060d7a71389033c","subject":"Make temp dir determination safer","message":"Make temp dir determination safer\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/Utilities.mss","new_file":"src\/Utilities.mss","new_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in\n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/*\n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a dictionary of {pos:id} mappings for a given\n \/\/ voice, and returns the NoteRest object. If one isn't found\n \/\/ exactly at `position`, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions = null)\n {\n \/\/ theres not much we can do here. Bail.\n Log('Bailing due to insufficient voice information');\n return null;\n }\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (tstamps, etc.) to an element.\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Bar object'));\n }\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n if (bobj.Duration > 0)\n {\n libmei.AddAttribute(element, 'dur.ges', bobj.Duration & 'p');\n }\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bar));\n\n switch (bobj.Type)\n {\n case('Line')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Slur')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('DiminuendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('CrescendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('GlissandoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Trill')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction GetTupletStack (bobj) {\n \/\/$module(Utilities.mss)\n tupletStack = CreateSparseArray();\n parentTuplet = bobj.ParentTupletIfAny;\n while (parentTuplet != null)\n {\n tupletStack.Push(parentTuplet);\n parentTuplet = parentTuplet.ParentTupletIfAny;\n }\n tupletStack.Reverse();\n return tupletStack;\n} \/\/$end\n\nfunction CountTupletsEndingAtNoteRest(noteRest) {\n \/\/$module(Utilities.mss)\n tuplet = noteRest.ParentTupletIfAny;\n\n if (tuplet = null)\n {\n return 0;\n }\n\n nextNoteRest = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n\n if (nextNoteRest = null or nextNoteRest.ParentTupletIfAny = null)\n {\n tupletStack = GetTupletStack(noteRest);\n return tupletStack.Length;\n }\n\n if (TupletsEqual(tuplet, nextNoteRest.ParentTupletIfAny))\n {\n return 0;\n }\n\n tupletStack = GetTupletStack(noteRest);\n nextTupletStack = GetTupletStack(nextNoteRest);\n\n \/\/ We are looking for the highest index where both stacks are identical.\n index = utils.min(tupletStack.Length, nextTupletStack.Length) - 1;\n\n while (index >= 0 and not(TupletsEqual(tupletStack[index], nextTupletStack[index])))\n {\n index = index - 1;\n }\n\n return tupletStack.Length - 1 - index;\n} \/\/$end\n\nfunction GetMeiTupletDepth (layer) {\n \/\/$module(Utilities.mss)\n depth = 0;\n tuplet = layer._property:ActiveMeiTuplet;\n while (tuplet != null)\n {\n depth = depth + 1;\n tuplet = tuplet._property:ParentTuplet;\n }\n return depth;\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n result = Sibelius.AppendLineToFile(Self._property:Logfile, message, True);\n Trace(Self._property:Logfile & ' ' & result);\n} \/\/$end\n\nfunction NormalizedBeamProp (noteRest) {\n \/\/$module(Utilities.mss)\n \/*\n Sibelius' Beam properties can't be trusted. We need to look at the context,\n check whether they make sense and if they don't, find out the value we'd expect.\n Problems can e.g. be that Sibelius reports\n * a ContinueBeam at the start of a beam (we'd expect StartBeam)\n * a property other than NoBeam on a quarter or longer un-beamable duration\n (we'd expect NoBeam)\n * ... (almost any combinations imaginable)\n *\/\n if (noteRest.Beam = NoBeam or noteRest.Duration >= 256)\n {\n return NoBeam;\n }\n\n \/\/ At this point, we're only dealing with ContinueBeam and SingleBeam.\n \/\/ We need to look at the preceding note to see whether there's any\n \/\/ beam to continue.\n\n if (noteRest.Beam != StartBeam)\n {\n prev_obj = PrevNormalOrGrace(noteRest, noteRest.GraceNote);\n\n if (prev_obj != null and prev_obj.Beam != NoBeam and prev_obj.Duration < 256)\n {\n \/\/ We actually have a beam we can continue.\n if (noteRest.Beam = SingleBeam and noteRest.Duration < 128 and prev_obj.Duration < 128)\n {\n \/\/ SingleBeam only makes sense if we actually have secondary beams between the\n \/\/ previous note and the current note.\n return SingleBeam;\n }\n return ContinueBeam;\n }\n }\n\n \/\/ At this point, we know there is no previous beam we can continue because we have a\n \/\/ StartBeam or the above test for a previous beam failed.\n \/\/ We still need to check whether there is a following note that we can beam to.\n\n next_obj = NextNormalOrGrace(noteRest, noteRest.GraceNote);\n if (next_obj != null and next_obj.Duration < 256 and (next_obj.Beam = ContinueBeam or next_obj.Beam = SingleBeam))\n {\n return StartBeam;\n }\n else\n {\n return NoBeam;\n }\n} \/\/$end\n\nfunction NextNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n When given a 'normal' NoteRest, this function returns the next 'normal' NoteRest\n in the same voice.\n When given a grace NoteRest, this function returns the immediately adjacent\n following grace NoteRest, if existant.\n This function is basically a duplicate of PrevNormalOrGrace() with\n 'Previous' replaced by 'Next'.\n *\/\n next_obj = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (next_obj != null and not(next_obj.GraceNote))\n {\n next_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (next_obj != null and next_obj.GraceNote)\n {\n next_obj = next_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return next_obj;\n} \/\/$end\n\nfunction PrevNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n For a description, see NextNormalOrGrace().\n This function is basically a duplicate of PrevNormalOrGrace() with\n 'Next' replaced by 'Previous'.\n *\/\n prev_obj = noteRest.PreviousItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (prev_obj != null and not(prev_obj.GraceNote))\n {\n prev_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (prev_obj and prev_obj.GraceNote)\n {\n prev_obj = prev_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return prev_obj;\n} \/\/$end\n\nfunction GetNongraceParentBeam (noteRest, layer) {\n \/\/$module(Utilities.mss)\n \/*\n This function is used to find out whether a non-grace beam spans over a grace\n NoteRest that is either unbeamed or at the start of a grace beam.\n *\/\n if (layer._property:ActiveBeam != null)\n {\n \/\/ Only if the active non-grace beam continues to the next normal note, the\n \/\/ grace note is truly placed under the non-grace beam.\n nextNongraceNoteRest = NextNormalOrGrace(noteRest, false);\n if (nextNongraceNoteRest != null)\n {\n nextNormalBeamProp = NormalizedBeamProp(nextNongraceNoteRest);\n }\n else\n {\n nextNormalBeamProp = NoBeam;\n }\n if (nextNormalBeamProp = ContinueBeam or nextNormalBeamProp = SingleBeam)\n {\n return layer._property:ActiveBeam;\n }\n }\n return null;\n} \/\/$end\n\nfunction GetTempDir () {\n \/\/$module(Utilities.mss)\n if (Sibelius.PathSeparator = '\/')\n {\n tempFolder = '\/tmp\/';\n }\n else\n {\n appDataFolder = Sibelius.GetUserApplicationDataFolder();\n \/\/ appDataFolder usually looks like C:\\Users\\{username}\\AppData\\Roaming\\\n \/\/ We strip the trailing bit until the second to last backslash\n i = Length(appDataFolder) - 2;\n while (i >= 0 and CharAt(appDataFolder, i) != '\\\\')\n {\n i = i - 1;\n }\n \/\/ tempFolder usually looks like C:\\Users\\USERNAME\\AppData\\Local\\Temp\\\n \/\/ So we replace the trailing 'Roaming' with 'Local\\Temp'\n tempFolder = Substring(appDataFolder, 0, i) & '\\\\Local\\\\Temp\\\\';\n }\n if (Sibelius.FolderExists(tempFolder))\n {\n return tempFolder;\n }\n} \/\/$end\n\nfunction InitFigbassCharMap () {\n \/\/$module(Utilities.mss)\n map = CreateDictionary(\n '\u00a7', '\u266e',\n '#', '\u266f',\n '!', '\u266d',\n '?', '\ud834\udd2a',\n '%', '\ud834\udd2b',\n 'a', '(2)',\n 'i', '[2]',\n 'w', '2\u266e',\n 's', '2\u266f',\n 'x', '2\u266d',\n 'W', '\u266e2',\n 'S', '\u266f2',\n 'X', '\u266d2',\n 'k', '2+',\n 'p', '(3)',\n 'q', '[3]',\n 'e', '3\u266e',\n 'd', '3\u266f',\n 'c', '3\u266d',\n 'E', '\u266e3',\n 'D', '\u266f3',\n 'C', '\u266d3',\n 'z', '3+',\n 'A', '(4)',\n 'I', '[4]',\n 'r', '4\u266e',\n 'f', '4\u266f',\n 'v', '4\u266d',\n 'R', '\u266e4',\n 'F', '\u266f4',\n 'V', '\u266d4',\n 'K', '4+',\n 'P', '(5)',\n 'Q', '[5]',\n 't', '5\u266e',\n 'g', '5\u266f',\n 'b', '5\u266d',\n 'T', '\u266e5',\n 'G', '\u266f5',\n 'B', '\u266d5',\n 'Z', '5+',\n '$', '(6)',\n '\u00a8', '[6]',\n 'y', '6\u266e',\n 'h', '6\u266f',\n 'n', '6\u266d',\n 'Y', '\u266e6',\n 'H', '\u266f6',\n 'N', '\u266d6',\n ',', '6+',\n '\u00c2', '(7)',\n ';', '[7]',\n 'u', '7\u266e',\n 'j', '7\u266f',\n 'm', '7\u266d',\n 'U', '\u266e7',\n 'J', '\u266f7',\n 'M', '\u266d7',\n '<', '7+',\n '>', '+7',\n '=', '(8)',\n '\u00d6', '[8]',\n '\u00c0', '(9)',\n '{', '[9]',\n 'o', '9\u266e',\n 'l', '9\u266f',\n '\u00eb', '9\u266d',\n 'O', '\u266e9',\n 'L', '\u266f9',\n ':', '\u266d9',\n '}', '9+',\n '\u00c5', '|',\n '\u00fc', '_',\n '\u00a9', CreateSparseArray('2\u266f', 'U+EA53', 'figbass2Raised' ), \/\/ 2 with slashed foot\n '\u00c4', CreateSparseArray('4\u266f', 'U+EA56', 'figbass4Raised' ), \/\/ 4 with slashed horizontal line\n '\u00cb', CreateSparseArray('5\u266f', 'U+EA58', 'figbass5Raised1'), \/\/ 5 with straight slash through head\n '\u00cf', CreateSparseArray('5\u266f', 'U+EA59', 'figbass5Raised2'), \/\/ 5 with angled slash through head\n '\u00ef', CreateSparseArray('5\u266f', 'U+EA5A', 'figbass5Raised3'), \/\/ 5 with slashed foot\n '\u00b4', CreateSparseArray('6\u266f', 'U+EA6F', 'figbass6Raised' ), \/\/ 6 with slashed head\n '\u00e4', CreateSparseArray('7\u266f', 'U+EA5E', 'figbass7Raised1'), \/\/ 7 with slashed head\n '&', CreateSparseArray('7\u266f', 'U+EA5F', 'figbass8Raised2'), \/\/ 7 with slashed stem\n \/\/ (Sibelius\/Opus and SMuFL\/Bravura don't match 100% for the slashed 9:\n \/\/ Opus slashes the stem, Bravura the head)\n '\u00f6', CreateSparseArray('9#', 'U+EA62', 'figbass9Raised') \/\/ slashed 9\n );\n literalChars = '0123456789[]_-+.';\n for i = 0 to Length(literalChars)\n {\n char = CharAt(literalChars, i);\n map[char] = char;\n }\n\n return map;\n} \/\/$end\n","old_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in\n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/*\n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a dictionary of {pos:id} mappings for a given\n \/\/ voice, and returns the NoteRest object. If one isn't found\n \/\/ exactly at `position`, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions = null)\n {\n \/\/ theres not much we can do here. Bail.\n Log('Bailing due to insufficient voice information');\n return null;\n }\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (tstamps, etc.) to an element.\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Bar object'));\n }\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n if (bobj.Duration > 0)\n {\n libmei.AddAttribute(element, 'dur.ges', bobj.Duration & 'p');\n }\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bar));\n\n switch (bobj.Type)\n {\n case('Line')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Slur')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('DiminuendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('CrescendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('GlissandoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Trill')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction GetTupletStack (bobj) {\n \/\/$module(Utilities.mss)\n tupletStack = CreateSparseArray();\n parentTuplet = bobj.ParentTupletIfAny;\n while (parentTuplet != null)\n {\n tupletStack.Push(parentTuplet);\n parentTuplet = parentTuplet.ParentTupletIfAny;\n }\n tupletStack.Reverse();\n return tupletStack;\n} \/\/$end\n\nfunction CountTupletsEndingAtNoteRest(noteRest) {\n \/\/$module(Utilities.mss)\n tuplet = noteRest.ParentTupletIfAny;\n\n if (tuplet = null)\n {\n return 0;\n }\n\n nextNoteRest = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n\n if (nextNoteRest = null or nextNoteRest.ParentTupletIfAny = null)\n {\n tupletStack = GetTupletStack(noteRest);\n return tupletStack.Length;\n }\n\n if (TupletsEqual(tuplet, nextNoteRest.ParentTupletIfAny))\n {\n return 0;\n }\n\n tupletStack = GetTupletStack(noteRest);\n nextTupletStack = GetTupletStack(nextNoteRest);\n\n \/\/ We are looking for the highest index where both stacks are identical.\n index = utils.min(tupletStack.Length, nextTupletStack.Length) - 1;\n\n while (index >= 0 and not(TupletsEqual(tupletStack[index], nextTupletStack[index])))\n {\n index = index - 1;\n }\n\n return tupletStack.Length - 1 - index;\n} \/\/$end\n\nfunction GetMeiTupletDepth (layer) {\n \/\/$module(Utilities.mss)\n depth = 0;\n tuplet = layer._property:ActiveMeiTuplet;\n while (tuplet != null)\n {\n depth = depth + 1;\n tuplet = tuplet._property:ParentTuplet;\n }\n return depth;\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n Sibelius.AppendLineToFile(Self._property:Logfile, message, True);\n} \/\/$end\n\nfunction NormalizedBeamProp (noteRest) {\n \/\/$module(Utilities.mss)\n \/*\n Sibelius' Beam properties can't be trusted. We need to look at the context,\n check whether they make sense and if they don't, find out the value we'd expect.\n Problems can e.g. be that Sibelius reports\n * a ContinueBeam at the start of a beam (we'd expect StartBeam)\n * a property other than NoBeam on a quarter or longer un-beamable duration\n (we'd expect NoBeam)\n * ... (almost any combinations imaginable)\n *\/\n if (noteRest.Beam = NoBeam or noteRest.Duration >= 256)\n {\n return NoBeam;\n }\n\n \/\/ At this point, we're only dealing with ContinueBeam and SingleBeam.\n \/\/ We need to look at the preceding note to see whether there's any\n \/\/ beam to continue.\n\n if (noteRest.Beam != StartBeam)\n {\n prev_obj = PrevNormalOrGrace(noteRest, noteRest.GraceNote);\n\n if (prev_obj != null and prev_obj.Beam != NoBeam and prev_obj.Duration < 256)\n {\n \/\/ We actually have a beam we can continue.\n if (noteRest.Beam = SingleBeam and noteRest.Duration < 128 and prev_obj.Duration < 128)\n {\n \/\/ SingleBeam only makes sense if we actually have secondary beams between the\n \/\/ previous note and the current note.\n return SingleBeam;\n }\n return ContinueBeam;\n }\n }\n\n \/\/ At this point, we know there is no previous beam we can continue because we have a\n \/\/ StartBeam or the above test for a previous beam failed.\n \/\/ We still need to check whether there is a following note that we can beam to.\n\n next_obj = NextNormalOrGrace(noteRest, noteRest.GraceNote);\n if (next_obj != null and next_obj.Duration < 256 and (next_obj.Beam = ContinueBeam or next_obj.Beam = SingleBeam))\n {\n return StartBeam;\n }\n else\n {\n return NoBeam;\n }\n} \/\/$end\n\nfunction NextNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n When given a 'normal' NoteRest, this function returns the next 'normal' NoteRest\n in the same voice.\n When given a grace NoteRest, this function returns the immediately adjacent\n following grace NoteRest, if existant.\n This function is basically a duplicate of PrevNormalOrGrace() with\n 'Previous' replaced by 'Next'.\n *\/\n next_obj = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (next_obj != null and not(next_obj.GraceNote))\n {\n next_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (next_obj != null and next_obj.GraceNote)\n {\n next_obj = next_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return next_obj;\n} \/\/$end\n\nfunction PrevNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n For a description, see NextNormalOrGrace().\n This function is basically a duplicate of PrevNormalOrGrace() with\n 'Next' replaced by 'Previous'.\n *\/\n prev_obj = noteRest.PreviousItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (prev_obj != null and not(prev_obj.GraceNote))\n {\n prev_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (prev_obj and prev_obj.GraceNote)\n {\n prev_obj = prev_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return prev_obj;\n} \/\/$end\n\nfunction GetNongraceParentBeam (noteRest, layer) {\n \/\/$module(Utilities.mss)\n \/*\n This function is used to find out whether a non-grace beam spans over a grace\n NoteRest that is either unbeamed or at the start of a grace beam.\n *\/\n if (layer._property:ActiveBeam != null)\n {\n \/\/ Only if the active non-grace beam continues to the next normal note, the\n \/\/ grace note is truly placed under the non-grace beam.\n nextNongraceNoteRest = NextNormalOrGrace(noteRest, false);\n if (nextNongraceNoteRest != null)\n {\n nextNormalBeamProp = NormalizedBeamProp(nextNongraceNoteRest);\n }\n else\n {\n nextNormalBeamProp = NoBeam;\n }\n if (nextNormalBeamProp = ContinueBeam or nextNormalBeamProp = SingleBeam)\n {\n return layer._property:ActiveBeam;\n }\n }\n return null;\n} \/\/$end\n\nfunction GetTempDir () {\n \/\/$module(Utilities.mss)\n if (utils.IsMac())\n {\n return '\/tmp\/';\n }\n else\n {\n documentsFolder = Sibelius.GetDocumentsFolder();\n \/\/ documentsFolder looks like C:\\Users\\USERNAME\\Documents\\\n \/\/ We strip the trailing bit until the second to last backslash\n i = Length(documentsFolder) - 2;\n while (i > 0 and CharAt(documentsFolder, i) != '\\\\')\n {\n i = i - 1;\n }\n return Substring(documentsFolder, 0, i) & '\\\\AppData\\\\Local\\\\Temp\\\\';\n }\n} \/\/$end\n\nfunction InitFigbassCharMap () {\n \/\/$module(Utilities.mss)\n map = CreateDictionary(\n '\u00a7', '\u266e',\n '#', '\u266f',\n '!', '\u266d',\n '?', '\ud834\udd2a',\n '%', '\ud834\udd2b',\n 'a', '(2)',\n 'i', '[2]',\n 'w', '2\u266e',\n 's', '2\u266f',\n 'x', '2\u266d',\n 'W', '\u266e2',\n 'S', '\u266f2',\n 'X', '\u266d2',\n 'k', '2+',\n 'p', '(3)',\n 'q', '[3]',\n 'e', '3\u266e',\n 'd', '3\u266f',\n 'c', '3\u266d',\n 'E', '\u266e3',\n 'D', '\u266f3',\n 'C', '\u266d3',\n 'z', '3+',\n 'A', '(4)',\n 'I', '[4]',\n 'r', '4\u266e',\n 'f', '4\u266f',\n 'v', '4\u266d',\n 'R', '\u266e4',\n 'F', '\u266f4',\n 'V', '\u266d4',\n 'K', '4+',\n 'P', '(5)',\n 'Q', '[5]',\n 't', '5\u266e',\n 'g', '5\u266f',\n 'b', '5\u266d',\n 'T', '\u266e5',\n 'G', '\u266f5',\n 'B', '\u266d5',\n 'Z', '5+',\n '$', '(6)',\n '\u00a8', '[6]',\n 'y', '6\u266e',\n 'h', '6\u266f',\n 'n', '6\u266d',\n 'Y', '\u266e6',\n 'H', '\u266f6',\n 'N', '\u266d6',\n ',', '6+',\n '\u00c2', '(7)',\n ';', '[7]',\n 'u', '7\u266e',\n 'j', '7\u266f',\n 'm', '7\u266d',\n 'U', '\u266e7',\n 'J', '\u266f7',\n 'M', '\u266d7',\n '<', '7+',\n '>', '+7',\n '=', '(8)',\n '\u00d6', '[8]',\n '\u00c0', '(9)',\n '{', '[9]',\n 'o', '9\u266e',\n 'l', '9\u266f',\n '\u00eb', '9\u266d',\n 'O', '\u266e9',\n 'L', '\u266f9',\n ':', '\u266d9',\n '}', '9+',\n '\u00c5', '|',\n '\u00fc', '_',\n '\u00a9', CreateSparseArray('2\u266f', 'U+EA53', 'figbass2Raised' ), \/\/ 2 with slashed foot\n '\u00c4', CreateSparseArray('4\u266f', 'U+EA56', 'figbass4Raised' ), \/\/ 4 with slashed horizontal line\n '\u00cb', CreateSparseArray('5\u266f', 'U+EA58', 'figbass5Raised1'), \/\/ 5 with straight slash through head\n '\u00cf', CreateSparseArray('5\u266f', 'U+EA59', 'figbass5Raised2'), \/\/ 5 with angled slash through head\n '\u00ef', CreateSparseArray('5\u266f', 'U+EA5A', 'figbass5Raised3'), \/\/ 5 with slashed foot\n '\u00b4', CreateSparseArray('6\u266f', 'U+EA6F', 'figbass6Raised' ), \/\/ 6 with slashed head\n '\u00e4', CreateSparseArray('7\u266f', 'U+EA5E', 'figbass7Raised1'), \/\/ 7 with slashed head\n '&', CreateSparseArray('7\u266f', 'U+EA5F', 'figbass8Raised2'), \/\/ 7 with slashed stem\n \/\/ (Sibelius\/Opus and SMuFL\/Bravura don't match 100% for the slashed 9:\n \/\/ Opus slashes the stem, Bravura the head)\n '\u00f6', CreateSparseArray('9#', 'U+EA62', 'figbass9Raised') \/\/ slashed 9\n );\n literalChars = '0123456789[]_-+.';\n for i = 0 to Length(literalChars)\n {\n char = CharAt(literalChars, i);\n map[char] = char;\n }\n\n return map;\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"6f34beacc227fc5b3dc6610fddbe0b414ee3af35","subject":"Fixed text offset for station\/airport icons","message":"Fixed text offset for station\/airport icons\n\ngit-svn-id: 52b2958d923a603b3f48d22aabe6b5bf40478d2a@476 dbea3d40-3153-0410-b551-57805770c6e6\n","repos":"glampr\/Cascadenik,mapnik\/Cascadenik","old_file":"openstreetmap\/rail.mss","new_file":"openstreetmap\/rail.mss","new_contents":".rail.line[zoom>=17][tunnel!=yes][tunnel!=true] { line-pattern-file: url('img\/rail-wide.png'); }\n.rail.line[zoom=16][tunnel!=yes][tunnel!=true] { line-pattern-file: url('img\/rail-normal.png'); }\n.rail.line[zoom>=14][zoom<=15][tunnel!=yes][tunnel!=true] { line-pattern-file: url('img\/rail-medium.png'); }\n.rail.line[zoom>=12][zoom<=13][tunnel!=yes][tunnel!=true] { line-pattern-file: url('img\/rail-narrow.png'); }\n\n.rail.line[zoom>=14][tunnel!=yes][tunnel!=true][bridge=yes],\n.rail.line[zoom>=14][tunnel!=yes][tunnel!=true][bridge=true]\n{\n line-color: #e4f7f2;\n outline-color: #d2d2d2;\n outline-width: 1;\n}\n\n.rail.line[zoom>=17][bridge=yes],\n.rail.line[zoom>=17][bridge=true] { line-width: 16; }\n\n.rail.line[zoom=16][bridge=yes],\n.rail.line[zoom=16][bridge=true] { line-width: 13; }\n\n.rail.line[zoom>=14][zoom<=15][bridge=yes],\n.rail.line[zoom>=14][zoom<=15][bridge=true] { line-width: 8; }\n\n.transit.point name\n{\n text-face-name: \"DejaVu Sans Book\";\n text-fill: #000;\n text-placement: point;\n}\n\n.transit.point[zoom>=15] name\n{\n text-size: 12;\n}\n\n.transit.point[railway=station][zoom>=17],\n.transit.point[railway=subway_entrance][zoom>=17]\n{\n point-file: url('img\/icons\/24x24\/symbol\/transport\/railway=station.png');\n point-allow-overlap: true;\n text-dy: 24;\n}\n\n.transit.point[aeroway=airport][zoom>=17],\n.transit.point[aeroway=aerodrome][zoom>=17]\n{\n point-file: url('img\/icons\/24x24\/symbol\/transport\/amenity=airport.png');\n text-dy: 24;\n}\n\n.transit.point[railway=station][zoom>=15][zoom<=16],\n.transit.point[railway=subway_entrance][zoom>=15][zoom<=16]\n{\n point-file: url('img\/icons\/16x16\/symbol\/transport\/railway=station.png');\n point-allow-overlap: true;\n text-dy: 20;\n}\n\n.transit.point[aeroway=airport][zoom>=14][zoom<=16],\n.transit.point[aeroway=aerodrome][zoom>=14][zoom<=16]\n{\n point-file: url('img\/icons\/24x24\/symbol\/transport\/amenity=airport.png');\n text-dy: 24;\n}\n\n.transit.point[zoom>=17] name\n{\n text-size: 12;\n text-halo-radius: 2;\n text-wrap-width: 65;\n}\n\n.transit.point[zoom>=15][zoom<=16] name,\n.transit.point[aeroway=airport][zoom>=10][zoom<=14] name,\n.transit.point[aeroway=aerodrome][zoom>=10][zoom<=14] name\n{\n text-size: 9;\n text-halo-radius: 1;\n text-wrap-width: 50;\n}\n\n.transit.point[railway=station][zoom>=12][zoom<=14],\n.transit.point[railway=subway_entrance][zoom>=12][zoom<=14]\n{\n point-file: url('img\/icons\/12x12\/symbol\/transport\/railway=station.png');\n \/* point-allow-overlap: true; *\/\n text-dy: 18;\n}\n\n.transit.point[aeroway=airport][zoom>=12][zoom<=13],\n.transit.point[aeroway=aerodrome][zoom>=12][zoom<=13]\n{\n point-file: url('img\/icons\/16x16\/symbol\/transport\/amenity=airport.png');\n text-dy: 20;\n}\n\n.transit.point[aeroway=airport][zoom>=9][zoom<=11],\n.transit.point[aeroway=aerodrome][zoom>=9][zoom<=11]\n{\n point-file: url('img\/icons\/12x12\/symbol\/transport\/amenity=airport.png');\n text-dy: 18;\n}\n","old_contents":".rail.line[zoom>=17][tunnel!=yes][tunnel!=true] { line-pattern-file: url('img\/rail-wide.png'); }\n.rail.line[zoom=16][tunnel!=yes][tunnel!=true] { line-pattern-file: url('img\/rail-normal.png'); }\n.rail.line[zoom>=14][zoom<=15][tunnel!=yes][tunnel!=true] { line-pattern-file: url('img\/rail-medium.png'); }\n.rail.line[zoom>=12][zoom<=13][tunnel!=yes][tunnel!=true] { line-pattern-file: url('img\/rail-narrow.png'); }\n\n.rail.line[zoom>=14][tunnel!=yes][tunnel!=true][bridge=yes],\n.rail.line[zoom>=14][tunnel!=yes][tunnel!=true][bridge=true]\n{\n line-color: #e4f7f2;\n outline-color: #d2d2d2;\n outline-width: 1;\n}\n\n.rail.line[zoom>=17][bridge=yes],\n.rail.line[zoom>=17][bridge=true] { line-width: 16; }\n\n.rail.line[zoom=16][bridge=yes],\n.rail.line[zoom=16][bridge=true] { line-width: 13; }\n\n.rail.line[zoom>=14][zoom<=15][bridge=yes],\n.rail.line[zoom>=14][zoom<=15][bridge=true] { line-width: 8; }\n\n.transit.point name\n{\n text-face-name: \"DejaVu Sans Book\";\n text-fill: #000;\n text-placement: point;\n}\n\n.transit.point[zoom>=15] name\n{\n text-size: 12;\n}\n\n.transit.point[railway=station][zoom>=17],\n.transit.point[railway=subway_entrance][zoom>=17]\n{\n point-file: url('img\/icons\/24x24\/symbol\/transport\/railway=station.png');\n point-allow-overlap: true;\n text-dy: 20;\n}\n\n.transit.point[aeroway=airport][zoom>=17],\n.transit.point[aeroway=aerodrome][zoom>=17]\n{\n point-file: url('img\/icons\/24x24\/symbol\/transport\/amenity=airport.png');\n text-dy: 20;\n}\n\n.transit.point[railway=station][zoom>=15][zoom<=16],\n.transit.point[railway=subway_entrance][zoom>=15][zoom<=16]\n{\n point-file: url('img\/icons\/16x16\/symbol\/transport\/railway=station.png');\n point-allow-overlap: true;\n text-dy: 16;\n}\n\n.transit.point[aeroway=airport][zoom>=14][zoom<=16],\n.transit.point[aeroway=aerodrome][zoom>=14][zoom<=16]\n{\n point-file: url('img\/icons\/24x24\/symbol\/transport\/amenity=airport.png');\n text-dy: 20;\n}\n\n.transit.point[zoom>=17] name\n{\n text-size: 12;\n text-halo-radius: 2;\n text-wrap-width: 65;\n}\n\n.transit.point[zoom>=15][zoom<=16] name,\n.transit.point[aeroway=airport][zoom>=10][zoom<=14] name,\n.transit.point[aeroway=aerodrome][zoom>=10][zoom<=14] name\n{\n text-size: 9;\n text-halo-radius: 1;\n text-wrap-width: 50;\n}\n\n.transit.point[railway=station][zoom>=12][zoom<=14],\n.transit.point[railway=subway_entrance][zoom>=12][zoom<=14]\n{\n point-file: url('img\/icons\/12x12\/symbol\/transport\/railway=station.png');\n \/* point-allow-overlap: true; *\/\n text-dy: 14;\n}\n\n.transit.point[aeroway=airport][zoom>=12][zoom<=13],\n.transit.point[aeroway=aerodrome][zoom>=12][zoom<=13]\n{\n point-file: url('img\/icons\/16x16\/symbol\/transport\/amenity=airport.png');\n text-dy: 16;\n}\n\n.transit.point[aeroway=airport][zoom>=9][zoom<=11],\n.transit.point[aeroway=aerodrome][zoom>=9][zoom<=11]\n{\n point-file: url('img\/icons\/12x12\/symbol\/transport\/amenity=airport.png');\n text-dy: 14;\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"3e570cc500b3d34ec7359e857a1ad04cb498bb35","subject":"dotted lines for tunnels","message":"dotted lines for tunnels\n","repos":"andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto","old_file":"osmt\/highway.mss","new_file":"osmt\/highway.mss","new_contents":"\/* Roads, footpaths, tracks *\/\n\n\n@private_road_colour: #c02c34;\n\n@tertiary_road_colour: #faf555;\n@secondary_road_colour: #d46833;\n@primary_road_colour: #cc3737;\n@trunk_road_colour: #650f0d;\n@motorway_road_colour: #7c0046;\n\n\/* paths (footway, cycleway, track) are dotted, the halo is behind the\n dots *\/\n@path_halo_opacity: 0.3;\n@path_halo_colour: white;\n@path_dot_opacity: 1.0;\n\n\/* highway labels *\/\n@highway_face_name: \"Liberation Sans Regular\";\n@highway_text_fill: white;\n@highway_halo_fill: black;\n@highway_halo_radius: 2.0;\n\n\/*\n service black\n residential black\n unclassified black\n tertiary yellow\n secondary orange\n primary red\n trunk blue\n motorway dark red\n*\/\n\n#highway-labels[highway='footway'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='cycleway'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='path'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='track'][zoom > 13] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n#highway-labels[highway='service'][zoom > 16] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='residential'][zoom > 15] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='unclassified'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='tertiary'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='secondary'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='primary'][zoom > 13] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='trunk'][zoom > 12] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='motorway'][zoom > 11] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n\/* default style for all path, footway, track, cycleways and roads *\/\n.highway[zoom > 12] {\n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n\n line-width: 1;\n}\n\n\/* defaults for roads with cars *\/\n.road[zoom > 11] {\n ::oneway_arrow[oneway='yes'][zoom > 14] {\n marker-type: arrow;\n\n marker-width: 2;\n marker-line-width: 2;\n\n marker-opacity: 1.0;\n marker-line-opacity: 1.0;\n\n marker-fill: white;\n marker-line-color: white;\n\n marker-spacing: 100;\n }\n\n line-color: #000000;\n line-join: round;\n line-cap: round;\n\n line-width: 1;\n\n [zoom > 17] { line-width: 15; line-opacity: 0.5; }\n [zoom = 17] { line-width: 10; line-opacity: 0.5; }\n [zoom = 16] { line-width: 5; line-opacity: 0.5; }\n [zoom = 15] { line-width: 2.25; line-opacity: 0.6; }\n [zoom = 14] { line-width: 1.5; line-opacity: 0.7; }\n [zoom = 13] { line-width: 1; line-opacity: 0.8; }\n [zoom = 12] { line-width: 0.5; line-opacity: 0.8; }\n\n ::bridge[bridge='yes'] {\n \/*\n ideally we would draw two lines outside the existing line,\n but the current compositing method in mapnik won't allow this\n so easily with transparency\n\n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n\n [zoom > 17] { line-width: 20; }\n [zoom = 17] { line-width: 15; }\n [zoom = 16] { line-width: 7; }\n [zoom = 15] { line-width: 3; }\n [zoom = 14] { line-width: 2; }\n [zoom = 13] { line-width: 1.5; }\n [zoom = 12] { line-width: 0.75; }\n *\/\n }\n \n [tunnel='yes'] {\n [zoom > 17] { line-dasharray: 6,6; }\n [zoom = 17] { line-dasharray: 4.5,4.5; }\n [zoom < 17] { line-dasharray: 3,3; }\n \tline-cap: butt;\n }\n\n}\n\n.highway#footway[zoom > 13] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n\n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n\n line-color: #FF0000;\n line-opacity: @path_dot_opacity;\n\n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom = 16] { line-width: 2 ; line-dasharray: 1,3 }\n [zoom < 16] { line-width: 1.5; line-dasharray: 1,2 }\n\n [highway='steps']{\n line-cap: butt;\n\n [zoom > 18] { line-dasharray: 3,4 }\n [zoom = 18] { line-dasharray: 2,3 }\n [zoom < 18] { line-dasharray: 1,2 }\n }\n\n}\n\n.highway#path[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n\n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n line-color: #000000;\n line-opacity: @path_dot_opacity;\n\n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom = 16] { line-width: 2 ; line-dasharray: 1,3 }\n [zoom < 16] { line-width: 1.5; line-dasharray: 1,2 }\n\n}\n\n.highway#track[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n\n [zoom > 18] { line-width: 16 }\n [zoom = 18] { line-width: 10 }\n [zoom = 17] { line-width: 6 }\n [zoom = 16] { line-width: 4.5 }\n [zoom = 15] { line-width: 3.2 }\n [zoom = 14] { line-width: 3 }\n [zoom = 13] { line-width: 2.4 }\n }\n\n line-color: #6d4f15;\n line-opacity: @path_dot_opacity;\n\n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 3,4 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 3,4 }\n [zoom = 16] { line-width: 2.1; line-dasharray: 3,4 }\n [zoom = 15] { line-width: 1.8; line-dasharray: 3,4 }\n [zoom = 14] { line-width: 1.5; line-dasharray: 3,4 }\n [zoom = 13] { line-width: 1.2 ; line-dasharray: 3,4 }\n\n}\n\n.highway#cycleway[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n\n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n\n line-color: #0000ff;\n line-opacity: @path_dot_opacity;\n\n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom = 16] { line-width: 2 ; line-dasharray: 1,3 }\n [zoom < 16] { line-width: 1.5; line-dasharray: 1,2 }\n\n}\n\n.road#service[zoom > 11] {\n [zoom > 17] { line-width: 7.5; }\n [zoom = 17] { line-width: 5; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 1; }\n [zoom = 14] { line-width: 0.75; }\n [zoom = 13] { line-width: 0.5; }\n [zoom = 12] { line-width: 0.25; }\n\n [service='parking_aisle'][zoom > 14] {\n [zoom > 17] { line-width: 3; }\n [zoom = 17] { line-width: 2.5; }\n [zoom = 16] { line-width: 1.25; }\n [zoom = 15] { line-width: 0.25; }\n }\n \n ::private[access='private'],[access='no'],[access='permissive'],[access='customer'],[access='delivery'] {\n line-cap: butt;\n line-dasharray: 6,6;\n line-color: @private_road_colour;\n line-opacity: 0.5;\n\n [zoom > 17] { line-width: 7.5; }\n [zoom = 17] { line-width: 5; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 1; }\n [zoom = 14] { line-width: 0.75; }\n [zoom = 13] { line-width: 0.5; }\n [zoom = 12] { line-width: 0.25; }\n }\n}\n\n.road#residential[zoom > 11] {\n ::living_street[highway='living_street'][zoom > 14] {\n line-cap: round;\n [zoom > 17] { line-dasharray: 6,24; }\n [zoom = 17] { line-dasharray: 3,12; }\n [zoom < 17] { line-dasharray: 6,12; }\n line-color: #76d276;\n line-opacity: 0.3;\n\n [zoom > 17] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n }\n \n ::private[access='private'],[access='no'],[access='permissive'],[access='customer'],[access='delivery'] {\n line-cap: round;\n [zoom > 17] { line-dasharray: 6,24; }\n [zoom = 17] { line-dasharray: 3,12; }\n [zoom < 17] { line-dasharray: 6,12; }\n line-color: @private_road_colour;\n line-opacity: 0.3;\n\n [zoom > 17] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n }\n\n [zoom > 17] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n\n}\n\n\/* sets the colours for the road classification,\n but also draws the default line where .road doesn't apply\n ie. for zoom < 12 *\/\n.road#unclassified{\n}\n\n.road#tertiary[zoom > 11] {\n line-color: @tertiary_road_colour;\n}\n\n.road#secondary[zoom > 7] {\n line-color: @secondary_road_colour;\n [zoom = 12] { line-width: 1.0}\n}\n\n.road#primary[zoom > 6] {\n line-color: @primary_road_colour;\n [zoom = 12] { line-width: 1.5}\n}\n\n.road#trunk[zoom > 5] {\n line-color: @trunk_road_colour;\n \n [zoom = 15] { line-width: 3; }\n [zoom = 14] { line-width: 2.75; }\n [zoom = 13] { line-width: 2.5; }\n [zoom = 12] { line-width: 2.0; }\n [zoom = 11] { line-width: 1.25; }\n}\n\n.road#motorway[zoom > 4] {\n line-color: @motorway_road_colour;\n \n \/* keep in mind that most motorways are dual-carraige ways, and\n the current mapnik\/osm2pgsql doesn't combine these into one\n for low zooms *\/\n \n [zoom = 16] { line-width: 6; }\n [zoom = 15] { line-width: 4; }\n [zoom = 14] { line-width: 3; }\n [zoom = 13] { line-width: 2.5; }\n [zoom = 12] { line-width: 2.0; }\n [zoom = 11] { line-width: 1.75; }\n [zoom = 10] { line-width: 1.5; }\n}\n","old_contents":"\/* Roads, footpaths, tracks *\/\n\n\n@private_road_colour: #c02c34;\n\n@tertiary_road_colour: #faf555;\n@secondary_road_colour: #d46833;\n@primary_road_colour: #cc3737;\n@trunk_road_colour: #650f0d;\n@motorway_road_colour: #7c0046;\n\n\/* paths (footway, cycleway, track) are dotted, the halo is behind the\n dots *\/\n@path_halo_opacity: 0.3;\n@path_halo_colour: white;\n@path_dot_opacity: 1.0;\n\n\/* highway labels *\/\n@highway_face_name: \"Liberation Sans Regular\";\n@highway_text_fill: white;\n@highway_halo_fill: black;\n@highway_halo_radius: 2.0;\n\n\/*\n service black\n residential black\n unclassified black\n tertiary yellow\n secondary orange\n primary red\n trunk blue\n motorway dark red\n*\/\n\n#highway-labels[highway='footway'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='cycleway'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='path'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='track'][zoom > 13] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n#highway-labels[highway='service'][zoom > 16] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='residential'][zoom > 15] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='unclassified'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='tertiary'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='secondary'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='primary'][zoom > 13] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='trunk'][zoom > 12] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='motorway'][zoom > 11] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n\/* default style for all path, footway, track, cycleways and roads *\/\n.highway[zoom > 12] {\n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n\n line-width: 1;\n}\n\n\/* defaults for roads with cars *\/\n.road[zoom > 11] {\n ::oneway_arrow[oneway='yes'][zoom > 14] {\n marker-type: arrow;\n\n marker-width: 2;\n marker-line-width: 2;\n\n marker-opacity: 1.0;\n marker-line-opacity: 1.0;\n\n marker-fill: white;\n marker-line-color: white;\n\n marker-spacing: 100;\n }\n\n line-color: #000000;\n line-join: round;\n line-cap: round;\n\n line-width: 1;\n\n [zoom > 17] { line-width: 15; line-opacity: 0.5; }\n [zoom = 17] { line-width: 10; line-opacity: 0.5; }\n [zoom = 16] { line-width: 5; line-opacity: 0.5; }\n [zoom = 15] { line-width: 2.25; line-opacity: 0.6; }\n [zoom = 14] { line-width: 1.5; line-opacity: 0.7; }\n [zoom = 13] { line-width: 1; line-opacity: 0.8; }\n [zoom = 12] { line-width: 0.5; line-opacity: 0.8; }\n\n ::bridge[bridge='yes'] {\n \/*\n ideally we would draw two lines outside the existing line,\n but the current compositing method in mapnik won't allow this\n so easily with transparency\n\n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n\n [zoom > 17] { line-width: 20; }\n [zoom = 17] { line-width: 15; }\n [zoom = 16] { line-width: 7; }\n [zoom = 15] { line-width: 3; }\n [zoom = 14] { line-width: 2; }\n [zoom = 13] { line-width: 1.5; }\n [zoom = 12] { line-width: 0.75; }\n *\/\n }\n\n}\n\n.highway#footway[zoom > 13] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n\n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n\n line-color: #FF0000;\n line-opacity: @path_dot_opacity;\n\n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom = 16] { line-width: 2 ; line-dasharray: 1,3 }\n [zoom < 16] { line-width: 1.5; line-dasharray: 1,2 }\n\n [highway='steps']{\n line-cap: butt;\n\n [zoom > 18] { line-dasharray: 3,4 }\n [zoom = 18] { line-dasharray: 2,3 }\n [zoom < 18] { line-dasharray: 1,2 }\n }\n\n}\n\n.highway#path[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n\n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n line-color: #000000;\n line-opacity: @path_dot_opacity;\n\n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom = 16] { line-width: 2 ; line-dasharray: 1,3 }\n [zoom < 16] { line-width: 1.5; line-dasharray: 1,2 }\n\n}\n\n.highway#track[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n\n [zoom > 18] { line-width: 16 }\n [zoom = 18] { line-width: 10 }\n [zoom = 17] { line-width: 6 }\n [zoom = 16] { line-width: 4.5 }\n [zoom = 15] { line-width: 3.2 }\n [zoom = 14] { line-width: 3 }\n [zoom = 13] { line-width: 2.4 }\n }\n\n line-color: #6d4f15;\n line-opacity: @path_dot_opacity;\n\n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 3,4 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 3,4 }\n [zoom = 16] { line-width: 2.1; line-dasharray: 3,4 }\n [zoom = 15] { line-width: 1.8; line-dasharray: 3,4 }\n [zoom = 14] { line-width: 1.5; line-dasharray: 3,4 }\n [zoom = 13] { line-width: 1.2 ; line-dasharray: 3,4 }\n\n}\n\n.highway#cycleway[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n\n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n\n line-color: #0000ff;\n line-opacity: @path_dot_opacity;\n\n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom = 16] { line-width: 2 ; line-dasharray: 1,3 }\n [zoom < 16] { line-width: 1.5; line-dasharray: 1,2 }\n\n}\n\n.road#service[zoom > 11] {\n [zoom > 17] { line-width: 7.5; }\n [zoom = 17] { line-width: 5; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 1; }\n [zoom = 14] { line-width: 0.75; }\n [zoom = 13] { line-width: 0.5; }\n [zoom = 12] { line-width: 0.25; }\n\n [service='parking_aisle'][zoom > 14] {\n [zoom > 17] { line-width: 3; }\n [zoom = 17] { line-width: 2.5; }\n [zoom = 16] { line-width: 1.25; }\n [zoom = 15] { line-width: 0.25; }\n }\n \n ::private[access='private'],[access='no'],[access='permissive'],[access='customer'],[access='delivery'] {\n line-cap: butt;\n line-dasharray: 6,6;\n line-color: @private_road_colour;\n line-opacity: 0.5;\n\n [zoom > 17] { line-width: 7.5; }\n [zoom = 17] { line-width: 5; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 1; }\n [zoom = 14] { line-width: 0.75; }\n [zoom = 13] { line-width: 0.5; }\n [zoom = 12] { line-width: 0.25; }\n }\n}\n\n.road#residential[zoom > 11] {\n ::living_street[highway='living_street'][zoom > 14] {\n line-cap: round;\n [zoom > 17] { line-dasharray: 6,24; }\n [zoom = 17] { line-dasharray: 3,12; }\n [zoom < 17] { line-dasharray: 6,12; }\n line-color: #76d276;\n line-opacity: 0.3;\n\n [zoom > 17] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n }\n \n ::private[access='private'],[access='no'],[access='permissive'],[access='customer'],[access='delivery'] {\n line-cap: round;\n [zoom > 17] { line-dasharray: 6,24; }\n [zoom = 17] { line-dasharray: 3,12; }\n [zoom < 17] { line-dasharray: 6,12; }\n line-color: @private_road_colour;\n line-opacity: 0.3;\n\n [zoom > 17] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n }\n\n [zoom > 17] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n\n}\n\n\/* sets the colours for the road classification,\n but also draws the default line where .road doesn't apply\n ie. for zoom < 12 *\/\n.road#unclassified{\n}\n\n.road#tertiary[zoom > 11] {\n line-color: @tertiary_road_colour;\n}\n\n.road#secondary[zoom > 7] {\n line-color: @secondary_road_colour;\n [zoom = 12] { line-width: 1.0}\n}\n\n.road#primary[zoom > 6] {\n line-color: @primary_road_colour;\n [zoom = 12] { line-width: 1.5}\n}\n\n.road#trunk[zoom > 5] {\n line-color: @trunk_road_colour;\n \n [zoom = 15] { line-width: 3; }\n [zoom = 14] { line-width: 2.75; }\n [zoom = 13] { line-width: 2.5; }\n [zoom = 12] { line-width: 2.0; }\n [zoom = 11] { line-width: 1.25; }\n}\n\n.road#motorway[zoom > 4] {\n line-color: @motorway_road_colour;\n \n \/* keep in mind that most motorways are dual-carraige ways, and\n the current mapnik\/osm2pgsql doesn't combine these into one\n for low zooms *\/\n \n [zoom = 16] { line-width: 6; }\n [zoom = 15] { line-width: 4; }\n [zoom = 14] { line-width: 3; }\n [zoom = 13] { line-width: 2.5; }\n [zoom = 12] { line-width: 2.0; }\n [zoom = 11] { line-width: 1.75; }\n [zoom = 10] { line-width: 1.5; }\n}\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"CartoCSS"} {"commit":"96c63eab8e13a81887b8267abea85d48ac81c9ef","subject":"#5 adjust halos for parks \/ open space","message":"#5 adjust halos for parks \/ open space\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Narrow Bold', 'Unifont Bold';\n\n@label_color_transport: #524c4c;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: #F7F7E6;\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 0.7), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: 2;\n}\n\n#shields { \n [zoom>=11] {\n\n \/* tmp place holder for hwy shields *\/\n\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n text-face-name: @text_font_water_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][changed!='']\n{\n text-name: [name];\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n text-face-name: @text_font_water;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 18;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-size: 22;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 22;\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.1;\n \/\/}\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-placement: interior;\n text-vertical-alignment: bottom;\n text-min-distance: 5;\n text-dy: -5;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n\n [justified='left'] {\n \/\/text-horizontal-alignment: left;\n text-horizontal-alignment: middle;\n \/\/text-dx: 20;\n }\n\n [justified='right'] {\n \/\/text-horizontal-alignment: right;\n text-horizontal-alignment: middle;\n \/\/text-dx: -20;\n }\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size>=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.3;\n \/\/}\n [justified='left'] {\n text-horizontal-alignment: left;\n text-dx: 15;\n }\n\n [justified='right'] {\n text-horizontal-alignment: right;\n text-dx: -15;\n }\n\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_sm;\n text-min-distance: 5;\n text-allow-overlap: true;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_halo_high;\n text-halo-comp-op: overlay;\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n \n [zoom>=11] {\n text-halo-fill: @label_color_places_halo_low;\n }\n}\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n marker-ignore-placement: true;\n marker-width: 5;\n marker-fill: #2e2115;\n marker-line-width: 0;\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n\n","old_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Narrow Bold', 'Unifont Bold';\n\n@label_color_transport: #524c4c;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: #F7F7E6;\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 0.7), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: 2;\n}\n\n#shields { \n [zoom>=11] {\n\n \/* tmp place holder for hwy shields *\/\n\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n text-face-name: @text_font_water_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][changed!='']\n{\n text-name: [name];\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n text-face-name: @text_font_water;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=11] {\n text-fill: #586e50;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n\n [zoom>=11] {\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_green_area_halo;\n }\n [zoom>=15] {\n text-halo-radius: @text_font_halo_radius_large;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 18;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-size: 22;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 22;\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.1;\n \/\/}\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-placement: interior;\n text-vertical-alignment: bottom;\n text-min-distance: 5;\n text-dy: -5;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n\n [justified='left'] {\n \/\/text-horizontal-alignment: left;\n text-horizontal-alignment: middle;\n \/\/text-dx: 20;\n }\n\n [justified='right'] {\n \/\/text-horizontal-alignment: right;\n text-horizontal-alignment: middle;\n \/\/text-dx: -20;\n }\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size>=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.3;\n \/\/}\n [justified='left'] {\n text-horizontal-alignment: left;\n text-dx: 15;\n }\n\n [justified='right'] {\n text-horizontal-alignment: right;\n text-dx: -15;\n }\n\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_sm;\n text-min-distance: 5;\n text-allow-overlap: true;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_halo_high;\n text-halo-comp-op: overlay;\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n \n [zoom>=11] {\n text-halo-fill: @label_color_places_halo_low;\n }\n}\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n marker-ignore-placement: true;\n marker-width: 5;\n marker-fill: #2e2115;\n marker-line-width: 0;\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"c4d2a5fdee66b0e3c45c2f3aa47730ba3de9d4f7","subject":"lighten minor roads","message":"lighten minor roads\n","repos":"Andrey-Pavlov\/toner-carto,stamen\/toner-carto","old_file":"toner-lite.mss","new_file":"toner-lite.mss","new_contents":"@color_physical: lighten(#000, 85%); \n@color_physical_bright: #fff;\n@color_water: lighten(#000, 85%);\n@color_administrative_dark: lighten(#000, 55%);\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: lighten(#000, 55%);\n@color_administrative_medium_high: lighten(#000, 55%);\n@color_administrative_medium_high2: lighten(#000, 55%);\n@color_transport: lighten(#000, 55%);\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: lighten(#ccc, 60%);\n@color_transport_minor: lighten(#ccc, 60%);\n@color_transport_rail: lighten(#444, 60%);\n@color_transport_path: lighten(#ededed, 60%);\n@color_building_outline: lighten(#000, 72%);\n@color_building_outline_special: lighten(#00aeef, 72%);\n@color_airport_runways: lighten(#eee, 55%);\n@color_airport_runways_detail: lighten(#f2f2f2, 55%);\n@halftone_opacity: 0.15;\n\n","old_contents":"@color_physical: lighten(#000, 85%); \n@color_physical_bright: #fff;\n@color_water: lighten(#000, 85%);\n@color_administrative_dark: lighten(#000, 55%);\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: lighten(#000, 55%);\n@color_administrative_medium_high: lighten(#000, 55%);\n@color_administrative_medium_high2: lighten(#000, 55%);\n@color_transport: lighten(#000, 55%);\n@color_transport_casing: lighten(#fff, 55%);\n@color_transport_inline: lighten(#fff, 55%);\n@color_transport_tunnel: lighten(#ccc, 55%);\n@color_transport_minor: lighten(#ccc, 55%);\n@color_transport_rail: lighten(#444, 55%);\n@color_transport_path: lighten(#ededed, 55%);\n@color_building_outline: lighten(#000, 72%);\n@color_building_outline_special: lighten(#00aeef, 72%);\n@color_airport_runways: lighten(#eee, 55%);\n@color_airport_runways_detail: lighten(#f2f2f2, 55%);\n@halftone_opacity: 0.15;\n\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"299f1cc2bee74ca1afd0b42d79b8763b50d09fc5","subject":"changed comments from \/* to \/\/ in order to allow for easier commenting out large sections while debugging","message":"changed comments from \/* to \/\/ in order to allow for easier commenting out large sections while debugging\n","repos":"karlwettin\/tilemill-style-hydda,karlwettin\/tilemill-style-hydda","old_file":"hyddafull\/labels.mss","new_file":"hyddafull\/labels.mss","new_contents":"\/* LABELS.MSS CONTENTS:\n * - place names\n * - area labels\n * - waterway labels \n *\/\n\n\/* Font sets are defined in palette.mss *\/\n\n\/* Mapnik does not yet support character-spacing adjustments for \n labels placed along a line. We can fake this using the replace()\n function in the text-name parameter by replacing each character\n with itself followed by one or more spaces. *\/\n\n\/* ================================================================== *\/\n\/* PLACE NAMES\n\/* ================================================================== *\/\n\n#place::country[type='country'][zoom>3][zoom<9] {\n text-name:'[name]';\n text-face-name:@sans_bold;\n text-placement:point;\n text-fill:@country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n [zoom=3] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=4] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>4] {\n text-halo-radius: 2;\n }\n [zoom=5] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=6] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=7] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n#place::state[type='state'][zoom>=5][zoom<=10] {\n text-name:'[name]';\n text-face-name:@sans_bold_italic;\n text-placement:point;\n text-fill:@state_text;\n text-halo-fill: @state_halo;\n text-halo-radius: 1;\n [zoom=6] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=7] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>8] {\n text-halo-radius: 2;\n }\n [zoom=8] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=9] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=10] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n\/\/ ---- Cities ------------------------------------------------------\n\n#place::city[type='city'][zoom>=2][zoom<=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@city_text;\n text-halo-fill:@city_halo;\n text-halo-radius:2;\n [zoom<=8] {\n text-size: 10;\n text-halo-radius:1;\n }\n [zoom=9] {\n text-size:10;\n text-wrap-width: 60;\n }\n [zoom=10] {\n text-size:11;\n text-wrap-width: 70;\n }\n [zoom=11] {\n text-size:12;\n text-character-spacing: 1;\n text-wrap-width: 80;\n }\n [zoom=12] {\n text-size:13;\n text-character-spacing: 1;\n text-wrap-width: 100;\n }\n [zoom=13] {\n text-size:14;\n text-character-spacing: 2;\n text-wrap-width: 200;\n text-transform: uppercase;\n }\n [zoom=14] {\n text-size:15;\n text-character-spacing: 4;\n text-wrap-width: 300;\n text-transform: uppercase;\n }\n [zoom=15] {\n text-size:16;\n text-character-spacing: 6;\n text-wrap-width: 400;\n text-transform: uppercase;\n }\n}\n\n\/\/ ---- Towns -------------------------------------------------------\n\n#place::town[type='town'][zoom>=9][zoom<=17] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@town_text;\n text-size:9;\n text-halo-fill:@town_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n [zoom>=10] {\n text-halo-radius:2;\n text-size: 10;\n }\n [zoom>=11]{ text-size:11; }\n [zoom>=12]{\n text-size:12;\n text-line-spacing: 1;\n }\n [zoom>=13]{\n text-transform: uppercase;\n text-character-spacing: 1;\n text-line-spacing: 2;\n }\n [zoom>=14]{\n text-size:13;\n text-character-spacing: 2;\n text-line-spacing: 3;\n }\n [zoom>=15]{\n text-size:14;\n text-character-spacing: 3;\n text-line-spacing: 4;\n }\n [zoom>=15]{\n text-size:15;\n text-character-spacing: 4;\n text-line-spacing: 5;\n }\n [zoom>=17]{\n text-size:16;\n text-character-spacing: 5;\n text-line-spacing: 6;\n }\n}\n\n\/\/ ---- Other small places ------------------------------------------\n\n#place::small[type='village'][zoom>=13],\n#place::small[type='suburb'][zoom>=13],\n#place::small[type='hamlet'][zoom>=13]{\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@other_text;\n text-size:10;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=14] {\n text-size:11;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-line-spacing: 1;\n }\n [zoom>=15] {\n text-halo-radius: 2;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-wrap-width: 60; \n text-line-spacing: 1;\n }\n [zoom>=16] {\n text-size:12;\n text-character-spacing: 2;\n text-wrap-width: 120;\n text-line-spacing: 2;\n } \n [zoom>=17] {\n text-size:13; \n text-character-spacing: 3;\n text-wrap-width: 160;\n text-line-spacing: 4;\n }\n [zoom>=18] {\n text-size:14;\n text-character-spacing: 4;\n text-line-spacing: 6;\n }\n}\n\n#place::small[type='locality'][zoom>=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@locality_text;\n text-size:9;\n text-halo-fill:@locality_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=16] {\n text-size:10;\n text-wrap-width: 60;\n text-line-spacing: 1;\n }\n [zoom>=17] {\n text-size:11;\n text-wrap-width: 120;\n text-line-spacing: 2;\n }\n [zoom>=18] {\n text-size:12;\n text-character-spacing: 1;\n text-line-spacing: 4;\n }\n}\n\n\n\/\/ ==================================================================\n\/\/ AREA LABELS\n\/\/ ==================================================================\n\n#area_label[type='golf_course'][zoom>=10],\n#area_label[type='park'][zoom>=10] {\n text-name: \"''\";\n text-fill: @park * 0.6;\n text-halo-fill: fadeout(@park,25%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom>=15][area>1600000],\n [zoom>=16][area>80000],\n [zoom>=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='cemetery'][zoom>=10] {\n text-name: \"''\";\n text-fill: @cemetery * 0.6;\n text-halo-fill: fadeout(@cemetery,25%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='hospital'][zoom>=10] {\n text-name: \"''\";\n text-fill: @hospital * 0.6;\n text-halo-fill: fadeout(lighten(@hospital,10%),50%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='college'][zoom>=10],\n#area_label[type='school'][zoom>=10],\n#area_label[type='university'][zoom>=10] {\n text-name: \"''\";\n text-fill: @school * 0.6;\n text-halo-fill: fadeout(lighten(@school,10%),50%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='water'][zoom>=10] {\n text-name: \"''\";\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-face-name:@sans_italic;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n text-character-spacing: 1;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 2;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 3;\n text-wrap-width: 180;\n }\n}\n \n#poi[type='university'][zoom>=15],\n#poi[type='hospital'][zoom>=16],\n#poi[type='school'][zoom>=17],\n#poi[type='library'][zoom>=17] {\n text-name:\"[name]\";\n text-face-name:@sans;\n text-size:10;\n text-wrap-width:30;\n text-fill: @poi_text;\n}\n\n\n\n\n\/\/ Islands and islets\n\n\n#island_label_polygon {\n [zoom=10][area>2000000],\n [zoom=11][area>500000],\n [zoom=12][area>200000],\n [zoom=13][area>50000],\n [zoom=14][area>10000],\n [zoom=15][area>2500],\n [zoom>15][area>0] {\n text-name: \"[name]\";\n text-fill:@island_text;\n text-face-name:@sans;\n text-size:9;\n text-halo-fill:@island_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n text-placement: interior;\n }\n}\n\n\n\/\/ nodes with name and place=island\/islet \n#island_label_point {\n [zoom>=13] {\n text-name: \"[name]\";\n text-fill:@island_text;\n text-face-name:@sans;\n text-size:9;\n text-halo-fill:@island_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n text-placement: interior;\n }\n}\n\n\n\/\/ Residential is often used as neighborhood name, block name and more\n\n#area_label[type = 'residential']{ \n [zoom=12][area>1280000],\n [zoom=13][area>640000],\n [zoom=14][area>320000],\n [zoom=15][area>240000],\n [zoom=16][area>90000],\n [zoom=17][area>10000],\n [zoom=18][area>=0] {\n text-name: \"[name]\";\n text-fill:@other_text;\n text-face-name:@sans;\n text-size:9;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n text-placement: interior; \n }\n}\n\n\/\/ ==================================================================\n\/\/ WATERWAY LABELS\n\/\/ ==================================================================\n\n#waterway_label[type='river'][zoom>=13],\n#waterway_label[type='canal'][zoom>=15],\n#waterway_label[type='stream'][zoom>=17] {\n text-name: '[name]';\n text-face-name: @sans_italic;\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-placement: line;\n text-min-distance: 400;\n text-size: 10;\n [type='river'][zoom=14],\n [type='canal'][zoom=16],\n [type='stream'][zoom=18] {\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n }\n [type='river'][zoom=15],\n [type='canal'][zoom=17] {\n text-size: 11;\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n }\n [type='river'][zoom>=16],\n [type='canal'][zoom=18] {\n text-size: 14;\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n text-spacing: 300;\n }\n}\n\n\/\/ ==================================================================\n\/\/ ROAD LABELS\n\/\/ ==================================================================\n\n#motorway_label[zoom>=11][zoom<=14][reflen<=8] {\n shield-name: \"[ref]\";\n shield-size: 9;\n shield-face-name: @sans_bold;\n shield-fill: #fff;\n shield-file: url(img\/shield-motorway-1.png);\n [type='motorway'] {\n [reflen=1] { shield-file: url(img\/shield-motorway-1.png); }\n [reflen=2] { shield-file: url(img\/shield-motorway-2.png); }\n [reflen=3] { shield-file: url(img\/shield-motorway-3.png); }\n [reflen=4] { shield-file: url(img\/shield-motorway-4.png); }\n [reflen=5] { shield-file: url(img\/shield-motorway-5.png); }\n [reflen=6] { shield-file: url(img\/shield-motorway-6.png); }\n [reflen=7] { shield-file: url(img\/shield-motorway-7.png); }\n [reflen=8] { shield-file: url(img\/shield-motorway-8.png); }\n }\n [type='trunk'] {\n [reflen=1] { shield-file: url(img\/shield-trunk-1.png); }\n [reflen=2] { shield-file: url(img\/shield-trunk-2.png); }\n [reflen=3] { shield-file: url(img\/shield-trunk-3.png); }\n [reflen=4] { shield-file: url(img\/shield-trunk-4.png); }\n [reflen=5] { shield-file: url(img\/shield-trunk-5.png); }\n [reflen=6] { shield-file: url(img\/shield-trunk-6.png); }\n [reflen=7] { shield-file: url(img\/shield-trunk-7.png); }\n [reflen=8] { shield-file: url(img\/shield-trunk-8.png); }\n }\n [zoom=11] { shield-min-distance: 60; } \/\/50\n [zoom=12] { shield-min-distance: 80; } \/\/60\n [zoom=13] { shield-min-distance: 120; } \/\/120\n [zoom=14] { shield-min-distance: 180; }\n}\n\n#motorway_label[type='motorway'][zoom>9],\n#motorway_label[type='trunk'][zoom>9] {\n text-name:\"[name]\";\n text-face-name:@sans_bold;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:10;\n [zoom=11] { text-min-distance:70; }\n [zoom=12] { text-min-distance:80; }\n [zoom=13] { text-min-distance:100; }\n}\n\n#mainroad_label[type='primary'][zoom>12],\n#mainroad_label[type='secondary'][zoom>13],\n#mainroad_label[type='tertiary'][zoom>13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n#minorroad_label[zoom>14] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-size:9;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n\/\/ ==================================================================\n\/\/ ONE-WAY ARROWS\n\/\/ ==================================================================\n\n#motorway_label[oneway!=0][oneway!='no'][oneway!='false'][zoom>=16],\n#mainroad_label[oneway!=0][oneway!='no'][oneway!='false'][zoom>=16],\n#minorroad_label[oneway!=0][oneway!='no'][oneway!='false'][zoom>=16] {\n marker-placement:line;\n marker-max-error: 0.5;\n marker-spacing: 200;\n marker-file: url(img\/icon\/oneway.svg);\n [oneway=-1] { marker-file: url(img\/icon\/oneway-reverse.svg); }\n [oneway='reverse'] { marker-file: url(img\/icon\/oneway-reverse.svg); }\n [zoom=16] { marker-transform: \"scale(0.5)\"; }\n [zoom=17] { marker-transform: \"scale(0.75)\"; }\n}\n\n\/* house names and numbers *\/\n\n#housenumbers {\n [zoom >= 18] {\n text-name: \"[addr:housenumber]\";\n text-placement: interior;\n text-min-distance: 1;\n text-wrap-width: 0;\n text-face-name: @sans_lt;\n text-fill: #444;\n text-size: 9;\n }\n}\n\n#housenames {\n [zoom >= 17] {\n text-name: \"[addr:housename]\";\n text-placement: interior;\n text-wrap-width: 20;\n text-face-name: @sans_lt;\n text-size: 8;\n text-fill: #444;\n [zoom >= 18] {\n text-size: 9;\n }\n }\n}\n\n\n","old_contents":"\/* LABELS.MSS CONTENTS:\n * - place names\n * - area labels\n * - waterway labels \n *\/\n\n\/* Font sets are defined in palette.mss *\/\n\n\/* Mapnik does not yet support character-spacing adjustments for \n labels placed along a line. We can fake this using the replace()\n function in the text-name parameter by replacing each character\n with itself followed by one or more spaces. *\/\n\n\/* ================================================================== *\/\n\/* PLACE NAMES\n\/* ================================================================== *\/\n\n#place::country[type='country'][zoom>3][zoom<9] {\n text-name:'[name]';\n text-face-name:@sans_bold;\n text-placement:point;\n text-fill:@country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n [zoom=3] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=4] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>4] {\n text-halo-radius: 2;\n }\n [zoom=5] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=6] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=7] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n#place::state[type='state'][zoom>=5][zoom<=10] {\n text-name:'[name]';\n text-face-name:@sans_bold_italic;\n text-placement:point;\n text-fill:@state_text;\n text-halo-fill: @state_halo;\n text-halo-radius: 1;\n [zoom=6] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=7] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>8] {\n text-halo-radius: 2;\n }\n [zoom=8] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=9] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=10] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n\/* ---- Cities ------------------------------------------------------ *\/\n\n#place::city[type='city'][zoom>=2][zoom<=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@city_text;\n text-halo-fill:@city_halo;\n text-halo-radius:2;\n [zoom<=8] {\n text-size: 10;\n text-halo-radius:1;\n }\n [zoom=9] {\n text-size:10;\n text-wrap-width: 60;\n }\n [zoom=10] {\n text-size:11;\n text-wrap-width: 70;\n }\n [zoom=11] {\n text-size:12;\n text-character-spacing: 1;\n text-wrap-width: 80;\n }\n [zoom=12] {\n text-size:13;\n text-character-spacing: 1;\n text-wrap-width: 100;\n }\n [zoom=13] {\n text-size:14;\n text-character-spacing: 2;\n text-wrap-width: 200;\n text-transform: uppercase;\n }\n [zoom=14] {\n text-size:15;\n text-character-spacing: 4;\n text-wrap-width: 300;\n text-transform: uppercase;\n }\n [zoom=15] {\n text-size:16;\n text-character-spacing: 6;\n text-wrap-width: 400;\n text-transform: uppercase;\n }\n}\n\n\/* ---- Towns ------------------------------------------------------- *\/\n\n#place::town[type='town'][zoom>=9][zoom<=17] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@town_text;\n text-size:9;\n text-halo-fill:@town_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n [zoom>=10] {\n text-halo-radius:2;\n text-size: 10;\n }\n [zoom>=11]{ text-size:11; }\n [zoom>=12]{\n text-size:12;\n text-line-spacing: 1;\n }\n [zoom>=13]{\n text-transform: uppercase;\n text-character-spacing: 1;\n text-line-spacing: 2;\n }\n [zoom>=14]{\n text-size:13;\n text-character-spacing: 2;\n text-line-spacing: 3;\n }\n [zoom>=15]{\n text-size:14;\n text-character-spacing: 3;\n text-line-spacing: 4;\n }\n [zoom>=15]{\n text-size:15;\n text-character-spacing: 4;\n text-line-spacing: 5;\n }\n [zoom>=17]{\n text-size:16;\n text-character-spacing: 5;\n text-line-spacing: 6;\n }\n}\n\n\/* ---- Other small places ------------------------------------------ *\/\n\n#place::small[type='village'][zoom>=13],\n#place::small[type='suburb'][zoom>=13],\n#place::small[type='hamlet'][zoom>=13]{\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@other_text;\n text-size:10;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=14] {\n text-size:11;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-line-spacing: 1;\n }\n [zoom>=15] {\n text-halo-radius: 2;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-wrap-width: 60; \n text-line-spacing: 1;\n }\n [zoom>=16] {\n text-size:12;\n text-character-spacing: 2;\n text-wrap-width: 120;\n text-line-spacing: 2;\n } \n [zoom>=17] {\n text-size:13; \n text-character-spacing: 3;\n text-wrap-width: 160;\n text-line-spacing: 4;\n }\n [zoom>=18] {\n text-size:14;\n text-character-spacing: 4;\n text-line-spacing: 6;\n }\n}\n\n#place::small[type='locality'][zoom>=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@locality_text;\n text-size:9;\n text-halo-fill:@locality_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=16] {\n text-size:10;\n text-wrap-width: 60;\n text-line-spacing: 1;\n }\n [zoom>=17] {\n text-size:11;\n text-wrap-width: 120;\n text-line-spacing: 2;\n }\n [zoom>=18] {\n text-size:12;\n text-character-spacing: 1;\n text-line-spacing: 4;\n }\n}\n\n\n\/* ================================================================== *\/\n\/* AREA LABELS\n\/* ================================================================== *\/\n\n#area_label[type='golf_course'][zoom>=10],\n#area_label[type='park'][zoom>=10] {\n text-name: \"''\";\n text-fill: @park * 0.6;\n text-halo-fill: fadeout(@park,25%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom>=15][area>1600000],\n [zoom>=16][area>80000],\n [zoom>=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='cemetery'][zoom>=10] {\n text-name: \"''\";\n text-fill: @cemetery * 0.6;\n text-halo-fill: fadeout(@cemetery,25%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='hospital'][zoom>=10] {\n text-name: \"''\";\n text-fill: @hospital * 0.6;\n text-halo-fill: fadeout(lighten(@hospital,10%),50%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='college'][zoom>=10],\n#area_label[type='school'][zoom>=10],\n#area_label[type='university'][zoom>=10] {\n text-name: \"''\";\n text-fill: @school * 0.6;\n text-halo-fill: fadeout(lighten(@school,10%),50%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='water'][zoom>=10] {\n text-name: \"''\";\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-face-name:@sans_italic;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n text-character-spacing: 1;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 2;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 3;\n text-wrap-width: 180;\n }\n}\n \n#poi[type='university'][zoom>=15],\n#poi[type='hospital'][zoom>=16],\n#poi[type='school'][zoom>=17],\n#poi[type='library'][zoom>=17] {\n text-name:\"[name]\";\n text-face-name:@sans;\n text-size:10;\n text-wrap-width:30;\n text-fill: @poi_text;\n}\n\n\n\n\n\/* Islands and islets *\/ \n\n\n#island_label_polygon {\n [zoom=10][area>2000000],\n [zoom=11][area>500000],\n [zoom=12][area>200000],\n [zoom=13][area>50000],\n [zoom=14][area>10000],\n [zoom=15][area>2500],\n [zoom>15][area>0] {\n text-name: \"[name]\";\n text-fill:@island_text;\n text-face-name:@sans;\n text-size:9;\n text-halo-fill:@island_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n text-placement: interior;\n }\n}\n\n\n\/\/ nodes with name and place=island\/islet \n#island_label_point {\n [zoom>=13] {\n text-name: \"[name]\";\n text-fill:@island_text;\n text-face-name:@sans;\n text-size:9;\n text-halo-fill:@island_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n text-placement: interior;\n }\n}\n\n\n\/* residential is often used as neighborhood name, block name and more*\/\n\n#area_label[type = 'residential']{ \n [zoom=12][area>1280000],\n [zoom=13][area>640000],\n [zoom=14][area>320000],\n [zoom=15][area>240000],\n [zoom=16][area>90000],\n [zoom=17][area>10000],\n [zoom=18][area>=0] {\n text-name: \"[name]\";\n text-fill:@other_text;\n text-face-name:@sans;\n text-size:9;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n text-placement: interior; \n }\n}\n\n\/* ================================================================== *\/\n\/* WATERWAY LABELS\n\/* ================================================================== *\/\n\n#waterway_label[type='river'][zoom>=13],\n#waterway_label[type='canal'][zoom>=15],\n#waterway_label[type='stream'][zoom>=17] {\n text-name: '[name]';\n text-face-name: @sans_italic;\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-placement: line;\n text-min-distance: 400;\n text-size: 10;\n [type='river'][zoom=14],\n [type='canal'][zoom=16],\n [type='stream'][zoom=18] {\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n }\n [type='river'][zoom=15],\n [type='canal'][zoom=17] {\n text-size: 11;\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n }\n [type='river'][zoom>=16],\n [type='canal'][zoom=18] {\n text-size: 14;\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n text-spacing: 300;\n }\n}\n\n\/* ================================================================== *\/\n\/* ROAD LABELS\n\/* ================================================================== *\/\n\n#motorway_label[zoom>=11][zoom<=14][reflen<=8] {\n shield-name: \"[ref]\";\n shield-size: 9;\n shield-face-name: @sans_bold;\n shield-fill: #fff;\n shield-file: url(img\/shield-motorway-1.png);\n [type='motorway'] {\n [reflen=1] { shield-file: url(img\/shield-motorway-1.png); }\n [reflen=2] { shield-file: url(img\/shield-motorway-2.png); }\n [reflen=3] { shield-file: url(img\/shield-motorway-3.png); }\n [reflen=4] { shield-file: url(img\/shield-motorway-4.png); }\n [reflen=5] { shield-file: url(img\/shield-motorway-5.png); }\n [reflen=6] { shield-file: url(img\/shield-motorway-6.png); }\n [reflen=7] { shield-file: url(img\/shield-motorway-7.png); }\n [reflen=8] { shield-file: url(img\/shield-motorway-8.png); }\n }\n [type='trunk'] {\n [reflen=1] { shield-file: url(img\/shield-trunk-1.png); }\n [reflen=2] { shield-file: url(img\/shield-trunk-2.png); }\n [reflen=3] { shield-file: url(img\/shield-trunk-3.png); }\n [reflen=4] { shield-file: url(img\/shield-trunk-4.png); }\n [reflen=5] { shield-file: url(img\/shield-trunk-5.png); }\n [reflen=6] { shield-file: url(img\/shield-trunk-6.png); }\n [reflen=7] { shield-file: url(img\/shield-trunk-7.png); }\n [reflen=8] { shield-file: url(img\/shield-trunk-8.png); }\n }\n [zoom=11] { shield-min-distance: 60; } \/\/50\n [zoom=12] { shield-min-distance: 80; } \/\/60\n [zoom=13] { shield-min-distance: 120; } \/\/120\n [zoom=14] { shield-min-distance: 180; }\n}\n\n#motorway_label[type='motorway'][zoom>9],\n#motorway_label[type='trunk'][zoom>9] {\n text-name:\"[name]\";\n text-face-name:@sans_bold;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:10;\n [zoom=11] { text-min-distance:70; }\n [zoom=12] { text-min-distance:80; }\n [zoom=13] { text-min-distance:100; }\n}\n\n#mainroad_label[type='primary'][zoom>12],\n#mainroad_label[type='secondary'][zoom>13],\n#mainroad_label[type='tertiary'][zoom>13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n#minorroad_label[zoom>14] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-size:9;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n\/* ================================================================== *\/\n\/* ONE-WAY ARROWS\n\/* ================================================================== *\/\n\n#motorway_label[oneway!=0][oneway!='no'][oneway!='false'][zoom>=16],\n#mainroad_label[oneway!=0][oneway!='no'][oneway!='false'][zoom>=16],\n#minorroad_label[oneway!=0][oneway!='no'][oneway!='false'][zoom>=16] {\n marker-placement:line;\n marker-max-error: 0.5;\n marker-spacing: 200;\n marker-file: url(img\/icon\/oneway.svg);\n [oneway=-1] { marker-file: url(img\/icon\/oneway-reverse.svg); }\n [oneway='reverse'] { marker-file: url(img\/icon\/oneway-reverse.svg); }\n [zoom=16] { marker-transform: \"scale(0.5)\"; }\n [zoom=17] { marker-transform: \"scale(0.75)\"; }\n}\n\n\/* house names and numbers *\/\n\n#housenumbers {\n [zoom >= 18] {\n text-name: \"[addr:housenumber]\";\n text-placement: interior;\n text-min-distance: 1;\n text-wrap-width: 0;\n text-face-name: @sans_lt;\n text-fill: #444;\n text-size: 9;\n }\n}\n\n#housenames {\n [zoom >= 17] {\n text-name: \"[addr:housename]\";\n text-placement: interior;\n text-wrap-width: 20;\n text-face-name: @sans_lt;\n text-size: 8;\n text-fill: #444;\n [zoom >= 18] {\n text-size: 9;\n }\n }\n}\n\n\n\/* ****************************************************************** *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"4cef3ad5c5e391322780f2b67274d28159bbf087","subject":"Fixed: Reference to nonexistent object","message":"Fixed: Reference to nonexistent object\n\nThe MeasureLines array was changed to MeasureObjects, but these lines were not updated to reflect this.\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportProcessors.mss","new_file":"src\/ExportProcessors.mss","new_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = sibmei2.GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = sibmei2.GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer) {\n \/\/$module(ExportProcessors.mss)\n ret = null;\n\n if (bobj.Duration < 256)\n {\n \/\/ if this object is an eighth note but is not beamed, and if the\n \/\/ active beam is set, null out the active beam and return null.\n if (bobj.Beam = NoBeam and layer._property:ActiveBeamId != null)\n {\n layer._property:ActiveBeamId = null;\n return ret;\n }\n\n \/*\n It's possible that Sibelius records a 'continue beam' at the start\n of a beamed group. Visually, this doesn't look out of place if the previous\n note was a quarter note or higher. \n \n The first check we do is if the note has a 'continue beam' attribute and\n the previous note has a duration higher than 256 (quarter) then we probably have\n a false negative (i.e., there is the start of a beam, but it isn't necessarily\n encoded correctly).\n *\/\n falseNegative = False;\n next_obj = bobj.NextItem(bobj.VoiceNumber, 'NoteRest');\n\n if ((bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam) and layer._property:ActiveBeamId = null)\n {\n \/\/ by all accounts this should be a beamed note, but we'll need to double-check.\n prev_obj = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n if (prev_obj != null and (prev_obj.Duration >= 256))\n {\n falseNegative = True;\n }\n }\n\n if (next_obj != null and (bobj.Beam = StartBeam or falseNegative = True) and next_obj.Beam = ContinueBeam)\n {\n \/\/ if:\n \/\/ - we're not at the end of the bar\n \/\/ - we have a start beam\n \/\/ - the next note is a continue beam\n beam = libmei.Beam();\n layer._property:ActiveBeamId = beam._id;\n\n \/\/ return the beam so that we can add it to the tree.\n ret = beam;\n }\n\n if (layer._property:ActiveBeamId != null and (bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam))\n {\n beamid = layer._property:ActiveBeamId;\n beam = libmei.getElementById(beamid);\n ret = beam;\n }\n }\n else\n {\n if (layer._property:ActiveBeamId != null)\n {\n \/\/ this is a break in any active beam, so register it as such.\n layer._property:ActiveBeamId = null;\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction ProcessTuplet (bobj, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.ParentTupletIfAny = null)\n {\n return null;\n }\n\n if (layer._property:ActiveTupletId = null)\n {\n tupletObject = bobj.ParentTupletIfAny;\n\n tuplet = libmei.Tuplet();\n\n layer._property:ActiveTupletObject = tupletObject;\n layer._property:ActiveTupletId = tuplet._id;\n\n if (libmei.GetName(meielement) = 'beam')\n {\n \/\/ get the first child\n startid = meielement.children[0];\n }\n else\n {\n startid = meielement._id;\n }\n\n libmei.AddAttribute(tuplet, 'startid', '#' & startid);\n libmei.AddAttribute(tuplet, 'num', tupletObject.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObject.Right);\n\n tupletStyle = tupletObject.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObject.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n return tuplet;\n }\n else\n {\n tid = layer._property:ActiveTupletId;\n t = libmei.getElementById(tid);\n\n if (IsLastNoteInTuplet(bobj))\n {\n libmei.AddAttribute(t, 'endid', '#' & meielement._id);\n layer._property:ActiveTupletObject = null;\n layer._property:ActiveTupletId = null;\n }\n\n return t;\n }\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet, layer) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n \n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it \n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n tupletSpan._property:AddedToMeasure = False;\n\n layer._property:ActiveTupletId = tupletSpan._id;\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (j = 0)\n {\n libmei.AddAttribute(sylel, 'wordpos', 'i'); \/\/ 'initial'\n\n if (lyric_word.Length > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n if (name = 'chord')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'chord'));\n }\n\n libmei.AddChild(obj, verse);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so \n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('242')\n {\n \/\/ triple staccato\n return null;\n }\n }\n} \/\/$end\n","old_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = sibmei2.GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = sibmei2.GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer) {\n \/\/$module(ExportProcessors.mss)\n ret = null;\n\n if (bobj.Duration < 256)\n {\n \/\/ if this object is an eighth note but is not beamed, and if the\n \/\/ active beam is set, null out the active beam and return null.\n if (bobj.Beam = NoBeam and layer._property:ActiveBeamId != null)\n {\n layer._property:ActiveBeamId = null;\n return ret;\n }\n\n \/*\n It's possible that Sibelius records a 'continue beam' at the start\n of a beamed group. Visually, this doesn't look out of place if the previous\n note was a quarter note or higher. \n \n The first check we do is if the note has a 'continue beam' attribute and\n the previous note has a duration higher than 256 (quarter) then we probably have\n a false negative (i.e., there is the start of a beam, but it isn't necessarily\n encoded correctly).\n *\/\n falseNegative = False;\n next_obj = bobj.NextItem(bobj.VoiceNumber, 'NoteRest');\n\n if ((bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam) and layer._property:ActiveBeamId = null)\n {\n \/\/ by all accounts this should be a beamed note, but we'll need to double-check.\n prev_obj = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n if (prev_obj != null and (prev_obj.Duration >= 256))\n {\n falseNegative = True;\n }\n }\n\n if (next_obj != null and (bobj.Beam = StartBeam or falseNegative = True) and next_obj.Beam = ContinueBeam)\n {\n \/\/ if:\n \/\/ - we're not at the end of the bar\n \/\/ - we have a start beam\n \/\/ - the next note is a continue beam\n beam = libmei.Beam();\n layer._property:ActiveBeamId = beam._id;\n\n \/\/ return the beam so that we can add it to the tree.\n ret = beam;\n }\n\n if (layer._property:ActiveBeamId != null and (bobj.Beam = ContinueBeam or bobj.Beam = SingleBeam))\n {\n beamid = layer._property:ActiveBeamId;\n beam = libmei.getElementById(beamid);\n ret = beam;\n }\n }\n else\n {\n if (layer._property:ActiveBeamId != null)\n {\n \/\/ this is a break in any active beam, so register it as such.\n layer._property:ActiveBeamId = null;\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction ProcessTuplet (bobj, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.ParentTupletIfAny = null)\n {\n return null;\n }\n\n if (layer._property:ActiveTupletId = null)\n {\n tupletObject = bobj.ParentTupletIfAny;\n\n tuplet = libmei.Tuplet();\n\n layer._property:ActiveTupletObject = tupletObject;\n layer._property:ActiveTupletId = tuplet._id;\n\n if (libmei.GetName(meielement) = 'beam')\n {\n \/\/ get the first child\n startid = meielement.children[0];\n }\n else\n {\n startid = meielement._id;\n }\n\n libmei.AddAttribute(tuplet, 'startid', '#' & startid);\n libmei.AddAttribute(tuplet, 'num', tupletObject.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObject.Right);\n\n tupletStyle = tupletObject.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObject.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n return tuplet;\n }\n else\n {\n tid = layer._property:ActiveTupletId;\n t = libmei.getElementById(tid);\n\n if (IsLastNoteInTuplet(bobj))\n {\n libmei.AddAttribute(t, 'endid', '#' & meielement._id);\n layer._property:ActiveTupletObject = null;\n layer._property:ActiveTupletId = null;\n }\n\n return t;\n }\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet, layer) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n \n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it \n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n tupletSpan._property:AddedToMeasure = False;\n\n layer._property:ActiveTupletId = tupletSpan._id;\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (j = 0)\n {\n libmei.AddAttribute(sylel, 'wordpos', 'i'); \/\/ 'initial'\n\n if (lyric_word.Length > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n if (name = 'chord')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'chord'));\n }\n\n libmei.AddChild(obj, verse);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so \n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureLines;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mlines = Self._property:MeasureLines;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mlines = Self._property:MeasureLines;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('242')\n {\n \/\/ triple staccato\n return null;\n }\n }\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"3620ebd5a038c2477e1a0f121efa9042e36d311e","subject":"Update roads.mss","message":"Update roads.mss","repos":"brelevenix\/osm-bright-tregor","old_file":"osm-bright\/roads.mss","new_file":"osm-bright\/roads.mss","new_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 0.3; @rdz11_med: 0.2; @rdz11_min: 0.1;\n@rdz12_maj: 0.5; @rdz12_med: 0.4; @rdz12_min: 0.2;\n@rdz13_maj: 1; @rdz13_med: 0.8; @rdz13_min: 0.5;\n@rdz14_maj: 2; @rdz14_med: 1.5; @rdz14_min: 1;\n@rdz15_maj: 4; @rdz15_med: 3; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 16; @rdz17_med: 12; @rdz17_min: 8;\n@rdz18_maj: 32; @rdz18_med: 24; @rdz18_min: 16;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz11_maj; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz12_maj; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz13_maj; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz14_med; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz15_med }\n [stylegroup='minorroad']{ line-width: @rdz15_min ; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_maj; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj ;}\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz16_maj; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_maj; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_maj; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz11_min ; line-color: @path; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz12_min ; line-color: @path; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min ; line-color: @path;}\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min; line-color: @path; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min; line-color: @path; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min ; line-color: @path;}\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min ; line-color: @path;}\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min ; line-color: @path; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","old_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 0.3; @rdz11_med: 0.2; @rdz11_min: 0.1;\n@rdz12_maj: 0.5; @rdz12_med: 0.4; @rdz12_min: 0.2;\n@rdz13_maj: 1; @rdz13_med: 0.8; @rdz13_min: 0.5;\n@rdz14_maj: 2; @rdz14_med: 1.5; @rdz14_min: 1;\n@rdz15_maj: 4; @rdz15_med: 3; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 16; @rdz17_med: 12; @rdz17_min: 8;\n@rdz18_maj: 32; @rdz18_med: 24; @rdz18_min: 16;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz11_maj; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz12_maj; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz13_maj; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz14_med; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz15_med }\n [stylegroup='minorroad']{ line-width: @rdz15_min ; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_maj; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj ;}\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz16_maj; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_maj; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_maj; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n line-color: @black;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz11_maj ; line-color: @black; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz12_maj ; line-color: @black; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_maj ; line-color: @black;}\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_maj; line-color: @black; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_maj; line-color: @black; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_maj ; line-color: @black;}\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_maj ; line-color: @black;}\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_maj ; line-color: @black; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"8d653c919069c556ad371b62d022ec712c29fb01","subject":"Fixed: Floats were not handled correctly","message":"Fixed: Floats were not handled correctly\n\nIf a staffheight was already a decimal (e.g., 7.5) then appending '.0' is exactly the wrong thing to do. (7.5.0)\n\nWhile I accept most of the blame, you can thank the wonderful Sibelius arithmetic processor for allowing math on doubly-decimaled numbers. And for not handling floating point numbers correctly.\n\n:-\/\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/ExportConverters.mss","new_file":"src\/ExportConverters.mss","new_contents":"\nfunction ConvertClef (clefid) {\n \/\/$module(ExportConverters.mss)\n clefparts = MSplitString(clefid, '.');\n shape = ' ';\n line = ' ';\n dis = ' ';\n dir = ' ';\n\n switch(clefparts[2])\n {\n case ('down')\n {\n dir = 'below';\n }\n case ('up')\n {\n dir = 'above';\n }\n }\n\n switch(clefparts[3])\n {\n case ('8')\n {\n dis = '8';\n }\n case ('15')\n {\n dis = '15';\n }\n }\n switch (clefparts[1]) {\n case ('bass')\n {\n shape = 'F';\n line = '4';\n }\n case ('treble')\n {\n if (clefparts[4] = 'old')\n {\n shape = 'GG';\n }\n else\n {\n shape = 'G';\n }\n line = '2';\n }\n case ('tenor')\n {\n shape = 'C';\n line = '4';\n }\n case ('alto')\n {\n shape = 'C';\n line = '3';\n }\n case ('soprano')\n {\n shape = 'C';\n if (clefparts[2] = 'mezzo')\n {\n line = '2';\n }\n else\n {\n line = '1';\n }\n }\n case ('baritone')\n {\n if (clefparts[2] = 'c')\n {\n shape = 'C';\n line = '5';\n }\n else\n {\n shape = 'F';\n line = '3';\n }\n }\n case ('violin')\n {\n shape = 'G';\n line = '1';\n }\n case ('sub-bass')\n {\n shape = 'F';\n line = '5';\n }\n case ('tab')\n {\n shape = 'TAB';\n }\n case (('percussion') or ('percussion_2'))\n {\n shape = 'perc';\n }\n }\n ret = CreateSparseArray(shape, line, dis, dir);\n return ret;\n} \/\/$end\n\nfunction ConvertOctava (octava_id) {\n \/\/$module(ExportConverters.mss)\n octparts = MSplitString(octava_id, '.');\n switch(octparts[3])\n {\n case ('minus15')\n {\n dis = '15';\n place = 'below';\n }\n case ('minus8')\n {\n dis = '8';\n place = 'below';\n }\n case ('plus15')\n {\n dis = '15';\n place = 'above';\n }\n case ('plus8')\n {\n dis = '8';\n place = 'above';\n }\n default\n {\n dis = ' ';\n place = ' ';\n }\n }\n return CreateSparseArray(dis, place);\n} \/\/$end\n\nfunction ConvertSlur (slur_value) {\n \/\/$module(ExportConverters.mss)\n slurparts = MSplitString(slur_value, '.');\n direction = ' ';\n style = ' ';\n switch(slurparts[3])\n {\n case ('up')\n {\n direction = 'above';\n }\n case ('down')\n {\n direction = 'below';\n }\n default\n {\n direction = ' ';\n }\n }\n switch(slurparts[4])\n {\n case ('dashed')\n {\n style = 'dashed';\n }\n case ('dotted')\n {\n style = 'dotted';\n }\n default\n {\n style = ' ';\n }\n }\n return CreateSparseArray(direction, style);\n} \/\/$end\n\nfunction ConvertDiatonicPitch (diatonic_pitch) {\n \/\/$module(ExportConverters)\n octv = (diatonic_pitch \/ 7) - 1;\n pnames = CreateSparseArray('c', 'd', 'e', 'f', 'g', 'a', 'b');\n idx = (diatonic_pitch % 7);\n pname = pnames[idx];\n\n return CreateSparseArray(pname, octv);\n} \/\/$end\n\nfunction ConvertOffsets (offset) {\n \/\/$module(ExportConverters.mss)\n\n \/*\n This function will convert the 1\/32 unit \n Sibelius offsets into a millimeter measurement as required by the \n data.MEASUREMENT datatype used by MEI.\n\n The `StaffHeight` property always returns the staff height in millimeters.\n\n Most offsets are given in Sibelius Units, which\n are defined as 1\/32 of a space. A space is 1\/4 of the staff height\n set at 128. For real world calculations, then, a unit is:\n ((staffheight \/ 128).\n\n So a staff height of 7mm (default) gives us (7\/4 = 1.75) \/ 32 = 0.05mm per Sibelius\n Unit.\n *\/\n scr = Sibelius.ActiveScore;\n staffheight = scr.StaffHeight;\n factor = (staffheight \/ 128.0);\n oset = factor * offset;\n retval = oset & 'mm';\n return retval;\n} \/\/$end\n\nfunction ConvertDuration (dur) {\n \/\/$module(ExportConverters.mss)\n \/\/ there doesn't really seem to be a smarter way to do this...\n \/\/ 1024 = 1 whole note\n\n ret = CreateSparseArray();\n\n pow = PrevPow2(dur);\n counter = pow;\n dots = 0;\n powcount = pow;\n durset = false;\n\n durrem = 1024 % dur;\n if (durrem != 0)\n {\n while (counter < dur)\n {\n powcount = (powcount \/ 2);\n counter = counter + powcount;\n dots = dots + 1;\n\n if (dots > 5)\n {\n \/\/ prevent a runaway loop.\n counter = 1000000000;\n }\n }\n }\n\n switch (powcount)\n {\n case (pow >= 4096)\n {\n ret[0] = 'long';\n durset = true;\n }\n case (pow >= 2048)\n {\n ret[0] = 'breve';\n durset = true;\n }\n default\n {\n if (durset = false)\n {\n ret[0] = 1024 \/ pow;\n }\n }\n }\n\n if (dots = 0)\n {\n ret[1] = ' ';\n }\n else\n {\n ret[1] = dots;\n }\n\n return ret;\n} \/\/$end\n\nfunction ConvertKeySignature (numsharps) {\n \/\/$module(ExportConverters.mss)\n switch (numsharps)\n {\n case (0)\n {\n \/\/ key of c\n return '0';\n }\n case (-8)\n {\n \/\/ atonal in Sibelius\n return '0';\n }\n case (numsharps > 0)\n {\n \/\/ sharps\n return numsharps & 's';\n }\n case (numsharps < 0)\n {\n \/\/flats\n return utils.AbsoluteValue(numsharps) & 'f';\n }\n }\n} \/\/$end\n\nfunction PitchesInKeySignature (keysig) {\n \/\/$module(ExportConverters.mss)\n\n \/\/ keysig is 7 >= 0 >= -7, for the number of sharps (negative is flats)\n ac = CreateSparseArray('F', 'C', 'G', 'D', 'A', 'E', 'B');\n if (keysig = 0)\n {\n return CreateSparseArray();\n }\n\n if (keysig > 0)\n {\n return ac.Slice(0, keysig);\n }\n else\n {\n v = ac.Slice(keysig);\n v.Reverse();\n return v;\n }\n} \/\/$end\n\nfunction ConvertAccidental (noteobj) {\n \/\/$module(ExportConverters.mss)\n \/\/ If accidentals are audible, but not visible, you get @accid.ges\n \/\/ If accidentals are both audible and visible, you get @accid\n \/\/ is_visible is not to be confused with hidden accidentals! is_visible\n \/\/ just determines whether an accidental is shown or not based on \n \/\/ the rules of CMN.\n\n \/\/ Returns a tuple [0 => accid (string), 1 => is_visible (bool)]\n \/\/ If the accidental is a natural and is visible, returns ('n', true); otherwise,\n \/\/ it returns ('', false);\n\n \/\/ first, determine if the accidental is visible.\n is_visible = HasVisibleAccidental(noteobj);\n ac = ' ';\n\n pname = Substring(noteobj.Name, 0, 1); \/\/ captures first letter\n accid = Substring(noteobj.Name, 1); \/\/ captures all other characters\n\n switch(accid)\n {\n case('bb')\n {\n ac = 'ff';\n }\n case('b-')\n {\n ac = 'fd';\n }\n case('b')\n {\n ac = 'f';\n }\n case('-')\n {\n ac = 'fu';\n }\n case('')\n {\n if (is_visible = True)\n {\n ac = 'n';\n }\n }\n case('+')\n {\n ac = 'sd';\n }\n case('#')\n {\n ac = 's';\n }\n case('#+')\n {\n ac = 'su';\n }\n case('x')\n {\n ac = 'x';\n }\n case('##')\n {\n ac = 'ss';\n }\n }\n\n ret = CreateSparseArray(ac, is_visible);\n return ret;\n} \/\/$end\n\nfunction HasVisibleAccidental (noteobj) {\n \/\/$module(ExportConverters.mss)\n \/\/ determines whether a note is *likely* to have a visible accidental.\n \/\/ Caution: This is probably not 100% accurate.\n\n \/\/ Returns a boolean if the note is visible.\n\n \/\/ If it has a cautionary accidental, it's most likely to be visible.\n if (noteobj.AccidentalStyle = CautionaryAcc)\n {\n return True;\n }\n\n if (noteobj.AccidentalStyle = HiddenAcc)\n {\n return False;\n }\n\n keysig = noteobj.ParentNoteRest.ParentBar.GetKeySignatureAt(noteobj.ParentNoteRest.Position);\n sf = sibmei2.PitchesInKeySignature(keysig.Sharps);\n pname = Substring(noteobj.Name, 0, 1); \/\/ captures first letter\n accid = Substring(noteobj.Name, 1); \/\/ captures all other characters\n\n \/\/ if the note is not in the key signature, then it should have an accidental\n note_is_in_keysig = utils.IsInArray(sf, pname);\n has_prev_pitch_with_accidental = False;\n\n parent_nr = noteobj.ParentNoteRest;\n parent_bar = parent_nr.ParentBar;\n\n for each NoteRest nr in parent_bar\n {\n if (nr.Position < parent_nr.Position)\n {\n for each n in nr\n {\n pname2 = Substring(n.Name, 0, 1); \/\/ captures first letter\n accid2 = Substring(n.Name, 1); \/\/ captures all other characters\n\n if (n.Name = noteobj.Name and note_is_in_keysig = False and n.Accidental != 0)\n {\n has_prev_pitch_with_accidental = True;\n }\n\n if (n.Name = noteobj.Name and n.AccidentalStyle = CautionaryAcc)\n {\n has_prev_pitch_with_accidental = True;\n }\n\n if (n.Name = noteobj.Name and note_is_in_keysig = True)\n {\n has_prev_pitch_with_accidental = False;\n }\n\n \/\/ this is a special case for dealing with naturals. If the pitch names\n \/\/ match, and the note is not in the key signature, and the previous pitch\n \/\/ was not empty, then we probably have a natural on the query note.\n if (pname = pname2 and note_is_in_keysig = False and accid2 != '')\n {\n has_prev_pitch_with_accidental = True;\n }\n\n }\n }\n else\n {\n for each n in nr\n {\n if (n.Name = noteobj.Name and n.Accidental != 0 and note_is_in_keysig = True)\n {\n has_prev_pitch_with_accidental = False;\n }\n }\n }\n }\n\n \/\/ deal with the 'weird' accidental values that don't have a value in noteobj.Accidental\n switch (accid)\n {\n case ('bb')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('b-')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('-')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('+')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('#+')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n }\n\n if (noteobj.Accidental = 0 and note_is_in_keysig = True and has_prev_pitch_with_accidental = False)\n {\n \/\/ it's a natural?\n return True;\n }\n\n if (note_is_in_keysig = True and has_prev_pitch_with_accidental = False)\n {\n return False;\n }\n\n if (has_prev_pitch_with_accidental = False and noteobj.Accidental != 0)\n {\n return True;\n }\n \n if (has_prev_pitch_with_accidental = True and accid = '')\n {\n \/\/ this is the corresponding return value for special cased naturals.\n return True;\n }\n\n \/\/ Finally, by default, assume this has no accidental.\n return False;\n} \/\/$end\n\nfunction ConvertNamedTimeSignature (timesig) {\n \/\/$module(ExportConverters.mss)\n switch(timesig)\n {\n case(CommonTimeString)\n {\n return 'common';\n }\n case(AllaBreveTimeString)\n {\n return 'cut';\n }\n default\n {\n return ' ';\n }\n }\n} \/\/$end\n\nfunction ConvertBracket (bracket) {\n \/\/$module(ExportConverters.mss)\n switch(bracket)\n {\n case(BracketFull)\n {\n return 'bracket';\n }\n case(BracketBrace)\n {\n return 'brace';\n }\n case(BracketSub)\n {\n return 'line';\n }\n default\n {\n return 'none';\n }\n }\n} \/\/$end\n\nfunction ConvertSibeliusStructure (score) {\n \/\/$module(ExportConverters.mss)\n \/\/ Takes in the Staff\/Bar Sibelius Structure and returns a Bar\/Staff\n \/\/ mapping for our MEI writers.\n bar_to_staff = CreateDictionary();\n\n \/\/ Invert the Sibelius structure\n for each Staff s in score\n {\n for each Bar b in s\n {\n if (bar_to_staff.PropertyExists(b.BarNumber))\n {\n bar_to_staff[b.BarNumber].Push(s.StaffNum);\n }\n else\n {\n bar_to_staff[b.BarNumber] = CreateSparseArray();\n bar_to_staff[b.BarNumber].Push(s.StaffNum);\n }\n }\n }\n return bar_to_staff;\n} \/\/$end\n\nfunction ConvertColor (nrest) {\n \/\/$module(ExportConverters.mss)\n r = nrest.ColorRed;\n g = nrest.ColorGreen;\n b = nrest.ColorBlue;\n a_dec = nrest.ColorAlpha & '.0';\n a = a_dec \/ 255.0;\n\n return 'rgba(' & r & ',' & g & ',' & b & ',' & a & ')';\n} \/\/$end\n\nfunction ConvertNoteStyle (style) {\n \/\/$module(ExportConverters.mss)\n noteStyle = ' ';\n\n if (style = NormalNoteStyle)\n {\n return ' ';\n }\n\n switch (style)\n {\n case (CrossNoteStyle)\n {\n noteStyle = 'cross';\n }\n case (DiamondNoteStyle)\n {\n noteStyle = 'diamond';\n }\n case (CrossOrDiamondNoteStyle)\n {\n \/\/ Sibelius uses this for percussion\n \/\/ and does not differentiate in the \n \/\/ head style, so we have to choose one\n \/\/ or the other.\n noteStyle = 'cross';\n }\n case (BlackAndWhiteDiamondNoteStyle)\n {\n noteStyle = 'filldiamond';\n }\n case (SlashedNoteStyle)\n {\n noteStyle = 'addslash';\n }\n case (BackSlashedNoteStyle)\n {\n noteStyle = 'addbackslash';\n }\n case (ArrowDownNoteStyle)\n {\n \/\/ this is not completely correct, since\n \/\/ we use the same value for up and down\n \/\/ iso triangles. But it's all we have for now.\n noteStyle = 'isotriangle';\n }\n case (ArrowUpNoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (InvertedTriangleNoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (ShapedNote1NoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (ShapedNote2NoteStyle)\n {\n noteStyle = 'semicircle';\n }\n case (ShapedNote3NoteStyle)\n {\n noteStyle = 'diamond';\n }\n case (ShapedNote4StemUpNoteStyle)\n {\n noteStyle = 'rtriangle';\n }\n case (ShapedNote4StemDownNoteStyle)\n {\n noteStyle = 'rtriangle';\n }\n case (ShapedNote5NoteStyle)\n {\n \/\/ this looks normal...\n noteStyle = ' ';\n }\n case (ShapedNote6NoteStyle)\n {\n \/\/ there is no square in MEI...\n noteStyle = ' ';\n }\n case (ShapedNote7NoteStyle)\n {\n noteStyle = 'piewedge';\n }\n }\n\n return noteStyle;\n} \/\/$end\n\nfunction ConvertSlurStyle (style) {\n \/\/$module(ExportConverters.mss)\n slurparts = MSplitString(style, '.');\n direction = ' ';\n style = ' ';\n\n switch(slurparts[3])\n {\n case ('up')\n {\n direction = 'above';\n }\n case ('down')\n {\n direction = 'below';\n }\n default\n {\n direction = ' ';\n }\n }\n switch(slurparts[4])\n {\n case ('dashed')\n {\n style = 'dashed';\n }\n case ('dotted')\n {\n style = 'dotted';\n }\n default\n {\n style = ' ';\n }\n }\n return CreateSparseArray(direction, style);\n} \/\/$end\n\nfunction ConvertPositionToTimestamp (position, bar) {\n \/\/$module(ExportConverters.mss)\n \/*\n To convert Sibelius ticks to musical timestamps\n we use the formula:\n\n tstamp = (notePosition \/ (barLength \/ beatsInBar))\n *\/\n\n \/\/ make sure we're working with floating point numbers\n \/\/ and yes, this makes me feel very, very dirty in case\n \/\/ you were wondering, but this is the only way ManuScript\n \/\/ can cast to floating point...\n barlength = bar.Length;\n timesignature = Sibelius.ActiveScore.SystemStaff.CurrentTimeSignature(bar.BarNumber);\n\n if (position = 0)\n {\n return 1;\n }\n\n barlen = barlength & '.0';\n pos = position & '.0';\n beats = timesignature.Numerator & '.0';\n unit = (barlen \/ beats);\n ret = (pos \/ unit) + 1;\n\n return ret;\n} \/\/$end\n\nfunction ConvertTupletStyle (tupletStyle) {\n \/\/$module(ExportConverters.mss)\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.addAttribute(activeTuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.addAttribute(activeTuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.addAttribute(activeTuplet, 'num.format', 'ratio');\n }\n }\n\n} \/\/$end\n\nfunction ConvertBarline (linetype) {\n \/\/$module(ExportConverters.mss)\n switch(linetype)\n {\n case (SpecialBarlineStartRepeat)\n {\n \/\/ start repeat\n return 'rptstart';\n }\n case (SpecialBarlineEndRepeat)\n {\n \/\/ end repeat\n return 'rptend';\n }\n case (SpecialBarlineDashed)\n {\n \/\/ dashed\n return 'dashed';\n }\n case (SpecialBarlineDouble)\n {\n \/\/ double\n return 'dbl';\n }\n case (SpecialBarlineFinal)\n {\n \/\/ final\n return 'end';\n }\n case (SpecialBarlineInvisible)\n {\n \/\/ invisible\n return 'invis';\n }\n case (SpecialBarlineBetweenStaves)\n {\n \/\/ between staves\n \/\/ no MEI equiv.\n return ' ';\n }\n case (SpecialBarlineNormal)\n {\n \/\/ normal\n \/\/ this should usually be needed.\n return 'single';\n }\n case (SpecialBarlineTick)\n {\n \/\/ tick\n \/\/ unknown\n return ' ';\n }\n case (SpecialBarlineShort)\n {\n \/\/ short\n \/\/ unknown\n return ' ';\n }\n default\n {\n return ' ';\n }\n }\n} \/\/$end\n\nfunction ConvertText (textobj) {\n \/\/$module(ExportConverters.mss)\n styleid = textobj.StyleId;\n switch (styleid)\n {\n case ('text.staff.expression')\n {\n dynam = libmei.Dynam();\n libmei.SetText(dynam, lstrip(textobj.Text));\n libmei.AddAttribute(dynam, 'staff', textobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(dynam, 'tstamp', ConvertPositionToTimestamp(textobj));\n\n if (textobj.Dx != 0)\n {\n libmei.AddAttribute(dynam, 'ho', ConvertOffset(textobj.Dx));\n }\n\n if (textobj.Dy != 0)\n {\n libmei.AddAttribute(dynam, 'vo', ConvertOffset(textobj.Dy));\n }\n return dynam;\n }\n case ('text.system.page_aligned.title')\n {\n return ConvertTextElement(textobj);\n }\n case ('text.system.page_aligned.composer')\n {\n return ConvertTextElement(textobj);\n }\n default\n {\n return null;\n }\n }\n} \/\/$end\n\nfunction ConvertTextElement (textobj) {\n \/\/$module(ExportConverters.mss)\n obj = libmei.AnchoredText();\n libmei.SetText(obj, lstrip(textobj.Text));\n\n if (textobj.Dx != 0)\n {\n libmei.AddAttribute(obj, 'ho', ConvertOffsets(textobj.Dx));\n }\n\n if (textobj.Dy != 0)\n {\n libmei.AddAttribute(obj, 'vo', ConvertOffsets(textobj.Dy));\n }\n\n return obj;\n} \/\/$end\n\nfunction ConvertEndingValues (styleid) {\n \/\/$module(ExportConverters)\n ending_style = MSplitString(styleid, '.');\n num = ' ';\n label = ' ';\n type = ' ';\n\n switch(ending_style[3])\n {\n case ('1st')\n {\n num = 1;\n label = '1.';\n type = 'closed';\n }\n case ('1st_n_2nd')\n {\n num = 1;\n label = '1. 2.';\n type = 'closed';\n }\n case ('2nd')\n {\n num = 2;\n label = '2.';\n if (ending_style[-1] = 'closed')\n {\n type = 'closed';\n }\n else\n {\n type = 'open';\n }\n }\n case ('3rd')\n {\n num = 3;\n label = '3.';\n type = 'closed';\n }\n case ('open')\n {\n type = 'open';\n }\n case ('closed')\n {\n type = 'closed';\n }\n }\n\n return CreateSparseArray(num, label, type);\n\n} \/\/$end\n\nfunction ConvertDate (datetime) {\n \/\/$module(ExportConverters.mss)\n d = datetime.DayOfMonth;\n m = datetime.Month;\n y = datetime.Year;\n\n time = datetime.TimeWithSeconds;\n\n isodate = utils.Format('%s-%s-%sT%sZ', y, m, d, time);\n\n return isodate;\n} \/\/$end\n","old_contents":"\nfunction ConvertClef (clefid) {\n \/\/$module(ExportConverters.mss)\n clefparts = MSplitString(clefid, '.');\n shape = ' ';\n line = ' ';\n dis = ' ';\n dir = ' ';\n\n switch(clefparts[2])\n {\n case ('down')\n {\n dir = 'below';\n }\n case ('up')\n {\n dir = 'above';\n }\n }\n\n switch(clefparts[3])\n {\n case ('8')\n {\n dis = '8';\n }\n case ('15')\n {\n dis = '15';\n }\n }\n switch (clefparts[1]) {\n case ('bass')\n {\n shape = 'F';\n line = '4';\n }\n case ('treble')\n {\n if (clefparts[4] = 'old')\n {\n shape = 'GG';\n }\n else\n {\n shape = 'G';\n }\n line = '2';\n }\n case ('tenor')\n {\n shape = 'C';\n line = '4';\n }\n case ('alto')\n {\n shape = 'C';\n line = '3';\n }\n case ('soprano')\n {\n shape = 'C';\n if (clefparts[2] = 'mezzo')\n {\n line = '2';\n }\n else\n {\n line = '1';\n }\n }\n case ('baritone')\n {\n if (clefparts[2] = 'c')\n {\n shape = 'C';\n line = '5';\n }\n else\n {\n shape = 'F';\n line = '3';\n }\n }\n case ('violin')\n {\n shape = 'G';\n line = '1';\n }\n case ('sub-bass')\n {\n shape = 'F';\n line = '5';\n }\n case ('tab')\n {\n shape = 'TAB';\n }\n case (('percussion') or ('percussion_2'))\n {\n shape = 'perc';\n }\n }\n ret = CreateSparseArray(shape, line, dis, dir);\n return ret;\n} \/\/$end\n\nfunction ConvertOctava (octava_id) {\n \/\/$module(ExportConverters.mss)\n octparts = MSplitString(octava_id, '.');\n switch(octparts[3])\n {\n case ('minus15')\n {\n dis = '15';\n place = 'below';\n }\n case ('minus8')\n {\n dis = '8';\n place = 'below';\n }\n case ('plus15')\n {\n dis = '15';\n place = 'above';\n }\n case ('plus8')\n {\n dis = '8';\n place = 'above';\n }\n default\n {\n dis = ' ';\n place = ' ';\n }\n }\n return CreateSparseArray(dis, place);\n} \/\/$end\n\nfunction ConvertSlur (slur_value) {\n \/\/$module(ExportConverters.mss)\n slurparts = MSplitString(slur_value, '.');\n direction = ' ';\n style = ' ';\n switch(slurparts[3])\n {\n case ('up')\n {\n direction = 'above';\n }\n case ('down')\n {\n direction = 'below';\n }\n default\n {\n direction = ' ';\n }\n }\n switch(slurparts[4])\n {\n case ('dashed')\n {\n style = 'dashed';\n }\n case ('dotted')\n {\n style = 'dotted';\n }\n default\n {\n style = ' ';\n }\n }\n return CreateSparseArray(direction, style);\n} \/\/$end\n\nfunction ConvertDiatonicPitch (diatonic_pitch) {\n \/\/$module(ExportConverters)\n octv = (diatonic_pitch \/ 7) - 1;\n pnames = CreateSparseArray('c', 'd', 'e', 'f', 'g', 'a', 'b');\n idx = (diatonic_pitch % 7);\n pname = pnames[idx];\n\n return CreateSparseArray(pname, octv);\n} \/\/$end\n\nfunction ConvertOffsets (offset) {\n \/\/$module(ExportConverters.mss)\n\n \/*\n This function will convert the 1\/32 unit \n Sibelius offsets into a millimeter measurement as required by the \n data.MEASUREMENT datatype used by MEI.\n\n Most offsets are given in Sibelius Units, which\n are defined as 1\/32 of a space. A space is 1\/4 of the staff height\n set at 128. For real world calculations, then, a unit is:\n ((staffheight \/ 4) \/ 32).\n\n The `StaffHeight` property always returns the staff height in millimeters.\n\n So a staff height of 7mm (default) gives us (7\/4 = 1.75) \/ 32 = 0.05mm per Sibelius\n Unit.\n *\/\n scr = Sibelius.ActiveScore;\n staffheight = scr.StaffHeight;\n factor = (((staffheight & '.0') \/ 4.0) \/ 32.0);\n oset = factor * offset;\n retval = oset & 'mm';\n return retval;\n} \/\/$end\n\nfunction ConvertDuration (dur) {\n \/\/$module(ExportConverters.mss)\n \/\/ there doesn't really seem to be a smarter way to do this...\n \/\/ 1024 = 1 whole note\n\n ret = CreateSparseArray();\n\n pow = PrevPow2(dur);\n counter = pow;\n dots = 0;\n powcount = pow;\n durset = false;\n\n durrem = 1024 % dur;\n if (durrem != 0)\n {\n while (counter < dur)\n {\n powcount = (powcount \/ 2);\n counter = counter + powcount;\n dots = dots + 1;\n\n if (dots > 5)\n {\n \/\/ prevent a runaway loop.\n counter = 1000000000;\n }\n }\n }\n\n switch (powcount)\n {\n case (pow >= 4096)\n {\n ret[0] = 'long';\n durset = true;\n }\n case (pow >= 2048)\n {\n ret[0] = 'breve';\n durset = true;\n }\n default\n {\n if (durset = false)\n {\n ret[0] = 1024 \/ pow;\n }\n }\n }\n\n if (dots = 0)\n {\n ret[1] = ' ';\n }\n else\n {\n ret[1] = dots;\n }\n\n return ret;\n} \/\/$end\n\nfunction ConvertKeySignature (numsharps) {\n \/\/$module(ExportConverters.mss)\n switch (numsharps)\n {\n case (0)\n {\n \/\/ key of c\n return '0';\n }\n case (-8)\n {\n \/\/ atonal in Sibelius\n return '0';\n }\n case (numsharps > 0)\n {\n \/\/ sharps\n return numsharps & 's';\n }\n case (numsharps < 0)\n {\n \/\/flats\n return utils.AbsoluteValue(numsharps) & 'f';\n }\n }\n} \/\/$end\n\nfunction PitchesInKeySignature (keysig) {\n \/\/$module(ExportConverters.mss)\n\n \/\/ keysig is 7 >= 0 >= -7, for the number of sharps (negative is flats)\n ac = CreateSparseArray('F', 'C', 'G', 'D', 'A', 'E', 'B');\n if (keysig = 0)\n {\n return CreateSparseArray();\n }\n\n if (keysig > 0)\n {\n return ac.Slice(0, keysig);\n }\n else\n {\n v = ac.Slice(keysig);\n v.Reverse();\n return v;\n }\n} \/\/$end\n\nfunction ConvertAccidental (noteobj) {\n \/\/$module(ExportConverters.mss)\n \/\/ If accidentals are audible, but not visible, you get @accid.ges\n \/\/ If accidentals are both audible and visible, you get @accid\n \/\/ is_visible is not to be confused with hidden accidentals! is_visible\n \/\/ just determines whether an accidental is shown or not based on \n \/\/ the rules of CMN.\n\n \/\/ Returns a tuple [0 => accid (string), 1 => is_visible (bool)]\n \/\/ If the accidental is a natural and is visible, returns ('n', true); otherwise,\n \/\/ it returns ('', false);\n\n \/\/ first, determine if the accidental is visible.\n is_visible = HasVisibleAccidental(noteobj);\n ac = ' ';\n\n pname = Substring(noteobj.Name, 0, 1); \/\/ captures first letter\n accid = Substring(noteobj.Name, 1); \/\/ captures all other characters\n\n switch(accid)\n {\n case('bb')\n {\n ac = 'ff';\n }\n case('b-')\n {\n ac = 'fd';\n }\n case('b')\n {\n ac = 'f';\n }\n case('-')\n {\n ac = 'fu';\n }\n case('')\n {\n if (is_visible = True)\n {\n ac = 'n';\n }\n }\n case('+')\n {\n ac = 'sd';\n }\n case('#')\n {\n ac = 's';\n }\n case('#+')\n {\n ac = 'su';\n }\n case('x')\n {\n ac = 'x';\n }\n case('##')\n {\n ac = 'ss';\n }\n }\n\n ret = CreateSparseArray(ac, is_visible);\n return ret;\n} \/\/$end\n\nfunction HasVisibleAccidental (noteobj) {\n \/\/$module(ExportConverters.mss)\n \/\/ determines whether a note is *likely* to have a visible accidental.\n \/\/ Caution: This is probably not 100% accurate.\n\n \/\/ Returns a boolean if the note is visible.\n\n \/\/ If it has a cautionary accidental, it's most likely to be visible.\n if (noteobj.AccidentalStyle = CautionaryAcc)\n {\n return True;\n }\n\n if (noteobj.AccidentalStyle = HiddenAcc)\n {\n return False;\n }\n\n keysig = noteobj.ParentNoteRest.ParentBar.GetKeySignatureAt(noteobj.ParentNoteRest.Position);\n sf = sibmei2.PitchesInKeySignature(keysig.Sharps);\n pname = Substring(noteobj.Name, 0, 1); \/\/ captures first letter\n accid = Substring(noteobj.Name, 1); \/\/ captures all other characters\n\n \/\/ if the note is not in the key signature, then it should have an accidental\n note_is_in_keysig = utils.IsInArray(sf, pname);\n has_prev_pitch_with_accidental = False;\n\n parent_nr = noteobj.ParentNoteRest;\n parent_bar = parent_nr.ParentBar;\n\n for each NoteRest nr in parent_bar\n {\n if (nr.Position < parent_nr.Position)\n {\n for each n in nr\n {\n pname2 = Substring(n.Name, 0, 1); \/\/ captures first letter\n accid2 = Substring(n.Name, 1); \/\/ captures all other characters\n\n if (n.Name = noteobj.Name and note_is_in_keysig = False and n.Accidental != 0)\n {\n has_prev_pitch_with_accidental = True;\n }\n\n if (n.Name = noteobj.Name and n.AccidentalStyle = CautionaryAcc)\n {\n has_prev_pitch_with_accidental = True;\n }\n\n if (n.Name = noteobj.Name and note_is_in_keysig = True)\n {\n has_prev_pitch_with_accidental = False;\n }\n\n \/\/ this is a special case for dealing with naturals. If the pitch names\n \/\/ match, and the note is not in the key signature, and the previous pitch\n \/\/ was not empty, then we probably have a natural on the query note.\n if (pname = pname2 and note_is_in_keysig = False and accid2 != '')\n {\n has_prev_pitch_with_accidental = True;\n }\n\n }\n }\n else\n {\n for each n in nr\n {\n if (n.Name = noteobj.Name and n.Accidental != 0 and note_is_in_keysig = True)\n {\n has_prev_pitch_with_accidental = False;\n }\n }\n }\n }\n\n \/\/ deal with the 'weird' accidental values that don't have a value in noteobj.Accidental\n switch (accid)\n {\n case ('bb')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('b-')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('-')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('+')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('#+')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n }\n\n if (noteobj.Accidental = 0 and note_is_in_keysig = True and has_prev_pitch_with_accidental = False)\n {\n \/\/ it's a natural?\n return True;\n }\n\n if (note_is_in_keysig = True and has_prev_pitch_with_accidental = False)\n {\n return False;\n }\n\n if (has_prev_pitch_with_accidental = False and noteobj.Accidental != 0)\n {\n return True;\n }\n \n if (has_prev_pitch_with_accidental = True and accid = '')\n {\n \/\/ this is the corresponding return value for special cased naturals.\n return True;\n }\n\n \/\/ Finally, by default, assume this has no accidental.\n return False;\n} \/\/$end\n\nfunction ConvertNamedTimeSignature (timesig) {\n \/\/$module(ExportConverters.mss)\n switch(timesig)\n {\n case(CommonTimeString)\n {\n return 'common';\n }\n case(AllaBreveTimeString)\n {\n return 'cut';\n }\n default\n {\n return ' ';\n }\n }\n} \/\/$end\n\nfunction ConvertBracket (bracket) {\n \/\/$module(ExportConverters.mss)\n switch(bracket)\n {\n case(BracketFull)\n {\n return 'bracket';\n }\n case(BracketBrace)\n {\n return 'brace';\n }\n case(BracketSub)\n {\n return 'line';\n }\n default\n {\n return 'none';\n }\n }\n} \/\/$end\n\nfunction ConvertSibeliusStructure (score) {\n \/\/$module(ExportConverters.mss)\n \/\/ Takes in the Staff\/Bar Sibelius Structure and returns a Bar\/Staff\n \/\/ mapping for our MEI writers.\n bar_to_staff = CreateDictionary();\n\n \/\/ Invert the Sibelius structure\n for each Staff s in score\n {\n for each Bar b in s\n {\n if (bar_to_staff.PropertyExists(b.BarNumber))\n {\n bar_to_staff[b.BarNumber].Push(s.StaffNum);\n }\n else\n {\n bar_to_staff[b.BarNumber] = CreateSparseArray();\n bar_to_staff[b.BarNumber].Push(s.StaffNum);\n }\n }\n }\n return bar_to_staff;\n} \/\/$end\n\nfunction ConvertColor (nrest) {\n \/\/$module(ExportConverters.mss)\n r = nrest.ColorRed;\n g = nrest.ColorGreen;\n b = nrest.ColorBlue;\n a_dec = nrest.ColorAlpha & '.0';\n a = a_dec \/ 255.0;\n\n return 'rgba(' & r & ',' & g & ',' & b & ',' & a & ')';\n} \/\/$end\n\nfunction ConvertNoteStyle (style) {\n \/\/$module(ExportConverters.mss)\n noteStyle = ' ';\n\n if (style = NormalNoteStyle)\n {\n return ' ';\n }\n\n switch (style)\n {\n case (CrossNoteStyle)\n {\n noteStyle = 'cross';\n }\n case (DiamondNoteStyle)\n {\n noteStyle = 'diamond';\n }\n case (CrossOrDiamondNoteStyle)\n {\n \/\/ Sibelius uses this for percussion\n \/\/ and does not differentiate in the \n \/\/ head style, so we have to choose one\n \/\/ or the other.\n noteStyle = 'cross';\n }\n case (BlackAndWhiteDiamondNoteStyle)\n {\n noteStyle = 'filldiamond';\n }\n case (SlashedNoteStyle)\n {\n noteStyle = 'addslash';\n }\n case (BackSlashedNoteStyle)\n {\n noteStyle = 'addbackslash';\n }\n case (ArrowDownNoteStyle)\n {\n \/\/ this is not completely correct, since\n \/\/ we use the same value for up and down\n \/\/ iso triangles. But it's all we have for now.\n noteStyle = 'isotriangle';\n }\n case (ArrowUpNoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (InvertedTriangleNoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (ShapedNote1NoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (ShapedNote2NoteStyle)\n {\n noteStyle = 'semicircle';\n }\n case (ShapedNote3NoteStyle)\n {\n noteStyle = 'diamond';\n }\n case (ShapedNote4StemUpNoteStyle)\n {\n noteStyle = 'rtriangle';\n }\n case (ShapedNote4StemDownNoteStyle)\n {\n noteStyle = 'rtriangle';\n }\n case (ShapedNote5NoteStyle)\n {\n \/\/ this looks normal...\n noteStyle = ' ';\n }\n case (ShapedNote6NoteStyle)\n {\n \/\/ there is no square in MEI...\n noteStyle = ' ';\n }\n case (ShapedNote7NoteStyle)\n {\n noteStyle = 'piewedge';\n }\n }\n\n return noteStyle;\n} \/\/$end\n\nfunction ConvertSlurStyle (style) {\n \/\/$module(ExportConverters.mss)\n slurparts = MSplitString(style, '.');\n direction = ' ';\n style = ' ';\n\n switch(slurparts[3])\n {\n case ('up')\n {\n direction = 'above';\n }\n case ('down')\n {\n direction = 'below';\n }\n default\n {\n direction = ' ';\n }\n }\n switch(slurparts[4])\n {\n case ('dashed')\n {\n style = 'dashed';\n }\n case ('dotted')\n {\n style = 'dotted';\n }\n default\n {\n style = ' ';\n }\n }\n return CreateSparseArray(direction, style);\n} \/\/$end\n\nfunction ConvertPositionToTimestamp (position, bar) {\n \/\/$module(ExportConverters.mss)\n \/*\n To convert Sibelius ticks to musical timestamps\n we use the formula:\n\n tstamp = (notePosition \/ (barLength \/ beatsInBar))\n *\/\n\n \/\/ make sure we're working with floating point numbers\n \/\/ and yes, this makes me feel very, very dirty in case\n \/\/ you were wondering, but this is the only way ManuScript\n \/\/ can cast to floating point...\n barlength = bar.Length;\n timesignature = Sibelius.ActiveScore.SystemStaff.CurrentTimeSignature(bar.BarNumber);\n\n if (position = 0)\n {\n return 1;\n }\n\n barlen = barlength & '.0';\n pos = position & '.0';\n beats = timesignature.Numerator & '.0';\n unit = (barlen \/ beats);\n ret = (pos \/ unit) + 1;\n\n return ret;\n} \/\/$end\n\nfunction ConvertTupletStyle (tupletStyle) {\n \/\/$module(ExportConverters.mss)\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.addAttribute(activeTuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.addAttribute(activeTuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.addAttribute(activeTuplet, 'num.format', 'ratio');\n }\n }\n\n} \/\/$end\n\nfunction ConvertBarline (linetype) {\n \/\/$module(ExportConverters.mss)\n switch(linetype)\n {\n case (SpecialBarlineStartRepeat)\n {\n \/\/ start repeat\n return 'rptstart';\n }\n case (SpecialBarlineEndRepeat)\n {\n \/\/ end repeat\n return 'rptend';\n }\n case (SpecialBarlineDashed)\n {\n \/\/ dashed\n return 'dashed';\n }\n case (SpecialBarlineDouble)\n {\n \/\/ double\n return 'dbl';\n }\n case (SpecialBarlineFinal)\n {\n \/\/ final\n return 'end';\n }\n case (SpecialBarlineInvisible)\n {\n \/\/ invisible\n return 'invis';\n }\n case (SpecialBarlineBetweenStaves)\n {\n \/\/ between staves\n \/\/ no MEI equiv.\n return ' ';\n }\n case (SpecialBarlineNormal)\n {\n \/\/ normal\n \/\/ this should usually be needed.\n return 'single';\n }\n case (SpecialBarlineTick)\n {\n \/\/ tick\n \/\/ unknown\n return ' ';\n }\n case (SpecialBarlineShort)\n {\n \/\/ short\n \/\/ unknown\n return ' ';\n }\n default\n {\n return ' ';\n }\n }\n} \/\/$end\n\nfunction ConvertText (textobj) {\n \/\/$module(ExportConverters.mss)\n styleid = textobj.StyleId;\n switch (styleid)\n {\n case ('text.staff.expression')\n {\n dynam = libmei.Dynam();\n libmei.SetText(dynam, lstrip(textobj.Text));\n libmei.AddAttribute(dynam, 'staff', textobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(dynam, 'tstamp', ConvertPositionToTimestamp(textobj));\n\n if (textobj.Dx != 0)\n {\n libmei.AddAttribute(dynam, 'ho', ConvertOffset(textobj.Dx));\n }\n\n if (textobj.Dy != 0)\n {\n libmei.AddAttribute(dynam, 'vo', ConvertOffset(textobj.Dy));\n }\n return dynam;\n }\n case ('text.system.page_aligned.title')\n {\n return ConvertTextElement(textobj);\n }\n case ('text.system.page_aligned.composer')\n {\n return ConvertTextElement(textobj);\n }\n default\n {\n return null;\n }\n }\n} \/\/$end\n\nfunction ConvertTextElement (textobj) {\n \/\/$module(ExportConverters.mss)\n obj = libmei.AnchoredText();\n libmei.SetText(obj, lstrip(textobj.Text));\n\n if (textobj.Dx != 0)\n {\n libmei.AddAttribute(obj, 'ho', ConvertOffsets(textobj.Dx));\n }\n\n if (textobj.Dy != 0)\n {\n libmei.AddAttribute(obj, 'vo', ConvertOffsets(textobj.Dy));\n }\n\n return obj;\n} \/\/$end\n\nfunction ConvertEndingValues (styleid) {\n \/\/$module(ExportConverters)\n ending_style = MSplitString(styleid, '.');\n num = ' ';\n label = ' ';\n type = ' ';\n\n switch(ending_style[3])\n {\n case ('1st')\n {\n num = 1;\n label = '1.';\n type = 'closed';\n }\n case ('1st_n_2nd')\n {\n num = 1;\n label = '1. 2.';\n type = 'closed';\n }\n case ('2nd')\n {\n num = 2;\n label = '2.';\n if (ending_style[-1] = 'closed')\n {\n type = 'closed';\n }\n else\n {\n type = 'open';\n }\n }\n case ('3rd')\n {\n num = 3;\n label = '3.';\n type = 'closed';\n }\n case ('open')\n {\n type = 'open';\n }\n case ('closed')\n {\n type = 'closed';\n }\n }\n\n return CreateSparseArray(num, label, type);\n\n} \/\/$end\n\nfunction ConvertDate (datetime) {\n \/\/$module(ExportConverters.mss)\n d = datetime.DayOfMonth;\n m = datetime.Month;\n y = datetime.Year;\n\n time = datetime.TimeWithSeconds;\n\n isodate = utils.Format('%s-%s-%sT%sZ', y, m, d, time);\n\n return isodate;\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"4a377341241abb672c54b394f5948db24bed9eb6","subject":"Fixed: Remove unused parameter","message":"Fixed: Remove unused parameter\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n\n \/\/ add chord symbols to the measure lines\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(chordsym._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n\n \/\/ add chord symbols to the measure lines\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(chordsym._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"8c6605c930f41a5025fe04f320cf04f0a5be3c00","subject":"Add InitFigbassCharMap()","message":"Add InitFigbassCharMap()\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/Utilities.mss","new_file":"src\/Utilities.mss","new_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in \n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/* \n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a dictionary of {pos:id} mappings for a given\n \/\/ voice, and returns the NoteRest object. If one isn't found\n \/\/ exactly at `position`, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions = null)\n {\n \/\/ theres not much we can do here. Bail.\n Log('Bailing due to insufficient voice information');\n return null;\n }\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (tstamps, etc.) to an element.\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Bar object'));\n }\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n if (bobj.Duration > 0)\n {\n libmei.AddAttribute(element, 'dur.ges', bobj.Duration & 'p');\n }\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bar));\n\n switch (bobj.Type)\n {\n case('Line')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Slur')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('DiminuendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('CrescendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('GlissandoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Trill')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction GetTupletStack (bobj) {\n \/\/$module(Utilities.mss)\n tupletStack = CreateSparseArray();\n parentTuplet = bobj.ParentTupletIfAny;\n while (parentTuplet != null)\n {\n tupletStack.Push(parentTuplet);\n parentTuplet = parentTuplet.ParentTupletIfAny;\n }\n tupletStack.Reverse();\n return tupletStack;\n} \/\/$end\n\nfunction CountTupletsEndingAtNoteRest(noteRest) {\n \/\/$module(Utilities.mss)\n tuplet = noteRest.ParentTupletIfAny;\n \n if (tuplet = null)\n {\n return 0;\n }\n \n nextNoteRest = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n\n if (nextNoteRest = null or nextNoteRest.ParentTupletIfAny = null)\n {\n tupletStack = GetTupletStack(noteRest);\n return tupletStack.Length;\n }\n \n if (TupletsEqual(tuplet, nextNoteRest.ParentTupletIfAny))\n {\n return 0;\n }\n \n tupletStack = GetTupletStack(noteRest);\n nextTupletStack = GetTupletStack(nextNoteRest);\n \n \/\/ We are looking for the highest index where both stacks are identical.\n index = utils.min(tupletStack.Length, nextTupletStack.Length) - 1;\n \n while (index >= 0 and not(TupletsEqual(tupletStack[index], nextTupletStack[index])))\n {\n index = index - 1;\n }\n \n return tupletStack.Length - 1 - index;\n} \/\/$end\n\nfunction GetMeiTupletDepth (layer) {\n \/\/$module(Utilities.mss)\n depth = 0;\n tuplet = layer._property:ActiveMeiTuplet;\n while (tuplet != null)\n {\n depth = depth + 1;\n tuplet = tuplet._property:ParentTuplet;\n }\n return depth;\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n Sibelius.AppendLineToFile(LOGFILE, message, True);\n} \/\/$end\n\nfunction NormalizedBeamProp (noteRest) {\n \/\/$module(Utilities.mss)\n \/*\n Sibelius' Beam properties can't be trusted. We need to look at the context,\n check whether they make sense and if they don't, find out the value we'd expect.\n Problems can e.g. be that Sibelius reports\n * a ContinueBeam at the start of a beam (we'd expect StartBeam)\n * a property other than NoBeam on a quarter or longer un-beamable duration\n (we'd expect NoBeam)\n * ... (almost any combinations imaginable)\n *\/\n if (noteRest.Beam = NoBeam or noteRest.Duration >= 256)\n {\n return NoBeam;\n }\n \n \/\/ At this point, we're only dealing with ContinueBeam and SingleBeam.\n \/\/ We need to look at the preceding note to see whether there's any\n \/\/ beam to continue.\n\n if (noteRest.Beam != StartBeam)\n {\n prev_obj = PrevNormalOrGrace(noteRest, noteRest.GraceNote);\n \n if (prev_obj != null and prev_obj.Beam != NoBeam and prev_obj.Duration < 256)\n {\n \/\/ We actually have a beam we can continue.\n if (noteRest.Beam = SingleBeam and noteRest.Duration < 128 and prev_obj.Duration < 128)\n {\n \/\/ SingleBeam only makes sense if we actually have secondary beams between the \n \/\/ previous note and the current note.\n return SingleBeam;\n }\n return ContinueBeam;\n }\n }\n \n \/\/ At this point, we know there is no previous beam we can continue because we have a\n \/\/ StartBeam or the above test for a previous beam failed.\n \/\/ We still need to check whether there is a following note that we can beam to.\n \n next_obj = NextNormalOrGrace(noteRest, noteRest.GraceNote);\n if (next_obj != null and next_obj.Duration < 256 and (next_obj.Beam = ContinueBeam or next_obj.Beam = SingleBeam))\n {\n return StartBeam;\n }\n else\n {\n return NoBeam;\n }\n} \/\/$end\n\nfunction NextNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n When given a 'normal' NoteRest, this function returns the next 'normal' NoteRest\n in the same voice.\n When given a grace NoteRest, this function returns the immediately adjacent \n following grace NoteRest, if existant.\n This function is basically a duplicate of PrevNormalOrGrace() with \n 'Previous' replaced by 'Next'.\n *\/\n next_obj = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (next_obj != null and not(next_obj.GraceNote))\n {\n next_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (next_obj != null and next_obj.GraceNote)\n {\n next_obj = next_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return next_obj;\n} \/\/$end\n\nfunction PrevNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n For a description, see NextNormalOrGrace().\n This function is basically a duplicate of PrevNormalOrGrace() with \n 'Next' replaced by 'Previous'.\n *\/\n prev_obj = noteRest.PreviousItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (prev_obj != null and not(prev_obj.GraceNote))\n {\n prev_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (prev_obj and prev_obj.GraceNote)\n {\n prev_obj = prev_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return prev_obj;\n} \/\/$end\n\nfunction GetNongraceParentBeam (noteRest, layer) {\n \/\/$module(Utilities.mss)\n \/*\n This function is used to find out whether a non-grace beam spans over a grace\n NoteRest that is either unbeamed or at the start of a grace beam.\n *\/\n if (layer._property:ActiveBeam != null)\n {\n \/\/ Only if the active non-grace beam continues to the next normal note, the\n \/\/ grace note is truly placed under the non-grace beam.\n nextNongraceNoteRest = NextNormalOrGrace(noteRest, false);\n if (nextNongraceNoteRest != null)\n {\n nextNormalBeamProp = NormalizedBeamProp(nextNongraceNoteRest);\n }\n else\n {\n nextNormalBeamProp = NoBeam;\n }\n if (nextNormalBeamProp = ContinueBeam or nextNormalBeamProp = SingleBeam)\n {\n return layer._property:ActiveBeam;\n }\n }\n return null;\n} \/\/$end\n\nfunction InitFigbassCharMap () {\n \/\/$module(Utilities.mss)\n map = CreateDictionary(\n '\u00a7', '\u266e',\n '#', '\u266f',\n '!', '\u266d',\n '?', '\ud834\udd2a',\n '%', '\ud834\udd2b',\n 'a', '(2)',\n 'i', '[2]',\n 'w', '2\u266e',\n 's', '2\u266f',\n 'x', '2\u266d',\n 'W', '\u266e2',\n 'S', '\u266f2',\n 'X', '\u266d2',\n 'k', '2+',\n 'p', '(3)',\n 'q', '[3]',\n 'e', '3\u266e',\n 'd', '3\u266f',\n 'c', '3\u266d',\n 'E', '\u266e3',\n 'D', '\u266f3',\n 'C', '\u266d3',\n 'z', '3+',\n 'A', '(4)',\n 'I', '[4]',\n 'r', '4\u266e',\n 'f', '4\u266f',\n 'v', '4\u266d',\n 'R', '\u266e4',\n 'F', '\u266f4',\n 'V', '\u266d4',\n 'K', '4+',\n 'P', '(5)',\n 'Q', '[5]',\n 't', '5\u266e',\n 'g', '5\u266f',\n 'b', '5\u266d',\n 'T', '\u266e5',\n 'G', '\u266f5',\n 'B', '\u266d5',\n 'Z', '5+',\n '$', '(6)',\n '\u00a8', '[6]',\n 'y', '6\u266e',\n 'h', '6\u266f',\n 'n', '6\u266d',\n 'Y', '\u266e6',\n 'H', '\u266f6',\n 'N', '\u266d6',\n ',', '6+',\n '\u00c2', '(7)',\n ';', '[7]',\n 'u', '7\u266e',\n 'j', '7\u266f',\n 'm', '7\u266d',\n 'U', '\u266e7',\n 'J', '\u266f7',\n 'M', '\u266d7',\n '<', '7+',\n '>', '+7',\n '=', '(8)',\n '\u00d6', '[8]',\n '\u00c0', '(9)',\n '{', '[9]',\n 'o', '9\u266e',\n 'l', '9\u266f',\n '\u00eb', '9\u266d',\n 'O', '\u266e9',\n 'L', '\u266f9',\n ':', '\u266d9',\n '}', '9+',\n '\u00c5', '|',\n '\u00fc', '_',\n '\u00a9', CreateSparseArray('2\u266f', 'U+EA53'), \/\/ 2 with slashed foot\n '\u00c4', CreateSparseArray('4\u266f', 'U+EA56'), \/\/ 4 with slashed horizontal line\n '\u00cb', CreateSparseArray('5\u266f', 'U+EA58'), \/\/ 5 with straight slash through head\n '\u00cf', CreateSparseArray('5\u266f', 'U+EA59'), \/\/ 5 with angled slash through head\n '\u00ef', CreateSparseArray('5\u266f', 'U+EA5A'), \/\/ 5 with slashed foot\n '\u00b4', CreateSparseArray('6\u266f', 'U+EA6F'), \/\/ 6 with slashed head\n '\u00e4', CreateSparseArray('7\u266f', 'U+EA5E'), \/\/ 7 with slashed head\n '&', CreateSparseArray('7\u266f', 'U+EA5F'), \/\/ 7 with slashed stem\n \/\/ (Sibelius\/Opus and SMuFL\/Bravura don't match 100% for the slashed 9:\n \/\/ Opus slashes the stem, Bravura the head)\n '\u00f6', CreateSparseArray('9#', 'U+EA62') \/\/ slashed 9\n );\n literalChars = '0123456789[]_-+.';\n for i = 0 to Length(literalChars)\n {\n char = CharAt(literalChars, i);\n map[char] = char;\n }\n\n return map;\n} \/\/$end\n","old_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in \n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/* \n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a dictionary of {pos:id} mappings for a given\n \/\/ voice, and returns the NoteRest object. If one isn't found\n \/\/ exactly at `position`, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions = null)\n {\n \/\/ theres not much we can do here. Bail.\n Log('Bailing due to insufficient voice information');\n return null;\n }\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (tstamps, etc.) to an element.\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Bar object'));\n }\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n if (bobj.Duration > 0)\n {\n libmei.AddAttribute(element, 'dur.ges', bobj.Duration & 'p');\n }\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bar));\n\n switch (bobj.Type)\n {\n case('Line')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Slur')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('DiminuendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('CrescendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('GlissandoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Trill')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction GetTupletStack (bobj) {\n \/\/$module(Utilities.mss)\n tupletStack = CreateSparseArray();\n parentTuplet = bobj.ParentTupletIfAny;\n while (parentTuplet != null)\n {\n tupletStack.Push(parentTuplet);\n parentTuplet = parentTuplet.ParentTupletIfAny;\n }\n tupletStack.Reverse();\n return tupletStack;\n} \/\/$end\n\nfunction CountTupletsEndingAtNoteRest(noteRest) {\n \/\/$module(Utilities.mss)\n tuplet = noteRest.ParentTupletIfAny;\n \n if (tuplet = null)\n {\n return 0;\n }\n \n nextNoteRest = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n\n if (nextNoteRest = null or nextNoteRest.ParentTupletIfAny = null)\n {\n tupletStack = GetTupletStack(noteRest);\n return tupletStack.Length;\n }\n \n if (TupletsEqual(tuplet, nextNoteRest.ParentTupletIfAny))\n {\n return 0;\n }\n \n tupletStack = GetTupletStack(noteRest);\n nextTupletStack = GetTupletStack(nextNoteRest);\n \n \/\/ We are looking for the highest index where both stacks are identical.\n index = utils.min(tupletStack.Length, nextTupletStack.Length) - 1;\n \n while (index >= 0 and not(TupletsEqual(tupletStack[index], nextTupletStack[index])))\n {\n index = index - 1;\n }\n \n return tupletStack.Length - 1 - index;\n} \/\/$end\n\nfunction GetMeiTupletDepth (layer) {\n \/\/$module(Utilities.mss)\n depth = 0;\n tuplet = layer._property:ActiveMeiTuplet;\n while (tuplet != null)\n {\n depth = depth + 1;\n tuplet = tuplet._property:ParentTuplet;\n }\n return depth;\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n Sibelius.AppendLineToFile(LOGFILE, message, True);\n} \/\/$end\n\nfunction NormalizedBeamProp (noteRest) {\n \/\/$module(Utilities.mss)\n \/*\n Sibelius' Beam properties can't be trusted. We need to look at the context,\n check whether they make sense and if they don't, find out the value we'd expect.\n Problems can e.g. be that Sibelius reports\n * a ContinueBeam at the start of a beam (we'd expect StartBeam)\n * a property other than NoBeam on a quarter or longer un-beamable duration\n (we'd expect NoBeam)\n * ... (almost any combinations imaginable)\n *\/\n if (noteRest.Beam = NoBeam or noteRest.Duration >= 256)\n {\n return NoBeam;\n }\n \n \/\/ At this point, we're only dealing with ContinueBeam and SingleBeam.\n \/\/ We need to look at the preceding note to see whether there's any\n \/\/ beam to continue.\n\n if (noteRest.Beam != StartBeam)\n {\n prev_obj = PrevNormalOrGrace(noteRest, noteRest.GraceNote);\n \n if (prev_obj != null and prev_obj.Beam != NoBeam and prev_obj.Duration < 256)\n {\n \/\/ We actually have a beam we can continue.\n if (noteRest.Beam = SingleBeam and noteRest.Duration < 128 and prev_obj.Duration < 128)\n {\n \/\/ SingleBeam only makes sense if we actually have secondary beams between the \n \/\/ previous note and the current note.\n return SingleBeam;\n }\n return ContinueBeam;\n }\n }\n \n \/\/ At this point, we know there is no previous beam we can continue because we have a\n \/\/ StartBeam or the above test for a previous beam failed.\n \/\/ We still need to check whether there is a following note that we can beam to.\n \n next_obj = NextNormalOrGrace(noteRest, noteRest.GraceNote);\n if (next_obj != null and next_obj.Duration < 256 and (next_obj.Beam = ContinueBeam or next_obj.Beam = SingleBeam))\n {\n return StartBeam;\n }\n else\n {\n return NoBeam;\n }\n} \/\/$end\n\nfunction NextNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n When given a 'normal' NoteRest, this function returns the next 'normal' NoteRest\n in the same voice.\n When given a grace NoteRest, this function returns the immediately adjacent \n following grace NoteRest, if existant.\n This function is basically a duplicate of PrevNormalOrGrace() with \n 'Previous' replaced by 'Next'.\n *\/\n next_obj = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (next_obj != null and not(next_obj.GraceNote))\n {\n next_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (next_obj != null and next_obj.GraceNote)\n {\n next_obj = next_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return next_obj;\n} \/\/$end\n\nfunction PrevNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n For a description, see NextNormalOrGrace().\n This function is basically a duplicate of PrevNormalOrGrace() with \n 'Next' replaced by 'Previous'.\n *\/\n prev_obj = noteRest.PreviousItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (prev_obj != null and not(prev_obj.GraceNote))\n {\n prev_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (prev_obj and prev_obj.GraceNote)\n {\n prev_obj = prev_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return prev_obj;\n} \/\/$end\n\nfunction GetNongraceParentBeam (noteRest, layer) {\n \/\/$module(Utilities.mss)\n \/*\n This function is used to find out whether a non-grace beam spans over a grace\n NoteRest that is either unbeamed or at the start of a grace beam.\n *\/\n if (layer._property:ActiveBeam != null)\n {\n \/\/ Only if the active non-grace beam continues to the next normal note, the\n \/\/ grace note is truly placed under the non-grace beam.\n nextNongraceNoteRest = NextNormalOrGrace(noteRest, false);\n if (nextNongraceNoteRest != null)\n {\n nextNormalBeamProp = NormalizedBeamProp(nextNongraceNoteRest);\n }\n else\n {\n nextNormalBeamProp = NoBeam;\n }\n if (nextNormalBeamProp = ContinueBeam or nextNormalBeamProp = SingleBeam)\n {\n return layer._property:ActiveBeam;\n }\n }\n return null;\n} \/\/$end\n\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"d9e4795f1e747106916a86e71e05b191910b92ee","subject":"update marine labels for v6","message":"update marine labels for v6\n","repos":"mapbox\/mapbox-studio-run-bike-and-hike.tm2,mapbox\/mapbox-studio-run-bike-and-hike.tm2","old_file":"labels.mss","new_file":"labels.mss","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Places \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Countries \/\/\n#country_label[zoom>=2] {\n text-name: @name;\n text-face-name: @med;\n text-wrap-width: 140;\n text-wrap-before: true;\n text-fill: @country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 2;\n text-halo-rasterizer: fast;\n text-size: 12;\n [zoom>=3][scalerank=1],\n [zoom>=4][scalerank=2],\n [zoom>=5][scalerank=3],\n [zoom>=6][scalerank>3] {\n text-size: 14;\n text-wrap-width: 160;\n }\n [zoom>=4][scalerank=1],\n [zoom>=5][scalerank=2],\n [zoom>=6][scalerank=3],\n [zoom>=7][scalerank>3] {\n text-size: 16;\n text-wrap-width: 185;\n }\n [zoom>=8] { text-fill: @country_text_high; } \n}\n\n\/\/ States \/\/\n#state_label[zoom>=4][zoom<=10] {\n text-name: [abbr];\n text-face-name: @reg;\n text-transform: uppercase;\n text-character-spacing: 1.5;\n text-placement: point;\n text-fill: @state_text;\n text-halo-fill: @state_halo;\n text-opacity: 1;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-size: 10;\n [zoom>=4][area>100000],\n [zoom>=5][area>50000],\n [zoom>=6][area>10000],\n [zoom>=7][area<=10000] {\n text-name: [abbr];\n }\n [zoom>=5][area>100000],\n [zoom>=6][area>50000],\n [zoom>=7][area>10000],\n [zoom>=8][area<=10000] {\n text-name: @name;\n }\n [zoom>=5][zoom<=6] {\n [area>10000] { text-size: 10; }\n [area>50000] { text-size: 11; }\n text-wrap-width: 40;\n }\n [zoom>=7] {\n text-size: 12;\n [area>50000] { text-size: 13; }\n [area>100000] { text-size: 14; }\n text-wrap-width: 60;\n }\n [zoom>=8] {\n text-size: 16;\n [area>50000] { text-size: 18; }\n [area>100000] { text-size: 20; }\n text-wrap-width: 80;\n }\n [zoom>=9][zoom<=10] {\n text-size: 18;\n [area>50000] { text-size: 20; }\n text-wrap-width: 100;\n }\n}\n\n\/\/ City dots \u2013\u00a0version with markers as text\n#place_label::citydots[type='city'][zoom>=4][zoom<=7][localrank<=1] {\n [ldir='N'],[ldir='S'],[ldir='E'],[ldir='W'],\n [ldir='NE'],[ldir='SE'],[ldir='SW'],[ldir='NW'] {\n \/\/ explicitly defining all the `ldir` values wer'e going\n \/\/ to use shaves a bit off the final project.xml size\n [ldir='E'] {\n text-name: '\u2218\u2009' + [name_en];\n text-horizontal-alignment: right; \n }\n [ldir='W'] {\n text-name: [name_en] + '\u2009\u2218';\n text-horizontal-alignment: left; \n }\n [ldir='S'] { \n text-name: '\u2218\\n' + [name_en];\n text-line-spacing: -10;\n text-vertical-alignment: bottom;\n } \n [ldir='N'] {\n text-name: [name_en] + '\\n\u2218';\n text-line-spacing: -10;\n text-vertical-alignment: top;\n }\n [ldir='SE'] {\n text-name: '\u2218\\n ' + [name_en];\n text-line-spacing: -15;\n text-vertical-alignment: bottom;\n text-horizontal-alignment: right;\n text-align: left;\n }\n [ldir='SW'] {\n text-name: '\u2218\\n' + [name_en] + ' ';\n text-line-spacing: -16;\n text-vertical-alignment: bottom;\n text-horizontal-alignment: left;\n text-align: right;\n }\n [ldir='NE'] {\n text-name: ' ' + [name_en] + '\\n\u2218';\n text-line-spacing: -16;\n text-vertical-alignment: top;\n text-horizontal-alignment: right;\n text-align: left;\n }\n [ldir='NW'] {\n text-name: [name_en] + ' \\n\u2218';\n text-line-spacing: -15;\n text-vertical-alignment: top;\n text-horizontal-alignment: left;\n text-align: right;\n }\n text-name: @name;\n text-size: 16;\n text-face-name: @reg;\n text-placement: point;\n text-fill: @city_text;\n text-halo-fill: @city_halo;\n text-halo-radius: 2;\n text-halo-rasterizer: fast; \n }\n}\n\n#place_label {\n [type='city'][zoom>=8][zoom<=15][localrank=1] {\n text-name: @name;\n text-face-name: @reg;\n text-fill: @city_text;\n text-halo-fill: @city_halo;\n text-halo-radius: 2;\n text-halo-rasterizer: fast;\n text-size: 16;\n text-line-spacing: -8;\n text-wrap-width: 160;\n text-wrap-before: true;\n [zoom>=9] { \n text-size: 17; \n text-wrap-width: 170; }\n [zoom>=10] { \n text-size: 18; \n text-wrap-width: 180; }\n [zoom>=12] { \n text-size: 24;\n text-character-spacing: 0;\n text-wrap-width: 220; \n }\n [zoom>=14] { \n text-fill: @city_text_high; \n text-size: 28;\n text-wrap-width: 250;\n } \n }\n }\n\n#place_label { \n [type='town'][zoom>=8][zoom<=17][localrank<=1] {\n text-name: @name;\n text-face-name: @reg;\n text-fill: @town_text;\n text-halo-fill: @town_halo;\n text-halo-radius: 2;\n text-halo-rasterizer: fast;\n text-size: 12;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-wrap-before: true;\n [zoom>=10] { \n text-size: 14;\n text-wrap-width: 120; \n }\n [zoom>=12] { \n text-size: 20;\n text-wrap-width: 160; \n }\n [zoom>=14] { \n text-fill: @town_text_high; \n text-size: 26;\n text-wrap-width: 200;\n }\n [zoom>=16] { \n text-size: 28;\n text-wrap-width: 180; \n }\n }\n [type='village'][zoom>=10][zoom<=18][localrank<=1],\n [type='hamlet'][zoom>=12][zoom<=18][localrank<=1] {\n text-name: @name;\n text-face-name: @reg;\n text-fill: @village_text;\n text-halo-fill: @village_halo;\n text-halo-radius: 2;\n text-halo-rasterizer: fast;\n text-size: 12;\n text-wrap-width: 100;\n text-line-spacing: -8;\n text-wrap-before: true;\n [type='village'] {\n [zoom>=12] { \n text-size: 18; \n text-wrap-width: 180; \n }\n [zoom>=14] { \n text-size: 20; \n text-wrap-width: 200; \n }\n [zoom>=16] {\n text-fill: @village_text_high;\n text-size: 24; \n text-wrap-width: 240; \n }\n [zoom>=18] {\n text-size: 26; \n text-wrap-width: 250; \n }\n }\n [type='hamlet'] {\n [zoom>=12] { \n text-size: 16; \n text-wrap-width: 160;\n }\n [zoom>=14] { \n text-size: 18; \n text-wrap-width: 180; \n }\n [zoom>=16] {\n text-fill: @village_text_high;\n text-size: 22; \n text-wrap-width: 220; \n }\n [zoom>=18] {\n text-size: 24; \n text-wrap-width: 240; \n }\n }\n }\n \n [type='suburb'][zoom>=12][zoom<=17][localrank<=1],\n [type='neighbourhood'][zoom>=13][zoom<=17][localrank<=1] {\n text-name: @name;\n text-face-name: @reg;\n text-fill: @neigh_text;\n text-halo-fill: @neigh_halo;\n text-halo-radius: 2;\n text-halo-rasterizer: fast;\n text-size: 14;\n text-wrap-width: 100;\n text-wrap-before: true;\n text-line-spacing: -8;\n [type='suburb'][zoom>=13],\n [type='neighbourhood'][zoom>=14] {\n text-size: 16; \n text-wrap-width: 160; \n }\n [type='suburb'][zoom>=14],\n [type='neighbourhood'][zoom>=15] {\n text-size: 18; \n text-wrap-width: 180;\n }\n [type='suburb'][zoom>=15],\n [type='neighbourhood'][zoom>=16] {\n text-size: 20; \n text-wrap-width: 200;\n }\n [type='suburb'][zoom>=16],\n [type='neighbourhood'][zoom>=17] {\n text-size: 22; \n text-wrap-width: 220;\n }\n [type='suburb'][zoom>=17] {\n text-size: 24; \n text-wrap-width: 240;\n }\n [zoom>=16] { text-fill:@neigh_text_high; }\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Water Features \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Water bodies \/\/\n#water_label {\n [zoom<=13], \/\/ automatic area filtering @ low zooms\n [zoom>=14][area>500000],\n [zoom>=16][area>10000],\n [zoom>=17] {\n text-name: @name;\n text-face-name: @it_bd;\n text-fill: darken(@marine_text, 10);\n text-character-spacing: 0.5; \n text-size: 9;\n text-wrap-width: 40;\n text-wrap-before: true;\n text-halo-fill: fadeout(@land, 5);\/\/fadeout(#fff, 25);\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n }\n [zoom>=15][area>500000],\n [zoom>=17][area>10000],\n [zoom>=18] {\n text-size: 10;\n text-wrap-width: 70;\n }\n [zoom>=16][area>500000],\n [zoom>=18][area>10000],\n [zoom>=19] {\n text-size: 11;\n text-wrap-width: 80;\n }\n [zoom>=12][area>10000000],\n [zoom>=14][area>5000000] {\n text-size: 12;\n text-wrap-width: 90;\n }\n [zoom>=10][area>100000000] {\n text-size: 13;\n text-wrap-width: 90;\n }\n}\n\n\/\/ Waterways \/\/\n#waterway_label {\n [class=\"river\"][zoom>=13],\n [class=\"canal\"][zoom>=15],\n [class=\"stream\"][zoom>=17], \n [class=\"stream_intermittent\"][zoom>=17] {\n text-placement: line;\n text-avoid-edges:true;\n text-min-distance: 400;\n text-name: @name;\n text-face-name: @it_bd;\n text-fill: darken(@marine_text, 25);\n text-size: 9;\n text-character-spacing: 1; \n text-halo-fill: fadeout(#fff, 45);\n text-halo-radius: 1;\n text-halo-rasterizer:fast;\n } \n [class=\"river\"][zoom>=14],\n [class=\"canal\"][zoom>=16],\n [class=\"stream\"][zoom>=18], \n [class=\"stream_intermittent\"][zoom>=18] {\n text-size: 9;\n }\n [class='river'][zoom=15],\n [class='canal'][zoom>=17] {\n text-size: 10;\n }\n [class='river'][zoom>=16],\n [class='canal'][zoom>=18] {\n text-size: 11;\n }\n}\n\n\/\/ Marine (oceans and seas) \/\/\n#marine_label[zoom>=2][\"mapnik::geometry_type\"=1],\n#marine_label[zoom>=2][\"mapnik::geometry_type\"=2] {\n text-name: @name;\n text-face-name: @it;\n text-fill: @marine_text;\n text-halo-fill: fadeout(#fff, 95);\n text-halo-radius: 2;\n [\"mapnik::geometry_type\"=1] {\n text-placement: point;\n text-wrap-width: 30;\n }\n [\"mapnik::geometry_type\"=2] {\n text-placement: line;\n }\n [labelrank=1][zoom>=2],\n [labelrank=2][zoom>=3],\n [labelrank=3][zoom>=4],\n [labelrank=4][zoom>=5],\n [labelrank=5][zoom>=6],\n [labelrank=6][zoom>=7] {\n text-size: 13;\n text-character-spacing: 1;\n }\n [labelrank=1][zoom>=3],\n [labelrank=2][zoom>=4],\n [labelrank=3][zoom>=5],\n [labelrank=4][zoom>=6],\n [labelrank=5][zoom>=7],\n [labelrank=6][zoom>=8] {\n text-size: 16;\n text-character-spacing: 2;\n }\n [labelrank=1][zoom>=4],\n [labelrank=2][zoom>=5],\n [labelrank=3][zoom>=6] {\n text-size: 20;\n text-character-spacing: 4;\n }\n [labelrank=1][zoom>=5],\n [labelrank=2][zoom>=6],\n [labelrank=3][zoom>=7] {\n text-size: 24;\n text-character-spacing: 8;\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Road labels \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ highway shield\n#road_label::shield-pt[class='motorway'][zoom>=7][zoom<=10][localrank=1][reflen<=6],\n#road_label::shield-pt[class='motorway'][zoom>=9][zoom<=10][localrank=1][reflen<=6],\n#road_label::shield-ln[zoom>=11][reflen<=6] {\n shield-name: \"[ref].replace('\u00b7', '\\n')\";\n shield-size: 9;\n shield-line-spacing: -4;\n shield-file: url('img\/shield\/[shield]-[reflen].svg');\n shield-face-name: @bold;\n shield-fill: #333;\n [zoom>=14] {\n shield-transform: scale(1.25,1.25);\n shield-size: 11;\n }\n}\n#road_label::shield-pt[class='motorway'][zoom>=7][zoom<=10][localrank=1][reflen<=6],\n#road_label::shield-pt[class='motorway'][zoom>=9][zoom<=10][localrank=1][reflen<=6] {\n shield-placement: point;\n shield-avoid-edges: false;\n}\n#road_label::shield-ln[zoom>=11][reflen<=6] {\n shield-placement: line;\n shield-spacing: 400;\n shield-min-distance: 20;\n shield-avoid-edges: true;\n}\n\n\/\/ Larger roads \/\/\n#road_label['mapnik::geometry_type'=2] {\n \/\/ Longer roads get a label earlier as they are likely to be more\n \/\/ important. This especially helps label density in rural\/remote areas.\n \/\/ This z14 filter is *not* redundant to logic in SQL queries. Because z14\n \/\/ includes all data for z14+ via overzooming, the streets included in a\n \/\/ z14 vector tile include more features than ideal for optimal performance.\n [class='motorway'][zoom>=14],\n [class='main'][zoom<=12][len>5000], \n [class='main'][zoom>=13][len>2000],\n [class='main'][zoom>=14][len>1500], \n [class='main'][zoom>=15][len>750], \n [class='main'][zoom>=16],\n [class='street'][zoom>=15][len>1500], \n [class='street'][zoom>=16],\n [class='street_limited'][zoom>=16] {\n text-avoid-edges: true;\n text-name: [name];\n text-character-spacing: 0.25;\n text-placement: line;\n text-face-name: @reg;\n text-fill: @road_text;\n text-size: 11;\n text-halo-fill: @road_halo;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-min-distance: 200; \/\/ only for labels w\/ the same name\n [class='motorway'] { text-halo-fill: @motorway_halo; }\n [zoom>=14] { \n text-size: 11; \n text-fill: @road_text_high; \n }\n [zoom>=16] { text-fill: @road_text_high2; }\n [zoom>=17] { text-size: 12; }\n [class='motorway'],\n [class='main'] {\n [zoom>=14] { \n text-size: 12; \n text-fill: @road_text_high; \n }\n [zoom>=16] { \n text-size: 13; \n text-fill: @road_text_high2; \n }\n [zoom>=17] { text-size: 14; }\n [zoom>=18] { text-size: 15; }\n }\n }\n}\n\n\/\/ Smaller roads \/\/\n#road_label['mapnik::geometry_type'=2]\n [class!='motorway']\n [class!='main']\n [class!='street']\n [class!='street_limited'] {\n [len>750][zoom>=16],\n [len>0][zoom>=17] { \n text-avoid-edges: true;\n text-name: [name];\n text-character-spacing: 0.25;\n text-placement: line;\n text-face-name: @reg;\n text-fill: @road_text;\n text-size: 11;\n text-halo-fill: @road_halo;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-min-distance: 200; \/\/ only for labels w\/ the same name\n [zoom>=15] { text-fill: @road_text_high; }\n } \n } ","old_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Places \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Countries \/\/\n#country_label[zoom>=2] {\n text-name: @name;\n text-face-name: @med;\n text-wrap-width: 140;\n text-wrap-before: true;\n text-fill: @country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 2;\n text-halo-rasterizer: fast;\n text-size: 12;\n [zoom>=3][scalerank=1],\n [zoom>=4][scalerank=2],\n [zoom>=5][scalerank=3],\n [zoom>=6][scalerank>3] {\n text-size: 14;\n text-wrap-width: 160;\n }\n [zoom>=4][scalerank=1],\n [zoom>=5][scalerank=2],\n [zoom>=6][scalerank=3],\n [zoom>=7][scalerank>3] {\n text-size: 16;\n text-wrap-width: 185;\n }\n [zoom>=8] { text-fill: @country_text_high; } \n}\n\n\/\/ States \/\/\n#state_label[zoom>=4][zoom<=10] {\n text-name: [abbr];\n text-face-name: @reg;\n text-transform: uppercase;\n text-character-spacing: 1.5;\n text-placement: point;\n text-fill: @state_text;\n text-halo-fill: @state_halo;\n text-opacity: 1;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-size: 10;\n [zoom>=4][area>100000],\n [zoom>=5][area>50000],\n [zoom>=6][area>10000],\n [zoom>=7][area<=10000] {\n text-name: [abbr];\n }\n [zoom>=5][area>100000],\n [zoom>=6][area>50000],\n [zoom>=7][area>10000],\n [zoom>=8][area<=10000] {\n text-name: @name;\n }\n [zoom>=5][zoom<=6] {\n [area>10000] { text-size: 10; }\n [area>50000] { text-size: 11; }\n text-wrap-width: 40;\n }\n [zoom>=7] {\n text-size: 12;\n [area>50000] { text-size: 13; }\n [area>100000] { text-size: 14; }\n text-wrap-width: 60;\n }\n [zoom>=8] {\n text-size: 16;\n [area>50000] { text-size: 18; }\n [area>100000] { text-size: 20; }\n text-wrap-width: 80;\n }\n [zoom>=9][zoom<=10] {\n text-size: 18;\n [area>50000] { text-size: 20; }\n text-wrap-width: 100;\n }\n}\n\n\/\/ City dots \u2013\u00a0version with markers as text\n#place_label::citydots[type='city'][zoom>=4][zoom<=7][localrank<=1] {\n [ldir='N'],[ldir='S'],[ldir='E'],[ldir='W'],\n [ldir='NE'],[ldir='SE'],[ldir='SW'],[ldir='NW'] {\n \/\/ explicitly defining all the `ldir` values wer'e going\n \/\/ to use shaves a bit off the final project.xml size\n [ldir='E'] {\n text-name: '\u2218\u2009' + [name_en];\n text-horizontal-alignment: right; \n }\n [ldir='W'] {\n text-name: [name_en] + '\u2009\u2218';\n text-horizontal-alignment: left; \n }\n [ldir='S'] { \n text-name: '\u2218\\n' + [name_en];\n text-line-spacing: -10;\n text-vertical-alignment: bottom;\n } \n [ldir='N'] {\n text-name: [name_en] + '\\n\u2218';\n text-line-spacing: -10;\n text-vertical-alignment: top;\n }\n [ldir='SE'] {\n text-name: '\u2218\\n ' + [name_en];\n text-line-spacing: -15;\n text-vertical-alignment: bottom;\n text-horizontal-alignment: right;\n text-align: left;\n }\n [ldir='SW'] {\n text-name: '\u2218\\n' + [name_en] + ' ';\n text-line-spacing: -16;\n text-vertical-alignment: bottom;\n text-horizontal-alignment: left;\n text-align: right;\n }\n [ldir='NE'] {\n text-name: ' ' + [name_en] + '\\n\u2218';\n text-line-spacing: -16;\n text-vertical-alignment: top;\n text-horizontal-alignment: right;\n text-align: left;\n }\n [ldir='NW'] {\n text-name: [name_en] + ' \\n\u2218';\n text-line-spacing: -15;\n text-vertical-alignment: top;\n text-horizontal-alignment: left;\n text-align: right;\n }\n text-name: @name;\n text-size: 16;\n text-face-name: @reg;\n text-placement: point;\n text-fill: @city_text;\n text-halo-fill: @city_halo;\n text-halo-radius: 2;\n text-halo-rasterizer: fast; \n }\n}\n\n#place_label {\n [type='city'][zoom>=8][zoom<=15][localrank=1] {\n text-name: @name;\n text-face-name: @reg;\n text-fill: @city_text;\n text-halo-fill: @city_halo;\n text-halo-radius: 2;\n text-halo-rasterizer: fast;\n text-size: 16;\n text-line-spacing: -8;\n text-wrap-width: 160;\n text-wrap-before: true;\n [zoom>=9] { \n text-size: 17; \n text-wrap-width: 170; }\n [zoom>=10] { \n text-size: 18; \n text-wrap-width: 180; }\n [zoom>=12] { \n text-size: 24;\n text-character-spacing: 0;\n text-wrap-width: 220; \n }\n [zoom>=14] { \n text-fill: @city_text_high; \n text-size: 28;\n text-wrap-width: 250;\n } \n }\n }\n\n#place_label { \n [type='town'][zoom>=8][zoom<=17][localrank<=1] {\n text-name: @name;\n text-face-name: @reg;\n text-fill: @town_text;\n text-halo-fill: @town_halo;\n text-halo-radius: 2;\n text-halo-rasterizer: fast;\n text-size: 12;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-wrap-before: true;\n [zoom>=10] { \n text-size: 14;\n text-wrap-width: 120; \n }\n [zoom>=12] { \n text-size: 20;\n text-wrap-width: 160; \n }\n [zoom>=14] { \n text-fill: @town_text_high; \n text-size: 26;\n text-wrap-width: 200;\n }\n [zoom>=16] { \n text-size: 28;\n text-wrap-width: 180; \n }\n }\n [type='village'][zoom>=10][zoom<=18][localrank<=1],\n [type='hamlet'][zoom>=12][zoom<=18][localrank<=1] {\n text-name: @name;\n text-face-name: @reg;\n text-fill: @village_text;\n text-halo-fill: @village_halo;\n text-halo-radius: 2;\n text-halo-rasterizer: fast;\n text-size: 12;\n text-wrap-width: 100;\n text-line-spacing: -8;\n text-wrap-before: true;\n [type='village'] {\n [zoom>=12] { \n text-size: 18; \n text-wrap-width: 180; \n }\n [zoom>=14] { \n text-size: 20; \n text-wrap-width: 200; \n }\n [zoom>=16] {\n text-fill: @village_text_high;\n text-size: 24; \n text-wrap-width: 240; \n }\n [zoom>=18] {\n text-size: 26; \n text-wrap-width: 250; \n }\n }\n [type='hamlet'] {\n [zoom>=12] { \n text-size: 16; \n text-wrap-width: 160;\n }\n [zoom>=14] { \n text-size: 18; \n text-wrap-width: 180; \n }\n [zoom>=16] {\n text-fill: @village_text_high;\n text-size: 22; \n text-wrap-width: 220; \n }\n [zoom>=18] {\n text-size: 24; \n text-wrap-width: 240; \n }\n }\n }\n \n [type='suburb'][zoom>=12][zoom<=17][localrank<=1],\n [type='neighbourhood'][zoom>=13][zoom<=17][localrank<=1] {\n text-name: @name;\n text-face-name: @reg;\n text-fill: @neigh_text;\n text-halo-fill: @neigh_halo;\n text-halo-radius: 2;\n text-halo-rasterizer: fast;\n text-size: 14;\n text-wrap-width: 100;\n text-wrap-before: true;\n text-line-spacing: -8;\n [type='suburb'][zoom>=13],\n [type='neighbourhood'][zoom>=14] {\n text-size: 16; \n text-wrap-width: 160; \n }\n [type='suburb'][zoom>=14],\n [type='neighbourhood'][zoom>=15] {\n text-size: 18; \n text-wrap-width: 180;\n }\n [type='suburb'][zoom>=15],\n [type='neighbourhood'][zoom>=16] {\n text-size: 20; \n text-wrap-width: 200;\n }\n [type='suburb'][zoom>=16],\n [type='neighbourhood'][zoom>=17] {\n text-size: 22; \n text-wrap-width: 220;\n }\n [type='suburb'][zoom>=17] {\n text-size: 24; \n text-wrap-width: 240;\n }\n [zoom>=16] { text-fill:@neigh_text_high; }\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Water Features \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Water bodies \/\/\n#water_label {\n [zoom<=13], \/\/ automatic area filtering @ low zooms\n [zoom>=14][area>500000],\n [zoom>=16][area>10000],\n [zoom>=17] {\n text-name: @name;\n text-face-name: @it_bd;\n text-fill: darken(@marine_text, 10);\n text-character-spacing: 0.5; \n text-size: 9;\n text-wrap-width: 40;\n text-wrap-before: true;\n text-halo-fill: fadeout(@land, 5);\/\/fadeout(#fff, 25);\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n }\n [zoom>=15][area>500000],\n [zoom>=17][area>10000],\n [zoom>=18] {\n text-size: 10;\n text-wrap-width: 70;\n }\n [zoom>=16][area>500000],\n [zoom>=18][area>10000],\n [zoom>=19] {\n text-size: 11;\n text-wrap-width: 80;\n }\n [zoom>=12][area>10000000],\n [zoom>=14][area>5000000] {\n text-size: 12;\n text-wrap-width: 90;\n }\n [zoom>=10][area>100000000] {\n text-size: 13;\n text-wrap-width: 90;\n }\n}\n\n\/\/ Waterways \/\/\n#waterway_label {\n [class=\"river\"][zoom>=13],\n [class=\"canal\"][zoom>=15],\n [class=\"stream\"][zoom>=17], \n [class=\"stream_intermittent\"][zoom>=17] {\n text-placement: line;\n text-avoid-edges:true;\n text-min-distance: 400;\n text-name: @name;\n text-face-name: @it_bd;\n text-fill: darken(@marine_text, 25);\n text-size: 9;\n text-character-spacing: 1; \n text-halo-fill: fadeout(#fff, 45);\n text-halo-radius: 1;\n text-halo-rasterizer:fast;\n } \n [class=\"river\"][zoom>=14],\n [class=\"canal\"][zoom>=16],\n [class=\"stream\"][zoom>=18], \n [class=\"stream_intermittent\"][zoom>=18] {\n text-size: 9;\n }\n [class='river'][zoom=15],\n [class='canal'][zoom>=17] {\n text-size: 10;\n }\n [class='river'][zoom>=16],\n [class='canal'][zoom>=18] {\n text-size: 11;\n }\n}\n\n\/\/ Marine (oceans and seas) \/\/\n#marine_label[zoom>=2][\"mapnik::geometry_type\"=1],\n#marine_label[zoom>=2][\"mapnik::geometry_type\"=2] {\n text-name: @name;\n text-face-name: @it;\n text-fill: @marine_text;\n text-wrap-width: 70;\n text-wrap-before: true;\n text-halo-fill: fadeout(#fff, 95);\n text-halo-radius: 2;\n [\"mapnik::geometry_type\"=1] {\n text-placement: point;\n text-wrap-width: 30;\n }\n [\"mapnik::geometry_type\"=2] {\n text-placement: line;\n }\n [labelrank = 1] {\n text-wrap-width: 400;\n [zoom = 3] {\n text-size: 14;\n text-character-spacing: 4;\n text-line-spacing: 16;\n }\n [zoom = 4] {\n text-size: 16;\n text-character-spacing: 6;\n text-line-spacing: 24;\n }\n [zoom = 5] {\n text-size: 18;\n text-character-spacing: 8;\n text-line-spacing: 32;\n }\n }\n [labelrank = 2] {\n [zoom = 3] {\n text-size: 10;\n text-character-spacing: 2;\n text-line-spacing: 6;\n }\n [zoom = 4] {\n text-size: 11;\n text-character-spacing: 2;\n text-line-spacing: 8;\n }\n [zoom = 5] {\n text-size: 17;\n text-character-spacing: 4;\n text-line-spacing: 8;\n }\n [zoom = 6] {\n text-size: 19;\n text-character-spacing: 5;\n text-line-spacing: 10;\n }\n }\n [labelrank = 3] {\n [zoom = 3] {\n text-size: 9;\n text-character-spacing: 2;\n text-line-spacing: 3;\n }\n [zoom = 4] {\n text-size: 10;\n text-character-spacing: 2;\n text-line-spacing: 8;\n }\n [zoom = 5] {\n text-size: 12;\n text-character-spacing: 4;\n text-line-spacing: 8;\n }\n [zoom = 6] {\n text-size: 15;\n text-character-spacing: 5;\n text-line-spacing: 10;\n }\n }\n [labelrank = 4][zoom = 4],\n [labelrank = 5][zoom = 5],\n [labelrank = 6][zoom = 6] {\n text-size: 9;\n text-character-spacing: 2;\n text-line-spacing: 6;\n }\n [labelrank = 4][zoom = 5],\n [labelrank = 5][zoom = 6],\n [labelrank = 6][zoom = 7] {\n text-size: 11;\n text-character-spacing: 3;\n text-line-spacing: 8;\n }\n [labelrank = 4][zoom = 6],\n [labelrank = 5][zoom = 7] {\n text-size: 16;\n text-character-spacing: 4;\n text-line-spacing: 1;\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Road labels \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ highway shield\n#road_label::shield-pt[class='motorway'][zoom>=7][zoom<=10][localrank=1][reflen<=6],\n#road_label::shield-pt[class='motorway'][zoom>=9][zoom<=10][localrank=1][reflen<=6],\n#road_label::shield-ln[zoom>=11][reflen<=6] {\n shield-name: \"[ref].replace('\u00b7', '\\n')\";\n shield-size: 9;\n shield-line-spacing: -4;\n shield-file: url('img\/shield\/[shield]-[reflen].svg');\n shield-face-name: @bold;\n shield-fill: #333;\n [zoom>=14] {\n shield-transform: scale(1.25,1.25);\n shield-size: 11;\n }\n}\n#road_label::shield-pt[class='motorway'][zoom>=7][zoom<=10][localrank=1][reflen<=6],\n#road_label::shield-pt[class='motorway'][zoom>=9][zoom<=10][localrank=1][reflen<=6] {\n shield-placement: point;\n shield-avoid-edges: false;\n}\n#road_label::shield-ln[zoom>=11][reflen<=6] {\n shield-placement: line;\n shield-spacing: 400;\n shield-min-distance: 20;\n shield-avoid-edges: true;\n}\n\n\/\/ Larger roads \/\/\n#road_label['mapnik::geometry_type'=2] {\n \/\/ Longer roads get a label earlier as they are likely to be more\n \/\/ important. This especially helps label density in rural\/remote areas.\n \/\/ This z14 filter is *not* redundant to logic in SQL queries. Because z14\n \/\/ includes all data for z14+ via overzooming, the streets included in a\n \/\/ z14 vector tile include more features than ideal for optimal performance.\n [class='motorway'][zoom>=14],\n [class='main'][zoom<=12][len>5000], \n [class='main'][zoom>=13][len>2000],\n [class='main'][zoom>=14][len>1500], \n [class='main'][zoom>=15][len>750], \n [class='main'][zoom>=16],\n [class='street'][zoom>=15][len>1500], \n [class='street'][zoom>=16],\n [class='street_limited'][zoom>=16] {\n text-avoid-edges: true;\n text-name: [name];\n text-character-spacing: 0.25;\n text-placement: line;\n text-face-name: @reg;\n text-fill: @road_text;\n text-size: 11;\n text-halo-fill: @road_halo;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-min-distance: 200; \/\/ only for labels w\/ the same name\n [class='motorway'] { text-halo-fill: @motorway_halo; }\n [zoom>=14] { \n text-size: 11; \n text-fill: @road_text_high; \n }\n [zoom>=16] { text-fill: @road_text_high2; }\n [zoom>=17] { text-size: 12; }\n [class='motorway'],\n [class='main'] {\n [zoom>=14] { \n text-size: 12; \n text-fill: @road_text_high; \n }\n [zoom>=16] { \n text-size: 13; \n text-fill: @road_text_high2; \n }\n [zoom>=17] { text-size: 14; }\n [zoom>=18] { text-size: 15; }\n }\n }\n}\n\n\/\/ Smaller roads \/\/\n#road_label['mapnik::geometry_type'=2]\n [class!='motorway']\n [class!='main']\n [class!='street']\n [class!='street_limited'] {\n [len>750][zoom>=16],\n [len>0][zoom>=17] { \n text-avoid-edges: true;\n text-name: [name];\n text-character-spacing: 0.25;\n text-placement: line;\n text-face-name: @reg;\n text-fill: @road_text;\n text-size: 11;\n text-halo-fill: @road_halo;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-min-distance: 200; \/\/ only for labels w\/ the same name\n [zoom>=15] { text-fill: @road_text_high; }\n } \n } ","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"82d07154a91b76a3eeb8d028dd129084e8481e3d","subject":"Fixed: Appogiaturas and Acciaccaturas are properly encoded","message":"Fixed: Appogiaturas and Acciaccaturas are properly encoded\n\nPreviously appog. and acciacc. were encoded as separate entities instead of on the note they were attached to. This commit fixes the encoding so that they are properly encoded on the 'host' note.\n\nFixes #5\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgname, 'type', 'plugin');\n libmei.AddChild(applic, plgname);\n\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n if (note._property:TieIds != null)\n {\n ties = note._property:TieIds;\n mties = Self._property:MeasureTies;\n mties = mties.Concat(ties);\n Self._property:MeasureTies = mties;\n }\n\n beam = ProcessBeam(bobj, l);\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n libmei.AddChild(tuplet, note);\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n if (bobj.GraceNote = True or bobj.IsAppoggiatura = True or bobj.IsAcciaccatura = True)\n {\n \/\/ skip any notes that are grace notes, since these will be encoded on the next note.\n return null;\n }\n\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n if (prev_object != null and prev_object.GraceNote = true)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (prev_object != null and prev_object.IsAppoggiatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'A');\n }\n\n if (prev_object != null and prev_object.IsAcciaccatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'a');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.addAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0)\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n \/\/ Accidentals will always be encoded as child elements, not attributes\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'headshape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n \/*\n Ties\n *\/\n tieresolver = Self._property:TieResolver;\n if (tieresolver.PropertyExists(hash))\n {\n \/\/ this note is the end of the tie.\n tie_id = tieresolver[hash];\n tie = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie, 'endid', '#' & n._id);\n }\n\n if (nobj.Tied = True)\n {\n \/\/ set the end hash\n parent_nr = nobj.ParentNoteRest;\n next_object = parent_nr.NextItem(parent_nr.VoiceNumber, 'NoteRest');\n\n if (next_object = null)\n {\n \/\/ check the first object in the next bar\n next_bar_num = parent_nr.ParentBar.BarNumber + 1;\n next_bar = parent_nr.ParentBar.ParentStaff.NthBar(next_bar_num);\n next_object = next_bar.NthBarObject(0);\n }\n\n if (next_object = null or next_object.Type != 'NoteRest')\n {\n \/\/ it's a hanging tie. What to do, what to do?\n \/\/ for now, just encode the startid with no endid and return the note.\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n n._property:TieIds = CreateSparseArray(tie._id);\n return n;\n }\n\n for each next_note in next_object\n {\n if (nobj.Pitch = next_note.Pitch)\n {\n \/\/ it's probably this one.\n endhash = SimpleNoteHash(next_note);\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n tieresolver[endhash] = tie._id;\n\n n._property:TieIds = CreateSparseArray(tie._id);\n }\n }\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n \n tiearr = CreateSparseArray();\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n\n if (sn._property:TieIds != null)\n {\n tieids = sn._property:TieIds;\n tiearr = tiearr.Concat(tieids);\n }\n }\n\n n._property:TieIds = tiearr;\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n libmei.AddAttribute(instrDef, 'midi.pan', s.Pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'rend', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(octl, 'dis', octrend[0]);\n libmei.AddAttribute(octl, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n Log('Format close: ' & activeinfo);\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgname, 'type', 'plugin');\n libmei.AddChild(applic, plgname);\n\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n if (note._property:TieIds != null)\n {\n ties = note._property:TieIds;\n mties = Self._property:MeasureTies;\n mties = mties.Concat(ties);\n Self._property:MeasureTies = mties;\n }\n\n beam = ProcessBeam(bobj, l);\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n libmei.AddChild(tuplet, note);\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n if (bobj.GraceNote = true)\n {\n libmei.addAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAppoggiatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'A');\n }\n\n if (bobj.IsAcciaccatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'a');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.addAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0)\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n \/\/ Accidentals will always be encoded as child elements, not attributes\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'headshape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n \/*\n Ties\n *\/\n tieresolver = Self._property:TieResolver;\n if (tieresolver.PropertyExists(hash))\n {\n \/\/ this note is the end of the tie.\n tie_id = tieresolver[hash];\n tie = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie, 'endid', '#' & n._id);\n }\n\n if (nobj.Tied = True)\n {\n \/\/ set the end hash\n parent_nr = nobj.ParentNoteRest;\n next_object = parent_nr.NextItem(parent_nr.VoiceNumber, 'NoteRest');\n\n if (next_object = null)\n {\n \/\/ check the first object in the next bar\n next_bar_num = parent_nr.ParentBar.BarNumber + 1;\n next_bar = parent_nr.ParentBar.ParentStaff.NthBar(next_bar_num);\n next_object = next_bar.NthBarObject(0);\n }\n\n if (next_object = null or next_object.Type != 'NoteRest')\n {\n \/\/ it's a hanging tie. What to do, what to do?\n \/\/ for now, just encode the startid with no endid and return the note.\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n n._property:TieIds = CreateSparseArray(tie._id);\n return n;\n }\n\n for each next_note in next_object\n {\n if (nobj.Pitch = next_note.Pitch)\n {\n \/\/ it's probably this one.\n endhash = SimpleNoteHash(next_note);\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n tieresolver[endhash] = tie._id;\n\n n._property:TieIds = CreateSparseArray(tie._id);\n }\n }\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n \n tiearr = CreateSparseArray();\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n\n if (sn._property:TieIds != null)\n {\n tieids = sn._property:TieIds;\n tiearr = tiearr.Concat(tieids);\n }\n }\n\n n._property:TieIds = tiearr;\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n libmei.AddAttribute(instrDef, 'midi.pan', s.Pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'rend', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(octl, 'dis', octrend[0]);\n libmei.AddAttribute(octl, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n Log('Format close: ' & activeinfo);\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"a3c68a934410314d749c7f481c3023474938dc05","subject":"#27 add variables for kerning, kern out road & water labels","message":"#27 add variables for kerning, kern out road & water labels\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Narrow Bold', 'Unifont Bold';\n\n@label_color_transport: #524c4c;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n\n@text_character_spacing_sm: 0.7;\n@text_character_spacing_md: 1.2;\n@text_character_spacing_lg: 1.7;\n\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: #F7F7E6;\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-character-spacing: @text_character_spacing_sm;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: 2;\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n \/\/ arbitrary default shield\n shield-file: url(images\/ca.svg);\n shield-fill: white;\n shield-transform: scale(0.052, 0.052);\n shield-face-name: \"Roadgeek 2005 Series D Regular\";\n shield-name: [ref];\n shield-min-distance: 250;\n shield-spacing: 250;\n \/\/ half the width of the shield to prevent from wrapping\n shield-min-padding: 10;\n\n [ref=~'I \\d+'] {\n shield-file: url(images\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n shield-fill: white;\n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(images\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n shield-fill: white;\n }\n\n [ref=~'US \\d+'] {\n shield-file: url(images\/us.svg);\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: #333;\n shield-text-dy: 1;\n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(images\/ca.svg);\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-fill: white;\n shield-text-dy: 2.5;\n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n text-face-name: @text_font_water_bold;\n text-wrap-width: 40;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_lg;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][changed!='']\n{\n text-name: [name];\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n text-face-name: @text_font_water;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_md;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 18;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-size: 22;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 22;\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.1;\n \/\/}\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-placement: interior;\n text-vertical-alignment: bottom;\n text-min-distance: 5;\n text-dy: -5;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n\n [justified='left'] {\n \/\/text-horizontal-alignment: left;\n text-horizontal-alignment: middle;\n \/\/text-dx: 20;\n }\n\n [justified='right'] {\n \/\/text-horizontal-alignment: right;\n text-horizontal-alignment: middle;\n \/\/text-dx: -20;\n }\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size>=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.3;\n \/\/}\n [justified='left'] {\n text-horizontal-alignment: left;\n text-dx: 15;\n }\n\n [justified='right'] {\n text-horizontal-alignment: right;\n text-dx: -15;\n }\n\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_sm;\n text-min-distance: 5;\n text-allow-overlap: true;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_halo_high;\n text-halo-comp-op: overlay;\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n \n [zoom>=11] {\n text-halo-fill: @label_color_places_halo_low;\n }\n}\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n marker-ignore-placement: true;\n marker-width: 5;\n marker-fill: #2e2115;\n marker-line-width: 0;\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n\n","old_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Narrow Bold', 'Unifont Bold';\n\n@label_color_transport: #524c4c;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: #F7F7E6;\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-size: 16;\n text-placement: line;\n text-max-char-angle-delta: 20;\n text-fill: #444;\n text-spacing: 256;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: 2;\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n \/\/ arbitrary default shield\n shield-file: url(images\/ca.svg);\n shield-fill: white;\n shield-transform: scale(0.052, 0.052);\n shield-face-name: \"Roadgeek 2005 Series D Regular\";\n shield-name: [ref];\n shield-min-distance: 250;\n shield-spacing: 250;\n \/\/ half the width of the shield to prevent from wrapping\n shield-min-padding: 10;\n\n [ref=~'I \\d+'] {\n shield-file: url(images\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n shield-fill: white;\n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(images\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n shield-fill: white;\n }\n\n [ref=~'US \\d+'] {\n shield-file: url(images\/us.svg);\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: #333;\n shield-text-dy: 1;\n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(images\/ca.svg);\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-fill: white;\n shield-text-dy: 2.5;\n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n text-face-name: @text_font_water_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][changed!='']\n{\n text-name: [name];\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n text-face-name: @text_font_water;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 18;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-size: 22;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 22;\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: 24;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.1;\n \/\/}\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-placement: interior;\n text-vertical-alignment: bottom;\n text-min-distance: 5;\n text-dy: -5;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n\n [justified='left'] {\n \/\/text-horizontal-alignment: left;\n text-horizontal-alignment: middle;\n \/\/text-dx: 20;\n }\n\n [justified='right'] {\n \/\/text-horizontal-alignment: right;\n text-horizontal-alignment: middle;\n \/\/text-dx: -20;\n }\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size>=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n \/\/ for debugging\n \/\/::outline {\n \/\/ polygon-fill: #fff;\n \/\/ polygon-opacity: 0.3;\n \/\/}\n [justified='left'] {\n text-horizontal-alignment: left;\n text-dx: 15;\n }\n\n [justified='right'] {\n text-horizontal-alignment: right;\n text-dx: -15;\n }\n\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_sm;\n text-min-distance: 5;\n text-allow-overlap: true;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n\n [font_size>=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_halo_high;\n text-halo-comp-op: overlay;\n\n [font_size>=20] {\n text-size: @text_font_size_large;\n }\n \n [zoom>=11] {\n text-halo-fill: @label_color_places_halo_low;\n }\n}\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n marker-ignore-placement: true;\n marker-width: 5;\n marker-fill: #2e2115;\n marker-line-width: 0;\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"bd318e838c57524f68cc672f92bf1add063ff35e","subject":"Fix error in tunnel casing selector","message":"Fix error in tunnel casing selector\n","repos":"Sweetymeow\/osm-bright,saydulk\/osm-bright,yohanboniface\/osm-bright,makinacorpus\/osm-makina,raumobil\/osm-bright,pinkflozd\/osm-bright,silph-io\/osm-silph,jeffaudi\/osm-hybrid,mapbox\/osm-bright,brelevenix\/osm-bright-tregor","old_file":"osm-bright\/roads.mss","new_file":"osm-bright\/roads.mss","new_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n#roads_low[zoom>=5][zoom<=8] {\n [type='motorway'] { line-color: @motorway_line; }\n [type='trunk'] { line-color: @trunk_line; }\n [zoom=5] {\n [type='motorway'] { line-width: 0.4; }\n [type='trunk'] { line-width: 0.2; } }\n [zoom=6] {\n [type='motorway'] { line-width: 0.5; }\n [type='trunk'] { line-width: 0.25; } }\n [zoom=7] {\n [type='motorway'] { line-width: 0.6; }\n [type='trunk'] { line-width: 0.3; } }\n [zoom=8] {\n [type='motorway'] { line-width: 1; }\n [type='trunk'] { line-width: 0.5; } }\n}\n\n\/* At mid-level scales start to show primary and secondary routes\nas well. *\/\n\n#roads_med[zoom>=9][zoom<=10] {\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_line;\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_line;\n }\n [type='primary'] { line-color: @primary_line; }\n [type='secondary'] { line-color: @secondary_line; }\n [type='tertiary'] { line-color: @standard_line; }\n [zoom=9] {\n [stylegroup='major'] { line-width: 1.4; }\n [stylegroup='medium'] { line-width: 0.6; } }\n [zoom=10] {\n [stylegroup='major'] { line-width: 1.8; }\n [stylegroup='medium'] { line-width: 0.8; } }\n}\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 1.6; @rdz11_med: 0.8; @rdz11_min: 0.4;\n@rdz12_maj: 2.5; @rdz12_med: 1.2; @rdz12_min: 0.8;\n@rdz13_maj: 3; @rdz13_med: 1.5; @rdz13_min: 1;\n@rdz14_maj: 4; @rdz14_med: 2.5; @rdz14_min: 1.6;\n@rdz15_maj: 6; @rdz15_med: 4; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 14; @rdz17_med: 12; @rdz17_min: 10;\n@rdz18_maj: 20; @rdz18_med: 17; @rdz18_min: 14;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz11_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz12_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz13_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz13_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz14_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz14_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz15_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz15_min + 2; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 2; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz16_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz16_min + 2; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 2; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj + 3; }\n [stylegroup='mainroad'] { line-width: @rdz17_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz17_min + 2; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 4; }\n [stylegroup='railway'] { line-width: 3 + 4; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj + 4; }\n [stylegroup='mainroad'] { line-width: @rdz18_med + 4; }\n [stylegroup='minorroad']{ line-width: @rdz18_min + 3.5; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 6; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4; line-dasharray: 2,1; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4; line-dasharray: 2,2; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4; line-dasharray: 3,3; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/* ****************************************************************** *\/\n","old_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n#roads_low[zoom>=5][zoom<=8] {\n [type='motorway'] { line-color: @motorway_line; }\n [type='trunk'] { line-color: @trunk_line; }\n [zoom=5] {\n [type='motorway'] { line-width: 0.4; }\n [type='trunk'] { line-width: 0.2; } }\n [zoom=6] {\n [type='motorway'] { line-width: 0.5; }\n [type='trunk'] { line-width: 0.25; } }\n [zoom=7] {\n [type='motorway'] { line-width: 0.6; }\n [type='trunk'] { line-width: 0.3; } }\n [zoom=8] {\n [type='motorway'] { line-width: 1; }\n [type='trunk'] { line-width: 0.5; } }\n}\n\n\/* At mid-level scales start to show primary and secondary routes\nas well. *\/\n\n#roads_med[zoom>=9][zoom<=10] {\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_line;\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_line;\n }\n [type='primary'] { line-color: @primary_line; }\n [type='secondary'] { line-color: @secondary_line; }\n [type='tertiary'] { line-color: @standard_line; }\n [zoom=9] {\n [stylegroup='major'] { line-width: 1.4; }\n [stylegroup='medium'] { line-width: 0.6; } }\n [zoom=10] {\n [stylegroup='major'] { line-width: 1.8; }\n [stylegroup='medium'] { line-width: 0.8; } }\n}\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 1.6; @rdz11_med: 0.8; @rdz11_min: 0.4;\n@rdz12_maj: 2.5; @rdz12_med: 1.2; @rdz12_min: 0.8;\n@rdz13_maj: 3; @rdz13_med: 1.5; @rdz13_min: 1;\n@rdz14_maj: 4; @rdz14_med: 2.5; @rdz14_min: 1.6;\n@rdz15_maj: 6; @rdz15_med: 4; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 14; @rdz17_med: 12; @rdz17_min: 10;\n@rdz18_maj: 20; @rdz18_med: 17; @rdz18_min: 14;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel::outline[zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz11_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz12_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz13_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz13_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz14_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz14_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz15_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz15_min + 2; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 2; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz16_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz16_min + 2; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 2; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj + 3; }\n [stylegroup='mainroad'] { line-width: @rdz17_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz17_min + 2; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 4; }\n [stylegroup='railway'] { line-width: 3 + 4; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj + 4; }\n [stylegroup='mainroad'] { line-width: @rdz18_med + 4; }\n [stylegroup='minorroad']{ line-width: @rdz18_min + 3.5; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 6; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4; line-dasharray: 2,1; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4; line-dasharray: 2,2; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4; line-dasharray: 3,3; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/* ****************************************************************** *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"c141b55d22f17a0bdf5ba31feb73e052e7d85719","subject":"Refactor Line converter support","message":"Refactor Line converter support\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/Utilities.mss","new_file":"src\/Utilities.mss","new_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in \n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/* \n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a dictionary of {pos:id} mappings for a given\n \/\/ voice, and returns the NoteRest object. If one isn't found\n \/\/ exactly at `position`, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions = null)\n {\n \/\/ theres not much we can do here. Bail.\n return null;\n }\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (startids, endids, tstamps, etc.) to an element\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Bar object'));\n }\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n if (bobj.Duration > 0)\n {\n libmei.AddAttribute(element, 'dur.ges', bobj.Duration & 'p');\n }\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bar));\n\n switch (bobj.Type)\n {\n case('Line')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Slur')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('DiminuendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('CrescendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('GlissandoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Trill')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction IsLastNoteInTuplet (bobj) {\n \/\/$module(Utilities.mss)\n if (bobj.ParentTupletIfAny = null or bobj.GraceNote = True)\n {\n return false;\n }\n\n tuplet = bobj.ParentTupletIfAny;\n\n if (bobj.PositionInTuplet >= tuplet.Duration)\n {\n return true;\n }\n\n return false;\n\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n Sibelius.AppendLineToFile(LOGFILE, message, True);\n} \/\/$end","old_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in \n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/* \n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a dictionary of {pos:id} mappings for a given\n \/\/ voice, and returns the NoteRest object. If one isn't found\n \/\/ exactly at `position`, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions = null)\n {\n \/\/ theres not much we can do here. Bail.\n return null;\n }\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (startids, endids, tstamps, etc.) to an element\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Bar object'));\n }\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n if (bobj.Duration > 0)\n {\n libmei.AddAttribute(element, 'dur.ges', bobj.Duration & 'p');\n }\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bar));\n\n if (bobj.Type = 'Line' or bobj.Type = 'Slur' or bobj.Type = 'DiminuendoLine' or bobj.Type = 'CrescendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction IsLastNoteInTuplet (bobj) {\n \/\/$module(Utilities.mss)\n if (bobj.ParentTupletIfAny = null or bobj.GraceNote = True)\n {\n return false;\n }\n\n tuplet = bobj.ParentTupletIfAny;\n\n if (bobj.PositionInTuplet >= tuplet.Duration)\n {\n return true;\n }\n\n return false;\n\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n Sibelius.AppendLineToFile(LOGFILE, message, True);\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"8a1208998976a629bbc5aabce0a552e4a1f15b20","subject":"pitch and track visible at lower zoom","message":"pitch and track visible at lower zoom\n","repos":"karlwettin\/tilemill-style-hydda,karlwettin\/tilemill-style-hydda","old_file":"hyddafull\/base.mss","new_file":"hyddafull\/base.mss","new_contents":"\/* BASE.MSS CONTENTS\n * - Landuse & landcover\n * - Water areas\n * - Water ways\n * - Administrative Boundaries\n *\n *\/\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER\n\/* ================================================================== *\/\n\n#sports-grounds {\n [leisure = 'sports_centre'],\n [leisure = 'stadium'] {\n [zoom >= 14] {\n polygon-fill: @stadium;\n }\n }\n\n [leisure = 'track'][zoom >= 13] {\n polygon-fill: @track;\n line-width: 0.5;\n line-color: @track * 0.95;\n }\n\n [leisure = 'pitch'][zoom >= 13] {\n polygon-fill: @pitch;\n line-width: 0.5;\n line-color: @pitch * 0.95;\n }\n}\n\n\n#land[zoom>=0][zoom<6],\n#shoreline_300[zoom>=6][zoom<10],\n#processed_p[zoom>=10] {\n polygon-fill: @land;\n polygon-gamma: 0.75;\n}\n\n#landuse_gen0[zoom>3][zoom<=9],\n#landuse_gen1[zoom>9][zoom<=12],\n#landuse[zoom>12] {\n\/\/ [type='cemetery'] { polygon-fill: @cemetery; polygon-meta-writer: ' + '; }\n [type='cemetery'] { polygon-fill: @cemetery; }\n [type='college'] { polygon-fill: @school; }\n [type='commercial'] { polygon-fill: @industrial; }\n [type='common'] { polygon-fill: @park; }\n [type='allotments'] { polygon-fill: @grass; }\n [type='forest'] { polygon-fill: @wooded; }\n [type='golf_course'] { polygon-fill: @sports; }\n [type='grass'] { polygon-fill: @grass; }\n [type='hospital'] { polygon-fill: @hospital; }\n [type='industrial'] { polygon-fill: @industrial; }\n [type='park'] { polygon-fill: @park; }\n [type='parking'] { polygon-fill: @parking; }\n [type='pedestrian'] { polygon-fill: @pedestrian_fill; }\n [type='pitch'] { polygon-fill: @sports; }\n [type='residential'] { polygon-fill: @residential; }\n [type='school'] { polygon-fill: @school; }\n [type='scrub'] { polygon-fill: @scrub; } \n [type='sports_center'] { polygon-fill: @sports; }\n [type='stadium'] { polygon-fill: @sports; }\n [type='university'] { polygon-fill: @school; }\n [type='wood'] { polygon-fill: @wooded; }\n}\n\n#landuse_overlays[type='nature_reserve'][zoom>6] {\n line-color: darken(@wooded,25%);\n line-opacity: 0.3;\n line-dasharray: 1,1;\n polygon-fill: darken(@wooded,25%);\n polygon-opacity: 0.1;\n [zoom=7] { line-width: 0.4; }\n [zoom=8] { line-width: 0.6; }\n [zoom=9] { line-width: 0.8; }\n [zoom=10] { line-width: 1.0; }\n [zoom=11] { line-width: 1.5; }\n [zoom>=12] { line-width: 2.0; }\n}\n \n#landuse_overlays[type='wetland'][zoom>11] {\n [zoom>11][zoom<=14] { polygon-pattern-file:url(img\/marsh-16.png); }\n [zoom>14] { polygon-pattern-file:url(img\/marsh-32.png);}\n }\n\n\/* ---- BUILDINGS ---- *\/\n#buildings[zoom>=12][zoom<=16] {\n polygon-fill:@building;\n [zoom>=14] {\n line-color:darken(@building,5);\n line-width:0.2;\n }\n [zoom>=16] {\n line-color:darken(@building,10);\n line-width:0.4;\n }\n}\n\/\/ At the highest zoom levels, render buildings in fancy pseudo-3D.\n\/\/ Ordering polygons by their Y-position is necessary for this effect\n\/\/ so we use a separate layer that does this for us.\n#buildings[zoom>=17][type != 'hedge'] {\n building-fill:@building;\n building-height:1.25;\n}\n\n#buildings[zoom>=17][type = 'hedge'] {\n building-fill:@wooded;\n building-height:1.25;\n}\n\n\n\n\n\n\n\n\n#piers-area {\n [zoom >= 12] {\n polygon-fill: @land;\n }\n}\n\n#piers {\n [man_made = 'breakwater'],\n [man_made = 'groyne'] {\n [zoom >= 11] {\n line-width: 1;\n line-color: #aaa;\n }\n [zoom >= 13] {\n line-width: 2;\n }\n [zoom >= 16] {\n line-width: 4;\n }\n }\n [man_made = 'pier'][zoom >= 11] {\n line-width: 1.5;\n line-color: @land;\n [zoom >= 13] { line-width: 3; }\n [zoom >= 16] { line-width: 7; }\n }\n}\n\n\/* ================================================================== *\/\n\/* WATER AREAS\n\/* ================================================================== *\/\n\nMap { background-color: @water; }\n\n#water_gen0[zoom>3][zoom<=9],\n#water_gen1[zoom>9][zoom<=12],\n#water[zoom>12] {\n polygon-fill: @water;\n}\n\n\/* ================================================================== *\/\n\/* WATER WAYS\n\/* ================================================================== *\/\n\n#waterway_low[zoom>=8][zoom<=12] {\n line-color: @water;\n [zoom=8] { line-width: 0.1; }\n [zoom=9] { line-width: 0.2; }\n [zoom=10]{ line-width: 0.4; }\n [zoom=11]{ line-width: 0.6; }\n [zoom=12]{ line-width: 0.8; }\n}\n\n#waterway_med[zoom>=13][zoom<=14] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=13]{ line-width: 1; }\n [zoom=14]{ line-width: 1.5; }\n }\n [type='stream'] {\n [zoom=13]{ line-width: 0.2; }\n [zoom=14]{ line-width: 0.4; }\n }\n}\n \n#waterway_high[zoom>=15] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=15]{ line-width: 2; }\n [zoom=16]{ line-width: 3; }\n [zoom=17]{ line-width: 4; }\n [zoom=18]{ line-width: 5; }\n [zoom=19]{ line-width: 6; }\n [zoom>19]{ line-width: 7; }\n }\n [type='stream'] {\n [zoom=15]{ line-width: 0.6; }\n [zoom=16]{ line-width: 0.8; }\n [zoom=17]{ line-width: 1; }\n [zoom=18]{ line-width: 1.5; }\n [zoom>18]{ line-width: 2; }\n }\n [type='ditch'],\n [type='drain'] {\n [zoom=15]{ line-width: 0.1; }\n [zoom=16]{ line-width: 0.3; }\n [zoom=17]{ line-width: 0.5; }\n [zoom=18]{ line-width: 0.7; }\n [zoom=19]{ line-width: 1; }\n [zoom>19]{ line-width: 1.5; }\n }\n}\n\n\/* ================================================================== *\/\n\/* ADMINISTRATIVE BOUNDARIES\n\/* ================================================================== *\/\n\n\n#admin[admin_level=2][zoom>1] {\n line-color:@admin_2;\n line-width:0.5;\n [zoom=2] { line-opacity: 0.25; }\n [zoom=3] { line-opacity: 0.3; }\n [zoom=4] { line-opacity: 0.4; }\n}\n\n\/* ================================================================== *\/\n\/* BARRIER POINTS\n\/* ================================================================== *\/\n\n\n#barrier_points[zoom>=17][stylegroup = 'divider'] {\n marker-height: 2;\n marker-fill: #c7c7c7;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n\n\/* ================================================================== *\/\n\/* BARRIER LINES\n\/* ================================================================== *\/\n\n#barrier_lines[zoom>=17][stylegroup = 'gate'] {\n line-width:2.5;\n line-color:#aab;\n line-dasharray:3,2;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'fence'] {\n line-width:1.75;\n line-color:#aab;\n line-dasharray:1,1;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'hedge'] {\n line-width:3;\n line-color:darken(@park,5);\n\n}\n\n","old_contents":"\/* BASE.MSS CONTENTS\n * - Landuse & landcover\n * - Water areas\n * - Water ways\n * - Administrative Boundaries\n *\n *\/\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER\n\/* ================================================================== *\/\n\n#sports-grounds {\n [leisure = 'sports_centre'],\n [leisure = 'stadium'] {\n [zoom >= 14] {\n polygon-fill: @stadium;\n }\n }\n\n [leisure = 'track'][zoom >= 15] {\n polygon-fill: @track;\n line-width: 0.5;\n line-color: @track * 0.95;\n }\n\n [leisure = 'pitch'][zoom >= 15] {\n polygon-fill: @pitch;\n line-width: 0.5;\n line-color: @pitch * 0.95;\n }\n}\n\n\n#land[zoom>=0][zoom<6],\n#shoreline_300[zoom>=6][zoom<10],\n#processed_p[zoom>=10] {\n polygon-fill: @land;\n polygon-gamma: 0.75;\n}\n\n#landuse_gen0[zoom>3][zoom<=9],\n#landuse_gen1[zoom>9][zoom<=12],\n#landuse[zoom>12] {\n\/\/ [type='cemetery'] { polygon-fill: @cemetery; polygon-meta-writer: ' + '; }\n [type='cemetery'] { polygon-fill: @cemetery; }\n [type='college'] { polygon-fill: @school; }\n [type='commercial'] { polygon-fill: @industrial; }\n [type='common'] { polygon-fill: @park; }\n [type='allotments'] { polygon-fill: @grass; }\n [type='forest'] { polygon-fill: @wooded; }\n [type='golf_course'] { polygon-fill: @sports; }\n [type='grass'] { polygon-fill: @grass; }\n [type='hospital'] { polygon-fill: @hospital; }\n [type='industrial'] { polygon-fill: @industrial; }\n [type='park'] { polygon-fill: @park; }\n [type='parking'] { polygon-fill: @parking; }\n [type='pedestrian'] { polygon-fill: @pedestrian_fill; }\n [type='pitch'] { polygon-fill: @sports; }\n [type='residential'] { polygon-fill: @residential; }\n [type='school'] { polygon-fill: @school; }\n [type='scrub'] { polygon-fill: @scrub; } \n [type='sports_center'] { polygon-fill: @sports; }\n [type='stadium'] { polygon-fill: @sports; }\n [type='university'] { polygon-fill: @school; }\n [type='wood'] { polygon-fill: @wooded; }\n}\n\n#landuse_overlays[type='nature_reserve'][zoom>6] {\n line-color: darken(@wooded,25%);\n line-opacity: 0.3;\n line-dasharray: 1,1;\n polygon-fill: darken(@wooded,25%);\n polygon-opacity: 0.1;\n [zoom=7] { line-width: 0.4; }\n [zoom=8] { line-width: 0.6; }\n [zoom=9] { line-width: 0.8; }\n [zoom=10] { line-width: 1.0; }\n [zoom=11] { line-width: 1.5; }\n [zoom>=12] { line-width: 2.0; }\n}\n \n#landuse_overlays[type='wetland'][zoom>11] {\n [zoom>11][zoom<=14] { polygon-pattern-file:url(img\/marsh-16.png); }\n [zoom>14] { polygon-pattern-file:url(img\/marsh-32.png);}\n }\n\n\/* ---- BUILDINGS ---- *\/\n#buildings[zoom>=12][zoom<=16] {\n polygon-fill:@building;\n [zoom>=14] {\n line-color:darken(@building,5);\n line-width:0.2;\n }\n [zoom>=16] {\n line-color:darken(@building,10);\n line-width:0.4;\n }\n}\n\/\/ At the highest zoom levels, render buildings in fancy pseudo-3D.\n\/\/ Ordering polygons by their Y-position is necessary for this effect\n\/\/ so we use a separate layer that does this for us.\n#buildings[zoom>=17][type != 'hedge'] {\n building-fill:@building;\n building-height:1.25;\n}\n\n#buildings[zoom>=17][type = 'hedge'] {\n building-fill:@wooded;\n building-height:1.25;\n}\n\n\n\n\n\n\n\n\n#piers-area {\n [zoom >= 12] {\n polygon-fill: @land;\n }\n}\n\n#piers {\n [man_made = 'breakwater'],\n [man_made = 'groyne'] {\n [zoom >= 11] {\n line-width: 1;\n line-color: #aaa;\n }\n [zoom >= 13] {\n line-width: 2;\n }\n [zoom >= 16] {\n line-width: 4;\n }\n }\n [man_made = 'pier'][zoom >= 11] {\n line-width: 1.5;\n line-color: @land;\n [zoom >= 13] { line-width: 3; }\n [zoom >= 16] { line-width: 7; }\n }\n}\n\n\/* ================================================================== *\/\n\/* WATER AREAS\n\/* ================================================================== *\/\n\nMap { background-color: @water; }\n\n#water_gen0[zoom>3][zoom<=9],\n#water_gen1[zoom>9][zoom<=12],\n#water[zoom>12] {\n polygon-fill: @water;\n}\n\n\/* ================================================================== *\/\n\/* WATER WAYS\n\/* ================================================================== *\/\n\n#waterway_low[zoom>=8][zoom<=12] {\n line-color: @water;\n [zoom=8] { line-width: 0.1; }\n [zoom=9] { line-width: 0.2; }\n [zoom=10]{ line-width: 0.4; }\n [zoom=11]{ line-width: 0.6; }\n [zoom=12]{ line-width: 0.8; }\n}\n\n#waterway_med[zoom>=13][zoom<=14] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=13]{ line-width: 1; }\n [zoom=14]{ line-width: 1.5; }\n }\n [type='stream'] {\n [zoom=13]{ line-width: 0.2; }\n [zoom=14]{ line-width: 0.4; }\n }\n}\n \n#waterway_high[zoom>=15] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=15]{ line-width: 2; }\n [zoom=16]{ line-width: 3; }\n [zoom=17]{ line-width: 4; }\n [zoom=18]{ line-width: 5; }\n [zoom=19]{ line-width: 6; }\n [zoom>19]{ line-width: 7; }\n }\n [type='stream'] {\n [zoom=15]{ line-width: 0.6; }\n [zoom=16]{ line-width: 0.8; }\n [zoom=17]{ line-width: 1; }\n [zoom=18]{ line-width: 1.5; }\n [zoom>18]{ line-width: 2; }\n }\n [type='ditch'],\n [type='drain'] {\n [zoom=15]{ line-width: 0.1; }\n [zoom=16]{ line-width: 0.3; }\n [zoom=17]{ line-width: 0.5; }\n [zoom=18]{ line-width: 0.7; }\n [zoom=19]{ line-width: 1; }\n [zoom>19]{ line-width: 1.5; }\n }\n}\n\n\/* ================================================================== *\/\n\/* ADMINISTRATIVE BOUNDARIES\n\/* ================================================================== *\/\n\n\n#admin[admin_level=2][zoom>1] {\n line-color:@admin_2;\n line-width:0.5;\n [zoom=2] { line-opacity: 0.25; }\n [zoom=3] { line-opacity: 0.3; }\n [zoom=4] { line-opacity: 0.4; }\n}\n\n\/* ================================================================== *\/\n\/* BARRIER POINTS\n\/* ================================================================== *\/\n\n\n#barrier_points[zoom>=17][stylegroup = 'divider'] {\n marker-height: 2;\n marker-fill: #c7c7c7;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n\n\/* ================================================================== *\/\n\/* BARRIER LINES\n\/* ================================================================== *\/\n\n#barrier_lines[zoom>=17][stylegroup = 'gate'] {\n line-width:2.5;\n line-color:#aab;\n line-dasharray:3,2;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'fence'] {\n line-width:1.75;\n line-color:#aab;\n line-dasharray:1,1;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'hedge'] {\n line-width:3;\n line-color:darken(@park,5);\n\n}\n\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"b00aef911fc838f575470f099426e1cf150a5c18","subject":"WIP: Make something work","message":"WIP: Make something work\n","repos":"music-encoding\/sibmei","old_file":"src\/TextStyles.mss","new_file":"src\/TextStyles.mss","new_contents":"function InitTextHandlers() {\n \/\/ QUESTION: We could also take an argument and throw all text handlers from\n \/\/ extensions into the same dictionary\n\n Self._property:TextHandlers = CreateDictionary(\n 'text.staff.expression', 'ExpressionTextHandler',\n 'text.system.page_aligned.title', 'PageTitleHandler',\n 'text.system.page_aligned.composer', 'PageComposerTextHandler',\n 'text.staff.space.figuredbass', 'FiguredBassTextHandler'\n );\n\n Self._property:TextSubstituteMap = CreateDictionary(\n 'Title', CreateSparseArray('Title'),\n \/\/ , , , and \n \/\/ are only allowed in a few places, e.g. metadata or title pages.\n \/\/ We therfore use mor generic elements\n 'Composer', CreateSparseArray('PersName', 'role', 'Composer'),\n 'Arranger', CreateSparseArray('PersName', 'role', 'Arranger'),\n 'Lyricist', CreateSparseArray('PersName', 'role', 'Lyricist'),\n 'Artist', CreateSparseArray('PersName', 'role', 'Artist'),\n \/\/ is only allowed on , so use generic element\n 'Copyright', CreateSparseArray('Seg', 'type', 'Copyright'),\n \/\/ is only allowed in a few places, so use generic element\n \/\/ We don't even know if it's a person or an institution\n 'Publisher', CreateSparseArray('Seg', 'type', 'Publisher'),\n 'MoreInfo', CreateSparseArray('Seg', 'type', 'MoreInfo'),\n 'PartName', CreateSparseArray('Seg', 'type', 'PartName')\n );\n} \/\/$end\n\n\nfunction HandleText (textObject) {\n \/\/ TODO: Move this to a global initialization function\n InitTextHandlers();\n if (null != Self._property:Extension and null != Extension.TextHandlers)\n {\n \/\/ TODO: We need to check for both StyleId *and* StyleAsText so we can\n \/\/ handle custom styles\n textHandler = Extension.TextHandlers[textObject.StyleId];\n if (null != textHandler)\n {\n return Extension.@textHandler(textObject);\n }\n }\n\n textHandler = TextHandlers[textObject.StyleId];\n if (null != textHandler)\n {\n return @textHandler(textObject);\n }\n} \/\/$end\n\n\nfunction ExpressionTextHandler (textObj) {\n dynam = AddBarObjectInfoToElement(textObj, libmei.Dynam());\n AddFormattedText(dynam, textObj);\n return dynam;\n} \/\/$end\n\n\nfunction PageTitleHandler (textObject) {\n atext = libmei.AnchoredText();\n title = libmei.Title();\n\n libmei.AddChild(atext, title);\n libmei.SetText(title, text);\n\n return atext;\n} \/\/$end\n\n\nfunction PageComposerTextHandler (textObject) {\n \/\/ 'text.system.page_aligned.composer'\n return AddBarObjectInfoToElement(textObj, CreateAnchoredText(textObj));\n} \/\/$end\n\n\nfunction TempoTextHandler (textObject) {\n \/\/ 'text.system.tempo'\n tempo = libmei.Tempo();\n libmei.AddChild(tempo, CreateAnchoredText(textObj));\n return tempo;\n} \/\/$end\n\n\nfunction FiguredBassTextHandler (textObject) {\n \/\/ 'text.staff.space.figuredbass'\n harm = AddBarObjectInfoToElement(textObj, libmei.Harm());\n fb = libmei.Fb();\n libmei.AddChild(harm, fb);\n ConvertFbFigures(fb, textObj);\n return harm;\n} \/\/$end\n\n\nfunction CreateAnchoredText (textObj) {\n \/\/$module(ExportConverters.mss)\n anchoredText = libmei.AnchoredText();\n libmei.SetText(anchoredText, ConvertSubstitution(textObj.Text));\n return anchoredText;\n} \/\/$end\n\n\nfunction AddFormattedText (parentElement, textObj) {\n textWithFormatting = textObj.TextWithFormatting;\n if (textWithFormatting.NumChildren < 2 and CharAt(textWithFormatting[0], 0) != '\\\\')\n {\n parentElement.SetText(textObj.Text);\n return null;\n }\n\n nodes = CreateSparseArray();\n\n state = CreateDictionary(\n 'currentText', null,\n 'rendAttributes', CreateDictionary(),\n 'rendFlags', CreateDictionary(),\n 'nodes', nodes,\n 'paragraphs', null\n );\n\n for each component in textObj.TextWithFormatting\n {\n switch (Substring(component, 0, 2))\n {\n case ('\\\\n')\n {\n PushStyledText(state);\n nodes.Push(libmei.Lb());\n }\n case ('\\\\N')\n {\n PushStyledText(state);\n \/\/ TODO: Add

if it is allowed within parentElement (look at .name)\n nodes.Push(libmei.Lb());\n }\n case ('\\\\B')\n {\n SwitchTextStyle(state, 'fontweight', 'bold');\n }\n case ('\\\\b')\n {\n SwitchTextStyle(state, 'fontweight', 'normal');\n }\n case ('\\\\I')\n {\n SwitchTextStyle(state, 'fontstyle', 'italic');\n }\n case ('\\\\i')\n {\n SwitchTextStyle(state, 'fontstyle', 'normal');\n }\n case ('\\\\U')\n {\n SwitchTextStyle(state, 'rend', 'underline', true);\n }\n case ('\\\\u')\n {\n SwitchTextStyle(state, 'rend', 'underline', false);\n }\n case ('\\\\f')\n {\n SwitchFont(state, GetTextCommandArg(component));\n }\n case ('\\\\c')\n {\n \/\/ TODO: Can we sensibly handle a character style change? The\n \/\/ only built-in one seem to be `text.character.musictext`\n ;\n }\n case ('\\\\s')\n {\n fontsize = ConvertOffsetsToMEI(GetTextCommandArg(component));\n SwitchTextStyle(state, 'fontsize', fontsize);\n }\n case ('\\\\v')\n {\n \/\/ Vertical scale change (vertical stretching). Probably not\n \/\/ possible to handle\n ;\n }\n case ('\\\\h')\n {\n \/\/ Horizontal scale change (horizontal stretching). Probably not\n \/\/ possible to handle\n ;\n }\n case ('\\\\t')\n {\n \/\/ Tracking. Probably not possible to handle.\n ;\n }\n case ('\\\\p')\n {\n SwitchBaselineAdjust(state, GetTextCommandArg(component));\n }\n case ('\\\\$') {\n AppendTextSubstitute(state, GetTextCommandArg(component));\n }\n case ('\\\\\\\\')\n {\n \/\/ According to the documentation, 'backslashes themselves are\n \/\/ represented by \\\\ , to avoid conflicting with the above\n \/\/ commands'. Though that does not seem to work, but in case\n \/\/ Avid fixes this at some point, let's just assume it works.\n \/\/ We strip one leading backspace.\n state.currentText = state.currentText & Substring(component, 1);\n }\n default\n {\n \/\/ This is regular text\n state.currentText = state.currentText & component;\n }\n }\n }\n\n PushStyledText(state);\n\n nodeCount = nodes.Length;\n precedingElement = null;\n\n nodeIndex = 0;\n while (nodeIndex < nodeCount)\n {\n node = nodes[nodeIndex];\n if (IsObject(node))\n {\n \/\/ We have an element\n libmei.AddChild(parentElement, node);\n precedingElement = node;\n }\n else\n {\n \/\/ We have a text node\n text = node;\n \/\/ If there are multiple adjacent text nodes, we need to join them\n while (nodeIndex < nodeCount and not IsObject(nodes[nodeIndex + 1])) {\n nodeIndex = nodeIndex + 1;\n text = text & nodes[nodeIndex];\n }\n\n if (precedingElement = null)\n {\n libmei.SetText(parentElement, text);\n }\n else\n {\n libmei.SetTail(precedingElement, text);\n }\n }\n nodeIndex = nodeIndex + 1;\n }\n} \/\/$end\n\n\nfunction NewTextParagraph (state) {\n \/\/ TODO!\n ;\n} \/\/$end\n\n\nfunction GetTextCommandArg (command) {\n \/\/ Remove leading part, e.g. the '\\$' or '\\s' and trailing '\\'\n return Substring(command, 2, Length(command) - 3);\n} \/\/$end\n\n\nfunction SwitchBaselineAdjust (state, param) {\n sup = (param = 'superscript');\n sub = (param = 'subscript');\n if (sup != state.rendFlags['sup'] or sub != state.rendFlags['sub']) {\n PushStyledText(state);\n }\n state.rendFlags['sup'] = sup;\n state.rendFlags['sub'] = sub;\n} \/\/$end\n\n\nfunction SwitchFont (state, fontName) {\n if (fontName = '_')\n {\n \/\/ Before resetting the style, we have to add text preceding the '\\f_\\'\n \/\/ style reset \u2013 but only if the style reset actually changes something.\n\n textNotYetAppended = true;\n\n if (null != state.rendAttributes)\n {\n for each Name attName in state.rendAttributes\n {\n if (textNotYetAppended and state.rendAttributes[attName] != null)\n {\n PushStyledText(state);\n textNotYetAppended = false;\n }\n state.rendAttributes[attName] = null;\n }\n }\n if (null != state.rendFlags)\n {\n for each Name flagName in state.rendFlags\n {\n if (textNotYetAppended and state.rendFlags[flagName])\n {\n PushStyledText(state);\n textNotYetAppended = false;\n }\n state.rendFlags[flagName] = false;\n }\n }\n }\n else\n {\n SwitchTextStyle(state, 'fontfam', fontName);\n }\n} \/\/$end\n\n\nfunction SwitchTextStyle (state, attName, value) {\n if (state.rendAttributes[attName] != value)\n {\n \/\/ Style changes, so append current text before modifying style state\n PushStyledText(state);\n }\n state.rendAttributes[attName] = value;\n} \/\/$end\n\n\nfunction SwitchRendFlags (state, flagName, value) {\n if (state.rendFlags[flagName] != value)\n {\n PushStyledText(state);\n }\n state.rendFlags[flagName] = value;\n} \/\/$end\n\n\nfunction PushStyledText (state) {\n if (state.currentText = '')\n {\n return null;\n }\n\n nodes = state.nodes;\n if (null = nodes)\n {\n state.nodes = CreateSparseArray();\n }\n\n styleAttributes = GetStyleAttributes(state);\n if (null = styleAttributes)\n {\n nodes.Push(state.currentText);\n }\n else\n {\n rend = libmei.Rend();\n for each Name attName in styleAttributes {\n libmei.AddAttribute(rend, attName, styleAttributes[attName]);\n }\n libmei.SetText(rend, state.currentText);\n nodes.Push(rend);\n }\n\n state.currentText = '';\n} \/\/$end\n\n\nfunction GetStyleAttributes (state) {\n rendAttributes = null;\n\n if (null != state.rendAttributes)\n {\n for each Name attName in state.rendAttributes\n {\n value = state.rendAttributes[attName];\n if (null != value)\n {\n if (null = rendAttributes) {\n rendAttributes = CreateDictionary();\n }\n rendAttributes[attName] = value;\n }\n }\n }\n\n if (null != state.rendFlags)\n {\n rendFlags = null;\n for each Name flagName in state.rendFlags\n {\n flagActive = state.rendFlags[flagName];\n if (flagActive)\n {\n if (null != rendFlags)\n {\n rendFlags = CreateSparseArray();\n }\n rendFlags.Push(flagName);\n }\n }\n if (null != rendFlags)\n {\n if (null = rendAttributes) {\n rendAttributes = CreateDictionary();\n }\n rendAttributes['rend'] = rendFlags.Join(' ');\n }\n }\n\n return rendAttributes;\n} \/\/$end\n\n\nfunction AppendTextSubstitute (state, substituteName) {\n score = Self._property:ActiveScore;\n\n textSubstituteInfo = TextSubstituteMap[substituteName];\n if (null = textSubstituteInfo)\n {\n \/\/ No known substitution. Sibelius renders those literally.\n state.currentText = state.currentText & '\\\\$' & substituteName & '\\\\';\n return null;\n }\n\n substitutedText = score.@substituteName;\n if (substitutedText = '') {\n \/\/ TODO: Also check for all-whitespace text\n return null;\n }\n\n elementName = textSubstituteInfo[0];\n element = libmei.@elementName();\n state.nodes.Push(element);\n for i = 1 to textSubstituteInfo.Length step 2\n {\n libmei.AddAttribute(element, textSubstituteInfo[i], textSubstituteInfo[i + 1]);\n }\n\n \/*\n \/\/ Use this instead of a Dictionary mapping? May be a little clearer and\n \/\/ allows the analysis script to check it properly.\n element = null;\n\n switch (substituteName)\n {\n case ('Title')\n {\n element = libmei.Title();\n }\n case ('Composer')\n {\n element = libmei.Composer();\n }\n case ('Arranger')\n {\n element = libmei.Arranger();\n }\n case ('Lyricist')\n {\n element = libmei.Lyricist();\n }\n case ('MoreInfo')\n {\n element = libmei.Seg();\n libmei.AddAttribute(element, 'type', 'MoreInfo');\n }\n case ('Artist')\n {\n element = libmei.PersName();\n libmei.AddAttribute(element, 'role', 'Artist');\n }\n case ('Copyright')\n {\n \/\/ is only allowed on , so use generic element\n element = libmei.Seg();\n libmei.AddAttribute(element, 'type', 'Copyright');\n }\n case ('Publisher')\n {\n \/\/ is only allowed in a few places, so use generic element\n \/\/ We don't even know if it's a person or an institution\n element = libmei.Seg();\n libmei.AddAttribute(element, 'type', 'Publisher');\n }\n case ('PartName')\n {\n element = libmei.Seg();\n libmei.AddAttribute(element, 'type', 'PartName');\n }\n default\n {\n state.currentText = state.currentText & '\\\\$' & substituteName & '\\\\';\n return null;\n }\n }*\/\n\n\n styleAttributes = GetStyleAttributes(state);\n rendElement = null;\n if (null = styleAttributes)\n {\n libmei.SetText(element, substitutedText);\n }\n else\n {\n rendElement = libmei.Rend();\n libmei.AddChild(element, rendElement);\n for each Name attName in styleAttributes\n {\n libmei.AddAttribute(rendElement, attName, styleAttributes[attName]);\n }\n libmei.SetText(rendElement, substitutedText);\n }\n} \/\/$end\n","old_contents":"function InitTextHandlers() {\n \/\/ QUESTION: We could also take an argument and throw all text handlers from\n \/\/ extensions into the same dictionary\n\n Self._property:TextHandlers = CreateDictionary(\n 'text.staff.expression', 'ExpressionTextHandler',\n 'text.system.page_aligned.title', 'PageTitleHandler',\n 'text.system.page_aligned.composer', 'PageComposerTextHandler',\n 'text.staff.space.figuredbass', 'FiguredBassTextHandler'\n );\n\n Self._property:TextSubstituteMap = CreateDictionary(\n 'Title', CreateSparseArray('Title'),\n \/\/ , , , and \n \/\/ are only allowed in a few places, e.g. metadata or title pages.\n \/\/ We therfore use mor generic elements\n 'Composer', CreateSparseArray('PersName', 'role', 'Composer'),\n 'Arranger', CreateSparseArray('PersName', 'role', 'Arranger'),\n 'Lyricist', CreateSparseArray('PersName', 'role', 'Lyricist'),\n 'Artist', CreateSparseArray('PersName', 'role', 'Artist'),\n \/\/ is only allowed on , so use generic element\n 'Copyright', CreateSparseArray('Seg', 'type', 'Copyright'),\n \/\/ is only allowed in a few places, so use generic element\n \/\/ We don't even know if it's a person or an institution\n 'Publisher', CreateSparseArray('Seg', 'type', 'Publisher'),\n 'MoreInfo', CreateSparseArray('Seg', 'type', 'MoreInfo'),\n 'PartName', CreateSparseArray('Seg', 'type', 'PartName')\n );\n} \/\/$end\n\n\nfunction HandleText (textObject) {\n \/\/ TODO: Move this to a global initialization function\n InitTextHandlers();\n Trace('handle text');\n if (null != Self._property:Extension and null != Extension.TextHandlers)\n {\n \/\/ TODO: We need to check for both StyleId *and* StyleAsText so we can\n \/\/ handle custom styles\n textHandler = Extension.TextHandlers[textObject.StyleId];\n if (null != textHandler)\n {\n return Extension.@textHandler(textObject);\n }\n }\n\n textHandler = TextHandlers[textObject.StyleId];\n if (null != textHandler)\n {\n return @textHandler(textObject);\n }\n} \/\/$end\n\n\nfunction ExpressionTextHandler (textObj) {\n dynam = AddBarObjectInfoToElement(textObj, libmei.Dynam());\n AddFormattedText(dynam, textObj);\n return dynam;\n} \/\/$end\n\n\nfunction PageTitleHandler (textObject) {\n atext = libmei.AnchoredText();\n title = libmei.Title();\n\n libmei.AddChild(atext, title);\n libmei.SetText(title, text);\n\n return atext;\n} \/\/$end\n\n\nfunction PageComposerTextHandler (textObject) {\n \/\/ 'text.system.page_aligned.composer'\n return AddBarObjectInfoToElement(textObj, CreateAnchoredText(textObj));\n} \/\/$end\n\n\nfunction TempoTextHandler (textObject) {\n \/\/ 'text.system.tempo'\n tempo = libmei.Tempo();\n libmei.AddChild(tempo, CreateAnchoredText(textObj));\n return tempo;\n} \/\/$end\n\n\nfunction FiguredBassTextHandler (textObject) {\n \/\/ 'text.staff.space.figuredbass'\n harm = AddBarObjectInfoToElement(textObj, libmei.Harm());\n fb = libmei.Fb();\n libmei.AddChild(harm, fb);\n ConvertFbFigures(fb, textObj);\n return harm;\n} \/\/$end\n\n\nfunction CreateAnchoredText (textObj) {\n \/\/$module(ExportConverters.mss)\n anchoredText = libmei.AnchoredText();\n libmei.SetText(anchoredText, ConvertSubstitution(textObj.Text));\n return anchoredText;\n} \/\/$end\n\n\nfunction AddFormattedText (parentElement, textObj) {\n textWithFormatting = textObj.TextWithFormatting;\n if (textWithFormatting.NumChildren < 2 and CharAt(textWithFormatting, 0) != '\\\\')\n {\n parentElement.SetText(textObj.Text);\n return null;\n }\n\n state = CreateDictionary(\n 'currentText', null,\n 'rendAttributes', null,\n 'rendFlags', null,\n 'nodes', null,\n 'paragraphs', null\n );\n\n for each component in textObj.TextWithFormatting\n {\n switch (Substring(component, 0, 2))\n {\n case ('\\\\n')\n {\n state.nodes.Push(libmei.Lb());\n }\n case ('\\\\N')\n {\n \/\/ TODO: Add

if it is allowed within parentElement (look at .name)\n state.nodes.Push(libmei.Lb());\n }\n case ('\\\\B')\n {\n SwitchTextStyle(state, 'fontweight', 'bold');\n }\n case ('\\\\b')\n {\n SwitchTextStyle(state, 'fontweight', 'normal');\n }\n case ('\\\\I')\n {\n SwitchTextStyle(state, 'fontstyle', 'italic');\n }\n case ('\\\\i')\n {\n SwitchTextStyle(state, 'fontstyle', 'normal');\n }\n case ('\\\\U')\n {\n SwitchTextStyle(state, 'rend', 'underline', true);\n }\n case ('\\\\u')\n {\n SwitchTextStyle(state, 'rend', 'underline', false);\n }\n case ('\\\\f')\n {\n SwitchFont(state, GetTextCommandArg(component));\n }\n case ('\\\\c')\n {\n \/\/ TODO: Can we sensibly handle a character style change? The\n \/\/ only built-in one seem to be `text.character.musictext`\n ;\n }\n case ('\\\\s')\n {\n fontsize = ConvertOffsetsToMEI(GetTextCommandArg(component));\n SwitchTextStyle(state, 'fontsize', fontsize);\n }\n case ('\\\\v')\n {\n \/\/ Vertical scale change (vertical stretching). Probably not\n \/\/ possible to handle\n ;\n }\n case ('\\\\h')\n {\n \/\/ Horizontal scale change (horizontal stretching). Probably not\n \/\/ possible to handle\n ;\n }\n case ('\\\\t')\n {\n \/\/ Tracking. Probably not possible to handle.\n ;\n }\n case ('\\\\p')\n {\n SwitchBaselineAdjust(state, GetTextCommandArg(component));\n }\n case ('\\\\$') {\n AddTextSubstitute(state, substituteName);\n }\n case ('\\\\\\\\')\n {\n \/\/ According to the documentation, 'backslashes themselves are\n \/\/ represented by \\\\ , to avoid conflicting with the above\n \/\/ commands'. Though that does not seem to work, but in case\n \/\/ Avid fixes this at some point, let's just assume it works.\n \/\/ We strip one leading backspace.\n state.currentText = state.currentText & Substring(component, 1);\n }\n default\n {\n \/\/ This is regular text\n state.currentText = state.currentText & component;\n }\n }\n }\n} \/\/$end\n\n\nfunction NewTextParagraph (state) {\n ;\n} \/\/$end\n\n\nfunction GetTextCommandArg (command) {\n \/\/ Remove leading part, e.g. the '\\$' or '\\s' and trailing '\\'\n return Substring(2, Length(command) - 3);\n} \/\/$end\n\n\nfunction SwitchBaselineAdjust (state, param) {\n sup = (param = 'superscript');\n sub = (param = 'subscript');\n if (sup != state.rendFlags['sup'] or sub != state.rendFlags['sub']) {\n AppendStyledText(state);\n }\n state.rendFlags['sup'] = sup;\n state.rendFlags['sub'] = sub;\n} \/\/$end\n\n\nfunction SwitchFont (state, fontName) {\n if (fontName = '_')\n {\n \/\/ Before resetting the style, we have to add text preceding the '\\f_\\'\n \/\/ style reset \u2013 but only if the style reset actually changes something.\n\n textNotYetAppended = true;\n\n if (null != state.rendAttributes)\n {\n for each Name attName in state.rendAttributes\n {\n if (textNotYetAppended and state.rendAttributes[attName] != null)\n {\n AppendStyledText(state);\n textNotYetAppended = false;\n }\n state.rendAttributes[attName] = null;\n }\n }\n if (null != state.rendFlags)\n {\n for each Name flagName in state.rendFlags\n {\n if (textNotYetAppended and state.rendFlags[flagName])\n {\n AppendStyledText(state);\n textNotYetAppended = false;\n }\n state.rendFlags[flagName] = false;\n }\n }\n }\n else\n {\n SwitchTextStyle(state, 'fontfam', fontName);\n }\n} \/\/$end\n\n\nfunction SwitchTextStyle (state, attName, value) {\n if (state.rendAttributes[attName] != value)\n {\n \/\/ Style changes, so append current text before modifying style state\n AppendStyledText(state);\n }\n state.rendAttributes[attName] = value;\n} \/\/$end\n\n\nfunction SwitchRendFlags (state, flagName, value) {\n if (state.rendFlags[flagName] != value)\n {\n AppendStyledText(state);\n }\n state.rendFlags[flagName] = value;\n} \/\/$end\n\n\nfunction AppendStyledText (state) {\n if (null != state.currentText)\n {\n rendAttributes = GetRendAttributes(state);\n if (null = rendAttributes)\n {\n nodes = state.nodes;\n if (null = nodes)\n {\n state.nodes = CreateSparseArray(currentText);\n }\n else\n {\n currentNode = nodes[nodes.Length - 1];\n if (IsObject(currentNode))\n {\n \/\/ This is an element\n newTail = libmei.GetTail(currentElement) & state.currentText;\n libmei.SetTail(currentElement, newTail);\n }\n else\n {\n \/\/ currentNode is plain text\n nodes[nodes.Length - 1] = currentNode & state.currentText;\n }\n }\n }\n else\n {\n rend = libmei.Rend();\n for each Name attName in rendAttributes\n {\n rend.AddAttribute(attName, rendAttributes[attName]);\n }\n \/\/ TODO: Continue this\n }\n }\n\n state.currentText = '';\n} \/\/$end\n\n\nfunction GetRendAttributes (state) {\n rendAttributes = null;\n\n if (null != state.rendAttributes)\n {\n for each Name attName in state.rendAttributes\n {\n value = state.rendAttributes[attName];\n if (null != value)\n {\n if (null = rendAttributes) {\n rendAttributes = CreateDictionary();\n }\n rendAttributes[attName] = value;\n }\n }\n }\n\n if (null != state.rendFlags)\n {\n rendFlags = null;\n for each Name flagName in state.rendFlags\n {\n flagActive = state.rendFlags[flagName];\n if (flagActive)\n {\n if (null != rendFlags)\n {\n rendFlags = CreateSparseArray();\n }\n rendFlags.Push(flagName);\n }\n }\n if (null != rendFlags)\n {\n if (null = rendAttributes) {\n rendAttributes = CreateDictionary();\n }\n rendAttributes['rend'] = rendFlags.Join(' ');\n }\n }\n\n return rendAttributes;\n} \/\/$end\n\n\nfunction AppendTextSubstitute (state, substituteName) {\n score = Self._property:ActiveScore;\n substitutedText = score.@substituteName;\n if (substitutedText = '') {\n \/\/ TODO: Also check for all-whitespace text\n return null;\n }\n\n textSubstituteInfo = TextSubstituteMap[substituteName];\n if (null = textSubstituteInfo)\n {\n \/\/ No known substitution. Sibelius renders those literally.\n state.currentText = state.currentText & '\\\\$' & substituteName & '\\\\';\n return null;\n }\n\n elementName = textSubstituteInfo[0];\n element = libmei.@elementName();\n state.nodes.Push(element);\n for i = 1 to textSubstituteInfo.Length step 2\n {\n libmei.AddAttribute(textSubstituteInfo[i], textSubstituteInfo[i + 1]);\n }\n\n \/*\n \/\/ Use this instead of a Dictionary mapping? May be a little clearer and\n \/\/ allows allows the analysis script to check it properly.\n element = null;\n\n switch (substituteName)\n {\n case ('Title')\n {\n element = libmei.Title();\n }\n case ('Composer')\n {\n element = libmei.Composer();\n }\n case ('Arranger')\n {\n element = libmei.Arranger();\n }\n case ('Lyricist')\n {\n element = libmei.Lyricist();\n }\n case ('MoreInfo')\n {\n element = libmei.Seg();\n libmei.AddAttribute(element, 'type', 'MoreInfo');\n }\n case ('Artist')\n {\n element = libmei.PersName();\n libmei.AddAttribute(element, 'role', 'Artist');\n }\n case ('Copyright')\n {\n \/\/ is only allowed on , so use generic element\n element = libmei.Seg();\n libmei.AddAttribute(element, 'type', 'Copyright');\n }\n case ('Publisher')\n {\n \/\/ is only allowed in a few places, so use generic element\n \/\/ We don't even know if it's a person or an institution\n element = libmei.Seg();\n libmei.AddAttribute(element, 'type', 'Publisher');\n }\n case ('PartName')\n {\n element = libmei.Seg();\n libmei.AddAttribute(element, 'type', 'PartName');\n }\n default\n {\n state.currentText = state.currentText & '\\\\$' & substituteName & '\\\\';\n return null;\n }\n }*\/\n\n\n rendAttributes = GetRendAttributes(state);\n rendElement = null;\n if (null = rendAttributes)\n {\n libmei.SetText(element, substitutedText);\n }\n else\n {\n rendElement = libmei.Rend();\n libmei.AddChild(element, rendElement);\n for each Name attName in rendAttributes\n {\n libmei.AddAttribute(rendElement, attName, rendAttributes[attName]);\n }\n libmei.SetText(rendElement, substitutedText);\n }\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"28faa6a50d64de1ab58ae1df72bee8d9de9e54cd","subject":"Update roads.mss","message":"Update roads.mss","repos":"brelevenix\/osm-bright-tregor","old_file":"osm-bright\/roads.mss","new_file":"osm-bright\/roads.mss","new_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 0.3; @rdz11_med: 0.2; @rdz11_min: 0.1;\n@rdz12_maj: 0.5; @rdz12_med: 0.4; @rdz12_min: 0.2;\n@rdz13_maj: 1; @rdz13_med: 0.8; @rdz13_min: 0.5;\n@rdz14_maj: 2; @rdz14_med: 1.5; @rdz14_min: 1;\n@rdz15_maj: 4; @rdz15_med: 3; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 16; @rdz17_med: 12; @rdz17_min: 8;\n@rdz18_maj: 32; @rdz18_med: 24; @rdz18_min: 16;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz11_maj; line-color: @purple; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz12_maj; line-color: @purple; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz13_maj; line-color: @purple; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz14_med; line-color: @purple; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz15_med }\n [stylegroup='minorroad']{ line-width: @rdz15_min ; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_maj; line-color: @purple; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj ;}\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz16_maj; line-color: @purple; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_maj; line-color: @purple; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_maj; line-color: @purple; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n line-color: @brown;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min ; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min*4; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min ; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min ; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min ; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","old_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 0.3; @rdz11_med: 0.2; @rdz11_min: 0.1;\n@rdz12_maj: 0.5; @rdz12_med: 0.4; @rdz12_min: 0.2;\n@rdz13_maj: 1; @rdz13_med: 0.8; @rdz13_min: 0.5;\n@rdz14_maj: 2; @rdz14_med: 1.5; @rdz14_min: 1;\n@rdz15_maj: 4; @rdz15_med: 3; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 16; @rdz17_med: 12; @rdz17_min: 8;\n@rdz18_maj: 32; @rdz18_med: 24; @rdz18_min: 16;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz11_maj; line-color: @purple; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz12_maj; line-color: @purple; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz13_maj; line-color: @purple; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: @rdz14_med; line-color: @purple; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj ; }\n [stylegroup='mainroad'] { line-width: @rdz15_med }\n [stylegroup='minorroad']{ line-width: @rdz15_min ; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_maj; line-color: @purple; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj ;}\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz16_maj; line-color: @purple; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_maj; line-color: @purple; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_maj; line-color: @purple; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min ; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min ; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min ; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min ; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"11bba703a8cb24f89f935962f991897fbd05a6e4","subject":"minor text fixes","message":"minor text fixes\n","repos":"silph-io\/osm-silph","old_file":"osm-bright\/roads.mss","new_file":"osm-bright\/roads.mss","new_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n#roads_low[zoom>=5][zoom<=8] {\n [type='motorway'] { line-color: @motorway_line; }\n [type='trunk'] { line-color: @trunk_line; }\n [zoom=5] {\n [type='motorway'] { line-width: 0.4; }\n [type='trunk'] { line-width: 0.2; } }\n [zoom=6] {\n [type='motorway'] { line-width: 0.5; }\n [type='trunk'] { line-width: 0.25; } }\n [zoom=7] {\n [type='motorway'] { line-width: 0.6; }\n [type='trunk'] { line-width: 0.3; } }\n [zoom=8] {\n [type='motorway'] { line-width: 1; }\n [type='trunk'] { line-width: 0.5; } }\n}\n\n\/* At mid-level scales start to show primary and secondary routes\nas well. *\/\n\n#roads_med[zoom>=9][zoom<=10] {\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_line;\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_line;\n }\n [type='primary'] { line-color: @primary_line; }\n [type='secondary'] { line-color: @secondary_line; }\n [type='tertiary'] { line-color: @standard_line; }\n [zoom=9] {\n [type='motorway'],[type='trunk'] { line-width: 1.4; }\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.6; }\n }\n [zoom=10] {\n [type='motorway'],[type='trunk'] { line-width: 1.8; }\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.8; }\n }\n}\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 1.6; @rdz11_med: 0.8; @rdz11_min: 0.4;\n@rdz12_maj: 2.5; @rdz12_med: 1.2; @rdz12_min: 0.8;\n@rdz13_maj: 3; @rdz13_med: 1.5; @rdz13_min: 1;\n@rdz14_maj: 4; @rdz14_med: 2.5; @rdz14_min: 1.6;\n@rdz15_maj: 6; @rdz15_med: 4; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 14; @rdz17_med: 12; @rdz17_min: 10;\n@rdz18_maj: 20; @rdz18_med: 17; @rdz18_min: 14;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz11_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz12_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz13_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz13_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz14_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz14_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz15_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz15_min + 2; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz16_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz16_min + 2; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 2; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj + 3; }\n [stylegroup='mainroad'] { line-width: @rdz17_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz17_min + 2; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 4; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj + 4; }\n [stylegroup='mainroad'] { line-width: @rdz18_med + 4; }\n [stylegroup='minorroad']{ line-width: @rdz18_min + 3.5; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 6; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4; line-dasharray: 2,1; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4; line-dasharray: 2,2; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4; line-dasharray: 3,3; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","old_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n#roads_low[zoom>=5][zoom<=8] {\n [type='motorway'] { line-color: @motorway_line; }\n [type='trunk'] { line-color: @trunk_line; }\n [zoom=5] {\n [type='motorway'] { line-width: 0.4; }\n [type='trunk'] { line-width: 0.2; } }\n [zoom=6] {\n [type='motorway'] { line-width: 0.5; }\n [type='trunk'] { line-width: 0.25; } }\n [zoom=7] {\n [type='motorway'] { line-width: 0.6; }\n [type='trunk'] { line-width: 0.3; } }\n [zoom=8] {\n [type='motorway'] { line-width: 1; }\n [type='trunk'] { line-width: 0.5; } }\n}\n\n\/* At mid-level scales start to show primary and secondary routes\nas well. *\/\n\n#roads_med[zoom>=9][zoom<=10] {\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_line;\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_line;\n }\n [type='primary'] { line-color: @primary_line; }\n [type='secondary'] { line-color: @secondary_line; }\n [type='tertiary'] { line-color: @standard_line; }\n [zoom=9] {\n [type='motorway'],[type='trunk'] { line-width: 1.4; }\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.6; }\n }\n [zoom=10] {\n [type='motorway'],[type='trunk'] { line-width: 1.8; }\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.8; }\n }\n}\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 1.6; @rdz11_med: 0.8; @rdz11_min: 0.4;\n@rdz12_maj: 2.5; @rdz12_med: 1.2; @rdz12_min: 0.8;\n@rdz13_maj: 3; @rdz13_med: 1.5; @rdz13_min: 1;\n@rdz14_maj: 4; @rdz14_med: 2.5; @rdz14_min: 1.6;\n@rdz15_maj: 6; @rdz15_med: 4; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 14; @rdz17_med: 12; @rdz17_min: 10;\n@rdz18_maj: 20; @rdz18_med: 17; @rdz18_min: 14;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz11_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz12_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz13_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz13_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz14_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz14_min + 2; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz15_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz15_min + 2; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 2; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz16_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz16_min + 2; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 2; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj + 3; }\n [stylegroup='mainroad'] { line-width: @rdz17_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz17_min + 2; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 4; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj + 4; }\n [stylegroup='mainroad'] { line-width: @rdz18_med + 4; }\n [stylegroup='minorroad']{ line-width: @rdz18_min + 3.5; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 6; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4; line-dasharray: 2,1; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4; line-dasharray: 2,2; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4; line-dasharray: 3,3; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"3b7fed0501e138d07841bcf2bd0176a46d892ba6","subject":"university label tweaks","message":"university label tweaks\n","repos":"andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto","old_file":"osmt\/poi.mss","new_file":"osmt\/poi.mss","new_contents":"\/*\n due to the UNION of the point and polygon tables in the query\n we will get both POIs mapped as nodes and ways\n*\/\n\n\/*\n This file is mostly auto-generated from poi.mss.template.\n There are still a few things I have tweaked though. I'm still trying to figure\n out a way to maintain a source file which is simple like my template file\n and a few rules for zoom to icon size mappings, yet is good enough to also\n code more complicated things.\n*\/\n\n\/*\n#amenity[amenity='school'] {\n ::icon{\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.000000.12.png');\n }\n\n ::label[zoom > 14] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: point;\n text-halo-fill: #6c4600;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n text-vertical-alignment: bottom;\n text-opacity: 0.75;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n }\n\n #amenity[amenity='school'][school_level='primary'] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school_primary.glow.000000.12.png');\n }\n\n #amenity[amenity='school'][school_level='secondary'] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school_secondary.glow.000000.12.png');\n }\n}*\/\n[zoom > 16] .poi#tourism[tourism='alpine_hut'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/alpine_hut.glow.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/alpine_hut.glow.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/alpine_hut.glow.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/alpine_hut.glow.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/alpine_hut.glow.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='chalet'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/chalet.glow.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/chalet.glow.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/chalet.glow.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/chalet.glow.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/chalet.glow.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='camp_site'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/camping.glow.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/camping.glow.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/camping.glow.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/camping.glow.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/camping.glow.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='caravan_site'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/caravan_site.glow.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/caravan_site.glow.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/caravan_site.glow.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/caravan_site.glow.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/caravan_site.glow.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='hotel'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/hotel.glow.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/hotel.glow.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/hotel.glow.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/hotel.glow.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/hotel.glow.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='motel'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/motel.glow.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/motel.glow.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/motel.glow.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/motel.glow.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/motel.glow.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='bench'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/bench.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/bench.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/bench.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/bench.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/bench.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='courthouse'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/court.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/court.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/court.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/court.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/court.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='fire_station'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/firestation.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/firestation.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/firestation.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/firestation.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/firestation.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='fountain'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/fountain.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/fountain.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/fountain.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/fountain.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/fountain.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='library'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/library.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/library.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/library.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/library.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/library.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='playground'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/playground.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/playground.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/playground.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/playground.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/playground.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='police'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/police.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/police.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/police.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/police.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/police.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='post_box'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_box.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_box.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_box.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_box.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_box.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='post_office'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_office.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_office.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_office.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_office.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_office.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='prison'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/prison.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/prison.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/prison.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/prison.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/prison.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='public_building'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/public_building.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/public_building.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/public_building.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/public_building.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/public_building.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='recycling'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/recycling.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/recycling.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/recycling.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/recycling.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/recycling.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='survey_point'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/survey_point.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/survey_point.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/survey_point.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/survey_point.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/survey_point.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='telephone'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/telephone.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/telephone.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/telephone.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/telephone.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/telephone.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='toilets'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/toilets.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/toilets.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/toilets.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/toilets.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/toilets.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='townhall'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/town_hall.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/town_hall.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/town_hall.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/town_hall.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/town_hall.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='waste_basket'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='waste_disposal'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#man_made[man_made='water_tower'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/water\/tower.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/water\/tower.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/water\/tower.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/water\/tower.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/water\/tower.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#natural[natural='cave_entrance'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/cave.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/cave.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/cave.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/cave.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/cave.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#natural[natural='peak'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/peak.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/peak.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/peak.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/peak.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/peak.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='attraction'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/attraction.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/attraction.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/attraction.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/attraction.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/attraction.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='cinema'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/cinema.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/cinema.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/cinema.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/cinema.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/cinema.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='fountain'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/fountain.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/fountain.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/fountain.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/fountain.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/fountain.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='information'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/information.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/information.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/information.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/information.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/information.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='memorial'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/memorial.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/memorial.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/memorial.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/memorial.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/memorial.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='monument'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/monument.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/monument.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/monument.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/monument.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/monument.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='museum'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/museum.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/museum.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/museum.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/museum.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/museum.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='picnic_site'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/picnic.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/picnic.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/picnic.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/picnic.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/picnic.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='theme_park'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/theme_park.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/theme_park.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/theme_park.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/theme_park.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/theme_park.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='viewpoint'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/view_point.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/view_point.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/view_point.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/view_point.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/view_point.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='zoo'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/zoo.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/zoo.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/zoo.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/zoo.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/zoo.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='block'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/blocks.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/blocks.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/blocks.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/blocks.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/blocks.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='bollard'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/bollard.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/bollard.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/bollard.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/bollard.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/bollard.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='cattle_grid'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cattle_grid.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cattle_grid.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cattle_grid.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cattle_grid.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cattle_grid.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='cycle_barrier'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cycle_barrier.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cycle_barrier.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cycle_barrier.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cycle_barrier.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cycle_barrier.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='entrance'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/entrance.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/entrance.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/entrance.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/entrance.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/entrance.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='exit'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/exit.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/exit.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/exit.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/exit.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/exit.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='gate'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/gate.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/gate.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/gate.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/gate.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/gate.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='kissing_gate'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/kissing_gate.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/kissing_gate.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/kissing_gate.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/kissing_gate.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/kissing_gate.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='lift_gate'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/lift_gate.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/lift_gate.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/lift_gate.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/lift_gate.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/lift_gate.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='steps'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/steps.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/steps.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/steps.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/steps.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/steps.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='stile'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/stile.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/stile.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/stile.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/stile.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/stile.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='toll_booth'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/toll_booth.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/toll_booth.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/toll_booth.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/toll_booth.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/toll_booth.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='college'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/college.glow.734A08.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/college.glow.734A08.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/college.glow.734A08.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/college.glow.734A08.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/college.glow.734A08.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='child_care'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/nursery.glow.734A08.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/nursery.glow.734A08.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/nursery.glow.734A08.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/nursery.glow.734A08.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/nursery.glow.734A08.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='school'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 13] .poi#amenity[amenity='university'] {\n [zoom = 14] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1;\n text-size: 10;\n }\n\n [zoom = 15] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 2;\n text-size: 12;\n }\n\n [zoom = 16] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 2;\n text-size: 14;\n }\n\n \/* don't show the uni name from 17+ as it would just clutter the building names *\/\n [zoom = 17] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/university.glow.734A08.12.png')\n }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/university.glow.734A08.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/university.glow.734A08.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/university.glow.734A08.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/university.glow.734A08.32.png');\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='dentist'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/dentist.p.DA0092.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/dentist.p.DA0092.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/dentist.p.DA0092.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/dentist.p.DA0092.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/dentist.p.DA0092.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='doctors'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/doctors.p.DA0092.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/doctors.p.DA0092.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/doctors.p.DA0092.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/doctors.p.DA0092.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/doctors.p.DA0092.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='hospital'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/hospital.p.DA0092.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/hospital.p.DA0092.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/hospital.p.DA0092.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/hospital.p.DA0092.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/hospital.p.DA0092.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='pharmacy'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/pharmacy.p.DA0092.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/pharmacy.p.DA0092.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/pharmacy.p.DA0092.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/pharmacy.p.DA0092.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/pharmacy.p.DA0092.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='veterinary'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/veterinary.p.DA0092.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/veterinary.p.DA0092.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/veterinary.p.DA0092.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/veterinary.p.DA0092.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/veterinary.p.DA0092.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='optician'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/optician.p.DA0092.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/optician.p.DA0092.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/optician.p.DA0092.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/optician.p.DA0092.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/optician.p.DA0092.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#sport[sport='archery'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/archery.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/archery.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/archery.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/archery.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/archery.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='baseball'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/baseball.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/baseball.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/baseball.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/baseball.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/baseball.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='canoe'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/canoe.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/canoe.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/canoe.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/canoe.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/canoe.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='cricket'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='cricket_nets'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='diving'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/diving.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/diving.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/diving.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/diving.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/diving.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='golf'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/golf.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/golf.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/golf.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/golf.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/golf.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='gym'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#leisure[leisure='gym'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='gym'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='gymnasium'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gymnasium.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gymnasium.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gymnasium.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gymnasium.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gymnasium.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='hillclimbing'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/hillclimbing.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/hillclimbing.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/hillclimbing.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/hillclimbing.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/hillclimbing.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='horse_racing'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/horse_racing.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/horse_racing.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/horse_racing.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/horse_racing.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/horse_racing.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='iceskating'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/iceskating.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/iceskating.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/iceskating.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/iceskating.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/iceskating.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='jetski'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/jetski.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/jetski.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/jetski.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/jetski.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/jetski.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='minature_golf'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/minature_golf.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/minature_golf.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/minature_golf.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/minature_golf.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/minature_golf.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='motorracing'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/motorracing.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/motorracing.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/motorracing.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/motorracing.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/motorracing.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#leisure[leisure='playground'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/playground.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/playground.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/playground.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/playground.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/playground.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='sailing'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/sailing.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/sailing.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/sailing.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/sailing.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/sailing.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='shooting'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/shooting.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/shooting.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/shooting.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/shooting.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/shooting.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='snooker'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/snooker.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/snooker.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/snooker.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/snooker.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/snooker.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='soccer'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/soccer.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/soccer.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/soccer.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/soccer.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/soccer.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='swimming'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/swimming_indoor.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/swimming_indoor.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/swimming_indoor.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/swimming_indoor.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/swimming_indoor.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='tennis'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/tennis.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/tennis.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/tennis.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/tennis.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/tennis.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='windsurfing'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/windsurfing.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/windsurfing.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/windsurfing.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/windsurfing.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/windsurfing.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#shop[shop='alcohol'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/alcohol.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/alcohol.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/alcohol.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/alcohol.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/alcohol.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='bakery'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bakery.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bakery.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bakery.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bakery.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bakery.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='bicycle'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bicycle.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bicycle.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bicycle.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bicycle.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bicycle.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='book'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/book.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/book.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/book.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/book.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/book.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='butcher'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/butcher.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/butcher.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/butcher.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/butcher.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/butcher.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='car'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='car_repair'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car_repair.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car_repair.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car_repair.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car_repair.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car_repair.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='clothes'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/clothes.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/clothes.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/clothes.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/clothes.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/clothes.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='computer'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/computer.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/computer.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/computer.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/computer.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/computer.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='confectionery'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/confectionery.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/confectionery.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/confectionery.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/confectionery.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/confectionery.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='convenience'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/convenience.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/convenience.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/convenience.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/convenience.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/convenience.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='copyshop'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/copyshop.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/copyshop.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/copyshop.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/copyshop.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/copyshop.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='department_store'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/department_store.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/department_store.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/department_store.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/department_store.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/department_store.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='diy'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/diy.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/diy.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/diy.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/diy.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/diy.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='estateagent'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/estateagent.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/estateagent.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/estateagent.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/estateagent.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/estateagent.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='fish'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/fish.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/fish.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/fish.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/fish.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/fish.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='florist'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/florist.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/florist.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/florist.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/florist.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/florist.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='garden_centre'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/garden_centre.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/garden_centre.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/garden_centre.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/garden_centre.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/garden_centre.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='gift'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/gift.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/gift.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/gift.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/gift.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/gift.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='greengrocer'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/greengrocer.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/greengrocer.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/greengrocer.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/greengrocer.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/greengrocer.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='hairdresser'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hairdresser.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hairdresser.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hairdresser.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hairdresser.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hairdresser.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='hearing_aids'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hearing_aids.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hearing_aids.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hearing_aids.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hearing_aids.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hearing_aids.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='hifi'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hifi.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hifi.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hifi.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hifi.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hifi.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='jewelry'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/jewelry.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/jewelry.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/jewelry.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/jewelry.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/jewelry.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='kiosk'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/kiosk.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/kiosk.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/kiosk.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/kiosk.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/kiosk.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='laundrette'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/laundrette.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/laundrette.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/laundrette.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/laundrette.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/laundrette.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='marketplace'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/marketplace.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/marketplace.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/marketplace.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/marketplace.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/marketplace.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='mobile_phone'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/mobile_phone.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/mobile_phone.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/mobile_phone.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/mobile_phone.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/mobile_phone.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='motorcycle'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/motorcycle.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/motorcycle.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/motorcycle.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/motorcycle.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/motorcycle.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='music'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/music.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/music.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/music.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/music.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/music.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='newspaper'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/newspaper.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/newspaper.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/newspaper.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/newspaper.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/newspaper.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='pet'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/pet.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/pet.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/pet.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/pet.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/pet.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='photo'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/photo.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/photo.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/photo.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/photo.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/photo.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='supermarket'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/supermarket.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/supermarket.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/supermarket.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/supermarket.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/supermarket.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='tackle'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tackle.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tackle.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tackle.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tackle.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tackle.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='tobacco'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tobacco.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tobacco.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tobacco.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tobacco.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tobacco.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='toys'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/toys.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/toys.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/toys.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/toys.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/toys.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='vending_machine'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/vending_machine.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/vending_machine.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/vending_machine.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/vending_machine.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/vending_machine.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='video_rental'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/video_rental.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/video_rental.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/video_rental.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/video_rental.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/video_rental.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='bar'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/bar.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/bar.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/bar.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/bar.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/bar.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='biergarten'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/biergarten.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/biergarten.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/biergarten.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/biergarten.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/biergarten.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='cafe'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/cafe.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/cafe.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/cafe.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/cafe.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/cafe.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='tap'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='drinking_water'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='fastfood'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/fastfood.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/fastfood.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/fastfood.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/fastfood.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/fastfood.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='ice_cream'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/ice_cream.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/ice_cream.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/ice_cream.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/ice_cream.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/ice_cream.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='pizza'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pizza.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pizza.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pizza.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pizza.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pizza.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='pub'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pub.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pub.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pub.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pub.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pub.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='restaurant'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/restaurant.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/restaurant.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/restaurant.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/restaurant.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/restaurant.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='atm'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/atm.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/atm.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/atm.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/atm.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/atm.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='bank'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/bank.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/bank.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/bank.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/bank.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/bank.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='currency_exchange'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/currency_exchange.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/currency_exchange.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/currency_exchange.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/currency_exchange.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/currency_exchange.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='parking'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking.n.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking.n.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking.n.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking.n.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='bicycle_parking'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking_bicycle.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking_bicycle.n.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking_bicycle.n.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking_bicycle.n.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking_bicycle.n.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#leisure[leisure='slipway'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/slipway.glow.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/slipway.glow.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/slipway.glow.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/slipway.glow.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/slipway.glow.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='taxi'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/taxi_rank.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/taxi_rank.n.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/taxi_rank.n.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/taxi_rank.n.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/taxi_rank.n.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#aeroway[aeroway='gate'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_gate.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_gate.n.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_gate.n.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_gate.n.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_gate.n.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#aeroway[aeroway='terminal'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_terminal.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_terminal.n.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_terminal.n.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_terminal.n.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_terminal.n.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#aeroway[aeroway='helipad'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/helicopter_pad.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/helicopter_pad.n.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/helicopter_pad.n.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/helicopter_pad.n.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/helicopter_pad.n.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#highway_poi[highway='bus_stop'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/bus_stop.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/bus_stop.n.0092DA.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/bus_stop.n.0092DA.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/bus_stop.n.0092DA.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/bus_stop.n.0092DA.32.png');\n }\n}\n\n[zoom > 16] .poi#highway_poi[highway='ford'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/ford.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/ford.n.0092DA.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/ford.n.0092DA.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/ford.n.0092DA.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/ford.n.0092DA.32.png');\n }\n}\n\n[zoom > 16] .poi#highway_poi[highway='traffic_signals'] {\n point-allow-overlap: true;\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/traffic_lights.glow.000000.16.png') }\n [zoom = 18] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/traffic_lights.glow.000000.20.png') }\n [zoom = 19] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/traffic_lights.glow.000000.24.png') }\n [zoom = 20] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/traffic_lights.glow.000000.24.png') }\n [zoom > 20] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/traffic_lights.glow.000000.32.png') }\n}\n","old_contents":"\/*\n due to the UNION of the point and polygon tables in the query\n we will get both POIs mapped as nodes and ways\n*\/\n\n\/*\n This file is mostly auto-generated from poi.mss.template.\n There are still a few things I have tweaked though. I'm still trying to figure\n out a way to maintain a source file which is simple like my template file\n and a few rules for zoom to icon size mappings, yet is good enough to also\n code more complicated things.\n*\/\n\n\/*\n#amenity[amenity='school'] {\n ::icon{\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.000000.12.png');\n }\n\n ::label[zoom > 14] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: point;\n text-halo-fill: #6c4600;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n text-vertical-alignment: bottom;\n text-opacity: 0.75;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n }\n\n #amenity[amenity='school'][school_level='primary'] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school_primary.glow.000000.12.png');\n }\n\n #amenity[amenity='school'][school_level='secondary'] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school_secondary.glow.000000.12.png');\n }\n}*\/\n[zoom > 16] .poi#tourism[tourism='alpine_hut'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/alpine_hut.glow.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/alpine_hut.glow.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/alpine_hut.glow.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/alpine_hut.glow.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/alpine_hut.glow.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='chalet'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/chalet.glow.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/chalet.glow.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/chalet.glow.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/chalet.glow.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/chalet.glow.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='camp_site'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/camping.glow.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/camping.glow.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/camping.glow.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/camping.glow.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/camping.glow.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='caravan_site'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/caravan_site.glow.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/caravan_site.glow.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/caravan_site.glow.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/caravan_site.glow.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/caravan_site.glow.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='hotel'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/hotel.glow.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/hotel.glow.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/hotel.glow.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/hotel.glow.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/hotel.glow.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='motel'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/motel.glow.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/motel.glow.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/motel.glow.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/motel.glow.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/accommodation\/motel.glow.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='bench'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/bench.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/bench.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/bench.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/bench.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/bench.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='courthouse'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/court.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/court.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/court.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/court.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/court.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='fire_station'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/firestation.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/firestation.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/firestation.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/firestation.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/firestation.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='fountain'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/fountain.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/fountain.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/fountain.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/fountain.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/fountain.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='library'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/library.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/library.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/library.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/library.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/library.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='playground'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/playground.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/playground.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/playground.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/playground.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/playground.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='police'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/police.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/police.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/police.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/police.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/police.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='post_box'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_box.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_box.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_box.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_box.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_box.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='post_office'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_office.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_office.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_office.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_office.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/post_office.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='prison'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/prison.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/prison.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/prison.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/prison.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/prison.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='public_building'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/public_building.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/public_building.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/public_building.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/public_building.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/public_building.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='recycling'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/recycling.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/recycling.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/recycling.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/recycling.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/recycling.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='survey_point'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/survey_point.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/survey_point.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/survey_point.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/survey_point.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/survey_point.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='telephone'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/telephone.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/telephone.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/telephone.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/telephone.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/telephone.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='toilets'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/toilets.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/toilets.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/toilets.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/toilets.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/toilets.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='townhall'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/town_hall.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/town_hall.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/town_hall.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/town_hall.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/town_hall.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='waste_basket'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='waste_disposal'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/amenity\/waste_bin.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#man_made[man_made='water_tower'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/water\/tower.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/water\/tower.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/water\/tower.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/water\/tower.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/water\/tower.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#natural[natural='cave_entrance'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/cave.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/cave.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/cave.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/cave.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/cave.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#natural[natural='peak'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/peak.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/peak.glow.000000.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/peak.glow.000000.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/peak.glow.000000.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/poi\/peak.glow.000000.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #000000;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='attraction'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/attraction.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/attraction.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/attraction.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/attraction.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/attraction.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='cinema'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/cinema.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/cinema.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/cinema.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/cinema.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/cinema.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='fountain'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/fountain.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/fountain.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/fountain.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/fountain.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/fountain.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='information'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/information.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/information.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/information.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/information.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/information.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='memorial'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/memorial.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/memorial.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/memorial.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/memorial.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/memorial.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='monument'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/monument.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/monument.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/monument.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/monument.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/monument.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='museum'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/museum.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/museum.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/museum.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/museum.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/museum.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='picnic_site'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/picnic.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/picnic.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/picnic.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/picnic.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/picnic.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='theme_park'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/theme_park.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/theme_park.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/theme_park.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/theme_park.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/theme_park.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='viewpoint'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/view_point.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/view_point.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/view_point.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/view_point.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/view_point.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#tourism[tourism='zoo'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/zoo.n.8E7409.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/zoo.n.8E7409.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/zoo.n.8E7409.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/zoo.n.8E7409.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/tourist\/zoo.n.8E7409.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #8E7409;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='block'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/blocks.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/blocks.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/blocks.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/blocks.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/blocks.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='bollard'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/bollard.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/bollard.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/bollard.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/bollard.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/bollard.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='cattle_grid'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cattle_grid.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cattle_grid.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cattle_grid.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cattle_grid.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cattle_grid.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='cycle_barrier'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cycle_barrier.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cycle_barrier.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cycle_barrier.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cycle_barrier.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/cycle_barrier.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='entrance'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/entrance.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/entrance.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/entrance.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/entrance.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/entrance.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='exit'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/exit.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/exit.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/exit.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/exit.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/exit.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='gate'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/gate.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/gate.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/gate.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/gate.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/gate.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='kissing_gate'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/kissing_gate.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/kissing_gate.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/kissing_gate.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/kissing_gate.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/kissing_gate.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='lift_gate'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/lift_gate.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/lift_gate.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/lift_gate.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/lift_gate.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/lift_gate.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='steps'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/steps.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/steps.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/steps.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/steps.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/steps.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='stile'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/stile.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/stile.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/stile.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/stile.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/stile.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#barrier[barrier='toll_booth'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/toll_booth.glow.999999.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/toll_booth.glow.999999.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/toll_booth.glow.999999.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/toll_booth.glow.999999.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/barrier\/toll_booth.glow.999999.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #999999;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='college'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/college.glow.734A08.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/college.glow.734A08.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/college.glow.734A08.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/college.glow.734A08.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/college.glow.734A08.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='child_care'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/nursery.glow.734A08.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/nursery.glow.734A08.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/nursery.glow.734A08.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/nursery.glow.734A08.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/nursery.glow.734A08.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='school'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='university'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/university.glow.734A08.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/university.glow.734A08.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/university.glow.734A08.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/university.glow.734A08.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/university.glow.734A08.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #734A08;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='dentist'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/dentist.p.DA0092.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/dentist.p.DA0092.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/dentist.p.DA0092.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/dentist.p.DA0092.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/dentist.p.DA0092.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='doctors'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/doctors.p.DA0092.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/doctors.p.DA0092.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/doctors.p.DA0092.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/doctors.p.DA0092.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/doctors.p.DA0092.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='hospital'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/hospital.p.DA0092.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/hospital.p.DA0092.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/hospital.p.DA0092.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/hospital.p.DA0092.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/hospital.p.DA0092.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='pharmacy'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/pharmacy.p.DA0092.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/pharmacy.p.DA0092.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/pharmacy.p.DA0092.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/pharmacy.p.DA0092.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/pharmacy.p.DA0092.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='veterinary'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/veterinary.p.DA0092.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/veterinary.p.DA0092.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/veterinary.p.DA0092.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/veterinary.p.DA0092.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/veterinary.p.DA0092.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='optician'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/optician.p.DA0092.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/optician.p.DA0092.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/optician.p.DA0092.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/optician.p.DA0092.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/health\/optician.p.DA0092.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #DA0092;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#sport[sport='archery'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/archery.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/archery.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/archery.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/archery.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/archery.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='baseball'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/baseball.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/baseball.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/baseball.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/baseball.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/baseball.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='canoe'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/canoe.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/canoe.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/canoe.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/canoe.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/canoe.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='cricket'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='cricket_nets'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/cricket.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='diving'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/diving.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/diving.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/diving.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/diving.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/diving.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='golf'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/golf.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/golf.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/golf.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/golf.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/golf.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='gym'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#leisure[leisure='gym'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='gym'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gym.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='gymnasium'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gymnasium.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gymnasium.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gymnasium.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gymnasium.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/gymnasium.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='hillclimbing'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/hillclimbing.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/hillclimbing.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/hillclimbing.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/hillclimbing.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/hillclimbing.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='horse_racing'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/horse_racing.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/horse_racing.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/horse_racing.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/horse_racing.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/horse_racing.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='iceskating'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/iceskating.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/iceskating.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/iceskating.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/iceskating.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/iceskating.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='jetski'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/jetski.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/jetski.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/jetski.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/jetski.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/jetski.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='minature_golf'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/minature_golf.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/minature_golf.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/minature_golf.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/minature_golf.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/minature_golf.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='motorracing'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/motorracing.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/motorracing.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/motorracing.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/motorracing.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/motorracing.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#leisure[leisure='playground'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/playground.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/playground.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/playground.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/playground.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/playground.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='sailing'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/sailing.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/sailing.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/sailing.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/sailing.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/sailing.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='shooting'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/shooting.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/shooting.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/shooting.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/shooting.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/shooting.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='snooker'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/snooker.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/snooker.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/snooker.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/snooker.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/snooker.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='soccer'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/soccer.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/soccer.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/soccer.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/soccer.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/soccer.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='swimming'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/swimming_indoor.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/swimming_indoor.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/swimming_indoor.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/swimming_indoor.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/swimming_indoor.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='tennis'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/tennis.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/tennis.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/tennis.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/tennis.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/tennis.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#sport[sport='windsurfing'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/windsurfing.glow.000000.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/windsurfing.glow.000000.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/windsurfing.glow.000000.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/windsurfing.glow.000000.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/windsurfing.glow.000000.32.png');\n }\n}\n\n[zoom > 16] .poi#shop[shop='alcohol'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/alcohol.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/alcohol.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/alcohol.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/alcohol.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/alcohol.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='bakery'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bakery.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bakery.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bakery.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bakery.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bakery.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='bicycle'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bicycle.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bicycle.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bicycle.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bicycle.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/bicycle.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='book'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/book.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/book.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/book.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/book.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/book.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='butcher'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/butcher.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/butcher.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/butcher.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/butcher.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/butcher.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='car'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='car_repair'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car_repair.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car_repair.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car_repair.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car_repair.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/car_repair.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='clothes'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/clothes.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/clothes.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/clothes.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/clothes.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/clothes.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='computer'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/computer.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/computer.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/computer.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/computer.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/computer.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='confectionery'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/confectionery.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/confectionery.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/confectionery.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/confectionery.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/confectionery.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='convenience'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/convenience.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/convenience.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/convenience.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/convenience.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/convenience.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='copyshop'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/copyshop.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/copyshop.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/copyshop.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/copyshop.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/copyshop.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='department_store'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/department_store.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/department_store.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/department_store.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/department_store.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/department_store.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='diy'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/diy.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/diy.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/diy.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/diy.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/diy.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='estateagent'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/estateagent.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/estateagent.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/estateagent.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/estateagent.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/estateagent.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='fish'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/fish.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/fish.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/fish.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/fish.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/fish.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='florist'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/florist.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/florist.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/florist.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/florist.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/florist.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='garden_centre'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/garden_centre.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/garden_centre.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/garden_centre.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/garden_centre.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/garden_centre.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='gift'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/gift.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/gift.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/gift.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/gift.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/gift.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='greengrocer'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/greengrocer.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/greengrocer.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/greengrocer.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/greengrocer.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/greengrocer.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='hairdresser'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hairdresser.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hairdresser.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hairdresser.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hairdresser.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hairdresser.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='hearing_aids'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hearing_aids.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hearing_aids.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hearing_aids.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hearing_aids.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hearing_aids.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='hifi'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hifi.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hifi.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hifi.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hifi.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/hifi.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='jewelry'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/jewelry.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/jewelry.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/jewelry.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/jewelry.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/jewelry.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='kiosk'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/kiosk.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/kiosk.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/kiosk.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/kiosk.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/kiosk.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='laundrette'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/laundrette.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/laundrette.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/laundrette.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/laundrette.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/laundrette.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='marketplace'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/marketplace.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/marketplace.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/marketplace.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/marketplace.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/marketplace.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='mobile_phone'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/mobile_phone.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/mobile_phone.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/mobile_phone.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/mobile_phone.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/mobile_phone.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='motorcycle'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/motorcycle.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/motorcycle.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/motorcycle.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/motorcycle.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/motorcycle.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='music'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/music.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/music.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/music.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/music.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/music.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='newspaper'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/newspaper.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/newspaper.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/newspaper.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/newspaper.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/newspaper.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='pet'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/pet.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/pet.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/pet.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/pet.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/pet.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='photo'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/photo.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/photo.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/photo.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/photo.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/photo.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='supermarket'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/supermarket.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/supermarket.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/supermarket.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/supermarket.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/supermarket.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='tackle'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tackle.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tackle.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tackle.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tackle.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tackle.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='tobacco'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tobacco.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tobacco.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tobacco.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tobacco.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/tobacco.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='toys'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/toys.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/toys.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/toys.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/toys.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/toys.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='vending_machine'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/vending_machine.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/vending_machine.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/vending_machine.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/vending_machine.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/vending_machine.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#shop[shop='video_rental'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/video_rental.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/video_rental.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/video_rental.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/video_rental.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/shopping\/video_rental.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='bar'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/bar.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/bar.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/bar.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/bar.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/bar.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='biergarten'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/biergarten.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/biergarten.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/biergarten.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/biergarten.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/biergarten.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='cafe'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/cafe.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/cafe.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/cafe.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/cafe.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/cafe.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='tap'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='drinking_water'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/drinkingtap.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='fastfood'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/fastfood.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/fastfood.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/fastfood.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/fastfood.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/fastfood.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='ice_cream'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/ice_cream.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/ice_cream.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/ice_cream.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/ice_cream.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/ice_cream.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='pizza'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pizza.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pizza.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pizza.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pizza.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pizza.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='pub'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pub.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pub.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pub.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pub.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/pub.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='restaurant'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/restaurant.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/restaurant.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/restaurant.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/restaurant.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/food\/restaurant.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='atm'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/atm.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/atm.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/atm.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/atm.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/atm.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='bank'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/bank.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/bank.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/bank.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/bank.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/bank.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='currency_exchange'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/currency_exchange.glow.AC39AC.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/currency_exchange.glow.AC39AC.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/currency_exchange.glow.AC39AC.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/currency_exchange.glow.AC39AC.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/money\/currency_exchange.glow.AC39AC.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #AC39AC;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='parking'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking.n.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking.n.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking.n.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking.n.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='bicycle_parking'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking_bicycle.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking_bicycle.n.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking_bicycle.n.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking_bicycle.n.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/parking_bicycle.n.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#leisure[leisure='slipway'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/slipway.glow.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/slipway.glow.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/slipway.glow.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/slipway.glow.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/slipway.glow.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#amenity[amenity='taxi'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/taxi_rank.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/taxi_rank.n.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/taxi_rank.n.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/taxi_rank.n.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/taxi_rank.n.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#aeroway[aeroway='gate'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_gate.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_gate.n.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_gate.n.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_gate.n.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_gate.n.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#aeroway[aeroway='terminal'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_terminal.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_terminal.n.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_terminal.n.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_terminal.n.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/airport_terminal.n.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#aeroway[aeroway='helipad'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/helicopter_pad.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/helicopter_pad.n.0092DA.16.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 10;\n text-dy: 12;\n }\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/helicopter_pad.n.0092DA.20.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 11;\n text-dy: 14;\n }\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/helicopter_pad.n.0092DA.24.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 75;\n text-halo-radius: 1.5;\n text-size: 12;\n text-dy: 18;\n }\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/helicopter_pad.n.0092DA.32.png');\n ::label {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Bold\";\n text-fill: #0092DA;\n text-placement: point;\n text-wrap-width: 100;\n text-halo-radius: 1.5;\n text-size: 13;\n text-dy: 20;\n }\n }\n}\n\n[zoom > 16] .poi#highway_poi[highway='bus_stop'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/bus_stop.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/bus_stop.n.0092DA.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/bus_stop.n.0092DA.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/bus_stop.n.0092DA.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/bus_stop.n.0092DA.32.png');\n }\n}\n\n[zoom > 16] .poi#highway_poi[highway='ford'] {\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/ford.n.0092DA.12.png') }\n [zoom = 18] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/ford.n.0092DA.16.png');\n }\n [zoom = 19] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/ford.n.0092DA.20.png');\n }\n [zoom = 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/ford.n.0092DA.24.png');\n }\n [zoom > 20] {\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/ford.n.0092DA.32.png');\n }\n}\n\n[zoom > 16] .poi#highway_poi[highway='traffic_signals'] {\n point-allow-overlap: true;\n [zoom = 17] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/traffic_lights.glow.000000.16.png') }\n [zoom = 18] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/traffic_lights.glow.000000.20.png') }\n [zoom = 19] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/traffic_lights.glow.000000.24.png') }\n [zoom = 20] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/traffic_lights.glow.000000.24.png') }\n [zoom > 20] { point-file: url('\/usr\/share\/icons\/sjjb\/png\/transport\/traffic_lights.glow.000000.32.png') }\n}\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"CartoCSS"} {"commit":"134334bc132d0edd00b14564cebef34326dc244c","subject":"TextHandler: Simplify logic for tracking the rendering state","message":"TextHandler: Simplify logic for tracking the rendering state\n","repos":"music-encoding\/sibmei","old_file":"src\/TextHandler.mss","new_file":"src\/TextHandler.mss","new_contents":"function InitTextHandlers() {\n \/\/ QUESTION: We could also take an argument and throw all text handlers from\n \/\/ extensions into the same dictionary\n\n textHandlers = CreateDictionary(\n 'StyleId', CreateDictionary(),\n 'StyleAsText', CreateDictionary()\n );\n\n RegisterHandlers(textHandlers, CreateDictionary(\n 'StyleId', CreateDictionary(\n 'text.staff.expression', 'ExpressionTextHandler',\n 'text.system.page_aligned.title', 'PageTitleHandler',\n 'text.system.page_aligned.subtitle', 'PageTitleHandler',\n 'text.system.page_aligned.composer', 'PageComposerTextHandler',\n 'text.system.tempo', 'TempoTextHandler',\n 'text.staff.space.figuredbass', 'FiguredBassTextHandler',\n 'text.staff.plain', 'CreateAnchoredText'\n )\n ), Self);\n\n return textHandlers;\n} \/\/$end\n\nfunction InitTextSubstituteMap() {\n return CreateDictionary(\n 'Title', CreateSparseArray('Title'),\n 'Subtitle', CreateSparseArray('Title', CreateDictionary('type', 'subordinate')),\n \/\/ is only allowed on and , so use\n \/\/ generic element\n 'Dedication', CreateSparseArray('Seg', CreateDictionary('type', 'Dedication')),\n \/\/ , , , and \n \/\/ are only allowed in a few places, e.g. metadata or title pages.\n \/\/ We therfore use more generic elements\n 'Composer', CreateSparseArray('PersName', CreateDictionary('role', 'Composer')),\n 'Arranger', CreateSparseArray('PersName', CreateDictionary('role', 'Arranger')),\n 'Lyricist', CreateSparseArray('PersName', CreateDictionary('role', 'Lyricist')),\n 'Artist', CreateSparseArray('PersName', CreateDictionary('role', 'Artist')),\n \/\/ is only allowed on , so use generic element\n 'Copyright', CreateSparseArray('Seg', CreateDictionary('type', 'Copyright')),\n \/\/ is only allowed in a few places, so use generic element\n \/\/ We don't even know if it's a person or an institution\n 'Publisher', CreateSparseArray('Seg', CreateDictionary('type', 'Publisher')),\n 'MoreInfo', CreateSparseArray('Seg', CreateDictionary('type', 'MoreInfo')),\n 'PartName', CreateSparseArray('Seg', CreateDictionary('type', 'PartName'))\n );\n} \/\/$end\n\n\nfunction HandleText (textObject) {\n \/\/ Step through the different ID types ('StyleId' and 'StyleAsText') and\n \/\/ check for text handlers for this type\n textHandlers = Self._property:TextHandlers;\n for each Name idType in textHandlers\n {\n handlersForIdType = textHandlers.@idType;\n idValue = textObject.@idType;\n if(handlersForIdType.MethodExists(idValue))\n {\n return handlersForIdType.@idValue(textObject);\n }\n }\n} \/\/$end\n\n\nfunction ExpressionTextHandler (this, textObject) {\n dynam = GenerateControlEvent(textObject, 'Dynam');\n AddFormattedText(dynam, textObject);\n return dynam;\n} \/\/$end\n\n\nfunction PageTitleHandler (this, textObject) {\n anchoredText = libmei.AnchoredText();\n title = libmei.Title();\n if (textObject.StyleId = 'text.system.page_aligned.subtitle')\n {\n libmei.AddAttribute(title, 'type', 'subordinate');\n }\n\n libmei.AddChild(anchoredText, title);\n AddFormattedText(title, textObject);\n\n return anchoredText;\n} \/\/$end\n\n\nfunction PageComposerTextHandler (this, textObject) {\n \/\/ 'text.system.page_aligned.composer'\n anchoredText = libmei.AnchoredText();\n AddFormattedText(anchoredText, textObject);\n return anchoredText;\n} \/\/$end\n\n\nfunction TempoTextHandler (this, textObject) {\n \/\/ 'text.system.tempo'\n tempo = GenerateControlEvent(textObject, 'Tempo');\n AddFormattedText(tempo, textObject);\n return tempo;\n} \/\/$end\n\n\nfunction FiguredBassTextHandler (this, textObject) {\n \/\/ 'text.staff.space.figuredbass'\n harm = GenerateControlEvent(textObject, 'Harm');\n fb = libmei.Fb();\n libmei.AddChild(harm, fb);\n ConvertFbFigures(fb, textObject);\n return harm;\n} \/\/$end\n\n\nfunction CreateAnchoredText (this, textObj) {\n anchoredText = libmei.AnchoredText();\n AddFormattedText(anchoredText, textObj);\n return anchoredText;\n} \/\/$end\n\n\nfunction AddFormattedText (parentElement, textObj) {\n textWithFormatting = textObj.TextWithFormatting;\n if (textWithFormatting.NumChildren < 2 and CharAt(textWithFormatting[0], 0) != '\\\\')\n {\n \/\/ We have a simple text element without special style properties\n if (parentElement.name = 'div')\n {\n p = libmei.P();\n libmei.SetText(p, textObj.Text);\n libmei.AddChild(parentElement, p);\n }\n else\n {\n libmei.SetText(parentElement, textObj.Text);\n }\n return parentElement;\n }\n\n \/\/ At this point we know that we have text with style changes and\/or text\n \/\/ substitutions\n nodes = CreateSparseArray();\n\n state = CreateDictionary(\n 'currentText', null,\n 'style', CreateDictionary(),\n \/\/ TODO: Also track the active character style (mainly\n \/\/ `\\ctext.character.musictext\\`, and custom styles)\n 'meiNodes', nodes\n );\n\n for each component in textObj.TextWithFormatting\n {\n switch (Substring(component, 0, 2))\n {\n case ('\\\\n')\n {\n PushStyledText(state);\n nodes.Push(libmei.Lb());\n }\n case ('\\\\N')\n {\n PushStyledText(state);\n \/\/ TODO: Add

if it is allowed within parentElement (use libmei.GetName())\n nodes.Push(libmei.Lb());\n }\n case ('\\\\B')\n {\n SwitchTextStyle(state, 'fontweight', 'bold');\n }\n case ('\\\\b')\n {\n SwitchTextStyle(state, 'fontweight', 'normal');\n }\n case ('\\\\I')\n {\n SwitchTextStyle(state, 'fontstyle', 'italic');\n }\n case ('\\\\i')\n {\n SwitchTextStyle(state, 'fontstyle', 'normal');\n }\n case ('\\\\U')\n {\n SwitchTextStyle(state, 'underline', 'underline_on');\n }\n case ('\\\\u')\n {\n SwitchTextStyle(state, 'underline', 'underline_off');\n }\n case ('\\\\f')\n {\n font = GetTextCommandArg(component);\n if (font = '_')\n {\n ResetTextStyles(state);\n }\n else\n {\n SwitchTextStyle(state, 'fontfam', font);\n }\n }\n case ('\\\\c')\n {\n \/\/ TODO: Can we sensibly handle a character style change? The\n \/\/ only built-in one seem to be `text.character.musictext`. We\n \/\/ might want to allow Extensions to handle custom character\n \/\/ styles.\n ;\n }\n case ('\\\\s')\n {\n fontsize = ConvertOffsetsToMEI(GetTextCommandArg(component));\n SwitchTextStyle(state, 'fontsize', fontsize);\n }\n case ('\\\\v')\n {\n \/\/ Vertical scale change (vertical stretching). Probably not\n \/\/ possible to handle\n ;\n }\n case ('\\\\h')\n {\n \/\/ Horizontal scale change (horizontal stretching). Probably not\n \/\/ possible to handle\n ;\n }\n case ('\\\\t')\n {\n \/\/ Tracking. Probably not possible to handle.\n ;\n }\n case ('\\\\p')\n {\n SwitchTextStyle(state, 'baseline', GetTextCommandArg(component));\n }\n case ('\\\\$')\n {\n AppendTextSubstitute(state, GetTextCommandArg(component));\n }\n case ('\\\\\\\\')\n {\n \/\/ According to the documentation, 'backslashes themselves are\n \/\/ represented by \\\\ , to avoid conflicting with the above\n \/\/ commands'. Though Sibelius does not seem to allow inputting\n \/\/ this, let's still cover it in case Avid fixes this.\n\n \/\/ We strip one leading backspace.\n state.currentText = state.currentText & Substring(component, 1);\n }\n default\n {\n \/\/ This is regular text\n state.currentText = state.currentText & component;\n }\n }\n }\n\n PushStyledText(state);\n\n nodeCount = nodes.Length;\n precedingElement = null;\n\n nodeIndex = 0;\n while (nodeIndex < nodeCount)\n {\n node = nodes[nodeIndex];\n if (IsObject(node))\n {\n \/\/ We have an element\n libmei.AddChild(parentElement, node);\n precedingElement = node;\n }\n else\n {\n \/\/ We have a text node\n text = node;\n \/\/ If there are multiple adjacent text nodes, we need to join them\n while (nodeIndex < nodeCount and not IsObject(nodes[nodeIndex + 1]))\n {\n nodeIndex = nodeIndex + 1;\n text = text & nodes[nodeIndex];\n }\n\n if (precedingElement = null)\n {\n libmei.SetText(parentElement, text);\n }\n else\n {\n libmei.SetTail(precedingElement, text);\n }\n }\n nodeIndex = nodeIndex + 1;\n }\n} \/\/$end\n\n\nfunction GetTextCommandArg (command) {\n \/\/ Remove leading part, e.g. the '\\$' or '\\s' and trailing '\\'\n return Substring(command, 2, Length(command) - 3);\n} \/\/$end\n\n\nfunction ResetTextStyles (state) {\n textNotYetPushed = true;\n style = state.style;\n\n for each Name property in style\n {\n if (textNotYetPushed and null != style[property])\n {\n \/\/ Style changes because we reset this property from non-null value\n \/\/ to null. Therefore push the existing text with the old style\n \/\/ before resetting it.\n textNotYetPushed = false;\n PushStyledText(state);\n }\n style[property] = null;\n }\n} \/\/$end\n\n\nfunction SwitchTextStyle (state, property, value) {\n if (state.style[property] != value)\n {\n \/\/ Style changes, so append current text before modifying style state\n PushStyledText(state);\n }\n state.style[property] = value;\n} \/\/$end\n\n\nfunction PushStyledText (state) {\n if (state.currentText = '')\n {\n return null;\n }\n\n styleAttributes = GetStyleAttributes(state);\n if (null = styleAttributes)\n {\n \/\/ We attach unstyled text without wrapping it in \n state.meiNodes.Push(state.currentText);\n }\n else\n {\n rend = libmei.Rend();\n for each Name attName in styleAttributes\n {\n libmei.AddAttribute(rend, attName, styleAttributes[attName]);\n }\n libmei.SetText(rend, state.currentText);\n state.meiNodes.Push(rend);\n }\n\n state.currentText = '';\n} \/\/$end\n\n\nfunction GetStyleAttributes (state) {\n \/\/ Returns a dictionary with attribute names and values.\n \/\/ Returns null if there are no style attributes.\n\n style = state.style;\n styleAttributes = CreateDictionary();\n rendValues = CreateSparseArray();\n\n noStyles = true;\n\n for each Name property in state.style\n {\n value = style[property];\n switch (value)\n {\n case (null)\n {\n ; \/\/ Nothing to add\n }\n case ('underline_on')\n {\n rendValues.Push('underline');\n }\n case ('underline_off')\n {\n ; \/\/ Nothing to add\n }\n case ('normal') \/\/ baseline\n {\n ; \/\/ Nothing to add\n }\n case ('subscript')\n {\n rendValues.Push('sub');\n }\n case ('superscript')\n {\n rendValues.Push('sup');\n }\n default\n {\n noStyles = false;\n styleAttributes[property] = value;\n }\n }\n }\n\n if (rendValues.Length > 0)\n {\n noStyles = false;\n styleAttributes['rend'] = rendValues.Join(' ');\n }\n\n if (noStyles)\n {\n return null;\n }\n return styleAttributes;\n} \/\/$end\n\n\nfunction AppendTextSubstitute (state, substituteName) {\n score = Self._property:ActiveScore;\n\n textSubstituteTemplate = TextSubstituteMap[substituteName];\n if (null = textSubstituteTemplate)\n {\n \/\/ No known substitution. Sibelius renders those literally.\n state.currentText = state.currentText & '\\\\$' & substituteName & '\\\\';\n return null;\n }\n\n substitutedText = score.@substituteName;\n if (substitutedText = '')\n {\n return null;\n }\n\n PushStyledText(state);\n\n element = MeiFactory(textSubstituteTemplate);\n state.meiNodes.Push(element);\n\n styleAttributes = GetStyleAttributes(state);\n rendElement = null;\n if (null = styleAttributes)\n {\n libmei.SetText(element, substitutedText);\n }\n else\n {\n rendElement = libmei.Rend();\n libmei.AddChild(element, rendElement);\n for each Name attName in styleAttributes\n {\n libmei.AddAttribute(rendElement, attName, styleAttributes[attName]);\n }\n libmei.SetText(rendElement, substitutedText);\n }\n} \/\/$end\n","old_contents":"function InitTextHandlers() {\n \/\/ QUESTION: We could also take an argument and throw all text handlers from\n \/\/ extensions into the same dictionary\n\n textHandlers = CreateDictionary(\n 'StyleId', CreateDictionary(),\n 'StyleAsText', CreateDictionary()\n );\n\n RegisterHandlers(textHandlers, CreateDictionary(\n 'StyleId', CreateDictionary(\n 'text.staff.expression', 'ExpressionTextHandler',\n 'text.system.page_aligned.title', 'PageTitleHandler',\n 'text.system.page_aligned.subtitle', 'PageTitleHandler',\n 'text.system.page_aligned.composer', 'PageComposerTextHandler',\n 'text.system.tempo', 'TempoTextHandler',\n 'text.staff.space.figuredbass', 'FiguredBassTextHandler',\n 'text.staff.plain', 'CreateAnchoredText'\n )\n ), Self);\n\n return textHandlers;\n} \/\/$end\n\nfunction InitTextSubstituteMap() {\n return CreateDictionary(\n 'Title', CreateSparseArray('Title'),\n 'Subtitle', CreateSparseArray('Title', CreateDictionary('type', 'subordinate')),\n \/\/ is only allowed on and , so use\n \/\/ generic element\n 'Dedication', CreateSparseArray('Seg', CreateDictionary('type', 'Dedication')),\n \/\/ , , , and \n \/\/ are only allowed in a few places, e.g. metadata or title pages.\n \/\/ We therfore use more generic elements\n 'Composer', CreateSparseArray('PersName', CreateDictionary('role', 'Composer')),\n 'Arranger', CreateSparseArray('PersName', CreateDictionary('role', 'Arranger')),\n 'Lyricist', CreateSparseArray('PersName', CreateDictionary('role', 'Lyricist')),\n 'Artist', CreateSparseArray('PersName', CreateDictionary('role', 'Artist')),\n \/\/ is only allowed on , so use generic element\n 'Copyright', CreateSparseArray('Seg', CreateDictionary('type', 'Copyright')),\n \/\/ is only allowed in a few places, so use generic element\n \/\/ We don't even know if it's a person or an institution\n 'Publisher', CreateSparseArray('Seg', CreateDictionary('type', 'Publisher')),\n 'MoreInfo', CreateSparseArray('Seg', CreateDictionary('type', 'MoreInfo')),\n 'PartName', CreateSparseArray('Seg', CreateDictionary('type', 'PartName'))\n );\n} \/\/$end\n\n\nfunction HandleText (textObject) {\n \/\/ Step through the different ID types ('StyleId' and 'StyleAsText') and\n \/\/ check for text handlers for this type\n textHandlers = Self._property:TextHandlers;\n for each Name idType in textHandlers {\n handlersForIdType = textHandlers.@idType;\n idValue = textObject.@idType;\n if(handlersForIdType.MethodExists(idValue))\n {\n return handlersForIdType.@idValue(textObject);\n }\n }\n} \/\/$end\n\n\nfunction ExpressionTextHandler (this, textObject) {\n dynam = GenerateControlEvent(textObject, 'Dynam');\n AddFormattedText(dynam, textObject);\n return dynam;\n} \/\/$end\n\n\nfunction PageTitleHandler (this, textObject) {\n anchoredText = libmei.AnchoredText();\n title = libmei.Title();\n if (textObject.StyleId = 'text.system.page_aligned.subtitle')\n {\n libmei.AddAttribute(title, 'type', 'subordinate');\n }\n\n libmei.AddChild(anchoredText, title);\n AddFormattedText(title, textObject);\n\n return anchoredText;\n} \/\/$end\n\n\nfunction PageComposerTextHandler (this, textObject) {\n \/\/ 'text.system.page_aligned.composer'\n anchoredText = libmei.AnchoredText();\n AddFormattedText(anchoredText, textObject);\n return anchoredText;\n} \/\/$end\n\n\nfunction TempoTextHandler (this, textObject) {\n \/\/ 'text.system.tempo'\n tempo = GenerateControlEvent(textObject, 'Tempo');\n AddFormattedText(tempo, textObject);\n return tempo;\n} \/\/$end\n\n\nfunction FiguredBassTextHandler (this, textObject) {\n \/\/ 'text.staff.space.figuredbass'\n harm = GenerateControlEvent(textObject, 'Harm');\n fb = libmei.Fb();\n libmei.AddChild(harm, fb);\n ConvertFbFigures(fb, textObject);\n return harm;\n} \/\/$end\n\n\nfunction CreateAnchoredText (this, textObj) {\n anchoredText = libmei.AnchoredText();\n AddFormattedText(anchoredText, textObj);\n return anchoredText;\n} \/\/$end\n\n\nfunction AddFormattedText (parentElement, textObj) {\n textWithFormatting = textObj.TextWithFormatting;\n if (textWithFormatting.NumChildren < 2 and CharAt(textWithFormatting[0], 0) != '\\\\')\n {\n if (parentElement.name = 'div')\n {\n p = libmei.P();\n libmei.SetText(p, textObj.Text);\n libmei.AddChild(parentElement, p);\n }\n else\n {\n libmei.SetText(parentElement, textObj.Text);\n }\n return parentElement;\n }\n\n nodes = CreateSparseArray();\n\n state = CreateDictionary(\n 'currentText', null,\n 'rendAttributes', CreateDictionary(),\n 'rendFlags', CreateDictionary(),\n \/\/ TODO: Also track the active character style (mainly\n \/\/ `\\ctext.character.musictext\\`, and custom styles)\n 'nodes', nodes,\n 'paragraphs', null\n );\n\n for each component in textObj.TextWithFormatting\n {\n switch (Substring(component, 0, 2))\n {\n case ('\\\\n')\n {\n PushStyledText(state);\n nodes.Push(libmei.Lb());\n }\n case ('\\\\N')\n {\n PushStyledText(state);\n \/\/ TODO: Add

if it is allowed within parentElement (use libmei.GetName())\n nodes.Push(libmei.Lb());\n }\n case ('\\\\B')\n {\n SwitchTextStyle(state, 'fontweight', 'bold');\n }\n case ('\\\\b')\n {\n SwitchTextStyle(state, 'fontweight', 'normal');\n }\n case ('\\\\I')\n {\n SwitchTextStyle(state, 'fontstyle', 'italic');\n }\n case ('\\\\i')\n {\n SwitchTextStyle(state, 'fontstyle', 'normal');\n }\n case ('\\\\U')\n {\n SwitchTextStyle(state, 'rend', 'underline', true);\n }\n case ('\\\\u')\n {\n SwitchTextStyle(state, 'rend', 'underline', false);\n }\n case ('\\\\f')\n {\n SwitchFont(state, GetTextCommandArg(component));\n }\n case ('\\\\c')\n {\n \/\/ TODO: Can we sensibly handle a character style change? The\n \/\/ only built-in one seem to be `text.character.musictext`. We\n \/\/ might want to allow Extensions to handle custom character\n \/\/ styles.\n ;\n }\n case ('\\\\s')\n {\n fontsize = ConvertOffsetsToMEI(GetTextCommandArg(component));\n SwitchTextStyle(state, 'fontsize', fontsize);\n }\n case ('\\\\v')\n {\n \/\/ Vertical scale change (vertical stretching). Probably not\n \/\/ possible to handle\n ;\n }\n case ('\\\\h')\n {\n \/\/ Horizontal scale change (horizontal stretching). Probably not\n \/\/ possible to handle\n ;\n }\n case ('\\\\t')\n {\n \/\/ Tracking. Probably not possible to handle.\n ;\n }\n case ('\\\\p')\n {\n SwitchBaselineAdjust(state, GetTextCommandArg(component));\n }\n case ('\\\\$') {\n AppendTextSubstitute(state, GetTextCommandArg(component));\n }\n case ('\\\\\\\\')\n {\n \/\/ According to the documentation, 'backslashes themselves are\n \/\/ represented by \\\\ , to avoid conflicting with the above\n \/\/ commands'. Though that does not seem to work, let's just\n \/\/ assume it does in case Avid fixes this.\n\n \/\/ We strip one leading backspace.\n state.currentText = state.currentText & Substring(component, 1);\n }\n default\n {\n \/\/ This is regular text\n state.currentText = state.currentText & component;\n }\n }\n }\n\n PushStyledText(state);\n\n nodeCount = nodes.Length;\n precedingElement = null;\n\n nodeIndex = 0;\n while (nodeIndex < nodeCount)\n {\n node = nodes[nodeIndex];\n if (IsObject(node))\n {\n \/\/ We have an element\n libmei.AddChild(parentElement, node);\n precedingElement = node;\n }\n else\n {\n \/\/ We have a text node\n text = node;\n \/\/ If there are multiple adjacent text nodes, we need to join them\n while (nodeIndex < nodeCount and not IsObject(nodes[nodeIndex + 1])) {\n nodeIndex = nodeIndex + 1;\n text = text & nodes[nodeIndex];\n }\n\n if (precedingElement = null)\n {\n libmei.SetText(parentElement, text);\n }\n else\n {\n libmei.SetTail(precedingElement, text);\n }\n }\n nodeIndex = nodeIndex + 1;\n }\n} \/\/$end\n\n\nfunction NewTextParagraph (state) {\n \/\/ TODO!\n ;\n} \/\/$end\n\n\nfunction GetTextCommandArg (command) {\n \/\/ Remove leading part, e.g. the '\\$' or '\\s' and trailing '\\'\n return Substring(command, 2, Length(command) - 3);\n} \/\/$end\n\n\nfunction SwitchBaselineAdjust (state, param) {\n sup = (param = 'superscript');\n sub = (param = 'subscript');\n if (sup != state.rendFlags['sup'] or sub != state.rendFlags['sub']) {\n \/\/ Style changed, push the previous text before changing the style\n PushStyledText(state);\n }\n state.rendFlags['sup'] = sup;\n state.rendFlags['sub'] = sub;\n} \/\/$end\n\n\nfunction ResetTextStyles (state, infoOnly) {\n \/\/ If `infoOnly` is `true`, does not make any changes, only tells us if\n \/\/ there are re-settable styles\n if (null != state.rendAttributes)\n {\n for each Name attName in state.rendAttributes\n {\n if (infoOnly and state.rendAttributes[attName] != null)\n {\n return true;\n }\n state.rendAttributes[attName] = null;\n }\n }\n\n if (null != state.rendFlags)\n {\n for each Name flagName in state.rendFlags\n {\n if (infoOnly and state.rendFlags[flagName])\n {\n return true;\n }\n state.rendFlags[flagName] = false;\n }\n }\n return false;\n} \/\/$end\n\n\nfunction SwitchFont (state, fontName) {\n if (fontName = '_')\n {\n \/\/ Before resetting the style, we have to add text preceding the '\\f_\\'\n \/\/ style reset \u2013 but only if the style reset actually changes something.\n if (ResetTextStyles(state, true))\n {\n PushStyledText(state);\n ResetTextStyles(state, false);\n }\n }\n else\n {\n SwitchTextStyle(state, 'fontfam', fontName);\n }\n} \/\/$end\n\n\nfunction SwitchTextStyle (state, attName, value) {\n if (state.rendAttributes[attName] != value)\n {\n \/\/ Style changes, so append current text before modifying style state\n PushStyledText(state);\n }\n state.rendAttributes[attName] = value;\n} \/\/$end\n\n\nfunction SwitchRendFlags (state, flagName, value) {\n if (state.rendFlags[flagName] != value)\n {\n PushStyledText(state);\n }\n state.rendFlags[flagName] = value;\n} \/\/$end\n\n\nfunction PushStyledText (state) {\n if (state.currentText = '')\n {\n return null;\n }\n\n styleAttributes = GetStyleAttributes(state);\n if (null = styleAttributes)\n {\n \/\/ We attach unstyled text without wrapping it in \n state.nodes.Push(state.currentText);\n }\n else\n {\n rend = libmei.Rend();\n for each Name attName in styleAttributes {\n libmei.AddAttribute(rend, attName, styleAttributes[attName]);\n }\n libmei.SetText(rend, state.currentText);\n state.nodes.Push(rend);\n }\n\n state.currentText = '';\n} \/\/$end\n\n\nfunction GetStyleAttributes (state) {\n rendAttributes = null;\n\n if (null != state.rendAttributes)\n {\n for each Name attName in state.rendAttributes\n {\n value = state.rendAttributes[attName];\n if (null != value)\n {\n if (null = rendAttributes) {\n rendAttributes = CreateDictionary();\n }\n rendAttributes[attName] = value;\n }\n }\n }\n\n if (null != state.rendFlags)\n {\n rendAttValue = '';\n firstRendFlag = true;\n for each Name flagName in state.rendFlags\n {\n flagActive = state.rendFlags[flagName];\n if (flagActive)\n {\n if (firstRendFlag = true)\n {\n rendAttValue = rendAttValue & flagName;\n firstRendFlag = false;\n }\n else\n {\n rendAttValue = rendAttValue & ' ' & flagName;\n }\n }\n }\n if (rendAttValue != '')\n {\n if (null = rendAttributes) {\n rendAttributes = CreateDictionary();\n }\n rendAttributes['rend'] = rendAttValue;\n }\n }\n\n return rendAttributes;\n} \/\/$end\n\n\nfunction AppendTextSubstitute (state, substituteName) {\n score = Self._property:ActiveScore;\n\n textSubstituteInfo = TextSubstituteMap[substituteName];\n if (null = textSubstituteInfo)\n {\n \/\/ No known substitution. Sibelius renders those literally.\n state.currentText = state.currentText & '\\\\$' & substituteName & '\\\\';\n return null;\n }\n\n substitutedText = score.@substituteName;\n if (substitutedText = '') {\n return null;\n }\n\n element = MeiFactory(textSubstituteInfo);\n state.nodes.Push(element);\n\n styleAttributes = GetStyleAttributes(state);\n rendElement = null;\n if (null = styleAttributes)\n {\n libmei.SetText(element, substitutedText);\n }\n else\n {\n rendElement = libmei.Rend();\n libmei.AddChild(element, rendElement);\n for each Name attName in styleAttributes\n {\n libmei.AddAttribute(rendElement, attName, styleAttributes[attName]);\n }\n libmei.SetText(rendElement, substitutedText);\n }\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"51b3c216136b85e29a6d09c888b359b2b66a1eb0","subject":"Lighten green footpaths slightly","message":"Lighten green footpaths slightly\n","repos":"gregrs-uk\/gb-leisure-carto,gregrs-uk\/gb-leisure-carto","old_file":"style.mss","new_file":"style.mss","new_contents":"\/\/ https:\/\/github.com\/gregrs-uk\/gb-leisure-carto\/\n\nMap {\n background-color: white;\n}\n\n#landuse {\n [natural='woodland'], \n [natural='wood'],\n [landuse='forest'] {\n polygon-fill:#cfc;\n }\n [landuse='residential'], [landuse='industrial'],\n [landuse='retail'], [landuse='commercial'],\n [landuse='farmyard'] {\n polygon-fill:#f0f0f0;\n }\n}\n\n#water {\n \/\/ natural=water and waterway=riverbank\n polygon-fill:#eff;\n line-width:1;\n line-color:#bcf;\n}\n\n#waterways {\n [waterway='stream'],[waterway='drain'],[waterway='ditch'] {\n line-width:1;\n line-color:#bcf;\n }\n [waterway='river'],[waterway='canal'] {\n ::outer {\n line-width:4;\n line-color:#bcf;\n line-cap:round;\n line-join:bevel;\n }\n ::inner {\n line-width:2;\n line-color:#eff;\n line-cap:round;\n line-join:bevel;\n }\n }\n}\n\n@motorway_width: 4;\n@primary_width: 3;\n@secondary_width: 3;\n@minor_width: 2;\n@outer_width: 1;\n\n#roads {\n ::outer {\n line-cap:round;\n line-join:bevel;\n [highway='motorway'],[highway='motorway_link'] {\n line-width:@motorway_width+@outer_width;\n }\n [highway='trunk'],[highway='trunk_link'],\n [highway='primary'],[highway='primary_link'] {\n line-width:@primary_width+@outer_width;\n line-color:#700;\n }\n [highway='secondary'],[highway='secondary_link'] {\n line-width:@secondary_width+@outer_width;\n line-color:#910;\n }\n [highway='tertiary'],[highway='tertiary_link'] {\n line-width:@secondary_width+@outer_width;\n line-color:#aa0;\n }\n [highway='unclassified'],[highway='residential'] {\n line-width:@minor_width+@outer_width;\n line-color:#333;\n }\n [highway='service'],\n [highway='track'][tracktype='grade1'],\n [highway='track'][tracktype='grade2'] {\n line-width:@minor_width+@outer_width;\n line-color:#aaa;\n }\n [highway='track'][tracktype!='grade1'][tracktype!='grade2'] {\n line-width:@minor_width+@outer_width;\n line-color:#aaa;\n line-dasharray:6,2;\n line-cap:butt;\n }\n }\n\n ::inner {\n line-cap:round;\n line-join:bevel;\n line-color:white;\n [highway='motorway'],[highway='motorway_link'] {\n line-width:@motorway_width;\n line-color:blue;\n }\n [highway='trunk'],[highway='trunk_link'],\n [highway='primary'],[highway='primary_link'] {\n line-width:@primary_width;\n line-color:#f99;\n }\n [highway='secondary'],[highway='secondary_link'] {\n line-width:@secondary_width;\n line-color:#fb4;\n }\n [highway='tertiary'],[highway='tertiary_link'] {\n line-width:@secondary_width;\n line-color:#ff5;\n }\n [highway='unclassified'],[highway='residential'],\n [highway='service'],[highway='track'] {\n line-width:@minor_width;\n }\n }\n}\n\n#railway {\n line-width:1;\n line-color:black;\n line-cap:butt;\n line-join:bevel;\n}\n\n#buildings {\n polygon-fill:#eb6;\n}\n\n#paths {\n \/\/ from db: highway=footway\/bridleway\/cycleway\n \/\/ or anything with designation tag set\n line-width: 1.5;\n line-color:#999;\n line-dasharray:4,2;\n line-cap:butt;\n line-join:bevel;\n \/\/ probably public rights of way but no designation set\n [foot='designated'],[access='designated'],\n [foot='permissive'],[access='permissive'],\n [foot='yes'],[access='yes'] {\n line-color: #0a0;\n }\n \/\/ override colour if designation is explicitly set\n [designation='public_footpath'] {\n line-color: #f70;\n }\n [designation='public_bridleway'] {\n line-color: #66f;\n }\n [designation='restricted_byway'] {\n line-color: purple;\n }\n [designation='byway_open_to_all_traffic'] {\n line-color: red;\n }\n}\n\n#boundaries {\n line-width:0.5;\n [barrier='fence'] { line-color:#b83; }\n [barrier='hedge'] { line-color:#7b7; }\n [barrier='wall'] { line-color:#999; }\n}\n\n#contours {\n line-width:0.5;\n line-color:#f0f;\n line-opacity:0.8;\n line-cap:butt;\n line-dasharray:1,1;\n}\n\n#labels {\n text-name:[name];\n text-face-name:'Arial Regular';\n text-halo-fill: white; \/\/fadeout(white,40%);\n text-size:8pt;\n text-halo-radius:1.5;\n text-fill: black; \/\/#777;\n text-opacity:0.3;\n [place='city'] {\n text-size:35pt;\n }\n [place='town'] {\n text-size:28pt;\n }\n [place='suburb'],[place='neighbourhood']\n {\n text-size:21pt;\n }\n [place='village'],[place='hamlet'],\n [place='island'] {\n text-size:14pt;\n }\n}\n\n#grid {\n line-color:cyan;\n line-width:0.5;\n line-opacity:0.25;\n}\n","old_contents":"\/\/ https:\/\/github.com\/gregrs-uk\/gb-leisure-carto\/\n\nMap {\n background-color: white;\n}\n\n#landuse {\n [natural='woodland'], \n [natural='wood'],\n [landuse='forest'] {\n polygon-fill:#cfc;\n }\n [landuse='residential'], [landuse='industrial'],\n [landuse='retail'], [landuse='commercial'],\n [landuse='farmyard'] {\n polygon-fill:#f0f0f0;\n }\n}\n\n#water {\n \/\/ natural=water and waterway=riverbank\n polygon-fill:#eff;\n line-width:1;\n line-color:#bcf;\n}\n\n#waterways {\n [waterway='stream'],[waterway='drain'],[waterway='ditch'] {\n line-width:1;\n line-color:#bcf;\n }\n [waterway='river'],[waterway='canal'] {\n ::outer {\n line-width:4;\n line-color:#bcf;\n line-cap:round;\n line-join:bevel;\n }\n ::inner {\n line-width:2;\n line-color:#eff;\n line-cap:round;\n line-join:bevel;\n }\n }\n}\n\n@motorway_width: 4;\n@primary_width: 3;\n@secondary_width: 3;\n@minor_width: 2;\n@outer_width: 1;\n\n#roads {\n ::outer {\n line-cap:round;\n line-join:bevel;\n [highway='motorway'],[highway='motorway_link'] {\n line-width:@motorway_width+@outer_width;\n }\n [highway='trunk'],[highway='trunk_link'],\n [highway='primary'],[highway='primary_link'] {\n line-width:@primary_width+@outer_width;\n line-color:#700;\n }\n [highway='secondary'],[highway='secondary_link'] {\n line-width:@secondary_width+@outer_width;\n line-color:#910;\n }\n [highway='tertiary'],[highway='tertiary_link'] {\n line-width:@secondary_width+@outer_width;\n line-color:#aa0;\n }\n [highway='unclassified'],[highway='residential'] {\n line-width:@minor_width+@outer_width;\n line-color:#333;\n }\n [highway='service'],\n [highway='track'][tracktype='grade1'],\n [highway='track'][tracktype='grade2'] {\n line-width:@minor_width+@outer_width;\n line-color:#aaa;\n }\n [highway='track'][tracktype!='grade1'][tracktype!='grade2'] {\n line-width:@minor_width+@outer_width;\n line-color:#aaa;\n line-dasharray:6,2;\n line-cap:butt;\n }\n }\n\n ::inner {\n line-cap:round;\n line-join:bevel;\n line-color:white;\n [highway='motorway'],[highway='motorway_link'] {\n line-width:@motorway_width;\n line-color:blue;\n }\n [highway='trunk'],[highway='trunk_link'],\n [highway='primary'],[highway='primary_link'] {\n line-width:@primary_width;\n line-color:#f99;\n }\n [highway='secondary'],[highway='secondary_link'] {\n line-width:@secondary_width;\n line-color:#fb4;\n }\n [highway='tertiary'],[highway='tertiary_link'] {\n line-width:@secondary_width;\n line-color:#ff5;\n }\n [highway='unclassified'],[highway='residential'],\n [highway='service'],[highway='track'] {\n line-width:@minor_width;\n }\n }\n}\n\n#railway {\n line-width:1;\n line-color:black;\n line-cap:butt;\n line-join:bevel;\n}\n\n#buildings {\n polygon-fill:#eb6;\n}\n\n#paths {\n \/\/ from db: highway=footway\/bridleway\/cycleway\n \/\/ or anything with designation tag set\n line-width: 1.5;\n line-color:#999;\n line-dasharray:4,2;\n line-cap:butt;\n line-join:bevel;\n \/\/ probably public rights of way but no designation set\n [foot='designated'],[access='designated'],\n [foot='permissive'],[access='permissive'],\n [foot='yes'],[access='yes'] {\n line-color: green;\n }\n \/\/ override colour if designation is explicitly set\n [designation='public_footpath'] {\n line-color: #f70;\n }\n [designation='public_bridleway'] {\n line-color: #66f;\n }\n [designation='restricted_byway'] {\n line-color: purple;\n }\n [designation='byway_open_to_all_traffic'] {\n line-color: red;\n }\n}\n\n#boundaries {\n line-width:0.5;\n [barrier='fence'] { line-color:#b83; }\n [barrier='hedge'] { line-color:#7b7; }\n [barrier='wall'] { line-color:#999; }\n}\n\n#contours {\n line-width:0.5;\n line-color:#f0f;\n line-opacity:0.8;\n line-cap:butt;\n line-dasharray:1,1;\n}\n\n#labels {\n text-name:[name];\n text-face-name:'Arial Regular';\n text-halo-fill: white; \/\/fadeout(white,40%);\n text-size:8pt;\n text-halo-radius:1.5;\n text-fill: black; \/\/#777;\n text-opacity:0.3;\n [place='city'] {\n text-size:35pt;\n }\n [place='town'] {\n text-size:28pt;\n }\n [place='suburb'],[place='neighbourhood']\n {\n text-size:21pt;\n }\n [place='village'],[place='hamlet'],\n [place='island'] {\n text-size:14pt;\n }\n}\n\n#grid {\n line-color:cyan;\n line-width:0.5;\n line-opacity:0.25;\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"CartoCSS"} {"commit":"913f971d2ab5d8370a6c32b8b760cb101b5c3a10","subject":"Remove unused 'campus' style.","message":"Remove unused 'campus' style.\n\nThis functionality is handled by the landuse layer instead. Fixes #5.\n","repos":"pinkflozd\/osm-bright,jeffaudi\/osm-hybrid,Sweetymeow\/osm-bright,brelevenix\/osm-bright-tregor,silph-io\/osm-silph,makinacorpus\/osm-makina,raumobil\/osm-bright,mapbox\/osm-bright,saydulk\/osm-bright,yohanboniface\/osm-bright","old_file":"osm-bright\/base.mss","new_file":"osm-bright\/base.mss","new_contents":"\/* BASE.MSS CONTENTS\n * - Landuse & landcover\n * - Water areas\n * - Water ways\n * - Administrative Boundaries\n *\n *\/\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER\n\/* ================================================================== *\/\n\n#land[zoom>=0][zoom<6],\n#shoreline_300[zoom>=6][zoom<10],\n#processed_p[zoom>=10] {\n polygon-fill: @land;\n polygon-gamma: 0.75;\n}\n\n#landuse_gen0[zoom>3][zoom<=9],\n#landuse_gen1[zoom>9][zoom<=12],\n#landuse[zoom>12] {\n [type='cemetery'] { polygon-fill: @cemetery; }\n [type='college'] { polygon-fill: @school; }\n [type='commercial'] { polygon-fill: @industrial; }\n [type='forest'] { polygon-fill: @forest; }\n [type='golf_course'] { polygon-fill: @park; }\n [type='grass'] { polygon-fill: @park; }\n [type='hospital'] { polygon-fill: @hospital; }\n [type='industrial'] { polygon-fill: @industrial; }\n [type='park'] { polygon-fill: @park; }\n [type='parking'] { polygon-fill: @parking; }\n [type='pedestrian'] { polygon-fill: @pedestrian_fill; }\n [type='pitch'] { polygon-fill: @sports; }\n [type='residential'] { polygon-fill: @residential; }\n [type='school'] { polygon-fill: @school; }\n [type='sports_center'] { polygon-fill: @sports; }\n [type='stadium'] { polygon-fill: @sports; }\n [type='university'] { polygon-fill: @school; }\n [type='wood'] { polygon-fill: @forest; }\n}\n\n#landuse_overlays[type='nature_reserve'][zoom>6] {\n line-color: darken(@forest,25%);\n line-opacity: 0.3;\n line-dasharray: 1,1;\n polygon-fill: darken(@forest,25%);\n polygon-opacity: 0.1;\n [zoom=7] { line-width: 0.4; }\n [zoom=8] { line-width: 0.6; }\n [zoom=9] { line-width: 0.8; }\n [zoom=10] { line-width: 1.0; }\n [zoom=11] { line-width: 1.5; }\n [zoom>=12] { line-width: 2.0; }\n}\n\n\/* ---- BUILDINGS ---- *\/\n#buildings[zoom>10][zoom<=16] {\n polygon-fill:@building;\n [zoom>13] {\n line-color:darken(@building,5);\n line-width:0.2;\n }\n [zoom>15] {\n line-color:darken(@building,10);\n line-width:0.4;\n }\n}\n\/* At the highest zoom levels, render buildings in fancy pseudo-3D *\/\n#buildings[zoom>=17] {\n building-fill:@building;\n building-height:1.25;\n}\n\n\/* ================================================================== *\/\n\/* WATER AREAS\n\/* ================================================================== *\/\n\nMap { background-color: @water; }\n\n#water_gen0[zoom>3][zoom<=9],\n#water_gen1[zoom>9][zoom<=12],\n#water[zoom>12] {\n polygon-fill: @water;\n}\n\n\/* ================================================================== *\/\n\/* WATER WAYS\n\/* ================================================================== *\/\n\n#waterway[type='river'][zoom>5] {\n line-color: @water;\n [zoom=6] { line-width: 0.15; }\n [zoom=7] { line-width: 0.25; }\n [zoom=8] { line-width: 0.5; }\n [zoom=9] { line-width: 1; }\n [zoom=10]{ line-width: 1; }\n [zoom>10]{\n line-cap: round;\n line-join: round;\n }\n [zoom=11]{ line-width: 2; }\n [zoom=12]{ line-width: 2; }\n [zoom=13]{ line-width: 3; }\n [zoom=14]{ line-width: 3; }\n [zoom=15]{ line-width: 4; }\n [zoom=16]{ line-width: 5; }\n [zoom=17]{ line-width: 6; }\n [zoom>17]{ line-width: 7; }\n}\n\n#waterway[type='stream'][zoom>9] {\n line-color: @water;\n [zoom=10]{ line-width: 0.5; }\n [zoom=11]{ line-width: 0.5; }\n [zoom=12]{ line-width: 1; }\n [zoom=13]{ line-width: 1; }\n [zoom>13]{\n line-width: 2;\n line-join: round;\n line-cap: round;\n }\n}\n\n#waterway[type='canal'][zoom>9] {\n line-color: @water;\n [zoom=10]{ line-width: 0.5; }\n [zoom=11]{ line-width: 0.5; }\n [zoom=12]{ line-width: 1; }\n [zoom=13]{ line-width: 1; }\n [zoom>13]{\n line-cap: round;\n line-join: round;\n } \n [zoom=14]{ line-width: 2; }\n [zoom=15]{ line-width: 4; }\n [zoom=16]{ line-width: 8; }\n [zoom=17]{ line-width: 16; }\n [zoom>17]{ line-width: 30; }\n}\n\n\/* == 7. ADMINISTRATIVE BOUNDARIES ================================== *\/\n\n#admin[admin_level=2][zoom>1] {\n line-color:@admin_2;\n line-width:0.5;\n [zoom=2] { line-opacity: 0.25; }\n [zoom=3] { line-opacity: 0.3; }\n [zoom=4] { line-opacity: 0.4; }\n}\n\n\/* ****************************************************************** *\/\n","old_contents":"\/* BASE.MSS CONTENTS\n * - Landuse & landcover\n * - Water areas\n * - Water ways\n * - Administrative Boundaries\n *\n *\/\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER\n\/* ================================================================== *\/\n\n#land[zoom>=0][zoom<6],\n#shoreline_300[zoom>=6][zoom<10],\n#processed_p[zoom>=10] {\n polygon-fill: @land;\n polygon-gamma: 0.75;\n}\n\n#landuse_gen0[zoom>3][zoom<=9],\n#landuse_gen1[zoom>9][zoom<=12],\n#landuse[zoom>12] {\n [type='cemetery'] { polygon-fill: @cemetery; }\n [type='college'] { polygon-fill: @school; }\n [type='commercial'] { polygon-fill: @industrial; }\n [type='forest'] { polygon-fill: @forest; }\n [type='golf_course'] { polygon-fill: @park; }\n [type='grass'] { polygon-fill: @park; }\n [type='hospital'] { polygon-fill: @hospital; }\n [type='industrial'] { polygon-fill: @industrial; }\n [type='park'] { polygon-fill: @park; }\n [type='parking'] { polygon-fill: @parking; }\n [type='pedestrian'] { polygon-fill: @pedestrian_fill; }\n [type='pitch'] { polygon-fill: @sports; }\n [type='residential'] { polygon-fill: @residential; }\n [type='school'] { polygon-fill: @school; }\n [type='sports_center'] { polygon-fill: @sports; }\n [type='stadium'] { polygon-fill: @sports; }\n [type='university'] { polygon-fill: @school; }\n [type='wood'] { polygon-fill: @forest; }\n}\n\n#landuse_overlays[type='nature_reserve'][zoom>6] {\n line-color: darken(@forest,25%);\n line-opacity: 0.3;\n line-dasharray: 1,1;\n polygon-fill: darken(@forest,25%);\n polygon-opacity: 0.1;\n [zoom=7] { line-width: 0.4; }\n [zoom=8] { line-width: 0.6; }\n [zoom=9] { line-width: 0.8; }\n [zoom=10] { line-width: 1.0; }\n [zoom=11] { line-width: 1.5; }\n [zoom>=12] { line-width: 2.0; }\n}\n\n\/* Note that amenity=school, amenity=hospital, etc are ideally polygons of the\n *campus*, but are occasionally applied to the physical building instead. *\/\n@campus: #ECF;\n#campus[zoom>10] {\n polygon-opacity:0.2;\n polygon-fill:@campus;\n [zoom>12] {\n line-opacity:0.4;\n line-color:spin(darken(@campus,20),20);\n }\n [zoom=13] { line-width:0.3; }\n [zoom=14] { line-width:0.5; }\n [zoom=15] { line-width:0.7; }\n [zoom=16] { line-width:0.8; }\n [zoom=17] { line-width:0.9; }\n [zoom=18] { line-width:1.0; }\n}\n\n\/* ---- BUILDINGS ---- *\/\n#buildings[zoom>10][zoom<=16] {\n polygon-fill:@building;\n [zoom>13] {\n line-color:darken(@building,5);\n line-width:0.2;\n }\n [zoom>15] {\n line-color:darken(@building,10);\n line-width:0.4;\n }\n}\n\/* At the highest zoom levels, render buildings in fancy pseudo-3D *\/\n#buildings[zoom>=17] {\n building-fill:@building;\n building-height:1.25;\n}\n\n\/* ================================================================== *\/\n\/* WATER AREAS\n\/* ================================================================== *\/\n\nMap { background-color: @water; }\n\n#water_gen0[zoom>3][zoom<=9],\n#water_gen1[zoom>9][zoom<=12],\n#water[zoom>12] {\n polygon-fill: @water;\n}\n\n\/* ================================================================== *\/\n\/* WATER WAYS\n\/* ================================================================== *\/\n\n#waterway[type='river'][zoom>5] {\n line-color: @water;\n [zoom=6] { line-width: 0.15; }\n [zoom=7] { line-width: 0.25; }\n [zoom=8] { line-width: 0.5; }\n [zoom=9] { line-width: 1; }\n [zoom=10]{ line-width: 1; }\n [zoom>10]{\n line-cap: round;\n line-join: round;\n }\n [zoom=11]{ line-width: 2; }\n [zoom=12]{ line-width: 2; }\n [zoom=13]{ line-width: 3; }\n [zoom=14]{ line-width: 3; }\n [zoom=15]{ line-width: 4; }\n [zoom=16]{ line-width: 5; }\n [zoom=17]{ line-width: 6; }\n [zoom>17]{ line-width: 7; }\n}\n\n#waterway[type='stream'][zoom>9] {\n line-color: @water;\n [zoom=10]{ line-width: 0.5; }\n [zoom=11]{ line-width: 0.5; }\n [zoom=12]{ line-width: 1; }\n [zoom=13]{ line-width: 1; }\n [zoom>13]{\n line-width: 2;\n line-join: round;\n line-cap: round;\n }\n}\n\n#waterway[type='canal'][zoom>9] {\n line-color: @water;\n [zoom=10]{ line-width: 0.5; }\n [zoom=11]{ line-width: 0.5; }\n [zoom=12]{ line-width: 1; }\n [zoom=13]{ line-width: 1; }\n [zoom>13]{\n line-cap: round;\n line-join: round;\n } \n [zoom=14]{ line-width: 2; }\n [zoom=15]{ line-width: 4; }\n [zoom=16]{ line-width: 8; }\n [zoom=17]{ line-width: 16; }\n [zoom>17]{ line-width: 30; }\n}\n\n\/* == 7. ADMINISTRATIVE BOUNDARIES ================================== *\/\n\n#admin[admin_level=2][zoom>1] {\n line-color:@admin_2;\n line-width:0.5;\n [zoom=2] { line-opacity: 0.25; }\n [zoom=3] { line-opacity: 0.3; }\n [zoom=4] { line-opacity: 0.4; }\n}\n\n\/* ****************************************************************** *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"4b0695b99eaa25b7bfed8c61d5a62cb74a187d33","subject":"landcover and color weaks","message":"landcover and color weaks\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"map.mss","new_file":"map.mss","new_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999;\n@color_transport_casing: #ddd;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc;\n@color_transport_minor: #ccc;\n@color_transport_rail: #444;\n@color_transport_path: #ededed;\n@color_building: #cdd;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: @color_transport;\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_green_areas: darken(#c0d3b5,20);\n\nMap {\n background-color: @color_physical;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n \/* lighten background color, as we decrease landcover opacity *\/\n [zoom>=12] {\n polygon-fill: lighten(@color_physical,20);\n }\n [zoom>=14] {\n polygon-fill: lighten(@color_physical,40);\n }\n\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_10m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{\n \/\/line-width: 0.5;\n line-color: @color_water;\n polygon-fill: @color_water;\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.5;\n\n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.3;\n }\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [zoom>=15] {\n line-color: @color_airport_runways_detail;\n }\n\n [type='runway'] {\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{\n [zoom>=9] {\n ::outline {\n line-width: 4.25;\n }\n\n line-width: 1.5;\n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 2.5;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 42;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 49;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n [zoom<=12] {\n line-color: @color_transport;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n line-width: 1.5;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 17;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 0.2;\n }\n\n [zoom>=13] {\n line-width: 0.4;\n }\n\n [zoom>=14] {\n line-width: 0.8;\n }\n\n [zoom>=15] {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 9;\n line-dasharray: 4,7;\n }\n\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 6;\n }\n\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n ::casing {\n line-color: @color_transport_path;\n }\n\n line-color: @color_transport_casing;\n\n [zoom>=15] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 1.5;\n line-cap: butt;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 3;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n.landcoverraster {\n raster-opacity:1;\n raster-scaling:gaussian;\n\n \/* blur landcover as it becomes too pixelated *\/\n\/*\n [zoom>=10] {\n image-filters: agg-stack-blur(5,5);\n }\n [zoom>=12] {\n image-filters: agg-stack-blur(10,10);\n opacity: 0.8;\n }\n [zoom>=14] {\n image-filters: agg-stack-blur(20,20);\n opacity: 0.6;\n }\n*\/\n}\n","old_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999;\n@color_transport_casing: #ddd;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc;\n@color_transport_minor: #ccc;\n@color_transport_rail: #444;\n@color_transport_path: #ededed;\n@color_building: #cdd;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: @color_transport;\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_green_areas: darken(#c0d3b5,20);\n\nMap {\n background-color: @color_physical;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_10m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{\n \/\/line-width: 0.5;\n line-color: @color_water;\n polygon-fill: @color_water;\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-fill: @color_green_areas;\n \n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.5;\n }\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [zoom>=15] {\n line-color: @color_airport_runways_detail;\n }\n\n [type='runway'] {\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{\n [zoom>=9] {\n ::outline {\n line-width: 4.25;\n }\n\n line-width: 1.5;\n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 2.5;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 42;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 49;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n [zoom<=12] {\n line-color: @color_transport;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n line-width: 1.5;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 17;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 0.2;\n }\n\n [zoom>=13] {\n line-width: 0.4;\n }\n\n [zoom>=14] {\n line-width: 0.8;\n }\n\n [zoom>=15] {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 9;\n line-dasharray: 4,7;\n }\n\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 6;\n }\n\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n ::casing {\n line-color: @color_transport_path;\n }\n\n line-color: @color_transport_casing;\n\n [zoom>=15] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 1.5;\n line-cap: butt;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 3;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n.landcoverraster {\n raster-opacity:1;\n raster-scaling:gaussian;\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"410bdaae63e01c84fa9b47676e6342040d55060f","subject":"pinker city & town colors, town halos","message":"pinker city & town colors, town halos\n","repos":"stepankuzmin\/osm-bright-2.tm2,mystand\/osm-bright-2.tm2,lrqdo\/osm-bright.tm2","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@sans: 'Source Sans Pro Regular';\n@sans_md: 'Source Sans Pro Semibold';\n@Sand_bd: 'Source Sans Pro Bold';\n\n#place_label {\n [type='city'][zoom<=15] {\n text-name: @name;\n text-face-name: @sans_md;\n text-fill: #846;\n text-size: 16;\n text-wrap-width: 100;\n text-wrap-before: true;\n text-halo-fill: @land;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n [zoom>=10] { text-size: 18; }\n [zoom>=12] { text-size: 24; }\n }\n [type='town'][zoom<=17] {\n text-name: @name;\n text-face-name: 'Source Sans Pro Regular';\n text-fill: #867;\n text-size: 14;\n text-wrap-width: 100;\n text-halo-fill: @land;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-wrap-before: true;\n [zoom>=12] { text-size: 16; }\n [zoom>=14] { text-size: 18; }\n }\n [type='village'] {\n text-name: @name;\n text-face-name: 'Source Sans Pro Regular';\n text-fill: #444;\n text-size: 12;\n text-wrap-width: 100;\n text-wrap-before: true;\n [zoom>=12] { text-size: 14; }\n [zoom>=14] { text-size: 18; }\n }\n [type='hamlet'],\n [type='suburb'],\n [type='neighbourhood'] {\n text-name: @name;\n text-face-name: 'Source Sans Pro Semibold';\n text-fill: #a98;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-size: 10;\n text-wrap-width: 100;\n text-wrap-before: true;\n text-halo-fill: @land;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n [zoom>=14] { text-size: 11; }\n [zoom>=15] { text-size: 12; text-character-spacing: 2; }\n [zoom>=16] { text-size: 14; text-character-spacing: 3; }\n }\n}","old_contents":"@sans: 'Source Sans Pro Regular';\n@sans_md: 'Source Sans Pro Semibold';\n@Sand_bd: 'Source Sans Pro Bold';\n\n#place_label {\n [type='city'][zoom<=15] {\n text-name: @name;\n text-face-name: @sans_md;\n text-fill: #543;\n text-size: 16;\n text-wrap-width: 100;\n text-wrap-before: true;\n text-halo-fill: @land;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n [zoom>=10] { text-size: 18; }\n [zoom>=12] { text-size: 24; }\n }\n [type='town'][zoom<=17] {\n text-name: @name;\n text-face-name: 'Source Sans Pro Regular';\n text-fill: #333;\n text-size: 14;\n text-wrap-width: 100;\n text-wrap-before: true;\n [zoom>=12] { text-size: 16; }\n [zoom>=14] { text-size: 18; }\n }\n [type='village'] {\n text-name: @name;\n text-face-name: 'Source Sans Pro Regular';\n text-fill: #444;\n text-size: 12;\n text-wrap-width: 100;\n text-wrap-before: true;\n [zoom>=12] { text-size: 14; }\n [zoom>=14] { text-size: 18; }\n }\n [type='hamlet'],\n [type='suburb'],\n [type='neighbourhood'] {\n text-name: @name;\n text-face-name: 'Source Sans Pro Semibold';\n text-fill: #a98;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-size: 10;\n text-wrap-width: 100;\n text-wrap-before: true;\n text-halo-fill: @land;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n [zoom>=14] { text-size: 11; }\n [zoom>=15] { text-size: 12; text-character-spacing: 2; }\n [zoom>=16] { text-size: 14; text-character-spacing: 3; }\n }\n}","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"2b6c9280d400042ac473734a2a4d1d865a623503","subject":"Smaller width for roads at zoom 17 and 18","message":"Smaller width for roads at zoom 17 and 18","repos":"jeffaudi\/osm-hybrid","old_file":"osm-hybrid\/roads.mss","new_file":"osm-hybrid\/roads.mss","new_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n#roads_low[zoom>=7][zoom<=8] {\n [type='motorway'] { line-color: @motorway_line; line-width: 1; }\n [type='trunk'] { line-color: @trunk_line; line-width: 0.5; }\n}\n\n\/* At mid-level scales start to show primary and secondary routes\nas well. *\/\n\n#roads_med[zoom>=9][zoom<=10] {\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_line;\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_line;\n }\n [type='primary'] { line-color: @primary_line; }\n [type='secondary'] { line-color: @secondary_line; }\n [type='tertiary'] { line-color: @standard_line; }\n [zoom=9] {\n [type='motorway'],[type='trunk'] { line-width: 1.4; }\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.6; }\n }\n [zoom=10] {\n [type='motorway'],[type='trunk'] { line-width: 1.8; }\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.8; }\n }\n}\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 1.6; @rdz11_med: 0.8; @rdz11_min: 0.4;\n@rdz12_maj: 2.5; @rdz12_med: 1.2; @rdz12_min: 0.8;\n@rdz13_maj: 3; @rdz13_med: 1.5; @rdz13_min: 1;\n@rdz14_maj: 4; @rdz14_med: 2.5; @rdz14_min: 1.6;\n@rdz15_maj: 6; @rdz15_med: 4; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 12; @rdz17_med: 10; @rdz17_min: 8;\n@rdz18_maj: 14; @rdz18_med: 12; @rdz18_min: 10;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz11_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz12_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz13_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz14_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz15_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz15_min + 2; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 2; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz16_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz16_min + 2; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 2; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj + 3; }\n [stylegroup='mainroad'] { line-width: @rdz17_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz17_min + 2; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 4; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj + 4; }\n [stylegroup='mainroad'] { line-width: @rdz18_med + 4; }\n [stylegroup='minorroad']{ line-width: @rdz18_min + 3.5; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 6; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4; line-dasharray: 2,1; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4; line-dasharray: 2,2; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4; line-dasharray: 3,3; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","old_contents":"\/* ==================================================================\n ROAD & RAIL LINES\n\/* ================================================================== *\/\n\n\/* At lower zoomlevels, just show major automobile routes: motorways\nand trunks. *\/\n\n#roads_low[zoom>=7][zoom<=8] {\n [type='motorway'] { line-color: @motorway_line; line-width: 1; }\n [type='trunk'] { line-color: @trunk_line; line-width: 0.5; }\n}\n\n\/* At mid-level scales start to show primary and secondary routes\nas well. *\/\n\n#roads_med[zoom>=9][zoom<=10] {\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_line;\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_line;\n }\n [type='primary'] { line-color: @primary_line; }\n [type='secondary'] { line-color: @secondary_line; }\n [type='tertiary'] { line-color: @standard_line; }\n [zoom=9] {\n [type='motorway'],[type='trunk'] { line-width: 1.4; }\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.6; }\n }\n [zoom=10] {\n [type='motorway'],[type='trunk'] { line-width: 1.8; }\n [type='primary'],[type='secondary'],\n [type='motorway_link'],[type='trunk_link'] { line-width: 0.8; }\n }\n}\n\n\/* At higher levels the roads become more complex. We're now showing \nmore than just automobile routes - railways, footways, and cycleways\ncome in as well.\n\n\/* Road width variables that are used in road & bridge styles *\/\n@rdz11_maj: 1.6; @rdz11_med: 0.8; @rdz11_min: 0.4;\n@rdz12_maj: 2.5; @rdz12_med: 1.2; @rdz12_min: 0.8;\n@rdz13_maj: 3; @rdz13_med: 1.5; @rdz13_min: 1;\n@rdz14_maj: 4; @rdz14_med: 2.5; @rdz14_min: 1.6;\n@rdz15_maj: 6; @rdz15_med: 4; @rdz15_min: 2;\n@rdz16_maj: 8; @rdz16_med: 6; @rdz16_min: 4;\n@rdz17_maj: 14; @rdz17_med: 12; @rdz17_min: 10;\n@rdz18_maj: 20; @rdz18_med: 17; @rdz18_min: 14;\n\n\/* ---- Casing ----------------------------------------------- *\/\n\n#roads_high::outline[zoom>=11][zoom<=20],\n#tunnel[render='1_outline'][zoom>=11][zoom<=20],\n#bridge[render='1_outline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-cap: round;\n [bridge=1],\n [tunnel=1] {\n line-cap: butt;\n }\n line-join: round;\n line-color: @standard_case;\n [bridge=1] { line-color: @standard_case * 0.8; }\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_case;\n [bridge=1] { line-color: @motorway_case * 0.8; }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_case;\n [bridge=1] { line-color: @trunk_case * 0.8; }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_case;\n [bridge=1] { line-color: @primary_case * 0.8; }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_case;\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [stylegroup='railway'] {\n line-color: fadeout(@land,50%);\n [bridge=1] { line-color: @secondary_case * 0.8; }\n }\n [tunnel=1] { line-dasharray: 3,3; } \n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz11_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz11_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz12_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz12_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz13_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj + 2; }\n [stylegroup='mainroad'] { line-width: @rdz14_med + 1.6; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n \/* No minor bridges yet *\/\n [stylegroup='service'] { line-width: 0; }\n [stylegroup='noauto'] { line-width: 0; }\n [stylegroup='railway'] { line-width: 0; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz15_med + 2; }\n [stylegroup='minorroad']{ line-width: @rdz15_min + 2; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 2; }\n [stylegroup='railway'] { line-width: 1.5 + 2; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj + 2.5; }\n [stylegroup='mainroad'] { line-width: @rdz16_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz16_min + 2; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 2; }\n [stylegroup='railway'] { line-width: 2 + 2; }\n }\n [zoom>=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj + 3; }\n [stylegroup='mainroad'] { line-width: @rdz17_med + 2.5; }\n [stylegroup='minorroad']{ line-width: @rdz17_min + 2; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3 + 2; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 4; }\n [stylegroup='railway'] { line-width: 3 + 4; } \/\/ 3 + 4\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj + 4; }\n [stylegroup='mainroad'] { line-width: @rdz18_med + 4; }\n [stylegroup='minorroad']{ line-width: @rdz18_min + 3.5; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 3 + 3.5; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 6; }\n [stylegroup='railway'] { line-width: 4 + 6; }\n }\n}\n\n\n#roads_high[zoom>=11][zoom<=20],\n#tunnel[render='3_inline'][zoom>=11][zoom<=20],\n#bridge[render='3_inline'][zoom>=11][zoom<=20]{\n \/* -- colors & styles -- *\/\n line-color: @standard_fill;\n [type='motorway'],\n [type='motorway_link'] {\n line-color: @motorway_fill;\n [tunnel=1] { line-color: lighten(@motorway_fill, 10%); }\n }\n [type='trunk'],\n [type='trunk_link'] {\n line-color: @trunk_fill;\n [tunnel=1] { line-color: lighten(@trunk_fill, 10%); }\n }\n [type='primary'],\n [type='primary_link'] {\n line-color: @primary_fill;\n [tunnel=1] { line-color: lighten(@primary_fill, 10%); }\n }\n [type='secondary'],\n [type='secondary_link'] {\n line-color: @secondary_fill;\n [tunnel=1] { line-color: lighten(@secondary_fill, 10%); }\n }\n [stylegroup='railway'] {\n line-color: @rail_line;\n line-dasharray: 1,1;\n [type='subway'] { line-opacity: 0.67; }\n [zoom>15] { line-dasharray: 1,2; } \n }\n [stylegroup='noauto'],\n [stylegroup='service'],\n [stylegroup='minorroad'] {\n line-width: 0;\n }\n [stylegroup='service'],\n [stylegroup='minorroad'],\n [stylegroup='mainroad'],\n [stylegroup='motorway'] {\n line-cap: round;\n line-join: round;\n }\n [stylegroup='noauto'] {\n line-join: round;\n }\n [tunnel=1] {\n line-cap: butt;\n }\n \/* -- widths -- *\/\n [zoom=11] {\n [stylegroup='motorway'] { line-width: @rdz11_maj; }\n [stylegroup='mainroad'] { line-width: @rdz11_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.2; }\n }\n [zoom=12] {\n [stylegroup='motorway'] { line-width: @rdz12_maj; }\n [stylegroup='mainroad'] { line-width: @rdz12_med; }\n [stylegroup='minorroad']{ line-width: 0; }\n [stylegroup='railway'] { line-width: 0.4; }\n }\n [zoom=13] {\n [stylegroup='motorway'] { line-width: @rdz13_maj; }\n [stylegroup='mainroad'] { line-width: @rdz13_med; }\n [stylegroup='minorroad']{ line-width: @rdz13_min; }\n [stylegroup='service'] { line-width: @rdz13_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz13_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 0.8; }\n }\n [zoom=14] {\n [stylegroup='motorway'] { line-width: @rdz14_maj; }\n [stylegroup='mainroad'] { line-width: @rdz14_med; }\n [stylegroup='minorroad']{ line-width: @rdz14_min; }\n [stylegroup='service'] { line-width: @rdz14_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1; }\n }\n [zoom=15] {\n [stylegroup='motorway'] { line-width: @rdz15_maj; }\n [stylegroup='mainroad'] { line-width: @rdz15_med; }\n [stylegroup='minorroad']{ line-width: @rdz15_min; }\n [stylegroup='service'] { line-width: @rdz15_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4; line-dasharray: 1,1; }\n [stylegroup='railway'] { line-width: 1.5; }\n }\n [zoom=16] {\n [stylegroup='motorway'] { line-width: @rdz16_maj; }\n [stylegroup='mainroad'] { line-width: @rdz16_med; }\n [stylegroup='minorroad']{ line-width: @rdz16_min; }\n [stylegroup='service'] { line-width: @rdz16_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4; line-dasharray: 2,1; }\n [stylegroup='railway'] { line-width: 2; }\n }\n [zoom=17] {\n [stylegroup='motorway'] { line-width: @rdz17_maj; }\n [stylegroup='mainroad'] { line-width: @rdz17_med; }\n [stylegroup='minorroad']{ line-width: @rdz17_min; }\n [stylegroup='service'] { line-width: @rdz17_min \/ 3; }\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4; line-dasharray: 2,2; }\n [stylegroup='railway'] { line-width: 3; }\n }\n [zoom>=18] {\n [stylegroup='motorway'] { line-width: @rdz18_maj; }\n [stylegroup='mainroad'] { line-width: @rdz18_med; }\n [stylegroup='minorroad']{ line-width: @rdz18_min; }\n [stylegroup='service'] { line-width: @rdz18_min \/ 2; }\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4; line-dasharray: 3,3; }\n [stylegroup='railway'] { line-width: 4; }\n }\n}\n\n\/* ---- Bridge fill for dashed lines -------------------------------- *\/\n#tunnel[render='2_line'][zoom>=14][zoom<=20],\n#bridge[render='2_line'][zoom>=14][zoom<=20]{\n \/* -- colors & styles -- *\/\n [stylegroup='noauto'] {\n line-color: @land;\n line-width: 0;\n line-join: round;\n }\n [stylegroup='railway'] {\n line-color: @land;\n line-join: round;\n }\n \/* -- widths -- *\/\n [zoom=14] {\n [stylegroup='noauto'] { line-width: @rdz14_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1 + 1; }\n }\n [zoom=15] {\n [stylegroup='noauto'] { line-width: @rdz15_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 1.5 + 1; }\n }\n [zoom=16] {\n [stylegroup='noauto'] { line-width: @rdz16_min \/ 4 + 1; }\n [stylegroup='railway'] { line-width: 2 + 1; }\n }\n [zoom=17] {\n [stylegroup='noauto'] { line-width: @rdz17_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 3 + 2; }\n }\n [zoom>=18] {\n [stylegroup='noauto'] { line-width: @rdz18_min \/ 4 + 3; }\n [stylegroup='railway'] { line-width: 4 + 3; }\n }\n}\n\n\/* ---- Turning Circles --------------------------------------------- *\/\n#turning_circle_case[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-color:@standard_case;\n marker-line-width:2;\n marker-allow-overlap:true;\n}\n#turning_circle_fill[zoom>=14] {\n marker-fill:@standard_fill;\n marker-line-width:0;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n#turning_circle_case,\n#turning_circle_fill {\n [zoom=14] { marker-width:@rdz14_min * 1.1; }\n [zoom=15] { marker-width:@rdz15_min * 1.1; }\n [zoom=16] { marker-width:@rdz16_min * 1.1; }\n [zoom=17] { marker-width:@rdz17_min * 1.1; }\n [zoom>=18] { marker-width:@rdz18_min * 1.1; }\n}\n\n\/* ================================================================== *\/\n\/* AEROWAYS\n\/* ================================================================== *\/\n\n#aeroway[zoom>9] {\n line-color:@aeroway;\n line-cap:butt;\n line-join:miter;\n [type='runway'] {\n [zoom=10]{ line-width:1; }\n [zoom=11]{ line-width:2; }\n [zoom=12]{ line-width:3; }\n [zoom=13]{ line-width:5; }\n [zoom=14]{ line-width:7; }\n [zoom=15]{ line-width:11; }\n [zoom=16]{ line-width:15; }\n [zoom=17]{ line-width:19; }\n [zoom>17]{ line-width:23; }\n }\n [type='taxiway'] {\n [zoom=10]{ line-width:0.2; }\n [zoom=11]{ line-width:0.2; }\n [zoom=12]{ line-width:0.2; }\n [zoom=13]{ line-width:1; }\n [zoom=14]{ line-width:1.5; }\n [zoom=15]{ line-width:2; }\n [zoom=16]{ line-width:3; }\n [zoom=17]{ line-width:4; }\n [zoom>17]{ line-width:5; }\n }\n}\n\n\/******************************************************************* *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"f9d071aa643bdc2b6a02f31167a9d5722d5485e7","subject":"smaller lowzoom water stroke, make road haloes gray","message":"smaller lowzoom water stroke, make road haloes gray\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_shield: 'PT Sans Bold', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Bold', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Italic', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Bold Italic', 'Unifont Medium';\n\n@label_color_transport: #524c4c;\n@label_color_shield: #fff;\n@label_color_shield_fed: #333;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n@text_font_size_xlg: 24;\n@text_font_size_xxlg: 34;\n\n@text_character_spacing_sm: 0.7;\n@text_character_spacing_md: 1.2;\n@text_character_spacing_lg: 1.7;\n@text_character_spacing_xlg: 2.2;\n\n@text_font_halo_radius_xsm: 1;\n@text_font_halo_radius_sm: 1.5;\n@text_font_halo_radius_md: 1.75;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: desaturate(#F7F7E6,50%);\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-placement: line;\n text-label-position-tolerance: 2;\n text-max-char-angle-delta: 20;\n text-min-path-length: 30;\n text-fill: #444;\n text-spacing: 256;\n text-min-distance: 5;\n text-character-spacing: @text_character_spacing_sm;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: @text_font_halo_radius_md;\n\n [kind='major_road'] {\n text-size: @text_font_size_xxsm; \n } \n\n [zoom>=13] {\n text-size: @text_font_size_xxsm;\n \n [kind='major_road'] {\n text-size: @text_font_size_xxsm * 1.2; \n }\n }\n\n [zoom>=14] {\n text-min-distance: 10;\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_md;\n text-halo-radius: @text_font_halo_radius_large;\n \n [kind='major_road'] {\n text-size: @text_font_size_sm * 1.2; \n } \n }\n\n [zoom>=16]{\n text-min-distance: 100;\n text-character-spacing: @text_character_spacing_lg;\n }\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n \/\/ default rectangle shield\n shield-file: url(shields\/default.svg);\n shield-fill: @label_color_shield_fed; \n shield-transform: scale(0.2,0.2);\n shield-face-name: @text_font_shield;\n shield-name: [ref];\n shield-size: 10;\n shield-min-distance: 44;\n shield-spacing: 20;\n \/\/ half the width of the shield to prevent from wrapping\n shield-min-padding: 10;\n\n [zoom>=11][zoom<=12][highway='trunk'],\n [zoom>=11][zoom<=12][highway='primary'],\n [zoom>=11][zoom<=12][highway='secondary'],\n [zoom>=11][zoom<=12][highway='tertiary'] {\n shield-opacity: 0;\n shield-size: 0;\n } \n\n [ref=~'I \\d+'] {\n shield-file: url(shields\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 65;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 15;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(shields\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 40;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 13;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'US \\d+'] {\n shield-file: url(shields\/us.svg);\n shield-transform: scale(0.062, 0.062);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: @label_color_shield_fed;\n shield-text-dy: 1;\n shield-character-spacing: -1;\n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.075, 0.075);\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.088, 0.088);\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.091, 0.091);\n } \n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(shields\/ca.svg);\n shield-fill: @label_color_shield;\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-dy: -2.5;\n shield-character-spacing: -1;\n\n [zoom>=11][zoom<=12][highway='trunk'],\n [zoom>=11][zoom<=12][highway='primary'],\n [zoom>=11][zoom<=12][highway='secondary'],\n [zoom>=11][zoom<=12][highway='tertiary'] {\n shield-opacity: 0;\n shield-size: 0;\n } \n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.060, 0.060);\n shield-min-distance: 50;\n }\n\n [zoom>=14] {\n shield-min-distance: 80;\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.080, 0.080);\n shield-dy: -3.5;\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.090, 0.090); \n } \n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n \n text-face-name: @text_font_water_bold;\n text-wrap-width: 40;\n text-wrap-character: ' ';\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_xlg;\n text-align: center;\n\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_xsm;\n text-halo-fill: @label_color_water_halo;\n text-placement: interior;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][scalerank<4][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][scalerank<7][changed!='']\n{\n text-name: [name];\n\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n text-face-name: @text_font_water_bold;\n text-wrap-width: 50;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_lg;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_xsm;\n text-halo-fill: @label_color_water_halo;\n text-placement: interior;\n text-align: center;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels { \n \/\/ [zoom>=4][scalerank<3],\n [zoom>=5][scalerank<3][admin!='United States of America'][admin!='Canada'],\n [zoom>=6][scalerank<5],\n [zoom>=7][scalerank>=5] {\n text-name: [name];\n text-transform: uppercase;\n text-face-name: @text_font_administrative; \n text-face-name: @text_font_administrative;\n text-fill: @label_color_administrative;\n text-halo-fill: @label_color_halo_low;\n text-halo-radius: @text_font_halo_radius_sm;\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-placement-type: simple;\n text-placements: 'E,N,W,S';\n text-allow-overlap: false;\n text-min-distance: 3;\n text-avoid-edges: true;\n text-min-padding: 5;\n \n [zoom>=5] {\n text-size: @text_font_size_sm; \n }\n\n [zoom>=6] {\n text-size: @text_font_size_medium;\n text-character-spacing: 2;\n }\n\n [zoom>=7] {\n text-size: @text_font_size_large;\n text-character-spacing: 3;\n } \n }\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n text-character-spacing: 1;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80; \n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n \/\/ text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n}\n\n\/\/ #admin1-labels-50m-z6 {\n\/\/ text-face-name: @text_font_administrative;\n\/\/ text-wrap-width: 80;\n\/\/ text-fill: @label_color_administrative;\n\/\/ text-halo-radius: @text_font_halo_radius_sm;\n\/\/ text-halo-fill: @label_color_halo_low; \n\/\/ text-name: \"[label_z6]\";\n\/\/ text-size: @text_font_size_medium;\n\/\/ text-character-spacing: 2;\n\/\/ }\n\n\/\/ #admin1-labels-50m-z7 {\n\/\/ text-face-name: @text_font_administrative;\n\/\/ text-wrap-width: 80;\n\/\/ text-fill: @label_color_administrative;\n\/\/ text-halo-radius: @text_font_halo_radius_sm;\n\/\/ text-halo-fill: @label_color_halo_low; \n\/\/ text-name: \"[label_z7]\";\n\/\/ text-size: @text_font_size_large;\n\/\/ text-character-spacing: 3;\n\/\/ }\n\n\/* Admin 0 labels *\/\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_sm;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-size: @text_font_size_large;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-character-spacing: @text_character_spacing_sm;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_lg;\n text-size: @text_font_size_large;\n [population<100] { text-size: @text_font_size_medium_plus; }\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xlg;\n [population<100] { text-size: @text_font_size_large; }\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xxlg;\n [population<100] { text-size: @text_font_size_xlg; }\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n\/* city labels - using hwy shields *\/\n#aries-places-labels {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<7],\n [zoom=7][scalerank<8],\n [zoom=8][scalerank<9],\n [zoom=9][scalerank<10],\n [zoom=10][scalerank<11],\n [zoom=11][scalerank<12],\n [zoom=12][scalerank<13],\n [zoom=13][scalerank<14], \n [zoom=14][scalerank<15] \n [zoom>=15][scalerank<15]{\n\n shield-file: url(shields\/circle-12.svg);\n shield-fill: @label_color_city;\n shield-halo-fill: @label_color_halo_low;\n shield-halo-radius: @text_font_halo_radius_sm;\n shield-unlock-image: true;\n shield-avoid-edges: true; \n shield-transform: scale(0.5, 0.5);\n shield-face-name: @text_font_city;\n shield-name: [name]; \n shield-min-distance: 2; \n shield-justify-alignment: auto;\n shield-horizontal-alignment: auto;\n shield-text-dy: [y];\n shield-text-dx: [x];\n\n [zoom>=4] {\n shield-size: @text_font_size_xsm;\n \n [population>700000] {\n shield-size: @text_font_size_xsm * 1.2;\n shield-transform: scale(0.7, 0.7);\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xsm * 1.3;\n shield-transform: scale(0.8, 0.8);\n } \n }\n\n [zoom>=5]{\n shield-size: @text_font_size_sm; \n \n [population>700000] {\n shield-size: @text_font_size_sm * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_sm * 1.3;\n } \n }\n\n [zoom>=6]{\n shield-size: @text_font_size_medium; \n\n [population>700000] {\n shield-size: @text_font_size_medium * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium * 1.5;\n } \n }\n\n [zoom>=8] {\n shield-halo-radius: @text_font_halo_radius_md;\n }\n\n [zoom>=10]{\n shield-size: @text_font_size_medium_plus; \n shield-halo-radius: @text_font_halo_radius_large;\n shield-halo-fill: @label_color_halo_high;\n \n [population>700000] {\n shield-size: @text_font_size_medium_plus * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium_plus * 1.3;\n } \n }\n\n [zoom>=11] {\n shield-opacity: 0;\n }\n\n [zoom>=12] {\n shield-size: @text_font_size_xlg;\n \n [population>700000] {\n shield-size: @text_font_size_xlg * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xlg * 1.3;\n } \n }\n }\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n","old_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_shield: 'PT Sans Bold', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Bold', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Italic', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Bold Italic', 'Unifont Medium';\n\n@label_color_transport: #524c4c;\n@label_color_shield: #fff;\n@label_color_shield_fed: #333;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n@text_font_size_xlg: 24;\n@text_font_size_xxlg: 34;\n\n@text_character_spacing_sm: 0.7;\n@text_character_spacing_md: 1.2;\n@text_character_spacing_lg: 1.7;\n@text_character_spacing_xlg: 2.2;\n\n@text_font_halo_radius_sm: 1.5;\n@text_font_halo_radius_md: 1.75;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: #F7F7E6;\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-placement: line;\n text-label-position-tolerance: 2;\n text-max-char-angle-delta: 20;\n text-min-path-length: 30;\n text-fill: #444;\n text-spacing: 256;\n text-min-distance: 5;\n text-character-spacing: @text_character_spacing_sm;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: @text_font_halo_radius_md;\n\n [kind='major_road'] {\n text-size: @text_font_size_xxsm; \n } \n\n [zoom>=13] {\n text-size: @text_font_size_xxsm;\n \n [kind='major_road'] {\n text-size: @text_font_size_xxsm * 1.2; \n }\n }\n\n [zoom>=14] {\n text-min-distance: 10;\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_md;\n text-halo-radius: @text_font_halo_radius_large;\n \n [kind='major_road'] {\n text-size: @text_font_size_sm * 1.2; \n } \n }\n\n [zoom>=16]{\n text-min-distance: 100;\n text-character-spacing: @text_character_spacing_lg;\n }\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n \/\/ default rectangle shield\n shield-file: url(shields\/default.svg);\n shield-fill: @label_color_shield_fed; \n shield-transform: scale(0.2,0.2);\n shield-face-name: @text_font_shield;\n shield-name: [ref];\n shield-size: 10;\n shield-min-distance: 44;\n shield-spacing: 20;\n \/\/ half the width of the shield to prevent from wrapping\n shield-min-padding: 10;\n\n [zoom>=11][zoom<=12][highway='trunk'],\n [zoom>=11][zoom<=12][highway='primary'],\n [zoom>=11][zoom<=12][highway='secondary'],\n [zoom>=11][zoom<=12][highway='tertiary'] {\n shield-opacity: 0;\n shield-size: 0;\n } \n\n [ref=~'I \\d+'] {\n shield-file: url(shields\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 65;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 15;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(shields\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 40;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 13;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'US \\d+'] {\n shield-file: url(shields\/us.svg);\n shield-transform: scale(0.062, 0.062);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: @label_color_shield_fed;\n shield-text-dy: 1;\n shield-character-spacing: -1;\n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.075, 0.075);\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.088, 0.088);\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.091, 0.091);\n } \n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(shields\/ca.svg);\n shield-fill: @label_color_shield;\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-dy: -2.5;\n shield-character-spacing: -1;\n\n [zoom>=11][zoom<=12][highway='trunk'],\n [zoom>=11][zoom<=12][highway='primary'],\n [zoom>=11][zoom<=12][highway='secondary'],\n [zoom>=11][zoom<=12][highway='tertiary'] {\n shield-opacity: 0;\n shield-size: 0;\n } \n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.060, 0.060);\n shield-min-distance: 50;\n }\n\n [zoom>=14] {\n shield-min-distance: 80;\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.080, 0.080);\n shield-dy: -3.5;\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.090, 0.090); \n } \n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n \n text-face-name: @text_font_water_bold;\n text-wrap-width: 40;\n text-wrap-character: ' ';\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_xlg;\n text-align: center;\n\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n text-placement: interior;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][scalerank<4][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][scalerank<7][changed!='']\n{\n text-name: [name];\n\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n text-face-name: @text_font_water_bold;\n text-wrap-width: 50;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_lg;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n text-placement: interior;\n text-align: center;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels { \n \/\/ [zoom>=4][scalerank<3],\n [zoom>=5][scalerank<3][admin!='United States of America'][admin!='Canada'],\n [zoom>=6][scalerank<5],\n [zoom>=7][scalerank>=5] {\n text-name: [name];\n text-transform: uppercase;\n text-face-name: @text_font_administrative; \n text-face-name: @text_font_administrative;\n text-fill: @label_color_administrative;\n text-halo-fill: @label_color_halo_low;\n text-halo-radius: @text_font_halo_radius_sm;\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-placement-type: simple;\n text-placements: 'E,N,W,S';\n text-allow-overlap: false;\n text-min-distance: 3;\n text-avoid-edges: true;\n text-min-padding: 5;\n \n [zoom>=5] {\n text-size: @text_font_size_sm; \n }\n\n [zoom>=6] {\n text-size: @text_font_size_medium;\n text-character-spacing: 2;\n }\n\n [zoom>=7] {\n text-size: @text_font_size_large;\n text-character-spacing: 3;\n } \n }\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n text-character-spacing: 1;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80; \n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n \/\/ text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n}\n\n\/\/ #admin1-labels-50m-z6 {\n\/\/ text-face-name: @text_font_administrative;\n\/\/ text-wrap-width: 80;\n\/\/ text-fill: @label_color_administrative;\n\/\/ text-halo-radius: @text_font_halo_radius_sm;\n\/\/ text-halo-fill: @label_color_halo_low; \n\/\/ text-name: \"[label_z6]\";\n\/\/ text-size: @text_font_size_medium;\n\/\/ text-character-spacing: 2;\n\/\/ }\n\n\/\/ #admin1-labels-50m-z7 {\n\/\/ text-face-name: @text_font_administrative;\n\/\/ text-wrap-width: 80;\n\/\/ text-fill: @label_color_administrative;\n\/\/ text-halo-radius: @text_font_halo_radius_sm;\n\/\/ text-halo-fill: @label_color_halo_low; \n\/\/ text-name: \"[label_z7]\";\n\/\/ text-size: @text_font_size_large;\n\/\/ text-character-spacing: 3;\n\/\/ }\n\n\/* Admin 0 labels *\/\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_sm;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-size: @text_font_size_large;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-character-spacing: @text_character_spacing_sm;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_lg;\n text-size: @text_font_size_large;\n [population<100] { text-size: @text_font_size_medium_plus; }\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xlg;\n [population<100] { text-size: @text_font_size_large; }\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xxlg;\n [population<100] { text-size: @text_font_size_xlg; }\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n\/* city labels - using hwy shields *\/\n#aries-places-labels {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<7],\n [zoom=7][scalerank<8],\n [zoom=8][scalerank<9],\n [zoom=9][scalerank<10],\n [zoom=10][scalerank<11],\n [zoom=11][scalerank<12],\n [zoom=12][scalerank<13],\n [zoom=13][scalerank<14], \n [zoom=14][scalerank<15] \n [zoom>=15][scalerank<15]{\n\n shield-file: url(shields\/circle-12.svg);\n shield-fill: @label_color_city;\n shield-halo-fill: @label_color_halo_low;\n shield-halo-radius: @text_font_halo_radius_sm;\n shield-unlock-image: true;\n shield-avoid-edges: true; \n shield-transform: scale(0.5, 0.5);\n shield-face-name: @text_font_city;\n shield-name: [name]; \n shield-min-distance: 2; \n shield-justify-alignment: auto;\n shield-horizontal-alignment: auto;\n shield-text-dy: [y];\n shield-text-dx: [x];\n\n [zoom>=4] {\n shield-size: @text_font_size_xsm;\n \n [population>700000] {\n shield-size: @text_font_size_xsm * 1.2;\n shield-transform: scale(0.7, 0.7);\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xsm * 1.3;\n shield-transform: scale(0.8, 0.8);\n } \n }\n\n [zoom>=5]{\n shield-size: @text_font_size_sm; \n \n [population>700000] {\n shield-size: @text_font_size_sm * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_sm * 1.3;\n } \n }\n\n [zoom>=6]{\n shield-size: @text_font_size_medium; \n\n [population>700000] {\n shield-size: @text_font_size_medium * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium * 1.5;\n } \n }\n\n [zoom>=8] {\n shield-halo-radius: @text_font_halo_radius_md;\n }\n\n [zoom>=10]{\n shield-size: @text_font_size_medium_plus; \n shield-halo-radius: @text_font_halo_radius_large;\n shield-halo-fill: @label_color_halo_high;\n \n [population>700000] {\n shield-size: @text_font_size_medium_plus * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium_plus * 1.3;\n } \n }\n\n [zoom>=11] {\n shield-opacity: 0;\n }\n\n [zoom>=12] {\n shield-size: @text_font_size_xlg;\n \n [population>700000] {\n shield-size: @text_font_size_xlg * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xlg * 1.3;\n } \n }\n }\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"37dd1e3d6b90fe75ed65ef72dfdb50aea81e47a2","subject":"Improve place label orientation","message":"Improve place label orientation\n","repos":"Andrey-Pavlov\/toner-carto,stamen\/toner-carto","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport_bold: 'Arial Unicode MS Bold';\n@text_font_physical_bold: 'Arial Unicode MS Bold';\n@text_font_administrative: 'Arial Unicode MS Regular';\n@text_font_administrative_bold: 'Arial Unicode MS Bold';\n@text_font_water: 'Arial Unicode MS Italic';\n@text_font_water_bold: 'Arial Unicode MS Bold Italic';\n@text_font_city: 'Arial Unicode MS Regular';\n@text_font_city_bold: 'Arial Unicode MS Bold';\n@text_font_poi_bold: 'Arial Unicode MS Bold Italic';\n\n@label_color_transport: #000;\n@label_color_transport_halo: #fff;\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_administrative: #000;\n@label_color_administrative_halo: #fff;\n@label_color_city: #000;\n@label_color_city_halo: #fff;\n@label_color_poi: #000;\n@label_color_poi_halo: #fff;\n\n@text_font_size_xxsm: 10;\n@text_font_size_xsm: 12;\n@text_font_size_sm: 13;\n@text_font_size_medium: 14;\n@text_font_size_medium_plus: 16;\n@text_font_size_large: 18;\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n\n#minor_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-avoid-edges: true;\n \n [zoom=16] {\n text-dy: 10; \n text-spacing: 124; \n text-size: @text_font_size_xxsm; \n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom=17] {\n text-dy: 13; \n text-spacing: 180; \n text-size: @text_font_size_xsm;\n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom>=18] {\n text-size: @text_font_size_xsm; \n text-spacing: 400; \n text-halo-radius: @text_font_halo_radius_large; \n }\n}\n\n#major_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-spacing: 100;\n text-avoid-edges: true;\n\n [zoom>=16][highway='primary'] {\n\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [is_tunnel=1][zoom>=15] {\n\ttext-fill: #777;\n }\n [zoom=12] {\n text-dy: 7;\n text-size: @text_font_size_xsm;\n text-min-distance: 4;\n }\n [zoom=13] {\n text-dy: 8;\n text-min-distance: 5;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_sm;\n }\n [highway='primary'] {\n\t\ttext-size: 13;\n }\n }\n\n [zoom=14] {\n text-min-distance: 5;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: 9;\n \ttext-size: @text_font_size_medium;\n } \n [highway='secondary'] {\n\t\ttext-dy: 7;\n \ttext-size: @text_font_size_xsm;\n text-halo-radius: 1.5;\n }\n }\n\n [zoom=15] {\n text-min-distance: 10;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: @text_font_size_xsm;\n \ttext-size: 15;\n }\n [highway='secondary'],[highway='tertiary'] {\n\t\ttext-dy: 11;\n \ttext-size: @text_font_size_sm;\n }\n }\n\n [zoom=16] {\n text-min-distance: 12;\n text-dy: 13;\n [highway='trunk'],[highway='primary'] { \n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'],[highway='tertiary'] {\t\n \ttext-spacing: 124;\n \ttext-size: @text_font_size_sm;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom=17] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-dy: 16;\n \ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-dy: 14;\n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-dy: 14; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_medium;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n\t\ttext-dy: 13; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_xsm; \n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom>=18] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-size: @text_font_size_medium; \n\t\ttext-spacing: 300;\n\t\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n text-size: @text_font_size_xsm;\n text-spacing: 400;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n}\n\n#poi_station_labels {\n [zoom>=16][railway='station'] {\n shield-name: \"[label]\";\n shield-face-name: @text_font_transport_bold;\n shield-fill: white;\n shield-size: 12;\n shield-file: url('images\/subway_shield_small.svg');\n }\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_physical_halo;\n text-halo-fill: @label_color_physical;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-fill: @label_color_physical;\n text-halo-fill: @label_color_physical_halo;\n \n text-line-spacing: -1;\n text-min-distance: 10;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n \n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=16] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#continents[zoom>=1][zoom<3]\n{\n \ttext-name: \"[name]\";\n text-face-name: @text_font_physical_bold;\n text-wrap-width: 32;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical;\n text-halo-radius: 3;\n text-halo-fill: @label_color_physical_halo;\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n \ttext-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n \ttext-min-distance: 1;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z4 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z5 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium_plus;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z6 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_large;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n\/\/ HACK! All the problematic water bodies with accents\n\/\/ e.g. \"Bahia de Campeche\" with an accented i,\n\/\/ have an empty \"changed\" string. So abuse this for now.\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \t[namealt!=''] {\n \t\ttext-name: [name] + '\\n(' + [namealt] + ')';\n }\n\ttext-face-name: @text_font_water_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][changed!='']\n{\n \ttext-name: [name];\n \t[namealt!=''] {\n \t\ttext-name: [name] + '\\n(' + [namealt] + ')';\n }\n text-face-name: @text_font_water;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n text-name: [name];\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-vertical-alignment: bottom;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo;\n text-min-distance: 5;\n\n [zoom>=4] {\n text-size: @text_font_size_xxsm;\n }\n\n [zoom>=5] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size=14] {\n text-size: @text_font_size_medium;\n }\n\n [font_size=16] {\n text-size: @text_font_size_medium_plus;\n }\n\n [font_size=18] {\n text-size: @text_font_size_large;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n text-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo;\n text-size: @text_font_size_sm;\n\n [zoom=7] {\n text-size: @text_font_size_xsm;\n }\n\n [font_size=18] {\n text-size: @text_font_size_large;\n }\n\n [font_size=20] {\n text-size: @text_font_size_large;\n }\n\n [justified='left'] {\n text-horizontal-alignment: middle;\n text-dx: -5;\n }\n\n [justified='right'] {\n text-horizontal-alignment: middle;\n text-dx: 5;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10,\n#city_labels_z11,\n#city_labels_z12, {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo; \n\ttext-size: @text_font_size_sm;\n [font_size=20] { text-size: @text_font_size_large; } \n}\n\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n \tmarker-ignore-placement: true;\n \tmarker-width: 7;\n \tmarker-fill: black;\n \tmarker-line-color: white;\n \tmarker-line-width: 2;\n}\n\n#airports[zoom>=10][zoom<=13] {\n marker-width: 18;\n\tmarker-file: url('images\/airplane.svg');\n}\n\n#airports[zoom>=13][scalerank<=12]\n{\n \ttext-name: \"[name]\";\n text-face-name: @text_font_poi_bold;\n text-fill: @label_color_poi;\n text-size: @text_font_size_medium;\n text-halo-fill: @label_color_poi_halo;\n text-halo-radius: @text_font_halo_radius_large;\n text-wrap-width: 128;\n text-dy: 14;\n text-allow-overlap: true;\n \n \t[zoom>=14] {\n \ttext-dy: 0;\n }\n}\n","old_contents":"@text_font_transport_bold: 'Arial Unicode MS Bold';\n@text_font_physical_bold: 'Arial Unicode MS Bold';\n@text_font_administrative: 'Arial Unicode MS Regular';\n@text_font_administrative_bold: 'Arial Unicode MS Bold';\n@text_font_water: 'Arial Unicode MS Italic';\n@text_font_water_bold: 'Arial Unicode MS Bold Italic';\n@text_font_city: 'Arial Unicode MS Regular';\n@text_font_city_bold: 'Arial Unicode MS Bold';\n@text_font_poi_bold: 'Arial Unicode MS Bold Italic';\n\n@label_color_transport: #000;\n@label_color_transport_halo: #fff;\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_administrative: #000;\n@label_color_administrative_halo: #fff;\n@label_color_city: #000;\n@label_color_city_halo: #fff;\n@label_color_poi: #000;\n@label_color_poi_halo: #fff;\n\n@text_font_size_xxsm: 10;\n@text_font_size_xsm: 12;\n@text_font_size_sm: 13;\n@text_font_size_medium: 14;\n@text_font_size_medium_plus: 16;\n@text_font_size_large: 18;\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n\n#minor_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-avoid-edges: true;\n \n [zoom=16] {\n text-dy: 10; \n text-spacing: 124; \n text-size: @text_font_size_xxsm; \n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom=17] {\n text-dy: 13; \n text-spacing: 180; \n text-size: @text_font_size_xsm;\n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom>=18] {\n text-size: @text_font_size_xsm; \n text-spacing: 400; \n text-halo-radius: @text_font_halo_radius_large; \n }\n}\n\n#major_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-spacing: 100;\n text-avoid-edges: true;\n\n [zoom>=16][highway='primary'] {\n\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [is_tunnel=1][zoom>=15] {\n\ttext-fill: #777;\n }\n [zoom=12] {\n text-dy: 7;\n text-size: @text_font_size_xsm;\n text-min-distance: 4;\n }\n [zoom=13] {\n text-dy: 8;\n text-min-distance: 5;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_sm;\n }\n [highway='primary'] {\n\t\ttext-size: 13;\n }\n }\n\n [zoom=14] {\n text-min-distance: 5;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: 9;\n \ttext-size: @text_font_size_medium;\n } \n [highway='secondary'] {\n\t\ttext-dy: 7;\n \ttext-size: @text_font_size_xsm;\n text-halo-radius: 1.5;\n }\n }\n\n [zoom=15] {\n text-min-distance: 10;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: @text_font_size_xsm;\n \ttext-size: 15;\n }\n [highway='secondary'],[highway='tertiary'] {\n\t\ttext-dy: 11;\n \ttext-size: @text_font_size_sm;\n }\n }\n\n [zoom=16] {\n text-min-distance: 12;\n text-dy: 13;\n [highway='trunk'],[highway='primary'] { \n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'],[highway='tertiary'] {\t\n \ttext-spacing: 124;\n \ttext-size: @text_font_size_sm;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom=17] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-dy: 16;\n \ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-dy: 14;\n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-dy: 14; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_medium;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n\t\ttext-dy: 13; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_xsm; \n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom>=18] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-size: @text_font_size_medium; \n\t\ttext-spacing: 300;\n\t\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n text-size: @text_font_size_xsm;\n text-spacing: 400;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n}\n\n#poi_station_labels {\n [zoom>=16][railway='station'] {\n shield-name: \"[label]\";\n shield-face-name: @text_font_transport_bold;\n shield-fill: white;\n shield-size: 12;\n shield-file: url('images\/subway_shield_small.svg');\n }\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_physical_halo;\n text-halo-fill: @label_color_physical;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-fill: @label_color_physical;\n text-halo-fill: @label_color_physical_halo;\n \n text-line-spacing: -1;\n text-min-distance: 10;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n \n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=16] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#continents[zoom>=1][zoom<3]\n{\n \ttext-name: \"[name]\";\n text-face-name: @text_font_physical_bold;\n text-wrap-width: 32;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical;\n text-halo-radius: 3;\n text-halo-fill: @label_color_physical_halo;\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n \ttext-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n \ttext-min-distance: 1;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z4 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z5 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium_plus;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z6 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_large;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n\/\/ HACK! All the problematic water bodies with accents\n\/\/ e.g. \"Bahia de Campeche\" with an accented i,\n\/\/ have an empty \"changed\" string. So abuse this for now.\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \t[namealt!=''] {\n \t\ttext-name: [name] + '\\n(' + [namealt] + ')';\n }\n\ttext-face-name: @text_font_water_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][changed!='']\n{\n \ttext-name: [name];\n \t[namealt!=''] {\n \t\ttext-name: [name] + '\\n(' + [namealt] + ')';\n }\n text-face-name: @text_font_water;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo;\n \ttext-min-distance: 5;\n \n \t#city_labels_z4 {\n text-size: @text_font_size_xxsm;\n [font_size=14] {\n text-size: @text_font_size_medium; \n }\n }\n \n \t#city_labels_z5 {\n text-size: @text_font_size_xsm;\n [font_size=16] {\n text-size: @text_font_size_medium_plus; \n }\n }\n \n #city_labels_z6 {\n text-size: @text_font_size_xsm;\n [font_size=18] {\n text-size: @text_font_size_large; \n }\n }\n \n [justified='left'] {\n \ttext-horizontal-alignment: middle;\n \ttext-dx: -5;\n }\n [justified='right'] {\n \ttext-horizontal-alignment: middle;\n \ttext-dx: 5;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n\ttext-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo; \n\ttext-size: @text_font_size_sm;\n [font_size=20] { text-size: @text_font_size_large; } \n \n \t#city_labels_z7 {\n \t text-size: @text_font_size_xsm;\n [font_size=18] {\n text-size: @text_font_size_large; \n }\n }\n \n \t[justified='left'] {\n \ttext-horizontal-alignment: middle;\n \ttext-dx: -5;\n }\n [justified='right'] {\n \ttext-horizontal-alignment: middle;\n \ttext-dx: 5;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10,\n#city_labels_z11,\n#city_labels_z12, {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo; \n\ttext-size: @text_font_size_sm;\n [font_size=20] { text-size: @text_font_size_large; } \n}\n\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n \tmarker-ignore-placement: true;\n \tmarker-width: 7;\n \tmarker-fill: black;\n \tmarker-line-color: white;\n \tmarker-line-width: 2;\n}\n\n#airports[zoom>=10][zoom<=13] {\n marker-width: 18;\n\tmarker-file: url('images\/airplane.svg');\n}\n\n#airports[zoom>=13][scalerank<=12]\n{\n \ttext-name: \"[name]\";\n text-face-name: @text_font_poi_bold;\n text-fill: @label_color_poi;\n text-size: @text_font_size_medium;\n text-halo-fill: @label_color_poi_halo;\n text-halo-radius: @text_font_halo_radius_large;\n text-wrap-width: 128;\n text-dy: 14;\n text-allow-overlap: true;\n \n \t[zoom>=14] {\n \ttext-dy: 0;\n }\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"ea6303b3ba4e09a752991d14f2088a0910dba44f","subject":"allow syllables on chords","message":"allow syllables on chords\n\n","repos":"annplaksin\/sibmei","old_file":"src\/ExportProcessors.mss","new_file":"src\/ExportProcessors.mss","new_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer, normalizedBeamProp) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Returns the active beam, if any, and creates new beam elements\n at the start of a beam.\n *\/\n switch (normalizedBeamProp)\n {\n case (NoBeam)\n {\n if (bobj.GraceNote)\n {\n if (layer._property:ActiveGraceBeam != null)\n {\n layer._property:ActiveGraceBeam = null;\n }\n \/\/ If there is an active non-grace beam, we have a normal beam spanning\n \/\/ over a non-beamed grace note that will be added as a child of that beam.\n return GetNongraceParentBeam(bobj, layer);\n }\n else\n {\n if (layer._property:ActiveBeam != null)\n {\n layer._property:ActiveBeam = null;\n }\n return null;\n }\n }\n case (StartBeam)\n {\n newBeam = libmei.Beam();\n if (bobj.GraceNote)\n {\n layer._property:ActiveGraceBeam = newBeam;\n nonGraceParentBeam = GetNongraceParentBeam(bobj, layer);\n if (nonGraceParentBeam != null)\n {\n newBeam._property:ParentBeam = nonGraceParentBeam;\n }\n }\n else\n {\n layer._property:ActiveBeam = newBeam;\n }\n return newBeam;\n }\n default {\n \/\/ ContinueBeam and SingleBeam\n if (bobj.GraceNote)\n {\n return layer._property:ActiveGraceBeam;\n }\n else\n {\n return layer._property:ActiveBeam;\n }\n }\n }\n} \/\/$end\n\nfunction ProcessTuplet (noteRest, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (noteRest.ParentTupletIfAny = null)\n {\n return null;\n }\n\n \/*\n We encode inner tuplets of nested tuplet structures as s.\n Therefore we always return the outermost MEI tuplet for content to be added.\n Still, we need to keep track of the inner tuplets to assign the @endid.\n layer._property:ActiveMeiTuplet always points to the innermost tuplet.\n *\/\n activeMeiTuplet = layer._property:ActiveMeiTuplet;\n\n tupletIsContinued = activeMeiTuplet != null and TupletsEqual(noteRest.ParentTupletIfAny, activeMeiTuplet._property:SibTuplet);\n\n if (not(tupletIsContinued))\n {\n \/\/ New tuplets need to be added\n noteRestTupletStack = GetTupletStack(noteRest);\n sibTuplet = null;\n meiTupletDepth = GetMeiTupletDepth(layer);\n\n for i = meiTupletDepth to noteRestTupletStack.Length\n {\n sibTuplet = noteRestTupletStack[i];\n nextActiveMeiTuplet = GenerateTuplet(sibTuplet);\n if (meiTupletDepth > 0 or i > meiTupletDepth)\n {\n \/\/ We have an inner tuplet that we encode as \n nextActiveMeiTuplet = ShiftTupletToTupletSpan(nextActiveMeiTuplet, layer);\n }\n libmei.AddAttribute(nextActiveMeiTuplet, 'startid', '#' & meielement._id);\n \/\/ We basically create a linked list of tuplets\n nextActiveMeiTuplet._property:ParentTuplet = activeMeiTuplet;\n nextActiveMeiTuplet._property:SibTuplet = sibTuplet;\n activeMeiTuplet = nextActiveMeiTuplet;\n }\n layer._property:ActiveMeiTuplet = activeMeiTuplet;\n }\n\n meiTuplet = activeMeiTuplet;\n for i = 0 to CountTupletsEndingAtNoteRest(noteRest)\n {\n libmei.AddAttribute(meiTuplet, 'endid', '#' & meielement._id);\n meiTuplet = meiTuplet._property:ParentTuplet;\n }\n layer._property:ActiveMeiTuplet = meiTuplet;\n\n outermostMeiTuplet = activeMeiTuplet;\n while (outermostMeiTuplet._property:ParentTuplet)\n {\n outermostMeiTuplet = outermostMeiTuplet._property:ParentTuplet;\n }\n return outermostMeiTuplet;\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n\n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it\n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(tupletSpan._id);\n Self._property:MeasureObjects = mobjs;\n\n return tupletSpan;\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n\n if (lyricobj.Text = '')\n {\n return null;\n }\n\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n \/\/ In the case of elisions, we create multiple syl elements from one\n \/\/ LyricItem. We have to distinguish between the first and the last syl\n \/\/ element we created. In the common, simple case, both are identical.\n sylel_last = sylel;\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (utils.Pos('_', syl.Text) > -1)\n {\n \/\/ Syllable elision. split this syllable element by underscore.\n syllables = MSplitString(syl.Text, '_');\n\n \/\/ reset the text of the first syllable element to the first half of the syllable.\n libmei.SetText(sylel, syllables[0]);\n libmei.AddAttribute(sylel, 'con', 'b');\n\n for s = 1 to syllables.Length\n {\n sylel_last = libmei.Syl();\n libmei.SetText(sylel_last, syllables[s]);\n libmei.AddChild(verse, sylel_last);\n }\n }\n\n if (j = 0)\n {\n \/\/add a wordpos only for partial words\n if (lyric_word.Length > 1)\n {\n libmei.AddAttribute(sylel_last, 'wordpos', 'i'); \/\/ 'initial'\n\n libmei.AddAttribute(sylel_last, 'con', 'd'); \/\/dash syllable connector\n }\n\n \/\/it is also possible, that an initial syllable has an underscore as an extender, if it is the only syllable of a word\n if (lyric_word.Length = 1)\n {\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel_last, 'con', 'u'); \/\/ 'underscore'\n }\n }\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n libmei.AddChild(obj, verse);\n }\n else\n {\n Log('Could not find note object for syl ' & syl);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so\n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessTremolo (bobj) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.DoubleTremolos = 0)\n {\n return null;\n }\n\n Log('Fingered tremolo: ' & bobj.DoubleTremolos);\n tremEl = libmei.FTrem();\n libmei.AddAttribute(tremEl, 'slash', bobj.DoubleTremolos);\n libmei.AddAttribute(tremEl, 'measperf');\n\n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n case ('52')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('53')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('54')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('55')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('160')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'stop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('162')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'open');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('163')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('164')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('165')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('166')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('212')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'ten');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('214')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'marc');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('217')\n {\n \/\/ up-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('218')\n {\n \/\/ down-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('233')\n {\n \/\/ up-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('234')\n {\n \/\/ down-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('240')\n {\n \/\/ double staccato\n return null;\n }\n case ('241')\n {\n \/\/ triple staccato\n return null;\n }\n case ('242')\n {\n \/\/ quadruple staccato\n return null;\n }\n case ('243')\n {\n \/\/ snap\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'snap');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('480')\n {\n \/\/scoop\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'scoop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('481')\n {\n \/\/fall\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fall');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('490')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fingernail');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('494')\n {\n \/\/doit\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'doit');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('495')\n {\n \/\/plop\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'plop');\n libmei.AddChild(nobj, artic);\n }\n\n }\n\n }\n} \/\/$end\n\nfunction ProcessEndingSlurs (bar) {\n \/\/$module(ExportProcessors.mss)\n slur_resolver = Self._property:SlurResolver;\n for voiceNumber = 1 to 5\n {\n endingSlurs = slur_resolver[LayerHash(bar, voiceNumber)];\n if (endingSlurs != null)\n {\n for each slur in endingSlurs\n {\n end_obj = GetNoteObjectAtEndPosition(slur);\n if (end_obj != null)\n {\n libmei.AddAttribute(slur._property:mobj, 'endid', '#' & end_obj._id);\n }\n }\n }\n }\n} \/\/$end\n","old_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer, normalizedBeamProp) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Returns the active beam, if any, and creates new beam elements\n at the start of a beam.\n *\/\n switch (normalizedBeamProp)\n {\n case (NoBeam)\n {\n if (bobj.GraceNote)\n {\n if (layer._property:ActiveGraceBeam != null)\n {\n layer._property:ActiveGraceBeam = null;\n }\n \/\/ If there is an active non-grace beam, we have a normal beam spanning\n \/\/ over a non-beamed grace note that will be added as a child of that beam.\n return GetNongraceParentBeam(bobj, layer);\n }\n else\n {\n if (layer._property:ActiveBeam != null)\n {\n layer._property:ActiveBeam = null;\n }\n return null;\n }\n }\n case (StartBeam)\n {\n newBeam = libmei.Beam();\n if (bobj.GraceNote)\n {\n layer._property:ActiveGraceBeam = newBeam;\n nonGraceParentBeam = GetNongraceParentBeam(bobj, layer);\n if (nonGraceParentBeam != null)\n {\n newBeam._property:ParentBeam = nonGraceParentBeam;\n }\n }\n else\n {\n layer._property:ActiveBeam = newBeam;\n }\n return newBeam;\n }\n default {\n \/\/ ContinueBeam and SingleBeam\n if (bobj.GraceNote)\n {\n return layer._property:ActiveGraceBeam;\n }\n else\n {\n return layer._property:ActiveBeam;\n }\n }\n }\n} \/\/$end\n\nfunction ProcessTuplet (noteRest, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (noteRest.ParentTupletIfAny = null)\n {\n return null;\n }\n\n \/*\n We encode inner tuplets of nested tuplet structures as s.\n Therefore we always return the outermost MEI tuplet for content to be added.\n Still, we need to keep track of the inner tuplets to assign the @endid.\n layer._property:ActiveMeiTuplet always points to the innermost tuplet.\n *\/\n activeMeiTuplet = layer._property:ActiveMeiTuplet;\n\n tupletIsContinued = activeMeiTuplet != null and TupletsEqual(noteRest.ParentTupletIfAny, activeMeiTuplet._property:SibTuplet);\n\n if (not(tupletIsContinued))\n {\n \/\/ New tuplets need to be added\n noteRestTupletStack = GetTupletStack(noteRest);\n sibTuplet = null;\n meiTupletDepth = GetMeiTupletDepth(layer);\n\n for i = meiTupletDepth to noteRestTupletStack.Length\n {\n sibTuplet = noteRestTupletStack[i];\n nextActiveMeiTuplet = GenerateTuplet(sibTuplet);\n if (meiTupletDepth > 0 or i > meiTupletDepth)\n {\n \/\/ We have an inner tuplet that we encode as \n nextActiveMeiTuplet = ShiftTupletToTupletSpan(nextActiveMeiTuplet, layer);\n }\n libmei.AddAttribute(nextActiveMeiTuplet, 'startid', '#' & meielement._id);\n \/\/ We basically create a linked list of tuplets\n nextActiveMeiTuplet._property:ParentTuplet = activeMeiTuplet;\n nextActiveMeiTuplet._property:SibTuplet = sibTuplet;\n activeMeiTuplet = nextActiveMeiTuplet;\n }\n layer._property:ActiveMeiTuplet = activeMeiTuplet;\n }\n\n meiTuplet = activeMeiTuplet;\n for i = 0 to CountTupletsEndingAtNoteRest(noteRest)\n {\n libmei.AddAttribute(meiTuplet, 'endid', '#' & meielement._id);\n meiTuplet = meiTuplet._property:ParentTuplet;\n }\n layer._property:ActiveMeiTuplet = meiTuplet;\n\n outermostMeiTuplet = activeMeiTuplet;\n while (outermostMeiTuplet._property:ParentTuplet)\n {\n outermostMeiTuplet = outermostMeiTuplet._property:ParentTuplet;\n }\n return outermostMeiTuplet;\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n\n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it\n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(tupletSpan._id);\n Self._property:MeasureObjects = mobjs;\n\n return tupletSpan;\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n\n if (lyricobj.Text = '')\n {\n return null;\n }\n\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n \/\/ In the case of elisions, we create multiple syl elements from one\n \/\/ LyricItem. We have to distinguish between the first and the last syl\n \/\/ element we created. In the common, simple case, both are identical.\n sylel_last = sylel;\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (utils.Pos('_', syl.Text) > -1)\n {\n \/\/ Syllable elision. split this syllable element by underscore.\n syllables = MSplitString(syl.Text, '_');\n\n \/\/ reset the text of the first syllable element to the first half of the syllable.\n libmei.SetText(sylel, syllables[0]);\n libmei.AddAttribute(sylel, 'con', 'b');\n\n for s = 1 to syllables.Length\n {\n sylel_last = libmei.Syl();\n libmei.SetText(sylel_last, syllables[s]);\n libmei.AddChild(verse, sylel_last);\n }\n }\n\n if (j = 0)\n {\n \/\/add a wordpos only for partial words\n if (lyric_word.Length > 1)\n {\n libmei.AddAttribute(sylel_last, 'wordpos', 'i'); \/\/ 'initial'\n\n libmei.AddAttribute(sylel_last, 'con', 'd'); \/\/dash syllable connector\n }\n\n \/\/it is also possible, that an initial syllable has an underscore as an extender, if it is the only syllable of a word\n if (lyric_word.Length = 1)\n {\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel_last, 'con', 'u'); \/\/ 'underscore'\n }\n }\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n if (name = 'chord')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'chord'));\n }\n\n libmei.AddChild(obj, verse);\n }\n else\n {\n Log('Could not find note object for syl ' & syl);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so\n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessTremolo (bobj) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.DoubleTremolos = 0)\n {\n return null;\n }\n\n Log('Fingered tremolo: ' & bobj.DoubleTremolos);\n tremEl = libmei.FTrem();\n libmei.AddAttribute(tremEl, 'slash', bobj.DoubleTremolos);\n libmei.AddAttribute(tremEl, 'measperf');\n\n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n case ('52')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('53')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('54')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('55')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('160')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'stop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('162')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'open');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('163')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('164')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('165')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('166')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('212')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'ten');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('214')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'marc');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('217')\n {\n \/\/ up-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('218')\n {\n \/\/ down-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('233')\n {\n \/\/ up-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('234')\n {\n \/\/ down-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('240')\n {\n \/\/ double staccato\n return null;\n }\n case ('241')\n {\n \/\/ triple staccato\n return null;\n }\n case ('242')\n {\n \/\/ quadruple staccato\n return null;\n }\n case ('243')\n {\n \/\/ snap\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'snap');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('480')\n {\n \/\/scoop\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'scoop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('481')\n {\n \/\/fall\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fall');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('490')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fingernail');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('494')\n {\n \/\/doit\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'doit');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('495')\n {\n \/\/plop\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'plop');\n libmei.AddChild(nobj, artic);\n }\n\n }\n\n }\n} \/\/$end\n\nfunction ProcessEndingSlurs (bar) {\n \/\/$module(ExportProcessors.mss)\n slur_resolver = Self._property:SlurResolver;\n for voiceNumber = 1 to 5\n {\n endingSlurs = slur_resolver[LayerHash(bar, voiceNumber)];\n if (endingSlurs != null)\n {\n for each slur in endingSlurs\n {\n end_obj = GetNoteObjectAtEndPosition(slur);\n if (end_obj != null)\n {\n libmei.AddAttribute(slur._property:mobj, 'endid', '#' & end_obj._id);\n }\n }\n }\n }\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"c13137504e7e1c0d8f47b9df1bf164fc53d694eb","subject":"Update labels.mss","message":"Update labels.mss","repos":"brelevenix\/osm-bright-tregor","old_file":"osm-bright\/labels.mss","new_file":"osm-bright\/labels.mss","new_contents":"\/* LABELS.MSS CONTENTS:\n * - place names\n * - area labels\n * - waterway labels \n *\/\n\n\/* Font sets are defined in palette.mss *\/\n\n\/* ================================================================== *\/\n\/* PLACE NAMES\n\/* ================================================================== *\/\n\n#place::country[type='country'][zoom>3][zoom<9] {\n text-name:'[name]';\n text-face-name:@sans_bold;\n text-placement:point;\n text-fill:@country_text;\n\n [zoom=3] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=4] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>4] {\n text-halo-radius: 2;\n }\n [zoom=5] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=6] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=7] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n#place::state[type='state'][zoom>=5][zoom<=10] {\n text-name:'[name]';\n text-face-name:@sans_bold_italic;\n text-placement:point;\n text-fill:@state_text;\n\n [zoom=6] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=7] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>8] {\n text-halo-radius: 2;\n }\n [zoom=8] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=9] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=10] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n\/* ---- Cities ------------------------------------------------------ *\/\n\n#place::city[type='city'][zoom>=8][zoom<=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@city_text;\n\n [zoom<=8] {\n text-size: 10;\n\n }\n [zoom=9] {\n text-size:10;\n text-wrap-width: 60;\n }\n [zoom=10] {\n text-size:11;\n text-wrap-width: 70;\n }\n [zoom=11] {\n text-size:12;\n text-character-spacing: 1;\n text-wrap-width: 80;\n }\n [zoom=12] {\n text-size:13;\n text-character-spacing: 1;\n text-wrap-width: 100;\n }\n [zoom=13] {\n text-size:14;\n text-character-spacing: 2;\n text-wrap-width: 200;\n text-transform: uppercase;\n }\n [zoom=14] {\n text-size:15;\n text-character-spacing: 4;\n text-wrap-width: 300;\n text-transform: uppercase;\n }\n [zoom=15] {\n text-size:16;\n text-character-spacing: 6;\n text-wrap-width: 400;\n text-transform: uppercase;\n }\n}\n\n\/* ---- Towns ------------------------------------------------------- *\/\n\n#place::town[type='town'][zoom>=9][zoom<=17] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@town_text;\n text-size:9;\n\n text-wrap-width: 50;\n [zoom>=10] {\n\n text-size: 10;\n }\n [zoom>=11]{ text-size:11; }\n [zoom>=12]{\n text-size:12;\n text-line-spacing: 1;\n }\n [zoom>=13]{\n text-transform: uppercase;\n text-character-spacing: 1;\n text-line-spacing: 2;\n }\n [zoom>=14]{\n text-size:13;\n text-character-spacing: 2;\n text-line-spacing: 3;\n }\n [zoom>=15]{\n text-size:14;\n text-character-spacing: 3;\n text-line-spacing: 4;\n }\n [zoom>=15]{\n text-size:15;\n text-character-spacing: 4;\n text-line-spacing: 5;\n }\n [zoom>=17]{\n text-size:16;\n text-character-spacing: 5;\n text-line-spacing: 6;\n }\n}\n\n\/* ---- Other small places ------------------------------------------ *\/\n\n#place::small[type='village'][zoom>=13],\n#place::small[type='suburb'][zoom>=13],\n#place::small[type='hamlet'][zoom>=13],\n#place::small[type='neighbourhood'][zoom>=13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@other_text;\n text-size:10;\n\n text-wrap-width: 30;\n [zoom>=14] {\n text-size:11;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-line-spacing: 1;\n }\n [zoom>=15] {\n text-halo-radius: 2;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-wrap-width: 60; \n text-line-spacing: 1;\n }\n [zoom>=16] {\n text-size:12;\n text-character-spacing: 2;\n text-wrap-width: 120;\n text-line-spacing: 2;\n } \n [zoom>=17] {\n text-size:13; \n text-character-spacing: 3;\n text-wrap-width: 160;\n text-line-spacing: 4;\n }\n [zoom>=18] {\n text-size:14;\n text-character-spacing: 4;\n text-line-spacing: 6;\n }\n}\n\n#place::small[type='locality'][zoom>=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@locality_text;\n text-size:9;\n\n text-wrap-width: 30;\n [zoom>=16] {\n text-size:10;\n text-wrap-width: 60;\n text-line-spacing: 1;\n }\n [zoom>=17] {\n text-size:11;\n text-wrap-width: 120;\n text-line-spacing: 2;\n }\n [zoom>=18] {\n text-size:12;\n text-character-spacing: 1;\n text-line-spacing: 4;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ AREA LABELS\n\/\/ =====================================================================\n\n#area_label {\n \/\/ Bring in labels gradually as one zooms in, bases on polygon area\n [zoom>=10][area>102400000],\n [zoom>=11][area>25600000],\n [zoom>=13][area>1600000],\n [zoom>=14][area>320000],\n [zoom>=15][area>80000],\n [zoom>=16][area>20000],\n [zoom>=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n text-halo-radius: 1.5;\n text-face-name:@sans;\n text-size: 11;\n text-wrap-width:30;\n\n \/\/ Specific style overrides for different types of areas:\n [type='park'][zoom>=10] {\n text-face-name: @sans_lt_italic;\n text-fill: @black;\n \n }\n [type='golf_course'][zoom>=10] {\n text-fill: @black;\n\n }\n [type='cemetery'][zoom>=10] {\n text-fill: @black;\n\n }\n [type='hospital'][zoom>=10] {\n text-fill: @black;\n\n }\n [type='college'][zoom>=10],\n [type='school'][zoom>=10],\n [type='university'][zoom>=10] {\n text-fill: @black;\n }\n [type='water'][zoom>=10] {\n text-fill: @black;\n }\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom=18][area>5000] {\n text-name: \"[name]\";\n text-size: 13;\n text-wrap-width: 60;\n text-character-spacing: 1;\n\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom=18][area>20000] {\n text-size: 15;\n text-character-spacing: 2;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 20;\n text-character-spacing: 3;\n text-wrap-width: 180;\n }\n}\n \n#poi[type='university'][zoom>=15],\n#poi[type='hospital'][zoom>=16],\n#poi[type='school'][zoom>=17],\n#poi[type='library'][zoom>=17] {\n text-name:\"[name]\";\n text-face-name:@sans;\n text-size:10;\n text-wrap-width:30;\ntext-fill: @black;\n}\n\n\n\/* ================================================================== *\/\n\/* WATERWAY LABELS\n\/* ================================================================== *\/\n\n#waterway_label[type='river'][zoom>=13],\n#waterway_label[type='canal'][zoom>=15],\n#waterway_label[type='stream'][zoom>=17] {\n text-name: '[name]';\n text-face-name: @sans_italic;\n text-fill: @black;\n\n\n text-placement: line;\n text-min-distance: 400;\n text-size: 10;\n [type='river'][zoom=15],\n [type='canal'][zoom=17] {\n text-size: 11;\n }\n [type='river'][zoom>=16],\n [type='canal'][zoom=18] {\n text-size: 14;\n text-spacing: 300;\n }\n}\n\n\/* ================================================================== *\/\n\/* ROAD LABELS\n\/* ================================================================== *\/\n\n#motorway_label[zoom>=11][zoom<=14][reflen<=8] {\n shield-name: \"[ref]\";\n shield-size: 9;\n shield-face-name: @sans_bold;\n shield-fill: #fff;\n shield-file: url(img\/shield-motorway-1.png);\n [type='motorway'] {\n [reflen=1] { shield-file: url(img\/shield-motorway-1.png); }\n [reflen=2] { shield-file: url(img\/shield-motorway-2.png); }\n [reflen=3] { shield-file: url(img\/shield-motorway-3.png); }\n [reflen=4] { shield-file: url(img\/shield-motorway-4.png); }\n [reflen=5] { shield-file: url(img\/shield-motorway-5.png); }\n [reflen=6] { shield-file: url(img\/shield-motorway-6.png); }\n [reflen=7] { shield-file: url(img\/shield-motorway-7.png); }\n [reflen=8] { shield-file: url(img\/shield-motorway-8.png); }\n }\n [type='trunk'] {\n [reflen=1] { shield-file: url(img\/shield-trunk-1.png); }\n [reflen=2] { shield-file: url(img\/shield-trunk-2.png); }\n [reflen=3] { shield-file: url(img\/shield-trunk-3.png); }\n [reflen=4] { shield-file: url(img\/shield-trunk-4.png); }\n [reflen=5] { shield-file: url(img\/shield-trunk-5.png); }\n [reflen=6] { shield-file: url(img\/shield-trunk-6.png); }\n [reflen=7] { shield-file: url(img\/shield-trunk-7.png); }\n [reflen=8] { shield-file: url(img\/shield-trunk-8.png); }\n }\n [zoom=11] { shield-min-distance: 60; } \/\/50\n [zoom=12] { shield-min-distance: 80; } \/\/60\n [zoom=13] { shield-min-distance: 120; } \/\/120\n [zoom=14] { shield-min-distance: 180; }\n}\n\n#motorway_label[type='motorway'][zoom>9],\n#motorway_label[type='trunk'][zoom>9] {\n text-name:\"[name]\";\n text-face-name:@sans_bold;\n text-placement:line;\n text-fill:@road_text;\n\n text-min-distance:60;\n text-size:10;\n [zoom=11] { text-min-distance:70; }\n [zoom=12] { text-min-distance:80; }\n [zoom=13] { text-min-distance:100; }\n}\n\n#mainroad_label[type='primary'][zoom>12],\n#mainroad_label[type='secondary'][zoom>13],\n#mainroad_label[type='tertiary'][zoom>13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-fill:@road_text;\n\n text-min-distance:60;\n text-size:11;\n}\n\n#minorroad_label[zoom>14] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-size:9;\n text-fill:@road_text;\n\n text-min-distance:60;\n text-size:11;\n}\n\n\/* ================================================================== *\/\n\/* ONE-WAY ARROWS\n\/* ================================================================== *\/\n\n#motorway_label[oneway!=0][zoom>=16],\n#mainroad_label[oneway!=0][zoom>=16],\n#minorroad_label[oneway!=0][zoom>=16] {\n marker-placement:line;\n marker-max-error: 0.5;\n marker-spacing: 200;\n marker-file: url(img\/icon\/oneway.svg);\n [oneway=-1] { marker-file: url(img\/icon\/oneway-reverse.svg); }\n [zoom=16] { marker-transform: \"scale(0.5)\"; }\n [zoom=17] { marker-transform: \"scale(0.75)\"; }\n}\n\n\n\/* ****************************************************************** *\/\n","old_contents":"\/* LABELS.MSS CONTENTS:\n * - place names\n * - area labels\n * - waterway labels \n *\/\n\n\/* Font sets are defined in palette.mss *\/\n\n\/* ================================================================== *\/\n\/* PLACE NAMES\n\/* ================================================================== *\/\n\n#place::country[type='country'][zoom>3][zoom<9] {\n text-name:'[name]';\n text-face-name:@sans_bold;\n text-placement:point;\n text-fill:@country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n [zoom=3] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=4] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>4] {\n text-halo-radius: 2;\n }\n [zoom=5] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=6] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=7] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n#place::state[type='state'][zoom>=5][zoom<=10] {\n text-name:'[name]';\n text-face-name:@sans_bold_italic;\n text-placement:point;\n text-fill:@state_text;\n text-halo-fill: @state_halo;\n text-halo-radius: 1;\n [zoom=6] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=7] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>8] {\n text-halo-radius: 2;\n }\n [zoom=8] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=9] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=10] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n\/* ---- Cities ------------------------------------------------------ *\/\n\n#place::city[type='city'][zoom>=8][zoom<=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@city_text;\n text-halo-fill:@city_halo;\n text-halo-radius:2;\n [zoom<=8] {\n text-size: 10;\n text-halo-radius:1;\n }\n [zoom=9] {\n text-size:10;\n text-wrap-width: 60;\n }\n [zoom=10] {\n text-size:11;\n text-wrap-width: 70;\n }\n [zoom=11] {\n text-size:12;\n text-character-spacing: 1;\n text-wrap-width: 80;\n }\n [zoom=12] {\n text-size:13;\n text-character-spacing: 1;\n text-wrap-width: 100;\n }\n [zoom=13] {\n text-size:14;\n text-character-spacing: 2;\n text-wrap-width: 200;\n text-transform: uppercase;\n }\n [zoom=14] {\n text-size:15;\n text-character-spacing: 4;\n text-wrap-width: 300;\n text-transform: uppercase;\n }\n [zoom=15] {\n text-size:16;\n text-character-spacing: 6;\n text-wrap-width: 400;\n text-transform: uppercase;\n }\n}\n\n\/* ---- Towns ------------------------------------------------------- *\/\n\n#place::town[type='town'][zoom>=9][zoom<=17] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@town_text;\n text-size:9;\n text-halo-fill:@town_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n [zoom>=10] {\n text-halo-radius:2;\n text-size: 10;\n }\n [zoom>=11]{ text-size:11; }\n [zoom>=12]{\n text-size:12;\n text-line-spacing: 1;\n }\n [zoom>=13]{\n text-transform: uppercase;\n text-character-spacing: 1;\n text-line-spacing: 2;\n }\n [zoom>=14]{\n text-size:13;\n text-character-spacing: 2;\n text-line-spacing: 3;\n }\n [zoom>=15]{\n text-size:14;\n text-character-spacing: 3;\n text-line-spacing: 4;\n }\n [zoom>=15]{\n text-size:15;\n text-character-spacing: 4;\n text-line-spacing: 5;\n }\n [zoom>=17]{\n text-size:16;\n text-character-spacing: 5;\n text-line-spacing: 6;\n }\n}\n\n\/* ---- Other small places ------------------------------------------ *\/\n\n#place::small[type='village'][zoom>=13],\n#place::small[type='suburb'][zoom>=13],\n#place::small[type='hamlet'][zoom>=13],\n#place::small[type='neighbourhood'][zoom>=13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@other_text;\n text-size:10;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=14] {\n text-size:11;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-line-spacing: 1;\n }\n [zoom>=15] {\n text-halo-radius: 2;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-wrap-width: 60; \n text-line-spacing: 1;\n }\n [zoom>=16] {\n text-size:12;\n text-character-spacing: 2;\n text-wrap-width: 120;\n text-line-spacing: 2;\n } \n [zoom>=17] {\n text-size:13; \n text-character-spacing: 3;\n text-wrap-width: 160;\n text-line-spacing: 4;\n }\n [zoom>=18] {\n text-size:14;\n text-character-spacing: 4;\n text-line-spacing: 6;\n }\n}\n\n#place::small[type='locality'][zoom>=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@locality_text;\n text-size:9;\n text-halo-fill:@locality_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=16] {\n text-size:10;\n text-wrap-width: 60;\n text-line-spacing: 1;\n }\n [zoom>=17] {\n text-size:11;\n text-wrap-width: 120;\n text-line-spacing: 2;\n }\n [zoom>=18] {\n text-size:12;\n text-character-spacing: 1;\n text-line-spacing: 4;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ AREA LABELS\n\/\/ =====================================================================\n\n#area_label {\n \/\/ Bring in labels gradually as one zooms in, bases on polygon area\n [zoom>=10][area>102400000],\n [zoom>=11][area>25600000],\n [zoom>=13][area>1600000],\n [zoom>=14][area>320000],\n [zoom>=15][area>80000],\n [zoom>=16][area>20000],\n [zoom>=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n text-halo-radius: 1.5;\n text-face-name:@sans;\n text-size: 11;\n text-wrap-width:30;\n text-fill: #888;\n text-halo-fill: #fff;\n \/\/ Specific style overrides for different types of areas:\n [type='park'][zoom>=10] {\n text-face-name: @sans_lt_italic;\n text-fill: @park * 0.6;\n text-halo-fill: lighten(@park, 10);\n }\n [type='golf_course'][zoom>=10] {\n text-fill: @sports * 0.6;\n text-halo-fill: lighten(@sports, 10);\n }\n [type='cemetery'][zoom>=10] {\n text-fill: @cemetery * 0.6;\n text-halo-fill: lighten(@cemetery, 10);\n }\n [type='hospital'][zoom>=10] {\n text-fill: @hospital * 0.6;\n text-halo-fill: lighten(@hospital, 10);\n }\n [type='college'][zoom>=10],\n [type='school'][zoom>=10],\n [type='university'][zoom>=10] {\n text-fill: @school * 0.6;\n text-halo-fill: lighten(@school, 10);\n }\n [type='water'][zoom>=10] {\n text-fill: @water * 0.6;\n text-halo-fill: lighten(@water, 10);\n }\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom=18][area>5000] {\n text-name: \"[name]\";\n text-size: 13;\n text-wrap-width: 60;\n text-character-spacing: 1;\n text-halo-radius: 2;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom=18][area>20000] {\n text-size: 15;\n text-character-spacing: 2;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 20;\n text-character-spacing: 3;\n text-wrap-width: 180;\n }\n}\n \n#poi[type='university'][zoom>=15],\n#poi[type='hospital'][zoom>=16],\n#poi[type='school'][zoom>=17],\n#poi[type='library'][zoom>=17] {\n text-name:\"[name]\";\n text-face-name:@sans;\n text-size:10;\n text-wrap-width:30;\n text-fill: @poi_text;\n}\n\n\n\/* ================================================================== *\/\n\/* WATERWAY LABELS\n\/* ================================================================== *\/\n\n#waterway_label[type='river'][zoom>=13],\n#waterway_label[type='canal'][zoom>=15],\n#waterway_label[type='stream'][zoom>=17] {\n text-name: '[name]';\n text-face-name: @sans_italic;\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-placement: line;\n text-min-distance: 400;\n text-size: 10;\n [type='river'][zoom=15],\n [type='canal'][zoom=17] {\n text-size: 11;\n }\n [type='river'][zoom>=16],\n [type='canal'][zoom=18] {\n text-size: 14;\n text-spacing: 300;\n }\n}\n\n\/* ================================================================== *\/\n\/* ROAD LABELS\n\/* ================================================================== *\/\n\n#motorway_label[zoom>=11][zoom<=14][reflen<=8] {\n shield-name: \"[ref]\";\n shield-size: 9;\n shield-face-name: @sans_bold;\n shield-fill: #fff;\n shield-file: url(img\/shield-motorway-1.png);\n [type='motorway'] {\n [reflen=1] { shield-file: url(img\/shield-motorway-1.png); }\n [reflen=2] { shield-file: url(img\/shield-motorway-2.png); }\n [reflen=3] { shield-file: url(img\/shield-motorway-3.png); }\n [reflen=4] { shield-file: url(img\/shield-motorway-4.png); }\n [reflen=5] { shield-file: url(img\/shield-motorway-5.png); }\n [reflen=6] { shield-file: url(img\/shield-motorway-6.png); }\n [reflen=7] { shield-file: url(img\/shield-motorway-7.png); }\n [reflen=8] { shield-file: url(img\/shield-motorway-8.png); }\n }\n [type='trunk'] {\n [reflen=1] { shield-file: url(img\/shield-trunk-1.png); }\n [reflen=2] { shield-file: url(img\/shield-trunk-2.png); }\n [reflen=3] { shield-file: url(img\/shield-trunk-3.png); }\n [reflen=4] { shield-file: url(img\/shield-trunk-4.png); }\n [reflen=5] { shield-file: url(img\/shield-trunk-5.png); }\n [reflen=6] { shield-file: url(img\/shield-trunk-6.png); }\n [reflen=7] { shield-file: url(img\/shield-trunk-7.png); }\n [reflen=8] { shield-file: url(img\/shield-trunk-8.png); }\n }\n [zoom=11] { shield-min-distance: 60; } \/\/50\n [zoom=12] { shield-min-distance: 80; } \/\/60\n [zoom=13] { shield-min-distance: 120; } \/\/120\n [zoom=14] { shield-min-distance: 180; }\n}\n\n#motorway_label[type='motorway'][zoom>9],\n#motorway_label[type='trunk'][zoom>9] {\n text-name:\"[name]\";\n text-face-name:@sans_bold;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:10;\n [zoom=11] { text-min-distance:70; }\n [zoom=12] { text-min-distance:80; }\n [zoom=13] { text-min-distance:100; }\n}\n\n#mainroad_label[type='primary'][zoom>12],\n#mainroad_label[type='secondary'][zoom>13],\n#mainroad_label[type='tertiary'][zoom>13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n#minorroad_label[zoom>14] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-size:9;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n\/* ================================================================== *\/\n\/* ONE-WAY ARROWS\n\/* ================================================================== *\/\n\n#motorway_label[oneway!=0][zoom>=16],\n#mainroad_label[oneway!=0][zoom>=16],\n#minorroad_label[oneway!=0][zoom>=16] {\n marker-placement:line;\n marker-max-error: 0.5;\n marker-spacing: 200;\n marker-file: url(img\/icon\/oneway.svg);\n [oneway=-1] { marker-file: url(img\/icon\/oneway-reverse.svg); }\n [zoom=16] { marker-transform: \"scale(0.5)\"; }\n [zoom=17] { marker-transform: \"scale(0.75)\"; }\n}\n\n\n\/* ****************************************************************** *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"bdf7bcc6ca065f0658cd7863ae827e8a09af498d","subject":"Fixed: Switch to no-space string to make the version value pass validation","message":"Fixed: Switch to no-space string to make the version value pass validation\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/GLOBALS.mss","new_file":"src\/GLOBALS.mss","new_contents":"Version \"2.0.0b3\"\nPluginName \"Sibelius to MEI Exporter\"\nAuthor \"Andrew Hankinson\"\n\n_InitialProgressTitle \"Exporting %s to MEI\"\n_ExportFileIsNull \"You must specify a file to save.\"\n_ScoreError \"Please open a score and try again.\"\n_ExportSuccess \"The file was exported successfully.\"\n_ExportFailure \"The file was not exported because of an error.\"\n_VersionNotSupported \"Versions earlier than Sibelius 7 are not supported.\"\n_ExportingBars \"Exporting to MEI: Bar %s of %s\"\n\n_ObjectAssignedToAllVoicesWarning \"Bar %s, voice %s. %s assigned to all voices will be encoded on voice 1. If this is incorrect, you should explicitly assign the trill object to a voice.\"\n_ObjectHasNoMEISupport \"%s is not supported by MEI at this time.\"\n_ObjectIsOnAnIllogicalObject \"Bar %s, voice %s. %s is added to a %s object. This will create invalid MEI. You should fix this in your Sibelius file if possible, or edit your MEI file after export.\"\n\nLOGFILE \"\/tmp\/sibelius.log\"\n","old_contents":"Version \"2.0.0 beta3\"\nPluginName \"Sibelius to MEI Exporter\"\nAuthor \"Andrew Hankinson\"\n\n_InitialProgressTitle \"Exporting %s to MEI\"\n_ExportFileIsNull \"You must specify a file to save.\"\n_ScoreError \"Please open a score and try again.\"\n_ExportSuccess \"The file was exported successfully.\"\n_ExportFailure \"The file was not exported because of an error.\"\n_VersionNotSupported \"Versions earlier than Sibelius 7 are not supported.\"\n_ExportingBars \"Exporting to MEI: Bar %s of %s\"\n\n_ObjectAssignedToAllVoicesWarning \"Bar %s, voice %s. %s assigned to all voices will be encoded on voice 1. If this is incorrect, you should explicitly assign the trill object to a voice.\"\n_ObjectHasNoMEISupport \"%s is not supported by MEI at this time.\"\n_ObjectIsOnAnIllogicalObject \"Bar %s, voice %s. %s is added to a %s object. This will create invalid MEI. You should fix this in your Sibelius file if possible, or edit your MEI file after export.\"\n\nLOGFILE \"\/tmp\/sibelius.log\"\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"77c31dc3fdafdbc1b3ddb6808ae3c5264817e317","subject":"Don't draw building=no. Also add white fill to bulidings w\/out crosshatching. Closes #41","message":"Don't draw building=no. Also add white fill to bulidings w\/out crosshatching. Closes #41\n","repos":"Andrey-Pavlov\/toner-carto,stamen\/toner-carto","old_file":"map.mss","new_file":"map.mss","new_contents":"@color_physical: #000;\n@color_physical_bright: #fff;\n@color_water: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #000;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc;\n@color_transport_minor: #ccc;\n@color_transport_rail: #444;\n@color_transport_path: #ededed;\n@color_building_outline: #000;\n@color_building_outline_special: #00aeef;\n@color_airport_runways: #eee;\n@color_airport_runways_detail: #f2f2f2;\n\nMap {\n background-color: @color_physical;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#country-shapes-110m {\n line-width: 0.25;\n polygon-fill: @color_administrative_bright;\n}\n\n#land-shapes-110m,\n#country-shapes-50m,\n#country-shapes-10m,\n{\n line-width: 0.25;\n polygon-fill: @color_physical_bright;\n}\n\n.country-boundary {\n line-color: @color_administrative_dark;\n line-width: 0.25;\n}\n\n.country-boundary-10m {\n ::whiteout {\n [zoom>=7] {\n line-color: @color_administrative_bright;\n line-width: 2;\n }\n }\n\n [zoom>=6] {\n line-color: @color_administrative_dark;\n line-width: 1.6;\n }\n\n [zoom>=7] {\n line-width: 1.6;\n line-dasharray: 3,7;\n line-cap: round;\n }\n}\n\n#admin1-lines-50m {\n line-width: 0.35;\n line-color: @color_administrative_dark;\n}\n\n#admin1-lines-10m {\n [zoom>=6][scalerank<10] {\n line-width: 0.6;\n line-color: @color_administrative_dark;\n }\n\n [zoom>=7][scalerank<10] {\n line-width: 1.5;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<10] {\n line-width: 2.0;\n line-color: @color_administrative_medium_high;\n }\n\n [zoom>=9] {\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-110m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 0;\n\n [zoom=7][scalerank<=7] {\n line-width: 2.25;\n }\n\n [zoom=8][scalerank<=8] {\n line-width: 3.25;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=6][scalerank>=3][scalerank<=6] {\n line-width: 0.1;\n }\n\n [zoom=7] {\n [scalerank<=6],\n [scalerank<=7][expressway=1],\n [scalerank<=7][type='Major Highway'],\n [scalerank<=7][type='Secondary Highway'],\n {\n line-width: 0.1;\n }\n\n [scalerank>=3][scalerank<=5] {\n line-width: 1.5;\n }\n }\n\n [zoom=8] {\n [scalerank<=8] {\n line-width: 0.1;\n }\n\n [type='Beltway'],\n [scalerank<=8][expressway=1],\n {\n line-width: 1.5;\n }\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#land,\n.land {\n polygon-fill: @color_physical_bright;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n#buildings-med[type!='no'] {\n [area>=40000] {\n polygon-pattern-file: url(\"images\/stripe_sm.png\");\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n}\n\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=20000] {\n polygon-pattern-file: url(\"images\/stripe_med.png\");\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n [zoom>=16] {\n polygon-fill: @color_physical_bright;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=16000],\n [zoom=16][area>=8000],\n [zoom=17][area>=4000],\n [zoom>=18],\n {\n polygon-pattern-file: url(\"images\/stripe.png\");\n polygon-pattern-alignment: global;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n {\n polygon-pattern-file: url(\"images\/stripe_color.png\");\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-pattern-alignment: global;\n polygon-pattern-file: url(\"images\/halftone2.png\");\n \n [type='nature_reserve'] {\n polygon-pattern-file: url(\"images\/halftone2-transparent.png\");\n }\n}\n\n#brown-areas-low[zoom=10][area>5000000],\n#brown-areas-med[zoom=11][area>1000000],\n#brown-areas-med[zoom=12][area> 500000],\n#brown-areas-med[zoom=12][area> 200000],\n#brown-areas-med[zoom=13][area> 75000],\n#brown-areas-high[zoom=14][area> 10000],\n#brown-areas-high[zoom>14],\n{\n polygon-pattern-alignment: global;\n polygon-pattern-file: url(\"images\/halftone2.png\");\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [zoom>=15] {\n line-color: @color_airport_runways_detail;\n }\n\n [type='runway'] {\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway']\n{\n [zoom>=9] {\n ::outline {\n line-width: 4.25;\n }\n\n line-width: 1.5;\n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 7;\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 42;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 49;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n }\n}\n\n#roads[kind='major_road']\n{\n [zoom<=12] {\n line-color: @color_transport;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n line-width: 1.5;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 17;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads[kind='minor_road']\n{\n [zoom<=14] {\n line-color: #999;\n }\n\n [zoom>=16] {\n line-color: @color_transport_minor;\n }\n\n [zoom>=10] {\n line-width: 0.2;\n }\n\n [zoom>=13] {\n line-width: 0.4;\n }\n\n [zoom>=14] {\n line-width: 0.8;\n }\n\n [zoom>=15] {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 9;\n line-dasharray: 4,7;\n }\n\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 6;\n }\n\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n ::casing {\n line-color: @color_transport_path;\n }\n\n line-color: @color_transport_casing;\n\n [zoom>=15] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 1.5;\n line-cap: butt;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 3;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n","old_contents":"@color_physical: #000;\n@color_physical_bright: #fff;\n@color_water: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #000;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc;\n@color_transport_minor: #ccc;\n@color_transport_rail: #444;\n@color_transport_path: #ededed;\n@color_building_outline: #000;\n@color_building_outline_special: #00aeef;\n@color_airport_runways: #eee;\n@color_airport_runways_detail: #f2f2f2;\n\nMap {\n background-color: @color_physical;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#country-shapes-110m {\n line-width: 0.25;\n polygon-fill: @color_administrative_bright;\n}\n\n#land-shapes-110m,\n#country-shapes-50m,\n#country-shapes-10m,\n{\n line-width: 0.25;\n polygon-fill: @color_physical_bright;\n}\n\n.country-boundary {\n line-color: @color_administrative_dark;\n line-width: 0.25;\n}\n\n.country-boundary-10m {\n ::whiteout {\n [zoom>=7] {\n line-color: @color_administrative_bright;\n line-width: 2;\n }\n }\n\n [zoom>=6] {\n line-color: @color_administrative_dark;\n line-width: 1.6;\n }\n\n [zoom>=7] {\n line-width: 1.6;\n line-dasharray: 3,7;\n line-cap: round;\n }\n}\n\n#admin1-lines-50m {\n line-width: 0.35;\n line-color: @color_administrative_dark;\n}\n\n#admin1-lines-10m {\n [zoom>=6][scalerank<10] {\n line-width: 0.6;\n line-color: @color_administrative_dark;\n }\n\n [zoom>=7][scalerank<10] {\n line-width: 1.5;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<10] {\n line-width: 2.0;\n line-color: @color_administrative_medium_high;\n }\n\n [zoom>=9] {\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-110m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 0;\n\n [zoom=7][scalerank<=7] {\n line-width: 2.25;\n }\n\n [zoom=8][scalerank<=8] {\n line-width: 3.25;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=6][scalerank>=3][scalerank<=6] {\n line-width: 0.1;\n }\n\n [zoom=7] {\n [scalerank<=6],\n [scalerank<=7][expressway=1],\n [scalerank<=7][type='Major Highway'],\n [scalerank<=7][type='Secondary Highway'],\n {\n line-width: 0.1;\n }\n\n [scalerank>=3][scalerank<=5] {\n line-width: 1.5;\n }\n }\n\n [zoom=8] {\n [scalerank<=8] {\n line-width: 0.1;\n }\n\n [type='Beltway'],\n [scalerank<=8][expressway=1],\n {\n line-width: 1.5;\n }\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#land,\n.land {\n polygon-fill: @color_physical_bright;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n#buildings-med {\n [area>=40000] {\n polygon-pattern-file: url(\"images\/stripe_sm.png\");\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n}\n\n#buildings-high {\n [zoom>=14] {\n [area>=20000] {\n polygon-pattern-file: url(\"images\/stripe_med.png\");\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n [zoom>=16] {\n line-width: 0.5;\n }\n\n [zoom=15][area>=16000],\n [zoom=16][area>=8000],\n [zoom=17][area>=4000],\n [zoom>=18],\n {\n polygon-pattern-file: url(\"images\/stripe.png\");\n polygon-pattern-alignment: global;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n {\n polygon-pattern-file: url(\"images\/stripe_color.png\");\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-pattern-alignment: global;\n polygon-pattern-file: url(\"images\/halftone2.png\");\n \n [type='nature_reserve'] {\n polygon-pattern-file: url(\"images\/halftone2-transparent.png\");\n }\n}\n\n#brown-areas-low[zoom=10][area>5000000],\n#brown-areas-med[zoom=11][area>1000000],\n#brown-areas-med[zoom=12][area> 500000],\n#brown-areas-med[zoom=12][area> 200000],\n#brown-areas-med[zoom=13][area> 75000],\n#brown-areas-high[zoom=14][area> 10000],\n#brown-areas-high[zoom>14],\n{\n polygon-pattern-alignment: global;\n polygon-pattern-file: url(\"images\/halftone2.png\");\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [zoom>=15] {\n line-color: @color_airport_runways_detail;\n }\n\n [type='runway'] {\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway']\n{\n [zoom>=9] {\n ::outline {\n line-width: 4.25;\n }\n\n line-width: 1.5;\n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 7;\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 42;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 49;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n }\n}\n\n#roads[kind='major_road']\n{\n [zoom<=12] {\n line-color: @color_transport;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n line-width: 1.5;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::casing {\n line-width: 13;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 17;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads[kind='minor_road']\n{\n [zoom<=14] {\n line-color: #999;\n }\n\n [zoom>=16] {\n line-color: @color_transport_minor;\n }\n\n [zoom>=10] {\n line-width: 0.2;\n }\n\n [zoom>=13] {\n line-width: 0.4;\n }\n\n [zoom>=14] {\n line-width: 0.8;\n }\n\n [zoom>=15] {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 9;\n line-dasharray: 4,7;\n }\n\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 6;\n }\n\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n ::casing {\n line-color: @color_transport_path;\n }\n\n line-color: @color_transport_casing;\n\n [zoom>=15] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 1.5;\n line-cap: butt;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 3;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"b368797d2a221ef2137ba9e78db1e28371b1ed5d","subject":"Corrected typo","message":"Corrected typo","repos":"jeffaudi\/osm-hybrid","old_file":"osm-hybrid\/labels.mss","new_file":"osm-hybrid\/labels.mss","new_contents":"\/* LABELS.MSS CONTENTS:\n * - place names\n * - area labels\n * - waterway labels \n *\/\n\n\/* Font sets are defined in palette.mss *\/\n\n\/* ================================================================== *\/\n\/* PLACE NAMES\n\/* ================================================================== *\/\n\n#place::country[type='country'][zoom>3][zoom<9] {\n text-name:'[name]';\n text-face-name:@sans_bold;\n text-placement:point;\n text-fill:@country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n [zoom=3] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=4] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>4] {\n text-halo-radius: 2;\n }\n [zoom=5] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=6] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=7] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n#place::state[type='state'][zoom>=6][zoom<=10] {\n text-name:'[name]';\n text-face-name:@sans_bold_italic;\n text-placement:point;\n text-fill:@state_text;\n text-halo-fill: @state_halo;\n text-halo-radius: 1;\n [zoom=6] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=7] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>8] {\n text-halo-radius: 2;\n }\n [zoom=8] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=9] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=10] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n\/* ---- Cities ------------------------------------------------------ *\/\n\n#place::city[type='city'][zoom>=9][zoom<=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@city_text;\n text-halo-fill:@city_halo;\n text-halo-radius:2;\n [zoom=9] {\n text-size:12;\n text-wrap-width: 60;\n }\n [zoom=10] {\n text-size:14;\n text-wrap-width: 70;\n }\n [zoom=11] {\n text-size:16;\n text-character-spacing: 1;\n text-wrap-width: 80;\n }\n [zoom=12] {\n text-size:18;\n text-character-spacing: 2;\n text-wrap-width: 200;\n }\n [zoom=13] {\n text-size:20;\n text-character-spacing: 4;\n text-wrap-width: 300;\n text-transform: uppercase;\n }\n [zoom=14] {\n text-size:22;\n text-character-spacing: 10;\n text-wrap-width: 500;\n text-transform: uppercase;\n }\n [zoom=15] {\n text-size:26;\n text-character-spacing: 16;\n text-wrap-width: 800;\n text-transform: uppercase;\n }\n}\n\n\/* ---- Towns ------------------------------------------------------- *\/\n\n#place::town[type='town'][zoom>=9][zoom<=17] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@town_text;\n text-size:9;\n text-halo-fill:@town_halo;\n text-halo-radius:2;\n text-wrap-width: 50;\n [zoom>=10] {\n text-halo-radius:2;\n text-size: 12;\n }\n [zoom>=11]{ \n text-size:14;\n }\n [zoom>=12]{\n text-size:16;\n text-line-spacing: 1;\n }\n [zoom>=13]{\n text-size:18;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-line-spacing: 2;\n }\n [zoom>=14]{\n text-size:20;\n text-character-spacing: 2;\n text-line-spacing: 3;\n }\n [zoom>=15]{\n text-size:22;\n text-character-spacing: 3;\n text-line-spacing: 4;\n }\n [zoom>=16]{\n text-size:24;\n text-character-spacing: 4;\n text-line-spacing: 5;\n }\n [zoom>=17]{\n text-size:26;\n text-character-spacing: 5;\n text-line-spacing: 6;\n }\n}\n\n\/* ---- Other small places ------------------------------------------ *\/\n\n#place::small[type='village'][zoom>=13],\n#place::small[type='suburb'][zoom>=13],\n#place::small[type='hamlet'][zoom>=13],\n#place::small[type='neighbourhood'][zoom>=13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@other_text;\n text-size:10;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=14] {\n text-size:14;\n text-character-spacing: 1;\n text-wrap-width: 120;\n text-line-spacing: 1;\n }\n [zoom>=15] {\n text-size:15;\n text-halo-radius: 2;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-wrap-width: 180; \n text-line-spacing: 1;\n }\n [zoom>=16] {\n text-size:16;\n text-character-spacing: 2;\n text-wrap-width: 240;\n text-line-spacing: 2;\n } \n [zoom>=17] {\n text-size:17; \n text-character-spacing: 3;\n text-wrap-width: 320;\n text-line-spacing: 4;\n }\n [zoom>=18] {\n text-size:18;\n text-character-spacing: 4;\n text-line-spacing: 6;\n }\n}\n\n#place::small[type='locality'][zoom>=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@locality_text;\n text-size:9;\n text-halo-fill:@locality_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=16] {\n text-size:10;\n text-wrap-width: 60;\n text-line-spacing: 1;\n }\n [zoom>=17] {\n text-size:11;\n text-wrap-width: 120;\n text-line-spacing: 2;\n }\n [zoom>=18] {\n text-size:12;\n text-character-spacing: 1;\n text-line-spacing: 4;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ AREA LABELS\n\/\/ =====================================================================\n\n#area_label {\n \/\/ Bring in labels gradually as one zooms in, bases on polygon area\n [zoom>=10][area>102400000],\n [zoom>=11][area>25600000],\n [zoom>=13][area>1600000],\n [zoom>=14][area>320000],\n [zoom>=15][area>80000],\n [zoom>=16][area>20000],\n [zoom>=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n text-halo-radius: 1.5;\n text-face-name:@sans_italic;\n text-size: 11;\n text-wrap-width:30;\n text-fill: @area_text;\n text-halo-fill: @area_halo;\n \/\/ Specific style overrides for different types of areas:\n [type='park'][zoom>=10] {\n text-face-name: @sans_lt_italic;\n text-fill: darken(@park, 70%);\n text-halo-fill: lighten(@park, 10);\n }\n [type='golf_course'][zoom>=10] {\n text-fill: darken(@sports, 70%);\n text-halo-fill: lighten(@sports, 10);\n }\n [type='cemetery'][zoom>=10] {\n text-fill: darken(@cemetery, 70%);\n text-halo-fill: lighten(@cemetery, 10);\n }\n [type='hospital'][zoom>=10] {\n text-fill: darken(@hospital, 70%);\n text-halo-fill: lighten(@hospital, 10);\n }\n [type='college'][zoom>=10],\n [type='school'][zoom>=10],\n [type='university'][zoom>=10] {\n text-fill: darken(@school, 70%);\n text-halo-fill: lighten(@school, 10);\n }\n [type='water'][zoom>=10] {\n text-fill: darken(@water, 70%);\n text-halo-fill: lighten(@water, 10);\n }\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom=18][area>5000] {\n text-name: \"[name]\";\n text-size: 13;\n text-wrap-width: 60;\n text-character-spacing: 1;\n text-halo-radius: 2;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom=18][area>20000] {\n text-size: 15;\n text-character-spacing: 2;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 20;\n text-character-spacing: 3;\n text-wrap-width: 180;\n }\n}\n \n#poi[type='university'][zoom>=15],\n#poi[type='hospital'][zoom>=16],\n#poi[type='school'][zoom>=17],\n#poi[type='library'][zoom>=17] {\n text-name:\"[name]\";\n text-face-name:@sans;\n text-size:10;\n text-wrap-width:30;\n text-fill: @poi_text;\n}\n\n\n\/* ================================================================== *\/\n\/* WATERWAY LABELS\n\/* ================================================================== *\/\n\n#waterway_label[type='river'][zoom>=13],\n#waterway_label[type='canal'][zoom>=15],\n#waterway_label[type='stream'][zoom>=17] {\n text-name: '[name]';\n text-face-name: @sans_italic;\n text-fill: darken(@water, 70%);\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-placement: line;\n text-min-distance: 400;\n text-size: 10;\n [type='river'][zoom=15],\n [type='canal'][zoom=17] {\n text-size: 11;\n }\n [type='river'][zoom>=16],\n [type='canal'][zoom=18] {\n text-size: 14;\n text-spacing: 300;\n }\n}\n\n\/* ================================================================== *\/\n\/* ROAD LABELS\n\/* ================================================================== *\/\n\n#motorway_label[zoom>=11][zoom<=14][reflen<=8] {\n shield-name: \"[ref]\";\n shield-size: 9;\n shield-face-name: @sans_bold;\n shield-fill: #fff;\n shield-file: url(img\/shield-motorway-1.png);\n [type='motorway'] {\n [reflen=1] { shield-file: url(img\/shield-motorway-1.png); }\n [reflen=2] { shield-file: url(img\/shield-motorway-2.png); }\n [reflen=3] { shield-file: url(img\/shield-motorway-3.png); }\n [reflen=4] { shield-file: url(img\/shield-motorway-4.png); }\n [reflen=5] { shield-file: url(img\/shield-motorway-5.png); }\n [reflen=6] { shield-file: url(img\/shield-motorway-6.png); }\n [reflen=7] { shield-file: url(img\/shield-motorway-7.png); }\n [reflen=8] { shield-file: url(img\/shield-motorway-8.png); }\n }\n [type='trunk'] {\n [reflen=1] { shield-file: url(img\/shield-trunk-1.png); }\n [reflen=2] { shield-file: url(img\/shield-trunk-2.png); }\n [reflen=3] { shield-file: url(img\/shield-trunk-3.png); }\n [reflen=4] { shield-file: url(img\/shield-trunk-4.png); }\n [reflen=5] { shield-file: url(img\/shield-trunk-5.png); }\n [reflen=6] { shield-file: url(img\/shield-trunk-6.png); }\n [reflen=7] { shield-file: url(img\/shield-trunk-7.png); }\n [reflen=8] { shield-file: url(img\/shield-trunk-8.png); }\n }\n [zoom=11] { shield-min-distance: 60; } \/\/50\n [zoom=12] { shield-min-distance: 80; } \/\/60\n [zoom=13] { shield-min-distance: 120; } \/\/120\n [zoom=14] { shield-min-distance: 180; }\n}\n\n#motorway_label[type='motorway'][zoom>9],\n#motorway_label[type='trunk'][zoom>9] {\n text-name:\"[name]\";\n text-face-name:@sans_bold;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:10;\n [zoom=11] { text-min-distance:70; }\n [zoom=12] { text-min-distance:80; }\n [zoom=13] { text-min-distance:100; }\n}\n\n#mainroad_label[type='primary'][zoom>12],\n#mainroad_label[type='secondary'][zoom>13],\n#mainroad_label[type='tertiary'][zoom>13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n#minorroad_label[zoom>14] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-size:9;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n\/* ================================================================== *\/\n\/* ONE-WAY ARROWS\n\/* ================================================================== *\/\n\n#motorway_label[oneway!=0][zoom>=16],\n#mainroad_label[oneway!=0][zoom>=16],\n#minorroad_label[oneway!=0][zoom>=16] {\n marker-placement:line;\n marker-max-error: 0.5;\n marker-spacing: 200;\n marker-file: url(img\/icon\/oneway.svg);\n [oneway=-1] { marker-file: url(img\/icon\/oneway-reverse.svg); }\n [zoom=16] { marker-transform: \"scale(0.5)\"; }\n [zoom=17] { marker-transform: \"scale(0.75)\"; }\n}\n\n\n\/* ****************************************************************** *\/\n","old_contents":"\/* LABELS.MSS CONTENTS:\n * - place names\n * - area labels\n * - waterway labels \n *\/\n\n\/* Font sets are defined in palette.mss *\/\n\n\/* ================================================================== *\/\n\/* PLACE NAMES\n\/* ================================================================== *\/\n\n#place::country[type='country'][zoom>3][zoom<9] {\n text-name:'[name]';\n text-face-name:@sans_bold;\n text-placement:point;\n text-fill:@country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n [zoom=3] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=4] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>4] {\n text-halo-radius: 2;\n }\n [zoom=5] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=6] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=7] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n#place::state[type='state'][zoom>=6][zoom<=10] {\n text-name:'[name]';\n text-face-name:@sans_bold_italic;\n text-placement:point;\n text-fill:@state_text;\n text-halo-fill: @state_halo;\n text-halo-radius: 1;\n [zoom=6] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=7] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>8] {\n text-halo-radius: 2;\n }\n [zoom=8] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=9] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=10] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n\/* ---- Cities ------------------------------------------------------ *\/\n\n#place::city[type='city'][zoom>=8][zoom<=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@city_text;\n text-halo-fill:@city_halo;\n text-halo-radius:2;\n [zoom<=8] {\n text-size: 11;\n text-halo-radius:2;\n }\n [zoom=9] {\n text-size:12;\n text-wrap-width: 60;\n }\n [zoom=10] {\n text-size:14;\n text-wrap-width: 70;\n }\n [zoom=11] {\n text-size:16;\n text-character-spacing: 1;\n text-wrap-width: 80;\n }\n [zoom=12] {\n text-size:18;\n text-character-spacing: 2;\n text-wrap-width: 200;\n }\n [zoom=13] {\n text-size:20;\n text-character-spacing: 4;\n text-wrap-width: 300;\n text-transform: uppercase;\n }\n [zoom=14] {\n text-size:22;\n text-character-spacing: 10;\n text-wrap-width: 500;\n text-transform: uppercase;\n }\n [zoom=15] {\n text-size:26;\n text-character-spacing: 16;\n text-wrap-width: 800;\n text-transform: uppercase;\n }\n}\n\n\/* ---- Towns ------------------------------------------------------- *\/\n\n#place::town[type='town'][zoom>=9][zoom<=17] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@town_text;\n text-size:9;\n text-halo-fill:@town_halo;\n text-halo-radius:2;\n text-wrap-width: 50;\n [zoom>=10] {\n text-halo-radius:2;\n text-size: 12;\n }\n [zoom>=11]{ \n text-size:14;\n }\n [zoom>=12]{\n text-size:16;\n text-line-spacing: 1;\n }\n [zoom>=13]{\n text-size:18;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-line-spacing: 2;\n }\n [zoom>=14]{\n text-size:20;\n text-character-spacing: 2;\n text-line-spacing: 3;\n }\n [zoom>=15]{\n text-size:22;\n text-character-spacing: 3;\n text-line-spacing: 4;\n }\n [zoom>=16]{\n text-size:24;\n text-character-spacing: 4;\n text-line-spacing: 5;\n }\n [zoom>=17]{\n text-size:26;\n text-character-spacing: 5;\n text-line-spacing: 6;\n }\n}\n\n\/* ---- Other small places ------------------------------------------ *\/\n\n#place::small[type='village'][zoom>=13],\n#place::small[type='suburb'][zoom>=13],\n#place::small[type='hamlet'][zoom>=13],\n#place::small[type='neighbourhood'][zoom>=13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@other_text;\n text-size:10;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=14] {\n text-size:14;\n text-character-spacing: 1;\n text-wrap-width: 120;\n text-line-spacing: 1;\n }\n [zoom>=15] {\n text-size:15;\n text-halo-radius: 2;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-wrap-width: 180; \n text-line-spacing: 1;\n }\n [zoom>=16] {\n text-size:16;\n text-character-spacing: 2;\n text-wrap-width: 240;\n text-line-spacing: 2;\n } \n [zoom>=17] {\n text-size:17; \n text-character-spacing: 3;\n text-wrap-width: 320;\n text-line-spacing: 4;\n }\n [zoom>=18] {\n text-size:18;\n text-character-spacing: 4;\n text-line-spacing: 6;\n }\n}\n\n#place::small[type='locality'][zoom>=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@locality_text;\n text-size:9;\n text-halo-fill:@locality_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=16] {\n text-size:10;\n text-wrap-width: 60;\n text-line-spacing: 1;\n }\n [zoom>=17] {\n text-size:11;\n text-wrap-width: 120;\n text-line-spacing: 2;\n }\n [zoom>=18] {\n text-size:12;\n text-character-spacing: 1;\n text-line-spacing: 4;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ AREA LABELS\n\/\/ =====================================================================\n\n#area_label {\n \/\/ Bring in labels gradually as one zooms in, bases on polygon area\n [zoom>=10][area>102400000],\n [zoom>=11][area>25600000],\n [zoom>=13][area>1600000],\n [zoom>=14][area>320000],\n [zoom>=15][area>80000],\n [zoom>=16][area>20000],\n [zoom>=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n text-halo-radius: 1.5;\n text-face-name:@sans_italic;\n text-size: 11;\n text-wrap-width:30;\n text-fill: @area_halo;\n text-halo-fill: @area_halo;\n \/\/ Specific style overrides for different types of areas:\n [type='park'][zoom>=10] {\n text-face-name: @sans_lt_italic;\n text-fill: darken(@park, 70%);\n text-halo-fill: lighten(@park, 10);\n }\n [type='golf_course'][zoom>=10] {\n text-fill: darken(@sports, 70%);\n text-halo-fill: lighten(@sports, 10);\n }\n [type='cemetery'][zoom>=10] {\n text-fill: darken(@cemetery, 70%);\n text-halo-fill: lighten(@cemetery, 10);\n }\n [type='hospital'][zoom>=10] {\n text-fill: darken(@hospital, 70%);\n text-halo-fill: lighten(@hospital, 10);\n }\n [type='college'][zoom>=10],\n [type='school'][zoom>=10],\n [type='university'][zoom>=10] {\n text-fill: darken(@school, 70%);\n text-halo-fill: lighten(@school, 10);\n }\n [type='water'][zoom>=10] {\n text-fill: darken(@water, 70%);\n text-halo-fill: lighten(@water, 10);\n }\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom=18][area>5000] {\n text-name: \"[name]\";\n text-size: 13;\n text-wrap-width: 60;\n text-character-spacing: 1;\n text-halo-radius: 2;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom=18][area>20000] {\n text-size: 15;\n text-character-spacing: 2;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 20;\n text-character-spacing: 3;\n text-wrap-width: 180;\n }\n}\n \n#poi[type='university'][zoom>=15],\n#poi[type='hospital'][zoom>=16],\n#poi[type='school'][zoom>=17],\n#poi[type='library'][zoom>=17] {\n text-name:\"[name]\";\n text-face-name:@sans;\n text-size:10;\n text-wrap-width:30;\n text-fill: @poi_text;\n}\n\n\n\/* ================================================================== *\/\n\/* WATERWAY LABELS\n\/* ================================================================== *\/\n\n#waterway_label[type='river'][zoom>=13],\n#waterway_label[type='canal'][zoom>=15],\n#waterway_label[type='stream'][zoom>=17] {\n text-name: '[name]';\n text-face-name: @sans_italic;\n text-fill: darken(@water, 70%);\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-placement: line;\n text-min-distance: 400;\n text-size: 10;\n [type='river'][zoom=15],\n [type='canal'][zoom=17] {\n text-size: 11;\n }\n [type='river'][zoom>=16],\n [type='canal'][zoom=18] {\n text-size: 14;\n text-spacing: 300;\n }\n}\n\n\/* ================================================================== *\/\n\/* ROAD LABELS\n\/* ================================================================== *\/\n\n#motorway_label[zoom>=11][zoom<=14][reflen<=8] {\n shield-name: \"[ref]\";\n shield-size: 9;\n shield-face-name: @sans_bold;\n shield-fill: #fff;\n shield-file: url(img\/shield-motorway-1.png);\n [type='motorway'] {\n [reflen=1] { shield-file: url(img\/shield-motorway-1.png); }\n [reflen=2] { shield-file: url(img\/shield-motorway-2.png); }\n [reflen=3] { shield-file: url(img\/shield-motorway-3.png); }\n [reflen=4] { shield-file: url(img\/shield-motorway-4.png); }\n [reflen=5] { shield-file: url(img\/shield-motorway-5.png); }\n [reflen=6] { shield-file: url(img\/shield-motorway-6.png); }\n [reflen=7] { shield-file: url(img\/shield-motorway-7.png); }\n [reflen=8] { shield-file: url(img\/shield-motorway-8.png); }\n }\n [type='trunk'] {\n [reflen=1] { shield-file: url(img\/shield-trunk-1.png); }\n [reflen=2] { shield-file: url(img\/shield-trunk-2.png); }\n [reflen=3] { shield-file: url(img\/shield-trunk-3.png); }\n [reflen=4] { shield-file: url(img\/shield-trunk-4.png); }\n [reflen=5] { shield-file: url(img\/shield-trunk-5.png); }\n [reflen=6] { shield-file: url(img\/shield-trunk-6.png); }\n [reflen=7] { shield-file: url(img\/shield-trunk-7.png); }\n [reflen=8] { shield-file: url(img\/shield-trunk-8.png); }\n }\n [zoom=11] { shield-min-distance: 60; } \/\/50\n [zoom=12] { shield-min-distance: 80; } \/\/60\n [zoom=13] { shield-min-distance: 120; } \/\/120\n [zoom=14] { shield-min-distance: 180; }\n}\n\n#motorway_label[type='motorway'][zoom>9],\n#motorway_label[type='trunk'][zoom>9] {\n text-name:\"[name]\";\n text-face-name:@sans_bold;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:10;\n [zoom=11] { text-min-distance:70; }\n [zoom=12] { text-min-distance:80; }\n [zoom=13] { text-min-distance:100; }\n}\n\n#mainroad_label[type='primary'][zoom>12],\n#mainroad_label[type='secondary'][zoom>13],\n#mainroad_label[type='tertiary'][zoom>13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n#minorroad_label[zoom>14] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-size:9;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n\/* ================================================================== *\/\n\/* ONE-WAY ARROWS\n\/* ================================================================== *\/\n\n#motorway_label[oneway!=0][zoom>=16],\n#mainroad_label[oneway!=0][zoom>=16],\n#minorroad_label[oneway!=0][zoom>=16] {\n marker-placement:line;\n marker-max-error: 0.5;\n marker-spacing: 200;\n marker-file: url(img\/icon\/oneway.svg);\n [oneway=-1] { marker-file: url(img\/icon\/oneway-reverse.svg); }\n [zoom=16] { marker-transform: \"scale(0.5)\"; }\n [zoom=17] { marker-transform: \"scale(0.75)\"; }\n}\n\n\n\/* ****************************************************************** *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"77cc963062f7fac379b98cd8566cb2cf68ebe36a","subject":"Fewer colors","message":"Fewer colors\n","repos":"OpenBounds\/MapStyles","old_file":"PublicLands.tm2\/style.mss","new_file":"PublicLands.tm2\/style.mss","new_contents":"Map { font-directory: url(\".\/fonts\"); }\n\n#lands {\n\tpolygon-opacity:1;\n line-width:1;\n line-color:black;\n\t[adminLevel='state'] {\n \tpolygon-fill:green;\n\t}\n\t[adminLevel='county'] {\n \tpolygon-fill:yellow;\n\t}\n\t[adminLevel='local'] {\n \tpolygon-fill:blue;\n\t}\n\t[adminAgency='Bureau of Land Management'] {\n\t\tpolygon-fill: red;\n\t}\n\t[adminAgency='Bureau of Reclamation']{\n\t\tpolygon-fill: #49006a;\n\t}\n\t[adminAgency='Forest Service']{\n\t\tpolygon-fill: #238b45;\n\t}\n\t[adminAgency='National Park Service']{\n\t\tpolygon-fill: #FE2EC8;\n\t}\n\t[adminAgency='Department of Defense']{\n\t\tpolygon-fill: #67000d;\n\t}\n\t[adminAgency='Army Corps of Engineers'] {\n\t\tpolygon-fill: #67000d;\n\t}\n\t[adminAgency='Army'] {\n polygon-fill: #67000d;\n }\n\t[adminAgency='Air Force'] {\n polygon-fill: #67000d;\n }\n\t[adminAgency='Navy'] {\n polygon-fill: #67000d;\n }\t\n\t[adminAgency='Department of Energy']{\n\t\tpolygon-fill: #49006a;\n\t}\n\t[adminAgency='Department of Agriculture']{\n\t\tpolygon-fill: #49006a;\n\t}\n\t[adminAgency='Coast Guard']{\n\t\tpolygon-fill: #67000d;\n\t}\n\t[adminAgency='Department of Transportation']{\n\t\tpolygon-fill: #49006a;\n\t}\n\t[adminAgency='Fish & Wildlife Service']{\n\t\tpolygon-fill: #0489B1;\n\t}\n\t[adminAgency='National Aeronautics and Space Administration']{\n\t\tpolygon-fill: #49006a;\n\t}\n\t[adminAgency='International Boundary & Water Commission']{\n\t\tpolygon-fill: #49006a;\n\t}\n\t[adminAgency='Tennessee Valley Authority']{\n\t\tpolygon-fill: #49006a;\n\t}\n\t[adminAgency='Bureau of Indian Affairs']{\n\t\tpolygon-fill: #49006a;\n\t}\n\t[adminAgency='Department of the Interior']{\n\t\tpolygon-fill: #49006a;\n\t}\n\t[adminAgency='National Center for Atmospheric Research']{\n\t\tpolygon-fill: #49006a;\n\t}\n\t[adminAgency='National Institute of Standards and Technology']{\n\t\tpolygon-fill: #49006a;\n\t}\n\t[adminAgency='Department of Justice']{\n polygon-fill: #49006a;\n }\n\t[adminAgency='Department of Commerce']{\n polygon-fill: #49006a;\n }\n\t[adminAgency='Department of Veterans Affairs']{\n polygon-fill: #49006a;\n }\n\t[adminAgency='Federal Aviation Administration']{\n polygon-fill: #49006a;\n }\n\t[adminAgency='Bureau of Indian Affairs'] {\n polygon-fill: #49006a;\n }\n\t[adminAgency='Bonneville Power Administration'] {\n polygon-fill: #49006a;\n }\n\t[adminAgency='Federal Government'] {\n polygon-fill: #49006a;\n }\n\t[adminAgency='Federal Highway Administration'] {\n polygon-fill: #49006a;\n }\n\t[adminAgency='Fire Administration'] {\n polygon-fill: #49006a;\n }\n\t[adminAgency='International Boundary & Water Commission'] {\n polygon-fill: #49006a;\n }\n\t[adminAgency='Marine Corps'] {\n polygon-fill: #67000d;\n }\n\t[adminAgency='National Marine Fisheries Service'] {\n polygon-fill: #49006a;\n }\n\t[adminAgency='Natural Resources Conservation Service'] {\n polygon-fill: #49006a;\n }\n\t[adminAgency='Smithsonian'] {\n polygon-fill: #49006a;\n }\n\t[adminAgency='Smithsonian Environmental Research Center'] {\n polygon-fill: #49006a;\n }\n}\n\n#lands_label {\n text-face-name: 'Noto Sans Regular';\n text-name:'[loc_nm]';\n text-size: 12;\n text-placement:line;\n text-fill:black;\n text-min-padding:1;\n text-wrap-width:100;\n}\n\n","old_contents":"Map { font-directory: url(\".\/fonts\"); }\n\n#lands {\n\tpolygon-opacity:1;\n line-width:1;\n line-color:black;\n\t[adminLevel='state'] {\n \tpolygon-fill:green;\n\t}\n\t[adminLevel='county'] {\n \tpolygon-fill:yellow;\n\t}\n\t[adminLevel='local'] {\n \tpolygon-fill:blue;\n\t}\n\t[adminAgency='Bureau of Land Management'] {\n\t\tpolygon-fill: red;\n\t}\n\t[adminAgency='Bureau of Reclamation']{\n\t\tpolygon-fill: #0080FF;\n\t}\n\t[adminAgency='Forest Service']{\n\t\tpolygon-fill: #238b45;\n\t}\n\t[adminAgency='National Park Service']{\n\t\tpolygon-fill: #01DF01;\n\t}\n\t[adminAgency='Department of Defense']{\n\t\tpolygon-fill: #67000d;\n\t}\n\t[adminAgency='Army Corps of Engineers'] {\n\t\tpolygon-fill: #a50f15;\n\t}\n\t[adminAgency='Army'] {\n polygon-fill: #5E610B;\n }\n\t[adminAgency='Air Force'] {\n polygon-fill: #A9F5F2;\n }\n\t[adminAgency='Navy'] {\n polygon-fill: #01DFD7;\n }\t\n\t[adminAgency='Department of Energy']{\n\t\tpolygon-fill: #F5A9F2;\n\t}\n\t[adminAgency='Department of Agriculture']{\n\t\tpolygon-fill: #FF8000;\n\t}\n\t[adminAgency='Coast Guard']{\n\t\tpolygon-fill: #0000FF;\n\t}\n\t[adminAgency='Department of Transportation']{\n\t\tpolygon-fill: #636363;\n\t}\n\t[adminAgency='Fish & Wildlife Service']{\n\t\tpolygon-fill: #a1d99b;\n\t}\n\t[adminAgency='National Aeronautics and Space Administration']{\n\t\tpolygon-fill: #000;\n\t}\n\t[adminAgency='International Boundary & Water Commission']{\n\t\tpolygon-fill: #49006a;\n\t}\n\t[adminAgency='Tennessee Valley Authority']{\n\t\tpolygon-fill: #7a0177;\n\t}\n\t[adminAgency='Bureau of Indian Affairs']{\n\t\tpolygon-fill: #e34a33;\n\t}\n\t[adminAgency='Department of the Interior']{\n\t\tpolygon-fill: #02818a;\n\t}\n\t[adminAgency='National Center for Atmospheric Research']{\n\t\tpolygon-fill: #d0d1e6;\n\t}\n\t[adminAgency='National Institute of Standards and Technology']{\n\t\tpolygon-fill: #ef3b2c;\n\t}\n\t[adminAgency='Department of Justice']{\n polygon-fill: #FE2E64;\n }\n\t[adminAgency='Department of Commerce']{\n polygon-fill: #CEF6D8;\n }\n\t[adminAgency='Department of Veterans Affairs']{\n polygon-fill: #61380B;\n }\n\t[adminAgency='Federal Aviation Administration']{\n polygon-fill: #fff;\n }\n\t[adminAgency='Bureau of Indian Affairs'] {\n polygon-fill: #F6CECE;\n }\n\t[adminAgency='Bonneville Power Administration'] {\n polygon-fill: #F7BE81;\n }\n\t[adminAgency='Federal Government'] {\n polygon-fill: #49006a;\n }\n\t[adminAgency='Federal Highway Administration'] {\n polygon-fill: #210B61;\n }\n\t[adminAgency='Fire Administration'] {\n polygon-fill: #21610B;\n }\n\t[adminAgency='International Boundary & Water Commission'] {\n polygon-fill: #424242;\n }\n\t[adminAgency='Marine Corps'] {\n polygon-fill: #AEB404;\n }\n\t[adminAgency='National Marine Fisheries Service'] {\n polygon-fill: #088A85;\n }\n\t[adminAgency='Natural Resources Conservation Service'] {\n polygon-fill: #3B170B;\n }\n\t[adminAgency='Smithsonian'] {\n polygon-fill: #DF01D7;\n }\n\t[adminAgency='Smithsonian Environmental Research Center'] {\n polygon-fill: #DF01D7;\n }\n}\n\n#lands_label {\n text-face-name: 'Noto Sans Regular';\n text-name:'[loc_nm]';\n text-size: 12;\n text-placement:line;\n text-fill:black;\n text-min-padding:1;\n text-wrap-width:100;\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"97c90b03f406f23d31a000afcd2d9c31b91dda13","subject":"removed empty style.mss file","message":"removed empty style.mss file\n","repos":"mapbox\/mapbox-studio-run-bike-and-hike.tm2,mapbox\/mapbox-studio-run-bike-and-hike.tm2","old_file":"style.mss","new_file":"style.mss","new_contents":"","old_contents":"\n\n\n\/","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"45ee519c16e66ad93c89c74cf8de9a3bcaa58b87","subject":"Corrected minor error in city halo","message":"Corrected minor error in city halo","repos":"jeffaudi\/osm-hybrid","old_file":"osm-hybrid\/palette.mss","new_file":"osm-hybrid\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM HYBRID for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt:\t\"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \n\t\t\"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\",\n\t\t\"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\",\n\t\t\"unifont Medium\";\n\n@sans:\t\t\"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\",\n\t\t\"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\",\n\t\t\"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\",\n\t\t\"unifont Medium\";\n\n@sans_italic:\t\"Open Sans Semibold Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\",\n\t\t\"TSCu_Paranar Italic\", \"Mallige NormalItalic\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\",\n\t\t\"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold:\t\"Open Sans Bold\", \"DejaVu Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \n\t\t\"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\",\n\t\t\"Unifont Medium\", \"unifont Medium\"; \n\n\n@sans_lt_italic:\t\"Open Sans Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\",\n\t\t\t\"TSCu_Paranar Italic\", \"Mallige NormalItalic\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n\t\t\t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold_italic:\t\"Open Sans Bold Italic\", \"DejaVu Sans Bold Italic\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\",\n\t\t\t\"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\", \"DejaVu Sans Book\",\n\t\t\t\"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\",\n \t\"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #FCFBE7;\n@water: #C4DFF6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #DAF2C1;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n@building: #E4E0E0;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #E65C5C;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #E68A5C;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n@primary_line: #FFC859;\n@primary_fill: lighten(@primary_line,10%);\n@primary_case: @primary_line * 0.9;\n\n@secondary_line: #FFE873;\n@secondary_fill: lighten(@secondary_line,10%);\n@secondary_case: @secondary_line * 0.9;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #eee;\n@admin_3: #999;\n@admin_4: #60f;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,30%);\n@place_halo_rev: fadeout(#000,30%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #eee;\n@city_halo: @place_halo_rev;\n\n@town_text: #444;\n@town_halo: @place_halo;\n\n@poi_text: #666;\n\n@road_text: #777;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #60f;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n\n\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM HYBRID for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt:\t\"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \n\t\t\"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\",\n\t\t\"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\",\n\t\t\"unifont Medium\";\n\n@sans:\t\t\"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\",\n\t\t\"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\",\n\t\t\"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\",\n\t\t\"unifont Medium\";\n\n@sans_italic:\t\"Open Sans Semibold Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\",\n\t\t\"TSCu_Paranar Italic\", \"Mallige NormalItalic\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\",\n\t\t\"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold:\t\"Open Sans Bold\", \"DejaVu Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \n\t\t\"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\",\n\t\t\"Unifont Medium\", \"unifont Medium\"; \n\n\n@sans_lt_italic:\t\"Open Sans Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\",\n\t\t\t\"TSCu_Paranar Italic\", \"Mallige NormalItalic\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n\t\t\t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold_italic:\t\"Open Sans Bold Italic\", \"DejaVu Sans Bold Italic\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\",\n\t\t\t\"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\", \"DejaVu Sans Book\",\n\t\t\t\"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\",\n \t\"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #FCFBE7;\n@water: #C4DFF6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #DAF2C1;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n@building: #E4E0E0;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #E65C5C;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #E68A5C;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n@primary_line: #FFC859;\n@primary_fill: lighten(@primary_line,10%);\n@primary_case: @primary_line * 0.9;\n\n@secondary_line: #FFE873;\n@secondary_fill: lighten(@secondary_line,10%);\n@secondary_case: @secondary_line * 0.9;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #eee;\n@admin_3: #999;\n@admin_4: #60f;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,15%);\n@place_halo_rev: fadeout(#fff,85%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #eee;\n@city_halo: @place_halo_rev;\n\n@town_text: #444;\n@town_halo: @place_halo;\n\n@poi_text: #666;\n\n@road_text: #777;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #60f;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n\n\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"abd58594ad742992eb5b1db7c1aae039f0d1cff0","subject":"Color tweaks, Unicode fix","message":"Color tweaks, Unicode fix\n","repos":"silph-io\/osm-silph","old_file":"osm-bright\/palette.mss","new_file":"osm-bright\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";*\/\n\n\n@sans_lt_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans_bold: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_bold_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold Italic\",\"DejaVu Sans Bold Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #F0EDE5;\n@water: #C4DFF6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #DAF2C1;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n@building: #E2DED2;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #E65C5C;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #E65822;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n@primary_line: #FFC859;\n@primary_fill: lighten(@primary_line,10%);\n@primary_case: @primary_line * 0.9;\n\n@secondary_line: #CD9120;\n@secondary_fill: #E4C049;\n@secondary_case: @secondary_line * 0.9;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,34%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n@poi_text: #888;\n\n@road_text: #777;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n\n\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";*\/\n\n\n@sans_lt_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans_bold: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_bold_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold Italic\",\"DejaVu Sans Bold Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #F0EDE5;\n@water: #C4DFF6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #DAF2C1;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n@building: #E2DED2;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #E65C5C;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #E68A5C;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n@primary_line: #FFC859;\n@primary_fill: lighten(@primary_line,10%);\n@primary_case: @primary_line * 0.9;\n\n@secondary_line: #FFE873;\n@secondary_fill: lighten(@secondary_line,10%);\n@secondary_case: @secondary_line * 0.9;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,34%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n@poi_text: #888;\n\n@road_text: #777;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n\n\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"eb72843d7971439d5dfceb66c39e4944f884bc0d","subject":"Remove outdated comment","message":"Remove outdated comment\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportProcessors.mss","new_file":"src\/ExportProcessors.mss","new_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = sibmei2.GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = sibmei2.GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer) {\n \/\/$module(ExportProcessors.mss)\n next_obj = bobj.NextItem(bobj.VoiceNumber, 'NoteRest');\n ret = null;\n\n if (bobj.Duration < 256)\n {\n \/\/ if this object is an eighth note but is not beamed, and if the\n \/\/ active beam is set, null out the active beam and return null.\n if (bobj.Beam = NoBeam and layer._property:ActiveBeamId != null)\n {\n layer._property:ActiveBeamId = null;\n return ret;\n }\n\n \/*\n It's possible that Sibelius records a 'continue beam' at the start\n of a beamed group. Visually, this doesn't look out of place if the previous\n note was a quarter note or higher. \n \n The first check we do is if the note has a 'continue beam' attribute and\n the previous note has a duration higher than 256 (quarter) then we probably have\n a false negative (i.e., there is the start of a beam, but it isn't necessarily\n encoded correctly).\n *\/\n falseNegative = False;\n\n if (bobj.Beam = ContinueBeam and layer._property:ActiveBeamId = null)\n {\n \/\/ by all accounts this should be a beamed note, but we'll need to double-check.\n prev_obj = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n if (prev_obj != null and (prev_obj.Duration >= 256))\n {\n falseNegative = True;\n }\n }\n\n if (next_obj != null and (bobj.Beam = StartBeam or falseNegative = True) and next_obj.Beam = ContinueBeam)\n {\n \/\/ if:\n \/\/ - we're not at the end of the bar\n \/\/ - we have a start beam\n \/\/ - the next note is a continue beam\n beam = libmei.Beam();\n layer._property:ActiveBeamId = beam._id;\n\n \/\/ return the beam so that we can add it to the tree.\n ret = beam;\n }\n\n if (layer._property:ActiveBeamId != null and bobj.Beam = ContinueBeam)\n {\n \/\/ add the note to the beam, but return null\n \/\/ so that we don't add it again to the tree.\n beamid = layer._property:ActiveBeamId;\n beam = libmei.getElementById(beamid);\n\n ret = beam;\n }\n }\n else\n {\n if (layer._property:ActiveBeamId != null)\n {\n \/\/ this is a break in any active beam, so register it as such.\n layer._property:ActiveBeamId = null;\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction ProcessTuplet (bobj, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.ParentTupletIfAny = null)\n {\n return null;\n }\n\n if (layer._property:ActiveTupletId = null)\n {\n tupletObject = bobj.ParentTupletIfAny;\n\n tuplet = libmei.Tuplet();\n\n layer._property:ActiveTupletObject = tupletObject;\n layer._property:ActiveTupletId = tuplet._id;\n\n if (libmei.GetName(meielement) = 'beam')\n {\n \/\/ get the first child\n startid = meielement.children[0];\n }\n else\n {\n startid = meielement._id;\n }\n\n libmei.AddAttribute(tuplet, 'startid', '#' & startid);\n libmei.AddAttribute(tuplet, 'num', tupletObject.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObject.Right);\n\n tupletStyle = tupletObject.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObject.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n return tuplet;\n\n \/\/ used for tuplet spans...\n \/\/ mlines = Self._property:MeasureLines;\n \/\/ mlines.Push(tuplet._id);\n }\n else\n {\n tid = layer._property:ActiveTupletId;\n t = libmei.getElementById(tid);\n\n if (IsLastNoteInTuplet(bobj))\n {\n libmei.AddAttribute(t, 'endid', '#' & meielement._id);\n layer._property:ActiveTupletObject = null;\n layer._property:ActiveTupletId = null;\n }\n\n return t;\n }\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (j = 0)\n {\n libmei.AddAttribute(sylel, 'wordpos', 'i'); \/\/ 'initial'\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n if (name = 'chord')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'chord'));\n }\n\n libmei.AddChild(obj, verse);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n spclbarlines[bar.BarNumber] = ConvertBarline(bobj.BarlineInternalType);\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so \n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessSymbol (sobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureLines;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mlines = Self._property:MeasureLines;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mlines = Self._property:MeasureLines;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureLines;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureLines;\n mlines.Push(turn._id);\n }\n\n case ('242')\n {\n \/\/ triple staccato\n return null;\n }\n }\n} \/\/$end\n","old_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '3.0.0');\n\n header = sibmei2.GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = sibmei2.GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer) {\n \/\/$module(ExportProcessors.mss)\n next_obj = bobj.NextItem(bobj.VoiceNumber, 'NoteRest');\n ret = null;\n\n if (bobj.Duration < 256)\n {\n \/\/ if this object is an eighth note but is not beamed, and if the\n \/\/ active beam is set, null out the active beam and return null.\n if (bobj.Beam = NoBeam and layer._property:ActiveBeamId != null)\n {\n layer._property:ActiveBeamId = null;\n return ret;\n }\n\n \/*\n It's possible that Sibelius records a 'continue beam' at the start\n of a beamed group. Visually, this doesn't look out of place if the previous\n note was a quarter note or higher. \n \n The first check we do is if the note has a 'continue beam' attribute and\n the previous note has a duration higher than 256 (quarter) then we probably have\n a false negative (i.e., there is the start of a beam, but it isn't necessarily\n encoded correctly).\n *\/\n falseNegative = False;\n\n if (bobj.Beam = ContinueBeam and layer._property:ActiveBeamId = null)\n {\n \/\/ by all accounts this should be a beamed note, but we'll need to double-check.\n prev_obj = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n if (prev_obj != null and (prev_obj.Duration >= 256))\n {\n falseNegative = True;\n }\n }\n\n if (next_obj != null and (bobj.Beam = StartBeam or falseNegative = True) and next_obj.Beam = ContinueBeam)\n {\n \/\/ if:\n \/\/ - we're not at the end of the bar\n \/\/ - we have a start beam\n \/\/ - the next note is a continue beam\n beam = libmei.Beam();\n layer._property:ActiveBeamId = beam._id;\n\n \/\/ return the beam so that we can add it to the tree.\n ret = beam;\n }\n\n if (layer._property:ActiveBeamId != null and bobj.Beam = ContinueBeam)\n {\n \/\/ add the note to the beam, but return null\n \/\/ so that we don't add it again to the tree.\n beamid = layer._property:ActiveBeamId;\n beam = libmei.getElementById(beamid);\n\n ret = beam;\n }\n }\n else\n {\n if (layer._property:ActiveBeamId != null)\n {\n \/\/ this is a break in any active beam, so register it as such.\n layer._property:ActiveBeamId = null;\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction ProcessTuplet (bobj, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.ParentTupletIfAny = null)\n {\n return null;\n }\n\n if (layer._property:ActiveTupletId = null)\n {\n tupletObject = bobj.ParentTupletIfAny;\n\n tuplet = libmei.Tuplet();\n\n layer._property:ActiveTupletObject = tupletObject;\n layer._property:ActiveTupletId = tuplet._id;\n\n if (libmei.GetName(meielement) = 'beam')\n {\n \/\/ get the first child\n startid = meielement.children[0];\n }\n else\n {\n startid = meielement._id;\n }\n\n libmei.AddAttribute(tuplet, 'startid', '#' & startid);\n libmei.AddAttribute(tuplet, 'num', tupletObject.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObject.Right);\n\n tupletStyle = tupletObject.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObject.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n return tuplet;\n\n \/\/ used for tuplet spans...\n \/\/ mlines = Self._property:MeasureLines;\n \/\/ mlines.Push(tuplet._id);\n }\n else\n {\n tid = layer._property:ActiveTupletId;\n t = libmei.getElementById(tid);\n\n if (IsLastNoteInTuplet(bobj))\n {\n libmei.AddAttribute(t, 'endid', '#' & meielement._id);\n layer._property:ActiveTupletObject = null;\n layer._property:ActiveTupletId = null;\n }\n\n return t;\n }\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (j = 0)\n {\n libmei.AddAttribute(sylel, 'wordpos', 'i'); \/\/ 'initial'\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n if (name = 'chord')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'chord'));\n }\n\n libmei.AddChild(obj, verse);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n spclbarlines[bar.BarNumber] = ConvertBarline(bobj.BarlineInternalType);\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n \/\/ swap out the section as the parent for the ending\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so \n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessSymbol (sobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureLines;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'inv');\n mlines = Self._property:MeasureLines;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'norm');\n mlines = Self._property:MeasureLines;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'norm');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureLines;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'inv');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureLines;\n mlines.Push(turn._id);\n }\n\n case ('242')\n {\n \/\/ triple staccato\n return null;\n }\n }\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"88c1669a6683566f3a80bb370ce21c2e07428a7b","subject":"Revert: Grace notes are actually explicit note objects.","message":"Revert: Grace notes are actually explicit note objects.\n\nPreviously a note was recorded to *have* a grace, but further reading of the MEI documentation revealed that a note can also *be* a grace. Reverting an earlier change that confused this.\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgname, 'type', 'plugin');\n libmei.AddChild(applic, plgname);\n\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n if (note._property:TieIds != null)\n {\n ties = note._property:TieIds;\n mties = Self._property:MeasureTies;\n mties = mties.Concat(ties);\n Self._property:MeasureTies = mties;\n }\n\n beam = ProcessBeam(bobj, l);\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n libmei.AddChild(tuplet, note);\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n if (bobj.IsAppoggiatura = True or bobj.IsAcciaccatura = True)\n {\n \/\/ skip any notes that are grace notes, since these will be encoded on the next note.\n return null;\n }\n\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n if (bobj.GraceNote = true)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (prev_object != null and prev_object.IsAppoggiatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'A');\n }\n\n if (prev_object != null and prev_object.IsAcciaccatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'a');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.addAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0)\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n \/\/ Accidentals will always be encoded as child elements, not attributes\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'headshape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n \/*\n Ties\n *\/\n tieresolver = Self._property:TieResolver;\n if (tieresolver.PropertyExists(hash))\n {\n \/\/ this note is the end of the tie.\n tie_id = tieresolver[hash];\n tie = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie, 'endid', '#' & n._id);\n }\n\n if (nobj.Tied = True)\n {\n \/\/ set the end hash\n parent_nr = nobj.ParentNoteRest;\n next_object = parent_nr.NextItem(parent_nr.VoiceNumber, 'NoteRest');\n\n if (next_object = null)\n {\n \/\/ check the first object in the next bar\n next_bar_num = parent_nr.ParentBar.BarNumber + 1;\n next_bar = parent_nr.ParentBar.ParentStaff.NthBar(next_bar_num);\n next_object = next_bar.NthBarObject(0);\n }\n\n if (next_object = null or next_object.Type != 'NoteRest')\n {\n \/\/ it's a hanging tie. What to do, what to do?\n \/\/ for now, just encode the startid with no endid and return the note.\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n n._property:TieIds = CreateSparseArray(tie._id);\n return n;\n }\n\n for each next_note in next_object\n {\n if (nobj.Pitch = next_note.Pitch)\n {\n \/\/ it's probably this one.\n endhash = SimpleNoteHash(next_note);\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n tieresolver[endhash] = tie._id;\n\n n._property:TieIds = CreateSparseArray(tie._id);\n }\n }\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n \n tiearr = CreateSparseArray();\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n\n if (sn._property:TieIds != null)\n {\n tieids = sn._property:TieIds;\n tiearr = tiearr.Concat(tieids);\n }\n }\n\n n._property:TieIds = tiearr;\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n libmei.AddAttribute(instrDef, 'midi.pan', s.Pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'rend', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(octl, 'dis', octrend[0]);\n libmei.AddAttribute(octl, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n Log('A vertical line was found.');\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n Log('Format close: ' & activeinfo);\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgname, 'type', 'plugin');\n libmei.AddChild(applic, plgname);\n\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n if (note._property:TieIds != null)\n {\n ties = note._property:TieIds;\n mties = Self._property:MeasureTies;\n mties = mties.Concat(ties);\n Self._property:MeasureTies = mties;\n }\n\n beam = ProcessBeam(bobj, l);\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n libmei.AddChild(tuplet, note);\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n if (bobj.GraceNote = True or bobj.IsAppoggiatura = True or bobj.IsAcciaccatura = True)\n {\n \/\/ skip any notes that are grace notes, since these will be encoded on the next note.\n return null;\n }\n\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n if (prev_object != null and prev_object.GraceNote = true)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (prev_object != null and prev_object.IsAppoggiatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'A');\n }\n\n if (prev_object != null and prev_object.IsAcciaccatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'a');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.addAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0)\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n \/\/ Accidentals will always be encoded as child elements, not attributes\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'headshape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n \/*\n Ties\n *\/\n tieresolver = Self._property:TieResolver;\n if (tieresolver.PropertyExists(hash))\n {\n \/\/ this note is the end of the tie.\n tie_id = tieresolver[hash];\n tie = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie, 'endid', '#' & n._id);\n }\n\n if (nobj.Tied = True)\n {\n \/\/ set the end hash\n parent_nr = nobj.ParentNoteRest;\n next_object = parent_nr.NextItem(parent_nr.VoiceNumber, 'NoteRest');\n\n if (next_object = null)\n {\n \/\/ check the first object in the next bar\n next_bar_num = parent_nr.ParentBar.BarNumber + 1;\n next_bar = parent_nr.ParentBar.ParentStaff.NthBar(next_bar_num);\n next_object = next_bar.NthBarObject(0);\n }\n\n if (next_object = null or next_object.Type != 'NoteRest')\n {\n \/\/ it's a hanging tie. What to do, what to do?\n \/\/ for now, just encode the startid with no endid and return the note.\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n n._property:TieIds = CreateSparseArray(tie._id);\n return n;\n }\n\n for each next_note in next_object\n {\n if (nobj.Pitch = next_note.Pitch)\n {\n \/\/ it's probably this one.\n endhash = SimpleNoteHash(next_note);\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n tieresolver[endhash] = tie._id;\n\n n._property:TieIds = CreateSparseArray(tie._id);\n }\n }\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n \n tiearr = CreateSparseArray();\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n\n if (sn._property:TieIds != null)\n {\n tieids = sn._property:TieIds;\n tiearr = tiearr.Concat(tieids);\n }\n }\n\n n._property:TieIds = tiearr;\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n libmei.AddAttribute(instrDef, 'midi.pan', s.Pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'rend', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(octl, 'dis', octrend[0]);\n libmei.AddAttribute(octl, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n Log('A vertical line was found.');\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n Log('Format close: ' & activeinfo);\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"c92a011814d3f951a906755f81cc2d3c853978d0","subject":"Clean up CPDZones CartoCSS.","message":"Clean up CPDZones CartoCSS.\n","repos":"ChattanoogaPublicLibrary\/cpd-zones-tiles","old_file":"CPDZones.mss","new_file":"CPDZones.mss","new_contents":"#cpddistricts {\n line-color:black;\n line-width:0.5;\n polygon-opacity:0.7;\n text-name: [CPD_Zone];\n text-face-name: \"Open Sans Bold\";\n text-halo-fill: white;\n text-halo-radius: 2.5;\n}\n\n#cpddistricts[CPD_Zone=\"Echo\"] {\n polygon-fill:#ff0000;\n}\n\n#cpddistricts[CPD_Zone=\"Alpha\"] {\n polygon-fill:#490A3D;\n}\n\n#cpddistricts[CPD_Zone=\"Delta\"] {\n polygon-fill:#BD1550;\n}\n\n#cpddistricts[CPD_Zone=\"George\"] {\n polygon-fill:#E97F02;\n}\n\n#cpddistricts[CPD_Zone=\"Fox\"] {\n polygon-fill:#F8CA00;\n}\n\n#cpddistricts[CPD_Zone=\"Charlie\"] {\n polygon-fill:#8A9B0F;\n}\n\n#cpddistricts[CPD_Zone=\"Bravo\"] {\n polygon-fill:#0a4916;\n text-allow-overlap: true;\n}\n","old_contents":"#cpddistricts[CPD_Zone=\"Echo\"] {\n line-color:black;\n line-width:0.5;\n polygon-opacity:0.7;\n polygon-fill:#ff0000;\n text-name: [CPD_Zone];\n text-face-name: 'Open Sans Bold';\n text-halo-fill: white;\n text-halo-radius: 2.5;\n}\n\n#cpddistricts[CPD_Zone=\"Alpha\"] {\n line-color:black;\n line-width:0.5;\n polygon-opacity:0.7;\n polygon-fill:#490A3D;\n text-name: [CPD_Zone];\n text-face-name: 'Open Sans Bold';\n text-halo-fill: white;\n text-halo-radius: 2.5;\n}\n\n#cpddistricts[CPD_Zone=\"Delta\"] {\n line-color:black;\n line-width:0.5;\n polygon-opacity:0.7;\n polygon-fill:#BD1550;\n text-name: [CPD_Zone];\n text-face-name: 'Open Sans Bold';\n text-halo-fill: white;\n text-halo-radius: 2.5;\n}\n\n#cpddistricts[CPD_Zone=\"George\"] {\n line-color:black;\n line-width:0.5;\n polygon-opacity:0.7;\n polygon-fill:#E97F02;\n text-name: [CPD_Zone];\n text-face-name: 'Open Sans Bold';\n text-halo-fill: white;\n text-halo-radius: 2.5;\n}\n\n#cpddistricts[CPD_Zone=\"Fox\"] {\n line-color:black;\n line-width:0.5;\n polygon-opacity:0.7;\n polygon-fill:#F8CA00;\n text-name: [CPD_Zone];\n text-face-name: 'Open Sans Bold';\n text-halo-fill: white;\n text-halo-radius: 2.5;\n}\n\n#cpddistricts[CPD_Zone=\"Charlie\"] {\n line-color:black;\n line-width:0.5;\n polygon-opacity:0.7;\n polygon-fill:#8A9B0F;\n text-name: [CPD_Zone];\n text-face-name: 'Open Sans Bold';\n text-halo-fill: white;\n text-halo-radius: 2.5;\n}\n\n#cpddistricts[CPD_Zone=\"Bravo\"] {\n line-color:black;\n line-width:0.5;\n polygon-opacity:0.7;\n polygon-fill:#0a4916;\n text-name: [CPD_Zone];\n text-face-name: 'Open Sans Bold';\n text-halo-fill: white;\n text-halo-radius: 2.5;\n text-allow-overlap: true;\n}\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"616c6fda9771422a4436d128c5bc2339b408d1d5","subject":"Tried to add backup labels.","message":"Tried to add backup labels.\n","repos":"OpenBounds\/MapStyles","old_file":"PublicLands.tm2\/style.mss","new_file":"PublicLands.tm2\/style.mss","new_contents":"Map { font-directory: url(\".\/fonts\"); }\n\n@default_text_halo: white;\n@default_text_color: black;\n@default_text_halo_radius: 2;\n\n#lands {\n\tpolygon-opacity:1;\t\n\t[zoom >= 14] {\n \t\ttext-face-name: 'Noto Sans Regular';\n \ttext-name:'[name]';\n\t\t[name=''],[name=NULL] { text-name: '[adminLevel]'; }\n \ttext-size: 12;\n \ttext-placement:interior;\n \ttext-fill:black;\n \ttext-halo-fill: @default_text_halo;\n \ttext-halo-radius: @default_text_halo_radius;\n \ttext-min-padding:1;\n \ttext-wrap-width:100;\n\t\tline-width:1;\n \tline-color:black;\n\t}\n\t[adminlevel='federal'] {\n\t\tpolygon-fill:#984ea3;\n\t}\n\t[adminLevel='state'] {\n \tpolygon-fill:#f781bf;\n\t}\n\t[adminLevel='county'] {\n \tpolygon-fill:#ffff33;\n\t}\n\t[adminLevel='local'] {\n \tpolygon-fill:#377eb8;\n\t}\n\t[adminAgency='Bureau of Land Management'] {\n\t\tpolygon-fill: #e41a1c;\n\t}\n\t[adminAgency='Forest Service'] {\n\t\tpolygon-fill: #4daf4a;\n\t}\n\t[adminAgency='U.S. Forest Service'] {\n polygon-fill: #4daf4a;\n }\n\t[adminAgency='National Park Service'] {\n\t\tpolygon-fill: #a65628;\n\t}\n\t[adminAgency='Department of Defense'],[adminAgency='Army Corps of Engineers'],[adminAgency='Army'],[adminAgency='Air Force'],[adminAgency='Navy'],[adminAgency='Marine Corps'],[adminAgency='Coast Guard'],[adminAgency='Fish & Wildlife Service'] {\n\t\tpolygon-fill: #0489B1;\n\t}\n}\n","old_contents":"Map { font-directory: url(\".\/fonts\"); }\n\n@default_text_halo: white;\n@default_text_color: black;\n@default_text_halo_radius: 2;\n\n#lands {\n\tpolygon-opacity:1;\t\n\t[zoom >= 14] {\n \t\ttext-face-name: 'Noto Sans Regular';\n \ttext-name:'[name]';\n \ttext-size: 12;\n \ttext-placement:interior;\n \ttext-fill:black;\n \ttext-halo-fill: @default_text_halo;\n \ttext-halo-radius: @default_text_halo_radius;\n \ttext-min-padding:1;\n \ttext-wrap-width:100;\n\t\tline-width:1;\n \tline-color:black;\n\t}\n\t[adminlevel='federal'] {\n\t\tpolygon-fill:#984ea3;\n\t}\n\t[adminLevel='state'] {\n \tpolygon-fill:#f781bf;\n\t}\n\t[adminLevel='county'] {\n \tpolygon-fill:#ffff33;\n\t}\n\t[adminLevel='local'] {\n \tpolygon-fill:#377eb8;\n\t}\n\t[adminAgency='Bureau of Land Management'] {\n\t\tpolygon-fill: #e41a1c;\n\t}\n\t[adminAgency='Forest Service'] {\n\t\tpolygon-fill: #4daf4a;\n\t}\n\t[adminAgency='U.S. Forest Service'] {\n polygon-fill: #4daf4a;\n }\n\t[adminAgency='National Park Service'] {\n\t\tpolygon-fill: #a65628;\n\t}\n\t[adminAgency='Department of Defense'],[adminAgency='Army Corps of Engineers'],[adminAgency='Army'],[adminAgency='Air Force'],[adminAgency='Navy'],[adminAgency='Marine Corps'],[adminAgency='Coast Guard'],[adminAgency='Fish & Wildlife Service'] {\n\t\tpolygon-fill: #0489B1;\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"9c29600f94d2905d5eabca89feee2b7cffef0b9d","subject":"#9 darken buildings","message":"#9 darken buildings\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"map.mss","new_file":"map.mss","new_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999;\n@color_transport_casing: #ddd;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc;\n@color_transport_minor: #ccc;\n@color_transport_rail: #aaa; \/\/ 35% K\n@color_transport_path: #666; \/\/ 60% K\n@color_building: #b0c0be;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: @color_transport;\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_green_areas: darken(#c0d3b5,20);\n\nMap {\n background-color: @color_physical;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n \/* lighten background color, as we decrease landcover opacity *\/\n [zoom>=12] {\n polygon-fill: lighten(@color_physical,20);\n }\n [zoom>=14] {\n polygon-fill: lighten(@color_physical,40);\n }\n\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_10m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{\n \/\/line-width: 0.5;\n line-color: @color_water;\n polygon-fill: @color_water;\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.5;\n\n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.3;\n }\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [zoom>=15] {\n line-color: @color_airport_runways_detail;\n }\n\n [type='runway'] {\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{\n [zoom>=9] {\n ::outline {\n line-width: 4.25;\n }\n\n line-width: 1.5;\n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 2.5;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n line-width: 28;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 49;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n [zoom<=12] {\n line-color: @color_transport;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n line-width: 1.5;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n line-width: 12;\n\n [is_link='yes'] {\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n line-width: 18;\n\n [is_link='yes'] {\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 17;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 0.2;\n }\n\n [zoom>=13] {\n line-width: 0.4;\n }\n\n [zoom>=14] {\n line-width: 0.8;\n }\n\n [zoom>=15] {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n line-width: 7;\n }\n\n [zoom>=18] {\n line-width: 13;\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n line-color: @color_transport_path;\n\n [zoom>=15] {\n line-width: 0.5;\n line-cap: butt;\n line-dasharray: 2, 3;\n }\n\n [zoom>=16] {\n line-width: 0.7;\n }\n\n [zoom>=17] {\n line-width: 1.2;\n line-dasharray: 4, 6;\n }\n}\n\n.landcoverraster {\n raster-opacity:1;\n raster-scaling:gaussian;\n\n \/* blur landcover as it becomes too pixelated *\/\n\/*\n [zoom>=10] {\n image-filters: agg-stack-blur(5,5);\n }\n [zoom>=12] {\n image-filters: agg-stack-blur(10,10);\n opacity: 0.8;\n }\n [zoom>=14] {\n image-filters: agg-stack-blur(20,20);\n opacity: 0.6;\n }\n*\/\n}\n","old_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999;\n@color_transport_casing: #ddd;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc;\n@color_transport_minor: #ccc;\n@color_transport_rail: #aaa; \/\/ 35% K\n@color_transport_path: #666; \/\/ 60% K\n@color_building: #cdd;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: @color_transport;\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_green_areas: darken(#c0d3b5,20);\n\nMap {\n background-color: @color_physical;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n \/* lighten background color, as we decrease landcover opacity *\/\n [zoom>=12] {\n polygon-fill: lighten(@color_physical,20);\n }\n [zoom>=14] {\n polygon-fill: lighten(@color_physical,40);\n }\n\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_10m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{\n \/\/line-width: 0.5;\n line-color: @color_water;\n polygon-fill: @color_water;\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.5;\n\n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.3;\n }\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [zoom>=15] {\n line-color: @color_airport_runways_detail;\n }\n\n [type='runway'] {\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{\n [zoom>=9] {\n ::outline {\n line-width: 4.25;\n }\n\n line-width: 1.5;\n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 2.5;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n line-width: 28;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 49;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::casing {\n line-width: 20;\n }\n\n line-width: 16;\n }\n }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n [zoom<=12] {\n line-color: @color_transport;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n line-width: 1.5;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n line-width: 12;\n\n [is_link='yes'] {\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n line-width: 18;\n\n [is_link='yes'] {\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::casing {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::casing {\n line-width: 17;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 0.2;\n }\n\n [zoom>=13] {\n line-width: 0.4;\n }\n\n [zoom>=14] {\n line-width: 0.8;\n }\n\n [zoom>=15] {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n line-width: 7;\n }\n\n [zoom>=18] {\n line-width: 13;\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n line-color: @color_transport_path;\n\n [zoom>=15] {\n line-width: 0.5;\n line-cap: butt;\n line-dasharray: 2, 3;\n }\n\n [zoom>=16] {\n line-width: 0.7;\n }\n\n [zoom>=17] {\n line-width: 1.2;\n line-dasharray: 4, 6;\n }\n}\n\n.landcoverraster {\n raster-opacity:1;\n raster-scaling:gaussian;\n\n \/* blur landcover as it becomes too pixelated *\/\n\/*\n [zoom>=10] {\n image-filters: agg-stack-blur(5,5);\n }\n [zoom>=12] {\n image-filters: agg-stack-blur(10,10);\n opacity: 0.8;\n }\n [zoom>=14] {\n image-filters: agg-stack-blur(20,20);\n opacity: 0.6;\n }\n*\/\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"9ab0a270324494214ae09009c62a8b22b01e2f4c","subject":"Update palette.mss","message":"Update palette.mss","repos":"brelevenix\/osm-bright-tregor","old_file":"osm-bright\/palette.mss","new_file":"osm-bright\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Open Sans Regular\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_lt_italic: \"Open Sans Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans: \"Open Sans Semibold\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_italic: \"Open Sans Semibold Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans_bold: \"Open Sans Bold\",\"DejaVu Sans Bold\",\"unifont Medium\";\n@sans_bold_italic: \"Open Sans Bold Italic\",\"DejaVu Sans Bold Italic\",\"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* COLOR PALETTE\n\/* ================================================================== *\/\n\n@black: #000000; \n@white: #ffffff;\n\n@grey-light: #cccccc;\n@grey-medium: #999999;\n@grey-strong: #777777;\n\n@orange: #FF6600;\n\n@blue: #0000ff;\n\n@yellow: #ffff33;\n@yellow-light: #ffff99;\n\n@green: #006600;\n@green-light: #D7EFD9;\n\n@purple: #9164CD;\n@pink: #FFB4E6;\n\n@path: #D7EFD9;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: @green-light;\n@water: @blue;\n@grass: @green;\n@beach: @yellow;\n@park: @green;\n@cemetery: @grey-light;\n@wooded: @green;\n@agriculture: @green-light;\n\n@building: @grey-strong;\n@hospital: @grey-light;\n@school: @grey-light;\n@sports: @grey-light;\n\n@residential: @grey-light;\n@commercial: @grey-light;\n@industrial: @grey-light;\n@parking: @grey-light;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: @white;\n@motorway_fill: @white;\n@motorway_case: @white;\n\n@trunk_line: @white;\n@trunk_fill: @white;\n@trunk_case: @white;\n\n@primary_line: @white;\n@primary_fill: @white;\n@primary_case: @white;\n\n@secondary_line: @white;\n@secondary_fill: @white;\n@secondary_case: @white;\n\n@standard_line: @white;\n@standard_fill: @white;\n@standard_case: @white;\n\n@pedestrian_line: @purple;\n@pedestrian_fill: @purple;\n@pedestrian_case: @purple;\n\n@cycle_line: @purple;\n@cycle_fill: @purple;\n@cycle_case: @purple;\n\n@rail_line: @black;\n@rail_fill: @black;\n@rail_case: @black;\n\n@aeroway: @black;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: @purple;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,0%);\n\n@country_text: @black;\n@country_halo: @place_halo;\n\n@state_text: @black;\n@state_halo: @place_halo;\n\n@city_text: @black;\n@city_halo: @place_halo;\n\n@town_text: @black;\n@town_halo: @place_halo;\n\n@poi_text: @black;\n\n@road_text: @black;\n@road_halo: @place_halo;\n\n@other_text: @black;\n@other_halo: @place_halo;\n\n@locality_text: @black;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: @black;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Open Sans Regular\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_lt_italic: \"Open Sans Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans: \"Open Sans Semibold\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_italic: \"Open Sans Semibold Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans_bold: \"Open Sans Bold\",\"DejaVu Sans Bold\",\"unifont Medium\";\n@sans_bold_italic: \"Open Sans Bold Italic\",\"DejaVu Sans Bold Italic\",\"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* COLOR PALETTE\n\/* ================================================================== *\/\n\n@black: #000000; \n@white: #ffffff;\n\n@grey-light: #cccccc;\n@grey-medium: #999999;\n@grey-strong: #777777;\n\n@orange: #FF6600;\n\n@blue: #0000ff;\n\n@yellow: #ffff33;\n@yellow-light: #ffff99;\n\n@green: #006600;\n@green-light: #D7EFD9;\n\n@purple: #9164CD;\n@pink: #FFB4E6;\n\n@brown: #D7EFD9;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: @green-light;\n@water: @blue;\n@grass: @green;\n@beach: @yellow;\n@park: @green;\n@cemetery: @grey-light;\n@wooded: @green;\n@agriculture: @green-light;\n\n@building: @grey-strong;\n@hospital: @grey-light;\n@school: @grey-light;\n@sports: @grey-light;\n\n@residential: @grey-light;\n@commercial: @grey-light;\n@industrial: @grey-light;\n@parking: @grey-light;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: @white;\n@motorway_fill: @white;\n@motorway_case: @white;\n\n@trunk_line: @white;\n@trunk_fill: @white;\n@trunk_case: @white;\n\n@primary_line: @white;\n@primary_fill: @white;\n@primary_case: @white;\n\n@secondary_line: @white;\n@secondary_fill: @white;\n@secondary_case: @white;\n\n@standard_line: @white;\n@standard_fill: @white;\n@standard_case: @white;\n\n@pedestrian_line: @purple;\n@pedestrian_fill: @purple;\n@pedestrian_case: @purple;\n\n@cycle_line: @purple;\n@cycle_fill: @purple;\n@cycle_case: @purple;\n\n@rail_line: @black;\n@rail_fill: @black;\n@rail_case: @black;\n\n@aeroway: @black;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: @purple;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,0%);\n\n@country_text: @black;\n@country_halo: @place_halo;\n\n@state_text: @black;\n@state_halo: @place_halo;\n\n@city_text: @black;\n@city_halo: @place_halo;\n\n@town_text: @black;\n@town_halo: @place_halo;\n\n@poi_text: @black;\n\n@road_text: @black;\n@road_halo: @place_halo;\n\n@other_text: @black;\n@other_halo: @place_halo;\n\n@locality_text: @black;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: @black;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"ea73332a2539d3a5d16388cade02c226a5798383","subject":"large area labels abstracting values","message":"large area labels abstracting values\n","repos":"andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto","old_file":"osmt\/style.mss","new_file":"osmt\/style.mss","new_contents":"\/*\n==Database level==\n* join adjacent way segments with same classification and name\n for labels layer and increase text-spacing so labels aren't\n repeated right next to each other\n\n* optimise queries as to select just what is required for rendering\n\n* select way area so can style bay names larger for larger bays\n\n==Style level==\n* ShieldSymbolizers for POIs with names at high zooms (eg police station\n icon with name)\n*\/\n\n\/*\n Large labeled areas such as park, golf courses and schools.\n\n These labels are shown at z15-17, before we see POI features.\n\n We use the way_area to show labels for larger areas from lower zooms.\n\n By placing a point-file below all the text-* attributes mapnik will\n render a marker icon if it decides it can't fit the text due to other labels\n in the way.\n*\/\n\n@school_label_halo_colour: #241600;\n@park_label_halo_colour: #0e300e;\n\n@area_label_opacity: 1.0;\n@area_label_halo_radius: 2.0;\n\n\/** Parks **\/\n\n\/* only show from z15+ where area > 30,000 *\/\n#park-labels[zoom > 14][way_area > 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @park_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\/* start showing on z16+ on area > 10,000 *\/\n#park-labels[zoom > 15][way_area >= 10000][way_area < 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @park_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\/* show the rest from z17+ *\/\n#park-labels[zoom > 16][way_area < 10000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @park_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\n\/** Golf Courses **\/\n\n\/* since most are large, just render all labels from zoom 15+ *\/\n#leisure[leisure='golf_course'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: #021402;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 50;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n \/* if mapnik can't place a label, try an icon instead *\/\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/golf.glow.000000.12.png');\n}\n\n\n\/** Schools **\/\n\n\/* only show from z15+ where area > 30,000 *\/\n#school-labels[zoom > 14][way_area > 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @school_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 30;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n \/* if mapnik can't place a label, try an icon instead *\/\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.12.png');\n}\n\n\/* start showing on z16+ on area > 10,000 *\/\n#school-labels[zoom > 15][way_area >= 10000][way_area < 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @school_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.16.png');\n}\n\n\/* show the rest from z17+ *\/\n#school-labels[zoom > 16][way_area < 10000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @school_label_halo_colour;\n text-halo-radius: @area_label_halo_radius;\n text-wrap-width: 20;\n text-opacity: @area_label_opacity;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.20.png');\n}\n\n\/* building names *\/\n#building-label[zoom > 16] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n\n [zoom > 21] { text-size: 17; }\n [zoom = 21] { text-size: 16; }\n [zoom = 20] { text-size: 15; }\n [zoom = 19] { text-size: 14; }\n [zoom = 18] { text-size: 12; }\n [zoom = 17] { text-size: 10; }\n}\n\n\/*\n Miscellaneous items\n *\/\n\n\/* ferry routes *\/\n#ferry-route[zoom > 6][zoom < 12] {\n line-color: white;\n line-width: 0.7;\n line-opacity: 0.5;\n}\n\n#ferry-route[zoom > 11] {\n line-color: #00066f;\n line-dasharray: 6,6;\n\n [zoom = 12] { line-width: 0.8; }\n [zoom = 13] { line-width: 1.0; }\n [zoom = 14] { line-width: 1.3; }\n [zoom = 15] { line-width: 1.6; }\n [zoom > 15] { line-width: 2.0; }\n\n ::halo{\n line-color: white;\n line-width: 1.0;\n line-opacity: 0.5;\n\n [zoom = 13] { line-width: 1.2; }\n [zoom = 14] { line-width: 1.5; }\n [zoom = 15] { line-width: 1.8; }\n [zoom > 15] { line-width: 2.2; }\n }\n}\n\n#landuse[landuse='military'][zoom > 10] {\n ::outline {\n line-color: #f55000;\n line-width: 3;\n line-opacity: 0.329;\n }\n\n polygon-pattern-file: url('\/usr\/share\/icons\/osmt\/military-pattern.png');\n}\n","old_contents":"\/*\n==Database level==\n* join adjacent way segments with same classification and name\n for labels layer and increase text-spacing so labels aren't\n repeated right next to each other\n\n* optimise queries as to select just what is required for rendering\n\n* select way area so can style bay names larger for larger bays\n\n==Style level==\n* ShieldSymbolizers for POIs with names at high zooms (eg police station\n icon with name)\n*\/\n\n\/*\n Large labeled areas such as park, golf courses and schools.\n\n These labels are shown at z15-17, before we see POI features.\n\n We use the way_area to show labels for larger areas from lower zooms.\n\n By placing a point-file below all the text-* attributes mapnik will\n render a marker icon if it decides it can't fit the text due to other labels\n in the way.\n*\/\n\n@school_label_halo_colour: #342101;\n@park_label_halo_colour: #0e300e;\n\n\n\/** Parks **\/\n\n\/* only show from z15+ where area > 30,000 *\/\n#park-labels[zoom > 14][way_area > 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @park_label_halo_colour;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n text-opacity: 0.75;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\/* start showing on z16+ on area > 10,000 *\/\n#park-labels[zoom > 15][way_area >= 10000][way_area < 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @park_label_halo_colour;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n text-opacity: 0.75;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\/* show the rest from z17+ *\/\n#park-labels[zoom > 16][way_area < 10000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @park_label_halo_colour;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n text-opacity: 0.75;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n}\n\n\n\/** Golf Courses **\/\n\n\/* since most are large, just render all labels from zoom 15+ *\/\n#leisure[leisure='golf_course'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: #021402;\n text-halo-radius: 2.0;\n text-wrap-width: 50;\n text-opacity: 0.75;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n \/* if mapnik can't place a label, try an icon instead *\/\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/sport\/golf.glow.000000.12.png');\n}\n\n\n\/** Schools **\/\n\n\/* only show from z15+ where area > 30,000 *\/\n#school-labels[zoom > 14][way_area > 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @school_label_halo_colour;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n text-opacity: 0.75;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n \/* if mapnik can't place a label, try an icon instead *\/\n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.12.png');\n}\n\n\/* start showing on z16+ on area > 10,000 *\/\n#school-labels[zoom > 15][way_area >= 10000][way_area < 30000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @school_label_halo_colour;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n text-opacity: 0.75;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.16.png');\n}\n\n\/* show the rest from z17+ *\/\n#school-labels[zoom > 16][way_area < 10000] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: @school_label_halo_colour;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n text-opacity: 0.75;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n \n point-file: url('\/usr\/share\/icons\/sjjb\/png\/education\/school.glow.734A08.20.png');\n}\n\n\/* building names *\/\n#building-label[zoom > 16] {\n text-name: \"[name]\";\n text-face-name: \"Liberation Sans Regular\";\n text-fill: white;\n text-placement: interior;\n text-halo-fill: black;\n text-halo-radius: 2.0;\n text-wrap-width: 20;\n\n [zoom > 21] { text-size: 17; }\n [zoom = 21] { text-size: 16; }\n [zoom = 20] { text-size: 15; }\n [zoom = 19] { text-size: 14; }\n [zoom = 18] { text-size: 12; }\n [zoom = 17] { text-size: 10; }\n}\n\n\/*\n Miscellaneous items\n *\/\n\n\/* ferry routes *\/\n#ferry-route[zoom > 6][zoom < 12] {\n line-color: white;\n line-width: 0.7;\n line-opacity: 0.5;\n}\n\n#ferry-route[zoom > 11] {\n line-color: #00066f;\n line-dasharray: 6,6;\n\n [zoom = 12] { line-width: 0.8; }\n [zoom = 13] { line-width: 1.0; }\n [zoom = 14] { line-width: 1.3; }\n [zoom = 15] { line-width: 1.6; }\n [zoom > 15] { line-width: 2.0; }\n\n ::halo{\n line-color: white;\n line-width: 1.0;\n line-opacity: 0.5;\n\n [zoom = 13] { line-width: 1.2; }\n [zoom = 14] { line-width: 1.5; }\n [zoom = 15] { line-width: 1.8; }\n [zoom > 15] { line-width: 2.2; }\n }\n}\n\n#landuse[landuse='military'][zoom > 10] {\n ::outline {\n line-color: #f55000;\n line-width: 3;\n line-opacity: 0.329;\n }\n\n polygon-pattern-file: url('\/usr\/share\/icons\/osmt\/military-pattern.png');\n}\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"CartoCSS"} {"commit":"48fde708bf318ffb4cf18a0e2f76d2f684db4470","subject":"Check for existance needs \"!= null\" test","message":"Check for existance needs \"!= null\" test\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/Utilities.mss","new_file":"src\/Utilities.mss","new_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in \n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/* \n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a dictionary of {pos:id} mappings for a given\n \/\/ voice, and returns the NoteRest object. If one isn't found\n \/\/ exactly at `position`, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions = null)\n {\n \/\/ theres not much we can do here. Bail.\n Log('Bailing due to insufficient voice information');\n return null;\n }\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (tstamps, etc.) to an element.\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Bar object'));\n }\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n if (bobj.Duration > 0)\n {\n libmei.AddAttribute(element, 'dur.ges', bobj.Duration & 'p');\n }\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bar));\n\n switch (bobj.Type)\n {\n case('Line')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Slur')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('DiminuendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('CrescendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('GlissandoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Trill')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction GetTupletStack (bobj) {\n \/\/$module(Utilities.mss)\n tupletStack = CreateSparseArray();\n parentTuplet = bobj.ParentTupletIfAny;\n while (parentTuplet != null)\n {\n tupletStack.Push(parentTuplet);\n parentTuplet = parentTuplet.ParentTupletIfAny;\n }\n tupletStack.Reverse();\n return tupletStack;\n} \/\/$end\n\nfunction CountTupletsEndingAtNoteRest(noteRest) {\n \/\/$module(Utilities.mss)\n tuplet = noteRest.ParentTupletIfAny;\n \n if (tuplet = null)\n {\n return 0;\n }\n \n nextNoteRest = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n\n if (nextNoteRest = null or nextNoteRest.ParentTupletIfAny = null)\n {\n tupletStack = GetTupletStack(noteRest);\n return tupletStack.Length;\n }\n \n if (TupletsEqual(tuplet, nextNoteRest.ParentTupletIfAny))\n {\n return 0;\n }\n \n tupletStack = GetTupletStack(noteRest);\n nextTupletStack = GetTupletStack(nextNoteRest);\n \n \/\/ We are looking for the highest index where both stacks are identical.\n index = utils.min(tupletStack.Length, nextTupletStack.Length) - 1;\n \n while (index >= 0 and not(TupletsEqual(tupletStack[index], nextTupletStack[index])))\n {\n index = index - 1;\n }\n \n return tupletStack.Length - 1 - index;\n} \/\/$end\n\nfunction GetMeiTupletDepth (layer) {\n \/\/$module(Utilities.mss)\n depth = 0;\n tuplet = layer._property:ActiveMeiTuplet;\n while (tuplet != null)\n {\n depth = depth + 1;\n tuplet = tuplet._property:ParentTuplet;\n }\n return depth;\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n Sibelius.AppendLineToFile(LOGFILE, message, True);\n} \/\/$end\n\nfunction NormalizedBeamProp (noteRest) {\n \/\/$module(Utilities.mss)\n \/*\n Sibelius' Beam properties can't be trusted. We need to look at the context,\n check whether they make sense and if they don't, find out the value we'd expect.\n Problems can e.g. be that Sibelius reports\n * a ContinueBeam at the start of a beam (we'd expect StartBeam)\n * a property other than NoBeam on a quarter or longer un-beamable duration\n (we'd expect NoBeam)\n * ... (almost any combinations imaginable)\n *\/\n if (noteRest.Beam = NoBeam or noteRest.Duration >= 256)\n {\n return NoBeam;\n }\n \n \/\/ At this point, we're only dealing with ContinueBeam and SingleBeam.\n \/\/ We need to look at the preceding note to see whether there's any\n \/\/ beam to continue.\n\n if (noteRest.Beam != StartBeam)\n {\n prev_obj = PrevNormalOrGrace(noteRest, noteRest.GraceNote);\n \n if (prev_obj != null and prev_obj.Beam != NoBeam and prev_obj.Duration < 256)\n {\n \/\/ We actually have a beam we can continue.\n if (noteRest.Beam = SingleBeam and noteRest.Duration < 128 and prev_obj.Duration < 128)\n {\n \/\/ SingleBeam only makes sense if we actually have secondary beams between the \n \/\/ previous note and the current note.\n return SingleBeam;\n }\n return ContinueBeam;\n }\n }\n \n \/\/ At this point, we know there is no previous beam we can continue because we have a\n \/\/ StartBeam or the above test for a previous beam failed.\n \/\/ We still need to check whether there is a following note that we can beam to.\n \n next_obj = NextNormalOrGrace(noteRest, noteRest.GraceNote);\n if (next_obj != null and next_obj.Duration < 256 and (next_obj.Beam = ContinueBeam or next_obj.Beam = SingleBeam))\n {\n return StartBeam;\n }\n else\n {\n return NoBeam;\n }\n} \/\/$end\n\nfunction NextNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n When given a 'normal' NoteRest, this function returns the next 'normal' NoteRest\n in the same voice.\n When given a grace NoteRest, this function returns the immediately adjacent \n following grace NoteRest, if existant.\n This function is basically a duplicate of PrevNormalOrGrace() with \n 'Previous' replaced by 'Next'.\n *\/\n next_obj = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (next_obj != null and not(next_obj.GraceNote))\n {\n next_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (next_obj != null and next_obj.GraceNote)\n {\n next_obj = next_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return next_obj;\n} \/\/$end\n\nfunction PrevNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n For a description, see NextNormalOrGrace().\n This function is basically a duplicate of PrevNormalOrGrace() with \n 'Next' replaced by 'Previous'.\n *\/\n prev_obj = noteRest.PreviousItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (prev_obj != null and not(prev_obj.GraceNote))\n {\n prev_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (prev_obj and prev_obj.GraceNote)\n {\n prev_obj = prev_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return prev_obj;\n} \/\/$end\n\nfunction GetNongraceParentBeam (noteRest, layer) {\n \/\/$module(Utilities.mss)\n \/*\n This function is used to find out whether a non-grace beam spans over a grace\n NoteRest that is either unbeamed or at the start of a grace beam.\n *\/\n if (layer._property:ActiveBeam != null)\n {\n \/\/ Only if the active non-grace beam continues to the next normal note, the\n \/\/ grace note is truly placed under the non-grace beam.\n nextNongraceNoteRest = NextNormalOrGrace(noteRest, false);\n if (nextNongraceNoteRest != null)\n {\n nextNormalBeamProp = NormalizedBeamProp(nextNongraceNoteRest);\n }\n else\n {\n nextNormalBeamProp = NoBeam;\n }\n if (nextNormalBeamProp = ContinueBeam or nextNormalBeamProp = SingleBeam)\n {\n return layer._property:ActiveBeam;\n }\n }\n return null;\n} \/\/$end\n\n","old_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in \n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/* \n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a dictionary of {pos:id} mappings for a given\n \/\/ voice, and returns the NoteRest object. If one isn't found\n \/\/ exactly at `position`, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions = null)\n {\n \/\/ theres not much we can do here. Bail.\n Log('Bailing due to insufficient voice information');\n return null;\n }\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (tstamps, etc.) to an element.\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Bar object'));\n }\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n if (bobj.Duration > 0)\n {\n libmei.AddAttribute(element, 'dur.ges', bobj.Duration & 'p');\n }\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bar));\n\n switch (bobj.Type)\n {\n case('Line')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Slur')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('DiminuendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('CrescendoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('GlissandoLine')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n case('Trill')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionWithDurationToTimestamp(bobj));\n }\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction GetTupletStack (bobj) {\n \/\/$module(Utilities.mss)\n tupletStack = CreateSparseArray();\n parentTuplet = bobj.ParentTupletIfAny;\n while (parentTuplet != null)\n {\n tupletStack.Push(parentTuplet);\n parentTuplet = parentTuplet.ParentTupletIfAny;\n }\n tupletStack.Reverse();\n return tupletStack;\n} \/\/$end\n\nfunction CountTupletsEndingAtNoteRest(noteRest) {\n \/\/$module(Utilities.mss)\n tuplet = noteRest.ParentTupletIfAny;\n \n if (tuplet = null)\n {\n return 0;\n }\n \n nextNoteRest = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n\n if (nextNoteRest = null or nextNoteRest.ParentTupletIfAny = null)\n {\n tupletStack = GetTupletStack(noteRest);\n return tupletStack.Length;\n }\n \n if (TupletsEqual(tuplet, nextNoteRest.ParentTupletIfAny))\n {\n return 0;\n }\n \n tupletStack = GetTupletStack(noteRest);\n nextTupletStack = GetTupletStack(nextNoteRest);\n \n \/\/ We are looking for the highest index where both stacks are identical.\n index = utils.min(tupletStack.Length, nextTupletStack.Length) - 1;\n \n while (index >= 0 and not(TupletsEqual(tupletStack[index], nextTupletStack[index])))\n {\n index = index - 1;\n }\n \n return tupletStack.Length - 1 - index;\n} \/\/$end\n\nfunction GetMeiTupletDepth (layer) {\n \/\/$module(Utilities.mss)\n depth = 0;\n tuplet = layer._property:ActiveMeiTuplet;\n while (tuplet)\n {\n depth = depth + 1;\n tuplet = tuplet._property:ParentTuplet;\n }\n return depth;\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n Sibelius.AppendLineToFile(LOGFILE, message, True);\n} \/\/$end\n\nfunction NormalizedBeamProp (noteRest) {\n \/\/$module(Utilities.mss)\n \/*\n Sibelius' Beam properties can't be trusted. We need to look at the context,\n check whether they make sense and if they don't, find out the value we'd expect.\n Problems can e.g. be that Sibelius reports\n * a ContinueBeam at the start of a beam (we'd expect StartBeam)\n * a property other than NoBeam on a quarter or longer un-beamable duration\n (we'd expect NoBeam)\n * ... (almost any combinations imaginable)\n *\/\n if (noteRest.Beam = NoBeam or noteRest.Duration >= 256)\n {\n return NoBeam;\n }\n \n \/\/ At this point, we're only dealing with ContinueBeam and SingleBeam.\n \/\/ We need to look at the preceding note to see whether there's any\n \/\/ beam to continue.\n\n if (noteRest.Beam != StartBeam)\n {\n prev_obj = PrevNormalOrGrace(noteRest, noteRest.GraceNote);\n \n if (prev_obj != null and prev_obj.Beam != NoBeam and prev_obj.Duration < 256)\n {\n \/\/ We actually have a beam we can continue.\n if (noteRest.Beam = SingleBeam and noteRest.Duration < 128 and prev_obj.Duration < 128)\n {\n \/\/ SingleBeam only makes sense if we actually have secondary beams between the \n \/\/ previous note and the current note.\n return SingleBeam;\n }\n return ContinueBeam;\n }\n }\n \n \/\/ At this point, we know there is no previous beam we can continue because we have a\n \/\/ StartBeam or the above test for a previous beam failed.\n \/\/ We still need to check whether there is a following note that we can beam to.\n \n next_obj = NextNormalOrGrace(noteRest, noteRest.GraceNote);\n if (next_obj != null and next_obj.Duration < 256 and (next_obj.Beam = ContinueBeam or next_obj.Beam = SingleBeam))\n {\n return StartBeam;\n }\n else\n {\n return NoBeam;\n }\n} \/\/$end\n\nfunction NextNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n When given a 'normal' NoteRest, this function returns the next 'normal' NoteRest\n in the same voice.\n When given a grace NoteRest, this function returns the immediately adjacent \n following grace NoteRest, if existant.\n This function is basically a duplicate of PrevNormalOrGrace() with \n 'Previous' replaced by 'Next'.\n *\/\n next_obj = noteRest.NextItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (next_obj != null and not(next_obj.GraceNote))\n {\n next_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (next_obj != null and next_obj.GraceNote)\n {\n next_obj = next_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return next_obj;\n} \/\/$end\n\nfunction PrevNormalOrGrace (noteRest, grace) {\n \/\/$module(Utilities.mss)\n \/*\n For a description, see NextNormalOrGrace().\n This function is basically a duplicate of PrevNormalOrGrace() with \n 'Next' replaced by 'Previous'.\n *\/\n prev_obj = noteRest.PreviousItem(noteRest.VoiceNumber, 'NoteRest');\n if (grace)\n {\n \/\/ There mustn't be any intermitting 'normal' notes between grace notes.\n if (prev_obj != null and not(prev_obj.GraceNote))\n {\n prev_obj = null;\n }\n }\n else\n {\n \/\/ If noteRest isn't a grace note, we skip all grace notes as their beams\n \/\/ can be nested inside normal beams.\n while (prev_obj and prev_obj.GraceNote)\n {\n prev_obj = prev_obj.NextItem(noteRest.VoiceNumber, 'NoteRest');\n }\n }\n return prev_obj;\n} \/\/$end\n\nfunction GetNongraceParentBeam (noteRest, layer) {\n \/\/$module(Utilities.mss)\n \/*\n This function is used to find out whether a non-grace beam spans over a grace\n NoteRest that is either unbeamed or at the start of a grace beam.\n *\/\n if (layer._property:ActiveBeam != null)\n {\n \/\/ Only if the active non-grace beam continues to the next normal note, the\n \/\/ grace note is truly placed under the non-grace beam.\n nextNongraceNoteRest = NextNormalOrGrace(noteRest, false);\n if (nextNongraceNoteRest != null)\n {\n nextNormalBeamProp = NormalizedBeamProp(nextNongraceNoteRest);\n }\n else\n {\n nextNormalBeamProp = NoBeam;\n }\n if (nextNormalBeamProp = ContinueBeam or nextNormalBeamProp = SingleBeam)\n {\n return layer._property:ActiveBeam;\n }\n }\n return null;\n} \/\/$end\n\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"94ecc685548d06b5ee64ef0b7fb798c2ffb43b2e","subject":"minor text fixes","message":"minor text fixes\n","repos":"silph-io\/osm-silph","old_file":"osm-bright\/palette.mss","new_file":"osm-bright\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";*\/\n\n\n@sans_lt_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans_bold: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_bold_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold Italic\",\"DejaVu Sans Bold Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #DCDCDC;\n@water: #8ec9fb;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #bedb9f;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n\n@building: #F4F4F4;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: @standard_line;\n@motorway_fill: @standard_fill;\n@motorway_case: @standard_case;\n\n@trunk_line: @standard_line;\n@trunk_fill: @standard_fill;\n@trunk_case: @standard_case;\n\n@primary_line: @standard_line;\n@primary_fill: @standard_fill;\n@primary_case: @standard_case;\n\n@secondary_line: @standard_line;\n@secondary_fill: @standard_fill;\n@secondary_case: @standard_case;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,34%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n@poi_text: #888;\n\n@road_text: #444;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";*\/\n\n\n@sans_lt_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Semibold Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\n@sans_bold: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n@sans_bold_italic: \"Ubuntu Regular\", \"Unifont Medium\";\n\n\/* \"Open Sans Bold Italic\",\"DejaVu Sans Bold Oblique\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\", \"TSCu_Paranar Italic\", \"Mallige NormalItalic\",\n \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\"; *\/\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #DCDCDC;\n@water: #138AB6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #bedb9f;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n\n@building: #F4F4F4;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: @standard_line;\n@motorway_fill: @standard_fill;\n@motorway_case: @standard_case;\n\n@trunk_line: @standard_line;\n@trunk_fill: @standard_fill;\n@trunk_case: @standard_case;\n\n@primary_line: @standard_line;\n@primary_fill: @standard_fill;\n@primary_case: @standard_case;\n\n@secondary_line: @standard_line;\n@secondary_fill: @standard_fill;\n@secondary_case: @standard_case;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #324;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,34%);\n\n@country_text: #435;\n@country_halo: @place_halo;\n\n@state_text: #546;\n@state_halo: @place_halo;\n\n@city_text: #444;\n@city_halo: @place_halo;\n\n@town_text: #666;\n@town_halo: @place_halo;\n\n@poi_text: #888;\n\n@road_text: #444;\n@road_halo: #fff;\n\n@other_text: #888;\n@other_halo: @place_halo;\n\n@locality_text: #aaa;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: #888;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"5b494fbb9f3b4e18c28b428c606c8c5e74d339a8","subject":"Don't show motorway links below z10","message":"Don't show motorway links below z10\n","repos":"mapbox\/open-streets-style","old_file":"open-streets\/highway.mss","new_file":"open-streets\/highway.mss","new_contents":"\/* ---- PALETTE ---- *\/\n\n@motorway_fill: #a8bae0; \/*#93b5d9;*\/\n@motorway_line: spin(darken(@motorway_fill,25),-10);\n@trunk_fill: #a7dea5;\/*#fabd7d;*\/\n@trunk_line: spin(darken(@trunk_fill,25),-10);\n@primary_fill: #fcf7bd;\n@primary_line: spin(darken(@primary_fill,25),-10);\n@secondary_fill:@primary_fill;\n@secondary_line:spin(darken(@secondary_fill,25),-10);\n@road_fill: #fff;\n@road_line: #bbb;\n@access_fill: @road_fill;\n@access_line: @road_line;\n@track: @road;\n@footway: #6B9;\n@cycleway: #69B;\n@bridge: rgba(64,64,64,0.66);\n\n\/* ---- ROADS ---- *\/\n\n\/* Service\/Access *\/\n.route.line[highway='service'] {\n [zoom>12]{ line-color:@access_line; line-cap:square; line-join:round; }\n [zoom=13]{ line-width:0.2; line-opacity:0.4; }\n [zoom=14]{ line-width:0.4; line-opacity:0.6; }\n [zoom=15]{ line-width:1; line-opacity:0.8; }\n [zoom=16]{ line-width:1.6 + 2; }\n [zoom=17]{ line-width:4 + 2; }\n [zoom=18]{ line-width:7 + 3; }\n}\n.route.fill[highway='service'] {\n [zoom>15]{ line-color:@access_fill; line-cap:square; line-join:round; }\n [zoom=16]{ line-width:1.6; }\n [zoom=17]{ line-width:4; }\n [zoom=18]{ line-width:7; }\n}\n\n\/* Motorway Links *\/\n.route.line[highway='motorway_link'][tunnel='no'],\n.route.tunnel[highway='motorway_link'] {\n [zoom>9] { line-color:@motorway_line; line-cap:round; line-join:round; }\n .tunnel[zoom>9] { line-dasharray:4,2; line-cap:butt; }\n [zoom=10]{ line-width:0.8; }\n [zoom=11]{ line-width:1; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2 + 2; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:5 + 2.5; }\n [zoom=17]{ line-width:6 + 2.5; }\n [zoom=18]{ line-width:14 + 2.5; }\n}\n.route.bridge::b[highway='motorway_link'] {\n [zoom>9] { line-color:darken(@motorway_line,15); line-cap:butt; line-join:round; }\n [zoom=10]{ line-width:0.8 + 1; }\n [zoom=11]{ line-width:1; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2 + 2; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:5 + 2.5; }\n [zoom=17]{ line-width:6 + 2.5; }\n [zoom=18]{ line-width:14 + 2.5; }\n}\n.route.fill[highway='motorway_link'] {\n [zoom>11]{ line-color:@motorway_fill; line-cap:round; line-join:round; }\n [zoom>11][tunnel='yes'] { line-color:lighten(@motorway_fill,10); }\n \/*[zoom=11]{ line-width:0.8; }*\/\n [zoom=12]{ line-width:1.0; }\n [zoom=13]{ line-width:1.2; }\n [zoom=14]{ line-width:2; }\n [zoom=15]{ line-width:3.5; }\n [zoom=16]{ line-width:5; }\n [zoom=17]{ line-width:6; }\n [zoom=18]{ line-width:14; }\n}\n\n\/* Standard\/Unknown *\/\n.route.line[highway='living_street'],\n.route.line[highway='residential'],\n.route.line[highway='road'],\n.route.line[highway='tertiary'],\n.route.line[highway='tertiary_link'],\n.route.line[highway='unclassified'] {\n [zoom>9] { line-color:@road_line; line-cap:round; line-join:round; }\n [zoom=10]{ line-width:0.2; line-opacity:0.4; }\n [zoom=11]{ line-width:0.4; line-opacity:0.6; }\n [zoom=12]{ line-width:0.6; line-opacity:0.8; }\n [zoom=13]{ line-width:0.8; }\n [zoom=14]{ line-width:1.0 + 1.8; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:6 + 2; }\n [zoom=17]{ line-width:8 + 2; }\n [zoom=18]{ line-width:10 + 3; }\n}\n.route.bridge::b[highway='living_street'],\n.route.bridge::b[highway='residential'],\n.route.bridge::b[highway='road'],\n.route.bridge::b[highway='tertiary'],\n.route.bridge::b[highway='tertiary_link'],\n.route.bridge::b[highway='unclassified'] {\n [zoom>9] { line-color:spin(darken(@road_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=10]{ line-width:0.2 + 1; line-opacity:0.4; }\n [zoom=11]{ line-width:0.4 + 1; line-opacity:0.6; }\n [zoom=12]{ line-width:0.6 + 1; line-opacity:0.8; }\n [zoom=13]{ line-width:0.8 + 1; }\n [zoom=14]{ line-width:1.0 + 1.8; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:6 + 2; }\n [zoom=17]{ line-width:8 + 2; }\n [zoom=18]{ line-width:10 + 3; }\n}\n.route.fill[highway='living_street'],\n.route.fill[highway='residential'],\n.route.fill[highway='road'],\n.route.fill[highway='tertiary'],\n.route.fill[highway='tertiary_link'],\n.route.fill[highway='unclassified'] {\n [zoom>13]{ line-color:@road_fill; line-cap:round; line-join:round; }\n [zoom=14]{ line-width:1.0; }\n [zoom=15]{ line-width:3.5; }\n [zoom=16]{ line-width:6; }\n [zoom=17]{ line-width:8; }\n [zoom=18]{ line-width:10; }\n}\n\n\/* Secondary *\/\n.route.line[highway='secondary'] {\n [zoom>7] { line-color:@road_line; line-cap:round; line-join:round; }\n [zoom=8] { line-width:0.3; line-opacity:0.8; }\n [zoom=9] { line-width:0.5; }\n [zoom=10]{ line-width:0.7; }\n [zoom=11]{ line-width:0.9; }\n [zoom>11]{ line-color:@secondary_line; }\n [zoom=12]{ line-width:0.9 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2.6 + 2; }\n [zoom=15]{ line-width:4 + 2; }\n [zoom=16]{ line-width:6 + 2.5; }\n [zoom=17]{ line-width:8 + 3; }\n [zoom=18]{ line-width:16 + 3; }\n}\n.route.bridge::b[highway='secondary'] {\n [zoom>7] { line-color:spin(darken(@road_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=8] { line-width:0.3; line-opacity:0.8; }\n [zoom=9] { line-width:0.5; }\n [zoom=10]{ line-width:0.7; }\n [zoom=11]{ line-width:0.9; }\n [zoom>11]{ line-color:spin(darken(@secondary_line,15),-10); }\n [zoom=12]{ line-width:0.9 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2.6 + 2; }\n [zoom=15]{ line-width:4 + 2; }\n [zoom=16]{ line-width:6 + 2.5; }\n [zoom=17]{ line-width:8 + 3; }\n [zoom=18]{ line-width:16 + 3; }\n}\n.route.fill[highway='secondary'] {\n [zoom>11]{ line-color:@secondary_fill; line-cap:round; line-join:round; }\n [zoom=12]{ line-width:0.9; }\n [zoom=13]{ line-width:1.2; }\n [zoom=14]{ line-width:2.6; }\n [zoom=15]{ line-width:4; }\n [zoom=16]{ line-width:6; }\n [zoom=17]{ line-width:8; }\n [zoom=18]{ line-width:16; }\n}\n\n\/* Primary *\/\n.route.line[highway='primary'] {\n [zoom>6] { line-color:@primary_line; line-cap:round; line-join:round; }\n [zoom=7] { line-width:0.2; line-opacity:0.6; }\n [zoom=8] { line-width:0.4; line-opacity:0.8; }\n [zoom=9] { line-width:0.6; }\n [zoom=10]{ line-width:0.8; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.bridge::b[highway='primary'] {\n [zoom>6] { line-color:spin(darken(@primary_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=7] { line-width:0.2 + 1; line-opacity:0.6; }\n [zoom=8] { line-width:0.4 + 1; line-opacity:0.8; }\n [zoom=9] { line-width:0.6 + 1; }\n [zoom=10]{ line-width:0.8 + 1; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.fill[highway='primary'] {\n [zoom>10]{ line-color:@primary_fill; line-cap:round; line-join:round; }\n [zoom=11]{ line-width:0.8; }\n [zoom=12]{ line-width:1.0; }\n [zoom=13]{ line-width:1.4; }\n [zoom=14]{ line-width:3; }\n [zoom=15]{ line-width:5; }\n [zoom=16]{ line-width:7; }\n [zoom=17]{ line-width:9; }\n [zoom=18]{ line-width:18; }\n}\n\n\/* Trunk *\/\n.route.line[highway='trunk'] {\n [zoom>6] { line-color:@trunk_line; line-cap:round; line-join:round; }\n [zoom=7] { line-width:0.3; line-opacity:0.6; }\n [zoom=8] { line-width:0.5; line-opacity:0.8; }\n [zoom=9] { line-width:0.7; }\n [zoom=10]{ line-width:0.8; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.bridge::b[highway='trunk'] {\n [zoom>6] { line-color:spin(darken(@trunk_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=7] { line-width:0.3; line-opacity:0.6 + 1; }\n [zoom=8] { line-width:0.5; line-opacity:0.8 + 1; }\n [zoom=9] { line-width:0.7 + 1; }\n [zoom=10]{ line-width:0.8 + 1; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.fill[highway='trunk'] {\n [zoom>10]{ line-color:@trunk_fill; line-cap:round; line-join:round; }\n [zoom=11]{ line-width:0.8; }\n [zoom=12]{ line-width:1.0; }\n [zoom=13]{ line-width:1.4; }\n [zoom=14]{ line-width:3; }\n [zoom=15]{ line-width:5; }\n [zoom=16]{ line-width:7; }\n [zoom=17]{ line-width:9; }\n [zoom=18]{ line-width:18; }\n}\n\n\/* Motorway *\/\n.route.line[highway='motorway'][tunnel='no'],\n.route.tunnel[highway='motorway'] {\n [zoom>6] { line-color:@motorway_line; line-cap:round; line-join:round; }\n .tunnel[zoom>6] { line-dasharray:4,2; line-cap:butt; }\n [zoom=7] { line-width:0.4; line-opacity:0.6; }\n [zoom=8] { line-width:0.6; line-opacity:0.8; }\n [zoom=9] { line-width:0.8; }\n [zoom=10]{ line-width:1.0; }\n [zoom=11]{ line-width:1.0 + 1.8; }\n [zoom=12]{ line-width:1.2 + 2; }\n [zoom=13]{ line-width:2 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:6 + 2; }\n [zoom=16]{ line-width:8 + 2.5; }\n [zoom=17]{ line-width:10 + 3; }\n [zoom=18]{ line-width:20 + 3; }\n}\n.route.bridge::b[highway='motorway'] {\n [zoom>6] { line-color:spin(darken(@motorway_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=7] { line-width:0.4; line-opacity:0.6 + 1; }\n [zoom=8] { line-width:0.6; line-opacity:0.8 + 1; }\n [zoom=9] { line-width:0.8 + 1; }\n [zoom=10]{ line-width:1.0 + 1; }\n [zoom=11]{ line-width:1.0 + 1.8; }\n [zoom=12]{ line-width:1.2 + 2; }\n [zoom=13]{ line-width:2 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:6 + 2; }\n [zoom=16]{ line-width:8 + 2.5; }\n [zoom=17]{ line-width:10 + 3; }\n [zoom=18]{ line-width:20 + 3; }\n}\n.route.fill[highway='motorway'] {\n [zoom>10]{ line-color:@motorway_fill; line-cap:round; line-join:round; }\n [zoom>10][tunnel='yes'] { line-color:lighten(@motorway_fill,10); }\n [zoom=11]{ line-width:1.0; }\n [zoom=12]{ line-width:1.2; }\n [zoom=13]{ line-width:2; }\n [zoom=14]{ line-width:3; }\n [zoom=15]{ line-width:6; }\n [zoom=16]{ line-width:8; }\n [zoom=17]{ line-width:10; }\n [zoom=18]{ line-width:20; }\n}\n\n\/* ---- TURNING CIRCLES ---- *\/\n\n.turning-circle[zoom>=14] {\n marker-fill:@road_fill;\n marker-line-color:@road_line;\n marker-line-width:1;\n [zoom=14] { marker-width: 2; }\n [zoom=15] { marker-width: 4; }\n [zoom=16] { marker-width: 7; }\n [zoom=17] { marker-width: 9; }\n [zoom=18] { marker-width: 12; marker-line-width: 1.5; }\n}\n\n\/* ---- ONE WAY ARROWS ---- *\/\n\/* FIXME *\/\n\/*.route.label::arrow[oneway='yes'][zoom>15] {\n marker-type:arrow;\n marker-line-width:1;\n marker-line-opacity:0.5;\n marker-line-color:#fff;\n marker-spacing: 300;\n marker-fill:darken(@motorway_line,10);\n marker-opacity:0.8;\n [zoom=16] {\n marker-transform:\"scale(0)\";\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'],\n [highway='secondary'] { marker-transform:\"scale(0.8)\"; }\n }\n [zoom=17] {\n marker-transform:\"scale(0.8)\";\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'],\n [highway='secondary'] { marker-transform:\"scale(0.9)\"; }\n }\n [zoom=18] {\n marker-transform:\"scale(1)\";\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'],\n [highway='secondary'] { marker-transform:\"scale(1.2)\"; }\n }\n}*\/\n\n\/* ---- AERO ---- *\/\n.aero.poly[zoom>13] {\n line-color:@road_line;\n polygon-fill:lighten(@road_line,10);\n}\n","old_contents":"\/* ---- PALETTE ---- *\/\n\n@motorway_fill: #a8bae0; \/*#93b5d9;*\/\n@motorway_line: spin(darken(@motorway_fill,25),-10);\n@trunk_fill: #a7dea5;\/*#fabd7d;*\/\n@trunk_line: spin(darken(@trunk_fill,25),-10);\n@primary_fill: #fcf7bd;\n@primary_line: spin(darken(@primary_fill,25),-10);\n@secondary_fill:@primary_fill;\n@secondary_line:spin(darken(@secondary_fill,25),-10);\n@road_fill: #fff;\n@road_line: #bbb;\n@access_fill: @road_fill;\n@access_line: @road_line;\n@track: @road;\n@footway: #6B9;\n@cycleway: #69B;\n@bridge: rgba(64,64,64,0.66);\n\n\/* ---- ROADS ---- *\/\n\n\/* Service\/Access *\/\n.route.line[highway='service'] {\n [zoom>12]{ line-color:@access_line; line-cap:square; line-join:round; }\n [zoom=13]{ line-width:0.2; line-opacity:0.4; }\n [zoom=14]{ line-width:0.4; line-opacity:0.6; }\n [zoom=15]{ line-width:1; line-opacity:0.8; }\n [zoom=16]{ line-width:1.6 + 2; }\n [zoom=17]{ line-width:4 + 2; }\n [zoom=18]{ line-width:7 + 3; }\n}\n.route.fill[highway='service'] {\n [zoom>15]{ line-color:@access_fill; line-cap:square; line-join:round; }\n [zoom=16]{ line-width:1.6; }\n [zoom=17]{ line-width:4; }\n [zoom=18]{ line-width:7; }\n}\n\n\/* Motorway Links *\/\n.route.line[highway='motorway_link'][tunnel='no'],\n.route.tunnel[highway='motorway_link'] {\n [zoom>6] { line-color:@motorway_line; line-cap:round; line-join:round; }\n .tunnel[zoom>6] { line-dasharray:4,2; line-cap:butt; }\n [zoom=7] { line-width:0.2; line-opacity:0.6; }\n [zoom=8] { line-width:0.4; line-opacity:0.8; }\n [zoom=9] { line-width:0.6; }\n [zoom=10]{ line-width:0.8; }\n [zoom=11]{ line-width:1; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2 + 2; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:5 + 2.5; }\n [zoom=17]{ line-width:6 + 2.5; }\n [zoom=18]{ line-width:14 + 2.5; }\n}\n.route.bridge::b[highway='motorway_link'] {\n [zoom>6] { line-color:darken(@motorway_line,15); line-cap:butt; line-join:round; }\n [zoom=7] { line-width:0.2; line-opacity:0.6 + 1; }\n [zoom=8] { line-width:0.4; line-opacity:0.8 + 1; }\n [zoom=9] { line-width:0.6 + 1; }\n [zoom=10]{ line-width:0.8 + 1; }\n [zoom=11]{ line-width:1; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2 + 2; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:5 + 2.5; }\n [zoom=17]{ line-width:6 + 2.5; }\n [zoom=18]{ line-width:14 + 2.5; }\n}\n.route.fill[highway='motorway_link'] {\n [zoom>11]{ line-color:@motorway_fill; line-cap:round; line-join:round; }\n [zoom>11][tunnel='yes'] { line-color:lighten(@motorway_fill,10); }\n \/*[zoom=11]{ line-width:0.8; }*\/\n [zoom=12]{ line-width:1.0; }\n [zoom=13]{ line-width:1.2; }\n [zoom=14]{ line-width:2; }\n [zoom=15]{ line-width:3.5; }\n [zoom=16]{ line-width:5; }\n [zoom=17]{ line-width:6; }\n [zoom=18]{ line-width:14; }\n}\n\n\/* Standard\/Unknown *\/\n.route.line[highway='living_street'],\n.route.line[highway='residential'],\n.route.line[highway='road'],\n.route.line[highway='tertiary'],\n.route.line[highway='tertiary_link'],\n.route.line[highway='unclassified'] {\n [zoom>9] { line-color:@road_line; line-cap:round; line-join:round; }\n [zoom=10]{ line-width:0.2; line-opacity:0.4; }\n [zoom=11]{ line-width:0.4; line-opacity:0.6; }\n [zoom=12]{ line-width:0.6; line-opacity:0.8; }\n [zoom=13]{ line-width:0.8; }\n [zoom=14]{ line-width:1.0 + 1.8; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:6 + 2; }\n [zoom=17]{ line-width:8 + 2; }\n [zoom=18]{ line-width:10 + 3; }\n}\n.route.bridge::b[highway='living_street'],\n.route.bridge::b[highway='residential'],\n.route.bridge::b[highway='road'],\n.route.bridge::b[highway='tertiary'],\n.route.bridge::b[highway='tertiary_link'],\n.route.bridge::b[highway='unclassified'] {\n [zoom>9] { line-color:spin(darken(@road_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=10]{ line-width:0.2 + 1; line-opacity:0.4; }\n [zoom=11]{ line-width:0.4 + 1; line-opacity:0.6; }\n [zoom=12]{ line-width:0.6 + 1; line-opacity:0.8; }\n [zoom=13]{ line-width:0.8 + 1; }\n [zoom=14]{ line-width:1.0 + 1.8; }\n [zoom=15]{ line-width:3.5 + 2; }\n [zoom=16]{ line-width:6 + 2; }\n [zoom=17]{ line-width:8 + 2; }\n [zoom=18]{ line-width:10 + 3; }\n}\n.route.fill[highway='living_street'],\n.route.fill[highway='residential'],\n.route.fill[highway='road'],\n.route.fill[highway='tertiary'],\n.route.fill[highway='tertiary_link'],\n.route.fill[highway='unclassified'] {\n [zoom>13]{ line-color:@road_fill; line-cap:round; line-join:round; }\n [zoom=14]{ line-width:1.0; }\n [zoom=15]{ line-width:3.5; }\n [zoom=16]{ line-width:6; }\n [zoom=17]{ line-width:8; }\n [zoom=18]{ line-width:10; }\n}\n\n\/* Secondary *\/\n.route.line[highway='secondary'] {\n [zoom>7] { line-color:@road_line; line-cap:round; line-join:round; }\n [zoom=8] { line-width:0.3; line-opacity:0.8; }\n [zoom=9] { line-width:0.5; }\n [zoom=10]{ line-width:0.7; }\n [zoom=11]{ line-width:0.9; }\n [zoom>11]{ line-color:@secondary_line; }\n [zoom=12]{ line-width:0.9 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2.6 + 2; }\n [zoom=15]{ line-width:4 + 2; }\n [zoom=16]{ line-width:6 + 2.5; }\n [zoom=17]{ line-width:8 + 3; }\n [zoom=18]{ line-width:16 + 3; }\n}\n.route.bridge::b[highway='secondary'] {\n [zoom>7] { line-color:spin(darken(@road_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=8] { line-width:0.3; line-opacity:0.8; }\n [zoom=9] { line-width:0.5; }\n [zoom=10]{ line-width:0.7; }\n [zoom=11]{ line-width:0.9; }\n [zoom>11]{ line-color:spin(darken(@secondary_line,15),-10); }\n [zoom=12]{ line-width:0.9 + 2; }\n [zoom=13]{ line-width:1.2 + 2; }\n [zoom=14]{ line-width:2.6 + 2; }\n [zoom=15]{ line-width:4 + 2; }\n [zoom=16]{ line-width:6 + 2.5; }\n [zoom=17]{ line-width:8 + 3; }\n [zoom=18]{ line-width:16 + 3; }\n}\n.route.fill[highway='secondary'] {\n [zoom>11]{ line-color:@secondary_fill; line-cap:round; line-join:round; }\n [zoom=12]{ line-width:0.9; }\n [zoom=13]{ line-width:1.2; }\n [zoom=14]{ line-width:2.6; }\n [zoom=15]{ line-width:4; }\n [zoom=16]{ line-width:6; }\n [zoom=17]{ line-width:8; }\n [zoom=18]{ line-width:16; }\n}\n\n\/* Primary *\/\n.route.line[highway='primary'] {\n [zoom>6] { line-color:@primary_line; line-cap:round; line-join:round; }\n [zoom=7] { line-width:0.2; line-opacity:0.6; }\n [zoom=8] { line-width:0.4; line-opacity:0.8; }\n [zoom=9] { line-width:0.6; }\n [zoom=10]{ line-width:0.8; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.bridge::b[highway='primary'] {\n [zoom>6] { line-color:spin(darken(@primary_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=7] { line-width:0.2 + 1; line-opacity:0.6; }\n [zoom=8] { line-width:0.4 + 1; line-opacity:0.8; }\n [zoom=9] { line-width:0.6 + 1; }\n [zoom=10]{ line-width:0.8 + 1; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.fill[highway='primary'] {\n [zoom>10]{ line-color:@primary_fill; line-cap:round; line-join:round; }\n [zoom=11]{ line-width:0.8; }\n [zoom=12]{ line-width:1.0; }\n [zoom=13]{ line-width:1.4; }\n [zoom=14]{ line-width:3; }\n [zoom=15]{ line-width:5; }\n [zoom=16]{ line-width:7; }\n [zoom=17]{ line-width:9; }\n [zoom=18]{ line-width:18; }\n}\n\n\/* Trunk *\/\n.route.line[highway='trunk'] {\n [zoom>6] { line-color:@trunk_line; line-cap:round; line-join:round; }\n [zoom=7] { line-width:0.3; line-opacity:0.6; }\n [zoom=8] { line-width:0.5; line-opacity:0.8; }\n [zoom=9] { line-width:0.7; }\n [zoom=10]{ line-width:0.8; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.bridge::b[highway='trunk'] {\n [zoom>6] { line-color:spin(darken(@trunk_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=7] { line-width:0.3; line-opacity:0.6 + 1; }\n [zoom=8] { line-width:0.5; line-opacity:0.8 + 1; }\n [zoom=9] { line-width:0.7 + 1; }\n [zoom=10]{ line-width:0.8 + 1; }\n [zoom=11]{ line-width:0.8 + 1.8; }\n [zoom=12]{ line-width:1.0 + 2; }\n [zoom=13]{ line-width:1.4 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:5 + 2; }\n [zoom=16]{ line-width:7 + 2.5; }\n [zoom=17]{ line-width:9 + 3; }\n [zoom=18]{ line-width:18 + 3; }\n}\n.route.fill[highway='trunk'] {\n [zoom>10]{ line-color:@trunk_fill; line-cap:round; line-join:round; }\n [zoom=11]{ line-width:0.8; }\n [zoom=12]{ line-width:1.0; }\n [zoom=13]{ line-width:1.4; }\n [zoom=14]{ line-width:3; }\n [zoom=15]{ line-width:5; }\n [zoom=16]{ line-width:7; }\n [zoom=17]{ line-width:9; }\n [zoom=18]{ line-width:18; }\n}\n\n\/* Motorway *\/\n.route.line[highway='motorway'][tunnel='no'],\n.route.tunnel[highway='motorway'] {\n [zoom>6] { line-color:@motorway_line; line-cap:round; line-join:round; }\n .tunnel[zoom>6] { line-dasharray:4,2; line-cap:butt; }\n [zoom=7] { line-width:0.4; line-opacity:0.6; }\n [zoom=8] { line-width:0.6; line-opacity:0.8; }\n [zoom=9] { line-width:0.8; }\n [zoom=10]{ line-width:1.0; }\n [zoom=11]{ line-width:1.0 + 1.8; }\n [zoom=12]{ line-width:1.2 + 2; }\n [zoom=13]{ line-width:2 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:6 + 2; }\n [zoom=16]{ line-width:8 + 2.5; }\n [zoom=17]{ line-width:10 + 3; }\n [zoom=18]{ line-width:20 + 3; }\n}\n.route.bridge::b[highway='motorway'] {\n [zoom>6] { line-color:spin(darken(@motorway_line,15),-10); line-cap:butt; line-join:round; }\n [zoom=7] { line-width:0.4; line-opacity:0.6 + 1; }\n [zoom=8] { line-width:0.6; line-opacity:0.8 + 1; }\n [zoom=9] { line-width:0.8 + 1; }\n [zoom=10]{ line-width:1.0 + 1; }\n [zoom=11]{ line-width:1.0 + 1.8; }\n [zoom=12]{ line-width:1.2 + 2; }\n [zoom=13]{ line-width:2 + 2; }\n [zoom=14]{ line-width:3 + 2; }\n [zoom=15]{ line-width:6 + 2; }\n [zoom=16]{ line-width:8 + 2.5; }\n [zoom=17]{ line-width:10 + 3; }\n [zoom=18]{ line-width:20 + 3; }\n}\n.route.fill[highway='motorway'] {\n [zoom>10]{ line-color:@motorway_fill; line-cap:round; line-join:round; }\n [zoom>10][tunnel='yes'] { line-color:lighten(@motorway_fill,10); }\n [zoom=11]{ line-width:1.0; }\n [zoom=12]{ line-width:1.2; }\n [zoom=13]{ line-width:2; }\n [zoom=14]{ line-width:3; }\n [zoom=15]{ line-width:6; }\n [zoom=16]{ line-width:8; }\n [zoom=17]{ line-width:10; }\n [zoom=18]{ line-width:20; }\n}\n\n\/* ---- TURNING CIRCLES ---- *\/\n\n.turning-circle[zoom>=14] {\n marker-fill:@road_fill;\n marker-line-color:@road_line;\n marker-line-width:1;\n [zoom=14] { marker-width: 2; }\n [zoom=15] { marker-width: 4; }\n [zoom=16] { marker-width: 7; }\n [zoom=17] { marker-width: 9; }\n [zoom=18] { marker-width: 12; marker-line-width: 1.5; }\n}\n\n\/* ---- ONE WAY ARROWS ---- *\/\n\/* FIXME *\/\n\/*.route.label::arrow[oneway='yes'][zoom>15] {\n marker-type:arrow;\n marker-line-width:1;\n marker-line-opacity:0.5;\n marker-line-color:#fff;\n marker-spacing: 300;\n marker-fill:darken(@motorway_line,10);\n marker-opacity:0.8;\n [zoom=16] {\n marker-transform:\"scale(0)\";\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'],\n [highway='secondary'] { marker-transform:\"scale(0.8)\"; }\n }\n [zoom=17] {\n marker-transform:\"scale(0.8)\";\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'],\n [highway='secondary'] { marker-transform:\"scale(0.9)\"; }\n }\n [zoom=18] {\n marker-transform:\"scale(1)\";\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'],\n [highway='secondary'] { marker-transform:\"scale(1.2)\"; }\n }\n}*\/\n\n\/* ---- AERO ---- *\/\n.aero.poly[zoom>13] {\n line-color:@road_line;\n polygon-fill:lighten(@road_line,10);\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"aeebdc74ef519551bd49e87ca938d93792a3d9aa","subject":"Reposition workDesc element","message":"Reposition workDesc element\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n libmei.AddChild(header, workDesc);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/*\n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n parent = beam._property:ParentBeam;\n if (parent = null)\n {\n parent = l;\n }\n if (beam._parent != parent._id)\n {\n libmei.AddChild(parent, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pnum & '.0' \/ pden & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', gesdur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'authority', 'SMuFL');\n libmei.AddAttribute(symbol, 'glyphnum', glyphnum);\n libmei.AddAttribute(symbol, 'glyphname', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/*\n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n parent = beam._property:ParentBeam;\n if (parent = null)\n {\n parent = l;\n }\n if (beam._parent != parent._id)\n {\n libmei.AddChild(parent, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pnum & '.0' \/ pden & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', gesdur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'authority', 'SMuFL');\n libmei.AddAttribute(symbol, 'glyphnum', glyphnum);\n libmei.AddAttribute(symbol, 'glyphname', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"9df80ae5157d9ac21a5e89dbc1daa95b7fe8db55","subject":"shield style tweaks","message":"shield style tweaks\n","repos":"mapbox\/mapbox-studio-streets-basic.tm2,mapbox\/mapbox-studio-streets-basic.tm2","old_file":"label.mss","new_file":"label.mss","new_contents":"\/\/ LABEL.MSS CONTENTS:\n\/\/ 1__ Ocean & Marine Labels\n\/\/ 2__ Place Names\n\/\/ 2_1__ Countries\n\/\/ 2_2__ States\n\/\/ 2_3__ Cities\n\/\/ 2_4__ Towns\n\/\/ 2_5__ Villages\n\/\/ 2_6__ Suburbs\n\/\/ 2_7__ Neighbourhoods & Hamlets\n\/\/ 4__ Water Labels \n\/\/ 5__ Road Labels\n\n\/\/ Font sets are defined in vars.mss\n\n\/\/ =====================================================================\n\/\/ 1__ OCEAN & MARINE LABELS\n\/\/ =====================================================================\n\n#marine_label[zoom>=2][\"mapnik::geometry_type\"=1],\n#marine_label[zoom>=2][\"mapnik::geometry_type\"=2] {\n text-name: @name;\n text-face-name: @sans_lt_italic;\n text-fill: lighten(@water,20);\n [\"mapnik::geometry_type\"=1] {\n text-placement: point;\n text-wrap-width: 30;\n }\n [\"mapnik::geometry_type\"=2] {\n text-placement: line;\n }\n [labelrank=1][zoom>=2],\n [labelrank=2][zoom>=3],\n [labelrank=3][zoom>=4],\n [labelrank=4][zoom>=5],\n [labelrank=5][zoom>=6],\n [labelrank=6][zoom>=7] {\n text-size: 13;\n text-character-spacing: 1;\n }\n [labelrank=1][zoom>=3],\n [labelrank=2][zoom>=4],\n [labelrank=3][zoom>=5],\n [labelrank=4][zoom>=6],\n [labelrank=5][zoom>=7],\n [labelrank=6][zoom>=8] {\n text-size: 16;\n text-character-spacing: 2;\n }\n [labelrank=1][zoom>=4],\n [labelrank=2][zoom>=5],\n [labelrank=3][zoom>=6] {\n text-size: 20;\n text-character-spacing: 4;\n }\n [labelrank=1][zoom>=5],\n [labelrank=2][zoom>=6],\n [labelrank=3][zoom>=7] {\n text-size: 24;\n text-character-spacing: 8;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ 2__ PLACE NAMES\n\/\/ =====================================================================\n\n\/\/ 2_1__ Countries _____________________________________________________\n\n#country_label[zoom>=2][zoom<=10] {\n text-name: @name;\n text-face-name: @sans_bold;\n [zoom=2] { text-face-name: @sans; }\n text-placement: point;\n text-size: 9;\n text-fill: @country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-wrap-width: 20;\n text-wrap-before: true;\n text-line-spacing: -3;\n [scalerank=1] {\n [zoom=3] { text-size: 12; text-wrap-width: 60; }\n [zoom=4] { text-size: 14; text-wrap-width: 90; }\n [zoom=5] { text-size: 20; text-wrap-width: 120; }\n [zoom>=6] { text-size: 20; text-wrap-width: 120; }\n }\n [scalerank=2] {\n [zoom=2] { text-name: [code]; }\n [zoom=3] { text-size: 11; }\n [zoom=4] { text-size: 13; }\n [zoom=5] { text-size: 17; }\n [zoom>=6] { text-size: 20; }\n }\n [scalerank=3] {\n [zoom=3] { text-name: [code]; }\n [zoom=4] { text-size: 11; }\n [zoom=5] { text-size: 15; }\n [zoom=6] { text-size: 17; }\n [zoom=7] { text-size: 18; text-wrap-width: 60; }\n [zoom>=8] { text-size: 20; text-wrap-width: 120; }\n }\n [scalerank=4] {\n [zoom=5] { text-size: 13; }\n [zoom=6] { text-size: 15; text-wrap-width: 60 }\n [zoom=7] { text-size: 16; text-wrap-width: 90; }\n [zoom=8] { text-size: 18; text-wrap-width: 120; }\n [zoom>=9] { text-size: 20; text-wrap-width: 120; }\n }\n [scalerank=5] {\n [zoom=5] { text-size: 11; }\n [zoom=6] { text-size: 13; }\n [zoom=7] { text-size: 14; text-wrap-width: 60; }\n [zoom=8] { text-size: 16; text-wrap-width: 90; }\n [zoom>=9] { text-size: 18; text-wrap-width: 120; }\n }\n [scalerank>=6] {\n [zoom=7] { text-size: 12; }\n [zoom=8] { text-size: 14; }\n [zoom>=9] { text-size: 16; }\n }\n}\n\n\n\/\/ 2_2__ States ________________________________________________________\n\n#state_label[zoom>=4][zoom<=10] {\n text-name: [abbr];\n text-face-name: @sans_lt;\n text-placement: point;\n text-fill: @state_text;\n text-halo-fill: fadeout(lighten(@land,5%),50%);\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-size: 9;\n [zoom>=4][area>100000],\n [zoom>=5][area>50000],\n [zoom>=6][area>10000],\n [zoom>=7][area<=10000] {\n text-name: [abbr];\n }\n [zoom>=5][area>100000],\n [zoom>=6][area>50000],\n [zoom>=7][area>10000],\n [zoom>=8][area<=10000] {\n text-name: @name;\n }\n [zoom>=5][zoom<=6] {\n [area>10000] { text-size: 12; }\n [area>50000] { text-size: 14; }\n text-wrap-width: 40;\n }\n [zoom>=7][zoom<=8] {\n text-size: 14;\n [area>50000] { text-size: 16; text-character-spacing: 1; }\n [area>100000] { text-size: 18; text-character-spacing: 3; }\n text-wrap-width: 60;\n }\n [zoom>=9][zoom<=10] {\n text-halo-radius: 2;\n text-size: 16;\n text-character-spacing: 2;\n [area>50000] { text-size: 18; text-character-spacing: 2; }\n text-wrap-width: 100;\n }\n}\n\n\/\/ 2_3__ Cities ________________________________________________________\n\n\/\/ City labels with dots for low zoom levels.\n\/\/ The separate attachment keeps the size of the XML down.\n#place_label::citydots[zoom>=4][zoom<=7][localrank<=2] {\n \/\/ explicitly defining all the `ldir` values wer'e going\n \/\/ to use shaves a bit off the final project.xml size\n [ldir='N'],[ldir='S'],[ldir='E'],[ldir='W'],\n [ldir='NE'],[ldir='SE'],[ldir='SW'],[ldir='NW'] {\n shield-file: url(\"img\/icon\/dot.svg\");\n shield-unlock-image: true;\n shield-name: @name;\n shield-face-name: @sans;\n shield-placement: point;\n shield-fill: @city_text;\n shield-halo-fill: #fff;\n shield-halo-radius: 1.5;\n shield-wrap-width: 40;\n shield-line-spacing: -4;\n shield-size: 11;\n [zoom>=5] {\n [scalerank>=0][scalerank<=2] { shield-size: 13; }\n [scalerank>=3][scalerank<=5] { shield-size: 12; }\n }\n [zoom>=6] {\n [scalerank>=0][scalerank<=2] { shield-size: 14; }\n [scalerank>=3][scalerank<=5] { shield-size: 12; }\n }\n [zoom=7] {\n [scalerank>=0][scalerank<=2] { shield-size: 15; }\n [scalerank>=3][scalerank<=5] { shield-size: 13; }\n [scalerank>=6] { shield-size: 12; }\n }\n [ldir='E'] { shield-text-dx: 4; }\n [ldir='W'] { shield-text-dx: -4; }\n [ldir='N'] { shield-text-dy: -4; }\n [ldir='S'] { shield-text-dy: 4; }\n [ldir='NE'] { shield-text-dx: 4; shield-text-dy: -3; }\n [ldir='SE'] { shield-text-dx: 4; shield-text-dy: 5; }\n [ldir='SW'] { shield-text-dx: -3; shield-text-dy: 3; }\n [ldir='NW'] { shield-text-dx: -4; shield-text-dy: -3; }\n }\n}\n\n\/\/ For medium to high zoom levels we do away with the dot\n\/\/ and center place labels on their point location.\n#place_label[type='city'][zoom>=8][zoom<=15][localrank=1] {\n text-name: @name;\n text-face-name: @sans;\n text-placement: point;\n text-fill: @city_text;\n text-halo-fill: #fff;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-wrap-width: 40;\n text-line-spacing: -4;\n \/\/ We keep the scalerank filters the same for each zoom level.\n \/\/ This is slightly inefficient-looking CartoCSS, but it saves\n \/\/ some space in the project.xml\n [zoom=8] {\n text-size: 13;\n text-wrap-width: 60;\n [scalerank>=0][scalerank<=1] { text-size: 18; }\n [scalerank>=2][scalerank<=3] { text-size: 16; }\n [scalerank>=4][scalerank<=5] { text-size: 15; }\n [scalerank>=6] { text-size: 13; }\n }\n [zoom=9] {\n text-size: 14;\n text-wrap-width: 60;\n [scalerank>=0][scalerank<=1] { text-size: 19; }\n [scalerank>=2][scalerank<=3] { text-size: 17; }\n [scalerank>=4][scalerank<=5] { text-size: 16; }\n [scalerank>=6] { text-size: 14; }\n }\n [zoom=10] {\n text-size: 15;\n text-wrap-width: 70;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 17; }\n [scalerank>=6] { text-size: 15; }\n }\n [zoom=11] {\n text-size: 16;\n text-wrap-width: 80;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 17; }\n [scalerank>=6] { text-size: 16; }\n }\n [zoom=12] {\n text-size: 17;\n text-wrap-width: 100;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 18; }\n [scalerank>=6] { text-size: 17; }\n }\n [zoom=13] {\n text-fill: mix(@city_text,@land,80);\n text-size: 18;\n text-wrap-width: 200;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 19; }\n [scalerank>=6] { text-size: 17; }\n }\n [zoom=14] {\n text-fill: mix(@city_text,@land,60);\n text-size: 19;\n text-wrap-width: 300;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 20; }\n [scalerank>=4][scalerank<=5] { text-size: 19; }\n [scalerank>=6] { text-size: 18; }\n }\n [zoom=15] {\n text-fill: mix(@city_text,@land,40);\n text-size: 20;\n text-wrap-width: 400;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 20; }\n [scalerank>=4][scalerank<=5] { text-size: 20; }\n [scalerank>=6] { text-size: 19; }\n }\n}\n\n\/\/ 2_4__ Towns _________________________________________________________\n\n#place_label[type='town'][zoom>=8][zoom<=17][localrank<=1] {\n text-name: @name;\n text-face-name: @sans;\n text-placement: point;\n text-fill: @town_text;\n text-halo-fill: @town_halo;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-wrap-width: 75;\n text-wrap-before: true;\n text-line-spacing: -4;\n text-size: 11;\n [zoom>=8] { text-size: 12; }\n [zoom>=10] { text-size: 13; }\n [zoom>=11] { text-size: 14; }\n [zoom>=12] { text-size: 15; text-wrap-width: 80; }\n [zoom>=13] {\n text-fill: mix(@city_text,@land,80);\n text-size: 16;\n text-wrap-width: 120;\n }\n [zoom>=14] {\n text-fill: mix(@city_text,@land,60);\n text-size: 18;\n text-wrap-width: 160;\n }\n [zoom>=15] {\n text-fill: mix(@city_text,@land,40);\n text-size: 20;\n text-wrap-width: 200;\n }\n [zoom>=16] { text-size: 22; text-wrap-width: 240; }\n}\n\n\/\/ 2_5 Villages ______________________________________________________\n\n#place_label[type='village'][zoom>=10][zoom<=14][localrank<=1],\n#place_label[type='village'][zoom>=15][zoom<=17] {\n text-name: @name;\n text-face-name: @sans;\n text-placement: point;\n text-fill: @town_text;\n text-size: 11;\n text-halo-fill: @town_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-wrap-width: 60;\n text-wrap-before: true;\n text-line-spacing: -4;\n [zoom>=12] { text-size: 12; }\n [zoom>=13] { text-wrap-width: 80; }\n [zoom>=14] { text-size: 14; text-wrap-width: 100; }\n [zoom>=15] { text-size: 16; text-wrap-width: 120; }\n [zoom>=16] { text-size: 18; text-wrap-width: 160; }\n [zoom=17] { text-size: 20; text-wrap-width: 200; }\n}\n\n\/\/ 2_6__ Suburbs _______________________________________________________\n\n#place_label[type='suburb'][zoom>=12][zoom<=14][localrank<=1],\n#place_label[type='suburb'][zoom>=15][zoom<=18] {\n text-name: @name;\n text-face-name: @sans_lt;\n text-placement: point;\n text-fill: @other_text;\n text-size: 11;\n text-halo-fill: @other_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-wrap-width: 60;\n text-wrap-before: true;\n text-line-spacing: -2;\n [zoom>=13] { text-size: 12; text-min-distance: 20; }\n [zoom>=14] { text-size: 13; text-wrap-width: 80; }\n [zoom>=15] { text-size: 14; text-wrap-width: 120; }\n [zoom>=16] { text-size: 16; text-wrap-width: 160; }\n [zoom>=17] { text-size: 20; text-wrap-width: 200; }\n}\n\n\/\/ 2_7__ Neighbourhoods & Hamlets ______________________________________\n\n#place_label[zoom>=13][zoom<=14][localrank<=1],\n#place_label[zoom>=15][zoom<=18] {\n [type='hamlet'],\n [type='neighbourhood'] {\n text-name: @name;\n text-face-name: @sans_lt;\n text-placement: point;\n text-fill: @other_text;\n text-size: 11;\n text-halo-fill: @other_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-wrap-width: 60;\n text-wrap-before: true;\n text-line-spacing: -2;\n [zoom>=14] { text-size: 12; text-wrap-width: 80; }\n [zoom>=16] { text-size: 14; text-wrap-width: 100; }\n [zoom>=17] { text-size: 16; text-wrap-width: 130; }\n [zoom>=18] { text-size: 18; text-wrap-width: 160; }\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ 4__ WATER LABELS\n\/\/ =====================================================================\n\n#water_label {\n [zoom<=15][area>200000],\n [zoom=16][area>50000],\n [zoom=17][area>10000],\n [zoom>=18][area>0]{\n text-name: @name;\n text-fill: lighten(@water,25);\n text-halo-fill: darken(@water,10);\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-size: 11;\n text-wrap-width: 50;\n text-wrap-before: true;\n text-line-spacing: -2;\n text-face-name: @sans_italic;\n }\n [zoom>=14][area>3200000],\n [zoom>=15][area>800000],\n [zoom>=16][area>200000],\n [zoom>=17][area>50000],\n [zoom>=18][area>10000] {\n text-size: 12;\n text-wrap-width: 75;\n }\n [zoom>=15][area>3200000],\n [zoom>=16][area>800000],\n [zoom>=17][area>200000],\n [zoom>=18][area>50000] {\n text-size: 14;\n text-wrap-width: 100;\n }\n [zoom>=16][area>3200000],\n [zoom>=17][area>800000],\n [zoom>=18][area>200000] {\n text-size: 16;\n text-wrap-width: 125;\n }\n [zoom>=17][area>3200000],\n [zoom>=18][area>800000] {\n text-size: 18;\n text-wrap-width: 150;\n }\n}\n\n#waterway_label[class='river'][zoom>=13],\n#waterway_label[class='canal'][zoom>=15],\n#waterway_label[class='stream'][zoom>=17],\n#waterway_label[class='stream_intermittent'][zoom>=17] {\n text-avoid-edges: true;\n text-name: @name;\n text-face-name: @sans_italic;\n text-fill: lighten(@water,25);\n text-halo-fill: darken(@water,10);\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-placement: line;\n text-size: 10;\n text-character-spacing: 1;\n [class='river'][zoom=14],\n [class='canal'][zoom=16],\n [class='stream'][zoom>=18],\n [class='stream_intermittent'][zoom>=18] {\n text-size: 10;\n }\n [class='river'][zoom=15],\n [class='canal'][zoom>=17] {\n text-size: 11;\n }\n [class='river'][zoom>=16],\n [class='canal'][zoom>=18] {\n text-size: 14;\n text-spacing: 300;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ 5__ ROAD LABELS\n\/\/ =====================================================================\n\n\/\/ highway shield\n#road_label::shield-pt[class='motorway'][zoom>=7][zoom<=10][localrank=1][reflen<=6],\n#road_label::shield-pt[class='motorway'][zoom>=9][zoom<=10][localrank=1][reflen<=6],\n#road_label::shield-ln[zoom>=11][reflen<=6] {\n shield-name: \"[ref].replace('\u00b7', '\\n')\";\n shield-size: 9;\n shield-line-spacing: -4;\n shield-file: url('img\/shield\/[shield]-[reflen].svg');\n shield-face-name: @sans;\n shield-fill: #333;\n [zoom>=14] {\n shield-transform: scale(1.25,1.25);\n shield-size: 11;\n }\n}\n#road_label::shield-pt[class='motorway'][zoom>=7][zoom<=10][localrank=1][reflen<=6],\n#road_label::shield-pt[class='motorway'][zoom>=9][zoom<=10][localrank=1][reflen<=6] {\n shield-placement: point;\n shield-avoid-edges: false;\n}\n#road_label::shield-ln[zoom>=11][reflen<=6] {\n shield-placement: line;\n shield-spacing: 400;\n shield-min-distance: 100;\n shield-avoid-edges: true;\n}\n\n\/\/ regular labels\n#road_label['mapnik::geometry_type'=2] {\n \/\/ Longer roads get a label earlier as they are likely to be more\n \/\/ important. This especially helps label density in rural\/remote areas.\n \/\/ This z14 filter is *not* redundant to logic in SQL queries. Because z14\n \/\/ includes all data for z14+ via overzooming, the streets included in a\n \/\/ z14 vector tile include more features than ideal for optimal performance.\n [class='motorway'][zoom>=12],\n [class='main'][zoom>=12],\n [class='street'][zoom<=14][len>2500],\n [class='street'][zoom>=15],\n [class='street_limited'] {\n text-avoid-edges: true;\n text-transform: uppercase;\n text-name: @name;\n text-character-spacing: 0.25;\n text-placement: line;\n text-face-name: @sans;\n text-fill: #444;\n text-size: 8;\n text-halo-fill: @road_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-min-distance: 200; \/\/ only for labels w\/ the same name\n [zoom>=14] { text-size: 9; }\n [zoom>=16] { text-size: 11; }\n [zoom>=18] { text-size: 12; }\n [class='motorway'],\n [class='main'] {\n [zoom>=14] { text-size: 10; }\n [zoom>=16] { text-size: 11; text-face-name: @sans_bold; }\n [zoom>=17] { text-size: 12; }\n [zoom>=18] { text-size: 14; }\n }\n }\n}\n\n\/\/ less prominent labels for all other types, by length\n#road_label['mapnik::geometry_type'=2]\n[class!='motorway']\n[class!='main']\n[class!='street']\n[class!='street_limited'] {\n [len>10000][zoom>=12],\n [len>5000][zoom>=13],\n [len>2500][zoom>=14],\n [len>1200][zoom>=15],\n [len>0][zoom>=16] {\n text-avoid-edges: true;\n text-name: @name;\n text-character-spacing: 0.25;\n text-placement: line;\n text-face-name: @sans;\n text-fill: #666;\n text-size: 9;\n text-halo-fill: @road_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-min-distance: 200; \/\/ only for labels w\/ the same name\n [zoom>=17] { text-size: 10; }\n [zoom>=18] { text-size: 11; }\n }\n}\n\n\/\/ =====================================================================\n\/\/ ADDRESS LABELS\n\/\/ =====================================================================\n\n#housenum_label[zoom>=18] {\n text-name:'[house_num]';\n text-face-name: @sans_lt_italic;\n text-fill: darken(@building, 20%);\n text-wrap-width: 50;\n text-wrap-before: true;\n text-placement:point;\n text-size: 9;\n [zoom>=19] {\n text-size: 11;\n text-character-spacing: -0.5;\n }\n}\n\n\n\/**\/\n","old_contents":"\/\/ LABEL.MSS CONTENTS:\n\/\/ 1__ Ocean & Marine Labels\n\/\/ 2__ Place Names\n\/\/ 2_1__ Countries\n\/\/ 2_2__ States\n\/\/ 2_3__ Cities\n\/\/ 2_4__ Towns\n\/\/ 2_5__ Villages\n\/\/ 2_6__ Suburbs\n\/\/ 2_7__ Neighbourhoods & Hamlets\n\/\/ 4__ Water Labels \n\/\/ 5__ Road Labels\n\n\/\/ Font sets are defined in vars.mss\n\n\/\/ =====================================================================\n\/\/ 1__ OCEAN & MARINE LABELS\n\/\/ =====================================================================\n\n#marine_label[zoom>=2][\"mapnik::geometry_type\"=1],\n#marine_label[zoom>=2][\"mapnik::geometry_type\"=2] {\n text-name: @name;\n text-face-name: @sans_lt_italic;\n text-fill: lighten(@water,20);\n [\"mapnik::geometry_type\"=1] {\n text-placement: point;\n text-wrap-width: 30;\n }\n [\"mapnik::geometry_type\"=2] {\n text-placement: line;\n }\n [labelrank=1][zoom>=2],\n [labelrank=2][zoom>=3],\n [labelrank=3][zoom>=4],\n [labelrank=4][zoom>=5],\n [labelrank=5][zoom>=6],\n [labelrank=6][zoom>=7] {\n text-size: 13;\n text-character-spacing: 1;\n }\n [labelrank=1][zoom>=3],\n [labelrank=2][zoom>=4],\n [labelrank=3][zoom>=5],\n [labelrank=4][zoom>=6],\n [labelrank=5][zoom>=7],\n [labelrank=6][zoom>=8] {\n text-size: 16;\n text-character-spacing: 2;\n }\n [labelrank=1][zoom>=4],\n [labelrank=2][zoom>=5],\n [labelrank=3][zoom>=6] {\n text-size: 20;\n text-character-spacing: 4;\n }\n [labelrank=1][zoom>=5],\n [labelrank=2][zoom>=6],\n [labelrank=3][zoom>=7] {\n text-size: 24;\n text-character-spacing: 8;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ 2__ PLACE NAMES\n\/\/ =====================================================================\n\n\/\/ 2_1__ Countries _____________________________________________________\n\n#country_label[zoom>=2][zoom<=10] {\n text-name: @name;\n text-face-name: @sans_bold;\n [zoom=2] { text-face-name: @sans; }\n text-placement: point;\n text-size: 9;\n text-fill: @country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-wrap-width: 20;\n text-wrap-before: true;\n text-line-spacing: -3;\n [scalerank=1] {\n [zoom=3] { text-size: 12; text-wrap-width: 60; }\n [zoom=4] { text-size: 14; text-wrap-width: 90; }\n [zoom=5] { text-size: 20; text-wrap-width: 120; }\n [zoom>=6] { text-size: 20; text-wrap-width: 120; }\n }\n [scalerank=2] {\n [zoom=2] { text-name: [code]; }\n [zoom=3] { text-size: 11; }\n [zoom=4] { text-size: 13; }\n [zoom=5] { text-size: 17; }\n [zoom>=6] { text-size: 20; }\n }\n [scalerank=3] {\n [zoom=3] { text-name: [code]; }\n [zoom=4] { text-size: 11; }\n [zoom=5] { text-size: 15; }\n [zoom=6] { text-size: 17; }\n [zoom=7] { text-size: 18; text-wrap-width: 60; }\n [zoom>=8] { text-size: 20; text-wrap-width: 120; }\n }\n [scalerank=4] {\n [zoom=5] { text-size: 13; }\n [zoom=6] { text-size: 15; text-wrap-width: 60 }\n [zoom=7] { text-size: 16; text-wrap-width: 90; }\n [zoom=8] { text-size: 18; text-wrap-width: 120; }\n [zoom>=9] { text-size: 20; text-wrap-width: 120; }\n }\n [scalerank=5] {\n [zoom=5] { text-size: 11; }\n [zoom=6] { text-size: 13; }\n [zoom=7] { text-size: 14; text-wrap-width: 60; }\n [zoom=8] { text-size: 16; text-wrap-width: 90; }\n [zoom>=9] { text-size: 18; text-wrap-width: 120; }\n }\n [scalerank>=6] {\n [zoom=7] { text-size: 12; }\n [zoom=8] { text-size: 14; }\n [zoom>=9] { text-size: 16; }\n }\n}\n\n\n\/\/ 2_2__ States ________________________________________________________\n\n#state_label[zoom>=4][zoom<=10] {\n text-name: [abbr];\n text-face-name: @sans_lt;\n text-placement: point;\n text-fill: @state_text;\n text-halo-fill: fadeout(lighten(@land,5%),50%);\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-size: 9;\n [zoom>=4][area>100000],\n [zoom>=5][area>50000],\n [zoom>=6][area>10000],\n [zoom>=7][area<=10000] {\n text-name: [abbr];\n }\n [zoom>=5][area>100000],\n [zoom>=6][area>50000],\n [zoom>=7][area>10000],\n [zoom>=8][area<=10000] {\n text-name: @name;\n }\n [zoom>=5][zoom<=6] {\n [area>10000] { text-size: 12; }\n [area>50000] { text-size: 14; }\n text-wrap-width: 40;\n }\n [zoom>=7][zoom<=8] {\n text-size: 14;\n [area>50000] { text-size: 16; text-character-spacing: 1; }\n [area>100000] { text-size: 18; text-character-spacing: 3; }\n text-wrap-width: 60;\n }\n [zoom>=9][zoom<=10] {\n text-halo-radius: 2;\n text-size: 16;\n text-character-spacing: 2;\n [area>50000] { text-size: 18; text-character-spacing: 2; }\n text-wrap-width: 100;\n }\n}\n\n\/\/ 2_3__ Cities ________________________________________________________\n\n\/\/ City labels with dots for low zoom levels.\n\/\/ The separate attachment keeps the size of the XML down.\n#place_label::citydots[zoom>=4][zoom<=7][localrank<=2] {\n \/\/ explicitly defining all the `ldir` values wer'e going\n \/\/ to use shaves a bit off the final project.xml size\n [ldir='N'],[ldir='S'],[ldir='E'],[ldir='W'],\n [ldir='NE'],[ldir='SE'],[ldir='SW'],[ldir='NW'] {\n shield-file: url(\"img\/icon\/dot.svg\");\n shield-unlock-image: true;\n shield-name: @name;\n shield-face-name: @sans;\n shield-placement: point;\n shield-fill: @city_text;\n shield-halo-fill: #fff;\n shield-halo-radius: 1.5;\n shield-wrap-width: 40;\n shield-line-spacing: -4;\n shield-size: 11;\n [zoom>=5] {\n [scalerank>=0][scalerank<=2] { shield-size: 13; }\n [scalerank>=3][scalerank<=5] { shield-size: 12; }\n }\n [zoom>=6] {\n [scalerank>=0][scalerank<=2] { shield-size: 14; }\n [scalerank>=3][scalerank<=5] { shield-size: 12; }\n }\n [zoom=7] {\n [scalerank>=0][scalerank<=2] { shield-size: 15; }\n [scalerank>=3][scalerank<=5] { shield-size: 13; }\n [scalerank>=6] { shield-size: 12; }\n }\n [ldir='E'] { shield-text-dx: 4; }\n [ldir='W'] { shield-text-dx: -4; }\n [ldir='N'] { shield-text-dy: -4; }\n [ldir='S'] { shield-text-dy: 4; }\n [ldir='NE'] { shield-text-dx: 4; shield-text-dy: -3; }\n [ldir='SE'] { shield-text-dx: 4; shield-text-dy: 5; }\n [ldir='SW'] { shield-text-dx: -3; shield-text-dy: 3; }\n [ldir='NW'] { shield-text-dx: -4; shield-text-dy: -3; }\n }\n}\n\n\/\/ For medium to high zoom levels we do away with the dot\n\/\/ and center place labels on their point location.\n#place_label[type='city'][zoom>=8][zoom<=15][localrank=1] {\n text-name: @name;\n text-face-name: @sans;\n text-placement: point;\n text-fill: @city_text;\n text-halo-fill: #fff;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-wrap-width: 40;\n text-line-spacing: -4;\n \/\/ We keep the scalerank filters the same for each zoom level.\n \/\/ This is slightly inefficient-looking CartoCSS, but it saves\n \/\/ some space in the project.xml\n [zoom=8] {\n text-size: 13;\n text-wrap-width: 60;\n [scalerank>=0][scalerank<=1] { text-size: 18; }\n [scalerank>=2][scalerank<=3] { text-size: 16; }\n [scalerank>=4][scalerank<=5] { text-size: 15; }\n [scalerank>=6] { text-size: 13; }\n }\n [zoom=9] {\n text-size: 14;\n text-wrap-width: 60;\n [scalerank>=0][scalerank<=1] { text-size: 19; }\n [scalerank>=2][scalerank<=3] { text-size: 17; }\n [scalerank>=4][scalerank<=5] { text-size: 16; }\n [scalerank>=6] { text-size: 14; }\n }\n [zoom=10] {\n text-size: 15;\n text-wrap-width: 70;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 17; }\n [scalerank>=6] { text-size: 15; }\n }\n [zoom=11] {\n text-size: 16;\n text-wrap-width: 80;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 17; }\n [scalerank>=6] { text-size: 16; }\n }\n [zoom=12] {\n text-size: 17;\n text-wrap-width: 100;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 18; }\n [scalerank>=6] { text-size: 17; }\n }\n [zoom=13] {\n text-fill: mix(@city_text,@land,80);\n text-size: 18;\n text-wrap-width: 200;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 19; }\n [scalerank>=4][scalerank<=5] { text-size: 19; }\n [scalerank>=6] { text-size: 17; }\n }\n [zoom=14] {\n text-fill: mix(@city_text,@land,60);\n text-size: 19;\n text-wrap-width: 300;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 20; }\n [scalerank>=4][scalerank<=5] { text-size: 19; }\n [scalerank>=6] { text-size: 18; }\n }\n [zoom=15] {\n text-fill: mix(@city_text,@land,40);\n text-size: 20;\n text-wrap-width: 400;\n [scalerank>=0][scalerank<=1] { text-size: 20; }\n [scalerank>=2][scalerank<=3] { text-size: 20; }\n [scalerank>=4][scalerank<=5] { text-size: 20; }\n [scalerank>=6] { text-size: 19; }\n }\n}\n\n\/\/ 2_4__ Towns _________________________________________________________\n\n#place_label[type='town'][zoom>=8][zoom<=17][localrank<=1] {\n text-name: @name;\n text-face-name: @sans;\n text-placement: point;\n text-fill: @town_text;\n text-halo-fill: @town_halo;\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-wrap-width: 75;\n text-wrap-before: true;\n text-line-spacing: -4;\n text-size: 11;\n [zoom>=8] { text-size: 12; }\n [zoom>=10] { text-size: 13; }\n [zoom>=11] { text-size: 14; }\n [zoom>=12] { text-size: 15; text-wrap-width: 80; }\n [zoom>=13] {\n text-fill: mix(@city_text,@land,80);\n text-size: 16;\n text-wrap-width: 120;\n }\n [zoom>=14] {\n text-fill: mix(@city_text,@land,60);\n text-size: 18;\n text-wrap-width: 160;\n }\n [zoom>=15] {\n text-fill: mix(@city_text,@land,40);\n text-size: 20;\n text-wrap-width: 200;\n }\n [zoom>=16] { text-size: 22; text-wrap-width: 240; }\n}\n\n\/\/ 2_5 Villages ______________________________________________________\n\n#place_label[type='village'][zoom>=10][zoom<=14][localrank<=1],\n#place_label[type='village'][zoom>=15][zoom<=17] {\n text-name: @name;\n text-face-name: @sans;\n text-placement: point;\n text-fill: @town_text;\n text-size: 11;\n text-halo-fill: @town_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-wrap-width: 60;\n text-wrap-before: true;\n text-line-spacing: -4;\n [zoom>=12] { text-size: 12; }\n [zoom>=13] { text-wrap-width: 80; }\n [zoom>=14] { text-size: 14; text-wrap-width: 100; }\n [zoom>=15] { text-size: 16; text-wrap-width: 120; }\n [zoom>=16] { text-size: 18; text-wrap-width: 160; }\n [zoom=17] { text-size: 20; text-wrap-width: 200; }\n}\n\n\/\/ 2_6__ Suburbs _______________________________________________________\n\n#place_label[type='suburb'][zoom>=12][zoom<=14][localrank<=1],\n#place_label[type='suburb'][zoom>=15][zoom<=18] {\n text-name: @name;\n text-face-name: @sans_lt;\n text-placement: point;\n text-fill: @other_text;\n text-size: 11;\n text-halo-fill: @other_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-wrap-width: 60;\n text-wrap-before: true;\n text-line-spacing: -2;\n [zoom>=13] { text-size: 12; text-min-distance: 20; }\n [zoom>=14] { text-size: 13; text-wrap-width: 80; }\n [zoom>=15] { text-size: 14; text-wrap-width: 120; }\n [zoom>=16] { text-size: 16; text-wrap-width: 160; }\n [zoom>=17] { text-size: 20; text-wrap-width: 200; }\n}\n\n\/\/ 2_7__ Neighbourhoods & Hamlets ______________________________________\n\n#place_label[zoom>=13][zoom<=14][localrank<=1],\n#place_label[zoom>=15][zoom<=18] {\n [type='hamlet'],\n [type='neighbourhood'] {\n text-name: @name;\n text-face-name: @sans_lt;\n text-placement: point;\n text-fill: @other_text;\n text-size: 11;\n text-halo-fill: @other_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-wrap-width: 60;\n text-wrap-before: true;\n text-line-spacing: -2;\n [zoom>=14] { text-size: 12; text-wrap-width: 80; }\n [zoom>=16] { text-size: 14; text-wrap-width: 100; }\n [zoom>=17] { text-size: 16; text-wrap-width: 130; }\n [zoom>=18] { text-size: 18; text-wrap-width: 160; }\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ 4__ WATER LABELS\n\/\/ =====================================================================\n\n#water_label {\n [zoom<=15][area>200000],\n [zoom=16][area>50000],\n [zoom=17][area>10000],\n [zoom>=18][area>0]{\n text-name: @name;\n text-fill: lighten(@water,25);\n text-halo-fill: darken(@water,10);\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-size: 11;\n text-wrap-width: 50;\n text-wrap-before: true;\n text-line-spacing: -2;\n text-face-name: @sans_italic;\n }\n [zoom>=14][area>3200000],\n [zoom>=15][area>800000],\n [zoom>=16][area>200000],\n [zoom>=17][area>50000],\n [zoom>=18][area>10000] {\n text-size: 12;\n text-wrap-width: 75;\n }\n [zoom>=15][area>3200000],\n [zoom>=16][area>800000],\n [zoom>=17][area>200000],\n [zoom>=18][area>50000] {\n text-size: 14;\n text-wrap-width: 100;\n }\n [zoom>=16][area>3200000],\n [zoom>=17][area>800000],\n [zoom>=18][area>200000] {\n text-size: 16;\n text-wrap-width: 125;\n }\n [zoom>=17][area>3200000],\n [zoom>=18][area>800000] {\n text-size: 18;\n text-wrap-width: 150;\n }\n}\n\n#waterway_label[class='river'][zoom>=13],\n#waterway_label[class='canal'][zoom>=15],\n#waterway_label[class='stream'][zoom>=17],\n#waterway_label[class='stream_intermittent'][zoom>=17] {\n text-avoid-edges: true;\n text-name: @name;\n text-face-name: @sans_italic;\n text-fill: lighten(@water,25);\n text-halo-fill: darken(@water,10);\n text-halo-radius: 1;\n text-halo-rasterizer: fast;\n text-placement: line;\n text-size: 10;\n text-character-spacing: 1;\n [class='river'][zoom=14],\n [class='canal'][zoom=16],\n [class='stream'][zoom>=18],\n [class='stream_intermittent'][zoom>=18] {\n text-size: 10;\n }\n [class='river'][zoom=15],\n [class='canal'][zoom>=17] {\n text-size: 11;\n }\n [class='river'][zoom>=16],\n [class='canal'][zoom>=18] {\n text-size: 14;\n text-spacing: 300;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ 5__ ROAD LABELS\n\/\/ =====================================================================\n\n\/\/ highway shield\n#road_label::shield-pt[zoom>=7][zoom<=10][localrank=1][reflen<=6],\n#road_label::shield-ln[zoom>=11][reflen<=6] {\n shield-name: \"[ref].replace('\u00b7', '\\n')\";\n shield-size: 9;\n shield-line-spacing: -4;\n shield-file: url('img\/shield\/[shield]-[reflen].svg');\n shield-face-name: @sans;\n shield-fill: #333;\n [zoom>=14] {\n shield-transform: scale(1.25,1.25);\n shield-size: 11;\n }\n}\n#road_label::shield-pt[zoom>=7][zoom<=10][localrank=1][reflen<=6] {\n shield-placement: point;\n shield-avoid-edges: false;\n}\n#road_label::shield-ln[zoom>=11][reflen<=6] {\n shield-placement: line;\n shield-spacing: 400;\n shield-min-distance: 100;\n shield-avoid-edges: true;\n}\n\n\/\/ regular labels\n#road_label['mapnik::geometry_type'=2] {\n \/\/ Longer roads get a label earlier as they are likely to be more\n \/\/ important. This especially helps label density in rural\/remote areas.\n \/\/ This z14 filter is *not* redundant to logic in SQL queries. Because z14\n \/\/ includes all data for z14+ via overzooming, the streets included in a\n \/\/ z14 vector tile include more features than ideal for optimal performance.\n [class='motorway'][zoom>=12],\n [class='main'][zoom>=12],\n [class='street'][zoom<=14][len>2500],\n [class='street'][zoom>=15],\n [class='street_limited'] {\n text-avoid-edges: true;\n text-transform: uppercase;\n text-name: @name;\n text-character-spacing: 0.25;\n text-placement: line;\n text-face-name: @sans;\n text-fill: #444;\n text-size: 8;\n text-halo-fill: @road_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-min-distance: 200; \/\/ only for labels w\/ the same name\n [zoom>=14] { text-size: 9; }\n [zoom>=16] { text-size: 11; }\n [zoom>=18] { text-size: 12; }\n [class='motorway'],\n [class='main'] {\n [zoom>=14] { text-size: 10; }\n [zoom>=16] { text-size: 11; text-face-name: @sans_bold; }\n [zoom>=17] { text-size: 12; }\n [zoom>=18] { text-size: 14; }\n }\n }\n}\n\n\/\/ less prominent labels for all other types, by length\n#road_label['mapnik::geometry_type'=2]\n[class!='motorway']\n[class!='main']\n[class!='street']\n[class!='street_limited'] {\n [len>10000][zoom>=12],\n [len>5000][zoom>=13],\n [len>2500][zoom>=14],\n [len>1200][zoom>=15],\n [len>0][zoom>=16] {\n text-avoid-edges: true;\n text-name: @name;\n text-character-spacing: 0.25;\n text-placement: line;\n text-face-name: @sans;\n text-fill: #666;\n text-size: 9;\n text-halo-fill: @road_halo;\n text-halo-radius: 1.5;\n text-halo-rasterizer: fast;\n text-min-distance: 200; \/\/ only for labels w\/ the same name\n [zoom>=17] { text-size: 10; }\n [zoom>=18] { text-size: 11; }\n }\n}\n\n\/\/ =====================================================================\n\/\/ ADDRESS LABELS\n\/\/ =====================================================================\n\n#housenum_label[zoom>=18] {\n text-name:'[house_num]';\n text-face-name: @sans_lt_italic;\n text-fill: darken(@building, 20%);\n text-wrap-width: 50;\n text-wrap-before: true;\n text-placement:point;\n text-size: 9;\n [zoom>=19] {\n text-size: 11;\n text-character-spacing: -0.5;\n }\n}\n\n\n\/**\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"a967bfc02e2f863a8cad53472bdda1922d2b1abe","subject":"Add @metcon=\"false\" to measures not conforming to time signature","message":"Add @metcon=\"false\" to measures not conforming to time signature\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n \n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n \n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n mobj = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pnum & '.0' \/ pden & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', gesdur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n mobj = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pnum & '.0' \/ pden & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', gesdur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"9e058abcae25fad9b28c964d5dc0c80d597f6ace","subject":"Trying to implement new symbols","message":"Trying to implement new symbols\n\nlibmei methods aren't found yet","repos":"music-encoding\/sibmei","old_file":"src\/ExportProcessors.mss","new_file":"src\/ExportProcessors.mss","new_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '4.0.1');\n\n header = GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer, normalizedBeamProp) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Returns the active beam, if any, and creates new beam elements\n at the start of a beam.\n *\/\n switch (normalizedBeamProp)\n {\n case (NoBeam)\n {\n if (bobj.GraceNote)\n {\n if (layer._property:ActiveGraceBeam != null)\n {\n layer._property:ActiveGraceBeam = null;\n }\n \/\/ If there is an active non-grace beam, we have a normal beam spanning\n \/\/ over a non-beamed grace note that will be added as a child of that beam.\n return GetNongraceParentBeam(bobj, layer);\n }\n else\n {\n if (layer._property:ActiveBeam != null)\n {\n layer._property:ActiveBeam = null;\n }\n return null;\n }\n }\n case (StartBeam)\n {\n newBeam = libmei.Beam();\n if (bobj.GraceNote)\n {\n layer._property:ActiveGraceBeam = newBeam;\n nonGraceParentBeam = GetNongraceParentBeam(bobj, layer);\n if (nonGraceParentBeam != null)\n {\n newBeam._property:ParentBeam = nonGraceParentBeam;\n }\n }\n else\n {\n layer._property:ActiveBeam = newBeam;\n }\n return newBeam;\n }\n default {\n \/\/ ContinueBeam and SingleBeam\n if (bobj.GraceNote)\n {\n return layer._property:ActiveGraceBeam;\n }\n else\n {\n return layer._property:ActiveBeam;\n }\n }\n }\n} \/\/$end\n\nfunction ProcessTuplet (noteRest, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n parentTuplet = noteRest.ParentTupletIfAny;\n if (parentTuplet = null)\n {\n return null;\n }\n\n if (noteRest.GraceNote)\n {\n \/\/ In Sibelius, grace notes before the first tuplet note are part of the\n \/\/ tuplet. In MEI, we want to put them before the tuplet element.\n prevNote = PrevNormalOrGrace(noteRest, false);\n if (null = prevNote)\n {\n return null;\n }\n if (not TupletsEqual(parentTuplet, prevNote.ParentTupletIfAny))\n {\n return null;\n }\n }\n\n \/*\n We encode inner tuplets of nested tuplet structures as s.\n Therefore we always return the outermost MEI tuplet for content to be added.\n Still, we need to keep track of the inner tuplets to assign the @endid.\n layer._property:ActiveMeiTuplet always points to the innermost tuplet.\n *\/\n activeMeiTuplet = layer._property:ActiveMeiTuplet;\n\n tupletIsContinued = activeMeiTuplet != null and TupletsEqual(parentTuplet, activeMeiTuplet._property:SibTuplet);\n\n if (not(tupletIsContinued))\n {\n \/\/ New tuplets need to be added\n noteRestTupletStack = GetTupletStack(noteRest);\n sibTuplet = null;\n meiTupletDepth = GetMeiTupletDepth(layer);\n\n for i = meiTupletDepth to noteRestTupletStack.Length\n {\n sibTuplet = noteRestTupletStack[i];\n nextActiveMeiTuplet = GenerateTuplet(sibTuplet);\n if (meiTupletDepth > 0 or i > meiTupletDepth)\n {\n \/\/ We have an inner tuplet that we encode as \n nextActiveMeiTuplet = ShiftTupletToTupletSpan(nextActiveMeiTuplet, layer);\n }\n libmei.AddAttribute(nextActiveMeiTuplet, 'startid', '#' & meielement._id);\n \/\/ We basically create a linked list of tuplets\n nextActiveMeiTuplet._property:ParentTuplet = activeMeiTuplet;\n nextActiveMeiTuplet._property:SibTuplet = sibTuplet;\n activeMeiTuplet = nextActiveMeiTuplet;\n }\n layer._property:ActiveMeiTuplet = activeMeiTuplet;\n }\n\n meiTuplet = activeMeiTuplet;\n for i = 0 to CountTupletsEndingAtNoteRest(noteRest)\n {\n libmei.AddAttribute(meiTuplet, 'endid', '#' & meielement._id);\n meiTuplet = meiTuplet._property:ParentTuplet;\n }\n layer._property:ActiveMeiTuplet = meiTuplet;\n\n outermostMeiTuplet = activeMeiTuplet;\n while (outermostMeiTuplet._property:ParentTuplet != null)\n {\n outermostMeiTuplet = outermostMeiTuplet._property:ParentTuplet;\n }\n return outermostMeiTuplet;\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n\n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it\n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(tupletSpan._id);\n Self._property:MeasureObjects = mobjs;\n\n return tupletSpan;\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n\n if (lyricobj.Text = '')\n {\n return null;\n }\n\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n \/\/ In the case of elisions, we create multiple syl elements from one\n \/\/ LyricItem. We have to distinguish between the first and the last syl\n \/\/ element we created. In the common, simple case, both are identical.\n sylel_last = sylel;\n libmei.AddChild(verse, sylel);\n\n \/\/ Split syllable text by underscore, in case there is an elision\n syllables = MSplitString(syl.Text, '_');\n libmei.SetText(sylel, syllables[0]);\n\n \/\/ Handle any found elisions\n for s = 1 to syllables.Length\n {\n libmei.AddAttribute(sylel_last, 'con', 'b');\n sylel_last = libmei.Syl();\n libmei.SetText(sylel_last, syllables[s]);\n libmei.AddChild(verse, sylel_last);\n }\n\n if (syl.SyllableType = MiddleOfWord)\n {\n libmei.AddAttribute(sylel_last, 'con', 'd'); \/\/dash syllable connector\n\n \/\/ New word starts at the first syllable in the lyric_word or after an elision\n if (j = 0 or syllables.Length > 1)\n {\n libmei.AddAttribute(sylel_last, 'wordpos', 'i'); \/\/ 'initial'\n }\n else\n {\n libmei.AddAttribute(sylel_last, 'wordpos', 'm'); \/\/ 'medial'\n }\n }\n\n \/\/ Word ends at EndOfWord or before an elision (if there are syllables before the elision)\n if (j > 0 and (syl.SyllableType = EndOfWord or syllables.Length > 1))\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n libmei.AddChild(obj, verse);\n }\n else\n {\n Log('Could not find note object for syl ' & syl);\n }\n }\n\n \/\/ Check if the last syllable is melismatic\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel_last, 'con', 'u'); \/\/ 'underscore'\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so\n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessTremolo (bobj) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.DoubleTremolos = 0)\n {\n return null;\n }\n\n Log('Fingered tremolo: ' & bobj.DoubleTremolos);\n tremEl = libmei.FTrem();\n libmei.AddAttribute(tremEl, 'beams', bobj.DoubleTremolos);\n libmei.AddAttribute(tremEl, 'unitdur');\n\n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n \/\/ trills are special\n if (sobj.Index = '32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n \/\/ load symbol style dictionaries\n \/\/ TODO: load them once within Run()?\n if (Self._property:ModifierMap = null)\n {\n Self._property:ModifierMap = InitModifierSymbols();\n }\n modifierMap = Self._property:ModifierMap;\n\n if (Self._property:ControlEventMap = null)\n {\n Self._property:ControlEventMap = InitControlEventSymbols();\n }\n controlEventMap = Self._property:ControlEventMap;\n\n \/\/ iterate over controlEventMap\n if(controlEventMap.PropertyExists(sobj.Index))\n {\n mapValue = controlEventMap[sobj.Index];\n\n makeElement = mapValue[0];\n trace(makeElement);\n for atts = 1 to mapValue.Length\n {\n att = mapValue[atts];\n trace(att[0] & att[1]);\n }\n\n trace(libmei.MethodExists(makeElement));\n\n \/\/symbol = libmei.CallMethod(makeElement);\n \/\/symbol = AddBarObjectInfoToElement(sobj, symbol);\n \/\/mlines = Self._property:MeasureObjects;\n \/\/mlines.Push(symbol._id);\n }\n \n} \/\/$end\n\nfunction ProcessEndingSlurs (bar) {\n \/\/$module(ExportProcessors.mss)\n slur_resolver = Self._property:SlurResolver;\n for voiceNumber = 1 to 5\n {\n endingSlurs = slur_resolver[LayerHash(bar, voiceNumber)];\n if (endingSlurs != null)\n {\n for each slur in endingSlurs\n {\n end_obj = GetNoteObjectAtEndPosition(slur);\n if (end_obj != null)\n {\n libmei.AddAttribute(slur._property:mobj, 'endid', '#' & end_obj._id);\n }\n }\n }\n }\n} \/\/$end\n","old_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '4.0.1');\n\n header = GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer, normalizedBeamProp) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Returns the active beam, if any, and creates new beam elements\n at the start of a beam.\n *\/\n switch (normalizedBeamProp)\n {\n case (NoBeam)\n {\n if (bobj.GraceNote)\n {\n if (layer._property:ActiveGraceBeam != null)\n {\n layer._property:ActiveGraceBeam = null;\n }\n \/\/ If there is an active non-grace beam, we have a normal beam spanning\n \/\/ over a non-beamed grace note that will be added as a child of that beam.\n return GetNongraceParentBeam(bobj, layer);\n }\n else\n {\n if (layer._property:ActiveBeam != null)\n {\n layer._property:ActiveBeam = null;\n }\n return null;\n }\n }\n case (StartBeam)\n {\n newBeam = libmei.Beam();\n if (bobj.GraceNote)\n {\n layer._property:ActiveGraceBeam = newBeam;\n nonGraceParentBeam = GetNongraceParentBeam(bobj, layer);\n if (nonGraceParentBeam != null)\n {\n newBeam._property:ParentBeam = nonGraceParentBeam;\n }\n }\n else\n {\n layer._property:ActiveBeam = newBeam;\n }\n return newBeam;\n }\n default {\n \/\/ ContinueBeam and SingleBeam\n if (bobj.GraceNote)\n {\n return layer._property:ActiveGraceBeam;\n }\n else\n {\n return layer._property:ActiveBeam;\n }\n }\n }\n} \/\/$end\n\nfunction ProcessTuplet (noteRest, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n parentTuplet = noteRest.ParentTupletIfAny;\n if (parentTuplet = null)\n {\n return null;\n }\n\n if (noteRest.GraceNote)\n {\n \/\/ In Sibelius, grace notes before the first tuplet note are part of the\n \/\/ tuplet. In MEI, we want to put them before the tuplet element.\n prevNote = PrevNormalOrGrace(noteRest, false);\n if (null = prevNote)\n {\n return null;\n }\n if (not TupletsEqual(parentTuplet, prevNote.ParentTupletIfAny))\n {\n return null;\n }\n }\n\n \/*\n We encode inner tuplets of nested tuplet structures as s.\n Therefore we always return the outermost MEI tuplet for content to be added.\n Still, we need to keep track of the inner tuplets to assign the @endid.\n layer._property:ActiveMeiTuplet always points to the innermost tuplet.\n *\/\n activeMeiTuplet = layer._property:ActiveMeiTuplet;\n\n tupletIsContinued = activeMeiTuplet != null and TupletsEqual(parentTuplet, activeMeiTuplet._property:SibTuplet);\n\n if (not(tupletIsContinued))\n {\n \/\/ New tuplets need to be added\n noteRestTupletStack = GetTupletStack(noteRest);\n sibTuplet = null;\n meiTupletDepth = GetMeiTupletDepth(layer);\n\n for i = meiTupletDepth to noteRestTupletStack.Length\n {\n sibTuplet = noteRestTupletStack[i];\n nextActiveMeiTuplet = GenerateTuplet(sibTuplet);\n if (meiTupletDepth > 0 or i > meiTupletDepth)\n {\n \/\/ We have an inner tuplet that we encode as \n nextActiveMeiTuplet = ShiftTupletToTupletSpan(nextActiveMeiTuplet, layer);\n }\n libmei.AddAttribute(nextActiveMeiTuplet, 'startid', '#' & meielement._id);\n \/\/ We basically create a linked list of tuplets\n nextActiveMeiTuplet._property:ParentTuplet = activeMeiTuplet;\n nextActiveMeiTuplet._property:SibTuplet = sibTuplet;\n activeMeiTuplet = nextActiveMeiTuplet;\n }\n layer._property:ActiveMeiTuplet = activeMeiTuplet;\n }\n\n meiTuplet = activeMeiTuplet;\n for i = 0 to CountTupletsEndingAtNoteRest(noteRest)\n {\n libmei.AddAttribute(meiTuplet, 'endid', '#' & meielement._id);\n meiTuplet = meiTuplet._property:ParentTuplet;\n }\n layer._property:ActiveMeiTuplet = meiTuplet;\n\n outermostMeiTuplet = activeMeiTuplet;\n while (outermostMeiTuplet._property:ParentTuplet != null)\n {\n outermostMeiTuplet = outermostMeiTuplet._property:ParentTuplet;\n }\n return outermostMeiTuplet;\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n\n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it\n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(tupletSpan._id);\n Self._property:MeasureObjects = mobjs;\n\n return tupletSpan;\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n\n if (lyricobj.Text = '')\n {\n return null;\n }\n\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n \/\/ In the case of elisions, we create multiple syl elements from one\n \/\/ LyricItem. We have to distinguish between the first and the last syl\n \/\/ element we created. In the common, simple case, both are identical.\n sylel_last = sylel;\n libmei.AddChild(verse, sylel);\n\n \/\/ Split syllable text by underscore, in case there is an elision\n syllables = MSplitString(syl.Text, '_');\n libmei.SetText(sylel, syllables[0]);\n\n \/\/ Handle any found elisions\n for s = 1 to syllables.Length\n {\n libmei.AddAttribute(sylel_last, 'con', 'b');\n sylel_last = libmei.Syl();\n libmei.SetText(sylel_last, syllables[s]);\n libmei.AddChild(verse, sylel_last);\n }\n\n if (syl.SyllableType = MiddleOfWord)\n {\n libmei.AddAttribute(sylel_last, 'con', 'd'); \/\/dash syllable connector\n\n \/\/ New word starts at the first syllable in the lyric_word or after an elision\n if (j = 0 or syllables.Length > 1)\n {\n libmei.AddAttribute(sylel_last, 'wordpos', 'i'); \/\/ 'initial'\n }\n else\n {\n libmei.AddAttribute(sylel_last, 'wordpos', 'm'); \/\/ 'medial'\n }\n }\n\n \/\/ Word ends at EndOfWord or before an elision (if there are syllables before the elision)\n if (j > 0 and (syl.SyllableType = EndOfWord or syllables.Length > 1))\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n libmei.AddChild(obj, verse);\n }\n else\n {\n Log('Could not find note object for syl ' & syl);\n }\n }\n\n \/\/ Check if the last syllable is melismatic\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel_last, 'con', 'u'); \/\/ 'underscore'\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so\n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessTremolo (bobj) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.DoubleTremolos = 0)\n {\n return null;\n }\n\n Log('Fingered tremolo: ' & bobj.DoubleTremolos);\n tremEl = libmei.FTrem();\n libmei.AddAttribute(tremEl, 'beams', bobj.DoubleTremolos);\n libmei.AddAttribute(tremEl, 'unitdur');\n\n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'lower');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'upper');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'upper');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'lower');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n case ('52')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('53')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('54')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('55')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('160')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'stop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('162')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'open');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('163')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('164')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('165')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('166')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('212')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'ten');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('214')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'marc');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('217')\n {\n \/\/ up-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('218')\n {\n \/\/ down-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('233')\n {\n \/\/ up-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('234')\n {\n \/\/ down-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('240')\n {\n \/\/ double staccato\n return null;\n }\n case ('241')\n {\n \/\/ triple staccato\n return null;\n }\n case ('242')\n {\n \/\/ quadruple staccato\n return null;\n }\n case ('243')\n {\n \/\/ snap\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'snap');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('480')\n {\n \/\/scoop\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'scoop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('481')\n {\n \/\/fall\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fall');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('490')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fingernail');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('494')\n {\n \/\/doit\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'doit');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('495')\n {\n \/\/plop\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'plop');\n libmei.AddChild(nobj, artic);\n }\n\n }\n\n }\n} \/\/$end\n\nfunction ProcessEndingSlurs (bar) {\n \/\/$module(ExportProcessors.mss)\n slur_resolver = Self._property:SlurResolver;\n for voiceNumber = 1 to 5\n {\n endingSlurs = slur_resolver[LayerHash(bar, voiceNumber)];\n if (endingSlurs != null)\n {\n for each slur in endingSlurs\n {\n end_obj = GetNoteObjectAtEndPosition(slur);\n if (end_obj != null)\n {\n libmei.AddAttribute(slur._property:mobj, 'endid', '#' & end_obj._id);\n }\n }\n }\n }\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"e5c917f4b80c1855deca8c4c5a90b24481d45870","subject":"add oneway arrows","message":"add oneway arrows\n","repos":"Sweetymeow\/osm-bright,yohanboniface\/osm-bright,raumobil\/osm-bright,pinkflozd\/osm-bright,saydulk\/osm-bright,jeffaudi\/osm-hybrid,silph-io\/osm-silph,brelevenix\/osm-bright-tregor,mapbox\/osm-bright,makinacorpus\/osm-makina","old_file":"osm-bright\/labels.mss","new_file":"osm-bright\/labels.mss","new_contents":"\/* LABELS.MSS CONTENTS:\n * - place names\n * - area labels\n * - waterway labels \n *\/\n\n\/* Font sets are defined in palette.mss *\/\n\n\/* Mapnik does not yet support character-spacing adjustments for \n labels placed along a line. We can fake this using the replace()\n function in the text-name parameter by replacing each character\n with itself followed by one or more spaces. *\/\n\n\/* ================================================================== *\/\n\/* PLACE NAMES\n\/* ================================================================== *\/\n\n#place::country[type='country'][zoom>3][zoom<9] {\n text-name:'[name]';\n text-face-name:@sans_bold;\n text-placement:point;\n text-fill:@country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n [zoom=3] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=4] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>4] {\n text-halo-radius: 2;\n }\n [zoom=5] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=6] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=7] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n#place::state[type='state'][zoom>=5][zoom<=10] {\n text-name:'[name]';\n text-face-name:@sans_bold_italic;\n text-placement:point;\n text-fill:@state_text;\n text-halo-fill: @state_halo;\n text-halo-radius: 1;\n [zoom=6] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=7] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>8] {\n text-halo-radius: 2;\n }\n [zoom=8] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=9] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=10] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n\/* ---- Cities ------------------------------------------------------ *\/\n\n#place::city[type='city'][zoom>=8][zoom<=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@city_text;\n text-halo-fill:@city_halo;\n text-halo-radius:2;\n [zoom<=8] {\n text-size: 10;\n text-halo-radius:1;\n }\n [zoom=9] {\n text-size:10;\n text-wrap-width: 60;\n }\n [zoom=10] {\n text-size:11;\n text-wrap-width: 70;\n }\n [zoom=11] {\n text-size:12;\n text-character-spacing: 1;\n text-wrap-width: 80;\n }\n [zoom=12] {\n text-size:13;\n text-character-spacing: 1;\n text-wrap-width: 100;\n }\n [zoom=13] {\n text-size:14;\n text-character-spacing: 2;\n text-wrap-width: 200;\n text-transform: uppercase;\n }\n [zoom=14] {\n text-size:15;\n text-character-spacing: 4;\n text-wrap-width: 300;\n text-transform: uppercase;\n }\n [zoom=15] {\n text-size:16;\n text-character-spacing: 6;\n text-wrap-width: 400;\n text-transform: uppercase;\n }\n}\n\n\/* ---- Towns ------------------------------------------------------- *\/\n\n#place::town[type='town'][zoom>=9][zoom<=17] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@town_text;\n text-size:9;\n text-halo-fill:@town_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n [zoom>=10] {\n text-halo-radius:2;\n text-size: 10;\n }\n [zoom>=11]{ text-size:11; }\n [zoom>=12]{\n text-size:12;\n text-line-spacing: 1;\n }\n [zoom>=13]{\n text-transform: uppercase;\n text-character-spacing: 1;\n text-line-spacing: 2;\n }\n [zoom>=14]{\n text-size:13;\n text-character-spacing: 2;\n text-line-spacing: 3;\n }\n [zoom>=15]{\n text-size:14;\n text-character-spacing: 3;\n text-line-spacing: 4;\n }\n [zoom>=15]{\n text-size:15;\n text-character-spacing: 4;\n text-line-spacing: 5;\n }\n [zoom>=17]{\n text-size:16;\n text-character-spacing: 5;\n text-line-spacing: 6;\n }\n}\n\n\/* ---- Other small places ------------------------------------------ *\/\n\n#place::small[type='village'][zoom>=13],\n#place::small[type='suburb'][zoom>=13],\n#place::small[type='hamlet'][zoom>=13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@other_text;\n text-size:10;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=14] {\n text-size:11;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-line-spacing: 1;\n }\n [zoom>=15] {\n text-halo-radius: 2;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-wrap-width: 60; \n text-line-spacing: 1;\n }\n [zoom>=16] {\n text-size:12;\n text-character-spacing: 2;\n text-wrap-width: 120;\n text-line-spacing: 2;\n } \n [zoom>=17] {\n text-size:13; \n text-character-spacing: 3;\n text-wrap-width: 160;\n text-line-spacing: 4;\n }\n [zoom>=18] {\n text-size:14;\n text-character-spacing: 4;\n text-line-spacing: 6;\n }\n}\n\n#place::small[type='locality'][zoom>=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@locality_text;\n text-size:9;\n text-halo-fill:@locality_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=16] {\n text-size:10;\n text-wrap-width: 60;\n text-line-spacing: 1;\n }\n [zoom>=17] {\n text-size:11;\n text-wrap-width: 120;\n text-line-spacing: 2;\n }\n [zoom>=18] {\n text-size:12;\n text-character-spacing: 1;\n text-line-spacing: 4;\n }\n}\n\n\n\/* ================================================================== *\/\n\/* AREA LABELS\n\/* ================================================================== *\/\n\n#area_label[type='golf_course'][zoom>=10],\n#area_label[type='park'][zoom>=10] {\n text-name: \"''\";\n text-fill: @park * 0.6;\n text-halo-fill: fadeout(@park,25%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom>=15][area>1600000],\n [zoom>=16][area>80000],\n [zoom>=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='cemetery'][zoom>=10] {\n text-name: \"''\";\n text-fill: @cemetery * 0.6;\n text-halo-fill: fadeout(@cemetery,25%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='hospital'][zoom>=10] {\n text-name: \"''\";\n text-fill: @hospital * 0.6;\n text-halo-fill: fadeout(lighten(@hospital,10%),50%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='college'][zoom>=10],\n#area_label[type='school'][zoom>=10],\n#area_label[type='university'][zoom>=10] {\n text-name: \"''\";\n text-fill: @school * 0.6;\n text-halo-fill: fadeout(lighten(@school,10%),50%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='water'][zoom>=10] {\n text-name: \"''\";\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-face-name:@sans_italic;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n text-character-spacing: 1;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 2;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 3;\n text-wrap-width: 180;\n }\n}\n \n#poi[type='university'][zoom>=15],\n#poi[type='hospital'][zoom>=16],\n#poi[type='school'][zoom>=17],\n#poi[type='library'][zoom>=17] {\n text-name:\"[name]\";\n text-face-name:@sans;\n text-size:10;\n text-wrap-width:30;\n text-fill: @poi_text;\n}\n\n\n\/* ================================================================== *\/\n\/* WATERWAY LABELS\n\/* ================================================================== *\/\n\n#waterway_label[type='river'][zoom>=13],\n#waterway_label[type='canal'][zoom>=15],\n#waterway_label[type='stream'][zoom>=17] {\n text-name: '[name]';\n text-face-name: @sans_italic;\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-placement: line;\n text-min-distance: 400;\n text-size: 10;\n [type='river'][zoom=14],\n [type='canal'][zoom=16],\n [type='stream'][zoom=18] {\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n }\n [type='river'][zoom=15],\n [type='canal'][zoom=17] {\n text-size: 11;\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n }\n [type='river'][zoom>=16],\n [type='canal'][zoom=18] {\n text-size: 14;\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n text-spacing: 300;\n }\n}\n\n\/* ================================================================== *\/\n\/* ROAD LABELS\n\/* ================================================================== *\/\n\n#motorway_label[zoom>=11][zoom<=14][reflen<=8] {\n shield-name: \"[ref]\";\n shield-size: 9;\n shield-face-name: @sans_bold;\n shield-fill: #fff;\n shield-file: url(img\/shield-motorway-1.png);\n [type='motorway'] {\n [reflen=2] { shield-file: url(img\/shield-motorway-1.png); }\n [reflen=2] { shield-file: url(img\/shield-motorway-2.png); }\n [reflen=3] { shield-file: url(img\/shield-motorway-3.png); }\n [reflen=4] { shield-file: url(img\/shield-motorway-4.png); }\n [reflen=5] { shield-file: url(img\/shield-motorway-5.png); }\n [reflen=6] { shield-file: url(img\/shield-motorway-6.png); }\n [reflen=7] { shield-file: url(img\/shield-motorway-7.png); }\n [reflen=8] { shield-file: url(img\/shield-motorway-8.png); }\n }\n [type='trunk'] {\n [reflen=2] { shield-file: url(img\/shield-trunk-1.png); }\n [reflen=2] { shield-file: url(img\/shield-trunk-2.png); }\n [reflen=3] { shield-file: url(img\/shield-trunk-3.png); }\n [reflen=4] { shield-file: url(img\/shield-trunk-4.png); }\n [reflen=5] { shield-file: url(img\/shield-trunk-5.png); }\n [reflen=6] { shield-file: url(img\/shield-trunk-6.png); }\n [reflen=7] { shield-file: url(img\/shield-trunk-7.png); }\n [reflen=8] { shield-file: url(img\/shield-trunk-8.png); }\n }\n [zoom=11] { shield-min-distance: 60; } \/\/50\n [zoom=12] { shield-min-distance: 80; } \/\/60\n [zoom=13] { shield-min-distance: 120; } \/\/120\n [zoom=14] { shield-min-distance: 180; }\n}\n\n#motorway_label[type='motorway'][zoom>9],\n#motorway_label[type='trunk'][zoom>9] {\n text-name:\"[name]\";\n text-face-name:@sans_bold;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:10;\n [zoom=11] { text-min-distance:70; }\n [zoom=12] { text-min-distance:80; }\n [zoom=13] { text-min-distance:100; }\n}\n\n#mainroad_label[type='primary'][zoom>12],\n#mainroad_label[type='secondary'][zoom>13],\n#mainroad_label[type='tertiary'][zoom>13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n#minorroad_label[zoom>14] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-size:9;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n#motorway_label[zoom>=16]{\n marker-placement:line;\n marker-width:3;\n marker-fill: #555;\n marker-line-opacity:0;\n marker-spacing: 250;\n}\n\n#mainroad_label[zoom>=16]{\n marker-placement:line;\n marker-height:3;\n marker-fill: #888; \n marker-line-opacity:0;\n marker-spacing: 250;\n}\n\n#minorroad_label[zoom>=16]{\n marker-placement:line;\n marker-height:1;\n marker-fill: #bbb;\n marker-line-opacity:0;\n marker-spacing: 250;\n}\n\/* ****************************************************************** *\/\n","old_contents":"\/* LABELS.MSS CONTENTS:\n * - place names\n * - area labels\n * - waterway labels \n *\/\n\n\/* Font sets are defined in palette.mss *\/\n\n\/* Mapnik does not yet support character-spacing adjustments for \n labels placed along a line. We can fake this using the replace()\n function in the text-name parameter by replacing each character\n with itself followed by one or more spaces. *\/\n\n\/* ================================================================== *\/\n\/* PLACE NAMES\n\/* ================================================================== *\/\n\n#place::country[type='country'][zoom>3][zoom<9] {\n text-name:'[name]';\n text-face-name:@sans_bold;\n text-placement:point;\n text-fill:@country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n [zoom=3] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=4] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>4] {\n text-halo-radius: 2;\n }\n [zoom=5] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=6] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=7] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n#place::state[type='state'][zoom>=5][zoom<=10] {\n text-name:'[name]';\n text-face-name:@sans_bold_italic;\n text-placement:point;\n text-fill:@state_text;\n text-halo-fill: @state_halo;\n text-halo-radius: 1;\n [zoom=6] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=7] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>8] {\n text-halo-radius: 2;\n }\n [zoom=8] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=9] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=10] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n\/* ---- Cities ------------------------------------------------------ *\/\n\n#place::city[type='city'][zoom>=8][zoom<=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@city_text;\n text-halo-fill:@city_halo;\n text-halo-radius:2;\n [zoom<=8] {\n text-size: 10;\n text-halo-radius:1;\n }\n [zoom=9] {\n text-size:10;\n text-wrap-width: 60;\n }\n [zoom=10] {\n text-size:11;\n text-wrap-width: 70;\n }\n [zoom=11] {\n text-size:12;\n text-character-spacing: 1;\n text-wrap-width: 80;\n }\n [zoom=12] {\n text-size:13;\n text-character-spacing: 1;\n text-wrap-width: 100;\n }\n [zoom=13] {\n text-size:14;\n text-character-spacing: 2;\n text-wrap-width: 200;\n text-transform: uppercase;\n }\n [zoom=14] {\n text-size:15;\n text-character-spacing: 4;\n text-wrap-width: 300;\n text-transform: uppercase;\n }\n [zoom=15] {\n text-size:16;\n text-character-spacing: 6;\n text-wrap-width: 400;\n text-transform: uppercase;\n }\n}\n\n\/* ---- Towns ------------------------------------------------------- *\/\n\n#place::town[type='town'][zoom>=9][zoom<=17] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@town_text;\n text-size:9;\n text-halo-fill:@town_halo;\n text-halo-radius:1;\n text-wrap-width: 50;\n [zoom>=10] {\n text-halo-radius:2;\n text-size: 10;\n }\n [zoom>=11]{ text-size:11; }\n [zoom>=12]{\n text-size:12;\n text-line-spacing: 1;\n }\n [zoom>=13]{\n text-transform: uppercase;\n text-character-spacing: 1;\n text-line-spacing: 2;\n }\n [zoom>=14]{\n text-size:13;\n text-character-spacing: 2;\n text-line-spacing: 3;\n }\n [zoom>=15]{\n text-size:14;\n text-character-spacing: 3;\n text-line-spacing: 4;\n }\n [zoom>=15]{\n text-size:15;\n text-character-spacing: 4;\n text-line-spacing: 5;\n }\n [zoom>=17]{\n text-size:16;\n text-character-spacing: 5;\n text-line-spacing: 6;\n }\n}\n\n\/* ---- Other small places ------------------------------------------ *\/\n\n#place::small[type='village'][zoom>=13],\n#place::small[type='suburb'][zoom>=13],\n#place::small[type='hamlet'][zoom>=13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@other_text;\n text-size:10;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=14] {\n text-size:11;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-line-spacing: 1;\n }\n [zoom>=15] {\n text-halo-radius: 2;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-wrap-width: 60; \n text-line-spacing: 1;\n }\n [zoom>=16] {\n text-size:12;\n text-character-spacing: 2;\n text-wrap-width: 120;\n text-line-spacing: 2;\n } \n [zoom>=17] {\n text-size:13; \n text-character-spacing: 3;\n text-wrap-width: 160;\n text-line-spacing: 4;\n }\n [zoom>=18] {\n text-size:14;\n text-character-spacing: 4;\n text-line-spacing: 6;\n }\n}\n\n#place::small[type='locality'][zoom>=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@locality_text;\n text-size:9;\n text-halo-fill:@locality_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=16] {\n text-size:10;\n text-wrap-width: 60;\n text-line-spacing: 1;\n }\n [zoom>=17] {\n text-size:11;\n text-wrap-width: 120;\n text-line-spacing: 2;\n }\n [zoom>=18] {\n text-size:12;\n text-character-spacing: 1;\n text-line-spacing: 4;\n }\n}\n\n\n\/* ================================================================== *\/\n\/* AREA LABELS\n\/* ================================================================== *\/\n\n#area_label[type='golf_course'][zoom>=10],\n#area_label[type='park'][zoom>=10] {\n text-name: \"''\";\n text-fill: @park * 0.6;\n text-halo-fill: fadeout(@park,25%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom>=15][area>1600000],\n [zoom>=16][area>80000],\n [zoom>=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='cemetery'][zoom>=10] {\n text-name: \"''\";\n text-fill: @cemetery * 0.6;\n text-halo-fill: fadeout(@cemetery,25%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='hospital'][zoom>=10] {\n text-name: \"''\";\n text-fill: @hospital * 0.6;\n text-halo-fill: fadeout(lighten(@hospital,10%),50%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='college'][zoom>=10],\n#area_label[type='school'][zoom>=10],\n#area_label[type='university'][zoom>=10] {\n text-name: \"''\";\n text-fill: @school * 0.6;\n text-halo-fill: fadeout(lighten(@school,10%),50%);\n text-halo-radius: 2;\n text-face-name:@sans;\n text-wrap-width:30;\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom>=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n }\n [zoom=17][area>80000],\n [zoom>=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 1;\n text-wrap-width: 120;\n }\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 2;\n text-wrap-width: 180;\n }\n}\n\n#area_label[type='water'][zoom>=10] {\n text-name: \"''\";\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-face-name:@sans_italic;\n text-wrap-width:30;\n [zoom=10][area>102400000],\n [zoom=11][area>25600000],\n [zoom=13][area>1600000],\n [zoom=14][area>320000],\n [zoom=15][area>80000],\n [zoom=16][area>20000],\n [zoom=17][area>5000],\n [zoom=18][area>=0] {\n text-name: \"[name]\";\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom=18][area>5000] {\n text-name: \"[name]\";\n text-size: 12;\n text-line-spacing: 2;\n text-wrap-width: 60;\n text-character-spacing: 1;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom=18][area>20000] {\n text-size: 14;\n text-line-spacing: 4;\n text-character-spacing: 2;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 16;\n text-line-spacing: 6;\n text-character-spacing: 3;\n text-wrap-width: 180;\n }\n}\n \n#poi[type='university'][zoom>=15],\n#poi[type='hospital'][zoom>=16],\n#poi[type='school'][zoom>=17],\n#poi[type='library'][zoom>=17] {\n text-name:\"[name]\";\n text-face-name:@sans;\n text-size:10;\n text-wrap-width:30;\n text-fill: @poi_text;\n}\n\n\n\/* ================================================================== *\/\n\/* WATERWAY LABELS\n\/* ================================================================== *\/\n\n#waterway_label[type='river'][zoom>=13],\n#waterway_label[type='canal'][zoom>=15],\n#waterway_label[type='stream'][zoom>=17] {\n text-name: '[name]';\n text-face-name: @sans_italic;\n text-fill: @water * 0.75;\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-placement: line;\n text-min-distance: 400;\n text-size: 10;\n [type='river'][zoom=14],\n [type='canal'][zoom=16],\n [type='stream'][zoom=18] {\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n }\n [type='river'][zoom=15],\n [type='canal'][zoom=17] {\n text-size: 11;\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n }\n [type='river'][zoom>=16],\n [type='canal'][zoom=18] {\n text-size: 14;\n text-name: \"[name].replace('([\\S\\ ])','$1 ')\";\n text-spacing: 300;\n }\n}\n\n\/* ================================================================== *\/\n\/* ROAD LABELS\n\/* ================================================================== *\/\n\n#motorway_label[zoom>=11][zoom<=14][reflen<=8] {\n shield-name: \"[ref]\";\n shield-size: 9;\n shield-face-name: @sans_bold;\n shield-fill: #fff;\n shield-file: url(img\/shield-motorway-1.png);\n [type='motorway'] {\n [reflen=2] { shield-file: url(img\/shield-motorway-1.png); }\n [reflen=2] { shield-file: url(img\/shield-motorway-2.png); }\n [reflen=3] { shield-file: url(img\/shield-motorway-3.png); }\n [reflen=4] { shield-file: url(img\/shield-motorway-4.png); }\n [reflen=5] { shield-file: url(img\/shield-motorway-5.png); }\n [reflen=6] { shield-file: url(img\/shield-motorway-6.png); }\n [reflen=7] { shield-file: url(img\/shield-motorway-7.png); }\n [reflen=8] { shield-file: url(img\/shield-motorway-8.png); }\n }\n [type='trunk'] {\n [reflen=2] { shield-file: url(img\/shield-trunk-1.png); }\n [reflen=2] { shield-file: url(img\/shield-trunk-2.png); }\n [reflen=3] { shield-file: url(img\/shield-trunk-3.png); }\n [reflen=4] { shield-file: url(img\/shield-trunk-4.png); }\n [reflen=5] { shield-file: url(img\/shield-trunk-5.png); }\n [reflen=6] { shield-file: url(img\/shield-trunk-6.png); }\n [reflen=7] { shield-file: url(img\/shield-trunk-7.png); }\n [reflen=8] { shield-file: url(img\/shield-trunk-8.png); }\n }\n [zoom=11] { shield-min-distance: 60; } \/\/50\n [zoom=12] { shield-min-distance: 80; } \/\/60\n [zoom=13] { shield-min-distance: 120; } \/\/120\n [zoom=14] { shield-min-distance: 180; }\n}\n\n#motorway_label[type='motorway'][zoom>9],\n#motorway_label[type='trunk'][zoom>9] {\n text-name:\"[name]\";\n text-face-name:@sans_bold;\n text-placement:line;\n text-fill:#777;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:10;\n [zoom=11] { text-min-distance:70; }\n [zoom=12] { text-min-distance:80; }\n [zoom=13] { text-min-distance:100; }\n}\n\n#mainroad_label[type='primary'][zoom>12],\n#mainroad_label[type='secondary'][zoom>13],\n#mainroad_label[type='tertiary'][zoom>13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-fill:#777;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n#minorroad_label[zoom>14] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-size:9;\n text-fill:#777;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n\/* ****************************************************************** *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"c28c4b7d6386cdc06464dbb50d757777c1404324","subject":"Fixed: Rename variable for measure objects","message":"Fixed: Rename variable for measure objects\n\nThey're more than just lines, so variable name should reflect this.\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n chordsym = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(line._id);\n Self._property:MeasureObjects = mlines;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureObjects;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"194fa7ab1d20f4bc79c60570af7b113e600d93a9","subject":"Add font names for music, text, and lyrics","message":"Add font names for music, text, and lyrics\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgname, 'type', 'plugin');\n libmei.AddChild(applic, plgname);\n\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(plgname, 'isodate', isodate);\n\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n if (note._property:TieIds != null)\n {\n ties = note._property:TieIds;\n mties = Self._property:MeasureTies;\n mties = mties.Concat(ties);\n Self._property:MeasureTies = mties;\n }\n\n beam = ProcessBeam(bobj, l);\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n libmei.AddChild(tuplet, note);\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsets(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n if (bobj.GraceNote = true)\n {\n libmei.addAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAppoggiatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'A');\n }\n\n if (bobj.IsAcciaccatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'a');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.addAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsets(bobj.Dx));\n }\n\n if (bobj.Dy != 0)\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsets(bobj.Dy));\n }\n\n if (bobj.CueSize = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pos = nobj.ParentNoteRest.Position;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n libmei.AddAttribute(n, 'pnum', nobj.Pitch);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n \/\/ Accidentals will always be encoded as child elements, not attributes\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'headshape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n \/*\n Ties\n *\/\n tieresolver = Self._property:TieResolver;\n if (tieresolver.PropertyExists(hash))\n {\n \/\/ this note is the end of the tie.\n tie_id = tieresolver[hash];\n tie = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie, 'endid', '#' & n._id);\n }\n\n if (nobj.Tied = True)\n {\n \/\/ set the end hash\n parent_nr = nobj.ParentNoteRest;\n next_object = parent_nr.NextItem(parent_nr.VoiceNumber, 'NoteRest');\n\n if (next_object = null)\n {\n \/\/ check the first object in the next bar\n next_bar_num = parent_nr.ParentBar.BarNumber + 1;\n next_bar = parent_nr.ParentBar.ParentStaff.NthBar(next_bar_num);\n next_object = next_bar.NthBarObject(0);\n }\n\n if (next_object = null or next_object.Type != 'NoteRest')\n {\n \/\/ it's a hanging tie. What to do, what to do?\n \/\/ for now, just encode the startid with no endid and return the note.\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n n._property:TieIds = CreateSparseArray(tie._id);\n return n;\n }\n\n for each next_note in next_object\n {\n if (nobj.Pitch = next_note.Pitch)\n {\n \/\/ it's probably this one.\n endhash = SimpleNoteHash(next_note);\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n tieresolver[endhash] = tie._id;\n\n n._property:TieIds = CreateSparseArray(tie._id);\n }\n }\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n \n tiearr = CreateSparseArray();\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n\n if (sn._property:TieIds != null)\n {\n tieids = sn._property:TieIds;\n tiearr = tiearr.Concat(tieids);\n }\n }\n\n n._property:TieIds = tiearr;\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'rend', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(octl, 'dis', octrend[0]);\n libmei.AddAttribute(octl, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgname, 'type', 'plugin');\n libmei.AddChild(applic, plgname);\n\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(plgname, 'isodate', isodate);\n\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n if (note._property:TieIds != null)\n {\n ties = note._property:TieIds;\n mties = Self._property:MeasureTies;\n mties = mties.Concat(ties);\n Self._property:MeasureTies = mties;\n }\n\n beam = ProcessBeam(bobj, l);\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n libmei.AddChild(tuplet, note);\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsets(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n if (bobj.GraceNote = true)\n {\n libmei.addAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAppoggiatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'A');\n }\n\n if (bobj.IsAcciaccatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'a');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.addAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsets(bobj.Dx));\n }\n\n if (bobj.Dy != 0)\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsets(bobj.Dy));\n }\n\n if (bobj.CueSize = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pos = nobj.ParentNoteRest.Position;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n libmei.AddAttribute(n, 'pnum', nobj.Pitch);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n \/\/ Accidentals will always be encoded as child elements, not attributes\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'headshape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n \/*\n Ties\n *\/\n tieresolver = Self._property:TieResolver;\n if (tieresolver.PropertyExists(hash))\n {\n \/\/ this note is the end of the tie.\n tie_id = tieresolver[hash];\n tie = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie, 'endid', '#' & n._id);\n }\n\n if (nobj.Tied = True)\n {\n \/\/ set the end hash\n parent_nr = nobj.ParentNoteRest;\n next_object = parent_nr.NextItem(parent_nr.VoiceNumber, 'NoteRest');\n\n if (next_object = null)\n {\n \/\/ check the first object in the next bar\n next_bar_num = parent_nr.ParentBar.BarNumber + 1;\n next_bar = parent_nr.ParentBar.ParentStaff.NthBar(next_bar_num);\n next_object = next_bar.NthBarObject(0);\n }\n\n if (next_object = null or next_object.Type != 'NoteRest')\n {\n \/\/ it's a hanging tie. What to do, what to do?\n \/\/ for now, just encode the startid with no endid and return the note.\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n n._property:TieIds = CreateSparseArray(tie._id);\n return n;\n }\n\n for each next_note in next_object\n {\n if (nobj.Pitch = next_note.Pitch)\n {\n \/\/ it's probably this one.\n endhash = SimpleNoteHash(next_note);\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n tieresolver[endhash] = tie._id;\n\n n._property:TieIds = CreateSparseArray(tie._id);\n }\n }\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n \n tiearr = CreateSparseArray();\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n\n if (sn._property:TieIds != null)\n {\n tieids = sn._property:TieIds;\n tiearr = tiearr.Concat(tieids);\n }\n }\n\n n._property:TieIds = tiearr;\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'rend', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(octl, 'dis', octrend[0]);\n libmei.AddAttribute(octl, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"5585af9d23fd1226604a4b026acb7ef137682665","subject":"Fixed: Add further distinction to tie indexes","message":"Fixed: Add further distinction to tie indexes\n\nThis commit helps further differentiate ties and their presence in a voice.\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n libmei.AddAttribute(n, 'staff', staff);\n libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber + '-' + nobj.ParentNoteRest.VoiceNumber + '-' + pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) + '-' + nobj.ParentNoteRest.VoiceNumber + '-' + pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) + '-' + nobj.ParentNoteRest.VoiceNumber + '-' + pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/* \n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n tsid = l._property:ActiveTupletId;\n tsobj = libmei.getElementById(tsid);\n\n if (tsobj._parent = null and tsobj._property:AddedToMeasure = False)\n {\n \/*\n The measure lines get added to the measure object\n so pretend this tuplet span object is a line\n and queue it for addition to the measure.\n *\/\n tsobj._property:AddedToMeasure = True;\n line = tsobj;\n }\n\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n libmei.AddAttribute(n, 'staff', staff);\n libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber + '-' + pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar, \n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) + '-' + pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) + '-' + pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"81b517fc218f2415a9b578f60e0d235a01a16745","subject":"add tmp code for default shield size","message":"add tmp code for default shield size\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_shield: 'PT Sans Bold', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Bold', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Italic', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Bold Italic', 'Unifont Medium';\n\n@label_color_transport: #524c4c;\n@label_color_shield: #fff;\n@label_color_shield_fed: #333;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n@text_font_size_xlg: 24;\n@text_font_size_xxlg: 34;\n\n@text_character_spacing_sm: 0.7;\n@text_character_spacing_md: 1.2;\n@text_character_spacing_lg: 1.7;\n@text_character_spacing_xlg: 2.2;\n\n@text_font_halo_radius_xsm: 1;\n@text_font_halo_radius_sm: 1.5;\n@text_font_halo_radius_md: 1.75;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: desaturate(#F7F7E6,50%);\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-placement: line;\n text-label-position-tolerance: 2;\n text-max-char-angle-delta: 20;\n text-min-path-length: 30;\n text-fill: #444;\n text-spacing: 256;\n text-min-distance: 5;\n text-character-spacing: @text_character_spacing_sm;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: @text_font_halo_radius_md;\n\n [kind='major_road'] {\n text-size: @text_font_size_xxsm; \n } \n\n [zoom>=13] {\n text-size: @text_font_size_xxsm;\n \n [kind='major_road'] {\n text-size: @text_font_size_xxsm * 1.2; \n }\n }\n\n [zoom>=14] {\n text-min-distance: 10;\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_md;\n text-halo-radius: @text_font_halo_radius_large;\n \n [kind='major_road'] {\n text-size: @text_font_size_sm * 1.2; \n } \n }\n\n [zoom>=16]{\n text-min-distance: 100;\n text-character-spacing: @text_character_spacing_lg;\n }\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n [ref_length>0][ref_length<8] {\n \/\/ default rectangle shield\n shield-fill: @label_color_shield_fed;\n shield-transform: scale(1.1,1.1);\n shield-face-name: @text_font_shield;\n shield-name: [ref];\n shield-size: 10;\n shield-min-distance: 60;\n shield-spacing: 60;\n \/\/ half the width of the shield to prevent from wrapping\n shield-min-padding: 10;\n shield-file: url(shields\/default-rg.svg); \n\n \/\/ [ref!~'(I|US|CA)( \\d{1,3})'] {\n \/\/ [ref_length>6][ref_length<8] {\n \/\/ shield-file: url(shields\/default-lg.svg);\n \/\/ }\n \/\/ [ref_length<=4][ref_length>=3] {\n \/\/ shield-file: url(shields\/default-sm.svg);\n \/\/ }\n \/\/ [ref_length<3][ref_length>0] {\n \/\/ shield-file: url(shields\/default-xsm.svg); \n \/\/ }\n \/\/ }\n\n \/\/ hide state shields at lower zooms\n [zoom>=11][zoom<=12][highway='trunk'],\n [zoom>=11][zoom<=12][highway='primary'],\n [zoom>=11][zoom<=12][highway='secondary'],\n [zoom>=11][zoom<=12][highway='tertiary'] {\n shield-opacity: 0;\n shield-size: 0;\n }\n\n [ref=~'I \\d+'] {\n shield-file: url(shields\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 65;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 15;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(shields\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 65;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 13;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'US \\d+'] {\n shield-file: url(shields\/us.svg);\n shield-transform: scale(0.062, 0.062);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: @label_color_shield_fed;\n shield-text-dy: 1;\n shield-character-spacing: -1;\n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.075, 0.075);\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.088, 0.088);\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.091, 0.091);\n } \n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(shields\/ca.svg);\n shield-fill: @label_color_shield;\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-dy: -2.5;\n shield-character-spacing: -1;\n\n [zoom>=11][zoom<=12][highway='trunk'],\n [zoom>=11][zoom<=12][highway='primary'],\n [zoom>=11][zoom<=12][highway='secondary'],\n [zoom>=11][zoom<=12][highway='tertiary'] {\n shield-opacity: 0;\n shield-size: 0;\n } \n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.060, 0.060);\n shield-min-distance: 70;\n }\n\n [zoom>=14] {\n shield-min-distance: 80;\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.080, 0.080);\n shield-dy: -3.5;\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.090, 0.090); \n } \n }\n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n \n text-face-name: @text_font_water_bold;\n text-wrap-width: 40;\n text-wrap-character: ' ';\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_xlg;\n text-align: center;\n\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_xsm;\n text-halo-fill: @label_color_water_halo;\n text-placement: interior;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][scalerank<4][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][scalerank<7][changed!='']\n{\n text-name: [name];\n\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n text-face-name: @text_font_water_bold;\n text-wrap-width: 50;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_lg;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_xsm;\n text-halo-fill: @label_color_water_halo;\n text-placement: interior;\n text-align: center;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels { \n \/\/ [zoom>=4][scalerank<3],\n [zoom>=5][scalerank<3][admin!='United States of America'][admin!='Canada'],\n [zoom>=6][scalerank<5],\n [zoom>=7][scalerank>=5] {\n text-name: [name];\n text-transform: uppercase;\n text-face-name: @text_font_administrative; \n text-face-name: @text_font_administrative;\n text-fill: @label_color_administrative;\n text-halo-fill: @label_color_halo_low;\n text-halo-radius: @text_font_halo_radius_sm;\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-placement-type: simple;\n text-placements: 'E,N,W,S';\n text-allow-overlap: false;\n text-min-distance: 3;\n text-avoid-edges: true;\n text-min-padding: 5;\n \n [zoom>=5] {\n text-size: @text_font_size_sm; \n }\n\n [zoom>=6] {\n text-size: @text_font_size_medium;\n text-character-spacing: 2;\n }\n\n [zoom>=7] {\n text-size: @text_font_size_large;\n text-character-spacing: 3;\n } \n }\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n text-character-spacing: 1;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80; \n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n \/\/ text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n}\n\n\/\/ #admin1-labels-50m-z6 {\n\/\/ text-face-name: @text_font_administrative;\n\/\/ text-wrap-width: 80;\n\/\/ text-fill: @label_color_administrative;\n\/\/ text-halo-radius: @text_font_halo_radius_sm;\n\/\/ text-halo-fill: @label_color_halo_low; \n\/\/ text-name: \"[label_z6]\";\n\/\/ text-size: @text_font_size_medium;\n\/\/ text-character-spacing: 2;\n\/\/ }\n\n\/\/ #admin1-labels-50m-z7 {\n\/\/ text-face-name: @text_font_administrative;\n\/\/ text-wrap-width: 80;\n\/\/ text-fill: @label_color_administrative;\n\/\/ text-halo-radius: @text_font_halo_radius_sm;\n\/\/ text-halo-fill: @label_color_halo_low; \n\/\/ text-name: \"[label_z7]\";\n\/\/ text-size: @text_font_size_large;\n\/\/ text-character-spacing: 3;\n\/\/ }\n\n\/* Admin 0 labels *\/\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_sm;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-size: @text_font_size_large;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-character-spacing: @text_character_spacing_sm;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_lg;\n text-size: @text_font_size_large;\n [population<100] { text-size: @text_font_size_medium_plus; }\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xlg;\n [population<100] { text-size: @text_font_size_large; }\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xxlg;\n [population<100] { text-size: @text_font_size_xlg; }\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n\/* city labels - using hwy shields *\/\n#aries-places-labels {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<7],\n [zoom=7][scalerank<8],\n [zoom=8][scalerank<9],\n [zoom=9][scalerank<10],\n [zoom=10][scalerank<11],\n [zoom=11][scalerank<12],\n [zoom=12][scalerank<13],\n [zoom=13][scalerank<14], \n [zoom=14][scalerank<15] \n [zoom>=15][scalerank<15]{\n\n shield-file: url(shields\/circle-12.svg);\n shield-fill: @label_color_city;\n shield-halo-fill: @label_color_halo_low;\n shield-halo-radius: @text_font_halo_radius_sm;\n shield-unlock-image: true;\n shield-avoid-edges: true;\n shield-transform: scale(0.5, 0.5);\n shield-face-name: @text_font_city;\n shield-name: [name];\n shield-min-distance: 2;\n shield-placement-type: simple;\n shield-placements: 'NE,SW,NW,SE,E,W';\n shield-text-dy: 3;\n shield-text-dx: 3;\n shield-min-distance: 10;\n\n\n [zoom>=4] {\n shield-size: @text_font_size_xsm;\n \n [population>700000] {\n shield-size: @text_font_size_xsm * 1.2;\n shield-transform: scale(0.7, 0.7);\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xsm * 1.3;\n shield-transform: scale(0.8, 0.8);\n } \n }\n\n [zoom>=5]{\n shield-size: @text_font_size_sm; \n \n [population>700000] {\n shield-size: @text_font_size_sm * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_sm * 1.3;\n } \n }\n\n [zoom>=6]{\n shield-size: @text_font_size_medium; \n\n [population>700000] {\n shield-size: @text_font_size_medium * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium * 1.5;\n } \n }\n\n [zoom>=8] {\n shield-halo-radius: @text_font_halo_radius_md;\n }\n\n [zoom>=10]{\n shield-size: @text_font_size_medium_plus; \n shield-halo-radius: @text_font_halo_radius_large;\n shield-halo-fill: @label_color_halo_high;\n \n [population>700000] {\n shield-size: @text_font_size_medium_plus * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium_plus * 1.3;\n } \n }\n\n [zoom>=11] {\n shield-opacity: 0;\n }\n\n [zoom>=12] {\n shield-size: @text_font_size_xlg;\n \n [population>700000] {\n shield-size: @text_font_size_xlg * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xlg * 1.3;\n } \n }\n }\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n","old_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_shield: 'PT Sans Bold', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Bold', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Italic', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Bold Italic', 'Unifont Medium';\n\n@label_color_transport: #524c4c;\n@label_color_shield: #fff;\n@label_color_shield_fed: #333;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n@text_font_size_xlg: 24;\n@text_font_size_xxlg: 34;\n\n@text_character_spacing_sm: 0.7;\n@text_character_spacing_md: 1.2;\n@text_character_spacing_lg: 1.7;\n@text_character_spacing_xlg: 2.2;\n\n@text_font_halo_radius_xsm: 1;\n@text_font_halo_radius_sm: 1.5;\n@text_font_halo_radius_md: 1.75;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: desaturate(#F7F7E6,50%);\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-placement: line;\n text-label-position-tolerance: 2;\n text-max-char-angle-delta: 20;\n text-min-path-length: 30;\n text-fill: #444;\n text-spacing: 256;\n text-min-distance: 5;\n text-character-spacing: @text_character_spacing_sm;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: @text_font_halo_radius_md;\n\n [kind='major_road'] {\n text-size: @text_font_size_xxsm; \n } \n\n [zoom>=13] {\n text-size: @text_font_size_xxsm;\n \n [kind='major_road'] {\n text-size: @text_font_size_xxsm * 1.2; \n }\n }\n\n [zoom>=14] {\n text-min-distance: 10;\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_md;\n text-halo-radius: @text_font_halo_radius_large;\n \n [kind='major_road'] {\n text-size: @text_font_size_sm * 1.2; \n } \n }\n\n [zoom>=16]{\n text-min-distance: 100;\n text-character-spacing: @text_character_spacing_lg;\n }\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n\n \/\/ default rectangle shield\n shield-file: url(shields\/default.svg);\n shield-fill: @label_color_shield_fed;\n shield-transform: scale(1.1,1.1);\n shield-face-name: @text_font_shield;\n shield-name: [ref];\n shield-size: 10;\n shield-min-distance: 60;\n shield-spacing: 60;\n \/\/ half the width of the shield to prevent from wrapping\n shield-min-padding: 10;\n\n [zoom>=11][zoom<=12][highway='trunk'],\n [zoom>=11][zoom<=12][highway='primary'],\n [zoom>=11][zoom<=12][highway='secondary'],\n [zoom>=11][zoom<=12][highway='tertiary'] {\n shield-opacity: 0;\n shield-size: 0;\n }\n\n [ref=~'I \\d+'] {\n shield-file: url(shields\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 65;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 15;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(shields\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 65;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 13;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'US \\d+'] {\n shield-file: url(shields\/us.svg);\n shield-transform: scale(0.062, 0.062);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: @label_color_shield_fed;\n shield-text-dy: 1;\n shield-character-spacing: -1;\n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.075, 0.075);\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.088, 0.088);\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.091, 0.091);\n } \n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(shields\/ca.svg);\n shield-fill: @label_color_shield;\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-dy: -2.5;\n shield-character-spacing: -1;\n\n [zoom>=11][zoom<=12][highway='trunk'],\n [zoom>=11][zoom<=12][highway='primary'],\n [zoom>=11][zoom<=12][highway='secondary'],\n [zoom>=11][zoom<=12][highway='tertiary'] {\n shield-opacity: 0;\n shield-size: 0;\n } \n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.060, 0.060);\n shield-min-distance: 70;\n }\n\n [zoom>=14] {\n shield-min-distance: 80;\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.080, 0.080);\n shield-dy: -3.5;\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.090, 0.090); \n } \n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n \n text-face-name: @text_font_water_bold;\n text-wrap-width: 40;\n text-wrap-character: ' ';\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_xlg;\n text-align: center;\n\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_xsm;\n text-halo-fill: @label_color_water_halo;\n text-placement: interior;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][scalerank<4][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][scalerank<7][changed!='']\n{\n text-name: [name];\n\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n text-face-name: @text_font_water_bold;\n text-wrap-width: 50;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_lg;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_xsm;\n text-halo-fill: @label_color_water_halo;\n text-placement: interior;\n text-align: center;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels { \n \/\/ [zoom>=4][scalerank<3],\n [zoom>=5][scalerank<3][admin!='United States of America'][admin!='Canada'],\n [zoom>=6][scalerank<5],\n [zoom>=7][scalerank>=5] {\n text-name: [name];\n text-transform: uppercase;\n text-face-name: @text_font_administrative; \n text-face-name: @text_font_administrative;\n text-fill: @label_color_administrative;\n text-halo-fill: @label_color_halo_low;\n text-halo-radius: @text_font_halo_radius_sm;\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-placement-type: simple;\n text-placements: 'E,N,W,S';\n text-allow-overlap: false;\n text-min-distance: 3;\n text-avoid-edges: true;\n text-min-padding: 5;\n \n [zoom>=5] {\n text-size: @text_font_size_sm; \n }\n\n [zoom>=6] {\n text-size: @text_font_size_medium;\n text-character-spacing: 2;\n }\n\n [zoom>=7] {\n text-size: @text_font_size_large;\n text-character-spacing: 3;\n } \n }\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n text-character-spacing: 1;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80; \n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n \/\/ text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n}\n\n\/\/ #admin1-labels-50m-z6 {\n\/\/ text-face-name: @text_font_administrative;\n\/\/ text-wrap-width: 80;\n\/\/ text-fill: @label_color_administrative;\n\/\/ text-halo-radius: @text_font_halo_radius_sm;\n\/\/ text-halo-fill: @label_color_halo_low; \n\/\/ text-name: \"[label_z6]\";\n\/\/ text-size: @text_font_size_medium;\n\/\/ text-character-spacing: 2;\n\/\/ }\n\n\/\/ #admin1-labels-50m-z7 {\n\/\/ text-face-name: @text_font_administrative;\n\/\/ text-wrap-width: 80;\n\/\/ text-fill: @label_color_administrative;\n\/\/ text-halo-radius: @text_font_halo_radius_sm;\n\/\/ text-halo-fill: @label_color_halo_low; \n\/\/ text-name: \"[label_z7]\";\n\/\/ text-size: @text_font_size_large;\n\/\/ text-character-spacing: 3;\n\/\/ }\n\n\/* Admin 0 labels *\/\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_sm;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-size: @text_font_size_large;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-character-spacing: @text_character_spacing_sm;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_lg;\n text-size: @text_font_size_large;\n [population<100] { text-size: @text_font_size_medium_plus; }\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xlg;\n [population<100] { text-size: @text_font_size_large; }\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xxlg;\n [population<100] { text-size: @text_font_size_xlg; }\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n\/* city labels - using hwy shields *\/\n#aries-places-labels {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<7],\n [zoom=7][scalerank<8],\n [zoom=8][scalerank<9],\n [zoom=9][scalerank<10],\n [zoom=10][scalerank<11],\n [zoom=11][scalerank<12],\n [zoom=12][scalerank<13],\n [zoom=13][scalerank<14], \n [zoom=14][scalerank<15] \n [zoom>=15][scalerank<15]{\n\n shield-file: url(shields\/circle-12.svg);\n shield-fill: @label_color_city;\n shield-halo-fill: @label_color_halo_low;\n shield-halo-radius: @text_font_halo_radius_sm;\n shield-unlock-image: true;\n shield-avoid-edges: true;\n shield-transform: scale(0.5, 0.5);\n shield-face-name: @text_font_city;\n shield-name: [name];\n shield-min-distance: 2;\n shield-placement-type: simple;\n shield-placements: 'NE,SW,NW,SE,E,W';\n shield-text-dy: 3;\n shield-text-dx: 3;\n shield-min-distance: 10;\n\n\n [zoom>=4] {\n shield-size: @text_font_size_xsm;\n \n [population>700000] {\n shield-size: @text_font_size_xsm * 1.2;\n shield-transform: scale(0.7, 0.7);\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xsm * 1.3;\n shield-transform: scale(0.8, 0.8);\n } \n }\n\n [zoom>=5]{\n shield-size: @text_font_size_sm; \n \n [population>700000] {\n shield-size: @text_font_size_sm * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_sm * 1.3;\n } \n }\n\n [zoom>=6]{\n shield-size: @text_font_size_medium; \n\n [population>700000] {\n shield-size: @text_font_size_medium * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium * 1.5;\n } \n }\n\n [zoom>=8] {\n shield-halo-radius: @text_font_halo_radius_md;\n }\n\n [zoom>=10]{\n shield-size: @text_font_size_medium_plus; \n shield-halo-radius: @text_font_halo_radius_large;\n shield-halo-fill: @label_color_halo_high;\n \n [population>700000] {\n shield-size: @text_font_size_medium_plus * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium_plus * 1.3;\n } \n }\n\n [zoom>=11] {\n shield-opacity: 0;\n }\n\n [zoom>=12] {\n shield-size: @text_font_size_xlg;\n \n [population>700000] {\n shield-size: @text_font_size_xlg * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xlg * 1.3;\n } \n }\n }\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"ca70c8e89579eac0fbda2cbd483dbd6b39395832","subject":"Fixing syntax error","message":"Fixing syntax error","repos":"mapbox\/open-streets-style","old_file":"open-streets\/style.mss","new_file":"open-streets\/style.mss","new_contents":"\/*\n\nOPEN STREETS\n============\n\nA TileMill map style for OpenStreetMap. For PostGIS databases created \nby osm2pgsql with a default style file, or style that is compatible \nwith the default.\n\nUse the included `configure.py` script to customize your database and\nextent settings. See the README for more info.\n\n\n\n*\/\n\n\n\n\n\n\n\n\/* ---- PALETTE ---- *\/\n\n@water: #c0d8ff;\n@land: #f4f6f0;\n@forest: #c7e6a8;\n@agriculture:#f4f0e0;\n@grass: lighten(@forest,5);\n@park: lighten(@forest,10);\n@beach: #ffeec7;\n@building: darken(#e8e4e4,8);\n\n\/* ---- NATURAL & LANDUSE ---- *\/\n\nMap { background-color: @water; }\n\n#world[zoom<6],\n#shoreline_300[zoom>=6][zoom<10],\n#processed_p[zoom>=10] {\n polygon-fill: @land;\n}\n\n#ne-lakes[zoom<6],\n.water[zoom>5] {\n polygon-fill:@water;\n polygon-gamma:0.8;\n}\n.water-outline[zoom>11] {\n line-color:darken(@water,10);\n [zoom=12] { line-width:0.8; }\n [zoom=13] { line-width:1.2; }\n [zoom=14] { line-width:1.4; }\n [zoom=15] { line-width:1.6; }\n [zoom=16] { line-width:1.8; }\n [zoom>16] { line-width:2; }\n}\n\n.wetland[zoom>10] {\n polygon-pattern-file:url(.\/res\/wetland-8.png);\n [zoom>13] { polygon-pattern-file:url(.\/res\/wetland-16.png); }\n [zoom>15] { polygon-pattern-file:url(.\/res\/wetland-32.png); }\n polygon-pattern-alignment: global;\n}\n\n.forest[zoom>6][size='huge'],\n.forest[zoom>7][size='large'],\n.forest[zoom>8][size='medium'],\n.forest[zoom>9][size='small'] {\n \/* At lower zoom levels forests are dense and distracting. \n Ramp them in gradually. *\/\n [zoom=7] { polygon-fill:lighten(@forest,14); }\n [zoom=8] { polygon-fill:lighten(@forest,12); }\n [zoom=9] { polygon-fill:lighten(@forest,9); }\n [zoom=10]{ polygon-fill:lighten(@forest,6); }\n [zoom=11]{ polygon-fill:lighten(@forest,3); }\n [zoom>11] { polygon-fill:@forest; }\n \/* These outlines create a slight faux-blur effect. *\/\n [zoom>14] {\n line-color:@forest;\n line-opacity:0.4;\n line-join:round; }\n [zoom=15] { line-width:1.6; }\n [zoom=16] { line-width:2.6; }\n [zoom=17] { line-width:3.6; }\n [zoom>=18] { line-width:4.6; }\n \/* a second outline for addtional blur *\/\n ::xtra {\n [zoom>16] {\n line-color:@forest;\n line-opacity:0.2;\n line-join:round; }\n [zoom=17] { line-width:7; }\n [zoom>=18] { line-width:9; }\n }\n}\n\n.agriculture[zoom>9] {\n polygon-fill:@agriculture;\n}\n\n.beach[zoom>9] {\n polygon-fill:@beach;\n}\n\n.grass[zoom>9][size='huge'],\n.grass[zoom>10][size='large'],\n.grass[zoom>11][size='medium'],\n.grass[zoom>12][size='small'] {\n \/* lighten relative to forest ramping *\/\n [zoom=10]{ polygon-fill:lighten(@grass,6); }\n [zoom=11]{ polygon-fill:lighten(@grass,3); }\n polygon-fill:@grass;\n}\n\n.park[zoom>9] {\n polygon-fill:@park;\n [zoom>13] { line-color:darken(@park,20); }\n [zoom=14] { line-width:0.6; }\n [zoom=15] { line-width:0.8; }\n [zoom>15] { line-width:1.2; }\n}\n\n\/* ---- CAMPUSES ---- *\/\n\/* Note that amenity=school, amenity=hospital, etc are ideally polygons of the\n *campus*, but are occasionally applied to the physical building instead. *\/\n@campus: #ECF;\n.campus[zoom>10] {\n polygon-opacity:0.2;\n polygon-fill:@campus;\n [zoom>12] {\n line-opacity:0.4;\n line-color:spin(darken(@campus,20),20);\n }\n [zoom=13] { line-width:0.3; }\n [zoom=14] { line-width:0.5; }\n [zoom=15] { line-width:0.7; }\n [zoom=16] { line-width:0.8; }\n [zoom=17] { line-width:0.9; }\n [zoom=18] { line-width:1.0; }\n}\n\n\/* ---- BUILDINGS ---- *\/\n\/* Transparent buildings account for situations where routes go\n in or under them *\/\n.building[zoom>10][zoom<17] {\n polygon-fill:@building;\n [zoom=11] { polygon-opacity:0.1; }\n [zoom=12] { polygon-opacity:0.2; }\n [zoom=13] { polygon-opacity:0.3; }\n [zoom>13] {\n polygon-opacity:0.4;\n line-color:darken(@building,5);\n line-width:0.2;\n }\n [zoom>15] {\n line-color:darken(@building,10);\n line-width:0.4;\n }\n}\n.building[zoom>=17] {\n building-fill:lighten(@building,4);\n building-fill-opacity: 0.8;\n building-height:1.2;\n}","old_contents":"\/*\n\nOPEN STREETS\n============\n\nA TileMill map style for OpenStreetMap. For PostGIS databases created \nby osm2pgsql with a default style file, or style that is compatible \nwith the default.\n\nUse the included `configure.py` script to customize your database and\nextent settings. See the README for more info.\n\n\n\n*\/\n\n\n\n\n\n\n\n\/* ---- PALETTE ---- *\/\n\n@water: #c0d8ff;\n@land: #f4f6f0;\n@forest: #c7e6a8;\n@agriculture:#f4f0e0;\n@grass: lighten(@forest,5);\n@park: lighten(@forest,10);\n@beach: #ffeec7;\n@building: darken(#e8e4e4,8);\n\n\/* ---- NATURAL & LANDUSE ---- *\/\n\nMap { background-color: @water; }\n\n#world[zoom<6],\n#shoreline_300[zoom>=6][zoom<10],\n#processed_p[zoom>=10] {\n polygon-fill: @land;\n}\n\n#ne-lakes[zoom<6],\n.water[zoom>5] {\n polygon-fill:@water;\n polygon-gamma:0.8;\n}\n.water-outline[zoom>11] {\n line-color:darken(@water,10);\n [zoom=12] { line-width:0.8; }\n [zoom=13] { line-width:1.2; }\n [zoom=14] { line-width:1.4; }\n [zoom=15] { line-width:1.6; }\n [zoom=16] { line-width:1.8; }\n [zoom>16] { line-width:2; }\n}\n\n.wetland[zoom>10] {\n polygon-pattern-file:url(.\/res\/wetland-8.png);\n [zoom>13] { polygon-pattern-file:url(.\/res\/wetland-16.png); }\n [zoom>15] { polygon-pattern-file:url(.\/res\/wetland-32.png); }\n polygon-pattern-alignment: global;\n}\n\n.forest[zoom>6][size='huge'],\n.forest[zoom>7][size='large'],\n.forest[zoom>8][size='medium'],\n.forest[zoom>9][size='small'] {\n \/* At lower zoom levels forests are dense and distracting. \n Ramp them in gradually. *\/\n [zoom=7] { polygon-fill:lighten(@forest,14); }\n [zoom=8] { polygon-fill:lighten(@forest,12); }\n [zoom=9] { polygon-fill:lighten(@forest,9); }\n [zoom=10]{ polygon-fill:lighten(@forest,6); }\n [zoom=11]{ polygon-fill:lighten(@forest,3); }\n [zoom>11] { polygon-fill:@forest; }\n \/* These outlines create a slight faux-blur effect. *\/\n [zoom>14] {\n line-color:@forest;\n line-opacity:0.4;\n line-join:round; }\n [zoom=15] { line-width:1.6; }\n [zoom=16] { line-width:2.6; }\n [zoom=17] { line-width:3.6; }\n [zoom>=18] { line-width:4.6; }\n \/* a second outline for addtional blur *\/\n ::xtra {\n [zoom>16] {\n line-color:@forest;\n line-opacity:0.2;\n line-join:round; }\n [zoom=17] { line-width:7; }\n [zoom>=18] { line-width:9; }\n }\n}\n\n.agriculture[zoom>9] {\n polygon-fill:@agriculture;\n}\n\n.beach[zoom>9] {\n polygon-fill:@beach;\n}\n\n.grass[zoom>9][size='huge'],\n.grass[zoom>10][size='large'],\n.grass[zoom>11][size='medium'],\n.grass[zoom>12][size='small'] {\n \/* lighten relative to forest ramping *\/\n [zoom=10]{ polygon-fill:lighten(@grass,6); }\n [zoom=11]{ polygon-fill:lighten(@grass,3); }\n polygon-fill:@grass;\n}\n\n.park[zoom>9] {\n polygon-fill:@park;\n [zoom>13] { line-color:darken(@park,20); }\n [zoom=14] { line-width:0.6; }\n [zoom=15] { line-width:0.8; }\n [zoom>15] { line-width:1.2; }\n}\n\n\/* ---- CAMPUSES ---- *\/\n\/* Note that amenity=school, amenity=hospital, etc are ideally polygons of the\n *campus*, but are occasionally applied to the physical building instead. *\/\n@campus: #ECF;\n.campus[zoom>10] {\n polygon-opacity:0.2;\n polygon-fill:@campus;\n [zoom>12] {\n line-opacity:0.4;\n line-color:spin(darken(@campus,20),20);\n }\n [zoom=13] { line-width:0.3; }\n [zoom=14] { line-width:0.5; }\n [zoom=15] { line-width:0.7; }\n [zoom=16] { line-width:0.8; }\n [zoom=17] { line-width:0.9; }\n [zoom=18] { line-width:1.0; }\n}\n\n\/* ---- BUILDINGS ---- *\/\n\/* Transparent buildings account for situations where routes go\n in or under them *\/\n.building[zoom>10][zoom<17] {\n polygon-fill:@building,8;\n [zoom=11] { polygon-opacity:0.1; }\n [zoom=12] { polygon-opacity:0.2; }\n [zoom=13] { polygon-opacity:0.3; }\n [zoom>13] {\n polygon-opacity:0.4;\n line-color:darken(@building,5);\n line-width:0.2;\n }\n [zoom>15] {\n line-color:darken(@building,10);\n line-width:0.4;\n }\n}\n.building[zoom>=17] {\n building-fill:lighten(@building,4);\n building-fill-opacity: 0.8;\n building-height:1.2;\n}","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"fa29b17fe2930c78e2dad2613cd89901342063b6","subject":"Remove unused XMLIdToObjectMap","message":"Remove unused XMLIdToObjectMap\n","repos":"music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n\n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n \/\/encodingDesc must preceed workList in MEI 4.0\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = GenerateApplicationInfo();\n libmei.AddChild(encodingD, appI);\n\n \/\/generate workList\n workList = libmei.WorkList();\n Self._property:WorkListElement = workList;\n\n wd_work = libmei.Work();\n wd_title = libmei.Title();\n libmei.AddChild(wd_work, wd_title);\n libmei.AddChild(workList, wd_work);\n libmei.AddChild(header, workList);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.Composer();\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_work, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.Lyricist();\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_work, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.Arranger();\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_work, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n return header;\n} \/\/$end\n\nfunction GenerateApplicationInfo () {\n \/\/$module(ExportGenerators.mss)\n\n appI = libmei.AppInfo();\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return appI;\n\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:SlurResolver = CreateSparseArray();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n \/\/annot is valid as a child of score\n libmei.AddChild(sco, ano);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = HandleText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workList = Self._property:WorkListElement;\n workEl = libmei.Work();\n libmei.AddChild(workList, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n l = null;\n\n mobjs = Self._property:MeasureObjects;\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0 or (l = null and bobj.Type = 'Clef'))\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n\n l._property:CurrentPos = 0;\n }\n }\n\n obj = null;\n mobj = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n \/\/ Clefs are placed inside the musical flow like notes. Hence we also need to find\n \/\/ out whether they are part of beams or tuplets.\n clef = GenerateClef(bobj);\n\n prevNoteRest = PrevNormalOrGrace(bobj, false);\n\n if (prevNoteRest != null)\n {\n prevBeamProp = NormalizedBeamProp(prevNoteRest);\n\n switch (prevBeamProp)\n {\n case ('StartBeam')\n {\n beam = l._property:ActiveBeam;\n }\n case ('NoBeam')\n {\n beam = null;\n }\n default\n {\n \/\/ ContinueBeam and SingleBeam\n nextNoteRest = NextNormalOrGrace(bobj, false);\n if (nextNoteRest != null)\n {\n nextBeamProp = NormalizedBeamProp(nextNoteRest);\n if ((nextBeamProp = ContinueBeam) or (nextBeamProp = SingleBeam))\n {\n beam = l._property:ActiveBeam;\n }\n }\n }\n }\n\n tuplet = l._property:ActiveMeiTuplet;\n while (tuplet != null and tuplet._property:ParentTuplet != null)\n {\n tuplet = tuplet._property:ParentTuplet;\n }\n }\n\n AppendToLayer(clef, l, beam, tuplet);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n\n AppendToLayer(note, l, beam, tuplet);\n }\n\n if (bobj.ArpeggioType != ArpeggioTypeNone) {\n arpeg = GenerateArpeggio(bobj);\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(arpeg._id);\n Self._property:MeasureObjects = mobjs;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n }\n }\n\n for each bobj in bar\n {\n obj = null;\n mobj = null;\n chordsym = null;\n\n switch (bobj.Type)\n {\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n bobj._property:mobj = mobj;\n PushToHashedLayer(Self._property:SlurResolver, bobj.EndBarNumber, bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('ArpeggioLine')\n {\n mobj = GenerateArpeggio(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = HandleText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n Self._property:MeasureObjects = mobjs;\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n HandleSymbol(sobj);\n }\n\n ProcessEndingSlurs(bar);\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n else\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n libmei.AddAttribute(nr, 'stem.mod', '1slash');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ppq', dur);\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMEI(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'fontsize', 'small');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pden * 1.0 \/ pnum) * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n vel = nobj.OriginalVelocity;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'vel', vel);\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', gesdur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n if (nobj.Dx != 0)\n {\n libmei.AddAttribute(n, 'ho', ConvertOffsetsToMEI(nobj.Dx));\n }\n\n if (nobj.Color != nobj.ParentNoteRest.Color)\n {\n note_color = ConvertColor(nobj);\n libmei.AddAttribute(n, 'color', note_color);\n }\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', dur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n \/\/ MEI now supports a four-bar repeat\n obj = libmei.MultiRpt();\n libmei.AddAttribute(obj, 'num', '4');\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n vuval = docSettings.StaffSize \/ 8;\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n libmei.AddAttribute(scoredef, 'vu.height', vuval & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'keysig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n libmei.AddAttribute(scoredef, 'spacing.staff', score.EngravingRules.SpacesBetweenStaves * 2);\n libmei.AddAttribute(scoredef, 'spacing.system', score.EngravingRules.SpacesBetweenSystems * 2);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n if (score.StaffCount > 0)\n {\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n }\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n diaTrans = s.InitialInstrumentType.DiatonicTransposition;\n semiTrans = s.InitialInstrumentType.ChromaticTransposition;\n if (diaTrans != 0 and semiTrans != 0)\n {\n libmei.AddAttribute(std, 'trans.semi', semiTrans);\n libmei.AddAttribute(std, 'trans.diat', diaTrans);\n }\n\n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.FullInstrumentName != null)\n {\n label = libmei.Label();\n libmei.SetText(label, s.FullInstrumentName);\n libmei.AddChild(std, label);\n }\n\n if (s.ShortInstrumentName != null)\n {\n labelAbbr = libmei.LabelAbbr();\n libmei.SetText(labelAbbr, s.ShortInstrumentName);\n libmei.AddChild(std, labelAbbr);\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n \/\/brackets\n case ('bracket')\n {\n line = libmei.Line();\n bracketType = 'bracket';\n\n \/\/horizontal brackets\n if (linecomps.Length >= 3)\n {\n \/\/brackets above\n if (linecomps[3] = 'above')\n {\n libmei.AddAttribute(line, 'place', 'above');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleup');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angleup');\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n \/\/brackets below\n if (linecomps[3] = 'below')\n {\n libmei.AddAttribute(line, 'place', 'below');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angledown');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angledown');\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n \/\/vertical bracktes\n if (linecomps[3] = 'vertical')\n {\n bracketType = bracketType & ' vertical';\n\n \/\/Add direction of bracket: line.staff.bracket.vertical.2 opens to the right, line.staff.bracket.vertical opens to the left\n if (linecomps > 4)\n {\n if (linecomps[4] = '2')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleright');\n libmei.AddAttribute(line, 'endsym', 'angleright');\n }\n }\n\n else\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'startsym', 'angleleft');\n libmei.AddAttribute(line, 'endsym', 'angleleft');\n }\n }\n }\n\n \/\/add types of bracktes\n libmei.AddAttribute(line, 'type', bracketType);\n }\n \/\/solid vertical line\n case ('vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n libmei.AddAttribute(line,'type','vertical');\n }\n \/\/dashed lines\n case ('dashed')\n {\n \/\/dashed vertical line\n if (linecomps.Length > 3)\n {\n if (linecomps[3] = 'vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n libmei.AddAttribute(line,'type','vertical');\n }\n }\n \/\/dashed horizontal line\n else\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n }\n }\n \/\/dotted horizontal line\n case('dotted')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dotted');\n }\n \/\/solid horizontal line\n case('plain')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n }\n case ('vibrato')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'vibrato');\n libmei.AddAttribute(line, 'form', 'wavy');\n libmei.AddAttribute(line, 'place', 'above');\n\n }\n\n \/\/To catch diverse line types, set a default\n default\n {\n line = libmei.Line();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateArpeggio (bobj) {\n \/\/$module(ExportGenerators.mss)\n arpeg = libmei.Arpeg();\n orientation = null;\n\n switch (bobj.Type)\n {\n case ('NoteRest')\n {\n switch (bobj.ArpeggioType)\n {\n case (ArpeggioTypeUp)\n {\n orientation = 1;\n }\n case (ArpeggioTypeDown)\n {\n orientation = -1;\n }\n }\n if (bobj.ArpeggioBottomDy > bobj.ArpeggioTopDy)\n {\n \/\/ Arpeggio was manipulated to be upside down\n orientation = -1 * orientation;\n }\n }\n case ('ArpeggioLine')\n {\n if (bobj.StyleId != 'line.staff.arpeggio') {\n \/\/ This means: Line style is line.staff.arpeggio.up or\n \/\/ line.staff.arpeggio.down.\n \/\/ Strangely, the line style does not really matter for the\n \/\/ visual orientation of the arpeggio. As long as RhDy and\n \/\/ and Dy properties are identical, arpeggios look the same,\n \/\/ independant of the two line styles with arrowheads.\n orientation = bobj.RhDy - bobj.Dy;\n }\n }\n }\n\n if (orientation = null)\n {\n libmei.AddAttribute(arpeg, 'arrow', 'false');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'arrow', 'true');\n\n if (orientation > 0)\n {\n libmei.AddAttribute(arpeg, 'order', 'up');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'order', 'down');\n }\n }\n\n arpeg = AddBarObjectInfoToElement(bobj, arpeg);\n\n return arpeg;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'glyph.auth', 'smufl');\n libmei.AddAttribute(symbol, 'glyph.num', glyphnum);\n libmei.AddAttribute(symbol, 'glyph.name', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end\n","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n\n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n \/\/encodingDesc must preceed workList in MEI 4.0\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = GenerateApplicationInfo();\n libmei.AddChild(encodingD, appI);\n\n \/\/generate workList\n workList = libmei.WorkList();\n Self._property:WorkListElement = workList;\n\n wd_work = libmei.Work();\n wd_title = libmei.Title();\n libmei.AddChild(wd_work, wd_title);\n libmei.AddChild(workList, wd_work);\n libmei.AddChild(header, workList);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.Composer();\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_work, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.Lyricist();\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_work, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.Arranger();\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_work, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n return header;\n} \/\/$end\n\nfunction GenerateApplicationInfo () {\n \/\/$module(ExportGenerators.mss)\n\n appI = libmei.AppInfo();\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return appI;\n\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:SlurResolver = CreateSparseArray();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n \/\/annot is valid as a child of score\n libmei.AddChild(sco, ano);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = HandleText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workList = Self._property:WorkListElement;\n workEl = libmei.Work();\n libmei.AddChild(workList, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n l = null;\n\n mobjs = Self._property:MeasureObjects;\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0 or (l = null and bobj.Type = 'Clef'))\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n\n l._property:CurrentPos = 0;\n }\n }\n\n obj = null;\n mobj = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n \/\/ Clefs are placed inside the musical flow like notes. Hence we also need to find\n \/\/ out whether they are part of beams or tuplets.\n clef = GenerateClef(bobj);\n\n prevNoteRest = PrevNormalOrGrace(bobj, false);\n\n if (prevNoteRest != null)\n {\n prevBeamProp = NormalizedBeamProp(prevNoteRest);\n\n switch (prevBeamProp)\n {\n case ('StartBeam')\n {\n beam = l._property:ActiveBeam;\n }\n case ('NoBeam')\n {\n beam = null;\n }\n default\n {\n \/\/ ContinueBeam and SingleBeam\n nextNoteRest = NextNormalOrGrace(bobj, false);\n if (nextNoteRest != null)\n {\n nextBeamProp = NormalizedBeamProp(nextNoteRest);\n if ((nextBeamProp = ContinueBeam) or (nextBeamProp = SingleBeam))\n {\n beam = l._property:ActiveBeam;\n }\n }\n }\n }\n\n tuplet = l._property:ActiveMeiTuplet;\n while (tuplet != null and tuplet._property:ParentTuplet != null)\n {\n tuplet = tuplet._property:ParentTuplet;\n }\n }\n\n AppendToLayer(clef, l, beam, tuplet);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n\n AppendToLayer(note, l, beam, tuplet);\n }\n\n if (bobj.ArpeggioType != ArpeggioTypeNone) {\n arpeg = GenerateArpeggio(bobj);\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(arpeg._id);\n Self._property:MeasureObjects = mobjs;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n }\n }\n\n for each bobj in bar\n {\n obj = null;\n mobj = null;\n chordsym = null;\n\n switch (bobj.Type)\n {\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n bobj._property:mobj = mobj;\n PushToHashedLayer(Self._property:SlurResolver, bobj.EndBarNumber, bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('ArpeggioLine')\n {\n mobj = GenerateArpeggio(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = HandleText(bobj);\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n Self._property:MeasureObjects = mobjs;\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n HandleSymbol(sobj);\n }\n\n ProcessEndingSlurs(bar);\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n else\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n libmei.AddAttribute(nr, 'stem.mod', '1slash');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ppq', dur);\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMEI(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMEI(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'fontsize', 'small');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pden * 1.0 \/ pnum) * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n vel = nobj.OriginalVelocity;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'vel', vel);\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', gesdur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n if (nobj.Dx != 0)\n {\n libmei.AddAttribute(n, 'ho', ConvertOffsetsToMEI(nobj.Dx));\n }\n\n if (nobj.Color != nobj.ParentNoteRest.Color)\n {\n note_color = ConvertColor(nobj);\n libmei.AddAttribute(n, 'color', note_color);\n }\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', dur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n \/\/ MEI now supports a four-bar repeat\n obj = libmei.MultiRpt();\n libmei.AddAttribute(obj, 'num', '4');\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n vuval = docSettings.StaffSize \/ 8;\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n libmei.AddAttribute(scoredef, 'vu.height', vuval & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'keysig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n libmei.AddAttribute(scoredef, 'spacing.staff', score.EngravingRules.SpacesBetweenStaves * 2);\n libmei.AddAttribute(scoredef, 'spacing.system', score.EngravingRules.SpacesBetweenSystems * 2);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n if (score.StaffCount > 0)\n {\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n }\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n diaTrans = s.InitialInstrumentType.DiatonicTransposition;\n semiTrans = s.InitialInstrumentType.ChromaticTransposition;\n if (diaTrans != 0 and semiTrans != 0)\n {\n libmei.AddAttribute(std, 'trans.semi', semiTrans);\n libmei.AddAttribute(std, 'trans.diat', diaTrans);\n }\n\n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.FullInstrumentName != null)\n {\n label = libmei.Label();\n libmei.SetText(label, s.FullInstrumentName);\n libmei.AddChild(std, label);\n }\n\n if (s.ShortInstrumentName != null)\n {\n labelAbbr = libmei.LabelAbbr();\n libmei.SetText(labelAbbr, s.ShortInstrumentName);\n libmei.AddChild(std, labelAbbr);\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n \/\/brackets\n case ('bracket')\n {\n line = libmei.Line();\n bracketType = 'bracket';\n\n \/\/horizontal brackets\n if (linecomps.Length >= 3)\n {\n \/\/brackets above\n if (linecomps[3] = 'above')\n {\n libmei.AddAttribute(line, 'place', 'above');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleup');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angleup');\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n \/\/brackets below\n if (linecomps[3] = 'below')\n {\n libmei.AddAttribute(line, 'place', 'below');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angledown');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angledown');\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n \/\/vertical bracktes\n if (linecomps[3] = 'vertical')\n {\n bracketType = bracketType & ' vertical';\n\n \/\/Add direction of bracket: line.staff.bracket.vertical.2 opens to the right, line.staff.bracket.vertical opens to the left\n if (linecomps > 4)\n {\n if (linecomps[4] = '2')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleright');\n libmei.AddAttribute(line, 'endsym', 'angleright');\n }\n }\n\n else\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'startsym', 'angleleft');\n libmei.AddAttribute(line, 'endsym', 'angleleft');\n }\n }\n }\n\n \/\/add types of bracktes\n libmei.AddAttribute(line, 'type', bracketType);\n }\n \/\/solid vertical line\n case ('vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n libmei.AddAttribute(line,'type','vertical');\n }\n \/\/dashed lines\n case ('dashed')\n {\n \/\/dashed vertical line\n if (linecomps.Length > 3)\n {\n if (linecomps[3] = 'vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n libmei.AddAttribute(line,'type','vertical');\n }\n }\n \/\/dashed horizontal line\n else\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n }\n }\n \/\/dotted horizontal line\n case('dotted')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dotted');\n }\n \/\/solid horizontal line\n case('plain')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n }\n case ('vibrato')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'vibrato');\n libmei.AddAttribute(line, 'form', 'wavy');\n libmei.AddAttribute(line, 'place', 'above');\n\n }\n\n \/\/To catch diverse line types, set a default\n default\n {\n line = libmei.Line();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateArpeggio (bobj) {\n \/\/$module(ExportGenerators.mss)\n arpeg = libmei.Arpeg();\n orientation = null;\n\n switch (bobj.Type)\n {\n case ('NoteRest')\n {\n switch (bobj.ArpeggioType)\n {\n case (ArpeggioTypeUp)\n {\n orientation = 1;\n }\n case (ArpeggioTypeDown)\n {\n orientation = -1;\n }\n }\n if (bobj.ArpeggioBottomDy > bobj.ArpeggioTopDy)\n {\n \/\/ Arpeggio was manipulated to be upside down\n orientation = -1 * orientation;\n }\n }\n case ('ArpeggioLine')\n {\n if (bobj.StyleId != 'line.staff.arpeggio') {\n \/\/ This means: Line style is line.staff.arpeggio.up or\n \/\/ line.staff.arpeggio.down.\n \/\/ Strangely, the line style does not really matter for the\n \/\/ visual orientation of the arpeggio. As long as RhDy and\n \/\/ and Dy properties are identical, arpeggios look the same,\n \/\/ independant of the two line styles with arrowheads.\n orientation = bobj.RhDy - bobj.Dy;\n }\n }\n }\n\n if (orientation = null)\n {\n libmei.AddAttribute(arpeg, 'arrow', 'false');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'arrow', 'true');\n\n if (orientation > 0)\n {\n libmei.AddAttribute(arpeg, 'order', 'up');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'order', 'down');\n }\n }\n\n arpeg = AddBarObjectInfoToElement(bobj, arpeg);\n\n return arpeg;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'glyph.auth', 'smufl');\n libmei.AddAttribute(symbol, 'glyph.num', glyphnum);\n libmei.AddAttribute(symbol, 'glyph.name', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"36b376f4eb8d5994b2ccef457d0f6fd0ece08bab","subject":"Turn champion role color to orange on hover.","message":"Turn champion role color to orange on hover.\n","repos":"Ilshidur\/lol-item-sets-generator.org,Ilshidur\/lol-item-sets-generator.org,league-of-legends-devs\/lol-item-sets-generator.org,league-of-legends-devs\/lol-item-sets-generator.org,Ilshidur\/lol-item-sets-generator.org,league-of-legends-devs\/lol-item-sets-generator.org","old_file":"app\/client\/templates\/sets_list\/sets_list.mss","new_file":"app\/client\/templates\/sets_list\/sets_list.mss","new_contents":"\/*****************************************************************************\/\n\/* SetsList: Style *\/\n\/*****************************************************************************\/\n.sets_list {\n}\n\n.loadingText {\n font-size: 2.5em;\n font-weight: bold;\n}\n\n.itemSet {\n padding: 0;\n overflow: hidden;\n}\n\n.itemSetLink {\n background-color: rgba(195, 176, 164, 0.6);\n color: white;\n}\n\n.itemSetLink:hover {\n background-color: rgba(214, 86, 5, 0.6);\n color: rgb(227, 172, 137);\n}\n\n.itemSetRole {\n position: absolute;\n background-color: inherit;\n color: white;\n font-size: 14px;\n font-weight: bold;\n line-height: 20px;\n text-align: center;\n z-index: 10;\n width: 100%;\n height: 20px;\n bottom: 0;\n left: 0;\n margin: 0;\n}\n\n.champImage {\n width: 100%;\n}\n\n.spriteContainer {\n width: 100%;\n}\n.spriteContainer:before {\n content: \"\";\n display: block;\n padding-top: 100%;\n}\n\n.champSprite {\n \/* from : http:\/\/stackoverflow.com\/a\/28985475\/4022804 *\/\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n text-align: center;\n}\n\n.champSprite .champName {\n position: absolute;\n left: 0;\n top: 0;\n color: inherit;\n font-size: 14px;\n font-weight: bold;\n line-height: 20px;\n text-align: center;\n background-color: rgba(56, 56, 56, 0.6);\n -webkit-box-shadow: 0px 0px 8px 5px rgba(56, 56, 56, 0.6);\n -moz-box-shadow: 0px 0px 8px 5px rgba(56, 56, 56, 0.6);\n box-shadow: 0px 0px 8px 5px rgba(56, 56, 56, 0.6);\n padding: 3px 8px;\n}\n","old_contents":"\/*****************************************************************************\/\n\/* SetsList: Style *\/\n\/*****************************************************************************\/\n.sets_list {\n}\n\n.loadingText {\n font-size: 2.5em;\n font-weight: bold;\n}\n\n.itemSet {\n padding: 0;\n overflow: hidden;\n}\n\n.itemSetLink {\n background-color: rgba(195, 176, 164, 0.6);\n}\n\n.itemSetLink:hover {\n background-color: rgba(214, 86, 5, 0.6);\n}\n\n.itemSetRole {\n position: absolute;\n background-color: inherit;\n color: white;\n font-size: 14px;\n font-weight: bold;\n line-height: 20px;\n text-align: center;\n z-index: 10;\n width: 100%;\n height: 20px;\n bottom: 0;\n left: 0;\n margin: 0;\n}\n\n.champImage {\n width: 100%;\n}\n\n.spriteContainer {\n width: 100%;\n}\n.spriteContainer:before {\n content: \"\";\n display: block;\n padding-top: 100%;\n}\n\n.champSprite {\n \/* from : http:\/\/stackoverflow.com\/a\/28985475\/4022804 *\/\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n text-align: center;\n}\n\n.champSprite .champName {\n position: absolute;\n left: 0;\n top: 0;\n color: white;\n font-size: 14px;\n font-weight: bold;\n line-height: 20px;\n text-align: center;\n background-color: rgba(56, 56, 56, 0.6);\n -webkit-box-shadow: 0px 0px 8px 5px rgba(56, 56, 56, 0.6);\n -moz-box-shadow: 0px 0px 8px 5px rgba(56, 56, 56, 0.6);\n box-shadow: 0px 0px 8px 5px rgba(56, 56, 56, 0.6);\n padding: 3px 8px;\n}\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"bc8e0e5131d4d197ca3cf38d1a3ab8b9e78c8801","subject":"Fix raster rendering test.","message":"Fix raster rendering test.\n","repos":"1ec5\/carto,tomhughes\/carto,pnorman\/carto,stefanklug\/carto,CartoDB\/carto,midnightcomm\/carto,CartoDB\/carto,mapbox\/carto,madeinqc\/carto,gravitystorm\/carto,clhenrick\/carto,whitelynx\/carto","old_file":"test\/rendering\/raster.mss","new_file":"test\/rendering\/raster.mss","new_contents":"#data {\n raster-opacity: 1;\n raster-mode: multiply2;\n}\n","old_contents":"#data {\nline-widt: 1;\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"CartoCSS"} {"commit":"90f4de9bad884a56ca13f67429db587c709891c9","subject":"tweak country labels","message":"tweak country labels\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_shield: 'PT Sans Bold', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Bold', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Italic', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Bold Italic', 'Unifont Medium';\n\n@label_color_transport: #524c4c;\n@label_color_shield: #fff;\n@label_color_shield_fed: #333;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n@text_font_size_xlg: 24;\n@text_font_size_xxlg: 34;\n\n@text_character_spacing_sm: 0.7;\n@text_character_spacing_md: 1.2;\n@text_character_spacing_lg: 1.7;\n@text_character_spacing_xlg: 2.2;\n\n@text_font_halo_radius_sm: 1.5;\n@text_font_halo_radius_md: 1.75;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: #F7F7E6;\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-placement: line;\n text-label-position-tolerance: 2;\n text-max-char-angle-delta: 20;\n text-min-path-length: 30;\n text-fill: #444;\n text-spacing: 256;\n text-min-distance: 5;\n text-character-spacing: @text_character_spacing_sm;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: @text_font_halo_radius_md;\n\n [kind='major_road'] {\n text-size: @text_font_size_xxsm; \n } \n\n [zoom>=13] {\n text-size: @text_font_size_xxsm;\n \n [kind='major_road'] {\n text-size: @text_font_size_xxsm * 1.2; \n }\n }\n\n [zoom>=14] {\n text-min-distance: 10;\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_md;\n text-halo-radius: @text_font_halo_radius_large;\n \n [kind='major_road'] {\n text-size: @text_font_size_sm * 1.2; \n } \n }\n\n [zoom>=16]{\n text-min-distance: 100;\n text-character-spacing: @text_character_spacing_lg;\n }\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n \/\/ default rectangle shield\n shield-file: url(shields\/default.svg);\n shield-fill: @label_color_shield_fed; \n shield-transform: scale(0.2,0.2);\n shield-face-name: @text_font_shield;\n shield-name: [ref];\n shield-size: 10;\n shield-min-distance: 44;\n shield-spacing: 20;\n \/\/ half the width of the shield to prevent from wrapping\n shield-min-padding: 10;\n\n [ref=~'I \\d+'] {\n shield-file: url(shields\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 65;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 15;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(shields\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 40;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 13;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'US \\d+'] {\n shield-file: url(shields\/us.svg);\n shield-transform: scale(0.062, 0.062);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: @label_color_shield_fed;\n shield-text-dy: 1;\n shield-character-spacing: -1;\n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.075, 0.075);\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.088, 0.088);\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.091, 0.091);\n } \n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(shields\/ca.svg);\n shield-fill: @label_color_shield;\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-dy: -2.5;\n shield-character-spacing: -1;\n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.060, 0.060);\n shield-min-distance: 50;\n }\n\n [zoom>=14] {\n shield-min-distance: 80;\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.080, 0.080);\n shield-dy: -3.5;\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.090, 0.090); \n } \n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n \n text-face-name: @text_font_water_bold;\n text-wrap-width: 40;\n text-wrap-character: ' ';\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_xlg;\n text-align: center;\n\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][scalerank<4][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][scalerank<7][changed!='']\n{\n text-name: [name];\n\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n text-face-name: @text_font_water_bold;\n text-wrap-width: 50;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_lg;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels { \n \/\/ [zoom>=4][scalerank<3],\n [zoom>=5][scalerank<3][admin!='United States of America'][admin!='Canada'],\n [zoom>=6][scalerank<5],\n [zoom>=7][scalerank>=5] {\n text-name: [name];\n text-transform: uppercase;\n text-face-name: @text_font_administrative; \n text-face-name: @text_font_administrative;\n text-fill: @label_color_administrative;\n text-halo-fill: @label_color_halo_low;\n text-halo-radius: @text_font_halo_radius_sm;\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-placement-type: simple;\n text-placements: 'E,N,W,S';\n \n [zoom>=5] {\n text-size: @text_font_size_sm; \n }\n\n [zoom>=6] {\n text-size: @text_font_size_medium;\n text-character-spacing: 2;\n }\n\n [zoom>=7] {\n text-size: @text_font_size_large;\n text-character-spacing: 3;\n } \n }\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n text-character-spacing: 1;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80; \n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n \/\/ text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_medium;\n text-character-spacing: 2;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n text-character-spacing: 3;\n}\n\n\/* Admin 0 labels *\/\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_sm;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-size: @text_font_size_large;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-character-spacing: @text_character_spacing_sm;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_lg;\n text-size: @text_font_size_large;\n [population<100] { text-size: @text_font_size_medium_plus; }\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xlg;\n [population<100] { text-size: @text_font_size_large; }\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xxlg;\n [population<100] { text-size: @text_font_size_xlg; }\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n\/* city labels *\/\n\n#aries-places-labels {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<7],\n [zoom=7][scalerank<8],\n [zoom=8][scalerank<9],\n [zoom=9][scalerank<10],\n [zoom=10][scalerank<11],\n [zoom=11][scalerank<12],\n [zoom=12][scalerank<13],\n [zoom=13][scalerank<14], \n [zoom=14][scalerank<15] \n [zoom>=15][scalerank<15]{\n\n shield-file: url(shields\/circle-12.svg);\n shield-fill: @label_color_city;\n shield-halo-fill: @label_color_halo_low;\n shield-halo-radius: @text_font_halo_radius_sm;\n shield-unlock-image: true; \n shield-transform: scale(0.5, 0.5);\n shield-face-name: @text_font_city;\n shield-name: [name]; \n shield-min-distance: 2; \n shield-placement-type: simple;\n shield-placements: 'NE, N, NW, SE, S, SW';\n shield-justify-alignment: auto;\n shield-horizontal-alignment: auto;\n\n [zoom>=4] {\n shield-size: @text_font_size_xsm;\n shield-text-dy: -7;\n \n [population>700000] {\n shield-size: @text_font_size_xsm * 1.2;\n shield-transform: scale(0.7, 0.7);\n shield-text-dy: -9;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xsm * 1.3;\n shield-transform: scale(0.8, 0.8);\n shield-text-dy: -10;\n } \n }\n\n [zoom>=5]{\n shield-size: @text_font_size_sm; \n shield-text-dy: -7; \n \n [population>700000] {\n shield-size: @text_font_size_sm * 1.2;\n shield-text-dy: -9;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_sm * 1.3;\n } \n }\n\n [zoom>=6]{\n shield-size: @text_font_size_medium; \n shield-text-dy: -8;\n\n [population>700000] {\n shield-size: @text_font_size_medium * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium * 1.5;\n } \n }\n\n [zoom>=8] {\n shield-halo-radius: @text_font_halo_radius_md;\n }\n\n [zoom>=10]{\n shield-size: @text_font_size_medium_plus; \n shield-halo-radius: @text_font_halo_radius_large;\n shield-halo-fill: @label_color_halo_high;\n \n [population>700000] {\n shield-size: @text_font_size_medium_plus * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium_plus * 1.3;\n } \n }\n\n [zoom>=11] {\n shield-opacity: 0;\n }\n\n [zoom>=12] {\n shield-size: @text_font_size_xlg;\n \n [population>700000] {\n shield-size: @text_font_size_xlg * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xlg * 1.3;\n } \n }\n }\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n\n","old_contents":"@text_font_transport: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_shield: 'PT Sans Bold', 'Unifont Medium';\n@text_font_administrative: 'PT Sans Bold', 'Unifont Medium';\n@text_font_city: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_parks: 'PT Sans Narrow Regular', 'Unifont Medium';\n@text_font_water: 'PT Sans Italic', 'Unifont Medium';\n@text_font_water_bold: 'PT Sans Bold Italic', 'Unifont Medium';\n\n@label_color_transport: #524c4c;\n@label_color_shield: #fff;\n@label_color_shield_fed: #333;\n@label_color_administrative: #2e2115;\n@label_color_city: #2e2115;\n\n@text_font_size_xxsm: 12;\n@text_font_size_xsm: 14;\n@text_font_size_sm: 15;\n@text_font_size_medium: 17;\n@text_font_size_medium_plus: 18;\n@text_font_size_large: 20;\n@text_font_size_xlg: 24;\n@text_font_size_xxlg: 34;\n\n@text_character_spacing_sm: 0.7;\n@text_character_spacing_md: 1.2;\n@text_character_spacing_lg: 1.7;\n@text_character_spacing_xlg: 2.2;\n\n@text_font_halo_radius_sm: 1.5;\n@text_font_halo_radius_md: 1.75;\n@text_font_halo_radius_large: 2;\n\n@label_color_halo_low: fadeout(rgba(255,255,255,0.7), 30%);\n@label_color_halo_high: fadeout(rgba(255,255,255,1), 30%);\n@label_color_administrative_halo: fadeout(#fff, 30%);\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_transport_halo: #F7F7E6;\n@label_color_airport_halo: #f7f7e6;\n@label_color_places_halo_low: fadeout(rgba(255,255,255, 1), 30%);\n@label_color_places_halo_high: fadeout(rgba(255,255,255, 1), 30%);\n\n@label_color_green_area: #374c30; \n@label_color_green_area_halo: #c0d3b5;\n@label_color_water: darken(@color_water,20);\n@label_color_water_halo: @color_water;\n\nMap {\n font-directory: url(\"fonts\/\");\n buffer-size: 128;\n}\n\n#minor_road_labels,\n#major_road_labels,\n{\n text-name: [name];\n text-face-name: @text_font_transport;\n text-placement: line;\n text-label-position-tolerance: 2;\n text-max-char-angle-delta: 20;\n text-min-path-length: 30;\n text-fill: #444;\n text-spacing: 256;\n text-min-distance: 5;\n text-character-spacing: @text_character_spacing_sm;\n text-avoid-edges: true;\n text-halo-fill: @label_color_transport_halo;\n text-halo-radius: @text_font_halo_radius_md;\n\n [kind='major_road'] {\n text-size: @text_font_size_xxsm; \n } \n\n [zoom>=13] {\n text-size: @text_font_size_xxsm;\n \n [kind='major_road'] {\n text-size: @text_font_size_xxsm * 1.2; \n }\n }\n\n [zoom>=14] {\n text-min-distance: 10;\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_md;\n text-halo-radius: @text_font_halo_radius_large;\n \n [kind='major_road'] {\n text-size: @text_font_size_sm * 1.2; \n } \n }\n\n [zoom>=16]{\n text-min-distance: 100;\n text-character-spacing: @text_character_spacing_lg;\n }\n}\n\n#highway_shields {\n [zoom>=11],\n [highway='motorway'],\n [highway='trunk'],\n [highway='primary'] {\n \/\/ default rectangle shield\n shield-file: url(shields\/default.svg);\n shield-fill: @label_color_shield_fed; \n shield-transform: scale(0.2,0.2);\n shield-face-name: @text_font_shield;\n shield-name: [ref];\n shield-size: 10;\n shield-min-distance: 44;\n shield-spacing: 20;\n \/\/ half the width of the shield to prevent from wrapping\n shield-min-padding: 10;\n\n [ref=~'I \\d+'] {\n shield-file: url(shields\/interstate_2.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 65;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 15;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'I \\d{3,}'] {\n shield-file: url(shields\/interstate_3.svg);\n shield-transform: scale(0.033, 0.033);\n shield-fill: @label_color_shield;\n shield-size: 9;\n shield-name: \"[ref].replace('I ', '')\";\n\n [zoom>=13] {\n shield-size: 11;\n shield-transform: scale(0.038, 0.038);\n shield-min-distance: 40;\n }\n\n [zoom>=15] {\n shield-size: 13;\n shield-transform: scale(0.045, 0.045);\n }\n\n [zoom>=17] {\n shield-size: 13;\n shield-transform: scale(0.05, 0.05);\n } \n }\n\n [ref=~'US \\d+'] {\n shield-file: url(shields\/us.svg);\n shield-transform: scale(0.062, 0.062);\n shield-size: 10;\n shield-name: \"[ref].replace('US ', '')\";\n shield-fill: @label_color_shield_fed;\n shield-text-dy: 1;\n shield-character-spacing: -1;\n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.075, 0.075);\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.088, 0.088);\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.091, 0.091);\n } \n }\n\n [ref=~'CA \\d+'] {\n shield-file: url(shields\/ca.svg);\n shield-fill: @label_color_shield;\n shield-transform: scale(0.052, 0.052);\n shield-size: 10;\n shield-name: \"[ref].replace('CA ', '')\";\n shield-dy: -2.5;\n shield-character-spacing: -1;\n\n [zoom>=13] {\n shield-size: 12;\n shield-transform: scale(0.060, 0.060);\n shield-min-distance: 50;\n }\n\n [zoom>=14] {\n shield-min-distance: 80;\n }\n\n [zoom>=15] {\n shield-size: 14;\n shield-transform: scale(0.080, 0.080);\n shield-dy: -3.5;\n }\n\n [zoom>=17] {\n shield-size: 16;\n shield-transform: scale(0.090, 0.090); \n } \n }\n }\n}\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: [name];\n \n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n \n text-face-name: @text_font_water_bold;\n text-wrap-width: 40;\n text-wrap-character: ' ';\n text-size: @text_font_size_sm;\n text-character-spacing: @text_character_spacing_xlg;\n text-align: center;\n\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][scalerank<4][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][scalerank<7][changed!='']\n{\n text-name: [name];\n\n [namealt!=''] {\n text-name: [name] + '\\n(' + [namealt] + ')';\n }\n\n [name = 'Hecate Straight'] {\n text-name: 'Hecate Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n [name = 'Queen Charlotte Straight'] {\n text-name: 'Queen Charlotte Strait' + [namealt]; \/\/ Becase we know namealt is empty\n }\n\n text-face-name: @text_font_water_bold;\n text-wrap-width: 50;\n text-size: @text_font_size_medium;\n text-character-spacing: @text_character_spacing_lg;\n text-fill: @label_color_water;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_water_halo;\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: \"[name]\";\n text-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_water;\n text-halo-fill: @label_color_water_halo;\n text-size: @text_font_size_xsm;\n\n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40;\n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=8][area>100000000],\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>5000000],\n [zoom=12][area>1000000],\n [zoom=13][area>400000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n text-name: [name];\n text-face-name: @text_font_parks;\n text-placement: interior;\n text-wrap-width: 96;\n text-wrap-before: true;\n text-line-spacing: -3;\n text-fill: @label_color_green_area;\n text-size: 15;\n\n [zoom>=8] {\n text-halo-fill: @label_color_green_area_halo;\n text-halo-radius: @text_font_halo_radius_sm; \n }\n\n [zoom>=11] {\n text-fill: #586e50;\n text-halo-radius: @text_font_halo_radius_large;\n }\n\n [zoom>=15] {\n text-size: 20;\n text-line-spacing: -7;\n }\n }\n}\n\n#continents\n{\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-wrap-width: 32;\n text-size: 24;\n text-line-spacing: -12;\n text-fill: #2e2115;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n}\n\n#admin1-labels { \n \/\/ [zoom>=4][scalerank<3],\n [zoom>=5][scalerank<3][admin!='United States of America'][admin!='Canada'],\n [zoom>=6][scalerank<5],\n [zoom>=7][scalerank>=5] {\n text-name: [name];\n text-transform: uppercase;\n text-face-name: @text_font_administrative; \n text-face-name: @text_font_administrative;\n text-fill: @label_color_administrative;\n text-halo-fill: @label_color_halo_low;\n text-halo-radius: @text_font_halo_radius_sm;\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n text-wrap-width: 40;\n text-placement-type: simple;\n text-placements: 'E,N,W,S';\n \n [zoom>=5] {\n text-size: @text_font_size_sm; \n }\n\n [zoom>=6] {\n text-size: @text_font_size_medium;\n text-character-spacing: 2;\n }\n\n [zoom>=7] {\n text-size: @text_font_size_large;\n text-character-spacing: 3;\n } \n }\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n text-character-spacing: 1;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80; \n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n \/\/ text-halo-comp-op: overlay; \n text-halo-rasterizer: fast;\n text-name: \"[label_z5]\";\n text-size: @text_font_size_sm;\n text-character-spacing: 1;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_medium;\n text-character-spacing: 2;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n text-character-spacing: 3;\n}\n\n\/* Admin 0 labels *\/\n\n#admin0-labels-z3[longfrom>3] {\n text-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_sm;\n text-size: @text_font_size_medium_plus;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n text-min-distance: 5;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n text-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-size: @text_font_size_large;\n text-line-spacing: -8;\n text-wrap-width: 100;\n text-character-spacing: @text_character_spacing_sm;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low;\n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z4 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_lg;\n text-size: @text_font_size_large;\n text-min-distance: 15;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z5 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xlg;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n#admin0-labels-z6 {\n text-name: [name];\n text-face-name: @text_font_administrative;\n text-transform: uppercase;\n text-wrap-width: 80;\n text-character-spacing: @text_character_spacing_xlg;\n text-size: @text_font_size_xxlg;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_halo_low; \n text-fill: @label_color_administrative;\n}\n\n\/* city labels *\/\n\n#aries-places-labels {\n [zoom=4][scalerank<5],\n [zoom=5][scalerank<6],\n [zoom=6][scalerank<7],\n [zoom=7][scalerank<8],\n [zoom=8][scalerank<9],\n [zoom=9][scalerank<10],\n [zoom=10][scalerank<11],\n [zoom=11][scalerank<12],\n [zoom=12][scalerank<13],\n [zoom=13][scalerank<14], \n [zoom=14][scalerank<15] \n [zoom>=15][scalerank<15]{\n\n shield-file: url(shields\/circle-12.svg);\n shield-fill: @label_color_city;\n shield-halo-fill: @label_color_halo_low;\n shield-halo-radius: @text_font_halo_radius_sm;\n shield-unlock-image: true; \n shield-transform: scale(0.5, 0.5);\n shield-face-name: @text_font_city;\n shield-name: [name]; \n shield-min-distance: 2; \n shield-placement-type: simple;\n shield-placements: 'NE, N, NW, SE, S, SW';\n shield-justify-alignment: auto;\n shield-horizontal-alignment: auto;\n\n [zoom>=4] {\n shield-size: @text_font_size_xsm;\n shield-text-dy: -7;\n \n [population>700000] {\n shield-size: @text_font_size_xsm * 1.2;\n shield-transform: scale(0.7, 0.7);\n shield-text-dy: -9;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xsm * 1.3;\n shield-transform: scale(0.8, 0.8);\n shield-text-dy: -10;\n } \n }\n\n [zoom>=5]{\n shield-size: @text_font_size_sm; \n shield-text-dy: -7; \n \n [population>700000] {\n shield-size: @text_font_size_sm * 1.2;\n shield-text-dy: -9;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_sm * 1.3;\n } \n }\n\n [zoom>=6]{\n shield-size: @text_font_size_medium; \n shield-text-dy: -8;\n\n [population>700000] {\n shield-size: @text_font_size_medium * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium * 1.5;\n } \n }\n\n [zoom>=8] {\n shield-halo-radius: @text_font_halo_radius_md;\n }\n\n [zoom>=10]{\n shield-size: @text_font_size_medium_plus; \n shield-halo-radius: @text_font_halo_radius_large;\n shield-halo-fill: @label_color_halo_high;\n \n [population>700000] {\n shield-size: @text_font_size_medium_plus * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_medium_plus * 1.3;\n } \n }\n\n [zoom>=11] {\n shield-opacity: 0;\n }\n\n [zoom>=12] {\n shield-size: @text_font_size_xlg;\n \n [population>700000] {\n shield-size: @text_font_size_xlg * 1.2;\n }\n\n [population>7000000] {\n shield-size: @text_font_size_xlg * 1.3;\n } \n }\n }\n}\n\n#airports {\n [zoom>=10] {\n text-name: [abbrev];\n text-face-name: @text_font_transport;\n text-fill: #444;\n text-size: @text_font_size_medium_plus;\n \n text-halo-fill: @label_color_airport_halo;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-wrap-width: 128;\n text-dy: 14; \n }\n\n [zoom>=13] {\n text-name: [name];\n }\n\n [zoom=14][natlscale>.04],\n [zoom=15][natlscale>.02],\n [zoom>=16][natlscale>.01]\n {\n text-dy: 20;\n } \n\n [zoom=8][natlscale>2.3][type='major'],\n [zoom=9][natlscale>1.2][type='major'],\n [zoom=10][natlscale>0.57][type='major'],\n [zoom=11][natlscale>0.29][type='major'],\n [zoom=12][natlscale>0.29][type='major'],\n [zoom=13][natlscale>0.29][type='major']\n {\n point-file: url('icons\/airport_major_l.png');\n }\n\n [zoom=14][natlscale>.29][type='major'],\n [zoom=15][natlscale>.29][type='major'],\n [zoom>=16][natlscale>.29][type='major']\n {\n point-file: url('icons\/airport_major_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='small'],\n [zoom=9][natlscale>1.2][type='small'],\n [zoom=10][natlscale>.57][type='small'],\n [zoom=11][natlscale>.29][type='small'],\n [zoom=12][natlscale>.29][type='small'],\n [zoom=13][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_l.png');\n }\n\n [zoom=14][natlscale>.29][type='small'],\n [zoom=15][natlscale>.29][type='small'],\n [zoom>=16][natlscale>.29][type='small']\n {\n point-file: url('icons\/airport_small_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='military'],\n [zoom=9][natlscale>1.2][type='military'],\n [zoom=10][natlscale>.57][type='military'],\n [zoom=11][natlscale>.29][type='military'],\n [zoom=12][natlscale>.29][type='military'],\n [zoom=13][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_l.png');\n }\n\n [zoom=14][natlscale>.29][type='military'],\n [zoom=15][natlscale>.29][type='military'],\n [zoom>=16][natlscale>.29][type='military']\n {\n point-file: url('icons\/airport_military_xl.png');\n }\n\n [zoom=8][natlscale>2.3][type='spaceport'],\n [zoom=9][natlscale>1.2][type='spaceport'],\n [zoom=10][natlscale>.57][type='spaceport'],\n [zoom=11][natlscale>.29][type='spaceport'],\n [zoom=12][natlscale>.29][type='spaceport'],\n [zoom=13][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_l.png');\n }\n\n [zoom=14][natlscale>.29][type='spaceport'],\n [zoom=15][natlscale>.29][type='spaceport'],\n [zoom>=16][natlscale>.29][type='spaceport']\n {\n point-file: url('icons\/intergalactic_xl.png');\n }\n}\n\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"5e067016c481d24651209e1a8eaf59d9a5c9b4e4","subject":"Move filename dialog to DoExport() and return filename","message":"Move filename dialog to DoExport() and return filename\n\nLike this, project specific export plugins can more easily use the standard\nsibmei behavior for determining file names. The returned file name can also\nbe used to trigger postprocessing for the exported file.\n","repos":"music-encoding\/sibmei","old_file":"src\/Run.mss","new_file":"src\/Run.mss","new_contents":"function Run() {\n \/\/$module(Run.mss)\n\n \/\/ do some preliminary checks\n if (Sibelius.ProgramVersion < 7000)\n {\n Sibelius.MessageBox(_VersionNotSupported);\n return False;\n }\n\n if (Sibelius.ScoreCount = 0)\n {\n Sibelius.MessageBox(_ScoreError);\n return False;\n }\n\n DoExport(null);\n\n} \/\/$end\n\n\nfunction GetExportFileName () {\n \/\/ get the active score object\n activeScore = Sibelius.ActiveScore;\n\n if (Sibelius.FileExists(activeScore.FileName)) {\n scoreFile = Sibelius.GetFile(activeScore.FileName);\n activeFileName = scoreFile.NameNoPath & '.mei';\n activePath = scoreFile.Path;\n } else {\n activeFileName = 'untitled.mei';\n activePath = Sibelius.GetDocumentsFolder();\n }\n\n if (not InitGlobals(null))\n {\n return null;\n }\n\n \/\/ Ask to the file to be saved somewhere\n filename = Sibelius.SelectFileToSave('Save as...', activeFileName, activePath, 'mei', 'TEXT', 'Music Encoding Initiative');\n\n return filename;\n} \/\/$end\n\n\nfunction DoExport (filename) {\n \/\/$module(Run.mss)\n\n \/\/ Argument filename is optional and will be determined automatically if\n \/\/ `null` is passed in instead. The filename is also returned so the\n \/\/ caller can then work with.\n if (null = filename)\n {\n filename = GetExportFileName();\n if (null = filename)\n {\n Sibelius.MessageBox(_ExportFileIsNull);\n return null;\n }\n }\n\n if (not Self._property:_Initialized)\n {\n Trace('InitGlobals() must be called before running DoExport()');\n return null;\n }\n\n \/\/ first, ensure we're running with a clean slate.\n \/\/ (initialization of libmei has moved to InitGlobals())\n libmei.destroy();\n\n \/\/ set the active score here so we can refer to it throughout the plugin\n Self._property:ActiveScore = Sibelius.ActiveScore;\n if (Self._property:ActiveScore = null)\n {\n Sibelius.MessageBox('Could not find an active score. Cannot export to ' & filename);\n return false;\n }\n\n \/\/ Set up the warnings tracker\n Self._property:warnings = CreateSparseArray();\n\n \/\/ Deal with the Progress GUI\n progCount = Sibelius.ActiveScore.SystemStaff.BarCount;\n fn = utils.ExtractFileName(filename);\n progressTitle = utils.Format(_InitialProgressTitle, fn);\n Sibelius.CreateProgressDialog(progressTitle, 0, progCount - 1);\n\n \/\/ finally, process the score.\n ProcessScore();\n\n doc = libmei.getDocument();\n \/\/ save the file\n export_status = libmei.meiDocumentToFile(doc, filename);\n\n \/\/ start cleaning up.\n Sibelius.DestroyProgressDialog();\n\n \/\/ display the warnings that were registered during the export process\n for each warning in Self._property:warnings\n {\n trace('Warning: ' & warning);\n }\n\n if (export_status = False)\n {\n Sibelius.MessageBox(_ExportFailure);\n }\n\n \/\/ clean up after ourself\n libmei.destroy();\n\n return filename;\n} \/\/$end\n","old_contents":"function Run() {\n \/\/$module(Run.mss)\n\n \/\/ do some preliminary checks\n if (Sibelius.ProgramVersion < 7000)\n {\n Sibelius.MessageBox(_VersionNotSupported);\n return False;\n }\n\n if (Sibelius.ScoreCount = 0)\n {\n Sibelius.MessageBox(_ScoreError);\n return False;\n }\n\n \/\/ get the active score object\n activeScore = Sibelius.ActiveScore;\n\n if (Sibelius.FileExists(activeScore.FileName)) {\n scoreFile = Sibelius.GetFile(activeScore.FileName);\n activeFileName = scoreFile.NameNoPath & '.mei';\n activePath = scoreFile.Path;\n } else {\n activeFileName = 'untitled.mei';\n activePath = Sibelius.GetDocumentsFolder();\n }\n\n if (not InitGlobals(null))\n {\n return false;\n }\n\n \/\/ Ask to the file to be saved somewhere\n filename = Sibelius.SelectFileToSave('Save as...', activeFileName, activePath, 'mei', 'TEXT', 'Music Encoding Initiative');\n\n if (filename = null)\n {\n Sibelius.MessageBox(_ExportFileIsNull);\n return False;\n }\n\n DoExport(filename);\n\n} \/\/$end\n\nfunction DoExport (filename) {\n \/\/$module(Run.mss)\n\n if (not Self._property:_Initialized)\n {\n Trace('InitGlobals() must be called before running DoExport()');\n return null;\n }\n\n \/\/ first, ensure we're running with a clean slate.\n \/\/ (initialization of libmei has moved to InitGlobals())\n libmei.destroy();\n\n \/\/ set the active score here so we can refer to it throughout the plugin\n Self._property:ActiveScore = Sibelius.ActiveScore;\n if (Self._property:ActiveScore = null)\n {\n Sibelius.MessageBox('Could not find an active score. Cannot export to ' & filename);\n return false;\n }\n\n \/\/ Set up the warnings tracker\n Self._property:warnings = CreateSparseArray();\n\n \/\/ Deal with the Progress GUI\n progCount = Sibelius.ActiveScore.SystemStaff.BarCount;\n fn = utils.ExtractFileName(filename);\n progressTitle = utils.Format(_InitialProgressTitle, fn);\n Sibelius.CreateProgressDialog(progressTitle, 0, progCount - 1);\n\n \/\/ finally, process the score.\n ProcessScore();\n\n doc = libmei.getDocument();\n \/\/ save the file\n export_status = libmei.meiDocumentToFile(doc, filename);\n\n \/\/ start cleaning up.\n Sibelius.DestroyProgressDialog();\n\n \/\/ display the warnings that were registered during the export process\n for each warning in Self._property:warnings\n {\n trace('Warning: ' & warning);\n }\n\n if (export_status = False)\n {\n Sibelius.MessageBox(_ExportFailure);\n }\n\n \/\/ clean up after ourself\n libmei.destroy();\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"ee15b32f557c1ba837a070b9b6ea811868c9bf66","subject":"Fix label positions on the progress map for concave polygons.","message":"Fix label positions on the progress map for concave polygons.\n\nSome of the neighborhood polygons on the progress map have centroids that\nlie outside the polygon, which leads to their percentage label being\nplaced inside a different neighborhood (which will then have two labels).\n\nBy adding `text-placement: interior` to the CartoCSS, we tell Mapnik to\nprefer placing labels on the interior of polygons if the centroid is not\ninside the poygon.\n","repos":"maurizi\/nyc-trees,kdeloach\/nyc-trees,kdeloach\/nyc-trees,maurizi\/nyc-trees,kdeloach\/nyc-trees,azavea\/nyc-trees,maurizi\/nyc-trees,azavea\/nyc-trees,azavea\/nyc-trees,maurizi\/nyc-trees,azavea\/nyc-trees,kdeloach\/nyc-trees,kdeloach\/nyc-trees,azavea\/nyc-trees","old_file":"src\/tiler\/style\/progress.mss","new_file":"src\/tiler\/style\/progress.mss","new_contents":"\/* If you change these colors, also change src\/nyc_trees\/sass\/partials\/_legend.scss *\/\n@mapped: #8BC34A;\n@not-mapped: #85664B;\n@not-mapped-zoomed-out: #85664B;\n\n#survey_blockface {\n line-join: round;\n line-cap: round;\n\n line-opacity: 1;\n\n \/\/ Note: this must be kept in sync with src\/nyc_trees\/js\/src\/BlockfaceLayer.js\n line-width: 1;\n [zoom = 16]{ line-width: 2; }\n [zoom = 17]{ line-width: 4; }\n [zoom = 18]{ line-width: 8; }\n [zoom = 19]{ line-width: 16; }\n\n [is_mapped = 'T'] {\n line-color: @mapped;\n [zoom <= 17]{ line-width: 6; }\n }\n [is_mapped = 'F'] {\n line-color: @not-mapped;\n [zoom <= 15]{\n line-color: @not-mapped-zoomed-out;\n }\n }\n}\n\n\/* If you change these colors, also change src\/nyc_trees\/sass\/partials\/_legend.scss *\/\n#survey_borough,#survey_neighborhoodtabulationarea {\n line-color: #555;\n line-width: 1;\n polygon-opacity: 0.50;\n polygon-fill: #fff;\n [percent >= 10] { polygon-fill: #F6F9F4 }\n [percent >= 20] { polygon-fill: #D7EBC7 }\n [percent >= 30] { polygon-fill: #B8DD9B }\n [percent >= 40] { polygon-fill: #99CF6F }\n [percent >= 50] { polygon-fill: #7AC143 }\n [percent >= 60] { polygon-fill: #5BA63B }\n [percent >= 70] { polygon-fill: #3D8C33 }\n [percent >= 80] { polygon-fill: #1E722B }\n [percent >= 90] { polygon-fill: #005824 }\n}\n\n\/*\n\nRunning this command in the windshaft module directory will list available fonts\nnode -e \"var m=require('mapnik');m.register_system_fonts();console.log(m.fontFiles())\"\n\n*\/\n\n#survey_borough::labels,\n#survey_neighborhoodtabulationarea::labels {\n text-name: '[label]';\n text-face-name: 'DejaVu Sans Bold';\n text-fill: #000;\n text-size: 12;\n text-halo-fill: fadeout(#fff, 30%);\n text-halo-radius: 2;\n text-placement: interior;\n}\n","old_contents":"\/* If you change these colors, also change src\/nyc_trees\/sass\/partials\/_legend.scss *\/\n@mapped: #8BC34A;\n@not-mapped: #85664B;\n@not-mapped-zoomed-out: #85664B;\n\n#survey_blockface {\n line-join: round;\n line-cap: round;\n\n line-opacity: 1;\n\n \/\/ Note: this must be kept in sync with src\/nyc_trees\/js\/src\/BlockfaceLayer.js\n line-width: 1;\n [zoom = 16]{ line-width: 2; }\n [zoom = 17]{ line-width: 4; }\n [zoom = 18]{ line-width: 8; }\n [zoom = 19]{ line-width: 16; }\n\n [is_mapped = 'T'] {\n line-color: @mapped;\n [zoom <= 17]{ line-width: 6; }\n }\n [is_mapped = 'F'] {\n line-color: @not-mapped;\n [zoom <= 15]{\n line-color: @not-mapped-zoomed-out;\n }\n }\n}\n\n\/* If you change these colors, also change src\/nyc_trees\/sass\/partials\/_legend.scss *\/\n#survey_borough,#survey_neighborhoodtabulationarea {\n line-color: #555;\n line-width: 1;\n polygon-opacity: 0.50;\n polygon-fill: #fff;\n [percent >= 10] { polygon-fill: #F6F9F4 }\n [percent >= 20] { polygon-fill: #D7EBC7 }\n [percent >= 30] { polygon-fill: #B8DD9B }\n [percent >= 40] { polygon-fill: #99CF6F }\n [percent >= 50] { polygon-fill: #7AC143 }\n [percent >= 60] { polygon-fill: #5BA63B }\n [percent >= 70] { polygon-fill: #3D8C33 }\n [percent >= 80] { polygon-fill: #1E722B }\n [percent >= 90] { polygon-fill: #005824 }\n}\n\n\/*\n\nRunning this command in the windshaft module directory will list available fonts\nnode -e \"var m=require('mapnik');m.register_system_fonts();console.log(m.fontFiles())\"\n\n*\/\n\n#survey_borough::labels,\n#survey_neighborhoodtabulationarea::labels {\n text-name: '[label]';\n text-face-name: 'DejaVu Sans Bold';\n text-fill: #000;\n text-size: 12;\n text-halo-fill: fadeout(#fff, 30%);\n text-halo-radius: 2;\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"CartoCSS"} {"commit":"78d1f4ab97d6113a0d0db933dacdf160eb430c1c","subject":"New: Method to convert Units to typographic points","message":"New: Method to convert Units to typographic points\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportConverters.mss","new_file":"src\/ExportConverters.mss","new_contents":"\nfunction ConvertClef (clefid) {\n \/\/$module(ExportConverters.mss)\n clefparts = MSplitString(clefid, '.');\n shape = ' ';\n line = ' ';\n dis = ' ';\n dir = ' ';\n\n switch(clefparts[2])\n {\n case ('down')\n {\n dir = 'below';\n }\n case ('up')\n {\n dir = 'above';\n }\n }\n\n switch(clefparts[3])\n {\n case ('8')\n {\n dis = '8';\n }\n case ('15')\n {\n dis = '15';\n }\n }\n switch (clefparts[1]) {\n case ('bass')\n {\n shape = 'F';\n line = '4';\n }\n case ('treble')\n {\n if (clefparts[4] = 'old')\n {\n shape = 'GG';\n }\n else\n {\n shape = 'G';\n }\n line = '2';\n }\n case ('tenor')\n {\n shape = 'C';\n line = '4';\n }\n case ('alto')\n {\n shape = 'C';\n line = '3';\n }\n case ('soprano')\n {\n shape = 'C';\n if (clefparts[2] = 'mezzo')\n {\n line = '2';\n }\n else\n {\n line = '1';\n }\n }\n case ('baritone')\n {\n if (clefparts[2] = 'c')\n {\n shape = 'C';\n line = '5';\n }\n else\n {\n shape = 'F';\n line = '3';\n }\n }\n case ('violin')\n {\n shape = 'G';\n line = '1';\n }\n case ('sub-bass')\n {\n shape = 'F';\n line = '5';\n }\n case ('tab')\n {\n shape = 'TAB';\n }\n case (('percussion') or ('percussion_2'))\n {\n shape = 'perc';\n }\n }\n ret = CreateSparseArray(shape, line, dis, dir);\n return ret;\n} \/\/$end\n\nfunction ConvertOctava (octava_id) {\n \/\/$module(ExportConverters.mss)\n octparts = MSplitString(octava_id, '.');\n switch(octparts[3])\n {\n case ('minus15')\n {\n dis = '15';\n place = 'below';\n }\n case ('minus8')\n {\n dis = '8';\n place = 'below';\n }\n case ('plus15')\n {\n dis = '15';\n place = 'above';\n }\n case ('plus8')\n {\n dis = '8';\n place = 'above';\n }\n default\n {\n dis = ' ';\n place = ' ';\n }\n }\n return CreateSparseArray(dis, place);\n} \/\/$end\n\nfunction ConvertSlur (slur_value) {\n \/\/$module(ExportConverters.mss)\n slurparts = MSplitString(slur_value, '.');\n direction = ' ';\n style = ' ';\n switch(slurparts[3])\n {\n case ('up')\n {\n direction = 'above';\n }\n case ('down')\n {\n direction = 'below';\n }\n default\n {\n direction = ' ';\n }\n }\n switch(slurparts[4])\n {\n case ('dashed')\n {\n style = 'dashed';\n }\n case ('dotted')\n {\n style = 'dotted';\n }\n default\n {\n style = ' ';\n }\n }\n return CreateSparseArray(direction, style);\n} \/\/$end\n\nfunction ConvertDiatonicPitch (diatonic_pitch) {\n \/\/$module(ExportConverters)\n octv = (diatonic_pitch \/ 7) - 1;\n pnames = CreateSparseArray('c', 'd', 'e', 'f', 'g', 'a', 'b');\n idx = (diatonic_pitch % 7);\n pname = pnames[idx];\n\n return CreateSparseArray(pname, octv);\n} \/\/$end\n\nfunction ConvertOffsetsToMillimeters (offset) {\n \/\/$module(ExportConverters.mss)\n\n \/*\n This function will convert the 1\/32 unit \n Sibelius offsets into a millimeter measurement as required by the \n data.MEASUREMENT datatype used by MEI.\n\n The `StaffHeight` property always returns the staff height in millimeters.\n\n Most offsets are given in Sibelius Units, which\n are defined as 1\/32 of a space. A space is 1\/4 of the staff height, so\n the staff height is always 128. A unit is therefore:\n ((staffheight \/ 128) = units in mm.\n\n So a staff height of 7mm (default) gives us (7 \/ 128) = 0.05mm per Sibelius\n Unit.\n *\/\n scr = Sibelius.ActiveScore;\n staffheight = scr.StaffHeight;\n factor = (staffheight \/ 128.0);\n oset = factor * offset;\n retval = oset & 'mm';\n return retval;\n} \/\/$end\n\nfunction ConvertUnitsToPoints (units) {\n \/\/$module(ExportConverters.mss)\n scr = Sibelius.ActiveScore;\n staffheight = scr.StaffHeight;\n\n \/*\n Points are 0.352778mm (a point is 1\/72 of an inch * 25.4mm\/in).\n *\/\n retval = (((staffheight \/ 128.0) * units) \/ 0.352778;\n return retval & 'pt';\n} \/\/$end\n\nfunction ConvertDuration (dur) {\n \/\/$module(ExportConverters.mss)\n \/\/ there doesn't really seem to be a smarter way to do this...\n \/\/ 1024 = 1 whole note\n\n ret = CreateSparseArray();\n\n pow = PrevPow2(dur);\n counter = pow;\n dots = 0;\n powcount = pow;\n durset = false;\n\n durrem = 1024 % dur;\n if (durrem != 0)\n {\n while (counter < dur)\n {\n powcount = (powcount \/ 2);\n counter = counter + powcount;\n dots = dots + 1;\n\n if (dots > 5)\n {\n \/\/ prevent a runaway loop.\n counter = 1000000000;\n }\n }\n }\n\n switch (powcount)\n {\n case (pow >= 4096)\n {\n ret[0] = 'long';\n durset = true;\n }\n case (pow >= 2048)\n {\n ret[0] = 'breve';\n durset = true;\n }\n default\n {\n if (durset = false)\n {\n ret[0] = 1024 \/ pow;\n }\n }\n }\n\n if (dots = 0)\n {\n ret[1] = ' ';\n }\n else\n {\n ret[1] = dots;\n }\n\n return ret;\n} \/\/$end\n\nfunction ConvertKeySignature (numsharps) {\n \/\/$module(ExportConverters.mss)\n switch (numsharps)\n {\n case (0)\n {\n \/\/ key of c\n return '0';\n }\n case (-8)\n {\n \/\/ atonal in Sibelius\n return '0';\n }\n case (numsharps > 0)\n {\n \/\/ sharps\n return numsharps & 's';\n }\n case (numsharps < 0)\n {\n \/\/flats\n return utils.AbsoluteValue(numsharps) & 'f';\n }\n }\n} \/\/$end\n\nfunction PitchesInKeySignature (keysig) {\n \/\/$module(ExportConverters.mss)\n\n \/\/ keysig is 7 >= 0 >= -7, for the number of sharps (negative is flats)\n ac = CreateSparseArray('F', 'C', 'G', 'D', 'A', 'E', 'B');\n if (keysig = 0)\n {\n return CreateSparseArray();\n }\n\n if (keysig > 0)\n {\n return ac.Slice(0, keysig);\n }\n else\n {\n v = ac.Slice(keysig);\n v.Reverse();\n return v;\n }\n} \/\/$end\n\nfunction ConvertAccidental (noteobj) {\n \/\/$module(ExportConverters.mss)\n \/\/ If accidentals are audible, but not visible, you get @accid.ges\n \/\/ If accidentals are both audible and visible, you get @accid\n \/\/ is_visible is not to be confused with hidden accidentals! is_visible\n \/\/ just determines whether an accidental is shown or not based on \n \/\/ the rules of CMN.\n\n \/\/ Returns a tuple [0 => accid (string), 1 => is_visible (bool)]\n \/\/ If the accidental is a natural and is visible, returns ('n', true); otherwise,\n \/\/ it returns ('', false);\n\n \/\/ first, determine if the accidental is visible.\n is_visible = HasVisibleAccidental(noteobj);\n ac = ' ';\n\n pname = Substring(noteobj.Name, 0, 1); \/\/ captures first letter\n accid = Substring(noteobj.Name, 1); \/\/ captures all other characters\n\n switch(accid)\n {\n case('bb')\n {\n ac = 'ff';\n }\n case('b-')\n {\n ac = 'fd';\n }\n case('b')\n {\n ac = 'f';\n }\n case('-')\n {\n ac = 'fu';\n }\n case('')\n {\n if (is_visible = True)\n {\n ac = 'n';\n }\n }\n case('+')\n {\n ac = 'sd';\n }\n case('#')\n {\n ac = 's';\n }\n case('#+')\n {\n ac = 'su';\n }\n case('x')\n {\n ac = 'x';\n }\n case('##')\n {\n ac = 'ss';\n }\n }\n\n ret = CreateSparseArray(ac, is_visible);\n return ret;\n} \/\/$end\n\nfunction HasVisibleAccidental (noteobj) {\n \/\/$module(ExportConverters.mss)\n \/\/ determines whether a note is *likely* to have a visible accidental.\n \/\/ Caution: This is probably not 100% accurate.\n\n \/\/ Returns a boolean if the note is visible.\n\n \/\/ If it has a cautionary accidental, it's most likely to be visible.\n if (noteobj.AccidentalStyle = CautionaryAcc)\n {\n return True;\n }\n\n if (noteobj.AccidentalStyle = HiddenAcc)\n {\n return False;\n }\n\n keysig = noteobj.ParentNoteRest.ParentBar.GetKeySignatureAt(noteobj.ParentNoteRest.Position);\n sf = sibmei2.PitchesInKeySignature(keysig.Sharps);\n pname = Substring(noteobj.Name, 0, 1); \/\/ captures first letter\n accid = Substring(noteobj.Name, 1); \/\/ captures all other characters\n\n \/\/ if the note is not in the key signature, then it should have an accidental\n note_is_in_keysig = utils.IsInArray(sf, pname);\n has_prev_pitch_with_accidental = False;\n\n parent_nr = noteobj.ParentNoteRest;\n parent_bar = parent_nr.ParentBar;\n\n for each NoteRest nr in parent_bar\n {\n if (nr.Position < parent_nr.Position)\n {\n for each n in nr\n {\n pname2 = Substring(n.Name, 0, 1); \/\/ captures first letter\n accid2 = Substring(n.Name, 1); \/\/ captures all other characters\n\n if (n.Name = noteobj.Name and note_is_in_keysig = False and n.Accidental != 0)\n {\n has_prev_pitch_with_accidental = True;\n }\n\n if (n.Name = noteobj.Name and n.AccidentalStyle = CautionaryAcc)\n {\n has_prev_pitch_with_accidental = True;\n }\n\n if (n.Name = noteobj.Name and note_is_in_keysig = True)\n {\n has_prev_pitch_with_accidental = False;\n }\n\n \/\/ this is a special case for dealing with naturals. If the pitch names\n \/\/ match, and the note is not in the key signature, and the previous pitch\n \/\/ was not empty, then we probably have a natural on the query note.\n if (pname = pname2 and note_is_in_keysig = False and accid2 != '')\n {\n has_prev_pitch_with_accidental = True;\n }\n\n }\n }\n else\n {\n for each n in nr\n {\n if (n.Name = noteobj.Name and n.Accidental != 0 and note_is_in_keysig = True)\n {\n has_prev_pitch_with_accidental = False;\n }\n }\n }\n }\n\n \/\/ deal with the 'weird' accidental values that don't have a value in noteobj.Accidental\n switch (accid)\n {\n case ('bb')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('b-')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('-')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('+')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('#+')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n }\n\n if (noteobj.Accidental = 0 and note_is_in_keysig = True and has_prev_pitch_with_accidental = False)\n {\n \/\/ it's a natural?\n return True;\n }\n\n if (note_is_in_keysig = True and has_prev_pitch_with_accidental = False)\n {\n return False;\n }\n\n if (has_prev_pitch_with_accidental = False and noteobj.Accidental != 0)\n {\n return True;\n }\n \n if (has_prev_pitch_with_accidental = True and accid = '')\n {\n \/\/ this is the corresponding return value for special cased naturals.\n return True;\n }\n\n \/\/ Finally, by default, assume this has no accidental.\n return False;\n} \/\/$end\n\nfunction ConvertNamedTimeSignature (timesig) {\n \/\/$module(ExportConverters.mss)\n switch(timesig)\n {\n case(CommonTimeString)\n {\n return 'common';\n }\n case(AllaBreveTimeString)\n {\n return 'cut';\n }\n default\n {\n return ' ';\n }\n }\n} \/\/$end\n\nfunction ConvertBracket (bracket) {\n \/\/$module(ExportConverters.mss)\n switch(bracket)\n {\n case(BracketFull)\n {\n return 'bracket';\n }\n case(BracketBrace)\n {\n return 'brace';\n }\n case(BracketSub)\n {\n return 'line';\n }\n default\n {\n return 'none';\n }\n }\n} \/\/$end\n\nfunction ConvertSibeliusStructure (score) {\n \/\/$module(ExportConverters.mss)\n \/\/ Takes in the Staff\/Bar Sibelius Structure and returns a Bar\/Staff\n \/\/ mapping for our MEI writers.\n bar_to_staff = CreateDictionary();\n\n \/\/ Invert the Sibelius structure\n for each Staff s in score\n {\n for each Bar b in s\n {\n if (bar_to_staff.PropertyExists(b.BarNumber))\n {\n bar_to_staff[b.BarNumber].Push(s.StaffNum);\n }\n else\n {\n bar_to_staff[b.BarNumber] = CreateSparseArray();\n bar_to_staff[b.BarNumber].Push(s.StaffNum);\n }\n }\n }\n return bar_to_staff;\n} \/\/$end\n\nfunction ConvertColor (nrest) {\n \/\/$module(ExportConverters.mss)\n r = nrest.ColorRed;\n g = nrest.ColorGreen;\n b = nrest.ColorBlue;\n a_dec = nrest.ColorAlpha & '.0';\n a = a_dec \/ 255.0;\n\n return 'rgba(' & r & ',' & g & ',' & b & ',' & a & ')';\n} \/\/$end\n\nfunction ConvertNoteStyle (style) {\n \/\/$module(ExportConverters.mss)\n noteStyle = ' ';\n\n if (style = NormalNoteStyle)\n {\n return ' ';\n }\n\n switch (style)\n {\n case (CrossNoteStyle)\n {\n noteStyle = 'cross';\n }\n case (DiamondNoteStyle)\n {\n noteStyle = 'diamond';\n }\n case (CrossOrDiamondNoteStyle)\n {\n \/\/ Sibelius uses this for percussion\n \/\/ and does not differentiate in the \n \/\/ head style, so we have to choose one\n \/\/ or the other.\n noteStyle = 'cross';\n }\n case (BlackAndWhiteDiamondNoteStyle)\n {\n noteStyle = 'filldiamond';\n }\n case (SlashedNoteStyle)\n {\n noteStyle = 'addslash';\n }\n case (BackSlashedNoteStyle)\n {\n noteStyle = 'addbackslash';\n }\n case (ArrowDownNoteStyle)\n {\n \/\/ this is not completely correct, since\n \/\/ we use the same value for up and down\n \/\/ iso triangles. But it's all we have for now.\n noteStyle = 'isotriangle';\n }\n case (ArrowUpNoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (InvertedTriangleNoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (ShapedNote1NoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (ShapedNote2NoteStyle)\n {\n noteStyle = 'semicircle';\n }\n case (ShapedNote3NoteStyle)\n {\n noteStyle = 'diamond';\n }\n case (ShapedNote4StemUpNoteStyle)\n {\n noteStyle = 'rtriangle';\n }\n case (ShapedNote4StemDownNoteStyle)\n {\n noteStyle = 'rtriangle';\n }\n case (ShapedNote5NoteStyle)\n {\n \/\/ this looks normal...\n noteStyle = ' ';\n }\n case (ShapedNote6NoteStyle)\n {\n \/\/ there is no square in MEI...\n noteStyle = ' ';\n }\n case (ShapedNote7NoteStyle)\n {\n noteStyle = 'piewedge';\n }\n }\n\n return noteStyle;\n} \/\/$end\n\nfunction ConvertSlurStyle (style) {\n \/\/$module(ExportConverters.mss)\n slurparts = MSplitString(style, '.');\n direction = ' ';\n style = ' ';\n\n switch(slurparts[3])\n {\n case ('up')\n {\n direction = 'above';\n }\n case ('down')\n {\n direction = 'below';\n }\n default\n {\n direction = ' ';\n }\n }\n switch(slurparts[4])\n {\n case ('dashed')\n {\n style = 'dashed';\n }\n case ('dotted')\n {\n style = 'dotted';\n }\n default\n {\n style = ' ';\n }\n }\n return CreateSparseArray(direction, style);\n} \/\/$end\n\nfunction ConvertPositionToTimestamp (position, bar) {\n \/\/$module(ExportConverters.mss)\n \/*\n To convert Sibelius ticks to musical timestamps\n we use the formula:\n\n tstamp = (notePosition \/ (barLength \/ beatsInBar))\n *\/\n\n \/\/ make sure we're working with floating point numbers\n \/\/ and yes, this makes me feel very, very dirty in case\n \/\/ you were wondering, but this is the only way ManuScript\n \/\/ can cast to floating point...\n barlength = bar.Length;\n timesignature = Sibelius.ActiveScore.SystemStaff.CurrentTimeSignature(bar.BarNumber);\n\n if (position = 0)\n {\n return 1;\n }\n\n barlen = barlength & '.0';\n pos = position & '.0';\n beats = timesignature.Numerator & '.0';\n unit = (barlen \/ beats);\n ret = (pos \/ unit) + 1;\n\n return ret;\n} \/\/$end\n\nfunction ConvertTupletStyle (tupletStyle) {\n \/\/$module(ExportConverters.mss)\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.addAttribute(activeTuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.addAttribute(activeTuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.addAttribute(activeTuplet, 'num.format', 'ratio');\n }\n }\n\n} \/\/$end\n\nfunction ConvertBarline (linetype) {\n \/\/$module(ExportConverters.mss)\n switch(linetype)\n {\n case (SpecialBarlineStartRepeat)\n {\n \/\/ start repeat\n return 'rptstart';\n }\n case (SpecialBarlineEndRepeat)\n {\n \/\/ end repeat\n return 'rptend';\n }\n case (SpecialBarlineDashed)\n {\n \/\/ dashed\n return 'dashed';\n }\n case (SpecialBarlineDouble)\n {\n \/\/ double\n return 'dbl';\n }\n case (SpecialBarlineFinal)\n {\n \/\/ final\n return 'end';\n }\n case (SpecialBarlineInvisible)\n {\n \/\/ invisible\n return 'invis';\n }\n case (SpecialBarlineBetweenStaves)\n {\n \/\/ between staves\n \/\/ no MEI equiv.\n return ' ';\n }\n case (SpecialBarlineNormal)\n {\n \/\/ normal\n \/\/ this should usually be needed.\n return 'single';\n }\n case (SpecialBarlineTick)\n {\n \/\/ tick\n \/\/ unknown\n return ' ';\n }\n case (SpecialBarlineShort)\n {\n \/\/ short\n \/\/ unknown\n return ' ';\n }\n default\n {\n return ' ';\n }\n }\n} \/\/$end\n\nfunction ConvertText (textobj) {\n \/\/$module(ExportConverters.mss)\n styleid = textobj.StyleId;\n switch (styleid)\n {\n case ('text.staff.expression')\n {\n dynam = libmei.Dynam();\n libmei.SetText(dynam, lstrip(textobj.Text));\n libmei.AddAttribute(dynam, 'staff', textobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(dynam, 'tstamp', ConvertPositionToTimestamp(textobj));\n\n if (textobj.Dx != 0)\n {\n libmei.AddAttribute(dynam, 'ho', ConvertOffsetsToMillimeters(textobj.Dx));\n }\n\n if (textobj.Dy != 0)\n {\n libmei.AddAttribute(dynam, 'vo', ConvertOffsetsToMillimeters(textobj.Dy));\n }\n return dynam;\n }\n case ('text.system.page_aligned.title')\n {\n return ConvertTextElement(textobj);\n }\n case ('text.system.page_aligned.composer')\n {\n return ConvertTextElement(textobj);\n }\n default\n {\n return null;\n }\n }\n} \/\/$end\n\nfunction ConvertTextElement (textobj) {\n \/\/$module(ExportConverters.mss)\n obj = libmei.AnchoredText();\n libmei.SetText(obj, lstrip(textobj.Text));\n\n if (textobj.Dx != 0)\n {\n libmei.AddAttribute(obj, 'ho', ConvertOffsetsToMillimeters(textobj.Dx));\n }\n\n if (textobj.Dy != 0)\n {\n libmei.AddAttribute(obj, 'vo', ConvertOffsetsToMillimeters(textobj.Dy));\n }\n\n return obj;\n} \/\/$end\n\nfunction ConvertEndingValues (styleid) {\n \/\/$module(ExportConverters)\n ending_style = MSplitString(styleid, '.');\n num = ' ';\n label = ' ';\n type = ' ';\n\n switch(ending_style[3])\n {\n case ('1st')\n {\n num = 1;\n label = '1.';\n type = 'closed';\n }\n case ('1st_n_2nd')\n {\n num = 1;\n label = '1. 2.';\n type = 'closed';\n }\n case ('2nd')\n {\n num = 2;\n label = '2.';\n if (ending_style[-1] = 'closed')\n {\n type = 'closed';\n }\n else\n {\n type = 'open';\n }\n }\n case ('3rd')\n {\n num = 3;\n label = '3.';\n type = 'closed';\n }\n case ('open')\n {\n type = 'open';\n }\n case ('closed')\n {\n type = 'closed';\n }\n }\n\n return CreateSparseArray(num, label, type);\n\n} \/\/$end\n\nfunction ConvertDate (datetime) {\n \/\/$module(ExportConverters.mss)\n d = datetime.DayOfMonth;\n m = datetime.Month;\n y = datetime.Year;\n\n time = datetime.TimeWithSeconds;\n\n isodate = utils.Format('%s-%s-%sT%sZ', y, m, d, time);\n\n return isodate;\n} \/\/$end\n","old_contents":"\nfunction ConvertClef (clefid) {\n \/\/$module(ExportConverters.mss)\n clefparts = MSplitString(clefid, '.');\n shape = ' ';\n line = ' ';\n dis = ' ';\n dir = ' ';\n\n switch(clefparts[2])\n {\n case ('down')\n {\n dir = 'below';\n }\n case ('up')\n {\n dir = 'above';\n }\n }\n\n switch(clefparts[3])\n {\n case ('8')\n {\n dis = '8';\n }\n case ('15')\n {\n dis = '15';\n }\n }\n switch (clefparts[1]) {\n case ('bass')\n {\n shape = 'F';\n line = '4';\n }\n case ('treble')\n {\n if (clefparts[4] = 'old')\n {\n shape = 'GG';\n }\n else\n {\n shape = 'G';\n }\n line = '2';\n }\n case ('tenor')\n {\n shape = 'C';\n line = '4';\n }\n case ('alto')\n {\n shape = 'C';\n line = '3';\n }\n case ('soprano')\n {\n shape = 'C';\n if (clefparts[2] = 'mezzo')\n {\n line = '2';\n }\n else\n {\n line = '1';\n }\n }\n case ('baritone')\n {\n if (clefparts[2] = 'c')\n {\n shape = 'C';\n line = '5';\n }\n else\n {\n shape = 'F';\n line = '3';\n }\n }\n case ('violin')\n {\n shape = 'G';\n line = '1';\n }\n case ('sub-bass')\n {\n shape = 'F';\n line = '5';\n }\n case ('tab')\n {\n shape = 'TAB';\n }\n case (('percussion') or ('percussion_2'))\n {\n shape = 'perc';\n }\n }\n ret = CreateSparseArray(shape, line, dis, dir);\n return ret;\n} \/\/$end\n\nfunction ConvertOctava (octava_id) {\n \/\/$module(ExportConverters.mss)\n octparts = MSplitString(octava_id, '.');\n switch(octparts[3])\n {\n case ('minus15')\n {\n dis = '15';\n place = 'below';\n }\n case ('minus8')\n {\n dis = '8';\n place = 'below';\n }\n case ('plus15')\n {\n dis = '15';\n place = 'above';\n }\n case ('plus8')\n {\n dis = '8';\n place = 'above';\n }\n default\n {\n dis = ' ';\n place = ' ';\n }\n }\n return CreateSparseArray(dis, place);\n} \/\/$end\n\nfunction ConvertSlur (slur_value) {\n \/\/$module(ExportConverters.mss)\n slurparts = MSplitString(slur_value, '.');\n direction = ' ';\n style = ' ';\n switch(slurparts[3])\n {\n case ('up')\n {\n direction = 'above';\n }\n case ('down')\n {\n direction = 'below';\n }\n default\n {\n direction = ' ';\n }\n }\n switch(slurparts[4])\n {\n case ('dashed')\n {\n style = 'dashed';\n }\n case ('dotted')\n {\n style = 'dotted';\n }\n default\n {\n style = ' ';\n }\n }\n return CreateSparseArray(direction, style);\n} \/\/$end\n\nfunction ConvertDiatonicPitch (diatonic_pitch) {\n \/\/$module(ExportConverters)\n octv = (diatonic_pitch \/ 7) - 1;\n pnames = CreateSparseArray('c', 'd', 'e', 'f', 'g', 'a', 'b');\n idx = (diatonic_pitch % 7);\n pname = pnames[idx];\n\n return CreateSparseArray(pname, octv);\n} \/\/$end\n\nfunction ConvertOffsetsToMillimeters (offset) {\n \/\/$module(ExportConverters.mss)\n\n \/*\n This function will convert the 1\/32 unit \n Sibelius offsets into a millimeter measurement as required by the \n data.MEASUREMENT datatype used by MEI.\n\n The `StaffHeight` property always returns the staff height in millimeters.\n\n Most offsets are given in Sibelius Units, which\n are defined as 1\/32 of a space. A space is 1\/4 of the staff height, so\n the staff height is always 128. A unit is therefore:\n ((staffheight \/ 128) = units in mm.\n\n So a staff height of 7mm (default) gives us (7 \/ 128) = 0.05mm per Sibelius\n Unit.\n *\/\n scr = Sibelius.ActiveScore;\n staffheight = scr.StaffHeight;\n factor = (staffheight \/ 128.0);\n oset = factor * offset;\n retval = oset & 'mm';\n return retval;\n} \/\/$end\n\nfunction ConvertDuration (dur) {\n \/\/$module(ExportConverters.mss)\n \/\/ there doesn't really seem to be a smarter way to do this...\n \/\/ 1024 = 1 whole note\n\n ret = CreateSparseArray();\n\n pow = PrevPow2(dur);\n counter = pow;\n dots = 0;\n powcount = pow;\n durset = false;\n\n durrem = 1024 % dur;\n if (durrem != 0)\n {\n while (counter < dur)\n {\n powcount = (powcount \/ 2);\n counter = counter + powcount;\n dots = dots + 1;\n\n if (dots > 5)\n {\n \/\/ prevent a runaway loop.\n counter = 1000000000;\n }\n }\n }\n\n switch (powcount)\n {\n case (pow >= 4096)\n {\n ret[0] = 'long';\n durset = true;\n }\n case (pow >= 2048)\n {\n ret[0] = 'breve';\n durset = true;\n }\n default\n {\n if (durset = false)\n {\n ret[0] = 1024 \/ pow;\n }\n }\n }\n\n if (dots = 0)\n {\n ret[1] = ' ';\n }\n else\n {\n ret[1] = dots;\n }\n\n return ret;\n} \/\/$end\n\nfunction ConvertKeySignature (numsharps) {\n \/\/$module(ExportConverters.mss)\n switch (numsharps)\n {\n case (0)\n {\n \/\/ key of c\n return '0';\n }\n case (-8)\n {\n \/\/ atonal in Sibelius\n return '0';\n }\n case (numsharps > 0)\n {\n \/\/ sharps\n return numsharps & 's';\n }\n case (numsharps < 0)\n {\n \/\/flats\n return utils.AbsoluteValue(numsharps) & 'f';\n }\n }\n} \/\/$end\n\nfunction PitchesInKeySignature (keysig) {\n \/\/$module(ExportConverters.mss)\n\n \/\/ keysig is 7 >= 0 >= -7, for the number of sharps (negative is flats)\n ac = CreateSparseArray('F', 'C', 'G', 'D', 'A', 'E', 'B');\n if (keysig = 0)\n {\n return CreateSparseArray();\n }\n\n if (keysig > 0)\n {\n return ac.Slice(0, keysig);\n }\n else\n {\n v = ac.Slice(keysig);\n v.Reverse();\n return v;\n }\n} \/\/$end\n\nfunction ConvertAccidental (noteobj) {\n \/\/$module(ExportConverters.mss)\n \/\/ If accidentals are audible, but not visible, you get @accid.ges\n \/\/ If accidentals are both audible and visible, you get @accid\n \/\/ is_visible is not to be confused with hidden accidentals! is_visible\n \/\/ just determines whether an accidental is shown or not based on \n \/\/ the rules of CMN.\n\n \/\/ Returns a tuple [0 => accid (string), 1 => is_visible (bool)]\n \/\/ If the accidental is a natural and is visible, returns ('n', true); otherwise,\n \/\/ it returns ('', false);\n\n \/\/ first, determine if the accidental is visible.\n is_visible = HasVisibleAccidental(noteobj);\n ac = ' ';\n\n pname = Substring(noteobj.Name, 0, 1); \/\/ captures first letter\n accid = Substring(noteobj.Name, 1); \/\/ captures all other characters\n\n switch(accid)\n {\n case('bb')\n {\n ac = 'ff';\n }\n case('b-')\n {\n ac = 'fd';\n }\n case('b')\n {\n ac = 'f';\n }\n case('-')\n {\n ac = 'fu';\n }\n case('')\n {\n if (is_visible = True)\n {\n ac = 'n';\n }\n }\n case('+')\n {\n ac = 'sd';\n }\n case('#')\n {\n ac = 's';\n }\n case('#+')\n {\n ac = 'su';\n }\n case('x')\n {\n ac = 'x';\n }\n case('##')\n {\n ac = 'ss';\n }\n }\n\n ret = CreateSparseArray(ac, is_visible);\n return ret;\n} \/\/$end\n\nfunction HasVisibleAccidental (noteobj) {\n \/\/$module(ExportConverters.mss)\n \/\/ determines whether a note is *likely* to have a visible accidental.\n \/\/ Caution: This is probably not 100% accurate.\n\n \/\/ Returns a boolean if the note is visible.\n\n \/\/ If it has a cautionary accidental, it's most likely to be visible.\n if (noteobj.AccidentalStyle = CautionaryAcc)\n {\n return True;\n }\n\n if (noteobj.AccidentalStyle = HiddenAcc)\n {\n return False;\n }\n\n keysig = noteobj.ParentNoteRest.ParentBar.GetKeySignatureAt(noteobj.ParentNoteRest.Position);\n sf = sibmei2.PitchesInKeySignature(keysig.Sharps);\n pname = Substring(noteobj.Name, 0, 1); \/\/ captures first letter\n accid = Substring(noteobj.Name, 1); \/\/ captures all other characters\n\n \/\/ if the note is not in the key signature, then it should have an accidental\n note_is_in_keysig = utils.IsInArray(sf, pname);\n has_prev_pitch_with_accidental = False;\n\n parent_nr = noteobj.ParentNoteRest;\n parent_bar = parent_nr.ParentBar;\n\n for each NoteRest nr in parent_bar\n {\n if (nr.Position < parent_nr.Position)\n {\n for each n in nr\n {\n pname2 = Substring(n.Name, 0, 1); \/\/ captures first letter\n accid2 = Substring(n.Name, 1); \/\/ captures all other characters\n\n if (n.Name = noteobj.Name and note_is_in_keysig = False and n.Accidental != 0)\n {\n has_prev_pitch_with_accidental = True;\n }\n\n if (n.Name = noteobj.Name and n.AccidentalStyle = CautionaryAcc)\n {\n has_prev_pitch_with_accidental = True;\n }\n\n if (n.Name = noteobj.Name and note_is_in_keysig = True)\n {\n has_prev_pitch_with_accidental = False;\n }\n\n \/\/ this is a special case for dealing with naturals. If the pitch names\n \/\/ match, and the note is not in the key signature, and the previous pitch\n \/\/ was not empty, then we probably have a natural on the query note.\n if (pname = pname2 and note_is_in_keysig = False and accid2 != '')\n {\n has_prev_pitch_with_accidental = True;\n }\n\n }\n }\n else\n {\n for each n in nr\n {\n if (n.Name = noteobj.Name and n.Accidental != 0 and note_is_in_keysig = True)\n {\n has_prev_pitch_with_accidental = False;\n }\n }\n }\n }\n\n \/\/ deal with the 'weird' accidental values that don't have a value in noteobj.Accidental\n switch (accid)\n {\n case ('bb')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('b-')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('-')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('+')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('#+')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n }\n\n if (noteobj.Accidental = 0 and note_is_in_keysig = True and has_prev_pitch_with_accidental = False)\n {\n \/\/ it's a natural?\n return True;\n }\n\n if (note_is_in_keysig = True and has_prev_pitch_with_accidental = False)\n {\n return False;\n }\n\n if (has_prev_pitch_with_accidental = False and noteobj.Accidental != 0)\n {\n return True;\n }\n \n if (has_prev_pitch_with_accidental = True and accid = '')\n {\n \/\/ this is the corresponding return value for special cased naturals.\n return True;\n }\n\n \/\/ Finally, by default, assume this has no accidental.\n return False;\n} \/\/$end\n\nfunction ConvertNamedTimeSignature (timesig) {\n \/\/$module(ExportConverters.mss)\n switch(timesig)\n {\n case(CommonTimeString)\n {\n return 'common';\n }\n case(AllaBreveTimeString)\n {\n return 'cut';\n }\n default\n {\n return ' ';\n }\n }\n} \/\/$end\n\nfunction ConvertBracket (bracket) {\n \/\/$module(ExportConverters.mss)\n switch(bracket)\n {\n case(BracketFull)\n {\n return 'bracket';\n }\n case(BracketBrace)\n {\n return 'brace';\n }\n case(BracketSub)\n {\n return 'line';\n }\n default\n {\n return 'none';\n }\n }\n} \/\/$end\n\nfunction ConvertSibeliusStructure (score) {\n \/\/$module(ExportConverters.mss)\n \/\/ Takes in the Staff\/Bar Sibelius Structure and returns a Bar\/Staff\n \/\/ mapping for our MEI writers.\n bar_to_staff = CreateDictionary();\n\n \/\/ Invert the Sibelius structure\n for each Staff s in score\n {\n for each Bar b in s\n {\n if (bar_to_staff.PropertyExists(b.BarNumber))\n {\n bar_to_staff[b.BarNumber].Push(s.StaffNum);\n }\n else\n {\n bar_to_staff[b.BarNumber] = CreateSparseArray();\n bar_to_staff[b.BarNumber].Push(s.StaffNum);\n }\n }\n }\n return bar_to_staff;\n} \/\/$end\n\nfunction ConvertColor (nrest) {\n \/\/$module(ExportConverters.mss)\n r = nrest.ColorRed;\n g = nrest.ColorGreen;\n b = nrest.ColorBlue;\n a_dec = nrest.ColorAlpha & '.0';\n a = a_dec \/ 255.0;\n\n return 'rgba(' & r & ',' & g & ',' & b & ',' & a & ')';\n} \/\/$end\n\nfunction ConvertNoteStyle (style) {\n \/\/$module(ExportConverters.mss)\n noteStyle = ' ';\n\n if (style = NormalNoteStyle)\n {\n return ' ';\n }\n\n switch (style)\n {\n case (CrossNoteStyle)\n {\n noteStyle = 'cross';\n }\n case (DiamondNoteStyle)\n {\n noteStyle = 'diamond';\n }\n case (CrossOrDiamondNoteStyle)\n {\n \/\/ Sibelius uses this for percussion\n \/\/ and does not differentiate in the \n \/\/ head style, so we have to choose one\n \/\/ or the other.\n noteStyle = 'cross';\n }\n case (BlackAndWhiteDiamondNoteStyle)\n {\n noteStyle = 'filldiamond';\n }\n case (SlashedNoteStyle)\n {\n noteStyle = 'addslash';\n }\n case (BackSlashedNoteStyle)\n {\n noteStyle = 'addbackslash';\n }\n case (ArrowDownNoteStyle)\n {\n \/\/ this is not completely correct, since\n \/\/ we use the same value for up and down\n \/\/ iso triangles. But it's all we have for now.\n noteStyle = 'isotriangle';\n }\n case (ArrowUpNoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (InvertedTriangleNoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (ShapedNote1NoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (ShapedNote2NoteStyle)\n {\n noteStyle = 'semicircle';\n }\n case (ShapedNote3NoteStyle)\n {\n noteStyle = 'diamond';\n }\n case (ShapedNote4StemUpNoteStyle)\n {\n noteStyle = 'rtriangle';\n }\n case (ShapedNote4StemDownNoteStyle)\n {\n noteStyle = 'rtriangle';\n }\n case (ShapedNote5NoteStyle)\n {\n \/\/ this looks normal...\n noteStyle = ' ';\n }\n case (ShapedNote6NoteStyle)\n {\n \/\/ there is no square in MEI...\n noteStyle = ' ';\n }\n case (ShapedNote7NoteStyle)\n {\n noteStyle = 'piewedge';\n }\n }\n\n return noteStyle;\n} \/\/$end\n\nfunction ConvertSlurStyle (style) {\n \/\/$module(ExportConverters.mss)\n slurparts = MSplitString(style, '.');\n direction = ' ';\n style = ' ';\n\n switch(slurparts[3])\n {\n case ('up')\n {\n direction = 'above';\n }\n case ('down')\n {\n direction = 'below';\n }\n default\n {\n direction = ' ';\n }\n }\n switch(slurparts[4])\n {\n case ('dashed')\n {\n style = 'dashed';\n }\n case ('dotted')\n {\n style = 'dotted';\n }\n default\n {\n style = ' ';\n }\n }\n return CreateSparseArray(direction, style);\n} \/\/$end\n\nfunction ConvertPositionToTimestamp (position, bar) {\n \/\/$module(ExportConverters.mss)\n \/*\n To convert Sibelius ticks to musical timestamps\n we use the formula:\n\n tstamp = (notePosition \/ (barLength \/ beatsInBar))\n *\/\n\n \/\/ make sure we're working with floating point numbers\n \/\/ and yes, this makes me feel very, very dirty in case\n \/\/ you were wondering, but this is the only way ManuScript\n \/\/ can cast to floating point...\n barlength = bar.Length;\n timesignature = Sibelius.ActiveScore.SystemStaff.CurrentTimeSignature(bar.BarNumber);\n\n if (position = 0)\n {\n return 1;\n }\n\n barlen = barlength & '.0';\n pos = position & '.0';\n beats = timesignature.Numerator & '.0';\n unit = (barlen \/ beats);\n ret = (pos \/ unit) + 1;\n\n return ret;\n} \/\/$end\n\nfunction ConvertTupletStyle (tupletStyle) {\n \/\/$module(ExportConverters.mss)\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.addAttribute(activeTuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.addAttribute(activeTuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.addAttribute(activeTuplet, 'num.format', 'ratio');\n }\n }\n\n} \/\/$end\n\nfunction ConvertBarline (linetype) {\n \/\/$module(ExportConverters.mss)\n switch(linetype)\n {\n case (SpecialBarlineStartRepeat)\n {\n \/\/ start repeat\n return 'rptstart';\n }\n case (SpecialBarlineEndRepeat)\n {\n \/\/ end repeat\n return 'rptend';\n }\n case (SpecialBarlineDashed)\n {\n \/\/ dashed\n return 'dashed';\n }\n case (SpecialBarlineDouble)\n {\n \/\/ double\n return 'dbl';\n }\n case (SpecialBarlineFinal)\n {\n \/\/ final\n return 'end';\n }\n case (SpecialBarlineInvisible)\n {\n \/\/ invisible\n return 'invis';\n }\n case (SpecialBarlineBetweenStaves)\n {\n \/\/ between staves\n \/\/ no MEI equiv.\n return ' ';\n }\n case (SpecialBarlineNormal)\n {\n \/\/ normal\n \/\/ this should usually be needed.\n return 'single';\n }\n case (SpecialBarlineTick)\n {\n \/\/ tick\n \/\/ unknown\n return ' ';\n }\n case (SpecialBarlineShort)\n {\n \/\/ short\n \/\/ unknown\n return ' ';\n }\n default\n {\n return ' ';\n }\n }\n} \/\/$end\n\nfunction ConvertText (textobj) {\n \/\/$module(ExportConverters.mss)\n styleid = textobj.StyleId;\n switch (styleid)\n {\n case ('text.staff.expression')\n {\n dynam = libmei.Dynam();\n libmei.SetText(dynam, lstrip(textobj.Text));\n libmei.AddAttribute(dynam, 'staff', textobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(dynam, 'tstamp', ConvertPositionToTimestamp(textobj));\n\n if (textobj.Dx != 0)\n {\n libmei.AddAttribute(dynam, 'ho', ConvertOffsetsToMillimeters(textobj.Dx));\n }\n\n if (textobj.Dy != 0)\n {\n libmei.AddAttribute(dynam, 'vo', ConvertOffsetsToMillimeters(textobj.Dy));\n }\n return dynam;\n }\n case ('text.system.page_aligned.title')\n {\n return ConvertTextElement(textobj);\n }\n case ('text.system.page_aligned.composer')\n {\n return ConvertTextElement(textobj);\n }\n default\n {\n return null;\n }\n }\n} \/\/$end\n\nfunction ConvertTextElement (textobj) {\n \/\/$module(ExportConverters.mss)\n obj = libmei.AnchoredText();\n libmei.SetText(obj, lstrip(textobj.Text));\n\n if (textobj.Dx != 0)\n {\n libmei.AddAttribute(obj, 'ho', ConvertOffsetsToMillimeters(textobj.Dx));\n }\n\n if (textobj.Dy != 0)\n {\n libmei.AddAttribute(obj, 'vo', ConvertOffsetsToMillimeters(textobj.Dy));\n }\n\n return obj;\n} \/\/$end\n\nfunction ConvertEndingValues (styleid) {\n \/\/$module(ExportConverters)\n ending_style = MSplitString(styleid, '.');\n num = ' ';\n label = ' ';\n type = ' ';\n\n switch(ending_style[3])\n {\n case ('1st')\n {\n num = 1;\n label = '1.';\n type = 'closed';\n }\n case ('1st_n_2nd')\n {\n num = 1;\n label = '1. 2.';\n type = 'closed';\n }\n case ('2nd')\n {\n num = 2;\n label = '2.';\n if (ending_style[-1] = 'closed')\n {\n type = 'closed';\n }\n else\n {\n type = 'open';\n }\n }\n case ('3rd')\n {\n num = 3;\n label = '3.';\n type = 'closed';\n }\n case ('open')\n {\n type = 'open';\n }\n case ('closed')\n {\n type = 'closed';\n }\n }\n\n return CreateSparseArray(num, label, type);\n\n} \/\/$end\n\nfunction ConvertDate (datetime) {\n \/\/$module(ExportConverters.mss)\n d = datetime.DayOfMonth;\n m = datetime.Month;\n y = datetime.Year;\n\n time = datetime.TimeWithSeconds;\n\n isodate = utils.Format('%s-%s-%sT%sZ', y, m, d, time);\n\n return isodate;\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"5d154b2eef5849717cf074bc46961d73345bba47","subject":"Separated style rules for DRB streams from NDH streams","message":"Separated style rules for DRB streams from NDH streams\n\nDRM streams and NHD streams had same style for same stream order, but\nDRB streams had order of approximately 3 higher than equivalent NHD\nstreams.\n","repos":"WikiWatershed\/model-my-watershed,WikiWatershed\/model-my-watershed,kdeloach\/model-my-watershed,WikiWatershed\/model-my-watershed,kdeloach\/model-my-watershed,WikiWatershed\/model-my-watershed,kdeloach\/model-my-watershed,WikiWatershed\/model-my-watershed,kdeloach\/model-my-watershed,kdeloach\/model-my-watershed","old_file":"src\/tiler\/styles.mss","new_file":"src\/tiler\/styles.mss","new_contents":"\/* CONSIDER THAT CHANGES TO THESE STYLES WILL MAKE THE *\/\n\/* TILE CACHE STALE. PLEASE USE setupdb.sh TO INVALIDATE *\/\n\/* THE LAYERS IMPACTED BY YOUR CHANGES. *\/\n\n#boundary_county,\n#boundary_district,\n#boundary_school_district,\n#boundary_huc08,\n#boundary_huc10,\n#boundary_huc12,\n#dep_municipalities {\n ::case {\n line-color: #FFF;\n line-opacity: 0.5;\n line-width: 3;\n line-join: round;\n }\n\n ::fill {\n polygon-opacity: 0.0;\n line-color: #E77471;\n line-opacity: 0.75;\n line-width: 1.5;\n line-join: round;\n }\n}\n\n#dep_urban_areas {\n ::case {\n line-color: #7F7F7F;\n line-width: 1;\n }\n ::fill {\n polygon-fill: #ccc;\n }\n}\n\n@drb_catchment_step_one_color: #A0A0A0;\n@drb_catchment_step_two_color: #888888;\n@drb_catchment_step_three_color: #707070;\n@drb_catchment_step_four_color: #484848;\n@drb_catchment_step_five_color: #202020;\n@drb_catchment_line_color: #FFF;\n@drb_catchment_line_width: 2;\n\n#drb_catchment_water_quality_tn {\n line-color: @drb_catchment_line_color;\n line-width: @drb_catchment_line_width;\n [tn_tot_kgy >= 0][tn_tot_kgy < 5] {\n polygon-fill: @drb_catchment_step_one_color;\n }\n [tn_tot_kgy >= 5][tn_tot_kgy < 10] {\n polygon-fill: @drb_catchment_step_two_color;\n }\n [tn_tot_kgy >= 10][tn_tot_kgy < 15] {\n polygon-fill: @drb_catchment_step_three_color;\n }\n [tn_tot_kgy >= 15][tn_tot_kgy < 20] {\n polygon-fill: @drb_catchment_step_four_color;\n }\n [tn_tot_kgy >= 20] {\n polygon-fill: @drb_catchment_step_five_color;\n }\n}\n\n#drb_catchment_water_quality_tp {\n line-color: @drb_catchment_line_color;\n line-width: @drb_catchment_line_width;\n [tp_tot_kgy >= 0.0][tp_tot_kgy < 0.30] {\n polygon-fill: @drb_catchment_step_one_color;\n }\n [tp_tot_kgy >= 0.30][tp_tot_kgy < 0.60] {\n polygon-fill: @drb_catchment_step_two_color;\n }\n [tp_tot_kgy >= 0.60][tp_tot_kgy < 0.90] {\n polygon-fill: @drb_catchment_step_three_color;\n }\n [tp_tot_kgy >= 0.90][tp_tot_kgy < 1.20] {\n polygon-fill: @drb_catchment_step_four_color;\n }\n [tp_tot_kgy >= 1.20] {\n polygon-fill: @drb_catchment_step_five_color;\n }\n}\n\n#drb_catchment_water_quality_tss {\n line-color: @drb_catchment_line_color;\n line-width: @drb_catchment_line_width;\n [tss_tot_kg >= 0][tss_tot_kg < 250] {\n polygon-fill: @drb_catchment_step_one_color;\n }\n [tss_tot_kg >= 250][tss_tot_kg < 500] {\n polygon-fill: @drb_catchment_step_two_color;\n }\n [tss_tot_kg >= 500][tss_tot_kg < 750] {\n polygon-fill: @drb_catchment_step_three_color;\n }\n [tss_tot_kg >= 750][tss_tot_kg < 1000] {\n polygon-fill: @drb_catchment_step_four_color;\n }\n [tss_tot_kg >= 1000] {\n polygon-fill: @drb_catchment_step_five_color;\n }\n}\n\n@streamColor: #1562A9;\n@wtrQualColor0: #1a9641;\n@wtrQualColor1: #a6d96a;\n@wtrQualColor2: #ffffbf;\n@wtrQualColor3: #fdae61;\n@wtrQualColor4: #d7191c;\n@wtrQualColorNA: #9E9E9E;\n\n@zoomBase: 0.5;\n\n\/* DRB and NHD Streams have custom SQL which is executed for tile requests\n that is dynamically generated from the requested zoom level. This filters\n stream features out below a certain threshold of stream_order per zoom level.\n Ensure that any changes to which stream_order + zoom levels are rendered\n here have appropriate coinciding filters in server.js\n*\/\n\n#drb_streams_50 {\n line-color: @streamColor;\n line-join: round;\n line-cap: round;\n}\n\n#nhdflowline {\n line-color: @streamColor;\n line-join: round;\n line-cap: round;\n}\n\n#nhd_quality_tp,\n#nhd_quality_tn,\n#nhd_quality_tss {\n [nhd_qual_grp=\"L1\"] {\n line-color: @wtrQualColor0;\n }\n [nhd_qual_grp=\"L2\"] {\n line-color: @wtrQualColor1;\n }\n [nhd_qual_grp=\"L3\"] {\n line-color: @wtrQualColor2;\n }\n [nhd_qual_grp=\"L4\"] {\n line-color: @wtrQualColor3;\n }\n [nhd_qual_grp=\"L5\"] {\n line-color: @wtrQualColor4;\n }\n [nhd_qual_grp=\"NA\"] {\n line-color: @wtrQualColorNA;\n }\n}\n\n\n#nhdflowline[zoom<=4],\n#nhd_quality_tp[zoom<=4],\n#nhd_quality_tn[zoom<=4],\n#nhd_quality_tss[zoom<=4] {\n [stream_order=10] {\n line-width: 5.0 * @zoomBase;\n }\n [stream_order=9] {\n line-width: 3.0 * @zoomBase;\n }\n [stream_order<=8] {\n line-width: 2.0 * @zoomBase;\n }\n}\n\n\n#nhdflowline[zoom>=5][zoom<=6],\n#nhd_quality_tp[zoom>=5][zoom<=6],\n#nhd_quality_tn[zoom>=5][zoom<=6],\n#nhd_quality_tss[zoom>=5][zoom<=6] {\n [stream_order=10] {\n line-width: 7.0 * @zoomBase;\n }\n [stream_order=9] {\n line-width: 4.0 * @zoomBase;\n }\n [stream_order<=8] {\n line-width: 3.0 * @zoomBase;\n }\n}\n\n\n#nhdflowline[zoom>=7][zoom<=8],\n#nhd_quality_tp[zoom>=7][zoom<=8],\n#nhd_quality_tn[zoom>=7][zoom<=8],\n#nhd_quality_tss[zoom>=7][zoom<=8] {\n [stream_order>=9] {\n line-width: 10.0 * @zoomBase;\n }\n [stream_order<=8][stream_order>=7] {\n line-width: 7.0 * @zoomBase;\n }\n [stream_order<=6] {\n line-width: 4.0 * @zoomBase;\n }\n [stream_order=5] {\n line-width: 3.0 * @zoomBase;\n }\n}\n\n\n#nhdflowline[zoom>=9][zoom<=10],\n#nhd_quality_tp[zoom>=9][zoom<=10],\n#nhd_quality_tn[zoom>=9][zoom<=10],\n#nhd_quality_tss[zoom>=9][zoom<=10] {\n [stream_order>=9] {\n line-width: 14.0 * @zoomBase;\n }\n [stream_order<=8][stream_order>=6] {\n line-width: 10.0 * @zoomBase;\n }\n [stream_order<=5][stream_order>=4] {\n line-width: 5.0 * @zoomBase;\n }\n [stream_order=3] {\n line-width: 3.0 * @zoomBase;\n }\n}\n\n\n#nhdflowline[zoom>=11][zoom<=12],\n#nhd_quality_tp[zoom>=11][zoom<=12],\n#nhd_quality_tn[zoom>=11][zoom<=12],\n#nhd_quality_tss[zoom>=11][zoom<=12] {\n [stream_order>=9] {\n line-width: 18.0 * @zoomBase;\n }\n [stream_order<=8][stream_order>=6] {\n line-width: 12.0 * @zoomBase;\n }\n [stream_order<=5][stream_order>=4] {\n line-width: 9.0 * @zoomBase;\n }\n [stream_order=3] {\n line-width: 6.0 * @zoomBase;\n }\n [stream_order=2] {\n line-width: 5.0 * @zoomBase;\n }\n [stream_order<=1][stream_order>=0] {\n line-width: 4.0 * @zoomBase;\n }\n}\n\n\n\n#nhdflowline[zoom>=13],\n#nhd_quality_tp[zoom>=13],\n#nhd_quality_tn[zoom>=13],\n#nhd_quality_tss[zoom>=13] {\n [stream_order>=9] {\n line-width: 18.0 * @zoomBase;\n }\n [stream_order<=8][stream_order>=6] {\n line-width: 14.0 * @zoomBase;\n }\n [stream_order<=5][stream_order>=3] {\n line-width: 10.0 * @zoomBase;\n }\n [stream_order=2] {\n line-width: 8.0 * @zoomBase;\n }\n [stream_order<=1][stream_order>=0] {\n line-width: 5.0 * @zoomBase;\n }\n}\n\n#drb_streams_50[zoom<=4]{\n [stream_order=10] {\n line-width: 3.0 * @zoomBase;\n }\n [stream_order=9] {\n line-width: 3.0 * @zoomBase;\n }\n [stream_order<=8] {\n line-width: 2.0 * @zoomBase;\n }\n}\n\n#drb_streams_50[zoom>=5][zoom<=6]{\n [stream_order=10] {\n line-width: 4.0 * @zoomBase;\n }\n [stream_order=9] {\n line-width: 3.0 * @zoomBase;\n }\n [stream_order<=8] {\n line-width: 2.0 * @zoomBase;\n }\n}\n\n#drb_streams_50[zoom>=7][zoom<=8]{\n [stream_order>=9] {\n line-width: 7.0 * @zoomBase;\n }\n [stream_order<=8][stream_order>=7] {\n line-width: 4.0 * @zoomBase;\n }\n [stream_order<=6] {\n line-width: 3.0 * @zoomBase;\n }\n [stream_order=5] {\n line-width: 2.0 * @zoomBase;\n }\n}\n\n#drb_streams_50[zoom>=9][zoom<=10]{\n [stream_order>=9] {\n line-width: 10.0 * @zoomBase;\n }\n [stream_order<=8][stream_order>=6] {\n line-width: 5.0 * @zoomBase;\n }\n [stream_order<=5][stream_order>=4] {\n line-width: 3.0 * @zoomBase;\n }\n [stream_order=3] {\n line-width: 2.0 * @zoomBase;\n }\n}\n\n#drb_streams_50[zoom>=11][zoom<=12] {\n [stream_order>=9] {\n line-width: 12.0 * @zoomBase;\n }\n [stream_order<=8][stream_order>=6] {\n line-width: 10.0 * @zoomBase;\n }\n [stream_order<=5][stream_order>=4] {\n line-width: 6.0 * @zoomBase;\n }\n [stream_order=3] {\n line-width: 5.0 * @zoomBase;\n }\n [stream_order=2] {\n line-width: 4.0 * @zoomBase;\n }\n [stream_order<=1][stream_order>=0] {\n line-width: 3.0 * @zoomBase;\n }\n}\n#drb_streams_50[zoom>=13]{\n [stream_order>=9] {\n line-width: 14.0 * @zoomBase;\n }\n [stream_order<=8][stream_order>=6] {\n line-width: 11.0 * @zoomBase;\n }\n [stream_order<=5][stream_order>=4] {\n line-width: 8.0 * @zoomBase;\n }\n [stream_order=3] {\n line-width: 5.0 * @zoomBase;\n }\n [stream_order=2] {\n line-width: 4.0 * @zoomBase;\n }\n [stream_order<=1][stream_order>=0] {\n line-width: 3.0 * @zoomBase;\n }\n}\n","old_contents":"\/* CONSIDER THAT CHANGES TO THESE STYLES WILL MAKE THE *\/\n\/* TILE CACHE STALE. PLEASE USE setupdb.sh TO INVALIDATE *\/\n\/* THE LAYERS IMPACTED BY YOUR CHANGES. *\/\n\n#boundary_county,\n#boundary_district,\n#boundary_school_district,\n#boundary_huc08,\n#boundary_huc10,\n#boundary_huc12,\n#dep_municipalities {\n ::case {\n line-color: #FFF;\n line-opacity: 0.5;\n line-width: 3;\n line-join: round;\n }\n\n ::fill {\n polygon-opacity: 0.0;\n line-color: #E77471;\n line-opacity: 0.75;\n line-width: 1.5;\n line-join: round;\n }\n}\n\n#dep_urban_areas {\n ::case {\n line-color: #7F7F7F;\n line-width: 1;\n }\n ::fill {\n polygon-fill: #ccc;\n }\n}\n\n@drb_catchment_step_one_color: #A0A0A0;\n@drb_catchment_step_two_color: #888888;\n@drb_catchment_step_three_color: #707070;\n@drb_catchment_step_four_color: #484848;\n@drb_catchment_step_five_color: #202020;\n@drb_catchment_line_color: #FFF;\n@drb_catchment_line_width: 2;\n\n#drb_catchment_water_quality_tn {\n line-color: @drb_catchment_line_color;\n line-width: @drb_catchment_line_width;\n [tn_tot_kgy >= 0][tn_tot_kgy < 5] {\n polygon-fill: @drb_catchment_step_one_color;\n }\n [tn_tot_kgy >= 5][tn_tot_kgy < 10] {\n polygon-fill: @drb_catchment_step_two_color;\n }\n [tn_tot_kgy >= 10][tn_tot_kgy < 15] {\n polygon-fill: @drb_catchment_step_three_color;\n }\n [tn_tot_kgy >= 15][tn_tot_kgy < 20] {\n polygon-fill: @drb_catchment_step_four_color;\n }\n [tn_tot_kgy >= 20] {\n polygon-fill: @drb_catchment_step_five_color;\n }\n}\n\n#drb_catchment_water_quality_tp {\n line-color: @drb_catchment_line_color;\n line-width: @drb_catchment_line_width;\n [tp_tot_kgy >= 0.0][tp_tot_kgy < 0.30] {\n polygon-fill: @drb_catchment_step_one_color;\n }\n [tp_tot_kgy >= 0.30][tp_tot_kgy < 0.60] {\n polygon-fill: @drb_catchment_step_two_color;\n }\n [tp_tot_kgy >= 0.60][tp_tot_kgy < 0.90] {\n polygon-fill: @drb_catchment_step_three_color;\n }\n [tp_tot_kgy >= 0.90][tp_tot_kgy < 1.20] {\n polygon-fill: @drb_catchment_step_four_color;\n }\n [tp_tot_kgy >= 1.20] {\n polygon-fill: @drb_catchment_step_five_color;\n }\n}\n\n#drb_catchment_water_quality_tss {\n line-color: @drb_catchment_line_color;\n line-width: @drb_catchment_line_width;\n [tss_tot_kg >= 0][tss_tot_kg < 250] {\n polygon-fill: @drb_catchment_step_one_color;\n }\n [tss_tot_kg >= 250][tss_tot_kg < 500] {\n polygon-fill: @drb_catchment_step_two_color;\n }\n [tss_tot_kg >= 500][tss_tot_kg < 750] {\n polygon-fill: @drb_catchment_step_three_color;\n }\n [tss_tot_kg >= 750][tss_tot_kg < 1000] {\n polygon-fill: @drb_catchment_step_four_color;\n }\n [tss_tot_kg >= 1000] {\n polygon-fill: @drb_catchment_step_five_color;\n }\n}\n\n@streamColor: #1562A9;\n@wtrQualColor0: #1a9641;\n@wtrQualColor1: #a6d96a;\n@wtrQualColor2: #ffffbf;\n@wtrQualColor3: #fdae61;\n@wtrQualColor4: #d7191c;\n@wtrQualColorNA: #9E9E9E;\n\n@zoomBase: 0.5;\n\n\/* DRB and NHD Streams have custom SQL which is executed for tile requests\n that is dynamically generated from the requested zoom level. This filters\n stream features out below a certain threshold of stream_order per zoom level.\n Ensure that any changes to which stream_order + zoom levels are rendered\n here have appropriate coinciding filters in server.js\n*\/\n\n#drb_streams_50 {\n line-color: @streamColor;\n line-join: round;\n line-cap: round;\n}\n\n#nhdflowline {\n line-color: @streamColor;\n line-join: round;\n line-cap: round;\n}\n\n#nhd_quality_tp,\n#nhd_quality_tn,\n#nhd_quality_tss {\n [nhd_qual_grp=\"L1\"] {\n line-color: @wtrQualColor0;\n }\n [nhd_qual_grp=\"L2\"] {\n line-color: @wtrQualColor1;\n }\n [nhd_qual_grp=\"L3\"] {\n line-color: @wtrQualColor2;\n }\n [nhd_qual_grp=\"L4\"] {\n line-color: @wtrQualColor3;\n }\n [nhd_qual_grp=\"L5\"] {\n line-color: @wtrQualColor4;\n }\n [nhd_qual_grp=\"NA\"] {\n line-color: @wtrQualColorNA;\n }\n}\n\n#drb_streams_50[zoom<=4],\n#nhdflowline[zoom<=4],\n#nhd_quality_tp[zoom<=4],\n#nhd_quality_tn[zoom<=4],\n#nhd_quality_tss[zoom<=4] {\n [stream_order=10] {\n line-width: 5.0 * @zoomBase;\n }\n [stream_order=9] {\n line-width: 3.0 * @zoomBase;\n }\n [stream_order<=8] {\n line-width: 2.0 * @zoomBase;\n }\n}\n\n#drb_streams_50[zoom>=5][zoom<=6],\n#nhdflowline[zoom>=5][zoom<=6],\n#nhd_quality_tp[zoom>=5][zoom<=6],\n#nhd_quality_tn[zoom>=5][zoom<=6],\n#nhd_quality_tss[zoom>=5][zoom<=6] {\n [stream_order=10] {\n line-width: 7.0 * @zoomBase;\n }\n [stream_order=9] {\n line-width: 4.0 * @zoomBase;\n }\n [stream_order<=8] {\n line-width: 3.0 * @zoomBase;\n }\n}\n\n#drb_streams_50[zoom>=7][zoom<=8],\n#nhdflowline[zoom>=7][zoom<=8],\n#nhd_quality_tp[zoom>=7][zoom<=8],\n#nhd_quality_tn[zoom>=7][zoom<=8],\n#nhd_quality_tss[zoom>=7][zoom<=8] {\n [stream_order>=9] {\n line-width: 10.0 * @zoomBase;\n }\n [stream_order<=8][stream_order>=7] {\n line-width: 7.0 * @zoomBase;\n }\n [stream_order<=6] {\n line-width: 4.0 * @zoomBase;\n }\n [stream_order=5] {\n line-width: 3.0 * @zoomBase;\n }\n}\n\n#drb_streams_50[zoom>=9][zoom<=10],\n#nhdflowline[zoom>=9][zoom<=10],\n#nhd_quality_tp[zoom>=9][zoom<=10],\n#nhd_quality_tn[zoom>=9][zoom<=10],\n#nhd_quality_tss[zoom>=9][zoom<=10] {\n [stream_order>=9] {\n line-width: 14.0 * @zoomBase;\n }\n [stream_order<=8][stream_order>=6] {\n line-width: 10.0 * @zoomBase;\n }\n [stream_order<=5][stream_order>=4] {\n line-width: 5.0 * @zoomBase;\n }\n [stream_order=3] {\n line-width: 3.0 * @zoomBase;\n }\n}\n\n#drb_streams_50[zoom>=11][zoom<=12],\n#nhdflowline[zoom>=11][zoom<=12],\n#nhd_quality_tp[zoom>=11][zoom<=12],\n#nhd_quality_tn[zoom>=11][zoom<=12],\n#nhd_quality_tss[zoom>=11][zoom<=12] {\n [stream_order>=9] {\n line-width: 18.0 * @zoomBase;\n }\n [stream_order<=8][stream_order>=6] {\n line-width: 12.0 * @zoomBase;\n }\n [stream_order<=5][stream_order>=4] {\n line-width: 9.0 * @zoomBase;\n }\n [stream_order=3] {\n line-width: 6.0 * @zoomBase;\n }\n [stream_order=2] {\n line-width: 5.0 * @zoomBase;\n }\n [stream_order<=1][stream_order>=0] {\n line-width: 4.0 * @zoomBase;\n }\n}\n\n\n#drb_streams_50[zoom>=13],\n#nhdflowline[zoom>=13],\n#nhd_quality_tp[zoom>=13],\n#nhd_quality_tn[zoom>=13],\n#nhd_quality_tss[zoom>=13] {\n [stream_order>=9] {\n line-width: 18.0 * @zoomBase;\n }\n [stream_order<=8][stream_order>=6] {\n line-width: 14.0 * @zoomBase;\n }\n [stream_order<=5][stream_order>=3] {\n line-width: 10.0 * @zoomBase;\n }\n [stream_order=2] {\n line-width: 8.0 * @zoomBase;\n }\n [stream_order<=1][stream_order>=0] {\n line-width: 5.0 * @zoomBase;\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"CartoCSS"} {"commit":"4424e1612e973cdcdb0a930a054f2a9d95ddedb0","subject":"Fixed: Slurs now encode @tstamp2","message":"Fixed: Slurs now encode @tstamp2\n\nRels #15\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/Utilities.mss","new_file":"src\/Utilities.mss","new_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in \n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/* \n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a dictionary of {pos:id} mappings for a given\n \/\/ voice, and returns the NoteRest object. If one isn't found\n \/\/ exactly at `position`, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (startids, endids, tstamps, etc.) to an element\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n libmei.AddAttribute(element, 'dur.ges', bobj.Duration & 'p');\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n\n if (bobj.Type = 'Line' or bobj.Type = 'Slur')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionToTimestamp(bobj.EndPosition, bar));\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction IsLastNoteInTuplet (bobj) {\n \/\/$module(Utilities.mss)\n if (bobj.ParentTupletIfAny = null)\n {\n return false;\n }\n\n tuplet = bobj.ParentTupletIfAny;\n\n if (bobj.PositionInTuplet >= tuplet.Duration)\n {\n return true;\n }\n\n return false;\n\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n Sibelius.AppendLineToFile(LOGFILE, message, True);\n} \/\/$end","old_contents":"function MSplitString (string, delimiter) {\n \/\/$module(Utilities.mss)\n \/*\n The default Splitstring method is buggy,\n so I've re-implemented it here.\n\n Delimiter is optional; if it is false, this will\n split the string into an array of characters.\n *\/\n ret = CreateSparseArray();\n pos = 0;\n \/\/ If there is no delimiter, split the string\n \/\/ into an array of characters.\n if (delimiter = false)\n {\n for i = 0 to Length(string)\n {\n ret.Push(Substring(string, i, 1));\n }\n return ret;\n }\n\n for i = 0 to Length(string) + 1\n {\n if (utils.CharAt(string, i) = delimiter)\n {\n ret.Push(Substring(string, pos, i - pos));\n pos = i + 1;\n }\n\n if (i = Length(string))\n {\n ret.Push(Substring(string, pos, Length(string) - pos));\n }\n }\n return ret;\n} \/\/$end\n\nfunction PrevPow2 (val) {\n \/\/$module(Utilities.mss)\n if (val = 0)\n {\n return 0;\n }\n \/\/val = val - 1;\n val = utils.bwOR(val, utils.shr(val, 1));\n val = utils.bwOR(val, utils.shr(val, 2));\n val = utils.bwOR(val, utils.shr(val, 4));\n val = utils.bwOR(val, utils.shr(val, 8));\n val = utils.bwOR(val, utils.shr(val, 16));\n \/\/ this might be a hack, but I wrote it in \n \/\/ a power outage with no internet.\n \/\/ we get the next power of two, and then\n \/\/ divide by two to get the previous one.\n val = (val + 1) \/ 2;\n return val;\n} \/\/$end\n\nfunction SimpleNoteHash (nobj) {\n \/\/$module(Utilities.mss)\n \/* \n Generate a simple note hash. Not guaranteed to be unique given\n any suitably large sample of notes, but should be unique enough for quick\n checks.\n *\/\n pos = nobj.ParentNoteRest.Position;\n pitch = nobj.Pitch;\n duration = nobj.Duration;\n voice = nobj.VoiceNumber;\n name = nobj.Name;\n parent_bar_number = nobj.ParentNoteRest.ParentBar.BarNumber;\n parent_staff_number = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n time = nobj.ParentNoteRest.Time;\n\n hash = '' & pos & '-' & pitch & '-' & duration & '-' & voice & '-' & name & '-' & parent_bar_number & '-' & parent_staff_number & '-' & time;\n\n return hash;\n\n} \/\/$end\n\nfunction GetNoteObjectAtPosition (bobj) {\n \/\/$module(Utilities.mss)\n \/\/ takes a dictionary of {pos:id} mappings for a given\n \/\/ voice, and returns the NoteRest object. If one isn't found\n \/\/ exactly at `position`, it will first look back (previous)\n \/\/ and then look forward, for candidate objects.\n\n objectPositions = Self._property:ObjectPositions;\n staff_num = bobj.ParentBar.ParentStaff.StaffNum;\n bar_num = bobj.ParentBar.BarNumber;\n voice_num = bobj.VoiceNumber;\n\n staffObjectPositions = objectPositions[staff_num];\n barObjectPositions = staffObjectPositions[bar_num];\n voiceObjectPositions = barObjectPositions[voice_num];\n\n if (voiceObjectPositions.PropertyExists(bobj.Position))\n {\n obj_id = voiceObjectPositions[bobj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n \/\/ if we can't find anything at this position,\n \/\/ find the previous and subsequent objects, and align the\n \/\/ lyrics with them.\n prev_obj = bobj.PreviousItem(voice_num, 'NoteRest');\n\n if (prev_obj != null)\n {\n \/\/ there should be an object registered here\n obj_id = voiceObjectPositions[prev_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n else\n {\n next_obj = bobj.NextItem(voice_num, 'NoteRest');\n\n if (next_obj != null)\n {\n obj_id = voiceObjectPositions[next_obj.Position];\n obj = libmei.getElementById(obj_id);\n return obj;\n }\n }\n }\n\n return null;\n} \/\/$end\n\nfunction AddBarObjectInfoToElement (bobj, element) {\n \/\/$module(Utilities.mss)\n \/*\n adds timing and position info (startids, endids, tstamps, etc.) to an element\n This info is mostly derived from the base BarObject class.\n *\/\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (bobj.Type = 'Line')\n {\n \/\/ lines have durations, but symbols do not.\n libmei.AddAttribute(element, 'dur.ges', bobj.Duration & 'p');\n }\n\n libmei.AddAttribute(element, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n\n if (bobj.Type = 'Line')\n {\n libmei.AddAttribute(element, 'tstamp2', ConvertPositionToTimestamp(bobj.EndPosition, bar));\n }\n\n libmei.AddAttribute(element, 'staff', bar.ParentStaff.StaffNum);\n libmei.AddAttribute(element, 'layer', voicenum);\n\n if (bobj.Dx > 0)\n {\n libmei.AddAttribute(element, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy > 0)\n {\n libmei.AddAttribute(element, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n return element;\n\n} \/\/$end\n\nfunction TupletsEqual (t, t2) {\n \/\/$module(Utilities.mss)\n\n \/\/ shamelessly copied from the built-in tuplet plugin.\n tIsBar = (t = null) or (t.Type = 'Bar');\n t2IsBar = (t2 = null) or (t2.Type = 'Bar');\n\n if( tIsBar and t2IsBar ) { return true; }\n if( tIsBar or t2IsBar ) { return false; }\n\n b = t.ParentBar;\n b2 = t2.ParentBar;\n\n if( b.BarNumber != b2.BarNumber ) { return false; }\n if( b.ParentStaff.StaffNum != b2.ParentStaff.StaffNum ) { return 0; }\n if( t.VoiceNumber != t2.VoiceNumber ) { return false; }\n\n if( t.Position != t2.Position ) { return false; }\n if( t.PlayedDuration != t2.PlayedDuration ) { return false; }\n\n return true;\n\n} \/\/$end\n\nfunction IsLastNoteInTuplet (bobj) {\n \/\/$module(Utilities.mss)\n if (bobj.ParentTupletIfAny = null)\n {\n return false;\n }\n\n tuplet = bobj.ParentTupletIfAny;\n\n if (bobj.PositionInTuplet >= tuplet.Duration)\n {\n return true;\n }\n\n return false;\n\n} \/\/$end\n\nfunction lstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, 0) = ' ')\n {\n return Substring(str, 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction rstrip (str) {\n \/\/$module(Utilities.mss)\n if (utils.CharAt(str, Length(str) - 1) = ' ')\n {\n return Substring(str, 0, Length(str) - 1);\n }\n else\n {\n return str;\n }\n} \/\/$end\n\nfunction Log (message) {\n \/\/$module(Utilities.mss)\n Sibelius.AppendLineToFile(LOGFILE, message, True);\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"f87b6ef81091cfbfc4943dc3efe23ad6cdb8410d","subject":"Make localities italic","message":"Make localities italic","repos":"jeffaudi\/osm-hybrid","old_file":"osm-hybrid\/labels.mss","new_file":"osm-hybrid\/labels.mss","new_contents":"\/* LABELS.MSS CONTENTS:\n * - place names\n * - area labels\n * - waterway labels \n *\/\n\n\/* Font sets are defined in palette.mss *\/\n\n\/* ================================================================== *\/\n\/* PLACE NAMES\n\/* ================================================================== *\/\n\n#place::country[type='country'][zoom>3][zoom<9] {\n text-name:'[name]';\n text-face-name:@sans_bold;\n text-placement:point;\n text-fill:@country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n [zoom=3] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=4] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>4] {\n text-halo-radius: 2;\n }\n [zoom=5] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=6] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=7] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n#place::state[type='state'][zoom>=6][zoom<=10] {\n text-name:'[name]';\n text-face-name:@sans_bold_italic;\n text-placement:point;\n text-fill:@state_text;\n text-halo-fill: @state_halo;\n text-halo-radius: 1;\n [zoom=6] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=7] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>8] {\n text-halo-radius: 2;\n }\n [zoom=8] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=9] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=10] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n\/* ---- Cities ------------------------------------------------------ *\/\n\n#place::city[type='city'][zoom>=8][zoom<=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@city_text;\n text-halo-fill:@city_halo;\n text-halo-radius:2;\n [zoom<=8] {\n text-size: 11;\n text-halo-radius:2;\n }\n [zoom=9] {\n text-size:12;\n text-wrap-width: 60;\n }\n [zoom=10] {\n text-size:14;\n text-wrap-width: 70;\n }\n [zoom=11] {\n text-size:16;\n text-character-spacing: 1;\n text-wrap-width: 80;\n }\n [zoom=12] {\n text-size:18;\n text-character-spacing: 2;\n text-wrap-width: 200;\n }\n [zoom=13] {\n text-size:20;\n text-character-spacing: 4;\n text-wrap-width: 300;\n text-transform: uppercase;\n }\n [zoom=14] {\n text-size:22;\n text-character-spacing: 10;\n text-wrap-width: 500;\n text-transform: uppercase;\n }\n [zoom=15] {\n text-size:26;\n text-character-spacing: 16;\n text-wrap-width: 800;\n text-transform: uppercase;\n }\n}\n\n\/* ---- Towns ------------------------------------------------------- *\/\n\n#place::town[type='town'][zoom>=9][zoom<=17] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@town_text;\n text-size:9;\n text-halo-fill:@town_halo;\n text-halo-radius:2;\n text-wrap-width: 50;\n [zoom>=10] {\n text-halo-radius:2;\n text-size: 12;\n }\n [zoom>=11]{ \n text-size:14;\n }\n [zoom>=12]{\n text-size:16;\n text-line-spacing: 1;\n }\n [zoom>=13]{\n text-size:18;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-line-spacing: 2;\n }\n [zoom>=14]{\n text-size:20;\n text-character-spacing: 2;\n text-line-spacing: 3;\n }\n [zoom>=15]{\n text-size:22;\n text-character-spacing: 3;\n text-line-spacing: 4;\n }\n [zoom>=16]{\n text-size:24;\n text-character-spacing: 4;\n text-line-spacing: 5;\n }\n [zoom>=17]{\n text-size:26;\n text-character-spacing: 5;\n text-line-spacing: 6;\n }\n}\n\n\/* ---- Other small places ------------------------------------------ *\/\n\n#place::small[type='village'][zoom>=13],\n#place::small[type='suburb'][zoom>=13],\n#place::small[type='hamlet'][zoom>=13],\n#place::small[type='neighbourhood'][zoom>=13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@other_text;\n text-size:10;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=14] {\n text-size:14;\n text-character-spacing: 1;\n text-wrap-width: 120;\n text-line-spacing: 1;\n }\n [zoom>=15] {\n text-size:15;\n text-halo-radius: 2;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-wrap-width: 180; \n text-line-spacing: 1;\n }\n [zoom>=16] {\n text-size:16;\n text-character-spacing: 2;\n text-wrap-width: 240;\n text-line-spacing: 2;\n } \n [zoom>=17] {\n text-size:17; \n text-character-spacing: 3;\n text-wrap-width: 320;\n text-line-spacing: 4;\n }\n [zoom>=18] {\n text-size:18;\n text-character-spacing: 4;\n text-line-spacing: 6;\n }\n}\n\n#place::small[type='locality'][zoom>=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@locality_text;\n text-size:9;\n text-halo-fill:@locality_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=16] {\n text-size:10;\n text-wrap-width: 60;\n text-line-spacing: 1;\n }\n [zoom>=17] {\n text-size:11;\n text-wrap-width: 120;\n text-line-spacing: 2;\n }\n [zoom>=18] {\n text-size:12;\n text-character-spacing: 1;\n text-line-spacing: 4;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ AREA LABELS\n\/\/ =====================================================================\n\n#area_label {\n \/\/ Bring in labels gradually as one zooms in, bases on polygon area\n [zoom>=10][area>102400000],\n [zoom>=11][area>25600000],\n [zoom>=13][area>1600000],\n [zoom>=14][area>320000],\n [zoom>=15][area>80000],\n [zoom>=16][area>20000],\n [zoom>=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n text-halo-radius: 1.5;\n text-face-name:@sans_italic;\n text-size: 11;\n text-wrap-width:30;\n text-fill: @area_halo;\n text-halo-fill: @area_halo;\n \/\/ Specific style overrides for different types of areas:\n [type='park'][zoom>=10] {\n text-face-name: @sans_lt_italic;\n text-fill: darken(@park, 70%);\n text-halo-fill: lighten(@park, 10);\n }\n [type='golf_course'][zoom>=10] {\n text-fill: darken(@sports, 70%);\n text-halo-fill: lighten(@sports, 10);\n }\n [type='cemetery'][zoom>=10] {\n text-fill: darken(@cemetery, 70%);\n text-halo-fill: lighten(@cemetery, 10);\n }\n [type='hospital'][zoom>=10] {\n text-fill: darken(@hospital, 70%);\n text-halo-fill: lighten(@hospital, 10);\n }\n [type='college'][zoom>=10],\n [type='school'][zoom>=10],\n [type='university'][zoom>=10] {\n text-fill: darken(@school, 70%);\n text-halo-fill: lighten(@school, 10);\n }\n [type='water'][zoom>=10] {\n text-fill: darken(@water, 70%);\n text-halo-fill: lighten(@water, 10);\n }\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom=18][area>5000] {\n text-name: \"[name]\";\n text-size: 13;\n text-wrap-width: 60;\n text-character-spacing: 1;\n text-halo-radius: 2;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom=18][area>20000] {\n text-size: 15;\n text-character-spacing: 2;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 20;\n text-character-spacing: 3;\n text-wrap-width: 180;\n }\n}\n \n#poi[type='university'][zoom>=15],\n#poi[type='hospital'][zoom>=16],\n#poi[type='school'][zoom>=17],\n#poi[type='library'][zoom>=17] {\n text-name:\"[name]\";\n text-face-name:@sans;\n text-size:10;\n text-wrap-width:30;\n text-fill: @poi_text;\n}\n\n\n\/* ================================================================== *\/\n\/* WATERWAY LABELS\n\/* ================================================================== *\/\n\n#waterway_label[type='river'][zoom>=13],\n#waterway_label[type='canal'][zoom>=15],\n#waterway_label[type='stream'][zoom>=17] {\n text-name: '[name]';\n text-face-name: @sans_italic;\n text-fill: darken(@water, 70%);\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-placement: line;\n text-min-distance: 400;\n text-size: 10;\n [type='river'][zoom=15],\n [type='canal'][zoom=17] {\n text-size: 11;\n }\n [type='river'][zoom>=16],\n [type='canal'][zoom=18] {\n text-size: 14;\n text-spacing: 300;\n }\n}\n\n\/* ================================================================== *\/\n\/* ROAD LABELS\n\/* ================================================================== *\/\n\n#motorway_label[zoom>=11][zoom<=14][reflen<=8] {\n shield-name: \"[ref]\";\n shield-size: 9;\n shield-face-name: @sans_bold;\n shield-fill: #fff;\n shield-file: url(img\/shield-motorway-1.png);\n [type='motorway'] {\n [reflen=1] { shield-file: url(img\/shield-motorway-1.png); }\n [reflen=2] { shield-file: url(img\/shield-motorway-2.png); }\n [reflen=3] { shield-file: url(img\/shield-motorway-3.png); }\n [reflen=4] { shield-file: url(img\/shield-motorway-4.png); }\n [reflen=5] { shield-file: url(img\/shield-motorway-5.png); }\n [reflen=6] { shield-file: url(img\/shield-motorway-6.png); }\n [reflen=7] { shield-file: url(img\/shield-motorway-7.png); }\n [reflen=8] { shield-file: url(img\/shield-motorway-8.png); }\n }\n [type='trunk'] {\n [reflen=1] { shield-file: url(img\/shield-trunk-1.png); }\n [reflen=2] { shield-file: url(img\/shield-trunk-2.png); }\n [reflen=3] { shield-file: url(img\/shield-trunk-3.png); }\n [reflen=4] { shield-file: url(img\/shield-trunk-4.png); }\n [reflen=5] { shield-file: url(img\/shield-trunk-5.png); }\n [reflen=6] { shield-file: url(img\/shield-trunk-6.png); }\n [reflen=7] { shield-file: url(img\/shield-trunk-7.png); }\n [reflen=8] { shield-file: url(img\/shield-trunk-8.png); }\n }\n [zoom=11] { shield-min-distance: 60; } \/\/50\n [zoom=12] { shield-min-distance: 80; } \/\/60\n [zoom=13] { shield-min-distance: 120; } \/\/120\n [zoom=14] { shield-min-distance: 180; }\n}\n\n#motorway_label[type='motorway'][zoom>9],\n#motorway_label[type='trunk'][zoom>9] {\n text-name:\"[name]\";\n text-face-name:@sans_bold;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:10;\n [zoom=11] { text-min-distance:70; }\n [zoom=12] { text-min-distance:80; }\n [zoom=13] { text-min-distance:100; }\n}\n\n#mainroad_label[type='primary'][zoom>12],\n#mainroad_label[type='secondary'][zoom>13],\n#mainroad_label[type='tertiary'][zoom>13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n#minorroad_label[zoom>14] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-size:9;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n\/* ================================================================== *\/\n\/* ONE-WAY ARROWS\n\/* ================================================================== *\/\n\n#motorway_label[oneway!=0][zoom>=16],\n#mainroad_label[oneway!=0][zoom>=16],\n#minorroad_label[oneway!=0][zoom>=16] {\n marker-placement:line;\n marker-max-error: 0.5;\n marker-spacing: 200;\n marker-file: url(img\/icon\/oneway.svg);\n [oneway=-1] { marker-file: url(img\/icon\/oneway-reverse.svg); }\n [zoom=16] { marker-transform: \"scale(0.5)\"; }\n [zoom=17] { marker-transform: \"scale(0.75)\"; }\n}\n\n\n\/* ****************************************************************** *\/\n","old_contents":"\/* LABELS.MSS CONTENTS:\n * - place names\n * - area labels\n * - waterway labels \n *\/\n\n\/* Font sets are defined in palette.mss *\/\n\n\/* ================================================================== *\/\n\/* PLACE NAMES\n\/* ================================================================== *\/\n\n#place::country[type='country'][zoom>3][zoom<9] {\n text-name:'[name]';\n text-face-name:@sans_bold;\n text-placement:point;\n text-fill:@country_text;\n text-halo-fill: @country_halo;\n text-halo-radius: 1;\n [zoom=3] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=4] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>4] {\n text-halo-radius: 2;\n }\n [zoom=5] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=6] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=7] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n#place::state[type='state'][zoom>=6][zoom<=10] {\n text-name:'[name]';\n text-face-name:@sans_bold_italic;\n text-placement:point;\n text-fill:@state_text;\n text-halo-fill: @state_halo;\n text-halo-radius: 1;\n [zoom=6] {\n text-size:10 + @text_adjust;\n text-wrap-width: 40;\n }\n [zoom=7] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n }\n [zoom>8] {\n text-halo-radius: 2;\n }\n [zoom=8] {\n text-size:11 + @text_adjust;\n text-wrap-width: 50;\n text-line-spacing: 1;\n }\n [zoom=9] {\n text-size:12 + @text_adjust;\n text-character-spacing: 1;\n text-wrap-width: 80;\n text-line-spacing: 2;\n }\n [zoom=10] {\n text-size:14 + @text_adjust;\n text-character-spacing: 2;\n }\n}\n\n\/* ---- Cities ------------------------------------------------------ *\/\n\n#place::city[type='city'][zoom>=8][zoom<=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@city_text;\n text-halo-fill:@city_halo;\n text-halo-radius:2;\n [zoom<=8] {\n text-size: 11;\n text-halo-radius:2;\n }\n [zoom=9] {\n text-size:12;\n text-wrap-width: 60;\n }\n [zoom=10] {\n text-size:14;\n text-wrap-width: 70;\n }\n [zoom=11] {\n text-size:16;\n text-character-spacing: 1;\n text-wrap-width: 80;\n }\n [zoom=12] {\n text-size:18;\n text-character-spacing: 2;\n text-wrap-width: 200;\n }\n [zoom=13] {\n text-size:20;\n text-character-spacing: 4;\n text-wrap-width: 300;\n text-transform: uppercase;\n }\n [zoom=14] {\n text-size:22;\n text-character-spacing: 10;\n text-wrap-width: 500;\n text-transform: uppercase;\n }\n [zoom=15] {\n text-size:26;\n text-character-spacing: 16;\n text-wrap-width: 800;\n text-transform: uppercase;\n }\n}\n\n\/* ---- Towns ------------------------------------------------------- *\/\n\n#place::town[type='town'][zoom>=9][zoom<=17] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@town_text;\n text-size:9;\n text-halo-fill:@town_halo;\n text-halo-radius:2;\n text-wrap-width: 50;\n [zoom>=10] {\n text-halo-radius:2;\n text-size: 12;\n }\n [zoom>=11]{ \n text-size:14;\n }\n [zoom>=12]{\n text-size:16;\n text-line-spacing: 1;\n }\n [zoom>=13]{\n text-size:18;\n text-transform: uppercase;\n text-character-spacing: 8;\n text-line-spacing: 2;\n }\n [zoom>=14]{\n text-size:20;\n text-character-spacing: 2;\n text-line-spacing: 3;\n }\n [zoom>=15]{\n text-size:22;\n text-character-spacing: 3;\n text-line-spacing: 4;\n }\n [zoom>=16]{\n text-size:24;\n text-character-spacing: 4;\n text-line-spacing: 5;\n }\n [zoom>=17]{\n text-size:26;\n text-character-spacing: 5;\n text-line-spacing: 6;\n }\n}\n\n\/* ---- Other small places ------------------------------------------ *\/\n\n#place::small[type='village'][zoom>=13],\n#place::small[type='suburb'][zoom>=13],\n#place::small[type='hamlet'][zoom>=13],\n#place::small[type='neighbourhood'][zoom>=13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@other_text;\n text-size:10;\n text-halo-fill:@other_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=14] {\n text-size:14;\n text-character-spacing: 1;\n text-wrap-width: 120;\n text-line-spacing: 1;\n }\n [zoom>=15] {\n text-size:15;\n text-halo-radius: 2;\n text-transform: uppercase;\n text-character-spacing: 1;\n text-wrap-width: 180; \n text-line-spacing: 1;\n }\n [zoom>=16] {\n text-size:16;\n text-character-spacing: 2;\n text-wrap-width: 240;\n text-line-spacing: 2;\n } \n [zoom>=17] {\n text-size:17; \n text-character-spacing: 3;\n text-wrap-width: 320;\n text-line-spacing: 4;\n }\n [zoom>=18] {\n text-size:18;\n text-character-spacing: 4;\n text-line-spacing: 6;\n }\n}\n\n#place::small[type='locality'][zoom>=15] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:point;\n text-fill:@locality_text;\n text-size:9;\n text-halo-fill:@locality_halo;\n text-halo-radius:1;\n text-wrap-width: 30;\n [zoom>=16] {\n text-size:10;\n text-wrap-width: 60;\n text-line-spacing: 1;\n }\n [zoom>=17] {\n text-size:11;\n text-wrap-width: 120;\n text-line-spacing: 2;\n }\n [zoom>=18] {\n text-size:12;\n text-character-spacing: 1;\n text-line-spacing: 4;\n }\n}\n\n\n\/\/ =====================================================================\n\/\/ AREA LABELS\n\/\/ =====================================================================\n\n#area_label {\n \/\/ Bring in labels gradually as one zooms in, bases on polygon area\n [zoom>=10][area>102400000],\n [zoom>=11][area>25600000],\n [zoom>=13][area>1600000],\n [zoom>=14][area>320000],\n [zoom>=15][area>80000],\n [zoom>=16][area>20000],\n [zoom>=17][area>5000],\n [zoom>=18][area>=0] {\n text-name: \"[name]\";\n text-halo-radius: 1.5;\n text-face-name:@sans;\n text-size: 11;\n text-wrap-width:30;\n text-fill: #f00;\n text-halo-fill: #fff;\n \/\/ Specific style overrides for different types of areas:\n [type='park'][zoom>=10] {\n text-face-name: @sans_lt_italic;\n text-fill: darken(@park, 70%);\n text-halo-fill: lighten(@park, 10);\n }\n [type='golf_course'][zoom>=10] {\n text-fill: darken(@sports, 70%);\n text-halo-fill: lighten(@sports, 10);\n }\n [type='cemetery'][zoom>=10] {\n text-fill: darken(@cemetery, 70%);\n text-halo-fill: lighten(@cemetery, 10);\n }\n [type='hospital'][zoom>=10] {\n text-fill: darken(@hospital, 70%);\n text-halo-fill: lighten(@hospital, 10);\n }\n [type='college'][zoom>=10],\n [type='school'][zoom>=10],\n [type='university'][zoom>=10] {\n text-fill: darken(@school, 70%);\n text-halo-fill: lighten(@school, 10);\n }\n [type='water'][zoom>=10] {\n text-fill: darken(@water, 70%);\n text-halo-fill: lighten(@water, 10);\n }\n }\n [zoom=15][area>1600000],\n [zoom=16][area>80000],\n [zoom=17][area>20000],\n [zoom=18][area>5000] {\n text-name: \"[name]\";\n text-size: 13;\n text-wrap-width: 60;\n text-character-spacing: 1;\n text-halo-radius: 2;\n }\n [zoom=16][area>1600000],\n [zoom=17][area>80000],\n [zoom=18][area>20000] {\n text-size: 15;\n text-character-spacing: 2;\n text-wrap-width: 120;\n }\n [zoom>=17][area>1600000],\n [zoom>=18][area>80000] {\n text-size: 20;\n text-character-spacing: 3;\n text-wrap-width: 180;\n }\n}\n \n#poi[type='university'][zoom>=15],\n#poi[type='hospital'][zoom>=16],\n#poi[type='school'][zoom>=17],\n#poi[type='library'][zoom>=17] {\n text-name:\"[name]\";\n text-face-name:@sans;\n text-size:10;\n text-wrap-width:30;\n text-fill: @poi_text;\n}\n\n\n\/* ================================================================== *\/\n\/* WATERWAY LABELS\n\/* ================================================================== *\/\n\n#waterway_label[type='river'][zoom>=13],\n#waterway_label[type='canal'][zoom>=15],\n#waterway_label[type='stream'][zoom>=17] {\n text-name: '[name]';\n text-face-name: @sans_italic;\n text-fill: darken(@water, 70%);\n text-halo-fill: fadeout(lighten(@water,5%),25%);\n text-halo-radius: 1;\n text-placement: line;\n text-min-distance: 400;\n text-size: 10;\n [type='river'][zoom=15],\n [type='canal'][zoom=17] {\n text-size: 11;\n }\n [type='river'][zoom>=16],\n [type='canal'][zoom=18] {\n text-size: 14;\n text-spacing: 300;\n }\n}\n\n\/* ================================================================== *\/\n\/* ROAD LABELS\n\/* ================================================================== *\/\n\n#motorway_label[zoom>=11][zoom<=14][reflen<=8] {\n shield-name: \"[ref]\";\n shield-size: 9;\n shield-face-name: @sans_bold;\n shield-fill: #fff;\n shield-file: url(img\/shield-motorway-1.png);\n [type='motorway'] {\n [reflen=1] { shield-file: url(img\/shield-motorway-1.png); }\n [reflen=2] { shield-file: url(img\/shield-motorway-2.png); }\n [reflen=3] { shield-file: url(img\/shield-motorway-3.png); }\n [reflen=4] { shield-file: url(img\/shield-motorway-4.png); }\n [reflen=5] { shield-file: url(img\/shield-motorway-5.png); }\n [reflen=6] { shield-file: url(img\/shield-motorway-6.png); }\n [reflen=7] { shield-file: url(img\/shield-motorway-7.png); }\n [reflen=8] { shield-file: url(img\/shield-motorway-8.png); }\n }\n [type='trunk'] {\n [reflen=1] { shield-file: url(img\/shield-trunk-1.png); }\n [reflen=2] { shield-file: url(img\/shield-trunk-2.png); }\n [reflen=3] { shield-file: url(img\/shield-trunk-3.png); }\n [reflen=4] { shield-file: url(img\/shield-trunk-4.png); }\n [reflen=5] { shield-file: url(img\/shield-trunk-5.png); }\n [reflen=6] { shield-file: url(img\/shield-trunk-6.png); }\n [reflen=7] { shield-file: url(img\/shield-trunk-7.png); }\n [reflen=8] { shield-file: url(img\/shield-trunk-8.png); }\n }\n [zoom=11] { shield-min-distance: 60; } \/\/50\n [zoom=12] { shield-min-distance: 80; } \/\/60\n [zoom=13] { shield-min-distance: 120; } \/\/120\n [zoom=14] { shield-min-distance: 180; }\n}\n\n#motorway_label[type='motorway'][zoom>9],\n#motorway_label[type='trunk'][zoom>9] {\n text-name:\"[name]\";\n text-face-name:@sans_bold;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:10;\n [zoom=11] { text-min-distance:70; }\n [zoom=12] { text-min-distance:80; }\n [zoom=13] { text-min-distance:100; }\n}\n\n#mainroad_label[type='primary'][zoom>12],\n#mainroad_label[type='secondary'][zoom>13],\n#mainroad_label[type='tertiary'][zoom>13] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n#minorroad_label[zoom>14] {\n text-name:'[name]';\n text-face-name:@sans;\n text-placement:line;\n text-size:9;\n text-fill:@road_text;\n text-halo-fill:@road_halo;\n text-halo-radius:1;\n text-min-distance:60;\n text-size:11;\n}\n\n\/* ================================================================== *\/\n\/* ONE-WAY ARROWS\n\/* ================================================================== *\/\n\n#motorway_label[oneway!=0][zoom>=16],\n#mainroad_label[oneway!=0][zoom>=16],\n#minorroad_label[oneway!=0][zoom>=16] {\n marker-placement:line;\n marker-max-error: 0.5;\n marker-spacing: 200;\n marker-file: url(img\/icon\/oneway.svg);\n [oneway=-1] { marker-file: url(img\/icon\/oneway-reverse.svg); }\n [zoom=16] { marker-transform: \"scale(0.5)\"; }\n [zoom=17] { marker-transform: \"scale(0.75)\"; }\n}\n\n\n\/* ****************************************************************** *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"eb81dd40e02bb102bb9b02a20f10d8ca4680c8fe","subject":"Changing color of localities","message":"Changing color of localities","repos":"jeffaudi\/osm-hybrid","old_file":"osm-hybrid\/palette.mss","new_file":"osm-hybrid\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM HYBRID for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt:\t\"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \n\t\t\"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\",\n\t\t\"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\",\n\t\t\"unifont Medium\";\n\n@sans:\t\t\"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\",\n\t\t\"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\",\n\t\t\"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\",\n\t\t\"unifont Medium\";\n\n@sans_italic:\t\"Open Sans Semibold Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\",\n\t\t\"TSCu_Paranar Italic\", \"Mallige NormalItalic\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\",\n\t\t\"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold:\t\"Open Sans Bold\", \"DejaVu Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \n\t\t\"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\",\n\t\t\"Unifont Medium\", \"unifont Medium\"; \n\n\n@sans_lt_italic:\t\"Open Sans Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\",\n\t\t\t\"TSCu_Paranar Italic\", \"Mallige NormalItalic\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n\t\t\t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold_italic:\t\"Open Sans Bold Italic\", \"DejaVu Sans Bold Italic\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\",\n\t\t\t\"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\", \"DejaVu Sans Book\",\n\t\t\t\"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\",\n \t\"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #FCFBE7;\n@water: #C4DFF6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #DAF2C1;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n@building: #E4E0E0;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #E65C5C;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #E68A5C;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n@primary_line: #FFC859;\n@primary_fill: lighten(@primary_line,10%);\n@primary_case: @primary_line * 0.9;\n\n@secondary_line: #FFE873;\n@secondary_fill: lighten(@secondary_line,10%);\n@secondary_case: @secondary_line * 0.9;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #eee;\n@admin_3: #999;\n@admin_4: #60f;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_text: #fff;\n@place_halo: fadeout(#000,30%);\n\n@country_text: @place_text;\n@country_halo: @place_halo;\n\n@state_text: @place_text;\n@state_halo: @place_halo;\n\n@city_text: @place_text;\n@city_halo: @place_halo;\n\n@town_text: @place_text;\n@town_halo: @place_halo;\n\n@poi_text: #aaa;\n\n@road_text: #777;\n@road_halo: #fff;\n\n@other_text: @place_text;\n@other_halo: @place_halo;\n\n\/* Name of localities *\/\n@locality_text: #90c;\n@locality_halo: @place_halo;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: @place_text;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n\n\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM HYBRID for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt:\t\"Open Sans Regular\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\", \n\t\t\"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\",\n\t\t\"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\",\n\t\t\"unifont Medium\";\n\n@sans:\t\t\"Open Sans Semibold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\", \"Padauk Regular\",\n\t\t\"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\",\n\t\t\"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\",\n\t\t\"unifont Medium\";\n\n@sans_italic:\t\"Open Sans Semibold Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\",\n\t\t\"TSCu_Paranar Italic\", \"Mallige NormalItalic\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\",\n\t\t\"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold:\t\"Open Sans Bold\", \"DejaVu Sans Bold\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\", \"Padauk Bold\", \n\t\t\"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\", \"Droid Sans Fallback Regular\",\n\t\t\"Unifont Medium\", \"unifont Medium\"; \n\n\n@sans_lt_italic:\t\"Open Sans Italic\", \"DejaVu Sans Italic\", \"DejaVu Sans Oblique\", \"Arundina Sans Italic\",\n\t\t\t\"TSCu_Paranar Italic\", \"Mallige NormalItalic\", \"DejaVu Sans Book\", \"Arundina Sans Regular\",\n\t\t\t\"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\", \"Mukti Narrow Regular\", \"gargi Medium\",\n\t\t\t\"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\", \"Mallige Normal\",\n\t\t\t\"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n@sans_bold_italic:\t\"Open Sans Bold Italic\", \"DejaVu Sans Bold Italic\", \"DejaVu Sans Bold\", \"Arundina Sans Bold\",\n\t\t\t\"Padauk Bold\", \"Mukti Narrow Bold\", \"TSCu_Paranar Bold\", \"Mallige Bold\", \"DejaVu Sans Book\",\n\t\t\t\"Arundina Sans Regular\", \"Padauk Regular\", \"Khmer OS Metal Chrieng Regular\",\n \t\"Mukti Narrow Regular\", \"gargi Medium\", \"TSCu_Paranar Regular\", \"Tibetan Machine Uni Regular\",\n \t\"Mallige Normal\", \"Droid Sans Fallback Regular\", \"Unifont Medium\", \"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: #FCFBE7;\n@water: #C4DFF6;\n@grass: #E6F2C1;\n@beach: #FFEEC7;\n@park: #DAF2C1;\n@cemetery: #D6DED2;\n@wooded: #C3D9AD;\n@agriculture: #F2E8B6;\n\n@building: #E4E0E0;\n@hospital: rgb(229,198,195);\n@school: #FFF5CC;\n@sports: #B8E6B8;\n\n@residential: @land * 0.98;\n@commercial: @land * 0.97;\n@industrial: @land * 0.96;\n@parking: #EEE;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: #E65C5C;\n@motorway_fill: lighten(@motorway_line,10%);\n@motorway_case: @motorway_line * 0.9;\n\n@trunk_line: #E68A5C;\n@trunk_fill: lighten(@trunk_line,10%);\n@trunk_case: @trunk_line * 0.9;\n\n@primary_line: #FFC859;\n@primary_fill: lighten(@primary_line,10%);\n@primary_case: @primary_line * 0.9;\n\n@secondary_line: #FFE873;\n@secondary_fill: lighten(@secondary_line,10%);\n@secondary_case: @secondary_line * 0.9;\n\n@standard_line: @land * 0.85;\n@standard_fill: #fff;\n@standard_case: @land * 0.9;\n\n@pedestrian_line: @standard_line;\n@pedestrian_fill: #FAFAF5;\n@pedestrian_case: @land;\n\n@cycle_line: @standard_line;\n@cycle_fill: #FAFAF5;\n@cycle_case: @land;\n\n@rail_line: #999;\n@rail_fill: #fff;\n@rail_case: @land;\n\n@aeroway: #ddd;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: #eee;\n@admin_3: #999;\n@admin_4: #60f;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_text: #fff;\n@place_halo: fadeout(#000,30%);\n\n@country_text: @place_text;\n@country_halo: @place_halo;\n\n@state_text: @place_text;\n@state_halo: @place_halo;\n\n@city_text: @place_text;\n@city_halo: @place_halo;\n\n@town_text: @place_text;\n@town_halo: @place_halo;\n\n@poi_text: #aaa;\n\n@road_text: #777;\n@road_halo: #fff;\n\n@other_text: @place_text;\n@other_halo: @place_halo;\n\n@locality_text: #f00;\n@locality_halo: #fff;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: @place_text;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n\n\n\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"73d9ee31db373441f985c6d6f312800f0f856cf5","subject":"Update palette.mss","message":"Update palette.mss","repos":"brelevenix\/osm-bright-tregor","old_file":"osm-bright\/palette.mss","new_file":"osm-bright\/palette.mss","new_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Open Sans Regular\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_lt_italic: \"Open Sans Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans: \"Open Sans Semibold\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_italic: \"Open Sans Semibold Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans_bold: \"Open Sans Bold\",\"DejaVu Sans Bold\",\"unifont Medium\";\n@sans_bold_italic: \"Open Sans Bold Italic\",\"DejaVu Sans Bold Italic\",\"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* COLOR PALETTE\n\/* ================================================================== *\/\n@grey1: #595959;\n@black: #000000; \n@white: #ffffff;\n@grey2: #8F8F8F;\n@grey3: #D6D6D6;\n@orange: #FF6600;\n@blue: #4BB4E6;\n@yellow: #FFDC00;\n@green: #50BE87;\n@purple: #9164CD;\n@pink: #FFB4E6;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: @green;\n@water: @blue;\n@grass: @green;\n@beach: @yellow;\n@park: @green;\n@cemetery: @grey;\n@wooded: @green;\n@agriculture: @green;\n\n@building: @grey2;\n@hospital: @grey2;\n@school: @grey2;\n@sports: @grey2;\n\n@residential: @grey;\n@commercial: @grey;\n@industrial: @grey;\n@parking: @grey;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: @black;\n@motorway_fill: lighten(@motorway_line,80%);\n@motorway_case: @motorway_line * 0.8;\n\n@trunk_line: @black;\n@trunk_fill: lighten(@trunk_line,70%);\n@trunk_case: @trunk_line * 0.7;\n\n@primary_line: @black;\n@primary_fill: lighten(@primary_line,60%);\n@primary_case: @primary_line * 0.6;\n\n@secondary_line: @black;\n@secondary_fill: lighten(@secondary_line,50%);\n@secondary_case: @secondary_line * 0.5;\n\n@standard_line: @black;\n@standard_fill: @white;\n@standard_case: @black;\n\n@pedestrian_line: @black;\n@pedestrian_fill: @white;\n@pedestrian_case: @black;\n\n@cycle_line: @black;\n@cycle_fill: @white;\n@cycle_case: @black;\n\n@rail_line: @black;\n@rail_fill: @black;\n@rail_case: @black;\n\n@aeroway: @black;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: @purple;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,0%);\n\n@country_text: @black;\n@country_halo: @place_halo;\n\n@state_text: @black;\n@state_halo: @place_halo;\n\n@city_text: @black;\n@city_halo: @place_halo;\n\n@town_text: @black;\n@town_halo: @place_halo;\n\n@poi_text: @black;\n\n@road_text: @black;\n@road_halo: @place_halo;\n\n@other_text: @black;\n@other_halo: @place_halo;\n\n@locality_text: @black;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: @black;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n","old_contents":"\/* ****************************************************************** *\/\n\/* OSM BRIGHT for Imposm *\/\n\/* ****************************************************************** *\/\n\n\/* For basic style customization you can simply edit the colors and\n * fonts defined in this file. For more detailed \/ advanced\n * adjustments explore the other files.\n *\n * GENERAL NOTES\n *\n * There is a slight performance cost in rendering line-caps. An\n * effort has been made to restrict line-cap definitions to styles\n * where the results will be visible (lines at least 2 pixels thick).\n *\/\n\n\/* ================================================================== *\/\n\/* FONTS\n\/* ================================================================== *\/\n\n\/* directory to load fonts from in addition to the system directories *\/\nMap { font-directory: url(.\/fonts); }\n\n\/* set up font sets for various weights and styles *\/\n@sans_lt: \"Open Sans Regular\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_lt_italic: \"Open Sans Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans: \"Open Sans Semibold\",\"DejaVu Sans Book\",\"unifont Medium\";\n@sans_italic: \"Open Sans Semibold Italic\",\"DejaVu Sans Italic\",\"unifont Medium\";\n@sans_bold: \"Open Sans Bold\",\"DejaVu Sans Bold\",\"unifont Medium\";\n@sans_bold_italic: \"Open Sans Bold Italic\",\"DejaVu Sans Bold Italic\",\"unifont Medium\";\n\n\/* Some fonts are larger or smaller than others. Use this variable to\n globally increase or decrease the font sizes. *\/\n\/* Note this is only implemented for certain things so far *\/\n@text_adjust: 0;\n\n\/* ================================================================== *\/\n\/* COLOR PALETTE\n\/* ================================================================== *\/\n@grey1: #595959;\n@black: #000000; \n@white: #ffffff;\n@grey2: #8F8F8F;\n@grey3: #D6D6D6;\n@orange: #FF6600;\n@blue: #4BB4E6;\n@yellow: #FFDC00;\n@green: #50BE87;\n@purple: #9164CD;\n@pink: #FFB4E6;\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER COLORS\n\/* ================================================================== *\/\n\n@land: @white;\n@water: @blue;\n@grass: @green;\n@beach: @yellow;\n@park: @green;\n@cemetery: @white;\n@wooded: @green;\n@agriculture: @white;\n\n@building: @orange;\n@hospital: @white;\n@school: @white;\n@sports: @green;\n\n@residential: @white;\n@commercial: @white;\n@industrial: @white;\n@parking: @white;\n\n\/* ================================================================== *\/\n\/* ROAD COLORS\n\/* ================================================================== *\/\n\n\/* For each class of road there are three color variables:\n * - line: for lower zoomlevels when the road is represented by a\n * single solid line.\n * - case: for higher zoomlevels, this color is for the road's\n * casing (outline).\n * - fill: for higher zoomlevels, this color is for the road's\n * inner fill (inline).\n *\/\n\n@motorway_line: @black;\n@motorway_fill: lighten(@motorway_line,80%);\n@motorway_case: @motorway_line * 0.8;\n\n@trunk_line: @black;\n@trunk_fill: lighten(@trunk_line,70%);\n@trunk_case: @trunk_line * 0.7;\n\n@primary_line: @black;\n@primary_fill: lighten(@primary_line,60%);\n@primary_case: @primary_line * 0.6;\n\n@secondary_line: @black;\n@secondary_fill: lighten(@secondary_line,50%);\n@secondary_case: @secondary_line * 0.5;\n\n@standard_line: @black;\n@standard_fill: @white;\n@standard_case: @black;\n\n@pedestrian_line: @black;\n@pedestrian_fill: @white;\n@pedestrian_case: @black;\n\n@cycle_line: @black;\n@cycle_fill: @white;\n@cycle_case: @black;\n\n@rail_line: @black;\n@rail_fill: @black;\n@rail_case: @black;\n\n@aeroway: @black;\n\n\/* ================================================================== *\/\n\/* BOUNDARY COLORS\n\/* ================================================================== *\/\n\n@admin_2: @purple;\n\n\/* ================================================================== *\/\n\/* LABEL COLORS\n\/* ================================================================== *\/\n\n\/* We set up a default halo color for places so you can edit them all\n at once or override each individually. *\/\n@place_halo: fadeout(#fff,0%);\n\n@country_text: @black;\n@country_halo: @place_halo;\n\n@state_text: @black;\n@state_halo: @place_halo;\n\n@city_text: @black;\n@city_halo: @place_halo;\n\n@town_text: @black;\n@town_halo: @place_halo;\n\n@poi_text: @black;\n\n@road_text: @black;\n@road_halo: @place_halo;\n\n@other_text: @black;\n@other_halo: @place_halo;\n\n@locality_text: @black;\n@locality_halo: @land;\n\n\/* Also used for other small places: hamlets, suburbs, localities *\/\n@village_text: @black;\n@village_halo: @place_halo;\n\n\/* ****************************************************************** *\/\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"34882c9c3065149a169918ccbeffb13b21284c77","subject":"minor text fixes","message":"minor text fixes\n","repos":"silph-io\/osm-silph","old_file":"osm-bright\/base.mss","new_file":"osm-bright\/base.mss","new_contents":"\/* BASE.MSS CONTENTS\n * - Landuse & landcover\n * - Water areas\n * - Water ways\n * - Administrative Boundaries\n *\n *\/\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER\n\/* ================================================================== *\/\n\n#land-low[zoom>=0][zoom<10],\n#land-high[zoom>=10] {\n polygon-fill: @land;\n polygon-gamma: 0.75;\n}\n\n#landuse_gen0[zoom>3][zoom<=9],\n#landuse_gen1[zoom>9][zoom<=12],\n#landuse[zoom>12] {\n [type='cemetery'] { polygon-fill: @cemetery; }\n [type='college'] { polygon-fill: @school; }\n [type='commercial'] { polygon-fill: @industrial; }\n [type='common'] { polygon-fill: @park; }\n [type='forest'] { polygon-fill: @wooded; }\n [type='golf_course'] { polygon-fill: @sports; }\n [type='grass'] { polygon-fill: @grass; }\n [type='hospital'] { polygon-fill: @hospital; }\n [type='industrial'] { polygon-fill: @industrial; }\n [type='park'] { polygon-fill: @park; }\n [type='parking'] { polygon-fill: @parking; }\n [type='pedestrian'] { polygon-fill: @pedestrian_fill; }\n [type='pitch'] { polygon-fill: @sports; }\n [type='residential'] { polygon-fill: @residential; }\n [type='school'] { polygon-fill: @school; }\n [type='sports_center'] { polygon-fill: @sports; }\n [type='stadium'] { polygon-fill: @sports; }\n [type='university'] { polygon-fill: @school; }\n [type='wood'] { polygon-fill: @wooded; }\n}\n\n#landuse_overlays[type='pedestrian'][zoom<=15] {\n line-width: 0.0;\n}\n\n#landuse_overlays[type='nature_reserve'][zoom>6] {\n line-color: darken(@wooded,25%);\n line-opacity: 0.3;\n line-dasharray: 1,1;\n polygon-fill: darken(@wooded,25%);\n polygon-opacity: 0.1;\n [zoom=7] { line-width: 0.4; }\n [zoom=8] { line-width: 0.6; }\n [zoom=9] { line-width: 0.8; }\n [zoom=10] { line-width: 1.0; }\n [zoom=11] { line-width: 1.5; }\n [zoom>=12] { line-width: 2.0; }\n}\n \n#landuse_overlays[type='wetland'][zoom>11] {\n [zoom>11][zoom<=14] { polygon-pattern-file:url(img\/marsh-16.png); }\n [zoom>14] { polygon-pattern-file:url(img\/marsh-32.png);}\n }\n\n\/* ---- BUILDINGS ---- *\/\n#buildings[zoom=16] {\n polygon-fill:@building;\n line-color:darken(@building,10%);\n line-width:0.4;\n}\n\/\/ At the highest zoom levels, render buildings in fancy pseudo-3D.\n\/\/ Ordering polygons by their Y-position is necessary for this effect\n\/\/ so we use a separate layer that does this for us.\n#buildings[zoom>=17][type != 'hedge'] {\n building-fill:@building;\n building-height:1.25;\n}\n\n#buildings[zoom>=17][type = 'hedge'] {\n building-fill:@wooded;\n building-height:1.25;\n}\n\n\/* ================================================================== *\/\n\/* WATER AREAS\n\/* ================================================================== *\/\n\nMap { background-color: @water; }\n\n#water_gen0[zoom>3][zoom<=9],\n#water_gen1[zoom>9][zoom<=12],\n#water[zoom>12] {\n polygon-fill: @water;\n}\n\n\/* ================================================================== *\/\n\/* WATER WAYS\n\/* ================================================================== *\/\n\n#waterway_low[zoom>=8][zoom<=12] {\n line-color: @water;\n [zoom=8] { line-width: 0.1; }\n [zoom=9] { line-width: 0.2; }\n [zoom=10]{ line-width: 0.4; }\n [zoom=11]{ line-width: 0.6; }\n [zoom=12]{ line-width: 0.8; }\n}\n\n#waterway_med[zoom>=13][zoom<=14] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=13]{ line-width: 1; }\n [zoom=14]{ line-width: 1.5; }\n }\n [type='stream'] {\n [zoom=13]{ line-width: 0.2; }\n [zoom=14]{ line-width: 0.4; }\n }\n}\n \n#waterway_high[zoom>=15] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=15]{ line-width: 2; }\n [zoom=16]{ line-width: 3; }\n [zoom=17]{ line-width: 4; }\n [zoom=18]{ line-width: 5; }\n [zoom=19]{ line-width: 6; }\n [zoom>19]{ line-width: 7; }\n }\n [type='stream'] {\n [zoom=15]{ line-width: 0.6; }\n [zoom=16]{ line-width: 0.8; }\n [zoom=17]{ line-width: 1; }\n [zoom=18]{ line-width: 1.5; }\n [zoom>18]{ line-width: 2; }\n }\n [type='ditch'],\n [type='drain'] {\n [zoom=15]{ line-width: 0.1; }\n [zoom=16]{ line-width: 0.3; }\n [zoom=17]{ line-width: 0.5; }\n [zoom=18]{ line-width: 0.7; }\n [zoom=19]{ line-width: 1; }\n [zoom>19]{ line-width: 1.5; }\n }\n}\n\n\/* ================================================================== *\/\n\/* ADMINISTRATIVE BOUNDARIES\n\/* ================================================================== *\/\n\n\n#admin[admin_level='2'][zoom>1] {\n line-color:@admin_2;\n line-width:0.5;\n [zoom=2] { line-opacity: 0.25; }\n [zoom=3] { line-opacity: 0.3; }\n [zoom=4] { line-opacity: 0.4; }\n}\n\n#admin[admin_level='4'][zoom>1] {\n line-color:@admin_2;\n line-width: 0.5;\n line-dasharray: 10, 3, 2, 3;\n}\n\n\/* ================================================================== *\/\n\/* BARRIER POINTS\n\/* ================================================================== *\/\n\n\n#barrier_points[zoom>=17][stylegroup = 'divider'] {\n marker-height: 2;\n marker-fill: #c7c7c7;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n\n\/* ================================================================== *\/\n\/* BARRIER LINES\n\/* ================================================================== *\/\n\n#barrier_lines[zoom>=17][stylegroup = 'gate'] {\n line-width:2.5;\n line-color:#aab;\n line-dasharray:3,2;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'fence'] {\n line-width:1.75;\n line-color:#aab;\n line-dasharray:1,1;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'hedge'] {\n line-width:3;\n line-color:darken(@park,5%);\n}\n","old_contents":"\/* BASE.MSS CONTENTS\n * - Landuse & landcover\n * - Water areas\n * - Water ways\n * - Administrative Boundaries\n *\n *\/\n\n\/* ================================================================== *\/\n\/* LANDUSE & LANDCOVER\n\/* ================================================================== *\/\n\n#land-low[zoom>=0][zoom<10],\n#land-high[zoom>=10] {\n polygon-fill: @land;\n polygon-gamma: 0.75;\n}\n\n#landuse_gen0[zoom>3][zoom<=9],\n#landuse_gen1[zoom>9][zoom<=12],\n#landuse[zoom>12] {\n [type='cemetery'] { polygon-fill: @cemetery; }\n [type='college'] { polygon-fill: @school; }\n [type='commercial'] { polygon-fill: @industrial; }\n [type='common'] { polygon-fill: @park; }\n [type='forest'] { polygon-fill: @wooded; }\n [type='golf_course'] { polygon-fill: @sports; }\n [type='grass'] { polygon-fill: @grass; }\n [type='hospital'] { polygon-fill: @hospital; }\n [type='industrial'] { polygon-fill: @industrial; }\n [type='park'] { polygon-fill: @park; }\n [type='parking'] { polygon-fill: @parking; }\n [type='pedestrian'] { polygon-fill: @pedestrian_fill; }\n [type='pitch'] { polygon-fill: @sports; }\n [type='residential'] { polygon-fill: @residential; }\n [type='school'] { polygon-fill: @school; }\n [type='sports_center'] { polygon-fill: @sports; }\n [type='stadium'] { polygon-fill: @sports; }\n [type='university'] { polygon-fill: @school; }\n [type='wood'] { polygon-fill: @wooded; }\n}\n\n#landuse_overlays[type='pedestrian'][zoom<=15] {\n line-width: 0.0;\n}\n\n#landuse_overlays[type='nature_reserve'][zoom>6] {\n line-color: darken(@wooded,25%);\n line-opacity: 0.3;\n line-dasharray: 1,1;\n polygon-fill: darken(@wooded,25%);\n polygon-opacity: 0.1;\n [zoom=7] { line-width: 0.4; }\n [zoom=8] { line-width: 0.6; }\n [zoom=9] { line-width: 0.8; }\n [zoom=10] { line-width: 1.0; }\n [zoom=11] { line-width: 1.5; }\n [zoom>=12] { line-width: 2.0; }\n}\n \n#landuse_overlays[type='wetland'][zoom>11] {\n [zoom>11][zoom<=14] { polygon-pattern-file:url(img\/marsh-16.png); }\n [zoom>14] { polygon-pattern-file:url(img\/marsh-32.png);}\n }\n\n\/* ---- BUILDINGS ---- *\/\n#buildings[zoom=16] {\n polygon-fill:@building;\n line-color:darken(@building,10%);\n line-width:0.4;\n}\n\/\/ At the highest zoom levels, render buildings in fancy pseudo-3D.\n\/\/ Ordering polygons by their Y-position is necessary for this effect\n\/\/ so we use a separate layer that does this for us.\n#buildings[zoom>=17][type != 'hedge'] {\n building-fill:@building;\n building-height:1.25;\n}\n\n#buildings[zoom>=17][type = 'hedge'] {\n building-fill:@wooded;\n building-height:1.25;\n}\n\n\/* ================================================================== *\/\n\/* WATER AREAS\n\/* ================================================================== *\/\n\nMap { background-color: @water; }\n\n#water_gen0[zoom>3][zoom<=9],\n#water_gen1[zoom>9][zoom<=12],\n#water[zoom>12] {\n polygon-fill: @water;\n}\n\n\/* ================================================================== *\/\n\/* WATER WAYS\n\/* ================================================================== *\/\n\n#waterway_low[zoom>=8][zoom<=12] {\n line-color: @water;\n [zoom=8] { line-width: 0.1; }\n [zoom=9] { line-width: 0.2; }\n [zoom=10]{ line-width: 0.4; }\n [zoom=11]{ line-width: 0.6; }\n [zoom=12]{ line-width: 0.8; }\n}\n\n#waterway_med[zoom>=13][zoom<=14] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=13]{ line-width: 1; }\n [zoom=14]{ line-width: 1.5; }\n }\n [type='stream'] {\n [zoom=13]{ line-width: 0.2; }\n [zoom=14]{ line-width: 0.4; }\n }\n}\n \n#waterway_high[zoom>=15] {\n line-color: @water;\n [type='river'],\n [type='canal'] {\n line-cap: round;\n line-join: round;\n [zoom=15]{ line-width: 2; }\n [zoom=16]{ line-width: 3; }\n [zoom=17]{ line-width: 4; }\n [zoom=18]{ line-width: 5; }\n [zoom=19]{ line-width: 6; }\n [zoom>19]{ line-width: 7; }\n }\n [type='stream'] {\n [zoom=15]{ line-width: 0.6; }\n [zoom=16]{ line-width: 0.8; }\n [zoom=17]{ line-width: 1; }\n [zoom=18]{ line-width: 1.5; }\n [zoom>18]{ line-width: 2; }\n }\n [type='ditch'],\n [type='drain'] {\n [zoom=15]{ line-width: 0.1; }\n [zoom=16]{ line-width: 0.3; }\n [zoom=17]{ line-width: 0.5; }\n [zoom=18]{ line-width: 0.7; }\n [zoom=19]{ line-width: 1; }\n [zoom>19]{ line-width: 1.5; }\n }\n}\n\n\/* ================================================================== *\/\n\/* ADMINISTRATIVE BOUNDARIES\n\/* ================================================================== *\/\n\n\n#admin[admin_level='2'][zoom>1] {\n line-color:@admin_2;\n line-width:0.5;\n [zoom=2] { line-opacity: 0.25; }\n [zoom=3] { line-opacity: 0.3; }\n [zoom=4] { line-opacity: 0.4; }\n}\n\n#admin[admin_level>=3][zoom>1] {\n line-color:@admin_2;\n line-width: 0.5;\n line-dasharray: 10, 3, 2, 3;\n}\n\n\/* ================================================================== *\/\n\/* BARRIER POINTS\n\/* ================================================================== *\/\n\n\n#barrier_points[zoom>=17][stylegroup = 'divider'] {\n marker-height: 2;\n marker-fill: #c7c7c7;\n marker-line-opacity:0;\n marker-allow-overlap:true;\n}\n\n\/* ================================================================== *\/\n\/* BARRIER LINES\n\/* ================================================================== *\/\n\n#barrier_lines[zoom>=17][stylegroup = 'gate'] {\n line-width:2.5;\n line-color:#aab;\n line-dasharray:3,2;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'fence'] {\n line-width:1.75;\n line-color:#aab;\n line-dasharray:1,1;\n}\n\n#barrier_lines[zoom>=17][stylegroup = 'hedge'] {\n line-width:3;\n line-color:darken(@park,5%);\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"CartoCSS"} {"commit":"55a9aa6f9798aed08ecb2e5aed0fe04dad8f2049","subject":"some style changes","message":"some style changes\n","repos":"pdxmele\/PDX-bike-map-public,pdxmele\/PDX-bike-map-public","old_file":"supporting_files\/style.mss","new_file":"supporting_files\/style.mss","new_contents":"Map {\n}\n\/* zoom > 15 (16 and 17)*\/\n\n\/\/designated bikeways, nothing else\n#bikes [zoom > 15][\"bicycle\"='designated']\n {\n line-color:#00ffcc;\n line-width:6;\n opacity: .6;\n}\n\/\/bike lanes\n#bikes [zoom > 15][\"cycleway\"='lane']\n {\n line-color:#2500ff;\n line-width:6;\n opacity: .6;\n}\n\/\/sharrows\n#bikes [zoom > 15][\"cycleway\"='shared_lane']\n {\n line-color:#01df23;\n line-width:6;\n opacity: .6;\n}\n\/\/cycletracks\n#bikes [zoom > 15][\"cycleway\"='track']\n {\n line-color:#ff6cf0;\n line-width:6;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom > 15][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:6;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom > 15][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:6;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom > 15][\"RLIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:6;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom > 15][\"CCGIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:6;\n opacity: .6;\n}\n\/\/separated paths\n#bikes [zoom > 15][\"highway\"='path']\n {\n line-color:#d7008c;\n line-width:6;\n line-dasharray: 2,2,2;\n opacity: .6;\n}\n#bikes [zoom > 15][\"highway\"='cycleway']\n {\n line-color:#d7008c;\n line-width:6;\n line-dasharray: 2,2,2;\n opacity: .6;\n}\n#bikes [zoom > 15][\"highway\"='footway'][\"bicycle\"='designated']\n {\n line-color:#d7008c;\n line-width:6;\n line-dasharray: 2,2,2;\n opacity: .6;\n} \n#bikes [zoom > 15][\"highway\"='footway'][\"bicycle\"='yes']\n {\n line-color:#d7008c;\n line-width:6;\n line-dasharray: 2,2,2;\n opacity: .6;\n} \n\n\/* zoom = 15 *\/\n\n\/\/designated bikeways, nothing else\n#bikes [zoom = 15][\"bicycle\"='designated']\n {\n line-color:#00ffcc;\n line-width:4;\n opacity: .6;\n}\n\/\/bike lanes\n#bikes [zoom = 15][\"cycleway\"='lane']\n {\n line-color:#2500ff;\n line-width:4;\n opacity: .6;\n}\n\/\/sharrows\n#bikes [zoom = 15][\"cycleway\"='shared_lane']\n {\n line-color:#01df23;\n line-width:4;\n opacity: .6;\n}\n\/\/cycletracks\n#bikes [zoom = 15][\"cycleway\"='track']\n {\n line-color:#ff6cf0;\n line-width:4;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom = 15][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:4;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom = 15][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:4;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom = 15][\"RLIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:4;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom = 15][\"CCGIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:4;\n opacity: .6;\n}\n\/\/separated paths\n#bikes [zoom = 15][\"highway\"='path']\n {\n line-color:#d7008c;\n line-width:4;\n line-dasharray: 2,2,2;\n opacity: .6;\n}\n#bikes [zoom = 15][\"highway\"='cycleway']\n {\n line-color:#d7008c;\n line-width:4;\n line-dasharray: 2,2,2;\n opacity: .6;\n}\n#bikes [zoom = 15][\"highway\"='footway'][\"bicycle\"='designated']\n {\n line-color:#d7008c;\n line-width:4;\n line-dasharray: 2,2,2;\n opacity: .6;\n} \n#bikes [zoom = 15][\"highway\"='footway'][\"bicycle\"='yes']\n {\n line-color:#d7008c;\n line-width:4;\n line-dasharray: 2,2,2;\n opacity: .6;\n} \n\n\/* zoom = 14 *\/\n\n\/\/designated bikeways, nothing else\n#bikes [zoom = 14][\"bicycle\"='designated']\n {\n line-color:#00ffcc;\n line-width:3;\n opacity: .6;\n}\n\/\/bike lanes\n#bikes [zoom = 14][\"cycleway\"='lane']\n {\n line-color:#2500ff;\n line-width:3;\n opacity: .6;\n}\n\/\/sharrows\n#bikes [zoom = 14][\"cycleway\"='shared_lane']\n {\n line-color:#01df23;\n line-width:3;\n opacity: .6;\n}\n\/\/cycletracks\n#bikes [zoom = 14][\"cycleway\"='track']\n {\n line-color:#ff6cf0;\n line-width:3;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom = 14][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:3;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom = 14][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:3;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom = 14][\"RLIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:3;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom = 14][\"CCGIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:3;\n opacity: .6;\n}\n\/\/separated paths\n#bikes [zoom = 14][\"highway\"='path']\n {\n line-color:#d7008c;\n line-width:3;\n line-dasharray: 2,2,2;\n opacity: .6;\n}\n#bikes [zoom = 14][\"highway\"='cycleway']\n {\n line-color:#d7008c;\n line-width:3;\n line-dasharray: 2,2,2;\n opacity: .6;\n}\n#bikes [zoom = 14][\"highway\"='footway'][\"bicycle\"='designated']\n {\n line-color:#d7008c;\n line-width:3;\n line-dasharray: 2,2,2;\n opacity: .6;\n} \n#bikes [zoom = 14][\"highway\"='footway'][\"bicycle\"='yes']\n {\n line-color:#d7008c;\n line-width:3;\n line-dasharray: 2,2,2;\n opacity: .6;\n} \n\n\/*11 < zoom < 14 (12 and 13) *\/\n\n\/\/designated bikeways, nothing else\n#bikes [zoom > 11][zoom < 14][\"bicycle\"='designated']\n {\n line-color:#00ffcc;\n line-width:2;\n opacity: .6;\n}\n\/\/bike lanes\n#bikes [zoom > 11][zoom < 14][\"cycleway\"='lane']\n {\n line-color:#2500ff;\n line-width:2;\n opacity: .6;\n}\n\/\/sharrows\n#bikes [zoom > 11][zoom < 14][\"cycleway\"='shared_lane']\n {\n line-color:#01df23;\n line-width:2;\n opacity: .6;\n}\n\/\/cycletracks\n#bikes [zoom > 11][zoom < 14][\"cycleway\"='track']\n {\n line-color:#ff6cf0;\n line-width:2;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom > 11][zoom < 14][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:2;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom > 11][zoom < 14][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:2;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom > 11][zoom < 14][\"RLIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:2;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom > 11][zoom < 14][\"CCGIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:2;\n opacity: .6;\n}\n\/\/separated paths\n#bikes [zoom > 11][zoom < 14][\"highway\"='path']\n {\n line-color:#d7008c;\n line-width:2;\n line-dasharray: 2,2,2;\n opacity: .6;\n}\n#bikes [zoom > 11][zoom < 14][\"highway\"='cycleway']\n {\n line-color:#d7008c;\n line-width:2;\n line-dasharray: 2,2,2;\n opacity: .6;\n}\n#bikes [zoom > 11][zoom < 14][\"highway\"='footway'][\"bicycle\"='designated']\n {\n line-color:#d7008c;\n line-width:2;\n line-dasharray: 2,2,2;\n opacity: .6;\n} \n#bikes [zoom > 11][zoom < 14][\"highway\"='footway'][\"bicycle\"='yes']\n {\n line-color:#d7008c;\n line-width:2;\n line-dasharray: 2,2,2;\n opacity: .6;\n} \n\n\/*zoom < 12 (10 and 11) *\/\n\n\/\/designated bikeways, nothing else\n#bikes [zoom < 12][\"bicycle\"='designated']\n {\n line-color:#00ffcc;\n line-width:1;\n opacity: .6;\n}\n\/\/bike lanes\n#bikes [zoom < 12][\"cycleway\"='lane']\n {\n line-color:#2500ff;\n line-width:1;\n opacity: .6;\n}\n\/\/sharrows\n#bikes [zoom < 12][\"cycleway\"='shared_lane']\n {\n line-color:#01df23;\n line-width:1;\n opacity: .6;\n}\n\/\/cycletracks\n#bikes [zoom < 12][\"cycleway\"='track']\n {\n line-color:#ff6cf0;\n line-width:1;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom < 12][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:1;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom < 12][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:1;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom < 12][\"RLIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:1;\n opacity: .6;\n}\n\/\/shared bus lanes\n#bikes [zoom < 12][\"CCGIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:1;\n opacity: .6;\n}\n\/\/separated paths\n#bikes [zoom < 12][\"highway\"='path']\n {\n line-color:#d7008c;\n line-width:1;\n line-dasharray: 2,2,2;\n opacity: .6;\n}\n#bikes [zoom < 12][\"highway\"='cycleway']\n {\n line-color:#d7008c;\n line-width:1;\n line-dasharray: 2,2,2;\n opacity: .6;\n}\n#bikes [zoom < 12][\"highway\"='footway'][\"bicycle\"='designated']\n {\n line-color:#d7008c;\n line-width:1;\n line-dasharray: 2,2,2;\n opacity: .6;\n} \n#bikes [zoom < 12][\"highway\"='footway'][\"bicycle\"='yes']\n {\n line-color:#d7008c;\n line-width:1;\n line-dasharray: 2,2,2;\n opacity: .6;\n} \n","old_contents":"Map {\n}\n\/* zoom > 15 *\/\n\n\/\/designated bikeways, nothing else\n#bikes [zoom > 15][\"bicycle\"='designated']\n {\n line-color:#00ffcc;\n line-width:6;\n opacity: .7;\n}\n\/\/bike lanes\n#bikes [zoom > 15][\"cycleway\"='lane']\n {\n line-color:#2500ff;\n line-width:6;\n opacity: .7;\n}\n\/\/sharrows\n#bikes [zoom > 15][\"cycleway\"='shared_lane']\n {\n line-color:#01df23;\n line-width:6;\n opacity: .7;\n}\n\/\/cycletracks\n#bikes [zoom > 15][\"cycleway\"='track']\n {\n line-color:#ff6cf0;\n line-width:6;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom > 15][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:6;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom > 15][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:6;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom > 15][\"RLIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:6;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom > 15][\"CCGIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:6;\n opacity: .7;\n}\n\/\/separated paths\n#bikes [zoom > 15][\"highway\"='path']\n {\n line-color:#d7008c;\n line-width:6;\n line-dasharray: 2,2,2;\n opacity: .7;\n}\n#bikes [zoom > 15][\"highway\"='cycleway']\n {\n line-color:#d7008c;\n line-width:6;\n line-dasharray: 2,2,2;\n opacity: .7;\n}\n#bikes [zoom > 15][\"highway\"='footway'][\"bicycle\"='designated']\n {\n line-color:#d7008c;\n line-width:6;\n line-dasharray: 2,2,2;\n opacity: .7;\n} \n#bikes [zoom > 15][\"highway\"='footway'][\"bicycle\"='yes']\n {\n line-color:#d7008c;\n line-width:6;\n line-dasharray: 2,2,2;\n opacity: .7;\n} \n\n\/*13 < zoom < 16 *\/\n\n\/\/designated bikeways, nothing else\n#bikes [zoom > 13][zoom < 16][\"bicycle\"='designated']\n {\n line-color:#00ffcc;\n line-width:4;\n opacity: .7;\n}\n\/\/bike lanes\n#bikes [zoom > 13][zoom < 16][\"cycleway\"='lane']\n {\n line-color:#2500ff;\n line-width:4;\n opacity: .7;\n}\n\/\/sharrows\n#bikes [zoom > 13][zoom < 16][\"cycleway\"='shared_lane']\n {\n line-color:#01df23;\n line-width:4;\n opacity: .7;\n}\n\/\/cycletracks\n#bikes [zoom > 13][zoom < 16][\"cycleway\"='track']\n {\n line-color:#ff6cf0;\n line-width:4;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom > 13][zoom < 16][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:4;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom > 13][zoom < 16][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:4;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom > 13][zoom < 16][\"RLIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:4;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom > 13][zoom < 16][\"CCGIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:4;\n opacity: .7;\n}\n\/\/separated paths\n#bikes [zoom > 13][zoom < 16][\"highway\"='path']\n {\n line-color:#d7008c;\n line-width:4;\n line-dasharray: 2,2,2;\n opacity: .7;\n}\n#bikes [zoom > 13][zoom < 16][\"highway\"='cycleway']\n {\n line-color:#d7008c;\n line-width:4;\n line-dasharray: 2,2,2;\n opacity: .7;\n}\n#bikes [zoom > 13][zoom < 16][\"highway\"='footway'][\"bicycle\"='designated']\n {\n line-color:#d7008c;\n line-width:4;\n line-dasharray: 2,2,2;\n opacity: .7;\n} \n#bikes [zoom > 13][zoom < 16][\"highway\"='footway'][\"bicycle\"='yes']\n {\n line-color:#d7008c;\n line-width:4;\n line-dasharray: 2,2,2;\n opacity: .7;\n} \n\n\/*11 < zoom < 14 *\/\n\n\/\/designated bikeways, nothing else\n#bikes [zoom > 11][zoom < 14][\"bicycle\"='designated']\n {\n line-color:#00ffcc;\n line-width:2;\n opacity: .7;\n}\n\/\/bike lanes\n#bikes [zoom > 11][zoom < 14][\"cycleway\"='lane']\n {\n line-color:#2500ff;\n line-width:2;\n opacity: .7;\n}\n\/\/sharrows\n#bikes [zoom > 11][zoom < 14][\"cycleway\"='shared_lane']\n {\n line-color:#01df23;\n line-width:2;\n opacity: .7;\n}\n\/\/cycletracks\n#bikes [zoom > 11][zoom < 14][\"cycleway\"='track']\n {\n line-color:#ff6cf0;\n line-width:2;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom > 11][zoom < 14][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:2;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom > 11][zoom < 14][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:2;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom > 11][zoom < 14][\"RLIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:2;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom > 11][zoom < 14][\"CCGIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:2;\n opacity: .7;\n}\n\/\/separated paths\n#bikes [zoom > 11][zoom < 14][\"highway\"='path']\n {\n line-color:#d7008c;\n line-width:2;\n line-dasharray: 2,2,2;\n opacity: .7;\n}\n#bikes [zoom > 11][zoom < 14][\"highway\"='cycleway']\n {\n line-color:#d7008c;\n line-width:2;\n line-dasharray: 2,2,2;\n opacity: .7;\n}\n#bikes [zoom > 11][zoom < 14][\"highway\"='footway'][\"bicycle\"='designated']\n {\n line-color:#d7008c;\n line-width:2;\n line-dasharray: 2,2,2;\n opacity: .7;\n} \n#bikes [zoom > 11][zoom < 14][\"highway\"='footway'][\"bicycle\"='yes']\n {\n line-color:#d7008c;\n line-width:2;\n line-dasharray: 2,2,2;\n opacity: .7;\n} \n\n\/*zoom < 12 *\/\n\n\/\/designated bikeways, nothing else\n#bikes [zoom < 12][\"bicycle\"='designated']\n {\n line-color:#00ffcc;\n line-width:1;\n opacity: .7;\n}\n\/\/bike lanes\n#bikes [zoom < 12][\"cycleway\"='lane']\n {\n line-color:#2500ff;\n line-width:1;\n opacity: .7;\n}\n\/\/sharrows\n#bikes [zoom < 12][\"cycleway\"='shared_lane']\n {\n line-color:#01df23;\n line-width:1;\n opacity: .7;\n}\n\/\/cycletracks\n#bikes [zoom < 12][\"cycleway\"='track']\n {\n line-color:#ff6cf0;\n line-width:1;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom < 12][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:1;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom < 12][\"cycleway\"='share_busway']\n {\n line-color:#f99326;\n line-width:1;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom < 12][\"RLIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:1;\n opacity: .7;\n}\n\/\/shared bus lanes\n#bikes [zoom < 12][\"CCGIS:bicycle\"='caution_area']\n {\n line-color:#fa5324;\n line-width:1;\n opacity: .7;\n}\n\/\/separated paths\n#bikes [zoom < 12][\"highway\"='path']\n {\n line-color:#d7008c;\n line-width:1;\n line-dasharray: 2,2,2;\n opacity: .7;\n}\n#bikes [zoom < 12][\"highway\"='cycleway']\n {\n line-color:#d7008c;\n line-width:1;\n line-dasharray: 2,2,2;\n opacity: .7;\n}\n#bikes [zoom < 12][\"highway\"='footway'][\"bicycle\"='designated']\n {\n line-color:#d7008c;\n line-width:1;\n line-dasharray: 2,2,2;\n opacity: .7;\n} \n#bikes [zoom < 12][\"highway\"='footway'][\"bicycle\"='yes']\n {\n line-color:#d7008c;\n line-width:1;\n line-dasharray: 2,2,2;\n opacity: .7;\n} \n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"97472821b77eb4d84a231eb51e74e95e481bf9cb","subject":"residential roads thicker for z19+","message":"residential roads thicker for z19+\n","repos":"andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto,andrewharvey\/osm-hybrid-carto","old_file":"osmt\/highway.mss","new_file":"osmt\/highway.mss","new_contents":"\/* Roads, footpaths, tracks *\/\n\n\n@private_road_colour: #c02c34;\n\n@tertiary_road_colour: #faf555;\n@secondary_road_colour: #d46833;\n@primary_road_colour: #cc3737;\n@trunk_road_colour: #650f0d;\n@motorway_road_colour: #7c0046;\n\n\/* paths (footway, cycleway, track) are dotted, the halo is behind the\n dots *\/\n@path_halo_opacity: 0.3;\n@path_halo_colour: white;\n@path_dot_opacity: 1.0;\n\n\/* highway labels *\/\n@highway_face_name: \"Liberation Sans Regular\";\n@highway_text_fill: white;\n@highway_halo_fill: black;\n@highway_halo_radius: 2.0;\n\n\/*\n service black\n residential black\n unclassified black\n tertiary yellow\n secondary orange\n primary red\n trunk blue\n motorway dark red\n*\/\n\n#highway-labels[highway='footway'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='cycleway'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='path'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='track'][zoom > 13] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n#highway-labels[highway='service'][zoom > 16] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='residential'][zoom > 15] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='unclassified'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='tertiary'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='secondary'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='primary'][zoom > 13] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='trunk'][zoom > 12] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='motorway'][zoom > 11] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n\/* default style for all path, footway, track, cycleways and roads *\/\n.highway[zoom > 12] {\n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n\n line-width: 1;\n}\n\n\/* defaults for roads with cars *\/\n.road[zoom > 11] {\n ::oneway_arrow[oneway='yes'][zoom > 14] {\n marker-type: arrow;\n\n marker-width: 2;\n marker-line-width: 2;\n\n marker-opacity: 1.0;\n marker-line-opacity: 1.0;\n\n marker-fill: white;\n marker-line-color: white;\n\n marker-spacing: 100;\n }\n\n line-color: #000000;\n line-join: round;\n line-cap: round;\n\n line-width: 1;\n\n [zoom > 17] { line-width: 15; line-opacity: 0.5; }\n [zoom = 17] { line-width: 10; line-opacity: 0.5; }\n [zoom = 16] { line-width: 5; line-opacity: 0.5; }\n [zoom = 15] { line-width: 2.25; line-opacity: 0.6; }\n [zoom = 14] { line-width: 1.5; line-opacity: 0.7; }\n [zoom = 13] { line-width: 1; line-opacity: 0.8; }\n [zoom = 12] { line-width: 0.5; line-opacity: 0.8; }\n\n ::bridge[bridge='yes'] {\n \/*\n ideally we would draw two lines outside the existing line,\n but the current compositing method in mapnik won't allow this\n so easily with transparency\n\n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n\n [zoom > 17] { line-width: 20; }\n [zoom = 17] { line-width: 15; }\n [zoom = 16] { line-width: 7; }\n [zoom = 15] { line-width: 3; }\n [zoom = 14] { line-width: 2; }\n [zoom = 13] { line-width: 1.5; }\n [zoom = 12] { line-width: 0.75; }\n *\/\n }\n \n [tunnel='yes'] {\n [zoom > 17] { line-dasharray: 6,6; }\n [zoom = 17] { line-dasharray: 4.5,4.5; }\n [zoom < 17] { line-dasharray: 3,3; }\n \tline-cap: butt;\n }\n\n}\n\n.highway#footway[zoom > 13] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n\n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n\n line-color: #FF0000;\n line-opacity: @path_dot_opacity;\n\n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom = 16] { line-width: 2 ; line-dasharray: 1,3 }\n [zoom < 16] { line-width: 1.5; line-dasharray: 1,2 }\n\n [highway='steps']{\n line-cap: butt;\n\n [zoom > 18] { line-dasharray: 3,4 }\n [zoom = 18] { line-dasharray: 2,3 }\n [zoom < 18] { line-dasharray: 1,2 }\n }\n\n}\n\n.highway#path[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n\n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n line-color: #000000;\n line-opacity: @path_dot_opacity;\n\n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom = 16] { line-width: 2 ; line-dasharray: 1,3 }\n [zoom < 16] { line-width: 1.5; line-dasharray: 1,2 }\n\n}\n\n.highway#track[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: 0.7;\n\n [zoom > 18] { line-width: 16; line-opacity: @path_halo_opacity; }\n [zoom = 18] { line-width: 10; line-opacity: @path_halo_opacity; }\n [zoom = 17] { line-width: 6; }\n [zoom = 16] { line-width: 4.5; }\n [zoom = 15] { line-width: 3.2 }\n [zoom = 14] { line-width: 2.5 }\n [zoom = 13] { line-width: 2 }\n }\n\n ::dottedline{\n\t line-color: #6d4f15;\n\t line-opacity: @path_dot_opacity;\n\t\n\t [zoom > 18] { line-width: 8 ; line-dasharray: 16,16 }\n\t [zoom = 18] { line-width: 5 ; line-dasharray: 8,8 }\n\t [zoom = 17] { line-width: 3 ; line-dasharray: 6,6 }\n\t [zoom = 16] { line-width: 2.1; line-dasharray: 4,4 }\n\t [zoom = 15] { line-width: 1.8; line-dasharray: 4,4 }\n\t [zoom = 14] { line-width: 1.5; line-dasharray: 4,4 }\n\t [zoom = 13] { line-width: 1.2 ; line-dasharray: 4,4 }\n }\n}\n\n.highway#cycleway[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n\n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n\n line-color: #0000ff;\n line-opacity: @path_dot_opacity;\n\n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom = 16] { line-width: 2 ; line-dasharray: 1,3 }\n [zoom < 16] { line-width: 1.5; line-dasharray: 1,2 }\n\n}\n\n.road#service[zoom > 11] {\n [zoom > 17] { line-width: 7.5; }\n [zoom = 17] { line-width: 5; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 1; }\n [zoom = 14] { line-width: 0.75; }\n [zoom = 13] { line-width: 0.5; }\n [zoom = 12] { line-width: 0.25; }\n\n [service='parking_aisle'][zoom > 14] {\n [zoom > 17] { line-width: 3; }\n [zoom = 17] { line-width: 2.5; }\n [zoom = 16] { line-width: 1.25; }\n [zoom = 15] { line-width: 0.25; }\n }\n \n ::private[access='private'],[access='no'],[access='permissive'],[access='customer'],[access='delivery'] {\n line-cap: butt;\n line-dasharray: 6,6;\n line-color: @private_road_colour;\n line-opacity: 0.5;\n\n [zoom > 17] { line-width: 7.5; }\n [zoom = 17] { line-width: 5; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 1; }\n [zoom = 14] { line-width: 0.75; }\n [zoom = 13] { line-width: 0.5; }\n [zoom = 12] { line-width: 0.25; }\n }\n}\n\n.road#residential[zoom > 11] {\n ::living_street[highway='living_street'][zoom > 14] {\n line-cap: round;\n [zoom > 17] { line-dasharray: 6,24; }\n [zoom = 17] { line-dasharray: 3,12; }\n [zoom < 17] { line-dasharray: 6,12; }\n line-color: #76d276;\n line-opacity: 0.3;\n\n [zoom = 18] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n }\n \n ::private[access='private'],[access='no'],[access='permissive'],[access='customer'],[access='delivery'] {\n line-cap: round;\n [zoom > 17] { line-dasharray: 6,24; }\n [zoom = 17] { line-dasharray: 3,12; }\n [zoom < 17] { line-dasharray: 6,12; }\n line-color: @private_road_colour;\n line-opacity: 0.3;\n\n [zoom = 18] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n }\n\n [zoom = 18] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n\n}\n\n\/* sets the colours for the road classification,\n but also draws the default line where .road doesn't apply\n ie. for zoom < 12 *\/\n.road#unclassified{\n}\n\n.road#tertiary[zoom > 11] {\n line-color: @tertiary_road_colour;\n}\n\n.road#secondary[zoom > 7] {\n line-color: @secondary_road_colour;\n [zoom = 12] { line-width: 1.0}\n}\n\n.road#primary[zoom > 6] {\n line-color: @primary_road_colour;\n [zoom = 12] { line-width: 1.5}\n}\n\n.road#trunk[zoom > 5] {\n line-color: @trunk_road_colour;\n \n [zoom = 15] { line-width: 3; }\n [zoom = 14] { line-width: 2.75; }\n [zoom = 13] { line-width: 2.5; }\n [zoom = 12] { line-width: 2.0; }\n [zoom = 11] { line-width: 1.25; }\n}\n\n.road#motorway[zoom > 4] {\n line-color: @motorway_road_colour;\n \n \/* keep in mind that most motorways are dual-carraige ways, and\n the current mapnik\/osm2pgsql doesn't combine these into one\n for low zooms *\/\n \n [zoom = 16] { line-width: 6; }\n [zoom = 15] { line-width: 4; }\n [zoom = 14] { line-width: 3; }\n [zoom = 13] { line-width: 2.5; }\n [zoom = 12] { line-width: 2.0; }\n [zoom = 11] { line-width: 1.75; }\n [zoom = 10] { line-width: 1.5; }\n}\n","old_contents":"\/* Roads, footpaths, tracks *\/\n\n\n@private_road_colour: #c02c34;\n\n@tertiary_road_colour: #faf555;\n@secondary_road_colour: #d46833;\n@primary_road_colour: #cc3737;\n@trunk_road_colour: #650f0d;\n@motorway_road_colour: #7c0046;\n\n\/* paths (footway, cycleway, track) are dotted, the halo is behind the\n dots *\/\n@path_halo_opacity: 0.3;\n@path_halo_colour: white;\n@path_dot_opacity: 1.0;\n\n\/* highway labels *\/\n@highway_face_name: \"Liberation Sans Regular\";\n@highway_text_fill: white;\n@highway_halo_fill: black;\n@highway_halo_radius: 2.0;\n\n\/*\n service black\n residential black\n unclassified black\n tertiary yellow\n secondary orange\n primary red\n trunk blue\n motorway dark red\n*\/\n\n#highway-labels[highway='footway'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='cycleway'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='path'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='track'][zoom > 13] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n#highway-labels[highway='service'][zoom > 16] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='residential'][zoom > 15] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='unclassified'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='tertiary'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='secondary'][zoom > 14] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='primary'][zoom > 13] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='trunk'][zoom > 12] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n#highway-labels[highway='motorway'][zoom > 11] {\n text-name: \"[name]\";\n text-face-name: @highway_face_name;\n text-fill: @highway_text_fill;\n text-placement: line;\n text-halo-fill: @highway_halo_fill;\n text-halo-radius: @highway_halo_radius;\n\n [zoom > 21] { text-size: 30; }\n [zoom = 21] { text-size: 25; }\n [zoom = 20] { text-size: 20; }\n [zoom = 19] { text-size: 15; }\n [zoom = 18] { text-size: 13; }\n [zoom = 17] { text-size: 12; }\n [zoom = 16] { text-size: 11; }\n [zoom = 15] { text-size: 11; }\n [zoom = 14] { text-size: 10; }\n [zoom = 13] { text-size: 8; }\n [zoom = 12] {text-size: 8; }\n}\n\n\/* default style for all path, footway, track, cycleways and roads *\/\n.highway[zoom > 12] {\n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n\n line-width: 1;\n}\n\n\/* defaults for roads with cars *\/\n.road[zoom > 11] {\n ::oneway_arrow[oneway='yes'][zoom > 14] {\n marker-type: arrow;\n\n marker-width: 2;\n marker-line-width: 2;\n\n marker-opacity: 1.0;\n marker-line-opacity: 1.0;\n\n marker-fill: white;\n marker-line-color: white;\n\n marker-spacing: 100;\n }\n\n line-color: #000000;\n line-join: round;\n line-cap: round;\n\n line-width: 1;\n\n [zoom > 17] { line-width: 15; line-opacity: 0.5; }\n [zoom = 17] { line-width: 10; line-opacity: 0.5; }\n [zoom = 16] { line-width: 5; line-opacity: 0.5; }\n [zoom = 15] { line-width: 2.25; line-opacity: 0.6; }\n [zoom = 14] { line-width: 1.5; line-opacity: 0.7; }\n [zoom = 13] { line-width: 1; line-opacity: 0.8; }\n [zoom = 12] { line-width: 0.5; line-opacity: 0.8; }\n\n ::bridge[bridge='yes'] {\n \/*\n ideally we would draw two lines outside the existing line,\n but the current compositing method in mapnik won't allow this\n so easily with transparency\n\n line-color: #000000;\n line-opacity: 0.5;\n line-join: round;\n line-cap: round;\n\n [zoom > 17] { line-width: 20; }\n [zoom = 17] { line-width: 15; }\n [zoom = 16] { line-width: 7; }\n [zoom = 15] { line-width: 3; }\n [zoom = 14] { line-width: 2; }\n [zoom = 13] { line-width: 1.5; }\n [zoom = 12] { line-width: 0.75; }\n *\/\n }\n \n [tunnel='yes'] {\n [zoom > 17] { line-dasharray: 6,6; }\n [zoom = 17] { line-dasharray: 4.5,4.5; }\n [zoom < 17] { line-dasharray: 3,3; }\n \tline-cap: butt;\n }\n\n}\n\n.highway#footway[zoom > 13] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n\n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n\n line-color: #FF0000;\n line-opacity: @path_dot_opacity;\n\n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom = 16] { line-width: 2 ; line-dasharray: 1,3 }\n [zoom < 16] { line-width: 1.5; line-dasharray: 1,2 }\n\n [highway='steps']{\n line-cap: butt;\n\n [zoom > 18] { line-dasharray: 3,4 }\n [zoom = 18] { line-dasharray: 2,3 }\n [zoom < 18] { line-dasharray: 1,2 }\n }\n\n}\n\n.highway#path[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n\n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n line-color: #000000;\n line-opacity: @path_dot_opacity;\n\n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom = 16] { line-width: 2 ; line-dasharray: 1,3 }\n [zoom < 16] { line-width: 1.5; line-dasharray: 1,2 }\n\n}\n\n.highway#track[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: 0.7;\n\n [zoom > 18] { line-width: 16; line-opacity: @path_halo_opacity; }\n [zoom = 18] { line-width: 10; line-opacity: @path_halo_opacity; }\n [zoom = 17] { line-width: 6; }\n [zoom = 16] { line-width: 4.5; }\n [zoom = 15] { line-width: 3.2 }\n [zoom = 14] { line-width: 2.5 }\n [zoom = 13] { line-width: 2 }\n }\n\n ::dottedline{\n\t line-color: #6d4f15;\n\t line-opacity: @path_dot_opacity;\n\t\n\t [zoom > 18] { line-width: 8 ; line-dasharray: 16,16 }\n\t [zoom = 18] { line-width: 5 ; line-dasharray: 8,8 }\n\t [zoom = 17] { line-width: 3 ; line-dasharray: 6,6 }\n\t [zoom = 16] { line-width: 2.1; line-dasharray: 4,4 }\n\t [zoom = 15] { line-width: 1.8; line-dasharray: 4,4 }\n\t [zoom = 14] { line-width: 1.5; line-dasharray: 4,4 }\n\t [zoom = 13] { line-width: 1.2 ; line-dasharray: 4,4 }\n }\n}\n\n.highway#cycleway[zoom > 12] {\n ::halo{\n line-color: @path_halo_colour;\n line-opacity: @path_halo_opacity;\n\n [zoom > 18] { line-width: 9 }\n [zoom = 18] { line-width: 6 }\n [zoom = 17] { line-width: 4 }\n [zoom < 17] { line-width: 2 }\n }\n\n line-color: #0000ff;\n line-opacity: @path_dot_opacity;\n\n [zoom > 18] { line-width: 8 ; line-dasharray: 2,16 }\n [zoom = 18] { line-width: 5 ; line-dasharray: 2,8 }\n [zoom = 17] { line-width: 3 ; line-dasharray: 1,4 }\n [zoom = 16] { line-width: 2 ; line-dasharray: 1,3 }\n [zoom < 16] { line-width: 1.5; line-dasharray: 1,2 }\n\n}\n\n.road#service[zoom > 11] {\n [zoom > 17] { line-width: 7.5; }\n [zoom = 17] { line-width: 5; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 1; }\n [zoom = 14] { line-width: 0.75; }\n [zoom = 13] { line-width: 0.5; }\n [zoom = 12] { line-width: 0.25; }\n\n [service='parking_aisle'][zoom > 14] {\n [zoom > 17] { line-width: 3; }\n [zoom = 17] { line-width: 2.5; }\n [zoom = 16] { line-width: 1.25; }\n [zoom = 15] { line-width: 0.25; }\n }\n \n ::private[access='private'],[access='no'],[access='permissive'],[access='customer'],[access='delivery'] {\n line-cap: butt;\n line-dasharray: 6,6;\n line-color: @private_road_colour;\n line-opacity: 0.5;\n\n [zoom > 17] { line-width: 7.5; }\n [zoom = 17] { line-width: 5; }\n [zoom = 16] { line-width: 2.5; }\n [zoom = 15] { line-width: 1; }\n [zoom = 14] { line-width: 0.75; }\n [zoom = 13] { line-width: 0.5; }\n [zoom = 12] { line-width: 0.25; }\n }\n}\n\n.road#residential[zoom > 11] {\n ::living_street[highway='living_street'][zoom > 14] {\n line-cap: round;\n [zoom > 17] { line-dasharray: 6,24; }\n [zoom = 17] { line-dasharray: 3,12; }\n [zoom < 17] { line-dasharray: 6,12; }\n line-color: #76d276;\n line-opacity: 0.3;\n\n [zoom > 17] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n }\n \n ::private[access='private'],[access='no'],[access='permissive'],[access='customer'],[access='delivery'] {\n line-cap: round;\n [zoom > 17] { line-dasharray: 6,24; }\n [zoom = 17] { line-dasharray: 3,12; }\n [zoom < 17] { line-dasharray: 6,12; }\n line-color: @private_road_colour;\n line-opacity: 0.3;\n\n [zoom > 17] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n }\n\n [zoom > 17] { line-width: 10; }\n [zoom = 17] { line-width: 7.5; }\n [zoom = 16] { line-width: 3.5; }\n [zoom = 15] { line-width: 1.75; }\n [zoom = 14] { line-width: 1; }\n [zoom = 13] { line-width: 0.75; }\n [zoom = 12] { line-width: 0.3; }\n\n}\n\n\/* sets the colours for the road classification,\n but also draws the default line where .road doesn't apply\n ie. for zoom < 12 *\/\n.road#unclassified{\n}\n\n.road#tertiary[zoom > 11] {\n line-color: @tertiary_road_colour;\n}\n\n.road#secondary[zoom > 7] {\n line-color: @secondary_road_colour;\n [zoom = 12] { line-width: 1.0}\n}\n\n.road#primary[zoom > 6] {\n line-color: @primary_road_colour;\n [zoom = 12] { line-width: 1.5}\n}\n\n.road#trunk[zoom > 5] {\n line-color: @trunk_road_colour;\n \n [zoom = 15] { line-width: 3; }\n [zoom = 14] { line-width: 2.75; }\n [zoom = 13] { line-width: 2.5; }\n [zoom = 12] { line-width: 2.0; }\n [zoom = 11] { line-width: 1.25; }\n}\n\n.road#motorway[zoom > 4] {\n line-color: @motorway_road_colour;\n \n \/* keep in mind that most motorways are dual-carraige ways, and\n the current mapnik\/osm2pgsql doesn't combine these into one\n for low zooms *\/\n \n [zoom = 16] { line-width: 6; }\n [zoom = 15] { line-width: 4; }\n [zoom = 14] { line-width: 3; }\n [zoom = 13] { line-width: 2.5; }\n [zoom = 12] { line-width: 2.0; }\n [zoom = 11] { line-width: 1.75; }\n [zoom = 10] { line-width: 1.5; }\n}\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"CartoCSS"} {"commit":"b0a0db829f218ddbd46782a6c684bcdedd2a13b6","subject":"New: Add isodate converter","message":"New: Add isodate converter\n","repos":"music-encoding\/sibmei,annplaksin\/sibmei","old_file":"src\/ExportConverters.mss","new_file":"src\/ExportConverters.mss","new_contents":"\nfunction ConvertClef (clefid) {\n \/\/$module(ExportConverters.mss)\n clefparts = MSplitString(clefid, '.');\n shape = ' ';\n line = ' ';\n dis = ' ';\n dir = ' ';\n\n switch(clefparts[2])\n {\n case ('down')\n {\n dir = 'below';\n }\n case ('up')\n {\n dir = 'above';\n }\n }\n\n switch(clefparts[3])\n {\n case ('8')\n {\n dis = '8';\n }\n case ('15')\n {\n dis = '15';\n }\n }\n switch (clefparts[1]) {\n case ('bass')\n {\n shape = 'F';\n line = '4';\n }\n case ('treble')\n {\n if (clefparts[4] = 'old')\n {\n shape = 'GG';\n }\n else\n {\n shape = 'G';\n }\n line = '2';\n }\n case ('tenor')\n {\n shape = 'C';\n line = '4';\n }\n case ('alto')\n {\n shape = 'C';\n line = '3';\n }\n case ('soprano')\n {\n shape = 'C';\n if (clefparts[2] = 'mezzo')\n {\n line = '2';\n }\n else\n {\n line = '1';\n }\n }\n case ('baritone')\n {\n if (clefparts[2] = 'c')\n {\n shape = 'C';\n line = '5';\n }\n else\n {\n shape = 'F';\n line = '3';\n }\n }\n case ('violin')\n {\n shape = 'G';\n line = '1';\n }\n case ('sub-bass')\n {\n shape = 'F';\n line = '5';\n }\n case ('tab')\n {\n shape = 'TAB';\n }\n case (('percussion') or ('percussion_2'))\n {\n shape = 'perc';\n }\n }\n ret = CreateSparseArray(shape, line, dis, dir);\n return ret;\n} \/\/$end\n\nfunction ConvertOctava (octava_id) {\n \/\/$module(ExportConverters.mss)\n octparts = MSplitString(octava_id, '.');\n switch(octparts[3])\n {\n case ('minus15')\n {\n dis = '15';\n place = 'below';\n }\n case ('minus8')\n {\n dis = '8';\n place = 'below';\n }\n case ('plus15')\n {\n dis = '15';\n place = 'above';\n }\n case ('plus8')\n {\n dis = '8';\n place = 'above';\n }\n default\n {\n dis = ' ';\n place = ' ';\n }\n }\n return CreateSparseArray(dis, place);\n} \/\/$end\n\nfunction ConvertSlur (slur_value) {\n \/\/$module(ExportConverters.mss)\n slurparts = MSplitString(slur_value, '.');\n direction = ' ';\n style = ' ';\n switch(slurparts[3])\n {\n case ('up')\n {\n direction = 'above';\n }\n case ('down')\n {\n direction = 'below';\n }\n default\n {\n direction = ' ';\n }\n }\n switch(slurparts[4])\n {\n case ('dashed')\n {\n style = 'dashed';\n }\n case ('dotted')\n {\n style = 'dotted';\n }\n default\n {\n style = ' ';\n }\n }\n return CreateSparseArray(direction, style);\n} \/\/$end\n\nfunction ConvertDiatonicPitch (diatonic_pitch) {\n \/\/$module(ExportConverters)\n octv = (diatonic_pitch \/ 7) - 1;\n pnames = CreateSparseArray('c', 'd', 'e', 'f', 'g', 'a', 'b');\n idx = (diatonic_pitch % 7);\n pname = pnames[idx];\n\n return CreateSparseArray(pname, octv);\n} \/\/$end\n\nfunction ConvertOffsets (offset) {\n \/\/$module(ExportConverters.mss)\n\n \/*\n This function will convert the 1\/32 unit \n Sibelius offsets into a millimeter measurement as required by the \n data.MEASUREMENT datatype used by MEI.\n\n Most offsets are given in Sibelius Units, which\n are defined as 1\/32 of a space. A space is 1\/4 of the staff height\n set at 128. For real world calculations, then, a unit is:\n ((staffheight \/ 4) \/ 32).\n\n The `StaffHeight` property always returns the staff height in millimeters.\n\n So a staff height of 7mm (default) gives us (7\/4 = 1.75) \/ 32 = 0.05mm per Sibelius\n Unit.\n *\/\n scr = Sibelius.ActiveScore;\n staffheight = scr.StaffHeight;\n factor = (((staffheight & '.0') \/ 4.0) \/ 32.0);\n oset = factor * offset;\n retval = oset & 'mm';\n return retval;\n} \/\/$end\n\nfunction ConvertDuration (dur) {\n \/\/$module(ExportConverters.mss)\n \/\/ there doesn't really seem to be a smarter way to do this...\n \/\/ 1024 = 1 whole note\n\n ret = CreateSparseArray();\n\n pow = PrevPow2(dur);\n counter = pow;\n dots = 0;\n powcount = pow;\n durset = false;\n\n durrem = 1024 % dur;\n if (durrem != 0)\n {\n while (counter < dur)\n {\n powcount = (powcount \/ 2);\n counter = counter + powcount;\n dots = dots + 1;\n\n if (dots > 5)\n {\n \/\/ prevent a runaway loop.\n counter = 1000000000;\n }\n }\n }\n\n switch (powcount)\n {\n case (pow >= 4096)\n {\n ret[0] = 'long';\n durset = true;\n }\n case (pow >= 2048)\n {\n ret[0] = 'breve';\n durset = true;\n }\n default\n {\n if (durset = false)\n {\n ret[0] = 1024 \/ pow;\n }\n }\n }\n\n if (dots = 0)\n {\n ret[1] = ' ';\n }\n else\n {\n ret[1] = dots;\n }\n\n return ret;\n} \/\/$end\n\nfunction ConvertKeySignature (numsharps) {\n \/\/$module(ExportConverters.mss)\n switch (numsharps)\n {\n case (0)\n {\n \/\/ key of c\n return '0';\n }\n case (-8)\n {\n \/\/ atonal in Sibelius\n return '0';\n }\n case (numsharps > 0)\n {\n \/\/ sharps\n return numsharps & 's';\n }\n case (numsharps < 0)\n {\n \/\/flats\n return utils.AbsoluteValue(numsharps) & 'f';\n }\n }\n} \/\/$end\n\nfunction PitchesInKeySignature (keysig) {\n \/\/$module(ExportConverters.mss)\n\n \/\/ keysig is 7 >= 0 >= -7, for the number of sharps (negative is flats)\n ac = CreateSparseArray('F', 'C', 'G', 'D', 'A', 'E', 'B');\n if (keysig = 0)\n {\n return CreateSparseArray();\n }\n\n if (keysig > 0)\n {\n return ac.Slice(0, keysig);\n }\n else\n {\n v = ac.Slice(keysig);\n v.Reverse();\n return v;\n }\n} \/\/$end\n\nfunction ConvertAccidental (noteobj) {\n \/\/$module(ExportConverters.mss)\n \/\/ If accidentals are audible, but not visible, you get @accid.ges\n \/\/ If accidentals are both audible and visible, you get @accid\n \/\/ is_visible is not to be confused with hidden accidentals! is_visible\n \/\/ just determines whether an accidental is shown or not based on \n \/\/ the rules of CMN.\n\n \/\/ Returns a tuple [0 => accid (string), 1 => is_visible (bool)]\n \/\/ If the accidental is a natural and is visible, returns ('n', true); otherwise,\n \/\/ it returns ('', false);\n\n \/\/ first, determine if the accidental is visible.\n is_visible = HasVisibleAccidental(noteobj);\n ac = ' ';\n\n pname = Substring(noteobj.Name, 0, 1); \/\/ captures first letter\n accid = Substring(noteobj.Name, 1); \/\/ captures all other characters\n\n switch(accid)\n {\n case('bb')\n {\n ac = 'ff';\n }\n case('b-')\n {\n ac = 'fd';\n }\n case('b')\n {\n ac = 'f';\n }\n case('-')\n {\n ac = 'fu';\n }\n case('')\n {\n if (is_visible = True)\n {\n ac = 'n';\n }\n }\n case('+')\n {\n ac = 'sd';\n }\n case('#')\n {\n ac = 's';\n }\n case('#+')\n {\n ac = 'su';\n }\n case('x')\n {\n ac = 'x';\n }\n case('##')\n {\n ac = 'ss';\n }\n }\n\n ret = CreateSparseArray(ac, is_visible);\n return ret;\n} \/\/$end\n\nfunction HasVisibleAccidental (noteobj) {\n \/\/$module(ExportConverters.mss)\n \/\/ determines whether a note is *likely* to have a visible accidental.\n \/\/ Caution: This is probably not 100% accurate.\n\n \/\/ Returns a boolean if the note is visible.\n\n \/\/ If it has a cautionary accidental, it's most likely to be visible.\n if (noteobj.AccidentalStyle = CautionaryAcc)\n {\n return True;\n }\n\n if (noteobj.AccidentalStyle = HiddenAcc)\n {\n return False;\n }\n\n keysig = noteobj.ParentNoteRest.ParentBar.GetKeySignatureAt(noteobj.ParentNoteRest.Position);\n sf = sibmei2.PitchesInKeySignature(keysig.Sharps);\n pname = Substring(noteobj.Name, 0, 1); \/\/ captures first letter\n accid = Substring(noteobj.Name, 1); \/\/ captures all other characters\n\n \/\/ if the note is not in the key signature, then it should have an accidental\n note_is_in_keysig = utils.IsInArray(sf, pname);\n has_prev_pitch_with_accidental = False;\n\n parent_nr = noteobj.ParentNoteRest;\n parent_bar = parent_nr.ParentBar;\n\n for each NoteRest nr in parent_bar\n {\n if (nr.Position < parent_nr.Position)\n {\n for each n in nr\n {\n pname2 = Substring(n.Name, 0, 1); \/\/ captures first letter\n accid2 = Substring(n.Name, 1); \/\/ captures all other characters\n\n if (n.Name = noteobj.Name and note_is_in_keysig = False and n.Accidental != 0)\n {\n has_prev_pitch_with_accidental = True;\n }\n\n if (n.Name = noteobj.Name and n.AccidentalStyle = CautionaryAcc)\n {\n has_prev_pitch_with_accidental = True;\n }\n\n if (n.Name = noteobj.Name and note_is_in_keysig = True)\n {\n has_prev_pitch_with_accidental = False;\n }\n\n \/\/ this is a special case for dealing with naturals. If the pitch names\n \/\/ match, and the note is not in the key signature, and the previous pitch\n \/\/ was not empty, then we probably have a natural on the query note.\n if (pname = pname2 and note_is_in_keysig = False and accid2 != '')\n {\n has_prev_pitch_with_accidental = True;\n }\n\n }\n }\n else\n {\n for each n in nr\n {\n if (n.Name = noteobj.Name and n.Accidental != 0 and note_is_in_keysig = True)\n {\n has_prev_pitch_with_accidental = False;\n }\n }\n }\n }\n\n \/\/ deal with the 'weird' accidental values that don't have a value in noteobj.Accidental\n switch (accid)\n {\n case ('bb')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('b-')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('-')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('+')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('#+')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n }\n\n if (noteobj.Accidental = 0 and note_is_in_keysig = True and has_prev_pitch_with_accidental = False)\n {\n \/\/ it's a natural?\n return True;\n }\n\n if (note_is_in_keysig = True and has_prev_pitch_with_accidental = False)\n {\n return False;\n }\n\n if (has_prev_pitch_with_accidental = False and noteobj.Accidental != 0)\n {\n return True;\n }\n \n if (has_prev_pitch_with_accidental = True and accid = '')\n {\n \/\/ this is the corresponding return value for special cased naturals.\n return True;\n }\n\n \/\/ Finally, by default, assume this has no accidental.\n return False;\n} \/\/$end\n\nfunction ConvertNamedTimeSignature (timesig) {\n \/\/$module(ExportConverters.mss)\n switch(timesig)\n {\n case(CommonTimeString)\n {\n return 'common';\n }\n case(AllaBreveTimeString)\n {\n return 'cut';\n }\n default\n {\n return ' ';\n }\n }\n} \/\/$end\n\nfunction ConvertBracket (bracket) {\n \/\/$module(ExportConverters.mss)\n switch(bracket)\n {\n case(BracketFull)\n {\n return 'bracket';\n }\n case(BracketBrace)\n {\n return 'brace';\n }\n case(BracketSub)\n {\n return 'line';\n }\n default\n {\n return 'none';\n }\n }\n} \/\/$end\n\nfunction ConvertSibeliusStructure (score) {\n \/\/$module(ExportConverters.mss)\n \/\/ Takes in the Staff\/Bar Sibelius Structure and returns a Bar\/Staff\n \/\/ mapping for our MEI writers.\n bar_to_staff = CreateDictionary();\n\n \/\/ Invert the Sibelius structure\n for each Staff s in score\n {\n for each Bar b in s\n {\n if (bar_to_staff.PropertyExists(b.BarNumber))\n {\n bar_to_staff[b.BarNumber].Push(s.StaffNum);\n }\n else\n {\n bar_to_staff[b.BarNumber] = CreateSparseArray();\n bar_to_staff[b.BarNumber].Push(s.StaffNum);\n }\n }\n }\n return bar_to_staff;\n} \/\/$end\n\nfunction ConvertColor (nrest) {\n \/\/$module(ExportConverters.mss)\n r = nrest.ColorRed;\n g = nrest.ColorGreen;\n b = nrest.ColorBlue;\n a_dec = nrest.ColorAlpha & '.0';\n a = a_dec \/ 255.0;\n\n return 'rgba(' & r & ',' & g & ',' & b & ',' & a & ')';\n} \/\/$end\n\nfunction ConvertNoteStyle (style) {\n \/\/$module(ExportConverters.mss)\n noteStyle = ' ';\n\n if (style = NormalNoteStyle)\n {\n return ' ';\n }\n\n switch (style)\n {\n case (CrossNoteStyle)\n {\n noteStyle = 'cross';\n }\n case (DiamondNoteStyle)\n {\n noteStyle = 'diamond';\n }\n case (CrossOrDiamondNoteStyle)\n {\n \/\/ Sibelius uses this for percussion\n \/\/ and does not differentiate in the \n \/\/ head style, so we have to choose one\n \/\/ or the other.\n noteStyle = 'cross';\n }\n case (BlackAndWhiteDiamondNoteStyle)\n {\n noteStyle = 'filldiamond';\n }\n case (SlashedNoteStyle)\n {\n noteStyle = 'addslash';\n }\n case (BackSlashedNoteStyle)\n {\n noteStyle = 'addbackslash';\n }\n case (ArrowDownNoteStyle)\n {\n \/\/ this is not completely correct, since\n \/\/ we use the same value for up and down\n \/\/ iso triangles. But it's all we have for now.\n noteStyle = 'isotriangle';\n }\n case (ArrowUpNoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (InvertedTriangleNoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (ShapedNote1NoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (ShapedNote2NoteStyle)\n {\n noteStyle = 'semicircle';\n }\n case (ShapedNote3NoteStyle)\n {\n noteStyle = 'diamond';\n }\n case (ShapedNote4StemUpNoteStyle)\n {\n noteStyle = 'rtriangle';\n }\n case (ShapedNote4StemDownNoteStyle)\n {\n noteStyle = 'rtriangle';\n }\n case (ShapedNote5NoteStyle)\n {\n \/\/ this looks normal...\n noteStyle = ' ';\n }\n case (ShapedNote6NoteStyle)\n {\n \/\/ there is no square in MEI...\n noteStyle = ' ';\n }\n case (ShapedNote7NoteStyle)\n {\n noteStyle = 'piewedge';\n }\n }\n\n return noteStyle;\n} \/\/$end\n\nfunction ConvertSlurStyle (style) {\n \/\/$module(ExportConverters.mss)\n slurparts = MSplitString(style, '.');\n direction = ' ';\n style = ' ';\n\n switch(slurparts[3])\n {\n case ('up')\n {\n direction = 'above';\n }\n case ('down')\n {\n direction = 'below';\n }\n default\n {\n direction = ' ';\n }\n }\n switch(slurparts[4])\n {\n case ('dashed')\n {\n style = 'dashed';\n }\n case ('dotted')\n {\n style = 'dotted';\n }\n default\n {\n style = ' ';\n }\n }\n return CreateSparseArray(direction, style);\n} \/\/$end\n\nfunction ConvertPositionToTimestamp (position, bar) {\n \/\/$module(ExportConverters.mss)\n \/*\n To convert Sibelius ticks to musical timestamps\n we use the formula:\n\n tstamp = (notePosition \/ (barLength \/ beatsInBar))\n *\/\n\n \/\/ make sure we're working with floating point numbers\n \/\/ and yes, this makes me feel very, very dirty in case\n \/\/ you were wondering, but this is the only way ManuScript\n \/\/ can cast to floating point...\n barlength = bar.Length;\n timesignature = Sibelius.ActiveScore.SystemStaff.CurrentTimeSignature(bar.BarNumber);\n\n if (position = 0)\n {\n return 1;\n }\n\n barlen = barlength & '.0';\n pos = position & '.0';\n beats = timesignature.Numerator & '.0';\n unit = (barlen \/ beats);\n ret = (pos \/ unit) + 1;\n\n return ret;\n} \/\/$end\n\nfunction ConvertTupletStyle (tupletStyle) {\n \/\/$module(ExportConverters.mss)\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.addAttribute(activeTuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.addAttribute(activeTuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.addAttribute(activeTuplet, 'num.format', 'ratio');\n }\n }\n\n} \/\/$end\n\nfunction ConvertBarline (linetype) {\n \/\/$module(ExportConverters.mss)\n switch(linetype)\n {\n case (SpecialBarlineStartRepeat)\n {\n \/\/ start repeat\n return 'rptstart';\n }\n case (SpecialBarlineEndRepeat)\n {\n \/\/ end repeat\n return 'rptend';\n }\n case (SpecialBarlineDashed)\n {\n \/\/ dashed\n return 'dashed';\n }\n case (SpecialBarlineDouble)\n {\n \/\/ double\n return 'dbl';\n }\n case (SpecialBarlineFinal)\n {\n \/\/ final\n return 'end';\n }\n case (SpecialBarlineInvisible)\n {\n \/\/ invisible\n return 'invis';\n }\n case (SpecialBarlineBetweenStaves)\n {\n \/\/ between staves\n \/\/ no MEI equiv.\n return ' ';\n }\n case (SpecialBarlineNormal)\n {\n \/\/ normal\n \/\/ this should usually be needed.\n return 'single';\n }\n case (SpecialBarlineTick)\n {\n \/\/ tick\n \/\/ unknown\n return ' ';\n }\n case (SpecialBarlineShort)\n {\n \/\/ short\n \/\/ unknown\n return ' ';\n }\n default\n {\n return ' ';\n }\n }\n} \/\/$end\n\nfunction ConvertText (textobj) {\n \/\/$module(ExportConverters.mss)\n styleid = textobj.StyleId;\n switch (styleid)\n {\n case ('text.staff.expression')\n {\n dynam = libmei.Dynam();\n libmei.SetText(dynam, lstrip(textobj.Text));\n libmei.AddAttribute(dynam, 'staff', textobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(dynam, 'tstamp', ConvertPositionToTimestamp(textobj));\n\n if (textobj.Dx != 0)\n {\n libmei.AddAttribute(dynam, 'ho', ConvertOffset(textobj.Dx));\n }\n\n if (textobj.Dy != 0)\n {\n libmei.AddAttribute(dynam, 'vo', ConvertOffset(textobj.Dy));\n }\n return dynam;\n }\n case ('text.system.page_aligned.title')\n {\n return ConvertTextElement(textobj);\n }\n case ('text.system.page_aligned.composer')\n {\n return ConvertTextElement(textobj);\n }\n default\n {\n return null;\n }\n }\n} \/\/$end\n\nfunction ConvertTextElement (textobj) {\n \/\/$module(ExportConverters.mss)\n obj = libmei.AnchoredText();\n libmei.SetText(obj, lstrip(textobj.Text));\n\n if (textobj.Dx != 0)\n {\n libmei.AddAttribute(obj, 'ho', ConvertOffsets(textobj.Dx));\n }\n\n if (textobj.Dy != 0)\n {\n libmei.AddAttribute(obj, 'vo', ConvertOffset(textobj.Dy));\n }\n\n return obj;\n} \/\/$end\n\nfunction ConvertEndingValues (styleid) {\n \/\/$module(ExportConverters)\n ending_style = MSplitString(styleid, '.');\n num = ' ';\n label = ' ';\n type = ' ';\n\n switch(ending_style[3])\n {\n case ('1st')\n {\n num = 1;\n label = '1.';\n type = 'closed';\n }\n case ('1st_n_2nd')\n {\n num = 1;\n label = '1. 2.';\n type = 'closed';\n }\n case ('2nd')\n {\n num = 2;\n label = '2.';\n if (ending_style[-1] = 'closed')\n {\n type = 'closed';\n }\n else\n {\n type = 'open';\n }\n }\n case ('3rd')\n {\n num = 3;\n label = '3.';\n type = 'closed';\n }\n case ('open')\n {\n type = 'open';\n }\n case ('closed')\n {\n type = 'closed';\n }\n }\n\n return CreateSparseArray(num, label, type);\n\n} \/\/$end\n\nfunction ConvertDate (datetime) {\n \/\/$module(ExportConverters.mss)\n d = datetime.DayOfMonth;\n m = datetime.Month;\n y = datetime.Year;\n\n hh = datetime.Hours;\n mm = datetime.Minutes;\n ss = datetime.Seconds;\n\n isodate = utils.Format(\"%s-%s-%sT%s:%s:%sZ\", y, m, d, hh, mm, ss);\n\n return isodate;\n} \/\/$end\n","old_contents":"\nfunction ConvertClef (clefid) {\n \/\/$module(ExportConverters.mss)\n clefparts = MSplitString(clefid, '.');\n shape = ' ';\n line = ' ';\n dis = ' ';\n dir = ' ';\n\n switch(clefparts[2])\n {\n case ('down')\n {\n dir = 'below';\n }\n case ('up')\n {\n dir = 'above';\n }\n }\n\n switch(clefparts[3])\n {\n case ('8')\n {\n dis = '8';\n }\n case ('15')\n {\n dis = '15';\n }\n }\n switch (clefparts[1]) {\n case ('bass')\n {\n shape = 'F';\n line = '4';\n }\n case ('treble')\n {\n if (clefparts[4] = 'old')\n {\n shape = 'GG';\n }\n else\n {\n shape = 'G';\n }\n line = '2';\n }\n case ('tenor')\n {\n shape = 'C';\n line = '4';\n }\n case ('alto')\n {\n shape = 'C';\n line = '3';\n }\n case ('soprano')\n {\n shape = 'C';\n if (clefparts[2] = 'mezzo')\n {\n line = '2';\n }\n else\n {\n line = '1';\n }\n }\n case ('baritone')\n {\n if (clefparts[2] = 'c')\n {\n shape = 'C';\n line = '5';\n }\n else\n {\n shape = 'F';\n line = '3';\n }\n }\n case ('violin')\n {\n shape = 'G';\n line = '1';\n }\n case ('sub-bass')\n {\n shape = 'F';\n line = '5';\n }\n case ('tab')\n {\n shape = 'TAB';\n }\n case (('percussion') or ('percussion_2'))\n {\n shape = 'perc';\n }\n }\n ret = CreateSparseArray(shape, line, dis, dir);\n return ret;\n} \/\/$end\n\nfunction ConvertOctava (octava_id) {\n \/\/$module(ExportConverters.mss)\n octparts = MSplitString(octava_id, '.');\n switch(octparts[3])\n {\n case ('minus15')\n {\n dis = '15';\n place = 'below';\n }\n case ('minus8')\n {\n dis = '8';\n place = 'below';\n }\n case ('plus15')\n {\n dis = '15';\n place = 'above';\n }\n case ('plus8')\n {\n dis = '8';\n place = 'above';\n }\n default\n {\n dis = ' ';\n place = ' ';\n }\n }\n return CreateSparseArray(dis, place);\n} \/\/$end\n\nfunction ConvertSlur (slur_value) {\n \/\/$module(ExportConverters.mss)\n slurparts = MSplitString(slur_value, '.');\n direction = ' ';\n style = ' ';\n switch(slurparts[3])\n {\n case ('up')\n {\n direction = 'above';\n }\n case ('down')\n {\n direction = 'below';\n }\n default\n {\n direction = ' ';\n }\n }\n switch(slurparts[4])\n {\n case ('dashed')\n {\n style = 'dashed';\n }\n case ('dotted')\n {\n style = 'dotted';\n }\n default\n {\n style = ' ';\n }\n }\n return CreateSparseArray(direction, style);\n} \/\/$end\n\nfunction ConvertDiatonicPitch (diatonic_pitch) {\n \/\/$module(ExportConverters)\n octv = (diatonic_pitch \/ 7) - 1;\n pnames = CreateSparseArray('c', 'd', 'e', 'f', 'g', 'a', 'b');\n idx = (diatonic_pitch % 7);\n pname = pnames[idx];\n\n return CreateSparseArray(pname, octv);\n} \/\/$end\n\nfunction ConvertOffsets (offset) {\n \/\/$module(ExportConverters.mss)\n\n \/*\n This function will convert the 1\/32 unit \n Sibelius offsets into a millimeter measurement as required by the \n data.MEASUREMENT datatype used by MEI.\n\n Most offsets are given in Sibelius Units, which\n are defined as 1\/32 of a space. A space is 1\/4 of the staff height\n set at 128. For real world calculations, then, a unit is:\n ((staffheight \/ 4) \/ 32).\n\n The `StaffHeight` property always returns the staff height in millimeters.\n\n So a staff height of 7mm (default) gives us (7\/4 = 1.75) \/ 32 = 0.05mm per Sibelius\n Unit.\n *\/\n scr = Sibelius.ActiveScore;\n staffheight = scr.StaffHeight;\n factor = (((staffheight & '.0') \/ 4.0) \/ 32.0);\n oset = factor * offset;\n retval = oset & 'mm';\n return retval;\n} \/\/$end\n\nfunction ConvertDuration (dur) {\n \/\/$module(ExportConverters.mss)\n \/\/ there doesn't really seem to be a smarter way to do this...\n \/\/ 1024 = 1 whole note\n\n ret = CreateSparseArray();\n\n pow = PrevPow2(dur);\n counter = pow;\n dots = 0;\n powcount = pow;\n durset = false;\n\n durrem = 1024 % dur;\n if (durrem != 0)\n {\n while (counter < dur)\n {\n powcount = (powcount \/ 2);\n counter = counter + powcount;\n dots = dots + 1;\n\n if (dots > 5)\n {\n \/\/ prevent a runaway loop.\n counter = 1000000000;\n }\n }\n }\n\n switch (powcount)\n {\n case (pow >= 4096)\n {\n ret[0] = 'long';\n durset = true;\n }\n case (pow >= 2048)\n {\n ret[0] = 'breve';\n durset = true;\n }\n default\n {\n if (durset = false)\n {\n ret[0] = 1024 \/ pow;\n }\n }\n }\n\n if (dots = 0)\n {\n ret[1] = ' ';\n }\n else\n {\n ret[1] = dots;\n }\n\n return ret;\n} \/\/$end\n\nfunction ConvertKeySignature (numsharps) {\n \/\/$module(ExportConverters.mss)\n switch (numsharps)\n {\n case (0)\n {\n \/\/ key of c\n return '0';\n }\n case (-8)\n {\n \/\/ atonal in Sibelius\n return '0';\n }\n case (numsharps > 0)\n {\n \/\/ sharps\n return numsharps & 's';\n }\n case (numsharps < 0)\n {\n \/\/flats\n return utils.AbsoluteValue(numsharps) & 'f';\n }\n }\n} \/\/$end\n\nfunction PitchesInKeySignature (keysig) {\n \/\/$module(ExportConverters.mss)\n\n \/\/ keysig is 7 >= 0 >= -7, for the number of sharps (negative is flats)\n ac = CreateSparseArray('F', 'C', 'G', 'D', 'A', 'E', 'B');\n if (keysig = 0)\n {\n return CreateSparseArray();\n }\n\n if (keysig > 0)\n {\n return ac.Slice(0, keysig);\n }\n else\n {\n v = ac.Slice(keysig);\n v.Reverse();\n return v;\n }\n} \/\/$end\n\nfunction ConvertAccidental (noteobj) {\n \/\/$module(ExportConverters.mss)\n \/\/ If accidentals are audible, but not visible, you get @accid.ges\n \/\/ If accidentals are both audible and visible, you get @accid\n \/\/ is_visible is not to be confused with hidden accidentals! is_visible\n \/\/ just determines whether an accidental is shown or not based on \n \/\/ the rules of CMN.\n\n \/\/ Returns a tuple [0 => accid (string), 1 => is_visible (bool)]\n \/\/ If the accidental is a natural and is visible, returns ('n', true); otherwise,\n \/\/ it returns ('', false);\n\n \/\/ first, determine if the accidental is visible.\n is_visible = HasVisibleAccidental(noteobj);\n ac = ' ';\n\n pname = Substring(noteobj.Name, 0, 1); \/\/ captures first letter\n accid = Substring(noteobj.Name, 1); \/\/ captures all other characters\n\n switch(accid)\n {\n case('bb')\n {\n ac = 'ff';\n }\n case('b-')\n {\n ac = 'fd';\n }\n case('b')\n {\n ac = 'f';\n }\n case('-')\n {\n ac = 'fu';\n }\n case('')\n {\n if (is_visible = True)\n {\n ac = 'n';\n }\n }\n case('+')\n {\n ac = 'sd';\n }\n case('#')\n {\n ac = 's';\n }\n case('#+')\n {\n ac = 'su';\n }\n case('x')\n {\n ac = 'x';\n }\n case('##')\n {\n ac = 'ss';\n }\n }\n\n ret = CreateSparseArray(ac, is_visible);\n return ret;\n} \/\/$end\n\nfunction HasVisibleAccidental (noteobj) {\n \/\/$module(ExportConverters.mss)\n \/\/ determines whether a note is *likely* to have a visible accidental.\n \/\/ Caution: This is probably not 100% accurate.\n\n \/\/ Returns a boolean if the note is visible.\n\n \/\/ If it has a cautionary accidental, it's most likely to be visible.\n if (noteobj.AccidentalStyle = CautionaryAcc)\n {\n return True;\n }\n\n if (noteobj.AccidentalStyle = HiddenAcc)\n {\n return False;\n }\n\n keysig = noteobj.ParentNoteRest.ParentBar.GetKeySignatureAt(noteobj.ParentNoteRest.Position);\n sf = sibmei2.PitchesInKeySignature(keysig.Sharps);\n pname = Substring(noteobj.Name, 0, 1); \/\/ captures first letter\n accid = Substring(noteobj.Name, 1); \/\/ captures all other characters\n\n \/\/ if the note is not in the key signature, then it should have an accidental\n note_is_in_keysig = utils.IsInArray(sf, pname);\n has_prev_pitch_with_accidental = False;\n\n parent_nr = noteobj.ParentNoteRest;\n parent_bar = parent_nr.ParentBar;\n\n for each NoteRest nr in parent_bar\n {\n if (nr.Position < parent_nr.Position)\n {\n for each n in nr\n {\n pname2 = Substring(n.Name, 0, 1); \/\/ captures first letter\n accid2 = Substring(n.Name, 1); \/\/ captures all other characters\n\n if (n.Name = noteobj.Name and note_is_in_keysig = False and n.Accidental != 0)\n {\n has_prev_pitch_with_accidental = True;\n }\n\n if (n.Name = noteobj.Name and n.AccidentalStyle = CautionaryAcc)\n {\n has_prev_pitch_with_accidental = True;\n }\n\n if (n.Name = noteobj.Name and note_is_in_keysig = True)\n {\n has_prev_pitch_with_accidental = False;\n }\n\n \/\/ this is a special case for dealing with naturals. If the pitch names\n \/\/ match, and the note is not in the key signature, and the previous pitch\n \/\/ was not empty, then we probably have a natural on the query note.\n if (pname = pname2 and note_is_in_keysig = False and accid2 != '')\n {\n has_prev_pitch_with_accidental = True;\n }\n\n }\n }\n else\n {\n for each n in nr\n {\n if (n.Name = noteobj.Name and n.Accidental != 0 and note_is_in_keysig = True)\n {\n has_prev_pitch_with_accidental = False;\n }\n }\n }\n }\n\n \/\/ deal with the 'weird' accidental values that don't have a value in noteobj.Accidental\n switch (accid)\n {\n case ('bb')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('b-')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('-')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('+')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n case ('#+')\n {\n ret = (has_prev_pitch_with_accidental != True);\n return ret;\n }\n }\n\n if (noteobj.Accidental = 0 and note_is_in_keysig = True and has_prev_pitch_with_accidental = False)\n {\n \/\/ it's a natural?\n return True;\n }\n\n if (note_is_in_keysig = True and has_prev_pitch_with_accidental = False)\n {\n return False;\n }\n\n if (has_prev_pitch_with_accidental = False and noteobj.Accidental != 0)\n {\n return True;\n }\n \n if (has_prev_pitch_with_accidental = True and accid = '')\n {\n \/\/ this is the corresponding return value for special cased naturals.\n return True;\n }\n\n \/\/ Finally, by default, assume this has no accidental.\n return False;\n} \/\/$end\n\nfunction ConvertNamedTimeSignature (timesig) {\n \/\/$module(ExportConverters.mss)\n switch(timesig)\n {\n case(CommonTimeString)\n {\n return 'common';\n }\n case(AllaBreveTimeString)\n {\n return 'cut';\n }\n default\n {\n return ' ';\n }\n }\n} \/\/$end\n\nfunction ConvertBracket (bracket) {\n \/\/$module(ExportConverters.mss)\n switch(bracket)\n {\n case(BracketFull)\n {\n return 'bracket';\n }\n case(BracketBrace)\n {\n return 'brace';\n }\n case(BracketSub)\n {\n return 'line';\n }\n default\n {\n return 'none';\n }\n }\n} \/\/$end\n\nfunction ConvertSibeliusStructure (score) {\n \/\/$module(ExportConverters.mss)\n \/\/ Takes in the Staff\/Bar Sibelius Structure and returns a Bar\/Staff\n \/\/ mapping for our MEI writers.\n bar_to_staff = CreateDictionary();\n\n \/\/ Invert the Sibelius structure\n for each Staff s in score\n {\n for each Bar b in s\n {\n if (bar_to_staff.PropertyExists(b.BarNumber))\n {\n bar_to_staff[b.BarNumber].Push(s.StaffNum);\n }\n else\n {\n bar_to_staff[b.BarNumber] = CreateSparseArray();\n bar_to_staff[b.BarNumber].Push(s.StaffNum);\n }\n }\n }\n return bar_to_staff;\n} \/\/$end\n\nfunction ConvertColor (nrest) {\n \/\/$module(ExportConverters.mss)\n r = nrest.ColorRed;\n g = nrest.ColorGreen;\n b = nrest.ColorBlue;\n a_dec = nrest.ColorAlpha & '.0';\n a = a_dec \/ 255.0;\n\n return 'rgba(' & r & ',' & g & ',' & b & ',' & a & ')';\n} \/\/$end\n\nfunction ConvertNoteStyle (style) {\n \/\/$module(ExportConverters.mss)\n noteStyle = ' ';\n\n if (style = NormalNoteStyle)\n {\n return ' ';\n }\n\n switch (style)\n {\n case (CrossNoteStyle)\n {\n noteStyle = 'cross';\n }\n case (DiamondNoteStyle)\n {\n noteStyle = 'diamond';\n }\n case (CrossOrDiamondNoteStyle)\n {\n \/\/ Sibelius uses this for percussion\n \/\/ and does not differentiate in the \n \/\/ head style, so we have to choose one\n \/\/ or the other.\n noteStyle = 'cross';\n }\n case (BlackAndWhiteDiamondNoteStyle)\n {\n noteStyle = 'filldiamond';\n }\n case (SlashedNoteStyle)\n {\n noteStyle = 'addslash';\n }\n case (BackSlashedNoteStyle)\n {\n noteStyle = 'addbackslash';\n }\n case (ArrowDownNoteStyle)\n {\n \/\/ this is not completely correct, since\n \/\/ we use the same value for up and down\n \/\/ iso triangles. But it's all we have for now.\n noteStyle = 'isotriangle';\n }\n case (ArrowUpNoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (InvertedTriangleNoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (ShapedNote1NoteStyle)\n {\n noteStyle = 'isotriangle';\n }\n case (ShapedNote2NoteStyle)\n {\n noteStyle = 'semicircle';\n }\n case (ShapedNote3NoteStyle)\n {\n noteStyle = 'diamond';\n }\n case (ShapedNote4StemUpNoteStyle)\n {\n noteStyle = 'rtriangle';\n }\n case (ShapedNote4StemDownNoteStyle)\n {\n noteStyle = 'rtriangle';\n }\n case (ShapedNote5NoteStyle)\n {\n \/\/ this looks normal...\n noteStyle = ' ';\n }\n case (ShapedNote6NoteStyle)\n {\n \/\/ there is no square in MEI...\n noteStyle = ' ';\n }\n case (ShapedNote7NoteStyle)\n {\n noteStyle = 'piewedge';\n }\n }\n\n return noteStyle;\n} \/\/$end\n\nfunction ConvertSlurStyle (style) {\n \/\/$module(ExportConverters.mss)\n slurparts = MSplitString(style, '.');\n direction = ' ';\n style = ' ';\n\n switch(slurparts[3])\n {\n case ('up')\n {\n direction = 'above';\n }\n case ('down')\n {\n direction = 'below';\n }\n default\n {\n direction = ' ';\n }\n }\n switch(slurparts[4])\n {\n case ('dashed')\n {\n style = 'dashed';\n }\n case ('dotted')\n {\n style = 'dotted';\n }\n default\n {\n style = ' ';\n }\n }\n return CreateSparseArray(direction, style);\n} \/\/$end\n\nfunction ConvertPositionToTimestamp (position, bar) {\n \/\/$module(ExportConverters.mss)\n \/*\n To convert Sibelius ticks to musical timestamps\n we use the formula:\n\n tstamp = (notePosition \/ (barLength \/ beatsInBar))\n *\/\n\n \/\/ make sure we're working with floating point numbers\n \/\/ and yes, this makes me feel very, very dirty in case\n \/\/ you were wondering, but this is the only way ManuScript\n \/\/ can cast to floating point...\n barlength = bar.Length;\n timesignature = Sibelius.ActiveScore.SystemStaff.CurrentTimeSignature(bar.BarNumber);\n\n if (position = 0)\n {\n return 1;\n }\n\n barlen = barlength & '.0';\n pos = position & '.0';\n beats = timesignature.Numerator & '.0';\n unit = (barlen \/ beats);\n ret = (pos \/ unit) + 1;\n\n return ret;\n} \/\/$end\n\nfunction ConvertTupletStyle (tupletStyle) {\n \/\/$module(ExportConverters.mss)\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.addAttribute(activeTuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.addAttribute(activeTuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.addAttribute(activeTuplet, 'num.format', 'ratio');\n }\n }\n\n} \/\/$end\n\nfunction ConvertBarline (linetype) {\n \/\/$module(ExportConverters.mss)\n switch(linetype)\n {\n case (SpecialBarlineStartRepeat)\n {\n \/\/ start repeat\n return 'rptstart';\n }\n case (SpecialBarlineEndRepeat)\n {\n \/\/ end repeat\n return 'rptend';\n }\n case (SpecialBarlineDashed)\n {\n \/\/ dashed\n return 'dashed';\n }\n case (SpecialBarlineDouble)\n {\n \/\/ double\n return 'dbl';\n }\n case (SpecialBarlineFinal)\n {\n \/\/ final\n return 'end';\n }\n case (SpecialBarlineInvisible)\n {\n \/\/ invisible\n return 'invis';\n }\n case (SpecialBarlineBetweenStaves)\n {\n \/\/ between staves\n \/\/ no MEI equiv.\n return ' ';\n }\n case (SpecialBarlineNormal)\n {\n \/\/ normal\n \/\/ this should usually be needed.\n return 'single';\n }\n case (SpecialBarlineTick)\n {\n \/\/ tick\n \/\/ unknown\n return ' ';\n }\n case (SpecialBarlineShort)\n {\n \/\/ short\n \/\/ unknown\n return ' ';\n }\n default\n {\n return ' ';\n }\n }\n} \/\/$end\n\nfunction ConvertText (textobj) {\n \/\/$module(ExportConverters.mss)\n styleid = textobj.StyleId;\n switch (styleid)\n {\n case ('text.staff.expression')\n {\n dynam = libmei.Dynam();\n libmei.SetText(dynam, lstrip(textobj.Text));\n libmei.AddAttribute(dynam, 'staff', textobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(dynam, 'tstamp', ConvertPositionToTimestamp(textobj));\n\n if (textobj.Dx != 0)\n {\n libmei.AddAttribute(dynam, 'ho', ConvertOffset(textobj.Dx));\n }\n\n if (textobj.Dy != 0)\n {\n libmei.AddAttribute(dynam, 'vo', ConvertOffset(textobj.Dy));\n }\n return dynam;\n }\n case ('text.system.page_aligned.title')\n {\n return ConvertTextElement(textobj);\n }\n case ('text.system.page_aligned.composer')\n {\n return ConvertTextElement(textobj);\n }\n default\n {\n return null;\n }\n }\n} \/\/$end\n\nfunction ConvertTextElement (textobj) {\n \/\/$module(ExportConverters.mss)\n obj = libmei.AnchoredText();\n libmei.SetText(obj, lstrip(textobj.Text));\n\n if (textobj.Dx != 0)\n {\n libmei.AddAttribute(obj, 'ho', ConvertOffsets(textobj.Dx));\n }\n\n if (textobj.Dy != 0)\n {\n libmei.AddAttribute(obj, 'vo', ConvertOffset(textobj.Dy));\n }\n\n return obj;\n} \/\/$end\n\nfunction ConvertEndingValues (styleid) {\n \/\/$module(ExportConverters)\n ending_style = MSplitString(styleid, '.');\n num = ' ';\n label = ' ';\n type = ' ';\n\n switch(ending_style[3])\n {\n case ('1st')\n {\n num = 1;\n label = '1.';\n type = 'closed';\n }\n case ('1st_n_2nd')\n {\n num = 1;\n label = '1. 2.';\n type = 'closed';\n }\n case ('2nd')\n {\n num = 2;\n label = '2.';\n if (ending_style[-1] = 'closed')\n {\n type = 'closed';\n }\n else\n {\n type = 'open';\n }\n }\n case ('3rd')\n {\n num = 3;\n label = '3.';\n type = 'closed';\n }\n case ('open')\n {\n type = 'open';\n }\n case ('closed')\n {\n type = 'closed';\n }\n }\n\n return CreateSparseArray(num, label, type);\n\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"328f44e766c6beac26bace22cd964312f86fb8ef","subject":"Don't output if file has no staffs","message":"Don't output if file has no staffs\n","repos":"music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n\n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n \/\/encodingDesc must preceed workList in MEI 4.0\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = GenerateApplicationInfo();\n libmei.AddChild(encodingD, appI);\n\n \/\/generate workList\n workList = libmei.WorkList();\n Self._property:WorkListElement = workList;\n\n wd_work = libmei.Work();\n wd_title = libmei.Title();\n libmei.AddChild(wd_work, wd_title);\n libmei.AddChild(workList, wd_work);\n libmei.AddChild(header, workList);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.Composer();\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_work, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.Lyricist();\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_work, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.Arranger();\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_work, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n return header;\n} \/\/$end\n\nfunction GenerateApplicationInfo () {\n \/\/$module(ExportGenerators.mss)\n\n appI = libmei.AppInfo();\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return appI;\n\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:SlurResolver = CreateSparseArray();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n \/\/annot is valid as a child of score\n libmei.AddChild(sco, ano);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workList = Self._property:WorkListElement;\n workEl = libmei.Work();\n libmei.AddChild(workList, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n mobjs = Self._property:MeasureObjects;\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/*\n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n parent = beam._property:ParentBeam;\n if (parent = null)\n {\n parent = l;\n }\n if (beam._parent != parent._id)\n {\n libmei.AddChild(parent, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n\n if (bobj.ArpeggioType != ArpeggioTypeNone) {\n arpeg = GenerateArpeggio(bobj);\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(arpeg._id);\n Self._property:MeasureObjects = mobjs;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n }\n }\n\n for each bobj in bar\n {\n obj = null;\n mobj = null;\n chordsym = null;\n\n switch (bobj.Type)\n {\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n bobj._property:mobj = mobj;\n PushToHashedLayer(Self._property:SlurResolver, bobj.EndBarNumber, bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('ArpeggioLine')\n {\n mobj = GenerateArpeggio(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n if (mobj != null)\n {\n \/\/Try to get note at position of bracket and put id\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(mobj, 'startid', '#' & obj._id);\n }\n }\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n Self._property:MeasureObjects = mobjs;\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n ProcessEndingSlurs(bar);\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n libmei.AddAttribute(nr, 'stem.mod', '1slash');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ppq', dur);\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pden & '.0' \/ pnum & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', gesdur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', dur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n \/\/ MEI now supports a four-bar repeat\n obj = libmei.MultiRpt();\n libmei.AddAttribute(obj, 'num', '4');\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n if (score.StaffCount > 0)\n {\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n }\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n \/\/brackets\n case ('bracket')\n {\n line = libmei.Line();\n bracketType = 'bracket';\n\n \/\/horizontal brackets\n if (linecomps.Length >= 3)\n {\n \/\/brackets above\n if (linecomps[3] = 'above')\n {\n libmei.AddAttribute(line, 'place', 'above');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleup');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angleup');\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n \/\/brackets below\n if (linecomps[3] = 'below')\n {\n libmei.AddAttribute(line, 'place', 'below');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angledown');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angledown');\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n \/\/vertical bracktes\n if (linecomps[3] = 'vertical')\n {\n bracketType = bracketType & ' vertical';\n\n \/\/Add direction of bracket: line.staff.bracket.vertical.2 opens to the right, line.staff.bracket.vertical opens to the left\n if (linecomps > 4)\n {\n if (linecomps[4] = '2')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleright');\n libmei.AddAttribute(line, 'endsym', 'angleright');\n }\n }\n\n else\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'startsym', 'angleleft');\n libmei.AddAttribute(line, 'endsym', 'angleleft');\n }\n }\n }\n\n \/\/add types of bracktes\n libmei.AddAttribute(line, 'type', bracketType);\n }\n \/\/solid vertical line\n case ('vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n libmei.AddAttribute(line,'type','vertical');\n }\n \/\/dashed lines\n case ('dashed')\n {\n \/\/dashed vertical line\n if (linecomps.Length > 3)\n {\n if (linecomps[3] = 'vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n libmei.AddAttribute(line,'type','vertical');\n }\n }\n \/\/dashed horizontal line\n else\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n }\n }\n \/\/dotted horizontal line\n case('dotted')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dotted');\n }\n \/\/solid horizontal line\n case('plain')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n }\n case ('vibrato')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'vibrato');\n libmei.AddAttribute(line, 'form', 'wavy');\n libmei.AddAttribute(line, 'place', 'above');\n\n }\n\n \/\/To catch diverse line types, set a default\n default\n {\n line = libmei.Line();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateArpeggio (bobj) {\n \/\/$module(ExportGenerators.mss)\n arpeg = libmei.Arpeg();\n orientation = null;\n\n switch (bobj.Type)\n {\n case ('NoteRest')\n {\n switch (bobj.ArpeggioType)\n {\n case (ArpeggioTypeUp)\n {\n orientation = 1;\n }\n case (ArpeggioTypeDown)\n {\n orientation = -1;\n }\n }\n if (bobj.ArpeggioBottomDy > bobj.ArpeggioTopDy)\n {\n \/\/ Arpeggio was manipulated to be upside down\n orientation = -1 * orientation;\n }\n }\n case ('ArpeggioLine')\n {\n if (bobj.StyleId != 'line.staff.arpeggio') {\n \/\/ This means: Line style is line.staff.arpeggio.up or\n \/\/ line.staff.arpeggio.down.\n \/\/ Strangely, the line style does not really matter for the\n \/\/ visual orientation of the arpeggio. As long as RhDy and\n \/\/ and Dy properties are identical, arpeggios look the same,\n \/\/ independant of the two line styles with arrowheads.\n orientation = bobj.RhDy - bobj.Dy;\n }\n }\n }\n\n if (orientation = null)\n {\n libmei.AddAttribute(arpeg, 'arrow', 'false');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'arrow', 'true');\n\n if (orientation > 0)\n {\n libmei.AddAttribute(arpeg, 'order', 'up');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'order', 'down');\n }\n }\n\n arpeg = AddBarObjectInfoToElement(bobj, arpeg);\n\n return arpeg;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'glyph.auth', 'smufl');\n libmei.AddAttribute(symbol, 'glyph.num', glyphnum);\n libmei.AddAttribute(symbol, 'glyph.name', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end\n","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n\n\n header = libmei.MeiHead();\n Self._property:HeaderElement = header;\n\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n\n \/\/encodingDesc must preceed workList in MEI 4.0\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = GenerateApplicationInfo();\n libmei.AddChild(encodingD, appI);\n\n \/\/generate workList\n workList = libmei.WorkList();\n Self._property:WorkListElement = workList;\n\n wd_work = libmei.Work();\n wd_title = libmei.Title();\n libmei.AddChild(wd_work, wd_title);\n libmei.AddChild(workList, wd_work);\n libmei.AddChild(header, workList);\n\n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.Composer();\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_work, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.Lyricist();\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_work, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.Arranger();\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_work, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n\n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n return header;\n} \/\/$end\n\nfunction GenerateApplicationInfo () {\n \/\/$module(ExportGenerators.mss)\n\n appI = libmei.AppInfo();\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n\n plgapp = libmei.Application();\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgapp, 'type', 'plugin');\n libmei.AddAttribute(plgapp, 'version', Version);\n libmei.SetId(plgapp, 'sibmei');\n libmei.AddChild(plgapp, plgname);\n libmei.AddChild(appI, plgapp);\n\n return appI;\n\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:SlurResolver = CreateSparseArray();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n Self._property:BodyElement = null;\n Self._property:MDivElement = null;\n Self._property:SectionElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n \/\/ We start the first page with a (good practice and helps Verovio)\n Self._property:PageBreak = libmei.Pb();\n Self._property:SystemBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages\n \/\/ Log('front: ' & frontmatter);\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n libmei.AddChild(music, body);\n Self._property:BodyElement = body;\n\n \/\/ start with the first bar.\n FIRST_BAR = 1;\n mdiv = GenerateMDiv(FIRST_BAR);\n libmei.AddChild(body, mdiv);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n systf = score.SystemStaff;\n\n currentScoreDef = null;\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n section = Self._property:SectionElement;\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n currTimeS = systf.CurrentTimeSignature(j);\n currKeyS = systf.CurrentKeySignature(j);\n\n if (Self._property:SystemBreak != null)\n {\n sb = Self._property:SystemBreak;\n libmei.AddChild(section, sb);\n Self._property:SystemBreak = null;\n }\n\n \/\/ Do not try to get the signatures for bar 0 -- will not work\n if (j > 1)\n {\n prevTimeS = systf.CurrentTimeSignature(j - 1);\n prevKeyS = systf.CurrentKeySignature(j - 1);\n }\n else\n {\n prevTimeS = systf.CurrentTimeSignature(j);\n prevKeyS = systf.CurrentKeySignature(j);\n }\n\n \/*\n This will check for a change in the current time signature and create a new\n scoredef element if it's changed. The key signature will always be processed later,\n so by then we will either have a new scoredef with a timesig change, or we'll need\n to create one just for the keysig change.\n *\/\n if ((currTimeS.Numerator != prevTimeS.Numerator) or (currTimeS.Denominator != prevTimeS.Denominator))\n {\n currentScoreDef = libmei.ScoreDef();\n \/\/ Log('Time Signature Change in Bar ' & j);\n libmei.AddAttribute(currentScoreDef, 'meter.count', currTimeS.Numerator);\n libmei.AddAttribute(currentScoreDef, 'meter.unit', currTimeS.Denominator);\n libmei.AddAttribute(currentScoreDef, 'meter.sym', ConvertNamedTimeSignature(currTimeS.Text));\n }\n\n if (currKeyS.Sharps != prevKeyS.Sharps)\n {\n if (currentScoreDef = null)\n {\n currentScoreDef = libmei.ScoreDef();\n }\n\n libmei.AddAttribute(currentScoreDef, 'key.sig', ConvertKeySignature(currKeyS.Sharps));\n }\n\n if (currentScoreDef != null)\n {\n \/\/ The sig changes must be added just before we add the measure to keep\n \/\/ the proper order.\n if (ending != null)\n {\n libmei.AddChild(ending, currentScoreDef);\n }\n else\n {\n libmei.AddChild(section, currentScoreDef);\n }\n currentScoreDef = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMDiv (barnum) {\n \/\/$module(ExportGenerators.mss)\n \/\/ Add the first mdiv; Movements will add new ones.\n score = Self._property:ActiveScore;\n\n mdiv = libmei.Mdiv();\n Self._property:MDivElement = mdiv;\n\n ano = libmei.Annot();\n libmei.AddAttribute(ano, 'type', 'duration');\n libmei.SetText(ano, ConvertTimeStamp(score.ScoreDuration));\n\n sco = libmei.Score();\n libmei.AddChild(mdiv, sco);\n\n scd = GenerateScoreDef(score, barnum);\n Self._property:MainScoreDef = scd;\n libmei.AddChild(sco, scd);\n\n section = libmei.Section();\n Self._property:SectionElement = section;\n libmei.AddChild(sco, section);\n\n \/\/annot is valid as a child of score\n libmei.AddChild(sco, ano);\n\n return mdiv;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureObjects = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n systf = score.SystemStaff;\n currTimeS = systf.CurrentTimeSignature(num);\n sysBar = systf[num];\n\n if (sysBar.Length != (currTimeS.Numerator * 1024 \/ currTimeS.Denominator))\n {\n libmei.AddAttribute(m, 'metcon', 'false');\n }\n\n systf = score.SystemStaff;\n sysBar = systf[num];\n\n if (sysBar.NthBarInSystem = 0)\n {\n Self._property:SystemBreak = libmei.Sb();\n }\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString and libmei.GetAttribute(m, 'label') = False)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureObjects;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n \/\/ an array of bar lines for this measure\n blines = specialbarlines[num];\n\n for each bline in blines\n {\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n \/\/ If we've reached the end of the section, swap out the mdiv to a new one.\n if (sysBar.SectionEnd = true)\n {\n body = Self._property:BodyElement;\n \/\/ create the mdiv for the next bar.\n newMdiv = GenerateMDiv(num + 1);\n libmei.AddChild(body, newMdiv);\n \/\/ a new section end means a new entry in the header.\n workList = Self._property:WorkListElement;\n workEl = libmei.Work();\n libmei.AddChild(workList, workEl);\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n mobjs = Self._property:MeasureObjects;\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n mobj = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n normalizedBeamProp = NormalizedBeamProp(bobj);\n\n if (normalizedBeamProp = SingleBeam)\n {\n if (bobj.GraceNote)\n {\n prevNote = l._property:PrevGraceNote;\n }\n else\n {\n prevNote = l._property:PrevNote;\n }\n \/\/ prevNote is not null here - unless we have a bug in NormalizeBeamProp()\n \/\/ or the registration of previous notes.\n libmei.AddAttribute(prevNote, 'breaksec', '1');\n }\n\n \/\/ fetch or create the active beam object (if any)\n beam = ProcessBeam(bobj, l, normalizedBeamProp);\n\n \/\/ fetch or create the active tuplet object (if any)\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent = l._id)\n {\n \/*\n If the beam has been previously added to the layer but now\n finds itself part of a tuplet, shift the tuplet to a tupletSpan. This\n effectively just replaces the active tuplet with a tupletSpan element\n *\/\n if (tuplet.name != 'tupletSpan')\n {\n ShiftTupletToTupletSpan(tuplet, l);\n }\n }\n else\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n }\n else\n {\n parent = beam._property:ParentBeam;\n if (parent = null)\n {\n parent = l;\n }\n if (beam._parent != parent._id)\n {\n libmei.AddChild(parent, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n tname = libmei.GetName(tuplet);\n\n if (tname != 'tupletSpan')\n {\n libmei.AddChild(tuplet, note);\n }\n else\n {\n libmei.AddChild(l, note);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n if (bobj.GraceNote)\n {\n l._property:PrevGraceNote = note;\n }\n else\n {\n l._property:PrevNote = note;\n }\n\n if (bobj.ArpeggioType != ArpeggioTypeNone) {\n arpeg = GenerateArpeggio(bobj);\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(arpeg._id);\n Self._property:MeasureObjects = mobjs;\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n }\n }\n\n for each bobj in bar\n {\n obj = null;\n mobj = null;\n chordsym = null;\n\n switch (bobj.Type)\n {\n case('GuitarFrame')\n {\n chordsym = GenerateChordSymbol(bobj);\n }\n case('Slur')\n {\n mobj = GenerateLine(bobj);\n bobj._property:mobj = mobj;\n PushToHashedLayer(Self._property:SlurResolver, bobj.EndBarNumber, bobj);\n }\n case('CrescendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('DiminuendoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('GlissandoLine')\n {\n mobj = GenerateLine(bobj);\n }\n case('Trill')\n {\n mobj = GenerateLine(bobj);\n }\n case('ArpeggioLine')\n {\n mobj = GenerateArpeggio(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n mobj = GenerateLine(bobj);\n }\n case('Text')\n {\n mobj = ConvertText(bobj);\n if (mobj != null)\n {\n \/\/Try to get note at position of bracket and put id\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(mobj, 'startid', '#' & obj._id);\n }\n }\n }\n }\n\n if (mobj != null)\n {\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(mobj._id);\n Self._property:MeasureObjects = mobjs;\n }\n\n \/\/ add chord symbols to the measure objects\n \/\/ so that they get added to the measure later in the processing cycle.\n if (chordsym != null)\n {\n mlines = Self._property:MeasureObjects;\n mlines.Push(chordsym._id);\n Self._property:MeasureObjects = mlines;\n }\n }\n\n Self._property:MeasureObjects = mobjs;\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj);\n }\n\n ProcessEndingSlurs(bar);\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.NoteCount > 0)\n {\n \/\/ notes and chords, not rests.\n switch (bobj.Stemweight)\n {\n case (StemweightUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n case (StemweightFlipUp)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n case (StemweightFlipDown)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n default\n {\n \/\/ Handle other values.\n \/\/ If the stemweight is less than zero, the stem will point up, otherwise it will point down.\n if (bobj.Stemweight < 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'up');\n }\n\n \/\/ it seems that 0-weight stems are assumed to be down\n if (bobj.Stemweight >= 0)\n {\n libmei.AddAttribute(nr, 'stem.dir', 'down');\n }\n }\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n \/* NB: If there is a problem with grace notes, look here first.\n I think most of these cases should be covered by appog. and acciacc.\n but possibly not...\n\n if (bobj.GraceNote = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n *\/\n\n if (bobj.IsAppoggiatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAcciaccatura = True)\n {\n libmei.AddAttribute(nr, 'grace', 'unacc');\n libmei.AddAttribute(nr, 'stem.mod', '1slash');\n }\n\n if (bobj.GetArticulation(PauseArtic) or bobj.GetArticulation(TriPauseArtic) or bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.GetArticulation(HarmonicArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'harm');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = ZOnStem))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n libmei.AddAttribute(nr, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n name = libmei.GetName(r);\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ppq', dur);\n libmei.AddAttribute(r, 'dots', meidur[1]);\n\n if (bobj.Dx != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0 and name != 'space')\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and name != 'space')\n {\n libmei.AddAttribute(r, 'fontsize', 'small');\n }\n\n if (bobj.Hidden = true and name != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0 and name != 'space')\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n\n \/\/ handle modifications to the gestural duration\n \/\/ if this particular note is a member of a tuplet.\n gesdur = null;\n if (nobj.ParentNoteRest.ParentTupletIfAny != null)\n {\n dur = nobj.ParentNoteRest.Duration;\n ptuplet = nobj.ParentNoteRest.ParentTupletIfAny;\n pnum = ptuplet.Left;\n pden = ptuplet.Right;\n floatgesdur = (pden & '.0' \/ pnum & '.0') * dur;\n gesdur = Round(floatgesdur);\n }\n else\n {\n gesdur = nobj.ParentNoteRest.Duration;\n }\n\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n parent_bar = nobj.ParentNoteRest.ParentBar;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n \/\/hash = SimpleNoteHash(nobj);\n \/\/n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', gesdur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n layer = nobj.ParentNoteRest.VoiceNumber;\n\n \/\/libmei.AddAttribute(n, 'staff', staff);\n \/\/libmei.AddAttribute(n, 'layer', layer);\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'head.shape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n tie_resolver = Self._property:TieResolver;\n\n \/\/ construct an index that will be used to open a tie, or check if a tie is open.\n \/\/ this may be modified below if the tie extends to the next bar\n tie_idx = parent_bar.BarNumber & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(tie_idx) and tie_resolver[tie_idx] != null)\n {\n \/\/ get the tie\n tie_id = tie_resolver[tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n \/\/ null it in case we get another one in this measure.\n tie_resolver[tie_idx] = null;\n }\n\n \/*\n If we have an unresolved tie with the same pitch number from the previous bar,\n assume that it stretches to this bar. Look backwards to see if this is the case\n and set it as the end of the tie.\n *\/\n prev_tie_idx = (parent_bar.BarNumber - 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n\n if (tie_resolver.PropertyExists(prev_tie_idx) and tie_resolver[prev_tie_idx] != null)\n {\n tie_id = tie_resolver[prev_tie_idx];\n tie_el = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie_el, 'endid', '#' & n._id);\n\n tie_resolver[prev_tie_idx] = null;\n }\n\n if (nobj.Tied = True)\n {\n measure_ties = Self._property:MeasureTies;\n\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n measure_ties.Push(tie._id);\n tie_dur = pos + dur;\n\n \/\/ if the tie extends beyond the length of the bar, increment the\n \/\/ bar by one so that we can pick up on it later...\n if (tie_dur >= parent_bar.Length)\n {\n tie_idx = (parent_bar.BarNumber + 1) & '-' & staff & '-' & nobj.ParentNoteRest.VoiceNumber & '-' & pnum;\n }\n\n tie_resolver[tie_idx] = tie._id;\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ppq', dur);\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n \/\/ MEI now supports a four-bar repeat\n obj = libmei.MultiRpt();\n libmei.AddAttribute(obj, 'num', '4');\n }\n }\n\n fermata = GenerateFermata(bobj);\n if (fermata != null)\n {\n libmei.AddAttribute(fermata, 'startid', '#' & obj._id);\n measureObjs = Self._property:MeasureObjects;\n measureObjs.Push(fermata._id);\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n libmei.AddAttribute(obj, 'tstamp.real', ConvertTimeStamp(bobj.Time));\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n \/\/ We should read out the lyrics font styles here (e.g. `text.staff.space.hypen.lyrics.verse1`),\n \/\/ but the styles properties don't seem to be easily accessible.\n libmei.AddAttribute(scoredef, 'lyric.name', score.MainTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score, barnum);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score, barnum) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n\n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n\n keysig = s.CurrentKeySignature(barnum);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(keysig.Sharps));\n\n if (keysig.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n \/\/ midi pan is 0-127, Sib. pan is -127 to + 127, so this needs to be converted.\n pan = RoundUp((s.Pan + 127) \/ 2);\n libmei.AddAttribute(instrDef, 'midi.pan', pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n\n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateTuplet(tupletObj) {\n \/\/$module(ExportGenerators.mss)\n tuplet = libmei.Tuplet();\n\n libmei.AddAttribute(tuplet, 'num', tupletObj.Left);\n libmei.AddAttribute(tuplet, 'numbase', tupletObj.Right);\n\n tupletStyle = tupletObj.Style;\n\n switch (tupletStyle)\n {\n case(TupletNoNumber)\n {\n libmei.AddAttribute(tuplet, 'dur.visible', 'false');\n }\n case(TupletLeft)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'count');\n }\n case(TupletLeftRight)\n {\n libmei.AddAttribute(tuplet, 'num.format', 'ratio');\n }\n }\n\n tupletBracket = tupletObj.Bracket;\n\n switch(tupletBracket)\n {\n case(TupletBracketOff)\n {\n libmei.AddAttribute(tuplet, 'bracket.visible', 'false');\n }\n }\n\n tuplet._property:SibTuplet = tupletObj;\n\n return tuplet;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'lform', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DiminuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(line, 'dis', octrend[0]);\n libmei.AddAttribute(line, 'dis.place', octrend[1]);\n }\n case ('GlissandoLine')\n {\n line = libmei.Gliss();\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element.\n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n \/\/brackets\n case ('bracket')\n {\n line = libmei.Line();\n bracketType = 'bracket';\n\n \/\/horizontal brackets\n if (linecomps.Length >= 3)\n {\n \/\/brackets above\n if (linecomps[3] = 'above')\n {\n libmei.AddAttribute(line, 'place', 'above');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleup');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angleup');\n libmei.AddAttribute(line, 'endsym', 'angleup');\n }\n }\n \/\/brackets below\n if (linecomps[3] = 'below')\n {\n libmei.AddAttribute(line, 'place', 'below');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angledown');\n }\n\n if (linecomps[4] = 'end')\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n else\n {\n libmei.AddAttribute(line, 'startsym', 'angledown');\n libmei.AddAttribute(line, 'endsym', 'angledown');\n }\n }\n \/\/vertical bracktes\n if (linecomps[3] = 'vertical')\n {\n bracketType = bracketType & ' vertical';\n\n \/\/Add direction of bracket: line.staff.bracket.vertical.2 opens to the right, line.staff.bracket.vertical opens to the left\n if (linecomps > 4)\n {\n if (linecomps[4] = '2')\n {\n bracketType = bracketType & ' start';\n libmei.AddAttribute(line, 'startsym', 'angleright');\n libmei.AddAttribute(line, 'endsym', 'angleright');\n }\n }\n\n else\n {\n bracketType = bracketType & ' end';\n libmei.AddAttribute(line, 'startsym', 'angleleft');\n libmei.AddAttribute(line, 'endsym', 'angleleft');\n }\n }\n }\n\n \/\/add types of bracktes\n libmei.AddAttribute(line, 'type', bracketType);\n }\n \/\/solid vertical line\n case ('vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n libmei.AddAttribute(line,'type','vertical');\n }\n \/\/dashed lines\n case ('dashed')\n {\n \/\/dashed vertical line\n if (linecomps.Length > 3)\n {\n if (linecomps[3] = 'vertical')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n libmei.AddAttribute(line,'type','vertical');\n }\n }\n \/\/dashed horizontal line\n else\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dashed');\n }\n }\n \/\/dotted horizontal line\n case('dotted')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','dotted');\n }\n \/\/solid horizontal line\n case('plain')\n {\n line = libmei.Line();\n libmei.AddAttribute(line,'form','solid');\n }\n case ('vibrato')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'vibrato');\n libmei.AddAttribute(line, 'form', 'wavy');\n libmei.AddAttribute(line, 'place', 'above');\n\n }\n\n \/\/To catch diverse line types, set a default\n default\n {\n line = libmei.Line();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateArpeggio (bobj) {\n \/\/$module(ExportGenerators.mss)\n arpeg = libmei.Arpeg();\n orientation = null;\n\n switch (bobj.Type)\n {\n case ('NoteRest')\n {\n switch (bobj.ArpeggioType)\n {\n case (ArpeggioTypeUp)\n {\n orientation = 1;\n }\n case (ArpeggioTypeDown)\n {\n orientation = -1;\n }\n }\n if (bobj.ArpeggioBottomDy > bobj.ArpeggioTopDy)\n {\n \/\/ Arpeggio was manipulated to be upside down\n orientation = -1 * orientation;\n }\n }\n case ('ArpeggioLine')\n {\n if (bobj.StyleId != 'line.staff.arpeggio') {\n \/\/ This means: Line style is line.staff.arpeggio.up or\n \/\/ line.staff.arpeggio.down.\n \/\/ Strangely, the line style does not really matter for the\n \/\/ visual orientation of the arpeggio. As long as RhDy and\n \/\/ and Dy properties are identical, arpeggios look the same,\n \/\/ independant of the two line styles with arrowheads.\n orientation = bobj.RhDy - bobj.Dy;\n }\n }\n }\n\n if (orientation = null)\n {\n libmei.AddAttribute(arpeg, 'arrow', 'false');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'arrow', 'true');\n\n if (orientation > 0)\n {\n libmei.AddAttribute(arpeg, 'order', 'up');\n }\n else\n {\n libmei.AddAttribute(arpeg, 'order', 'down');\n }\n }\n\n arpeg = AddBarObjectInfoToElement(bobj, arpeg);\n\n return arpeg;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a\n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n bar = bobj.ParentBar;\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\n\nfunction GenerateFermata (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* Note rests can have multiple fermatas in Sibelius,\n but this is currently not supported.\n Also, fermatas added as symbols are not yet handled.\n *\/\n shape = null;\n\n switch (bobj.Type)\n {\n case('NoteRest')\n {\n if (bobj.GetArticulation(PauseArtic))\n {\n shape = 'curved';\n }\n if (bobj.GetArticulation(TriPauseArtic))\n {\n shape = 'angular';\n }\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n shape = 'square';\n }\n }\n case('BarRest')\n {\n switch (bobj.PauseType)\n {\n case(PauseTypeRound)\n {\n shape = 'curved';\n }\n case(PauseTypeTriangular)\n {\n shape = 'angular';\n }\n case(PauseTypeSquare)\n {\n shape = 'square';\n }\n }\n }\n }\n\n if (shape = null)\n {\n return null;\n }\n\n fermata = libmei.Fermata();\n\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', shape);\n\n fermata = AddBarObjectInfoToElement(bobj, fermata);\n\n return fermata;\n} \/\/$end\n\nfunction GenerateChordSymbol (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Generates a element containing chord symbol information\n *\/\n harm = libmei.Harm();\n\n libmei.AddAttribute(harm, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n libmei.AddAttribute(harm, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.SetText(harm, bobj.ChordNameAsPlainText);\n\n return harm;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element.\n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain\n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/\n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end\n\nfunction GenerateSmuflAltsym (glyphnum, glyphname) {\n \/\/$module(ExportGenerators.mss)\n if (Self._property:SmuflSymbolIds = null)\n {\n Self._property:SmuflSymbolIds = CreateDictionary();\n }\n symbolIds = Self._property:SmuflSymbolIds;\n\n if (symbolIds[glyphnum] = null)\n {\n if (Self._property:SymbolTable = null)\n {\n symbolTable = libmei.SymbolTable();\n libmei.AddChild(Self._property:MainScoreDef, symbolTable);\n Self._property:SymbolTable = symbolTable;\n }\n symbolTable = Self._property:SymbolTable;\n\n symbolDef = libmei.SymbolDef();\n libmei.AddChild(symbolTable, symbolDef);\n anchoredText = libmei.AnchoredText();\n libmei.AddChild(symbolDef, anchoredText);\n symbol = libmei.Symbol();\n libmei.AddChild(anchoredText, symbol);\n libmei.AddAttribute(symbol, 'glyph.auth', 'smufl');\n libmei.AddAttribute(symbol, 'glyph.num', glyphnum);\n libmei.AddAttribute(symbol, 'glyph.name', glyphname);\n\n symbolIds[glyphnum] = symbolDef._id;\n }\n\n return '#' & symbolIds[glyphnum];\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"a7aefbc9b2e53b3f2ecb84b4443a81105acd8ba9","subject":"Fixed: Add @tstamp, @staff, and @layer to clef","message":"Fixed: Add @tstamp, @staff, and @layer to clef\n\nPreviously the clef element was missing some information about it's exact positioning (e.g., for a clef change). This commit adds more information to the clef element to help reconstruct its position in the bar.\n\nFixes #27\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgname, 'type', 'plugin');\n libmei.AddChild(applic, plgname);\n\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n if (note._property:TieIds != null)\n {\n ties = note._property:TieIds;\n mties = Self._property:MeasureTies;\n mties = mties.Concat(ties);\n Self._property:MeasureTies = mties;\n }\n\n beam = ProcessBeam(bobj, l);\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n libmei.AddChild(tuplet, note);\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n libmei.AddAttribute(clef_el, 'tstamp', ConvertPositionToTimestamp(bobj.Position, bobj.ParentBar));\n libmei.AddAttribute(clef_el, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(clef_el, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n if (bobj.GraceNote = True or bobj.IsAppoggiatura = True or bobj.IsAcciaccatura = True)\n {\n \/\/ skip any notes that are grace notes, since these will be encoded on the next note.\n return null;\n }\n\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n if (prev_object != null and prev_object.GraceNote = true)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (prev_object != null and prev_object.IsAppoggiatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'A');\n }\n\n if (prev_object != null and prev_object.IsAcciaccatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'a');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.addAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0)\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n \/\/ Accidentals will always be encoded as child elements, not attributes\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'headshape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n \/*\n Ties\n *\/\n tieresolver = Self._property:TieResolver;\n if (tieresolver.PropertyExists(hash))\n {\n \/\/ this note is the end of the tie.\n tie_id = tieresolver[hash];\n tie = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie, 'endid', '#' & n._id);\n }\n\n if (nobj.Tied = True)\n {\n \/\/ set the end hash\n parent_nr = nobj.ParentNoteRest;\n next_object = parent_nr.NextItem(parent_nr.VoiceNumber, 'NoteRest');\n\n if (next_object = null)\n {\n \/\/ check the first object in the next bar\n next_bar_num = parent_nr.ParentBar.BarNumber + 1;\n next_bar = parent_nr.ParentBar.ParentStaff.NthBar(next_bar_num);\n next_object = next_bar.NthBarObject(0);\n }\n\n if (next_object = null or next_object.Type != 'NoteRest')\n {\n \/\/ it's a hanging tie. What to do, what to do?\n \/\/ for now, just encode the startid with no endid and return the note.\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n n._property:TieIds = CreateSparseArray(tie._id);\n return n;\n }\n\n for each next_note in next_object\n {\n if (nobj.Pitch = next_note.Pitch)\n {\n \/\/ it's probably this one.\n endhash = SimpleNoteHash(next_note);\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n tieresolver[endhash] = tie._id;\n\n n._property:TieIds = CreateSparseArray(tie._id);\n }\n }\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n \n tiearr = CreateSparseArray();\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n\n if (sn._property:TieIds != null)\n {\n tieids = sn._property:TieIds;\n tiearr = tiearr.Concat(tieids);\n }\n }\n\n n._property:TieIds = tiearr;\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n libmei.AddAttribute(instrDef, 'midi.pan', s.Pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'rend', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(octl, 'dis', octrend[0]);\n libmei.AddAttribute(octl, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n Log('A vertical line was found.');\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n Log('Format close: ' & activeinfo);\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgname, 'type', 'plugin');\n libmei.AddChild(applic, plgname);\n\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n if (note != null)\n {\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n if (note._property:TieIds != null)\n {\n ties = note._property:TieIds;\n mties = Self._property:MeasureTies;\n mties = mties.Concat(ties);\n Self._property:MeasureTies = mties;\n }\n\n beam = ProcessBeam(bobj, l);\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n libmei.AddChild(tuplet, note);\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n }\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n if (bobj.GraceNote = True or bobj.IsAppoggiatura = True or bobj.IsAcciaccatura = True)\n {\n \/\/ skip any notes that are grace notes, since these will be encoded on the next note.\n return null;\n }\n\n nr = null;\n\n \/\/ the previous object will tell us if it was a grace note, appogiature, or acciaccatura.\n prev_object = bobj.PreviousItem(bobj.VoiceNumber, 'NoteRest');\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n if (prev_object != null and prev_object.GraceNote = true)\n {\n libmei.AddAttribute(nr, 'grace', 'acc');\n }\n\n if (prev_object != null and prev_object.IsAppoggiatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'A');\n }\n\n if (prev_object != null and prev_object.IsAcciaccatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'a');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.addAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0)\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n pos = nobj.ParentNoteRest.Position;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n clef = nobj.ParentNoteRest.ParentBar.GetClefAt(pos);\n \/\/ SparseArray(shape, line, dis, dir);\n clefinfo = ConvertClef(clef.StyleId);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pnum = nobj.Pitch;\n\n dis = clefinfo[2];\n dir = clefinfo[3];\n\n if (dis != ' ')\n {\n octges = ' ';\n \/\/ there is a transposing clef in action, so we need to adjust the\n \/\/ performed octave.\n if (dis = '8' and dir = 'below')\n {\n octges = ntinfo[1] - 1;\n pnum = pnum - 12; \/\/ subtract an octave from the MIDI number\n }\n\n if (dis = '8' and dir = 'above')\n {\n octges = ntinfo[1] + 1;\n pnum = pnum + 12;\n }\n\n if (dis = '15' and dir = 'below')\n {\n octges = ntinfo[1] - 2;\n pnum = pnum - 24; \/\/ subtract two octaves from the MIDI number\n }\n\n if (dis = '15' and dir = 'above')\n {\n octges = ntinfo[1] + 2;\n pnum = pnum + 24;\n }\n\n libmei.AddAttribute(n, 'oct.ges', octges);\n }\n\n libmei.AddAttribute(n, 'pnum', pnum);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n \/\/ Accidentals will always be encoded as child elements, not attributes\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'headshape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n \/*\n Ties\n *\/\n tieresolver = Self._property:TieResolver;\n if (tieresolver.PropertyExists(hash))\n {\n \/\/ this note is the end of the tie.\n tie_id = tieresolver[hash];\n tie = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie, 'endid', '#' & n._id);\n }\n\n if (nobj.Tied = True)\n {\n \/\/ set the end hash\n parent_nr = nobj.ParentNoteRest;\n next_object = parent_nr.NextItem(parent_nr.VoiceNumber, 'NoteRest');\n\n if (next_object = null)\n {\n \/\/ check the first object in the next bar\n next_bar_num = parent_nr.ParentBar.BarNumber + 1;\n next_bar = parent_nr.ParentBar.ParentStaff.NthBar(next_bar_num);\n next_object = next_bar.NthBarObject(0);\n }\n\n if (next_object = null or next_object.Type != 'NoteRest')\n {\n \/\/ it's a hanging tie. What to do, what to do?\n \/\/ for now, just encode the startid with no endid and return the note.\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n n._property:TieIds = CreateSparseArray(tie._id);\n return n;\n }\n\n for each next_note in next_object\n {\n if (nobj.Pitch = next_note.Pitch)\n {\n \/\/ it's probably this one.\n endhash = SimpleNoteHash(next_note);\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n tieresolver[endhash] = tie._id;\n\n n._property:TieIds = CreateSparseArray(tie._id);\n }\n }\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n \n tiearr = CreateSparseArray();\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n\n if (sn._property:TieIds != null)\n {\n tieids = sn._property:TieIds;\n tiearr = tiearr.Concat(tieids);\n }\n }\n\n n._property:TieIds = tiearr;\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n if (s.InstrumentName != null)\n {\n instrObj = s.InitialInstrumentType;\n instrComment = libmei.XMLComment(instrObj.DefaultSoundId);\n libmei.AddChild(std, instrComment);\n\n instrDef = libmei.InstrDef();\n \/\/ libmei.AddAttribute(instrDef, 'midi.instrname', s.InstrumentName);\n libmei.AddAttribute(instrDef, 'midi.pan', s.Pan);\n libmei.AddAttribute(instrDef, 'midi.volume', s.Volume);\n libmei.AddAttribute(instrDef, 'midi.channel', s.Channel);\n libmei.AddChild(std, instrDef);\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'rend', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(octl, 'dis', octrend[0]);\n libmei.AddAttribute(octl, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case ('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n case ('vertical')\n {\n Log('A vertical line was found.');\n line = libmei.BarLine();\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n Log('Format close: ' & activeinfo);\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"d1eee186f6e211e7425d116da11272707234f014","subject":"Set wordpos and con for elisions connecting two words","message":"Set wordpos and con for elisions connecting two words\n\n","repos":"music-encoding\/sibmei","old_file":"src\/ExportProcessors.mss","new_file":"src\/ExportProcessors.mss","new_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '4.0.1');\n\n header = GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer, normalizedBeamProp) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Returns the active beam, if any, and creates new beam elements\n at the start of a beam.\n *\/\n switch (normalizedBeamProp)\n {\n case (NoBeam)\n {\n if (bobj.GraceNote)\n {\n if (layer._property:ActiveGraceBeam != null)\n {\n layer._property:ActiveGraceBeam = null;\n }\n \/\/ If there is an active non-grace beam, we have a normal beam spanning\n \/\/ over a non-beamed grace note that will be added as a child of that beam.\n return GetNongraceParentBeam(bobj, layer);\n }\n else\n {\n if (layer._property:ActiveBeam != null)\n {\n layer._property:ActiveBeam = null;\n }\n return null;\n }\n }\n case (StartBeam)\n {\n newBeam = libmei.Beam();\n if (bobj.GraceNote)\n {\n layer._property:ActiveGraceBeam = newBeam;\n nonGraceParentBeam = GetNongraceParentBeam(bobj, layer);\n if (nonGraceParentBeam != null)\n {\n newBeam._property:ParentBeam = nonGraceParentBeam;\n }\n }\n else\n {\n layer._property:ActiveBeam = newBeam;\n }\n return newBeam;\n }\n default {\n \/\/ ContinueBeam and SingleBeam\n if (bobj.GraceNote)\n {\n return layer._property:ActiveGraceBeam;\n }\n else\n {\n return layer._property:ActiveBeam;\n }\n }\n }\n} \/\/$end\n\nfunction ProcessTuplet (noteRest, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (noteRest.ParentTupletIfAny = null)\n {\n return null;\n }\n\n \/*\n We encode inner tuplets of nested tuplet structures as s.\n Therefore we always return the outermost MEI tuplet for content to be added.\n Still, we need to keep track of the inner tuplets to assign the @endid.\n layer._property:ActiveMeiTuplet always points to the innermost tuplet.\n *\/\n activeMeiTuplet = layer._property:ActiveMeiTuplet;\n\n tupletIsContinued = activeMeiTuplet != null and TupletsEqual(noteRest.ParentTupletIfAny, activeMeiTuplet._property:SibTuplet);\n\n if (not(tupletIsContinued))\n {\n \/\/ New tuplets need to be added\n noteRestTupletStack = GetTupletStack(noteRest);\n sibTuplet = null;\n meiTupletDepth = GetMeiTupletDepth(layer);\n\n for i = meiTupletDepth to noteRestTupletStack.Length\n {\n sibTuplet = noteRestTupletStack[i];\n nextActiveMeiTuplet = GenerateTuplet(sibTuplet);\n if (meiTupletDepth > 0 or i > meiTupletDepth)\n {\n \/\/ We have an inner tuplet that we encode as \n nextActiveMeiTuplet = ShiftTupletToTupletSpan(nextActiveMeiTuplet, layer);\n }\n libmei.AddAttribute(nextActiveMeiTuplet, 'startid', '#' & meielement._id);\n \/\/ We basically create a linked list of tuplets\n nextActiveMeiTuplet._property:ParentTuplet = activeMeiTuplet;\n nextActiveMeiTuplet._property:SibTuplet = sibTuplet;\n activeMeiTuplet = nextActiveMeiTuplet;\n }\n layer._property:ActiveMeiTuplet = activeMeiTuplet;\n }\n\n meiTuplet = activeMeiTuplet;\n for i = 0 to CountTupletsEndingAtNoteRest(noteRest)\n {\n libmei.AddAttribute(meiTuplet, 'endid', '#' & meielement._id);\n meiTuplet = meiTuplet._property:ParentTuplet;\n }\n layer._property:ActiveMeiTuplet = meiTuplet;\n\n outermostMeiTuplet = activeMeiTuplet;\n while (outermostMeiTuplet._property:ParentTuplet)\n {\n outermostMeiTuplet = outermostMeiTuplet._property:ParentTuplet;\n }\n return outermostMeiTuplet;\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n\n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it\n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(tupletSpan._id);\n Self._property:MeasureObjects = mobjs;\n\n return tupletSpan;\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n\n if (lyricobj.Text = '')\n {\n return null;\n }\n\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n \/\/ In the case of elisions, we create multiple syl elements from one\n \/\/ LyricItem. We have to distinguish between the first and the last syl\n \/\/ element we created. In the common, simple case, both are identical.\n sylel_last = sylel;\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (utils.Pos('_', syl.Text) > -1)\n {\n \/\/ Syllable elision. split this syllable element by underscore.\n syllables = MSplitString(syl.Text, '_');\n\n \/\/ reset the text of the first syllable element to the first half of the syllable.\n libmei.SetText(sylel, syllables[0]);\n libmei.AddAttribute(sylel, 'con', 'b');\n\n for s = 1 to syllables.Length\n {\n sylel_last = libmei.Syl();\n libmei.SetText(sylel_last, syllables[s]);\n libmei.AddChild(verse, sylel_last);\n }\n }\n\n if (j = 0)\n {\n \/\/add a wordpos only for partial words\n if (lyric_word.Length > 1)\n {\n libmei.AddAttribute(sylel_last, 'wordpos', 'i'); \/\/ 'initial'\n\n libmei.AddAttribute(sylel_last, 'con', 'd'); \/\/dash syllable connector\n }\n\n \/\/it is also possible, that an initial syllable has an underscore as an extender, if it is the only syllable of a word\n if (lyric_word.Length = 1)\n {\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel_last, 'con', 'u'); \/\/ 'underscore'\n }\n }\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n \/\/ Make sure, this is no elision in the middle of lyric_word\n if (utils.Pos('_', syl.Text) <= -1)\n {\n \/\/ There is no elision hidden, process syllable as middle of word\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n else\n {\n \/\/ There is an elision, sylel is the end of a word and sylel_last is the start of a new word\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ terminal\n \/\/ connector for sylel is already set\n\n \/\/ Modify sylel_last\n libmei.AddAttribute(sylel_last, 'wordpos', 'i'); \/\/initial\n libmei.AddAttribute(sylel_last, 'con', 'd');\n }\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n libmei.AddChild(obj, verse);\n }\n else\n {\n Log('Could not find note object for syl ' & syl);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so\n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessTremolo (bobj) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.DoubleTremolos = 0)\n {\n return null;\n }\n\n Log('Fingered tremolo: ' & bobj.DoubleTremolos);\n tremEl = libmei.FTrem();\n libmei.AddAttribute(tremEl, 'beams', bobj.DoubleTremolos);\n libmei.AddAttribute(tremEl, 'unitdur');\n\n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'lower');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'upper');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'upper');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'lower');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n case ('52')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('53')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('54')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('55')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('160')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'stop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('162')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'open');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('163')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('164')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('165')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('166')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('212')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'ten');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('214')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'marc');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('217')\n {\n \/\/ up-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('218')\n {\n \/\/ down-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('233')\n {\n \/\/ up-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('234')\n {\n \/\/ down-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('240')\n {\n \/\/ double staccato\n return null;\n }\n case ('241')\n {\n \/\/ triple staccato\n return null;\n }\n case ('242')\n {\n \/\/ quadruple staccato\n return null;\n }\n case ('243')\n {\n \/\/ snap\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'snap');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('480')\n {\n \/\/scoop\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'scoop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('481')\n {\n \/\/fall\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fall');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('490')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fingernail');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('494')\n {\n \/\/doit\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'doit');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('495')\n {\n \/\/plop\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'plop');\n libmei.AddChild(nobj, artic);\n }\n\n }\n\n }\n} \/\/$end\n\nfunction ProcessEndingSlurs (bar) {\n \/\/$module(ExportProcessors.mss)\n slur_resolver = Self._property:SlurResolver;\n for voiceNumber = 1 to 5\n {\n endingSlurs = slur_resolver[LayerHash(bar, voiceNumber)];\n if (endingSlurs != null)\n {\n for each slur in endingSlurs\n {\n end_obj = GetNoteObjectAtEndPosition(slur);\n if (end_obj != null)\n {\n libmei.AddAttribute(slur._property:mobj, 'endid', '#' & end_obj._id);\n }\n }\n }\n }\n} \/\/$end\n","old_contents":"function ProcessScore () {\n \/\/$module(ExportProcessors.mss)\n \/\/ processors are a bit like a workflow manager -- they orchestrate the\n \/\/ generators, which in turn use the converters to convert specific values from sibelius\n \/\/ to MEI.\n score = Self._property:ActiveScore;\n\n mei = libmei.Mei();\n libmei.setDocumentRoot(mei);\n\n libmei.AddAttribute(mei, 'xmlns:xlink', 'http:\/\/www.w3.org\/1999\/xlink');\n libmei.AddAttribute(mei, 'xmlns', 'http:\/\/www.music-encoding.org\/ns\/mei');\n libmei.AddAttribute(mei, 'meiversion', '4.0.1');\n\n header = GenerateMEIHeader();\n libmei.AddChild(mei, header);\n\n music = GenerateMEIMusic();\n libmei.AddChild(mei, music);\n\n} \/\/$end\n\nfunction ProcessBeam (bobj, layer, normalizedBeamProp) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Returns the active beam, if any, and creates new beam elements\n at the start of a beam.\n *\/\n switch (normalizedBeamProp)\n {\n case (NoBeam)\n {\n if (bobj.GraceNote)\n {\n if (layer._property:ActiveGraceBeam != null)\n {\n layer._property:ActiveGraceBeam = null;\n }\n \/\/ If there is an active non-grace beam, we have a normal beam spanning\n \/\/ over a non-beamed grace note that will be added as a child of that beam.\n return GetNongraceParentBeam(bobj, layer);\n }\n else\n {\n if (layer._property:ActiveBeam != null)\n {\n layer._property:ActiveBeam = null;\n }\n return null;\n }\n }\n case (StartBeam)\n {\n newBeam = libmei.Beam();\n if (bobj.GraceNote)\n {\n layer._property:ActiveGraceBeam = newBeam;\n nonGraceParentBeam = GetNongraceParentBeam(bobj, layer);\n if (nonGraceParentBeam != null)\n {\n newBeam._property:ParentBeam = nonGraceParentBeam;\n }\n }\n else\n {\n layer._property:ActiveBeam = newBeam;\n }\n return newBeam;\n }\n default {\n \/\/ ContinueBeam and SingleBeam\n if (bobj.GraceNote)\n {\n return layer._property:ActiveGraceBeam;\n }\n else\n {\n return layer._property:ActiveBeam;\n }\n }\n }\n} \/\/$end\n\nfunction ProcessTuplet (noteRest, meielement, layer) {\n \/\/$module(ExportProcessors.mss)\n if (noteRest.ParentTupletIfAny = null)\n {\n return null;\n }\n\n \/*\n We encode inner tuplets of nested tuplet structures as s.\n Therefore we always return the outermost MEI tuplet for content to be added.\n Still, we need to keep track of the inner tuplets to assign the @endid.\n layer._property:ActiveMeiTuplet always points to the innermost tuplet.\n *\/\n activeMeiTuplet = layer._property:ActiveMeiTuplet;\n\n tupletIsContinued = activeMeiTuplet != null and TupletsEqual(noteRest.ParentTupletIfAny, activeMeiTuplet._property:SibTuplet);\n\n if (not(tupletIsContinued))\n {\n \/\/ New tuplets need to be added\n noteRestTupletStack = GetTupletStack(noteRest);\n sibTuplet = null;\n meiTupletDepth = GetMeiTupletDepth(layer);\n\n for i = meiTupletDepth to noteRestTupletStack.Length\n {\n sibTuplet = noteRestTupletStack[i];\n nextActiveMeiTuplet = GenerateTuplet(sibTuplet);\n if (meiTupletDepth > 0 or i > meiTupletDepth)\n {\n \/\/ We have an inner tuplet that we encode as \n nextActiveMeiTuplet = ShiftTupletToTupletSpan(nextActiveMeiTuplet, layer);\n }\n libmei.AddAttribute(nextActiveMeiTuplet, 'startid', '#' & meielement._id);\n \/\/ We basically create a linked list of tuplets\n nextActiveMeiTuplet._property:ParentTuplet = activeMeiTuplet;\n nextActiveMeiTuplet._property:SibTuplet = sibTuplet;\n activeMeiTuplet = nextActiveMeiTuplet;\n }\n layer._property:ActiveMeiTuplet = activeMeiTuplet;\n }\n\n meiTuplet = activeMeiTuplet;\n for i = 0 to CountTupletsEndingAtNoteRest(noteRest)\n {\n libmei.AddAttribute(meiTuplet, 'endid', '#' & meielement._id);\n meiTuplet = meiTuplet._property:ParentTuplet;\n }\n layer._property:ActiveMeiTuplet = meiTuplet;\n\n outermostMeiTuplet = activeMeiTuplet;\n while (outermostMeiTuplet._property:ParentTuplet)\n {\n outermostMeiTuplet = outermostMeiTuplet._property:ParentTuplet;\n }\n return outermostMeiTuplet;\n} \/\/$end\n\nfunction ShiftTupletToTupletSpan (tuplet) {\n \/\/$module(ExportProcessors.mss)\n \/*\n Shifts the tuplet object to a tupletSpan object. This is\n useful if we need to define a tuplet outside of a hierarchy;\n for example, if a tuplet is only on part of a beam group.\n\n A tupletSpan supports many of the same attributes as a tuplet\n object, so we can copy the attributes verbatim. Functionally,\n it should behave the same way as a tuplet, except that it\n takes no child elements and the parent element is the measure,\n not the layer. These two things get handled higher up the\n processing chain, however, so we don't have to worry about them here.\n *\/\n\n tupletSpan = libmei.TupletSpan();\n libmei.SetAttributes(tupletSpan, tuplet.attrs);\n\n if (tuplet._parent != null)\n {\n \/\/ if the tuplet has already been added to the tree,\n \/\/ remove it now. (Unfortunately, we can't delete the object,\n \/\/ but disowning it from the tree should be enough to keep it from\n \/\/ appearing in the output.)\n pobj = libmei.getElementById(tuplet._parent);\n libmei.RemoveChild(pobj, tuplet);\n tuplet._parent = null;\n }\n\n mobjs = Self._property:MeasureObjects;\n mobjs.Push(tupletSpan._id);\n Self._property:MeasureObjects = mobjs;\n\n return tupletSpan;\n} \/\/$end\n\nfunction ProcessLyric (lyricobj, objectPositions) {\n \/\/$module(ExportProcessors.mss)\n \/*\n We need to track initial, medial, and terminal lyrics. Sibelius\n only allows us to know the medial and terminal, so we store all the\n syllables in an array until we reach the end of the word, and then\n attach them to the notes.\n *\/\n\n if (lyricobj.Text = '')\n {\n return null;\n }\n\n styleparts = MSplitString(lyricobj.StyleId, '.');\n verse_id = styleparts[5];\n verse_id_arr = MSplitString(verse_id, false);\n verse_num = verse_id_arr[5];\n bar_num = lyricobj.ParentBar.BarNumber;\n staff_num = lyricobj.ParentBar.ParentStaff.StaffNum;\n voicenum = lyricobj.VoiceNumber;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice 0.\n voicenum = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar_num, voicenum, 'Lyric object'));\n }\n\n lyricwords = Self._property:LyricWords;\n\n if (lyricwords.PropertyExists(staff_num) = False)\n {\n lyricwords[staff_num] = CreateDictionary();\n }\n\n lyricstaff = lyricwords[staff_num];\n\n if (lyricstaff.PropertyExists(voicenum) = False)\n {\n lyricstaff[voicenum] = CreateDictionary();\n }\n\n lyricvoice = lyricstaff[voicenum];\n\n if (lyricvoice.PropertyExists(verse_num) = False)\n {\n lyricvoice[verse_num] = CreateSparseArray();\n }\n\n if (lyricobj.SyllableType = MiddleOfWord)\n {\n lyricvoice[verse_num].Push(lyricobj);\n \/\/ we haven't reached the end of the word yet, so just return\n \/\/ and keep going.\n return null;\n }\n\n \/\/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n \/\/ anything past here is in the EndOfWord condition.\n \/\/ this should return a sparse array containing the syllables of the word.\n lyricvoice[verse_num].Push(lyricobj);\n lyric_word = lyricvoice[verse_num];\n objects = objectPositions[voicenum];\n\n obj_id = null;\n obj = null;\n\n for j = 0 to lyric_word.Length\n {\n syl = lyric_word[j];\n\n verse = libmei.Verse();\n libmei.AddAttribute(verse, 'n', verse_num);\n sylel = libmei.Syl();\n \/\/ In the case of elisions, we create multiple syl elements from one\n \/\/ LyricItem. We have to distinguish between the first and the last syl\n \/\/ element we created. In the common, simple case, both are identical.\n sylel_last = sylel;\n libmei.SetText(sylel, syl.Text);\n libmei.AddChild(verse, sylel);\n\n if (utils.Pos('_', syl.Text) > -1)\n {\n \/\/ Syllable elision. split this syllable element by underscore.\n syllables = MSplitString(syl.Text, '_');\n\n \/\/ reset the text of the first syllable element to the first half of the syllable.\n libmei.SetText(sylel, syllables[0]);\n libmei.AddAttribute(sylel, 'con', 'b');\n\n for s = 1 to syllables.Length\n {\n sylel_last = libmei.Syl();\n libmei.SetText(sylel_last, syllables[s]);\n libmei.AddChild(verse, sylel_last);\n }\n }\n\n if (j = 0)\n {\n \/\/add a wordpos only for partial words\n if (lyric_word.Length > 1)\n {\n libmei.AddAttribute(sylel_last, 'wordpos', 'i'); \/\/ 'initial'\n\n libmei.AddAttribute(sylel_last, 'con', 'd'); \/\/dash syllable connector\n }\n\n \/\/it is also possible, that an initial syllable has an underscore as an extender, if it is the only syllable of a word\n if (lyric_word.Length = 1)\n {\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel_last, 'con', 'u'); \/\/ 'underscore'\n }\n }\n }\n else\n {\n if (syl.SyllableType = EndOfWord)\n {\n libmei.AddAttribute(sylel, 'wordpos', 't'); \/\/ 'terminal'\n\n if (syl.NumNotes > 1)\n {\n libmei.AddAttribute(sylel, 'con', 'u'); \/\/ 'underscore'\n }\n\n }\n else\n {\n \/\/ Make sure, this is no elision in the middle of lyric_word\n if (utils.Pos('_', syl.Text) <= -1)\n {\n \/\/ There is no elision hidden, process syllable as middle of word\n libmei.AddAttribute(sylel, 'wordpos', 'm'); \/\/ medial\n libmei.AddAttribute(sylel, 'con', 'd');\n }\n }\n }\n\n obj = GetNoteObjectAtPosition(syl);\n\n if (obj != null)\n {\n name = libmei.GetName(obj);\n\n if (name = 'rest')\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectIsOnAnIllogicalObject, bar_num, voicenum, 'Lyric', 'rest'));\n }\n\n libmei.AddChild(obj, verse);\n }\n else\n {\n Log('Could not find note object for syl ' & syl);\n }\n }\n\n \/\/ now reset the syllable array for this voice\n lyricvoice[verse_num] = CreateSparseArray();\n} \/\/$end\n\nfunction ProcessSystemStaff (score) {\n \/\/$module(ExportProcessors.mss)\n systf = score.SystemStaff;\n\n for each bar in systf\n {\n for each bobj in bar\n {\n switch (bobj.Type)\n {\n case ('SpecialBarline')\n {\n spclbarlines = Self._property:SpecialBarlines;\n if (spclbarlines.PropertyExists(bar.BarNumber) = False)\n {\n spclbarlines[bar.BarNumber] = CreateSparseArray();\n }\n\n spclbarlines[bar.BarNumber].Push(ConvertBarline(bobj.BarlineInternalType));\n }\n case ('SystemTextItem')\n {\n if (bobj.OnNthBlankPage < 0)\n {\n ProcessFrontMatter(bobj);\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(bar.BarNumber) = False)\n {\n systemtext[bar.BarNumber] = CreateSparseArray();\n }\n\n systemtext[bar.BarNumber].Push(bobj);\n }\n case ('Graphic')\n {\n Log('Found a graphic!');\n Log('is object? ' & IsObject(bobj));\n }\n case ('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n }\n }\n }\n} \/\/$end\n\nfunction ProcessFrontMatter (bobj) {\n \/\/$module(ExportProcessors.mss)\n \/*\n For example, if page 2 (0-indexed) is the first page of music,\n then 'OnNthPage' will be 2, but the system staff items for\n the first page of text will be -2, so 2 + (-2) = 0 + 1;\n *\/\n bar = bobj.ParentBar;\n text = '';\n\n pnum = (bar.OnNthPage + bobj.OnNthBlankPage) + 1;\n frontmatter = Self._property:FrontMatter;\n\n if (frontmatter.PropertyExists(pnum) = False)\n {\n pb = libmei.Pb();\n libmei.AddAttribute(pb, 'n', pnum);\n frontmatter[pnum] = CreateSparseArray(pb);\n }\n pagematter = frontmatter[pnum];\n\n text = GenerateFormattedString(bobj);\n frontmatter[pnum] = pagematter.Concat(text);\n\n} \/\/$end\n\nfunction RegisterVolta (bobj) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n style = MSplitString(bobj.StyleId, '.');\n\n if (style[2] = 'repeat')\n {\n voltabars[bobj.ParentBar.BarNumber] = bobj;\n }\n} \/\/$end\n\nfunction ProcessVolta (mnum) {\n \/\/$module(ExportProcessors.mss)\n voltabars = Self._property:VoltaBars;\n\n if (voltabars.PropertyExists(mnum))\n {\n voltaElement = libmei.Ending();\n\n Self._property:VoltaElement = voltaElement;\n\n voltaObject = voltabars[mnum];\n voltainfo = ConvertEndingValues(voltaObject.StyleId);\n\n libmei.AddAttribute(voltaElement, 'n', voltainfo[0]);\n libmei.AddAttribute(voltaElement, 'label', voltainfo[1]);\n libmei.AddAttribute(voltaElement, 'type', voltainfo[2]);\n\n if (voltaObject.EndBarNumber != mnum)\n {\n Self._property:ActiveVolta = voltaObject;\n }\n\n return voltaElement;\n }\n else\n {\n if (Self._property:ActiveVolta != null)\n {\n \/\/ we have an unresolved volta, so\n \/\/ we'll keep the previous parentElement\n \/\/ active.\n activeVolta = Self._property:ActiveVolta;\n voltaElement = Self._property:VoltaElement;\n\n \/\/ if the end bar is the current bar OR if the end\n \/\/ bar is the next bar, but the end position is 0, we're escaping the\n \/\/ volta the next time around.\n if ((activeVolta.EndBarNumber = mnum) or\n (activeVolta.EndBarNumber = (mnum + 1) and activeVolta.EndPosition = 0))\n {\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n }\n return null;\n }\n }\n\n return null;\n} \/\/$end\n\nfunction ProcessTremolo (bobj) {\n \/\/$module(ExportProcessors.mss)\n if (bobj.DoubleTremolos = 0)\n {\n return null;\n }\n\n Log('Fingered tremolo: ' & bobj.DoubleTremolos);\n tremEl = libmei.FTrem();\n libmei.AddAttribute(tremEl, 'beams', bobj.DoubleTremolos);\n libmei.AddAttribute(tremEl, 'unitdur');\n\n} \/\/$end\n\nfunction ProcessSymbol (sobj) {\n \/\/$module(ExportProcessors.mss)\n Log('symbol index: ' & sobj.Index & ' name: ' & sobj.Name);\n Log(sobj.VoiceNumber);\n voicenum = sobj.VoiceNumber;\n bar = sobj.ParentBar;\n\n if (voicenum = 0)\n {\n \/\/ assign it to the first voice, since we don't have any notes in voice\/layer 0.\n sobj.VoiceNumber = 1;\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bar.BarNumber, voicenum, 'Symbol'));\n }\n\n switch (sobj.Index)\n {\n case ('32')\n {\n \/\/ trill\n trill = GenerateTrill(sobj);\n mlines = Self._property:MeasureObjects;\n mlines.Push(trill._id);\n }\n\n case ('36')\n {\n \/\/ inverted mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'lower');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('37')\n {\n \/\/ mordent\n mordent = libmei.Mordent();\n libmei.AddAttribute(mordent, 'form', 'upper');\n mordent = AddBarObjectInfoToElement(sobj, mordent);\n mlines = Self._property:MeasureObjects;\n mlines.Push(mordent._id);\n }\n\n case ('38')\n {\n \/\/ turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'upper');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n\n case ('39')\n {\n \/\/ inverted turn\n turn = libmei.Turn();\n libmei.AddAttribute(turn, 'form', 'lower');\n turn = AddBarObjectInfoToElement(sobj, turn);\n mlines = Self._property:MeasureObjects;\n mlines.Push(turn._id);\n }\n case ('52')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('53')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'heel');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('54')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('55')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'toe');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('160')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'stop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('162')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'open');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('163')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('164')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('165')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('166')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'damp');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('212')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'ten');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('214')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'marc');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('217')\n {\n \/\/ up-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('218')\n {\n \/\/ down-bow above\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'above');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('233')\n {\n \/\/ up-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'upbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('234')\n {\n \/\/ down-bow below\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttribute(artic, 'artic', 'dnbow');\n libmei.AddAttribute(artic, 'place', 'below');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('240')\n {\n \/\/ double staccato\n return null;\n }\n case ('241')\n {\n \/\/ triple staccato\n return null;\n }\n case ('242')\n {\n \/\/ quadruple staccato\n return null;\n }\n case ('243')\n {\n \/\/ snap\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'snap');\n libmei.AddChild(nobj, artic);\n }\n else\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name));\n }\n }\n case ('480')\n {\n \/\/scoop\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'scoop');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('481')\n {\n \/\/fall\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fall');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('490')\n {\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'fingernail');\n libmei.AddChild(nobj, artic);\n }\n }\n case ('494')\n {\n \/\/doit\n nobj = GetNoteObjectAtPosition(sobj);\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'doit');\n libmei.AddChild(nobj, artic);\n }\n\n }\n case ('495')\n {\n \/\/plop\n nobj = GetNoteObjectAtPosition(sobj);\n\n if (nobj != null)\n {\n artic = libmei.Artic();\n libmei.AddAttributeValue(artic, 'artic', 'plop');\n libmei.AddChild(nobj, artic);\n }\n\n }\n\n }\n} \/\/$end\n\nfunction ProcessEndingSlurs (bar) {\n \/\/$module(ExportProcessors.mss)\n slur_resolver = Self._property:SlurResolver;\n for voiceNumber = 1 to 5\n {\n endingSlurs = slur_resolver[LayerHash(bar, voiceNumber)];\n if (endingSlurs != null)\n {\n for each slur in endingSlurs\n {\n end_obj = GetNoteObjectAtEndPosition(slur);\n if (end_obj != null)\n {\n libmei.AddAttribute(slur._property:mobj, 'endid', '#' & end_obj._id);\n }\n }\n }\n }\n} \/\/$end\n","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"b283a3de5c63c3b15cf9e866723a99f5a825c4e5","subject":"#20 #23 appropriately blur landcover raster at higher zooms","message":"#20 #23 appropriately blur landcover raster at higher zooms\n","repos":"stamen\/terrain-classic,stamen\/terrain-classic","old_file":"map.mss","new_file":"map.mss","new_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999; \/\/ 40% K\n@color_transport_casing_z10: #ddd;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc; \/\/ 20% K\n@color_transport_hwy: #737373; \/\/ 55% K \n@color_transport_minor: #aaa; \n@color_transport_rail: #aaa; \/\/ 33% K\n@color_transport_path: #666; \/\/ 60% K\n@color_building: #ccc;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: #c8cebe; \/\/ hsl(82,8,81)\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_green_areas: darken(#c0d3b5,20);\n\nMap {\n background-color: @color_water;\n font-directory: url(\"fonts\/\");\n\n [zoom>=10] {\n background-color: @color_physical;\n }\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n \/* lighten background color, as we decrease landcover opacity *\/\n [zoom>=12] {\n polygon-fill: lighten(@color_physical,20);\n }\n [zoom>=14] {\n polygon-fill: lighten(@color_physical,40);\n }\n\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_50m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{ \n line-color: @color_water;\n line-width: 0;\n polygon-fill: @color_water;\n\n [zoom>=5]{\n line-width: 0.5;\n }\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.5;\n\n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.3;\n }\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [type='runway'] {\n [zoom=10] {\n line-width: 1;\n }\n [zoom=11] {\n line-width: 1.5;\n }\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n line-color: @color_transport_hwy;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n line-color: @color_transport_hwy;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{ \n [zoom>=9] {\n ::outline {\n line-width: 3;\n line-color: @color_transport_casing_z10;\n }\n\n line-width: 1.5; \n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 5;\n line-color: @color_transport_casing;\n }\n\n line-width: 3;\n line-color: @color_transport_hwy; \n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4; \n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 13;\n }\n\n line-width: 7.5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 39;\n } \n\n line-width: 28;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 49;\n \/\/ }\n\n \/\/ line-width: 35;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n\n [zoom<=12] {\n line-color: @color_transport;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 10;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 14;\n\n [is_link='yes'] {\n ::casing{\n line-width: 14;\n }\n\n line-width: 7;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 25;\n }\n\n line-width: 17;\n\n [is_link='yes'] {\n ::casing {\n line-width: 19;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 30;\n \/\/ }\n\n \/\/ line-width: 26;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 17;\n \/\/ }\n\n \/\/ line-width: 13;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 1;\n }\n\n [zoom>=13] {\n line-width: 1.5;\n line-color: @color_transport;\n }\n\n [zoom>=14] {\n ::casing {\n line-width: 3.5;\n line-color: @color_transport_casing;\n }\n line-width: 2.5;\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 6;\n }\n line-width: 4;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 6.5;\n } \n line-width: 4; \n }\n\n [zoom>=17] {\n ::casing {\n line-width: 11.5;\n }\n line-width: 8;\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 14.5;\n } \n line-width: 11;\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n line-color: @color_transport_path;\n\n [zoom>=15] {\n line-width: 0.5;\n line-cap: butt;\n line-dasharray: 2, 3;\n }\n\n [zoom>=16] {\n line-width: 0.7;\n }\n\n [zoom>=17] {\n line-width: 1.2;\n line-dasharray: 4, 6;\n }\n}\n\n#lc500mMODIS_low {\n [zoom>=0][zoom<10] {\n raster-opacity:1;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(0,0); \n }\n}\n\n#lc500mMODIS_med {\n [zoom>=10] {\n raster-opacity:1;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(5,5);\n }\n}\n\n#lc500mMODIS_high {\n [zoom>=14] {\n raster-opacity:0.5;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(20,20); \n }\n}\n\n#land {\n polygon-fill: @color_physical;\n}\n","old_contents":"@color_physical: #dee0be;\n@color_physical_bright: #fff;\n@color_water: #99b3cc;\n@color_administrative_lowzoom: #000;\n@color_administrative_dark: #000;\n@color_administrative_bright: #fff;\n@color_administrative_medium_low: #000;\n@color_administrative_medium_high: #000;\n@color_administrative_medium_high2: #000;\n@color_transport: #999; \/\/ 40% K\n@color_transport_casing_z10: #ddd;\n@color_transport_casing: #fff;\n@color_transport_inline: #fff;\n@color_transport_tunnel: #ccc; \/\/ 20% K\n@color_transport_hwy: #737373; \/\/ 55% K \n@color_transport_minor: #aaa; \n@color_transport_rail: #aaa; \/\/ 33% K\n@color_transport_path: #666; \/\/ 60% K\n@color_building: #ccc;\n@color_building_outline: darken(@color_building,20);\n@color_building_outline_special: #00aeef;\n@color_airport_runways: #c8cebe; \/\/ hsl(82,8,81)\n@color_airport_runways_detail: darken(@color_airport_runways,20);\n@color_green_areas: darken(#c0d3b5,20);\n\nMap {\n background-color: @color_water; \/\/@color_physical;\n font-directory: url(\"fonts\/\");\n}\n\n\/**\n * \"shore\" is a general class for layers with continents, coastlines, lakes,\n * and other kinds of meeting points between water and land.\n *\/\n.shore {\n line-color: @color_physical;\n \/* lighten background color, as we decrease landcover opacity *\/\n [zoom>=12] {\n polygon-fill: lighten(@color_physical,20);\n }\n [zoom>=14] {\n polygon-fill: lighten(@color_physical,40);\n }\n\n line-cap: round;\n line-join: round;\n line-width: 0;\n}\n\n#ne_10m_rivers_lake_centerlines_scale_rank\n{\n [zoom=4][scalerank<4] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=5][scalerank<5] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=6][scalerank<6] {\n line-color: @color_water;\n line-width: 0.5;\n [strokeweig>1] { line-width: 1; }\n [strokeweig>2] { line-width: 2; }\n }\n [zoom=7][scalerank<7] {\n line-color: @color_water;\n line-width: 1;\n [strokeweig>1] { line-width: 1.5; }\n [strokeweig>2] { line-width: 2.5; }\n }\n [zoom>=8] {\n line-width: 1;\n line-color: @color_water;\n [strokeweig>1] { line-width: 2; }\n [strokeweig>2] { line-width: 3; }\n }\n}\n\n#water,\n#ne_50m_ocean,\n#ne_10m_lakes,\n#ne_50m_lakes\n{ \n line-color: @color_water;\n line-width: 0;\n polygon-fill: @color_water;\n\n [zoom>=5]{\n line-width: 0.5;\n }\n}\n\n.country-boundary[scalerank<6],\n.country-boundary-10m[scalerank<6] {\n line-color: @color_administrative_dark;\n line-opacity: 0.2;\n line-width: 2;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.08;\n line-width: 4;\n line-dasharray: 7,3;\n }\n}\n\n#admin1-lines-10m,\n#admin0-map-units-10m {\n [zoom>=4][adm0_a3='CAN'],\n [zoom>=4][adm0_a3='USA'],\n [zoom>=4][adm0_a3='AUS'],\n [zoom>=5][scalerank<=2],\n [zoom>=5][featurecla='Map unit boundary'][adm0_a3='GBR'],\n [zoom>=6][scalerank<=4],\n [zoom>=6][featurecla='Map unit boundary'][adm0_a3='GBR'] {\n line-color: @color_administrative_dark;\n line-opacity: 0.15;\n line-width: 1.5;\n line-dasharray: 7,3;\n ::glow {\n line-color: @color_administrative_dark;\n line-opacity: 0.05;\n line-width: 3;\n line-dasharray: 7,3;\n }\n }\n\n [zoom>=7][scalerank<=5] {\n line-width: 1;\n line-color: @color_administrative_medium_low;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=8][scalerank<=6] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high;\n line-dasharray: 1,5;\n line-cap: round;\n }\n\n [zoom>=9][scalerank<=8] {\n line-width: 1.2;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n }\n}\n\n#lakes-50m[zoom<3][scalerank<1],\n#lakes-50m[zoom=3][scalerank<2],\n#lakes-50m[zoom=4][scalerank<3],\n#lakes-50m[zoom=5][scalerank<5],\n#lakes-50m[zoom=6],\n#lakes-10m,\n{\n line-width: 1;\n polygon-fill: @color_physical;\n}\n\n#ne-roads[zoom=7][scalerank<=4],\n#ne-roads[zoom>=8][scalerank<=8] {\n ::casing {\n line-color: @color_transport_casing;\n line-opacity: 0.5;\n line-width: 1.5;\n\n [zoom=8][scalerank<=6] {\n line-width: 3;\n }\n }\n\n line-color: @color_transport;\n line-width: 0;\n\n [zoom=8][scalerank<=6] {\n line-width: 1;\n }\n}\n\n\/**\n * Ocean, lake, and river polygons\n *\/\n#water-bodies-low[zoom=8][area>50000000],\n#water-bodies-low[zoom=9][area>10000000],\n#water-bodies-low[zoom=10][area>2500000],\n#water-bodies-med[zoom=11][area> 800000],\n#water-bodies-med[zoom=12][area> 500000],\n#water-bodies-med[zoom=13][area> 25000],\n#water-bodies-high[zoom=14][area> 10000],\n#water-bodies-high[zoom>=15]\n{ \n polygon-fill: @color_water;\n}\n\n\/**\n * Water bodies that are parts of rivers\n * should never be filtered\n *\/\n#water-bodies-low[type='riverbank'],\n#water-bodies-med[type='riverbank'],\n#water-bodies-high[type='riverbank']\n{ \n polygon-fill: @color_water;\n}\n\n#nullisland {\n polygon-fill: @color_physical;\n}\n\n#admin1-lines-osm,\n{\n line-width: 2.0;\n line-color: @color_administrative_medium_high2;\n line-dasharray: 1,5;\n line-cap: round;\n}\n\n\/**\n * Zoom 13 buildings.\n * Already filtered by size upon import.\n *\/\n#buildings-med[type!='no'] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n}\n\n\/**\n * Zoom 14+ buildings.\n * Includes all buildings.\n *\/\n#buildings-high[type!='no'] {\n [zoom=14] {\n [area>=5000] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n }\n\n \/**\n * This is for outlines and no stripe. Catches small buildings.\n * Larger buildings will be overridden with stripes below.\n *\/\n [zoom>=15][area>=2000],\n [zoom>=16] {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n [zoom=15][area>=3000],\n [zoom=16][area>=2000],\n [zoom=17][area>=1000],\n [zoom>=18],\n {\n polygon-fill: @color_building;\n line-width: 0.5;\n line-color: @color_building_outline;\n }\n\n \/\/ Stamen HQ fancy candycane striping\n [zoom>=18] {\n [osm_id=260351411],\n [osm_id=224030635], \/\/ Seth's house\n [osm_id=248153467], \/\/ Sean's house\n [osm_id=291796473], \/\/ Stamen South\n {\n polygon-fill: @color_building;\n line-width: 1.5;\n line-color: @color_building_outline_special;\n }\n }\n}\n\n#green-areas-low[zoom=10][area>5000000],\n#green-areas-med[zoom=11][area>1000000],\n#green-areas-med[zoom=12][area> 500000],\n#green-areas-med[zoom=12][area> 200000],\n#green-areas-med[zoom=13][area> 75000],\n#green-areas-high[zoom=14][area> 10000],\n#green-areas-high[zoom>14],\n{\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.5;\n\n [type='nature_reserve'] {\n polygon-fill: @color_green_areas;\n polygon-opacity: 0.3;\n }\n}\n\n#aeroways {\n line-color: @color_airport_runways;\n line-cap: square;\n line-join: miter;\n\n [type='runway'] {\n [zoom=10] {\n line-width: 1;\n }\n [zoom=11] {\n line-width: 1.5;\n }\n [zoom=12] {\n line-width: 2;\n }\n\n [zoom=13] {\n line-width: 4;\n }\n\n [zoom=14] {\n line-width: 8;\n }\n\n [zoom=15] {\n line-width: 16;\n }\n\n [zoom=16] {\n line-width: 32;\n }\n\n [zoom=17] {\n line-width: 64;\n }\n\n [zoom>=18] {\n line-width: 128;\n }\n }\n\n [type='taxiway'] {\n [zoom=13] {\n line-width: 1;\n }\n\n [zoom=14] {\n line-width: 2;\n }\n\n [zoom=15] {\n line-width: 4;\n }\n\n [zoom=16] {\n line-width: 8;\n }\n\n [zoom=17] {\n line-width: 16;\n }\n\n [zoom>=18] {\n line-width: 32;\n }\n }\n}\n\n#tunnels,\n#roads,\n#roads_med,\n#highways_med,\n#bridges {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 1;\n line-color: @color_transport;\n}\n\n#tunnels {\n [zoom>=14] {\n ::outline\n {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-opacity: 0.5;\n line-width: 4;\n }\n}\n\n#tunnels[kind='highway'] {\n [zoom>=15] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 4;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='major_road'] {\n [zoom>=15] {\n ::outline {\n line-width: 5;\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-width: 3;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n line-opacity: 0.4;\n }\n\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n\n [is_link='yes'] {\n ::outline {\n line-color: @color_transport_casing;\n }\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 30;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 13;\n }\n }\n }\n}\n\n#tunnels[kind='minor_road'] {\n [zoom>=15] {\n ::outline {\n line-opacity: 0.7;\n line-color: @color_transport_tunnel;\n }\n\n line-color: @color_transport_minor;\n line-width: 1.5;\n line-opacity: 0.5;\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 4;\n line-color: @color_transport;\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 7;\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 17;\n line-color: @color_transport;\n }\n\n line-width: 13;\n line-color: @color_transport_casing;\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 16;\n }\n}\n\n#bridges[kind='highway'] {\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n line-color: @color_transport_hwy;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n line-color: @color_transport_hwy;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 44;\n line-color: @color_transport;\n }\n\n line-width: 28;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 22;\n }\n\n line-width: 18;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 51;\n }\n\n line-width: 35;\n\n [is_link='yes'] {\n ::outline {\n line-width: 21;\n }\n\n line-width: 16;\n }\n }\n}\n\n#bridges[kind='major_road'] {\n line-color: @color_transport;\n\n [zoom>=14] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 1.9;\n }\n\n [zoom>=15] {\n ::outline {\n line-width: 8.5;\n }\n\n line-width: 5.5;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::outline {\n line-width: 11;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::outline {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 12;\n\n [is_link='yes'] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 24;\n line-color: @color_transport;\n }\n\n line-width: 18;\n line-color: @color_transport_inline;\n\n [is_link='yes'] {\n ::outline {\n line-width: 14;\n }\n\n line-width: 9;\n }\n }\n\n [zoom>=19] {\n ::outline {\n line-width: 32;\n }\n\n line-width: 26;\n\n [is_link='yes'] {\n ::outline {\n line-width: 18;\n }\n\n line-width: 13;\n }\n }\n}\n\n#roads,\n#roads_med,\n#highways_med {\n ::casing,\n ::outline,\n {\n line-cap: butt;\n line-width: 0;\n line-color: @color_transport_casing;\n }\n\n line-join: round;\n line-cap: round;\n line-width: 0;\n line-color: @color_transport;\n\n [is_link='yes']\n {\n [zoom>=16]\n {\n ::casing {\n line-width: 8;\n }\n\n line-width: 4;\n }\n }\n}\n\n#roads[kind='highway'],\n#highways_med[kind='highway']\n{ \n [zoom>=9] {\n ::outline {\n line-width: 3;\n line-color: @color_transport_casing_z10;\n }\n\n line-width: 1.5; \n }\n\n [zoom>=10] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 5;\n line-color: @color_transport_casing;\n }\n\n line-width: 3;\n line-color: @color_transport_hwy; \n }\n\n [zoom>=12] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 0.5;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 8;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 3;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 9;\n }\n\n line-width: 4; \n\n [is_link='yes'] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 11;\n }\n\n line-width: 6;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6.5;\n }\n\n line-width: 2.25;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 13;\n }\n\n line-width: 7.5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 7;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=17] {\n ::casing {\n line-width: 24;\n }\n\n line-width: 15;\n\n [is_link='yes'] {\n ::casing {\n line-width: 9;\n }\n\n line-width: 5;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 39;\n } \n\n line-width: 28;\n\n [is_link='yes'] {\n ::casing {\n line-width: 14;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 49;\n \/\/ }\n\n \/\/ line-width: 35;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='major_road'],\n#roads_med[kind='major_road']\n{\n\n [zoom<=12] {\n line-color: @color_transport;\n }\n\n [zoom>=9] {\n line-width: 0.15;\n }\n\n [zoom>=10] {\n line-width: 0.5;\n }\n\n [zoom>=11] {\n ::outline {\n line-width: 1.25;\n }\n\n line-width: 0.7;\n }\n\n [zoom>=12] {\n ::outline {\n line-width: 4;\n }\n\n line-width: 2;\n\n [is_link='yes'] {\n ::outline {\n line-width: 0;\n }\n\n line-width: 1;\n }\n }\n\n [zoom>=13] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 3;\n }\n\n [zoom>=14] {\n ::outline {\n line-width: 6;\n }\n\n line-width: 4;\n\n [is_link='yes'] {\n ::outline {\n line-width: 5;\n }\n\n line-width: 2;\n }\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 8;\n }\n\n line-width: 5;\n\n [is_link='yes'] {\n ::casing {\n line-width: 5.5;\n }\n\n line-width: 2.5;\n }\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 10;\n }\n\n line-width: 7;\n\n [is_link='yes'] {\n ::casing {\n line-width: 6;\n }\n\n line-width: 4;\n }\n }\n\n [zoom>=17] {\n ::outline {\n line-width: 20;\n }\n\n line-width: 14;\n\n [is_link='yes'] {\n ::casing{\n line-width: 14;\n }\n\n line-width: 7;\n }\n }\n\n [zoom>=18] {\n ::outline {\n line-width: 25;\n }\n\n line-width: 17;\n\n [is_link='yes'] {\n ::casing {\n line-width: 19;\n }\n\n line-width: 10;\n }\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 30;\n \/\/ }\n\n \/\/ line-width: 26;\n\n \/\/ [is_link='yes'] {\n \/\/ ::casing {\n \/\/ line-width: 17;\n \/\/ }\n\n \/\/ line-width: 13;\n \/\/ }\n \/\/ }\n}\n\n#roads[kind='minor_road'],\n#roads_med[kind='minor_road']\n{\n line-color: @color_transport_minor;\n\n [zoom>=10] {\n line-width: 1;\n }\n\n [zoom>=13] {\n line-width: 1.5;\n line-color: @color_transport;\n }\n\n [zoom>=14] {\n ::casing {\n line-width: 3.5;\n line-color: @color_transport_casing;\n }\n line-width: 2.5;\n }\n\n [zoom>=15] {\n ::casing {\n line-width: 6;\n }\n line-width: 4;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 6.5;\n } \n line-width: 4; \n }\n\n [zoom>=17] {\n ::casing {\n line-width: 11.5;\n }\n line-width: 8;\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 14.5;\n } \n line-width: 11;\n }\n\n \/\/ [zoom>=19] {\n \/\/ ::casing {\n \/\/ line-width: 20;\n \/\/ }\n\n \/\/ line-width: 16;\n \/\/ }\n}\n\n#tunnels[kind='rail'],\n#roads[kind='rail'],\n#bridges[kind='rail']\n{\n ::casing,\n ::outline,\n {\n line-color: @color_transport_rail;\n }\n\n line-color: @color_transport_rail;\n\n [zoom>=14] {\n ::casing {\n line-width: 3;\n line-dasharray: 1,3;\n }\n\n line-width: 1;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 5;\n line-dasharray: 1,4;\n }\n }\n\n [zoom>=18] {\n ::casing {\n line-width: 6;\n line-dasharray: 2,6;\n }\n\n line-width: 2;\n }\n\n [zoom>=19] {\n line-width: 4;\n }\n}\n\n#tunnels[highway='service'],\n#roads[highway='service'],\n#bridges[highway='service'],\n{\n [zoom>=15]\n {\n line-width: 1.5;\n }\n\n [zoom>=16] {\n ::casing {\n line-width: 4;\n }\n\n line-width: 2;\n }\n\n [zoom>=17] {\n line-width: 4;\n }\n}\n\n#tunnels[kind='path'],\n#roads[kind='path'],\n#bridges[kind='path'],\n{\n line-color: @color_transport_path;\n\n [zoom>=15] {\n line-width: 0.5;\n line-cap: butt;\n line-dasharray: 2, 3;\n }\n\n [zoom>=16] {\n line-width: 0.7;\n }\n\n [zoom>=17] {\n line-width: 1.2;\n line-dasharray: 4, 6;\n }\n}\n\n.landcoverraster {\n raster-opacity:1;\n raster-scaling:gaussian;\n\n \/* blur landcover as it becomes too pixelated *\/\n \/\/ [zoom<10] {\n \/\/ image-filters: agg-stack-blur(0,0);\n \/\/ }\n\n \/\/ [zoom>=10] {\n \/\/ image-filters: agg-stack-blur(5,5);\n \/\/ }\n \/\/ [zoom>=12] {\n \/\/ image-filters: agg-stack-blur(10,10);\n \/\/ opacity: 0.8;\n \/\/ }\n \/\/ [zoom>=14] {\n \/\/ image-filters: agg-stack-blur(30,30);\n \/\/ opacity: 0.6;\n \/\/ }\n\n}\n\n#lc500mMODIS_low {\n [zoom>=0][zoom<10] {\n raster-opacity:1;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(0,0); \n }\n}\n\n#lc500mMODIS_med {\n [zoom>=10] {\n raster-opacity:1;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(10,10);\n }\n}\n\n#lc500mMODIS_high {\n [zoom>=14] {\n raster-opacity:1;\n raster-scaling:gaussian;\n image-filters: agg-stack-blur(30,30);\n }\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"9dcceabcefd1d1e2606f9a6b4bf343c4cc1c2194","subject":"Ensure that labels cover polygons, not just the centroid","message":"Ensure that labels cover polygons, not just the centroid\n","repos":"stamen\/toner-carto,Andrey-Pavlov\/toner-carto","old_file":"labels.mss","new_file":"labels.mss","new_contents":"@text_font_transport_bold: 'Arial Unicode MS Bold';\n@text_font_physical_bold: 'Arial Unicode MS Bold';\n@text_font_administrative: 'Arial Unicode MS Regular';\n@text_font_administrative_bold: 'Arial Unicode MS Bold';\n@text_font_water: 'Arial Unicode MS Italic';\n@text_font_water_bold: 'Arial Unicode MS Bold Italic';\n@text_font_city: 'Arial Unicode MS Regular';\n@text_font_city_bold: 'Arial Unicode MS Bold';\n@text_font_poi_bold: 'Arial Unicode MS Bold Italic';\n\n@label_color_transport: #000;\n@label_color_transport_halo: #fff;\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_administrative: #000;\n@label_color_administrative_halo: #fff;\n@label_color_city: #000;\n@label_color_city_halo: #fff;\n@label_color_poi: #000;\n@label_color_poi_halo: #fff;\n\n@text_font_size_xxsm: 10;\n@text_font_size_xsm: 12;\n@text_font_size_sm: 13;\n@text_font_size_medium: 14;\n@text_font_size_medium_plus: 16;\n@text_font_size_large: 18;\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n\n#minor_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-avoid-edges: true;\n \n [zoom=16] {\n text-dy: 10; \n text-spacing: 124; \n text-size: @text_font_size_xxsm; \n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom=17] {\n text-dy: 13; \n text-spacing: 180; \n text-size: @text_font_size_xsm;\n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom>=18] {\n text-size: @text_font_size_xsm; \n text-spacing: 400; \n text-halo-radius: @text_font_halo_radius_large; \n }\n}\n\n#major_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-spacing: 100;\n text-avoid-edges: true;\n\n [zoom>=16][highway='primary'] {\n\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [is_tunnel=1][zoom>=15] {\n\ttext-fill: #777;\n }\n [zoom=12] {\n text-dy: 7;\n text-size: @text_font_size_xsm;\n text-min-distance: 4;\n }\n [zoom=13] {\n text-dy: 8;\n text-min-distance: 5;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_sm;\n }\n [highway='primary'] {\n\t\ttext-size: 13;\n }\n }\n\n [zoom=14] {\n text-min-distance: 5;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: 9;\n \ttext-size: @text_font_size_medium;\n } \n [highway='secondary'] {\n\t\ttext-dy: 7;\n \ttext-size: @text_font_size_xsm;\n text-halo-radius: 1.5;\n }\n }\n\n [zoom=15] {\n text-min-distance: 10;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: @text_font_size_xsm;\n \ttext-size: 15;\n }\n [highway='secondary'],[highway='tertiary'] {\n\t\ttext-dy: 11;\n \ttext-size: @text_font_size_sm;\n }\n }\n\n [zoom=16] {\n text-min-distance: 12;\n text-dy: 13;\n [highway='trunk'],[highway='primary'] { \n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'],[highway='tertiary'] {\t\n \ttext-spacing: 124;\n \ttext-size: @text_font_size_sm;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom=17] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-dy: 16;\n \ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-dy: 14;\n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-dy: 14; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_medium;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n\t\ttext-dy: 13; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_xsm; \n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom>=18] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-size: @text_font_size_medium; \n\t\ttext-spacing: 300;\n\t\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n text-size: @text_font_size_xsm;\n text-spacing: 400;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n}\n\n#poi_station_labels {\n [zoom>=16][railway='station'] {\n shield-name: \"[label]\";\n shield-face-name: @text_font_transport_bold;\n shield-fill: white;\n shield-size: 12;\n shield-file: url('images\/subway_shield_small.svg');\n }\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_physical_halo;\n text-halo-fill: @label_color_physical;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: interior;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-fill: @label_color_physical;\n text-halo-fill: @label_color_physical_halo;\n \n text-line-spacing: -1;\n text-min-distance: 10;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n \n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=16] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#continents[zoom>=1][zoom<3]\n{\n \ttext-name: \"[name]\";\n text-face-name: @text_font_physical_bold;\n text-wrap-width: 32;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical;\n text-halo-radius: 3;\n text-halo-fill: @label_color_physical_halo;\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n \ttext-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n \ttext-min-distance: 1;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z4 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z5 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium_plus;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z6 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_large;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n\/\/ HACK! All the problematic water bodies with accents\n\/\/ e.g. \"Bahia de Campeche\" with an accented i,\n\/\/ have an empty \"changed\" string. So abuse this for now.\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: \"[name]\";\n\ttext-face-name: @text_font_water_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][changed!='']\n{\n \ttext-name: \"[name]\";\n text-face-name: @text_font_water;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo;\n \ttext-min-distance: 5;\n \n \t#city_labels_z4 {\n text-size: @text_font_size_xxsm;\n [font_size=14] {\n text-size: @text_font_size_medium; \n }\n }\n \n \t#city_labels_z5 {\n text-size: @text_font_size_xsm;\n [font_size=16] {\n text-size: @text_font_size_medium_plus; \n }\n }\n \n #city_labels_z6 {\n text-size: @text_font_size_xsm;\n [font_size=18] {\n text-size: @text_font_size_large; \n }\n }\n \n [justified='left'] {\n \ttext-horizontal-alignment: middle;\n \ttext-dx: -5;\n }\n [justified='right'] {\n \ttext-horizontal-alignment: middle;\n \ttext-dx: 5;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n\ttext-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo; \n\ttext-size: @text_font_size_sm;\n [font_size=20] { text-size: @text_font_size_large; } \n \n \t#city_labels_z7 {\n \t text-size: @text_font_size_xsm;\n [font_size=18] {\n text-size: @text_font_size_large; \n }\n }\n \n \t[justified='left'] {\n \ttext-horizontal-alignment: middle;\n \ttext-dx: -5;\n }\n [justified='right'] {\n \ttext-horizontal-alignment: middle;\n \ttext-dx: 5;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10,\n#city_labels_z11,\n#city_labels_z12, {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo; \n\ttext-size: @text_font_size_sm;\n [font_size=20] { text-size: @text_font_size_large; } \n}\n\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n \tmarker-ignore-placement: true;\n \tmarker-width: 7;\n \tmarker-fill: black;\n \tmarker-line-color: white;\n \tmarker-line-width: 2;\n}\n\n#airports[zoom>=10][zoom<=13] {\n marker-width: 18;\n\tmarker-file: url('images\/airplane.svg');\n}\n\n#airports[zoom>=13][scalerank<=12]\n{\n \ttext-name: \"[name]\";\n text-face-name: @text_font_poi_bold;\n text-fill: @label_color_poi;\n text-size: @text_font_size_medium;\n text-halo-fill: @label_color_poi_halo;\n text-halo-radius: @text_font_halo_radius_large;\n text-wrap-width: 128;\n text-dy: 14;\n text-allow-overlap: true;\n \n \t[zoom>=14] {\n \ttext-dy: 0;\n }\n}\n","old_contents":"@text_font_transport_bold: 'Arial Unicode MS Bold';\n@text_font_physical_bold: 'Arial Unicode MS Bold';\n@text_font_administrative: 'Arial Unicode MS Regular';\n@text_font_administrative_bold: 'Arial Unicode MS Bold';\n@text_font_water: 'Arial Unicode MS Italic';\n@text_font_water_bold: 'Arial Unicode MS Bold Italic';\n@text_font_city: 'Arial Unicode MS Regular';\n@text_font_city_bold: 'Arial Unicode MS Bold';\n@text_font_poi_bold: 'Arial Unicode MS Bold Italic';\n\n@label_color_transport: #000;\n@label_color_transport_halo: #fff;\n@label_color_physical: #000;\n@label_color_physical_halo: #fff;\n@label_color_administrative: #000;\n@label_color_administrative_halo: #fff;\n@label_color_city: #000;\n@label_color_city_halo: #fff;\n@label_color_poi: #000;\n@label_color_poi_halo: #fff;\n\n@text_font_size_xxsm: 10;\n@text_font_size_xsm: 12;\n@text_font_size_sm: 13;\n@text_font_size_medium: 14;\n@text_font_size_medium_plus: 16;\n@text_font_size_large: 18;\n@text_font_halo_radius_sm: 1;\n@text_font_halo_radius_large: 2;\n\n#minor_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-avoid-edges: true;\n \n [zoom=16] {\n text-dy: 10; \n text-spacing: 124; \n text-size: @text_font_size_xxsm; \n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom=17] {\n text-dy: 13; \n text-spacing: 180; \n text-size: @text_font_size_xsm;\n text-halo-radius: @text_font_halo_radius_large; \n }\n [zoom>=18] {\n text-size: @text_font_size_xsm; \n text-spacing: 400; \n text-halo-radius: @text_font_halo_radius_large; \n }\n}\n\n#major_road_labels {\n text-name: \"[name]\";\n text-face-name: @text_font_transport_bold;\n text-placement: line;\n text-max-char-angle-delta: 30;\n text-fill: @label_color_transport;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_transport_halo;\n text-spacing: 100;\n text-avoid-edges: true;\n\n [zoom>=16][highway='primary'] {\n\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [is_tunnel=1][zoom>=15] {\n\ttext-fill: #777;\n }\n [zoom=12] {\n text-dy: 7;\n text-size: @text_font_size_xsm;\n text-min-distance: 4;\n }\n [zoom=13] {\n text-dy: 8;\n text-min-distance: 5;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_sm;\n }\n [highway='primary'] {\n\t\ttext-size: 13;\n }\n }\n\n [zoom=14] {\n text-min-distance: 5;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: 9;\n \ttext-size: @text_font_size_medium;\n } \n [highway='secondary'] {\n\t\ttext-dy: 7;\n \ttext-size: @text_font_size_xsm;\n text-halo-radius: 1.5;\n }\n }\n\n [zoom=15] {\n text-min-distance: 10;\n [highway='trunk'],[highway='primary'] {\n\t\ttext-dy: @text_font_size_xsm;\n \ttext-size: 15;\n }\n [highway='secondary'],[highway='tertiary'] {\n\t\ttext-dy: 11;\n \ttext-size: @text_font_size_sm;\n }\n }\n\n [zoom=16] {\n text-min-distance: 12;\n text-dy: 13;\n [highway='trunk'],[highway='primary'] { \n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'],[highway='tertiary'] {\t\n \ttext-spacing: 124;\n \ttext-size: @text_font_size_sm;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom=17] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-dy: 16;\n \ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-dy: 14;\n \ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-dy: 14; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_medium;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n\t\ttext-dy: 13; \n \ttext-spacing: 180;\n \ttext-size: @text_font_size_xsm; \n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n\n [zoom>=18] {\n text-min-distance: 12;\n [highway='trunk'] {\n\t\ttext-size: @text_font_size_medium_plus;\n }\n [highway='primary'] {\n\t\ttext-size: @text_font_size_medium;\n }\n [highway='secondary'] {\n\t\ttext-size: @text_font_size_medium; \n\t\ttext-spacing: 300;\n\t\ttext-halo-radius: @text_font_halo_radius_large;\n }\n [highway='tertiary'] {\n text-size: @text_font_size_xsm;\n text-spacing: 400;\n \ttext-halo-radius: @text_font_halo_radius_large;\n }\n }\n}\n\n#poi_station_labels {\n [zoom>=16][railway='station'] {\n shield-name: \"[label]\";\n shield-face-name: @text_font_transport_bold;\n shield-fill: white;\n shield-size: 12;\n shield-file: url('images\/subway_shield_small.svg');\n }\n}\n\n#water-bodies-labels-low,\n#water-bodies-labels-med,\n#water-bodies-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: point;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n text-fill: @label_color_physical_halo;\n text-halo-fill: @label_color_physical;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=15] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#green-areas-labels-low,\n#green-areas-labels-med,\n#green-areas-labels-high {\n [zoom=9][area>100000000],\n [zoom=10][area>100000000],\n [zoom=11][area>25000000],\n [zoom=12][area>5000000],\n [zoom=13][area>2000000],\n [zoom=14][area>200000],\n [zoom=15][area>50000],\n [zoom=16][area>10000],\n [zoom>=17] {\n \ttext-name: \"[name]\";\n\ttext-face-name: @text_font_water;\n text-placement: point;\n text-max-char-angle-delta: 30;\n text-wrap-width: 40;\n text-halo-radius: @text_font_halo_radius_large;\n \n text-fill: @label_color_physical;\n text-halo-fill: @label_color_physical_halo;\n \n text-line-spacing: -1;\n text-min-distance: 10;\n text-size: @text_font_size_xsm;\n \n [zoom>9][zoom<12] {\n text-spacing: 200;\n text-wrap-width: 50;\n }\n \n [zoom=12] {\n text-size: @text_font_size_xsm;\n text-spacing: 200;\n text-wrap-width: 70;\n }\n [zoom=13] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=14] {\n text-size: @text_font_size_xsm;\n text-spacing: 100;\n text-wrap-width: 70;\n }\n [zoom>=16] {\n text-size: @text_font_size_sm;\n text-spacing: 100;\n text-wrap-width: 40; \n }\n }\n}\n\n#continents[zoom>=1][zoom<3]\n{\n \ttext-name: \"[name]\";\n text-face-name: @text_font_physical_bold;\n text-wrap-width: 32;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical;\n text-halo-radius: 3;\n text-halo-fill: @label_color_physical_halo;\n}\n\n#admin1-labels-50m-z4 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z4]\";\n text-size: @text_font_size_xsm;\n}\n\n#admin1-labels-50m-z5 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z5]\";\n text-size: @text_font_size_medium_plus;\n}\n\n#admin1-labels-50m-z6 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z6]\";\n text-size: @text_font_size_large;\n}\n\n#admin1-labels-50m-z7 {\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo; \n text-name: \"[label_z7]\";\n text-size: @text_font_size_large;\n}\n\n#admin0-labels-z3[longfrom>3] {\n \ttext-name: \"[shortname]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n \ttext-min-distance: 1;\n}\n\n#admin0-labels-z3[longfrom<=3] {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative;\n text-wrap-width: 80;\n text-size: @text_font_size_sm;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z4 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z5 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium_plus;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n#admin0-labels-z6 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_administrative_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_large;\n text-fill: @label_color_administrative;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_administrative_halo;\n}\n\n\/\/ HACK! All the problematic water bodies with accents\n\/\/ e.g. \"Bahia de Campeche\" with an accented i,\n\/\/ have an empty \"changed\" string. So abuse this for now.\n\n#ne_110m_geography_marine_polys[zoom=2][scalerank=0][changed!=''],\n#ne_110m_geography_marine_polys[zoom=3][changed!=''],\n#ne_50m_geography_marine_polys[zoom=4][scalerank<4][changed!=''] {\n text-name: \"[name]\";\n\ttext-face-name: @text_font_water_bold;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n#ne_50m_geography_marine_polys[zoom=5][changed!=''],\n#ne_10m_geography_marine_polys[zoom>=6][zoom<=8][changed!='']\n{\n \ttext-name: \"[name]\";\n text-face-name: @text_font_water;\n text-wrap-width: 80;\n text-size: @text_font_size_medium;\n text-fill: @label_color_physical_halo;\n text-halo-radius: @text_font_halo_radius_sm;\n text-halo-fill: @label_color_physical;\n}\n\n#city_labels_z4,\n#city_labels_z5,\n#city_labels_z6 {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_city;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo;\n \ttext-min-distance: 5;\n \n \t#city_labels_z4 {\n text-size: @text_font_size_xxsm;\n [font_size=14] {\n text-size: @text_font_size_medium; \n }\n }\n \n \t#city_labels_z5 {\n text-size: @text_font_size_xsm;\n [font_size=16] {\n text-size: @text_font_size_medium_plus; \n }\n }\n \n #city_labels_z6 {\n text-size: @text_font_size_xsm;\n [font_size=18] {\n text-size: @text_font_size_large; \n }\n }\n \n [justified='left'] {\n \ttext-horizontal-alignment: middle;\n \ttext-dx: -5;\n }\n [justified='right'] {\n \ttext-horizontal-alignment: middle;\n \ttext-dx: 5;\n }\n}\n\n#city_labels_z7,\n#city_labels_z8, {\n\ttext-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo; \n\ttext-size: @text_font_size_sm;\n [font_size=20] { text-size: @text_font_size_large; } \n \n \t#city_labels_z7 {\n \t text-size: @text_font_size_xsm;\n [font_size=18] {\n text-size: @text_font_size_large; \n }\n }\n \n \t[justified='left'] {\n \ttext-horizontal-alignment: middle;\n \ttext-dx: -5;\n }\n [justified='right'] {\n \ttext-horizontal-alignment: middle;\n \ttext-dx: 5;\n }\n}\n\n#city_labels_z9,\n#city_labels_z10,\n#city_labels_z11,\n#city_labels_z12, {\n \ttext-name: \"[name]\";\n text-face-name: @text_font_city_bold;\n text-fill: @label_color_city;\n text-halo-radius: @text_font_halo_radius_large;\n text-halo-fill: @label_color_city_halo; \n\ttext-size: @text_font_size_sm;\n [font_size=20] { text-size: @text_font_size_large; } \n}\n\n\n#city_points_z4,\n#city_points_z5, \n#city_points_z6,\n#city_points_z7,\n#city_points_z8 {\n \tmarker-ignore-placement: true;\n \tmarker-width: 7;\n \tmarker-fill: black;\n \tmarker-line-color: white;\n \tmarker-line-width: 2;\n}\n\n#airports[zoom>=10][zoom<=13] {\n marker-width: 18;\n\tmarker-file: url('images\/airplane.svg');\n}\n\n#airports[zoom>=13][scalerank<=12]\n{\n \ttext-name: \"[name]\";\n text-face-name: @text_font_poi_bold;\n text-fill: @label_color_poi;\n text-size: @text_font_size_medium;\n text-halo-fill: @label_color_poi_halo;\n text-halo-radius: @text_font_halo_radius_large;\n text-wrap-width: 128;\n text-dy: 14;\n text-allow-overlap: true;\n \n \t[zoom>=14] {\n \ttext-dy: 0;\n }\n}\n","returncode":0,"stderr":"","license":"isc","lang":"CartoCSS"} {"commit":"b71fe866256a3f0047eff59d25d4cb90b10d98e1","subject":"Removing Log messages","message":"Removing Log messages\n","repos":"annplaksin\/sibmei,music-encoding\/sibmei","old_file":"src\/ExportGenerators.mss","new_file":"src\/ExportGenerators.mss","new_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgname, 'type', 'plugin');\n libmei.AddChild(applic, plgname);\n\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n \/\/ Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n if (note._property:TieIds != null)\n {\n ties = note._property:TieIds;\n mties = Self._property:MeasureTies;\n mties = mties.Concat(ties);\n Self._property:MeasureTies = mties;\n }\n\n beam = ProcessBeam(bobj, l);\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n libmei.AddChild(tuplet, note);\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n if (bobj.GraceNote = true)\n {\n libmei.addAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAppoggiatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'A');\n }\n\n if (bobj.IsAcciaccatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'a');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.addAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0)\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pos = nobj.ParentNoteRest.Position;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n libmei.AddAttribute(n, 'pnum', nobj.Pitch);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n \/\/ Accidentals will always be encoded as child elements, not attributes\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'headshape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n \/*\n Ties\n *\/\n tieresolver = Self._property:TieResolver;\n if (tieresolver.PropertyExists(hash))\n {\n \/\/ this note is the end of the tie.\n tie_id = tieresolver[hash];\n tie = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie, 'endid', '#' & n._id);\n }\n\n if (nobj.Tied = True)\n {\n \/\/ set the end hash\n parent_nr = nobj.ParentNoteRest;\n next_object = parent_nr.NextItem(parent_nr.VoiceNumber, 'NoteRest');\n\n if (next_object = null)\n {\n \/\/ check the first object in the next bar\n next_bar_num = parent_nr.ParentBar.BarNumber + 1;\n next_bar = parent_nr.ParentBar.ParentStaff.NthBar(next_bar_num);\n next_object = next_bar.NthBarObject(0);\n }\n\n if (next_object = null or next_object.Type != 'NoteRest')\n {\n \/\/ it's a hanging tie. What to do, what to do?\n \/\/ for now, just encode the startid with no endid and return the note.\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n n._property:TieIds = CreateSparseArray(tie._id);\n return n;\n }\n\n for each next_note in next_object\n {\n if (nobj.Pitch = next_note.Pitch)\n {\n \/\/ it's probably this one.\n endhash = SimpleNoteHash(next_note);\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n tieresolver[endhash] = tie._id;\n\n n._property:TieIds = CreateSparseArray(tie._id);\n }\n }\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n \n tiearr = CreateSparseArray();\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n\n if (sn._property:TieIds != null)\n {\n tieids = sn._property:TieIds;\n tiearr = tiearr.Concat(tieids);\n }\n }\n\n n._property:TieIds = tiearr;\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'rend', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(octl, 'dis', octrend[0]);\n libmei.AddAttribute(octl, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n activetext = activetext & c;\n }\n }\n }\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n Log('Format close: ' & activeinfo);\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n \/\/ Log('Units: ' & activeinfo);\n ;\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n \/\/ Log('Style: ' & activeinfo);\n ;\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n \/\/ Log('Font: ' & activeinfo);\n ;\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n \/\/ Log('Substitution: ' & activeinfo);\n ;\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n \/\/ Log('default: ' & ctx);\n ;\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","old_contents":"function GenerateMEIHeader () {\n \/\/$module(ExportGenerators.mss)\n \/\/ takes in a Sibelius Score object\n \/\/ returns a libmei tree (i.e., nested objects and arrays) with a MEI header with metadata\n score = Self._property:ActiveScore;\n header = libmei.MeiHead();\n fileD = libmei.FileDesc();\n titleS = libmei.TitleStmt();\n libmei.AddChild(header, fileD);\n libmei.AddChild(fileD, titleS);\n \n workDesc = libmei.WorkDesc();\n wd_work = libmei.Work();\n wd_titleStmt = libmei.TitleStmt();\n wd_title = libmei.Title();\n wd_respStmt = libmei.RespStmt();\n libmei.AddChild(wd_titleStmt, wd_title);\n libmei.AddChild(wd_titleStmt, wd_respStmt);\n libmei.AddChild(wd_work, wd_titleStmt);\n libmei.AddChild(workDesc, wd_work);\n \n title = libmei.Title();\n libmei.AddChild(titleS, title);\n\n if (score.Title != '')\n {\n libmei.SetText(title, score.Title);\n libmei.SetText(wd_title, score.Title);\n }\n if (score.Subtitle != '')\n {\n subtitle = libmei.Title();\n libmei.AddChild(titleS, subtitle);\n libmei.SetText(subtitle, score.Subtitle);\n libmei.AddAttribute(subtitle, 'type', 'subtitle');\n }\n if (score.Composer != '')\n {\n composer = libmei.Composer();\n libmei.AddChild(titleS, composer);\n libmei.SetText(composer, score.Composer);\n wd_composer = libmei.PersName();\n libmei.AddAttribute(wd_composer, 'role', 'composer');\n libmei.SetText(wd_composer, score.Composer);\n libmei.AddChild(wd_respStmt, wd_composer);\n }\n if (score.Lyricist != '')\n {\n lyricist = libmei.Lyricist();\n libmei.AddChild(titleS, lyricist);\n libmei.SetText(lyricist, score.Lyricist);\n wd_lyricist = libmei.PersName();\n libmei.AddAttribute(wd_lyricist, 'role', 'lyricist');\n libmei.SetText(wd_lyricist, score.Lyricist);\n libmei.AddChild(wd_respStmt, wd_lyricist);\n }\n if (score.Arranger != '')\n {\n arranger = libmei.Arranger();\n libmei.AddChild(titleS, arranger);\n libmei.SetText(arranger, score.Arranger);\n wd_arranger = libmei.PersName();\n libmei.AddAttribute(wd_arranger, 'role', 'arranger');\n libmei.SetText(wd_arranger, score.Arranger);\n libmei.AddChild(wd_respStmt, wd_arranger);\n }\n if (score.OtherInformation != '')\n {\n wd_notesStmt = libmei.NotesStmt();\n ns_annot = libmei.Annot();\n libmei.AddChild(wd_work, wd_notesStmt);\n libmei.AddChild(wd_notesStmt, ns_annot);\n libmei.SetText(ns_annot, score.OtherInformation);\n }\n\n respS = libmei.RespStmt();\n libmei.AddChild(titleS, respS);\n persN = libmei.PersName();\n libmei.AddChild(respS, persN);\n pubS = libmei.PubStmt();\n libmei.AddChild(fileD, pubS);\n \n avail = libmei.Availability();\n ur = libmei.UseRestrict();\n libmei.AddChild(avail, ur);\n libmei.AddChild(pubS, avail);\n libmei.SetText(ur, score.Copyright);\n\n encodingD = libmei.EncodingDesc();\n libmei.AddChild(header, encodingD);\n appI = libmei.AppInfo();\n libmei.AddChild(encodingD, appI);\n\n applic = libmei.Application();\n libmei.SetId(applic, 'sibelius');\n libmei.AddChild(appI, applic);\n libmei.AddAttribute(applic, 'version', Sibelius.ProgramVersion);\n isodate = ConvertDate(Sibelius.CurrentDate);\n libmei.AddAttribute(applic, 'isodate', isodate);\n\n plgname = libmei.Name();\n libmei.SetText(plgname, PluginName & ' (' & Version & ')');\n libmei.AddAttribute(plgname, 'type', 'plugin');\n libmei.AddChild(applic, plgname);\n\n osname = libmei.Name();\n libmei.SetText(osname, Sibelius.OSVersionString);\n libmei.AddAttribute(osname, 'type', 'operating-system');\n libmei.AddChild(applic, osname);\n \n libmei.AddChild(header, workDesc);\n\n return header;\n} \/\/$end\n\nfunction GenerateMEIMusic () {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n\n Self._property:TieResolver = CreateDictionary();\n Self._property:LyricWords = CreateDictionary();\n Self._property:SpecialBarlines = CreateDictionary();\n Self._property:SystemText = CreateDictionary();\n Self._property:LayerObjectPositions = null;\n Self._property:ObjectPositions = CreateDictionary();\n \n \/\/ the section parent is used in case we need to inject\n \/\/ a new parent later (e.g., for endings)\n Self._property:SectionParent = null;\n Self._property:VoltaBars = CreateDictionary();\n Self._property:ActiveVolta = null;\n Self._property:VoltaElement = null;\n\n \/\/ track page numbers\n Self._property:CurrentPageNumber = null;\n Self._property:PageBreak = null;\n Self._property:FrontMatter = CreateDictionary();\n\n \/\/ grab some global markers from the system staff\n \/\/ This will store it for later use.\n ProcessSystemStaff(score);\n\n music = libmei.Music();\n\n frontmatter = Self._property:FrontMatter;\n frontpages = frontmatter.GetPropertyNames();\n\n if (frontpages.Length > 0)\n {\n \/\/ sort the front pages \n Log('front: ' & frontmatter);\n\n sorted_front = utils.SortArray(frontpages, False);\n frontEl = libmei.Front();\n for each pnum in sorted_front\n {\n pgels = frontmatter[pnum];\n\n for each el in pgels\n {\n libmei.AddChild(frontEl, el);\n }\n }\n\n libmei.AddChild(music, frontEl);\n }\n\n body = libmei.Body();\n mdiv = libmei.Mdiv();\n sco = libmei.Score();\n\n libmei.AddChild(music, body);\n libmei.AddChild(body, mdiv);\n libmei.AddChild(mdiv, sco);\n\n scd = sibmei2.GenerateScoreDef(score);\n libmei.AddChild(sco, scd);\n\n barmap = ConvertSibeliusStructure(score);\n numbars = barmap.GetPropertyNames();\n numbars = numbars.Length;\n Self._property:BarMap = barmap;\n\n section = libmei.Section();\n libmei.AddChild(sco, section);\n\n for j = 1 to numbars + 1\n {\n \/\/ this value may get changed by the volta processor\n \/\/ to inject a new parent in the hierarchy.\n progressMsg = utils.Format(_ExportingBars, j, numbars);\n cont = Sibelius.UpdateProgressDialog(j, progressMsg);\n\n \/\/ if the user has clicked cancel, stop the plugin.\n if (cont = 0)\n {\n ExitPlugin();\n }\n\n m = GenerateMeasure(j);\n ending = ProcessVolta(j);\n\n if (Self._property:PageBreak != null)\n {\n pb = Self._property:PageBreak;\n libmei.AddChild(section, pb);\n Self._property:PageBreak = null;\n }\n\n if (ending != null)\n {\n libmei.AddChild(section, ending);\n libmei.AddChild(ending, m);\n }\n else\n {\n libmei.AddChild(section, m);\n }\n }\n\n return music;\n} \/\/$end\n\nfunction GenerateMeasure (num) {\n \/\/$module(ExportGenerators.mss)\n\n score = Self._property:ActiveScore;\n \/\/ measureties\n Self._property:MeasureTies = CreateSparseArray();\n Self._property:MeasureLines = CreateSparseArray();\n\n m = libmei.Measure();\n libmei.AddAttribute(m, 'n', num);\n\n barmap = Self._property:BarMap;\n staves = barmap[num];\n children = CreateSparseArray();\n\n \/\/ since so much metadata about the staff and other context\n \/\/ is available on the bar that should now be on the measure, go through the bars\n \/\/ and try to extract it.\n\n for i = 1 to staves.Length + 1\n {\n this_staff = score.NthStaff(i);\n bar = this_staff[num];\n\n curr_pn = bar.OnNthPage;\n if (curr_pn != Self._property:CurrentPageNumber)\n {\n Self._property:CurrentPageNumber = curr_pn;\n pb = libmei.Pb();\n\n \/\/ pages are stored internally as 0-based, so increment by one for the 'human' representation.\n libmei.AddAttribute(pb, 'n', curr_pn + 1);\n Self._property:PageBreak = pb;\n }\n\n if (bar.ExternalBarNumberString)\n {\n libmei.AddAttribute(m, 'label', bar.ExternalBarNumberString);\n }\n\n s = GenerateStaff(i, num);\n libmei.AddChild(m, s);\n }\n\n mties = Self._property:MeasureTies;\n\n for each tie in mties\n {\n m.children.Push(tie);\n }\n\n mlines = Self._property:MeasureLines;\n\n for each line in mlines\n {\n m.children.Push(line);\n }\n\n specialbarlines = Self._property:SpecialBarlines;\n\n if (specialbarlines.PropertyExists(num))\n {\n bline = specialbarlines[num];\n\n if (bline = 'rptstart')\n {\n libmei.AddAttribute(m, 'left', bline);\n }\n else\n {\n libmei.AddAttribute(m, 'right', bline);\n }\n }\n\n systemtext = Self._property:SystemText;\n\n if (systemtext.PropertyExists(num))\n {\n textobjs = systemtext[num];\n for each textobj in textobjs\n {\n text = ConvertText(textobj);\n\n if (text != null)\n {\n libmei.AddChild(m, text);\n }\n }\n }\n\n return m;\n} \/\/$end\n\n\nfunction GenerateStaff (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n stf = libmei.Staff();\n\n if (bar.OnHiddenStave)\n {\n libmei.AddAttribute(stf, 'visible', 'false');\n }\n\n libmei.AddAttribute(stf, 'n', staffnum);\n\n layers = GenerateLayers(staffnum, measurenum);\n \/\/ NB: Completely resets any previous children!\n libmei.SetChildren(stf, layers);\n\n return stf;\n} \/\/$end\n\nfunction GenerateLayers (staffnum, measurenum) {\n \/\/$module(ExportGenerators.mss)\n layerdict = CreateDictionary();\n layers = CreateSparseArray();\n\n objectPositions = Self._property:ObjectPositions;\n\n if (objectPositions.PropertyExists(staffnum) = False)\n {\n objectPositions[staffnum] = CreateDictionary();\n }\n\n staffObjectPositions = objectPositions[staffnum];\n\n score = Self._property:ActiveScore;\n this_staff = score.NthStaff(staffnum);\n bar = this_staff[measurenum];\n\n for each bobj in bar\n {\n voicenumber = bobj.VoiceNumber;\n\n if (staffObjectPositions.PropertyExists(bar.BarNumber) = False)\n {\n staffObjectPositions[bar.BarNumber] = CreateDictionary();\n }\n\n barObjectPositions = staffObjectPositions[bar.BarNumber];\n\n if (layerdict.PropertyExists(voicenumber))\n {\n l = layerdict[voicenumber];\n }\n else\n {\n if (voicenumber != 0)\n {\n l = libmei.Layer();\n layers.Push(l._id);\n\n if (barObjectPositions.PropertyExists(voicenumber) = False)\n {\n barObjectPositions[voicenumber] = CreateDictionary();\n }\n\n layerdict[voicenumber] = l;\n libmei.AddAttribute(l, 'n', voicenumber);\n }\n }\n\n obj = null;\n line = null;\n parent = null;\n beam = null;\n tuplet = null;\n\n switch (bobj.Type)\n {\n case('Clef')\n {\n clef = GenerateClef(bobj);\n libmei.AddChild(l, clef);\n }\n case('NoteRest')\n {\n note = GenerateNoteRest(bobj, l);\n\n \/\/ record the position of this element\n objVoice = barObjectPositions[voicenumber];\n objVoice[bobj.Position] = note._id;\n\n if (note._property:TieIds != null)\n {\n ties = note._property:TieIds;\n mties = Self._property:MeasureTies;\n mties = mties.Concat(ties);\n Self._property:MeasureTies = mties;\n }\n\n beam = ProcessBeam(bobj, l);\n tuplet = ProcessTuplet(bobj, note, l);\n\n if (beam != null)\n {\n libmei.AddChild(beam, note);\n\n if (tuplet != null)\n {\n if (beam._parent != tuplet._id)\n {\n libmei.AddChild(tuplet, beam);\n }\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n if (beam._parent != l._id)\n {\n libmei.AddChild(l, beam);\n }\n }\n }\n else\n {\n if (tuplet != null)\n {\n libmei.AddChild(tuplet, note);\n\n if (tuplet._parent != l._id)\n {\n libmei.AddChild(l, tuplet);\n }\n }\n else\n {\n libmei.AddChild(l, note);\n }\n }\n\n }\n case('BarRest')\n {\n brest = GenerateBarRest(bobj);\n\n if (brest != null)\n {\n libmei.AddChild(l, brest);\n }\n }\n case('Slur')\n {\n line = GenerateLine(bobj);\n }\n case('CrescendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('DimuendoLine')\n {\n line = GenerateLine(bobj);\n }\n case('OctavaLine')\n {\n line = GenerateLine(bobj);\n }\n case('Trill')\n {\n line = GenerateLine(bobj);\n }\n case('RepeatTimeLine')\n {\n RegisterVolta(bobj);\n }\n case('Line')\n {\n line = GenerateLine(bobj);\n }\n }\n\n if (line != null)\n {\n mlines = Self._property:MeasureLines;\n mlines.Push(line._id);\n Self._property:MeasureLines = mlines;\n }\n }\n\n for each LyricItem lobj in bar\n {\n ProcessLyric(lobj, objectPositions);\n }\n\n for each SymbolItem sobj in bar\n {\n ProcessSymbol(sobj, objectPositions);\n }\n\n return layers;\n} \/\/$end\n\nfunction GenerateClef (bobj) {\n \/\/$module(ExportGenerators.mss)\n clefinfo = ConvertClef(bobj.StyleId);\n clef_el = libmei.Clef();\n\n libmei.AddAttribute(clef_el, 'shape', clefinfo[0]);\n libmei.AddAttribute(clef_el, 'line', clefinfo[1]);\n libmei.AddAttribute(clef_el, 'dis', clefinfo[2]);\n libmei.AddAttribute(clef_el, 'dis.place', clefinfo[3]);\n\n return clef_el;\n} \/\/$end\n\nfunction GenerateNoteRest (bobj, layer) {\n \/\/$module(ExportGenerators.mss)\n nr = null;\n\n switch(bobj.NoteCount)\n {\n case(0)\n {\n nr = GenerateRest(bobj);\n }\n case(1)\n {\n nobj = bobj[0];\n nr = GenerateNote(nobj);\n }\n default\n {\n nr = GenerateChord(bobj);\n }\n }\n\n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(nr, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.CueSize = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(nr) != 'space')\n {\n libmei.AddAttribute(nr, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(nr, 'color', nrest_color);\n }\n\n if (bobj.GraceNote = true)\n {\n libmei.addAttribute(nr, 'grace', 'acc');\n }\n\n if (bobj.IsAppoggiatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'A');\n }\n\n if (bobj.IsAcciaccatura = true)\n {\n libmei.AddAttribute(nr, 'ornam', 'a');\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'curved');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(TriPauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'angular');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(SquarePauseArtic))\n {\n fermata = libmei.Fermata();\n libmei.AddAttribute(fermata, 'form', 'norm');\n libmei.AddAttribute(fermata, 'shape', 'square');\n libmei.AddAttribute(fermata, 'startid', '#' & nr._id);\n libmei.AddAttribute(fermata, 'layer', bobj.VoiceNumber);\n libmei.AddAttribute(fermata, 'staff', bobj.ParentBar.ParentStaff.StaffNum);\n\n mlines = Self._property:MeasureLines;\n mlines.Push(fermata._id);\n }\n\n if (bobj.GetArticulation(StaccatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacc');\n }\n\n if (bobj.GetArticulation(DownBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'dnbow');\n }\n\n if (bobj.GetArticulation(UpBowArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'upbow');\n }\n\n if (bobj.GetArticulation(MarcatoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'marc');\n }\n\n if (bobj.GetArticulation(AccentArtic))\n {\n libmei.addAttributeValue(nr, 'artic', 'acc');\n }\n\n if (bobj.GetArticulation(TenutoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'ten');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(StaccatissimoArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stacciss');\n }\n\n if (bobj.GetArticulation(PlusArtic))\n {\n libmei.AddAttributeValue(nr, 'artic', 'stop');\n }\n\n if (bobj.FallType = FallTypeDoit)\n {\n libmei.AddAttributeValue(nr, 'artic', 'doit');\n }\n\n if (bobj.FallType = FallTypeNormal)\n {\n libmei.AddAttributeValue(nr, 'artic', 'fall');\n }\n\n if (bobj.ScoopType = ScoopTypePlop)\n {\n libmei.AddAttributeValue(nr, 'artic', 'plop');\n }\n\n \/\/ a tremolo is a parent of note or chord in MEI\n if ((bobj.SingleTremolos > 0) or (bobj.SingleTremolos = -1))\n {\n \/\/ btrem = libmei.BTrem();\n \/\/ libmei.AddChild(btrem, nr);\n\n if (bobj.SingleTremolos = ZOnStem)\n {\n stemmod = 'z';\n }\n else\n {\n stemmod = bobj.SingleTremolos & 'slash';\n }\n\n libmei.AddAttribute(nr, 'stem.mod', stemmod);\n }\n\n return nr;\n} \/\/$end\n\nfunction GenerateRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/\/ check if it's a rest\n \/\/ check if it's hidden, in which case make MEI instead of \n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n if (bobj.Hidden)\n {\n r = libmei.Space();\n }\n else\n {\n r = libmei.Rest();\n }\n\n libmei.AddAttribute(r, 'dur', meidur[0]);\n libmei.AddAttribute(r, 'dur.ges', dur & 'p');\n libmei.AddAttribute(r, 'dots', meidur[1]);\n \n if (bobj.Dx != 0)\n {\n libmei.AddAttribute(r, 'ho', ConvertOffsetsToMillimeters(bobj.Dx));\n }\n\n if (bobj.Dy != 0)\n {\n libmei.AddAttribute(r, 'vo', ConvertOffsetsToMillimeters(bobj.Dy));\n }\n\n if (bobj.CueSize = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'size', 'cue');\n }\n\n if (bobj.Hidden = true and libmei.GetName(r) != 'space')\n {\n libmei.AddAttribute(r, 'visible', 'false');\n }\n\n if (bobj.Color != 0)\n {\n nrest_color = ConvertColor(bobj);\n libmei.AddAttribute(r, 'color', nrest_color);\n }\n\n if (bobj.GetArticulation(PauseArtic))\n {\n libmei.AddAttribute(r, 'fermata', 'above');\n }\n\n return r;\n} \/\/$end\n\nfunction GenerateNote (nobj) {\n \/\/$module(ExportGenerators.mss)\n dur = nobj.ParentNoteRest.Duration;\n meidur = ConvertDuration(dur);\n ntinfo = ConvertDiatonicPitch(nobj.DiatonicPitch);\n pos = nobj.ParentNoteRest.Position;\n keysig = nobj.ParentNoteRest.ParentBar.GetKeySignatureAt(pos);\n\n n = libmei.Note();\n hash = SimpleNoteHash(nobj);\n n._property:hash = hash;\n\n libmei.AddAttribute(n, 'pnum', nobj.Pitch);\n libmei.AddAttribute(n, 'pname', ntinfo[0]);\n libmei.AddAttribute(n, 'oct', ntinfo[1]);\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n\n \/\/ Accidentals will always be encoded as child elements, not attributes\n staff = nobj.ParentNoteRest.ParentBar.ParentStaff.StaffNum;\n\n if (nobj.NoteStyle != NormalNoteStyle)\n {\n nstyle = ConvertNoteStyle(nobj.NoteStyle);\n libmei.AddAttribute(n, 'headshape', nstyle);\n }\n\n accid = ConvertAccidental(nobj, keysig.Sharps);\n accVal = accid[0];\n isVisible = accid[1];\n\n if (accVal != ' ')\n {\n child = libmei.Accid();\n libmei.AddChild(n, child);\n\n if (isVisible = True)\n {\n libmei.AddAttribute(child, 'accid', accVal);\n }\n else\n {\n libmei.AddAttribute(child, 'accid.ges', accVal);\n }\n\n switch (nobj.AccidentalStyle)\n {\n case (CautionaryAcc)\n {\n libmei.AddAttribute(child, 'func', 'caution');\n }\n case (BracketedAcc)\n {\n libmei.AddAttribute(child, 'enclose', 'paren');\n }\n }\n }\n\n \/*\n Ties\n *\/\n tieresolver = Self._property:TieResolver;\n if (tieresolver.PropertyExists(hash))\n {\n \/\/ this note is the end of the tie.\n tie_id = tieresolver[hash];\n tie = libmei.getElementById(tie_id);\n libmei.AddAttribute(tie, 'endid', '#' & n._id);\n }\n\n if (nobj.Tied = True)\n {\n \/\/ set the end hash\n parent_nr = nobj.ParentNoteRest;\n next_object = parent_nr.NextItem(parent_nr.VoiceNumber, 'NoteRest');\n\n if (next_object = null)\n {\n \/\/ check the first object in the next bar\n next_bar_num = parent_nr.ParentBar.BarNumber + 1;\n next_bar = parent_nr.ParentBar.ParentStaff.NthBar(next_bar_num);\n next_object = next_bar.NthBarObject(0);\n }\n\n if (next_object = null or next_object.Type != 'NoteRest')\n {\n \/\/ it's a hanging tie. What to do, what to do?\n \/\/ for now, just encode the startid with no endid and return the note.\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n n._property:TieIds = CreateSparseArray(tie._id);\n return n;\n }\n\n for each next_note in next_object\n {\n if (nobj.Pitch = next_note.Pitch)\n {\n \/\/ it's probably this one.\n endhash = SimpleNoteHash(next_note);\n tie = libmei.Tie();\n libmei.AddAttribute(tie, 'startid', '#' & n._id);\n tieresolver[endhash] = tie._id;\n\n n._property:TieIds = CreateSparseArray(tie._id);\n }\n }\n }\n\n return n;\n} \/\/$end\n\nfunction GenerateChord (bobj) {\n \/\/$module(ExportGenerators.mss)\n n = libmei.Chord();\n dur = bobj.Duration;\n meidur = ConvertDuration(dur);\n\n libmei.AddAttribute(n, 'dur', meidur[0]);\n libmei.AddAttribute(n, 'dur.ges', dur & 'p');\n libmei.AddAttribute(n, 'dots', meidur[1]);\n \n tiearr = CreateSparseArray();\n\n for each note in bobj\n {\n sn = GenerateNote(note);\n libmei.AddChild(n, sn);\n\n if (sn._property:TieIds != null)\n {\n tieids = sn._property:TieIds;\n tiearr = tiearr.Concat(tieids);\n }\n }\n\n n._property:TieIds = tiearr;\n\n return n;\n} \/\/$end\n\nfunction GenerateBarRest (bobj) {\n \/\/$module(ExportGenerators.mss)\n switch (bobj.RestType)\n {\n case(BreveBarRest)\n {\n obj = libmei.MRest();\n libmei.AddAttribute(obj, 'dur', 'breve');\n }\n case (WholeBarRest)\n {\n obj = libmei.MRest();\n }\n case (OneBarRepeat)\n {\n obj = libmei.MRpt();\n }\n case (TwoBarRepeat)\n {\n obj = libmei.MRpt2();\n }\n case (FourBarRepeat)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectHasNoMEISupport, 'A four-bar repeat'));\n return null;\n }\n }\n\n if (bobj.Hidden = true)\n {\n libmei.AddAttribute(obj, 'visible', 'false');\n }\n\n return obj;\n} \/\/$end\n\nfunction GenerateScoreDef (score) {\n \/\/$module(ExportGenerators.mss)\n scoredef = libmei.ScoreDef();\n Self._property:_GlobalScoreDef = libmei.GetId(scoredef);\n\n docSettings = score.DocumentSetup;\n\n \/\/ this will ensure that the units specified by the user is the one that is\n \/\/ represented in the output.\n sibUnits = docSettings.UnitsInDocumentSetupDialog;\n unit = '';\n\n switch(sibUnits)\n {\n case(DocumentSetupUnitsInches)\n {\n unit = 'in';\n }\n case(DocumentSetupUnitsPoints)\n {\n unit = 'pt';\n }\n default\n {\n \/\/ Millimeters is the default for Sibelius\n unit = 'mm';\n }\n }\n\n libmei.AddAttribute(scoredef, 'page.width', docSettings.PageWidth & unit);\n libmei.AddAttribute(scoredef, 'page.height', docSettings.PageHeight & unit);\n libmei.AddAttribute(scoredef, 'page.leftmar', docSettings.PageLeftMargin & unit);\n libmei.AddAttribute(scoredef, 'page.rightmar', docSettings.PageRightMargin & unit);\n libmei.AddAttribute(scoredef, 'page.topmar', docSettings.PageTopMargin & unit);\n libmei.AddAttribute(scoredef, 'page.botmar', docSettings.PageBottomMargin & unit);\n\n showCautionaryAccidentals = score.EngravingRules.CautionaryNaturalsInKeySignatures;\n if (showCautionaryAccidentals = true)\n {\n libmei.AddAttribute(scoredef, 'key.sig.showchange', 'true');\n }\n\n libmei.AddAttribute(scoredef, 'music.name', score.MainMusicFontName);\n libmei.AddAttribute(scoredef, 'text.name', score.MainTextFontName);\n libmei.AddAttribute(scoredef, 'lyric.name', score.MusicTextFontName);\n\n systf = score.SystemStaff;\n timesig = systf.CurrentTimeSignature(1);\n\n libmei.AddAttribute(scoredef, 'meter.count', timesig.Numerator);\n libmei.AddAttribute(scoredef, 'meter.unit', timesig.Denominator);\n libmei.AddAttribute(scoredef, 'meter.sym', ConvertNamedTimeSignature(timesig.Text));\n libmei.AddAttribute(scoredef, 'ppq', '256'); \/\/ sibelius' internal ppq.\n\n staffgrp = GenerateStaffGroups(score);\n libmei.AddChild(scoredef, staffgrp);\n\n return scoredef;\n} \/\/$end\n\nfunction GenerateStaffGroups (score) {\n \/\/$module(ExportGenerators.mss)\n staffdict = CreateDictionary();\n parentstgrp = libmei.StaffGrp();\n numstaff = score.StaffCount;\n\n for each Staff s in score\n {\n std = libmei.StaffDef();\n libmei.XMLIdToObjectMap[std._id] = s;\n\n libmei.AddAttribute(std, 'n', s.StaffNum);\n libmei.AddAttribute(std, 'label', s.FullInstrumentName);\n libmei.AddAttribute(std, 'lines', s.InitialInstrumentType.NumStaveLines);\n \n clefinfo = ConvertClef(s.InitialClefStyleId);\n libmei.AddAttribute(std, 'clef.shape', clefinfo[0]);\n libmei.AddAttribute(std, 'clef.line', clefinfo[1]);\n libmei.AddAttribute(std, 'clef.dis', clefinfo[2]);\n libmei.AddAttribute(std, 'clef.dis.place', clefinfo[3]);\n libmei.AddAttribute(std, 'key.sig', ConvertKeySignature(s.InitialKeySignature.Sharps));\n\n if (s.InitialKeySignature.Major)\n {\n libmei.AddAttribute(std, 'key.mode', 'major');\n }\n else\n {\n libmei.AddAttribute(std, 'key.mode', 'minor');\n }\n\n staffdict[s.StaffNum] = std;\n }\n\n stgpdict = CreateDictionary();\n stgprevidx = CreateDictionary();\n stgpnum = 1;\n brackets = score.BracketsAndBraces;\n\n for each bkt in brackets\n {\n stgp = libmei.StaffGrp();\n libmei.AddAttribute(stgp, 'symbol', ConvertBracket(bkt.BracketType));\n libmei.AddAttribute(stgp, 'n', stgpnum);\n stgpdict[stgpnum] = stgp;\n\n if (bkt.BracketType != BracketSub)\n {\n for i = bkt.TopStaveNum to bkt.BottomStaveNum + 1\n {\n libmei.AddChild(stgp, staffdict[i]);\n stgprevidx[i] = stgpnum;\n }\n }\n stgpnum = stgpnum + 1;\n }\n\n \/\/ finally, we need to put them all in the right order.\n stgpnum_added = CreateSparseArray();\n for j = 1 to numstaff + 1\n {\n if (stgprevidx.PropertyExists(j))\n {\n \/\/ there is a group\n stgpnum = stgprevidx[j];\n if (utils.IsInArray(stgpnum_added, stgpnum) = false)\n {\n libmei.AddChild(parentstgrp, stgpdict[stgpnum]);\n stgpnum_added.Push(stgpnum);\n }\n }\n else\n {\n libmei.AddChild(parentstgrp, staffdict[j]);\n }\n \n }\n return parentstgrp;\n} \/\/$end\n\nfunction GenerateLine (bobj) {\n \/\/$module(ExportGenerators.mss)\n line = null;\n bar = bobj.ParentBar;\n\n switch (bobj.Type)\n {\n case ('Slur')\n {\n line = libmei.Slur();\n slurrend = ConvertSlurStyle(bobj.StyleId);\n libmei.AddAttribute(line, 'rend', slurrend[1]);\n }\n case ('CrescendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'cres');\n }\n case ('DimuendoLine')\n {\n line = libmei.Hairpin();\n libmei.AddAttribute(line, 'form', 'dim');\n }\n case ('OctavaLine')\n {\n line = libmei.Octave();\n octrend = ConvertOctava(bobj.StyleId);\n libmei.AddAttribute(octl, 'dis', octrend[0]);\n libmei.AddAttribute(octl, 'dis.place', octrend[1]);\n }\n case ('Trill')\n {\n line = GenerateTrill(bobj);\n \/\/ NB: Return here since the trill already has its properties set.\n return line;\n }\n case ('Line')\n {\n \/\/ a generic line element. \n linecomps = MSplitString(bobj.StyleId, '.');\n switch(linecomps[2])\n {\n case('bracket')\n {\n line = libmei.Line();\n libmei.AddAttribute(line, 'type', 'bracket');\n if (linecomps.Length > 4)\n {\n if (linecomps[4] = 'start')\n {\n libmei.AddAttribute(line, 'subtype', 'start');\n }\n\n if (linecomps[4] = 'end')\n {\n libmei.AddAttribute(line, 'subtype', 'end');\n }\n }\n }\n }\n }\n }\n\n if (line = null)\n {\n return null;\n }\n\n line = AddBarObjectInfoToElement(bobj, line);\n\n return line;\n} \/\/$end\n\n\nfunction GenerateTrill (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/* There are two types of trills in Sibelius: A line object and a \n symbol object. This method normalizes both of these.\n *\/\n trill = libmei.Trill();\n voicenum = bobj.VoiceNumber;\n bar = bobj.ParentBar;\n\n if (voicenum = 0)\n {\n warnings = Self._property:warnings;\n warnings.Push(utils.Format(_ObjectAssignedToAllVoicesWarning, bobj.Type));\n voicenum = 1;\n }\n\n obj = GetNoteObjectAtPosition(bobj);\n\n if (obj != null)\n {\n libmei.AddAttribute(trill, 'startid', '#' & obj._id);\n }\n\n trill = AddBarObjectInfoToElement(bobj, trill);\n\n return trill;\n} \/\/$end\n\nfunction GenerateFormattedString (bobj) {\n \/\/$module(ExportGenerators.mss)\n \/*\n Returns an array containing at least one paragraph\n tag, formatted with the element. \n\n Multiple paragraph tags may be returned if the formatting string contains\n a '\\n\\' (new paragraph)\n *\/\n\n FORMATOPEN = 1;\n FORMATCLOSE = 2;\n FORMATTAG = 3;\n FORMATINFO = 4;\n TEXTSTR = 5;\n\n \/\/ initialize context as a text string, since we may not always open with a formatting tag.\n ctx = TEXTSTR;\n tag = null;\n activeinfo = '';\n activetext = '';\n\n ret = CreateSparseArray();\n activeDiv = libmei.Div();\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n ret.Push(activeDiv);\n\n text = bobj.TextWithFormattingAsString;\n Log('text: ' & text);\n Log('initial context: ' & ctx);\n\n if (text = '')\n {\n return ret;\n }\n\n for i = 0 to Length(text)\n {\n c = CharAt(text, i);\n Log('c: ' & c);\n\n if (c = '\\\\')\n {\n if (ctx = FORMATINFO or ctx = FORMATTAG)\n {\n \/*\n If we have an open format context or\n we are looking at format info and see\n a slash, we are closing the format context\n *\/\n ctx = FORMATCLOSE;\n }\n else\n {\n if (ctx = TEXTSTR or ctx = FORMATCLOSE)\n {\n \/* If we have a slash we are either switching\n into a new formatting tag context\n or we are opening a new formatting tag\n immediately after closing one.\n *\/\n ctx = FORMATOPEN;\n }\n }\n }\n else\n {\n switch (ctx)\n {\n case (FORMATOPEN)\n {\n \/\/ the previous iteration gave us an opening\n \/\/ formatting string, so the next character is\n \/\/ the formatting tag\n ctx = FORMATTAG;\n }\n\n case (FORMATTAG)\n {\n \/*\n After seeing a tag we will expect to find some\n info. If there is no info, the next character will\n be a \\ and it will be caught above.\n *\/\n ctx = FORMATINFO;\n activeinfo = activeinfo & c;\n }\n\n case (FORMATINFO)\n {\n \/\/ keep appending the active info until\n \/\/ we reach the end.\n activeinfo = activeinfo & c;\n }\n\n case (FORMATCLOSE)\n {\n \/\/ the previous context was a closing format tag,\n \/\/ so the next character, if it is not another opening\n \/\/ tag, is a text string. Assume it is a text string\n \/\/ which will be corrected on the next go-round.\n ctx = TEXTSTR;\n activetext = activetext & c;\n }\n\n case (TEXTSTR)\n {\n Log('Activetext: ' & activetext);\n activetext = activetext & c;\n }\n }\n }\n\n Log('Context: ' & ctx);\n\n \/\/ now that we have figured out what context we are in, we\n \/\/ can do something about it.\n switch (ctx)\n {\n case (FORMATTAG)\n {\n tag = c;\n\n if (tag = 'n')\n {\n if (activetext != '')\n {\n libmei.SetText(activePara, activetext);\n activetext = '';\n }\n\n activePara = libmei.P();\n libmei.AddChild(activeDiv, activePara);\n }\n\n if (tag = 'N')\n {\n if (activetext != '')\n {\n children = activePara.children;\n\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n activetext = '';\n\n lb = libmei.Lb();\n libmei.AddChild(activePara, lb);\n }\n }\n\n case (TEXTSTR)\n {\n ;\n }\n\n case (FORMATOPEN)\n {\n \/\/ if we have hit a new format opening tag and we have some previous text.\n \/\/ if (activetext != '')\n \/\/ {\n \/\/ \/\/ we have some pending text that needs to be dealt with\n \/\/ libmei.SetText(activePara, activetext);\n \/\/ activetext = '';\n \/\/ }\n ;\n }\n\n case (FORMATCLOSE)\n {\n Log('Format close: ' & activeinfo);\n if (activeinfo != '')\n {\n \/\/ tags that have info.\n switch (tag)\n {\n case ('s')\n {\n \/\/ our info block should contain units.\n Log('Units: ' & activeinfo);\n }\n\n case ('c')\n {\n \/\/ our info block should contain a style\n Log('Style: ' & activeinfo);\n }\n\n case ('f')\n {\n \/\/ our info block should either contain \n \/\/ a font name or an underscore to switch\n \/\/ back to the default font.\n Log('Font: ' & activeinfo);\n }\n\n case ('$')\n {\n \/\/ our info block should contain a substitution\n Log('Substitution: ' & activeinfo);\n }\n }\n\n activeinfo = '';\n tag = '';\n }\n }\n default\n {\n Log('default: ' & ctx);\n }\n }\n }\n\n \/\/ \n if (ctx = TEXTSTR and activetext != '')\n {\n \/\/ if we end the text on a text string, append it to the active paragraph element.\n children = activePara.children;\n if (children.Length > 0)\n {\n lastLbId = children[-1];\n lastLb = libmei.getElementById(lastLbId);\n libmei.SetTail(lastLb, activetext);\n }\n else\n {\n libmei.SetText(activePara, activetext);\n }\n }\n\n return ret;\n} \/\/$end","returncode":0,"stderr":"","license":"mit","lang":"CartoCSS"} {"commit":"3ca728ae96e91f3f4481e0aa2f45dc4ae9cd3436","subject":"Updating nested multiple selectors","message":"Updating nested multiple selectors\n","repos":"midnightcomm\/carto,gravitystorm\/carto,pnorman\/carto,stefanklug\/carto,CartoDB\/carto,tomhughes\/carto,madeinqc\/carto,1ec5\/carto,CartoDB\/carto,mapbox\/carto,whitelynx\/carto,clhenrick\/carto","old_file":"test\/mess\/nested_multiple.mss","new_file":"test\/mess\/nested_multiple.mss","new_contents":"#world::innerborder {\n line-color: #000;\n}\n\n#world {\n .brown {\n line-color: #f00;\n }\n}\n\n#world .one .two .three {\n line-color: #000;\n}\n\n.blue, .green {\n line-color: #111;\n}\n","old_contents":"#world::innerborder {\n line-color: #000;\n}\n\n#world {\n .brown {\n line-color: #f00;\n }\n}\n\n#world .one .two .three {\n line-color: #000;\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"CartoCSS"} {"commit":"e588ad601f0732f5e0a317c3ae7fa4c1426fe107","subject":"scales added to example","message":"scales added to example\n","repos":"midnightcomm\/carto,1ec5\/carto,stefanklug\/carto,whitelynx\/carto,clhenrick\/carto,mapbox\/carto,CartoDB\/carto,tomhughes\/carto,gravitystorm\/carto,pnorman\/carto,CartoDB\/carto,madeinqc\/carto","old_file":"test\/mess\/complex_cascades.mss","new_file":"test\/mess\/complex_cascades.mss","new_contents":"#world {\n polygon-fill: #FFF;\n line-color:#F00;\n line-width: 0.5;\n}\n\n#world[NAME='United States'] {\n polygon-fill:#CCC;\n [zoom > 6] { polygon-fill:#DDD; }\n [zoom > 7] { polygon-fill:#999; }\n [zoom > 5] { polygon-fill:#666; }\n}\n\n#world[NAME='Canada'],\n#countries {\n polygon-fill: #eee;\n line-color: #ccc;\n line-width: 1;\n\n .new {\n polygon-fill: #CCC;\n }\n\n .new[zoom > 5] {\n line-width:0.5;\n\n [NAME='United States'] {\n polygon-fill:#AFC;\n }\n }\n}\n\n\/******************************************************************************\/\n\/* FLATTENS INTO *\/\n\/******************************************************************************\/\n\n#world {\n polygon-fill: #FFF;\n line-color:#F00;\n line-width:0.5;\n}\n\n#world [NAME='United States'] {\n polygon-fill:#CCC;\n}\n\n#world [zoom > 6] [NAME='United States'] {\n polygon-fill:#DDD;\n}\n\n#world [zoom > 5] [NAME='United States'] {\n \/* zoom > 5 overrides zoom > 6 *\/\n polygon-fill:#999;\n}\n\n#world [zoom > 7] [NAME='United States'] {\n polygon-fill:#666;\n}\n\n#world [NAME='Canada'] {\n polygon-fill: #eee;\n line-color: #ccc;\n line-width: 1;\n}\n\n#world .new [NAME='Canada'] {\n polygon-fill: #CCC;\n}\n\n#world .new [zoom > 5] [NAME='Canada'] {\n line-width:0.5;\n}\n\n#world .new [zoom > 5] [NAME='Canada'] [NAME='United States'] {\n \/* how do we handle filter overrides? I think we should discard the entire\n ruleset since there's obviously no way for this to be true *\/\n polygon-fill:#AFC;\n}\n\n#countries {\n polygon-fill: #eee;\n line-color: #ccc;\n line-width: 1;\n}\n\n#countries .new {\n polygon-fill: #CCC;\n}\n\n#countries .new [zoom > 5] {\n line-width:0.5;\n}\n\n#countries .new [zoom > 5] [NAME='United States'] {\n \/* for the #countries layer case, there was no previous filter on NAME, so we\n use that value and keep the ruleset *\/\n polygon-fill:#AFC;\n}\n\n\/******************************************************************************\/\n\/* CONVERTS TO *\/\n\/******************************************************************************\/\n\nLayer: #world\n\n