-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyaml2lilypond.leo
1010 lines (921 loc) · 46.3 KB
/
yaml2lilypond.leo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by Leo (http://webpages.charter.net/edreamleo/front.html) -->
<?xml-stylesheet ekr_test?>
<leo_file xmlns:leo="http://www.leo-editor.org/2011/leo" >
<leo_header file_format="2" tnodes="0" max_tnode_index="0" clone_windows="0"/>
<globals body_outline_ratio="0.5" body_secondary_ratio="0.5">
<global_window_position top="50" left="50" height="500" width="700"/>
<global_log_window_position top="0" left="0" height="0" width="0"/>
</globals>
<preferences/>
<find_panel_settings/>
<vnodes>
<v t="georgesawyer.20110802081402.1951" a="E"><vh>yaml2lilypond project</vh>
<v t="georgesawyer.20110825192845.1922"><vh><< readme >></vh></v>
<v t="georgesawyer.20110825192845.1468"><vh>DONE</vh>
<v t="markdblackwell.20110831121351.1583"><vh>better error messages</vh>
<v t="markdblackwell.20110831121351.1610" a="E"><vh>reading a YAML music file</vh>
<v t="markdblackwell.20110831121351.1611" a="E"><vh>problem with key</vh>
<v t="markdblackwell.20110831121351.1616"><vh>error message</vh></v>
<v t="markdblackwell.20110831121351.1612" a="E"><vh>source</vh>
<v t="markdblackwell.20110831121351.1613" a="E"><vh>Main</vh>
<v t="markdblackwell.20110823170927.1283"><vh>run_requests</vh></v>
<v t="markdblackwell.20110823170927.1281"><vh>run</vh></v>
</v>
</v>
</v>
</v>
<v t="georgesawyer.20110831082815.1603"><vh>reading a YAML template</vh>
<v t="georgesawyer.20110828205607.1541"><vh>second document not found</vh>
<v t="georgesawyer.20110831082815.1604"><vh>error message</vh></v>
<v t="georgesawyer.20110831082815.1605"><vh>source</vh>
<v t="markdblackwell.20110831121351.1579"><vh>Main</vh>
<v t="markdblackwell.20110823170927.1280"><vh>get_sole_yaml_document</vh></v>
<v t="markdblackwell.20110823170927.1281"></v>
</v>
<v t="markdblackwell.20110831121351.1580" a="E"><vh>Movement</vh>
<v t="markdblackwell.20110823170927.1373"><vh>initialize</vh></v>
</v>
<v t="markdblackwell.20110831121351.1581" a="E"><vh>Template</vh>
<v t="markdblackwell.20110823170927.1325"><vh>create_measures</vh></v>
</v>
<v t="markdblackwell.20110831121351.1582" a="E"><vh>UseYaml</vh>
<v t="markdblackwell.20110823170927.1341"><vh>get_yaml_documents</vh></v>
</v>
</v>
</v>
</v>
</v>
<v t="georgesawyer.20110802081402.2006"><vh>add function to find all YAML files</vh></v>
<v t="georgesawyer.20110802081402.2007"><vh>chop up with Leo</vh></v>
<v t="georgesawyer.20110819095338.1609"><vh><< purpose >></vh></v>
<v t="georgesawyer.20110827101921.1492"><vh>move current directory to App class</vh>
<v t="markdblackwell.20110823170927.1383" a="E"><vh>App</vh>
<v t="markdblackwell.20110823170927.1384"><vh><< class accessor >></vh></v>
<v t="markdblackwell.20110823170927.1386"><vh><< script >></vh></v>
</v>
<v t="markdblackwell.20110823170927.1367"><vh><< constant >></vh></v>
</v>
<v t="markdblackwell.20110831105007.1547"><vh>from YAML template, produce sample text</vh>
<v t="markdblackwell.20110831105007.1550"><vh>source</vh>
<v t="markdblackwell.20110831121351.1576" a="E"><vh>Main</vh>
<v t="markdblackwell.20110831121351.1575"><vh><< constant>></vh></v>
<v t="markdblackwell.20110831105007.1548"><vh>make_copyable_version</vh></v>
<v t="markdblackwell.20110823170927.1281"></v>
</v>
<v t="markdblackwell.20110831121351.1577"><vh>Measure</vh>
<v t="markdblackwell.20110823170927.1300"><vh><< accessor >></vh></v>
<v t="markdblackwell.20110823170927.1310"><vh>initialize</vh></v>
</v>
<v t="markdblackwell.20110831121351.1578"><vh>Movement</vh>
<v t="markdblackwell.20110823170927.1368"><vh><< accessor >></vh></v>
</v>
</v>
</v>
<v t="markdblackwell.20110914111846.1611"><vh>in output, place key above contents</vh>
<v t="markdblackwell.20110823170927.1311"><vh>to_s</vh></v>
<v t="markdblackwell.20110823170927.1263"><vh>write_input_for_lilypond</vh></v>
<v t="markdblackwell.20110914111846.1680" a="E"><vh>trail, not needed</vh>
<v t="markdblackwell.20110823170927.1310"></v>
<v t="markdblackwell.20110823170927.1327"><vh>initialize_copy</vh></v>
<v t="markdblackwell.20110823170927.1325"></v>
<v t="markdblackwell.20110823170927.1322"><vh><< accessor >></vh></v>
<v t="markdblackwell.20110823170927.1326"><vh>initialize</vh></v>
<v t="markdblackwell.20110823170927.1281"></v>
</v>
</v>
</v>
<v t="georgesawyer.20110802081402.2005"><vh>TODO</vh>
<v t="markdblackwell.20110831121351.1617"><vh>better error messages</vh>
<v t="markdblackwell.20110831121351.1942" a="E"><vh>missing LF after ...</vh>
<v t="markdblackwell.20110831121351.1941"><vh>error message</vh></v>
</v>
<v t="markdblackwell.20110831121351.1939"><vh>when one of my three values is missing </vh></v>
<v t="markdblackwell.20110831121351.1619"><vh>reading a YAML music file</vh></v>
<v t="markdblackwell.20110831121351.1618"><vh>reading a YAML template</vh></v>
</v>
<v t="georgesawyer.20110827101921.1493"><vh>actualize tests</vh>
<v t="georgesawyer.20110827152321.1533"><vh>@path test/unit</vh>
<v t="georgesawyer.20110827152321.1531"><vh>@path app</vh>
<v t="georgesawyer.20110827101921.1519"><vh><< app code tests >></vh>
<v t="georgesawyer.20110827101921.1500"><vh>some test</vh>
<v t="georgesawyer.20110827101921.1520"><vh>code</vh></v>
<v t="georgesawyer.20110827101921.1521"><vh>prints</vh></v>
</v>
<v t="georgesawyer.20110827101921.1505"><vh>@shadow app_test.rb</vh></v>
<v t="georgesawyer.20110827101921.1543"><vh>@shadow lilypond_test.rb</vh></v>
<v t="georgesawyer.20110827101921.1544"><vh>@shadow main_test.rb</vh></v>
<v t="georgesawyer.20110827101921.1545"><vh>@shadow measure_test.rb</vh></v>
<v t="georgesawyer.20110827101921.1546"><vh>@shadow movement_test.rb</vh></v>
<v t="georgesawyer.20110827101921.1547"><vh>@shadow template_test.rb</vh></v>
<v t="georgesawyer.20110827101921.1548"><vh>@shadow use_yaml_test.rb</vh></v>
<v t="georgesawyer.20110827101921.1549"><vh>@shadow variable_request_test.rb</vh></v>
</v>
</v>
<v t="georgesawyer.20110827152321.1532"><vh>@path surroundings</vh>
<v t="georgesawyer.20110827101921.1518"><vh><< surroundings tests >></vh>
<v t="georgesawyer.20110827101921.1510"><vh>@shadow unshift.rb</vh></v>
<v t="georgesawyer.20110827101921.1509"><vh>@shadow yaml_test.rb</vh></v>
<v t="georgesawyer.20110827101921.1508"><vh>@shadow flatten_test.rb</vh></v>
</v>
</v>
</v>
</v>
<v t="georgesawyer.20110825192845.1469"><vh>make project a Ruby gem</vh></v>
<v t="georgesawyer.20110819095338.1610"><vh><< usage >></vh></v>
</v>
<v t="georgesawyer.20110825192845.1464" a="E"><vh>fragment</vh>
<v t="markdblackwell.20110831121351.1570"><vh>private</vh>
<v t="markdblackwell.20110831121351.1574" a="E"><vh>private class</vh>
<v t="markdblackwell.20110831105007.1548"></v>
</v>
<v t="markdblackwell.20110823170927.1375" a="E"><vh>private</vh>
<v t="markdblackwell.20110823170927.1376"><vh>get_filepaths</vh>
<v t="markdblackwell.20110827081420.1506"><vh><< rdoc >></vh></v>
</v>
</v>
<v t="markdblackwell.20110831105007.1551" a="E"><vh>private</vh>
<v t="georgesawyer.20110827101921.1628"><vh>flatten</vh></v>
<v t="markdblackwell.20110823170927.1325"></v>
</v>
</v>
<v t="georgesawyer.20110825192845.1462"><vh>accessor</vh>
<v t="markdblackwell.20110823170927.1300"></v>
<v t="markdblackwell.20110823170927.1368"></v>
<v t="markdblackwell.20110823170927.1322"></v>
</v>
<v t="georgesawyer.20110825192845.1465" a="E"><vh>class</vh>
<v t="markdblackwell.20110823170927.1383" a="E"></v>
<v t="markdblackwell.20110823170927.1258" a="E"><vh>LilyPond</vh>
<v t="markdblackwell.20110823170927.1259"><vh><< constant >></vh></v>
<v t="markdblackwell.20110823170927.1260" a="E"><vh>method</vh>
<v t="markdblackwell.20110823170927.1261" a="E"><vh>public class</vh>
<v t="markdblackwell.20110826175603.1481"><vh>output_extension</vh></v>
<v t="markdblackwell.20110823170927.1262"><vh>rest</vh></v>
<v t="markdblackwell.20110823170927.1263"></v>
</v>
</v>
</v>
<v t="markdblackwell.20110823170927.1274" a="E"><vh>Main</vh>
<v t="markdblackwell.20110831121351.1575"></v>
<v t="markdblackwell.20110823170927.1275"><vh><< class accessor >></vh></v>
<v t="markdblackwell.20110823170927.1277"><vh>method</vh>
<v t="markdblackwell.20110823170927.1278"><vh>public class</vh>
<v t="markdblackwell.20110823170927.1279"><vh>extract_three_keys</vh></v>
<v t="markdblackwell.20110823170927.1280"></v>
<v t="markdblackwell.20110823170927.1281"></v>
<v t="markdblackwell.20110823170927.1282"><vh>run_lilypond</vh></v>
<v t="markdblackwell.20110823170927.1283"></v>
</v>
<v t="markdblackwell.20110831121351.1574" a="E"></v>
</v>
</v>
<v t="markdblackwell.20110823170927.1298"><vh>Measure</vh>
<v t="markdblackwell.20110823170927.1299"><vh><< constant >></vh></v>
<v t="markdblackwell.20110823170927.1300"></v>
<v t="markdblackwell.20110823170927.1301" a="E"><vh><< single line method >></vh>
<v t="markdblackwell.20110823170927.1302"><vh>content_no_barlines=</vh></v>
<v t="markdblackwell.20110823170927.1303"><vh>content=</vh></v>
<v t="markdblackwell.20110823170927.1304"><vh>prefix</vh></v>
<v t="markdblackwell.20110823170927.1305"><vh>prefix_barlines</vh></v>
<v t="markdblackwell.20110823170927.1306"><vh>suffix</vh></v>
<v t="markdblackwell.20110823170927.1307"><vh>suffix_barlines</vh></v>
</v>
<v t="markdblackwell.20110823170927.1308"><vh>method</vh>
<v t="markdblackwell.20110823170927.1309"><vh>public</vh>
<v t="markdblackwell.20110823170927.1310"></v>
<v t="markdblackwell.20110823170927.1311"></v>
</v>
</v>
</v>
<v t="markdblackwell.20110823170927.1366" a="E"><vh>Movement</vh>
<v t="markdblackwell.20110823170927.1367"></v>
<v t="markdblackwell.20110823170927.1368"></v>
<v t="markdblackwell.20110823170927.1369" a="E"><vh>method</vh>
<v t="markdblackwell.20110823170927.1370"><vh>public class</vh>
<v t="markdblackwell.20110823170927.1371"><vh>names</vh>
<v t="markdblackwell.20110827081420.1493"><vh><< rdoc >></vh></v>
</v>
</v>
<v t="markdblackwell.20110823170927.1372" a="E"><vh>public</vh>
<v t="markdblackwell.20110823170927.1373"></v>
<v t="markdblackwell.20110823170927.1374"><vh>is_template</vh></v>
</v>
<v t="markdblackwell.20110823170927.1375" a="E"></v>
</v>
</v>
<v t="markdblackwell.20110823170927.1320" a="E"><vh>Template</vh>
<v t="markdblackwell.20110823170927.1321"><vh><< constant >></vh></v>
<v t="markdblackwell.20110823170927.1322"></v>
<v t="markdblackwell.20110823170927.1323" a="E"><vh>method</vh>
<v t="markdblackwell.20110823170927.1324" a="E"><vh>public</vh>
<v t="markdblackwell.20110823170927.1326"></v>
<v t="markdblackwell.20110823170927.1327"></v>
</v>
<v t="markdblackwell.20110831105007.1551" a="E"></v>
</v>
</v>
<v t="markdblackwell.20110823170927.1335"><vh>UseYaml</vh>
<v t="markdblackwell.20110823170927.1336"><vh><< class accessor >></vh></v>
<v t="markdblackwell.20110823170927.1338"><vh><< script >></vh></v>
<v t="markdblackwell.20110823170927.1339" a="E"><vh>method</vh>
<v t="markdblackwell.20110823170927.1340" a="E"><vh>public class</vh>
<v t="markdblackwell.20110823170927.1341"></v>
</v>
</v>
</v>
<v t="markdblackwell.20110823170927.1348" a="E"><vh>VariableRequest</vh>
<v t="markdblackwell.20110823170927.1349"><vh><< class accessor >></vh></v>
<v t="markdblackwell.20110823170927.1350"><vh><< script >></vh></v>
<v t="markdblackwell.20110823170927.1351" a="E"><vh>method</vh>
<v t="markdblackwell.20110823170927.1352" a="E"><vh>public class</vh>
<v t="markdblackwell.20110823170927.1353"><vh>execute_method</vh></v>
</v>
</v>
</v>
</v>
<v t="georgesawyer.20110825192845.1460"><vh>class accessor</vh>
<v t="markdblackwell.20110823170927.1336"></v>
<v t="markdblackwell.20110823170927.1349"></v>
<v t="markdblackwell.20110823170927.1384"></v>
<v t="markdblackwell.20110823170927.1275"></v>
</v>
<v t="georgesawyer.20110825192845.1456"><vh>constants</vh>
<v t="markdblackwell.20110823170927.1299"></v>
<v t="markdblackwell.20110823170927.1321"></v>
<v t="markdblackwell.20110823170927.1259"></v>
<v t="markdblackwell.20110823170927.1367"></v>
<v t="markdblackwell.20110831121351.1575"></v>
</v>
<v t="georgesawyer.20110825192845.1467" a="E"><vh>method</vh>
<v t="georgesawyer.20110827101921.1628"></v>
<v t="markdblackwell.20110823170927.1303"></v>
<v t="markdblackwell.20110823170927.1302"></v>
<v t="markdblackwell.20110823170927.1325"></v>
<v t="markdblackwell.20110823170927.1353"></v>
<v t="markdblackwell.20110823170927.1279"></v>
<v t="markdblackwell.20110823170927.1376"></v>
<v t="markdblackwell.20110823170927.1280"></v>
<v t="markdblackwell.20110823170927.1341"></v>
<v t="markdblackwell.20110823170927.1326"></v>
<v t="markdblackwell.20110823170927.1373"></v>
<v t="markdblackwell.20110823170927.1327"></v>
<v t="markdblackwell.20110823170927.1374"></v>
<v t="markdblackwell.20110831105007.1548"></v>
<v t="markdblackwell.20110823170927.1371"></v>
<v t="markdblackwell.20110826175603.1481"></v>
<v t="markdblackwell.20110823170927.1304"></v>
<v t="markdblackwell.20110823170927.1305"></v>
<v t="markdblackwell.20110823170927.1262"></v>
<v t="markdblackwell.20110823170927.1281"></v>
<v t="markdblackwell.20110823170927.1282"></v>
<v t="markdblackwell.20110823170927.1283"></v>
<v t="markdblackwell.20110823170927.1306"></v>
<v t="markdblackwell.20110823170927.1307"></v>
<v t="markdblackwell.20110823170927.1311"></v>
<v t="markdblackwell.20110823170927.1263"></v>
</v>
<v t="georgesawyer.20110825192845.1463"><vh>require</vh>
<v t="markdblackwell.20110823170927.1392"><vh><< require >></vh></v>
</v>
<v t="georgesawyer.20110825192845.1461"><vh>script</vh>
<v t="markdblackwell.20110823170927.1394"><vh><< script >></vh></v>
<v t="markdblackwell.20110823170927.1338"></v>
<v t="markdblackwell.20110823170927.1350"></v>
<v t="markdblackwell.20110823170927.1386"></v>
</v>
</v>
<v t="georgesawyer.20110802081402.1953" a="E"><vh>external files</vh>
<v t="georgesawyer.20110825192845.1923" a="E"><vh>@path .</vh>
<v t="georgesawyer.20110827152321.1537"><vh>@shadow Rakefile</vh></v>
<v t="georgesawyer.20110825192845.1920" a="E"><vh>@shadow README.md</vh></v>
</v>
<v t="georgesawyer.20110827101921.1494"><vh>@path test/unit</vh>
<v t="georgesawyer.20110827152321.1534"><vh>@shadow standalone_test_helper.rb</vh></v>
<v t="georgesawyer.20110827101921.1552" a="E"><vh>@path surroundings</vh>
<v t="georgesawyer.20110827101921.1518"></v>
</v>
<v t="georgesawyer.20110827101921.1553"><vh>@path app</vh>
<v t="georgesawyer.20110827101921.1519"></v>
</v>
</v>
<v t="markdblackwell.20110823170927.1230"><vh>@path my_doc</vh>
<v t="georgesawyer.20110819095338.1333" a="E"><vh>@shadow comment_block.txt</vh></v>
</v>
<v t="markdblackwell.20110823170927.1229" a="E"><vh>@path app</vh>
<v t="markdblackwell.20110823170927.1382"
expanded="markdblackwell.20110823170927.1383,"><vh>@shadow app.rb</vh></v>
<v t="markdblackwell.20110823170927.1391"><vh>@shadow generate.rb</vh></v>
<v t="markdblackwell.20110823170927.1239"
expanded="markdblackwell.20110823170927.1258,markdblackwell.20110823170927.1260,markdblackwell.20110823170927.1261,"><vh>@shadow lily_pond.rb</vh></v>
<v t="markdblackwell.20110823170927.1241"
expanded="markdblackwell.20110823170927.1274,markdblackwell.20110831121351.1574,"><vh>@shadow main.rb</vh></v>
<v t="markdblackwell.20110823170927.1243"
expanded="markdblackwell.20110823170927.1301,"><vh>@shadow measure.rb</vh></v>
<v t="markdblackwell.20110823170927.1354"
expanded="markdblackwell.20110823170927.1366,markdblackwell.20110823170927.1369,markdblackwell.20110823170927.1372,markdblackwell.20110823170927.1375,"><vh>@shadow movement.rb</vh></v>
<v t="markdblackwell.20110823170927.1245"
expanded="markdblackwell.20110823170927.1320,markdblackwell.20110823170927.1323,markdblackwell.20110823170927.1324,markdblackwell.20110831105007.1551,"><vh>@shadow template.rb</vh></v>
<v t="markdblackwell.20110823170927.1247"
expanded="markdblackwell.20110823170927.1339,markdblackwell.20110823170927.1340,"><vh>@shadow use_yaml.rb</vh></v>
<v t="markdblackwell.20110823170927.1249" a="E"
expanded="markdblackwell.20110823170927.1348,markdblackwell.20110823170927.1351,markdblackwell.20110823170927.1352,"><vh>@shadow variable_request.rb</vh></v>
</v>
</v>
</v>
<v t="markdblackwell.20110914111846.1607" a="E"><vh>Recovered Nodes</vh>
<v t="markdblackwell.20110914111846.1608"><vh>Recovered node "<< readme >> from @shadow README.md</vh>
<v t="markdblackwell.20110914111846.1609"><vh>old:<< readme >></vh></v>
<v t="markdblackwell.20110914111846.1610"><vh>new:<< readme >></vh></v>
</v>
</v>
</vnodes>
<tnodes>
<t tx="georgesawyer.20110802081402.1951">@language plain
Convert YAML to LilyPond input format</t>
<t tx="georgesawyer.20110802081402.1953">@path .</t>
<t tx="georgesawyer.20110802081402.2005"></t>
<t tx="georgesawyer.20110802081402.2006"># Look at this for finding YAML files:
App.root.join(*TEST_GROUP).find do |path|
b=path.basename.to_s
Find.prune if path.directory? && ?.==b[0]
paths << path.dirname.join(b.chomp '.rb') if REQUIRE_TEST_BASENAME==b
end</t>
<t tx="georgesawyer.20110802081402.2007"></t>
<t tx="georgesawyer.20110819095338.1609">Purpose: improve usability of LilyPond by means of the YAML entry format.
Generate LilyPond input from YAML.</t>
<t tx="georgesawyer.20110819095338.1610">Example usage: TODO</t>
<t tx="georgesawyer.20110825192845.1456"></t>
<t tx="georgesawyer.20110825192845.1460"></t>
<t tx="georgesawyer.20110825192845.1461"></t>
<t tx="georgesawyer.20110825192845.1462"></t>
<t tx="georgesawyer.20110825192845.1463"></t>
<t tx="georgesawyer.20110825192845.1464">@language ruby</t>
<t tx="georgesawyer.20110825192845.1465"></t>
<t tx="georgesawyer.20110825192845.1467"></t>
<t tx="georgesawyer.20110825192845.1468"></t>
<t tx="georgesawyer.20110825192845.1469"></t>
<t tx="georgesawyer.20110825192845.1922">#yaml2lilypond
A program to convert music specifications from YAML format into LilyPond (input) format.
The program works, but its tests (it was written as a spike solution) and documentation are<br />
NOT READY YET.
TODO: change invocation to, 'yaml2lilypond'.
Written in Ruby.
##Justification and purpose
Some music, especially some choral music, is largely irregular in measure length. During LilyPond music entry and editing, these measures often are (or could be) joined or split, depending on the source you are working with: especially in early music, or wherever music has been entered in a free way.
In a practical way, yaml2lilypond allows measures to be labeled by (text) strings, instead of (only) by measure numbers.
Given multiple instruments or voice parts, each often carries along or implies several, separate, parallel LilyPond files for various purposes, such as adjusting the piano or organ reduction. Other features which LilyPond doesn't do well yet (completely automatically) might necessitate more of these parallel files.
Whenever there are parallel files, they require careful synchronization of all the measures and measure lengths. What a bother!
Obviously, any time humans find themselves checking and synchronizing with difficulty is a good opportunity for a computer to do it, instead. I found myself in that situation, and that's why I wrote this program.
For all music input files (in YAML format), yaml2lilypond fills each measure with spacer rests, unless told otherwise.
Regarding a LilyPond file whose purpose is just a few measures, this eases synchronization, because you can include only those measures.
When joining and splitting measures, only those LilyPond files which specify something explicitly (for those measures) need be changed. They are changed more simply:
* the measures are easier to find;
* just those couple of labeled measure areas need be changed; and
* measure numbers following them don't need adjusting, because there aren't any.
What is YAML? YAML is a data (storage) format whose noise (extra characters you enter) is very spare. It seems the cleanest for entering LilyPond source (it interferes only minimally) while still allowing measures to be labeled by text strings.
##Invocation
```bash
cd <movements directory>
ruby <directory containing yaml2lilypond>/app/generate.rb
```
If on the Windows command line:
```
cd <movements directory>
ruby "<directory containing yaml2lilypond>/app/generate.rb"
```
##Requirements
Yaml2lilypond requires your LilyPond project files (at least the YAML files) to be organized in a certain way. First, make a directory (e.g., 'movements'). Under this, segregate each music movement's files into its own subdirectory (actually, filesystem tree). Note: if a LilyPond project only has one movement, there nevertheless must be a subdirectory for it.
Before running yaml2lilypond, change your current, working directory to 'movements'.
BTW, to allow relative include paths in LilyPond (useful for movements), insert this line somewhere, such as near the top of book.ly:
```lilypond
#(ly:set-option 'relative-includes #t)
```
For example, a LilyPond project in a directory, 'suite', should have a subdirectory, 'movements'. Under this you might make subdirectories, 'adagio', 'minuet' and 'sarabande':
```
suite
* movements
** adagio
** minuet
** sarabande
```
Within each movement's subdirectory, there must be a file, ('template.yml', in YAML format) describing all the measures (in music order) with:
* Unique string identifiers, and
* Time signatures.
For example, the following is for a movement of two measures, with time signatures 6/4 and 3/2:
```yaml
---
- SomeLabel
- SomeOtherLabel
---
- 6
- - 3
- 2
...
```
##Results
All YAML (*.yml) files (except, 'template.yml': see above) are converted to files in LilyPond input format in the same directories. The output files will have the same filenames, but with extension, '.gly' (for 'generated Lilypond').
For reference, and for copying, yaml2lilypond also will generate a useful, sample YAML file in each movement directory ('sample-yaml.txt', based on template.yml), with a spacer rest for each measure.
##Input format
YAML input files for various instruments, voices, or voice 'overlays', etc., can be placed anywhere in the filesystem tree of a given movement. They must start with variable, mode and a prefix for the file. Continuing the example from above:
```yaml
---
variable: someMovementSopranoNotes
mode: relative c''
prefix:
- %
SomeLabel:
- R1*6/4
SomeOtherLabel:
- R1*3/2
...
```
The above would generate:
```lilypond
someMovementSopranoNotes = {
\relative c'' {
%
% SomeLabel
\time 6/4
| R1*6/4 |
% SomeOtherLabel
\time 3/2
| R1*3/2 |
}
}
```
Beside measure content ('R1*6/4', above), you can specify measure prefixes and suffixes, or both, e.g.:
```yaml
SomeLabel:
# New relative pitch location.
- prefix
- '} \relative c {'
SomeOtherLabel:
# New section.
- suffix
- \bar "||"
- \tempo "Poco più mosso" 2 = 56
```
You need not give any measure content. Also, you need not include measure labels for all measures. In both cases, a LilyPond spacer rest (for the full measure) will be used.
##YAML notes
If you want, you can include YAML comments. They can start anywhere with a hash character (#).
If you have any characters of '{}#' in a line (except YAML comments) or, as in tremolo, ':' at the end, then everything (after '- ') must be enclosed in single quotes (they will be removed). In that case, for single quotes in the result, you must enter them twice.
Be careful about the final, triple dots. If there are any characters after them, other than your computer's usual end of line sequence (required) you will get a mysterious error message.
Copyright (c) 2011 Mark D. Blackwell. See [MIT-LICENSE](MIT-LICENSE) for details.
</t>
<t tx="georgesawyer.20110825192845.1923"></t>
<t tx="georgesawyer.20110827101921.1492"></t>
<t tx="georgesawyer.20110827101921.1493"></t>
<t tx="georgesawyer.20110827101921.1494">@language ruby
@others</t>
<t tx="georgesawyer.20110827101921.1500"></t>
<t tx="georgesawyer.20110827101921.1518">@others</t>
<t tx="georgesawyer.20110827101921.1519">@others</t>
<t tx="georgesawyer.20110827101921.1520">k='(Requi)-emAeternam'
test_instrument[k].content_no_barlines='hello'
print test_instrument[k].content, "\n"
test_instrument[k].content='c4 d e f'
print test_instrument[k].content, "\n"
test_instrument[k].content="r*#{test_instrument[k].time}"
print test_instrument[k].content, "\n"</t>
<t tx="georgesawyer.20110827101921.1521">hello
| c4 d e f |
| r*12/4 |</t>
<t tx="georgesawyer.20110827101921.1552">@others</t>
<t tx="georgesawyer.20110827101921.1553">@others</t>
<t tx="georgesawyer.20110827101921.1628">def flatten a
a=[a].flatten # Not recursive: is Array#flatten.
2==a.length ? a : (a.push 4)
end</t>
<t tx="georgesawyer.20110827152321.1531"></t>
<t tx="georgesawyer.20110827152321.1532"></t>
<t tx="georgesawyer.20110827152321.1533"></t>
<t tx="georgesawyer.20110828205607.1541">Before, '---', I accidently put a hyphen, making, '- ---'. Therefore the second document was not found.
But, the error message was terrible. It should identify the YAML file (and it easily can).</t>
<t tx="georgesawyer.20110831082815.1603"></t>
<t tx="georgesawyer.20110831082815.1604">app/template.rb:10:in `create_measures': undefined method `collect' for nil:NilClass (NoMethodError)
from C:/Mark/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/template.rb:16:in `initialize'
from C:/Mark/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/movement.rb:21:in `new'
from C:/Mark/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/movement.rb:21:in `initialize'
from C:/Mark/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/main.rb:21:in `new'
from C:/Mark/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/main.rb:21:in `block in run'
from C:/Mark/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/main.rb:20:in `each'
from C:/Mark/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/main.rb:20:in `run'
from C:/Mark/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/generate.rb:13:in `<main>'
</t>
<t tx="georgesawyer.20110831082815.1605">@language ruby</t>
<t tx="markdblackwell.20110823170927.1229">@language ruby</t>
<t tx="markdblackwell.20110823170927.1230">@language plain</t>
<t tx="markdblackwell.20110823170927.1258">class LilyPond #:nodoc: all
<< constant >>
@others
end</t>
<t tx="markdblackwell.20110823170927.1259">INDENT = ' '*2
LILYPOND_VERSION='2.14.2'
OUTPUT_EXTENSION='.gly'</t>
<t tx="markdblackwell.20110823170927.1260"></t>
<t tx="markdblackwell.20110823170927.1261"></t>
<t tx="markdblackwell.20110823170927.1262">def self.rest; rest='r1*' end</t>
<t tx="markdblackwell.20110823170927.1263">def self.write_input_for_lilypond movement, instrument, filepath
lilypond_variable_name, mode, overall_prefix = Main.three_keys
a=Array.new
a.push %Q@\\version "#{LILYPOND_VERSION}"@
a.push "% This file was autogenerated. DO NOT MODIFY.\n"
a.push "#{lilypond_variable_name} = {"
a.push "#{INDENT}\\#{mode} {" # Keep a separate line, as may contain a LilyPond line comment.
overall_prefix.each{|e| a.push "#{INDENT}#{INDENT}#{e}"} unless overall_prefix.nil?
a.push instrument.hash.values_at(*movement.measure_keys).map{|e| e.to_s}.join "\n" # Value is Measure.
a.push "#{INDENT}}"
a.push "}"
s=a.join "\n"
f=File.new filepath, 'wb' # Use Unix (LF) line endings.
f.print s, "\n"
f.close
end</t>
<t tx="markdblackwell.20110823170927.1274">class Main #:nodoc: all
<< constant >>
<< class accessor >>
@others
end</t>
<t tx="markdblackwell.20110823170927.1275">class << self
attr_reader :three_keys
end</t>
<t tx="markdblackwell.20110823170927.1277"></t>
<t tx="markdblackwell.20110823170927.1278"></t>
<t tx="markdblackwell.20110823170927.1279">def self.extract_three_keys lilypond_variable_request
@three_keys=[
(lilypond_variable_request.delete 'variable'),
(lilypond_variable_request.delete 'mode'),
(lilypond_variable_request.delete 'prefix') ]
end</t>
<t tx="markdblackwell.20110823170927.1280">def self.get_sole_yaml_document filepath
y=UseYaml.get_yaml_documents filepath, 1 # Must be exactly one YAML document.
y.first
end</t>
<t tx="markdblackwell.20110823170927.1281">def self.run
##print 'Movement.names=';p Movement.names
Movement.names.each do |movement_name|
movement = Movement.new movement_name
make_copyable_version movement
##print 'movement.filepaths.inspect=';p movement.filepaths.inspect
movement.filepaths.each do |filepath|
##print 'filepath.to_s=';p filepath.to_s
next if movement.is_template filepath
##print 'filepath.to_s=';p filepath.to_s
lilypond_variable_request=get_sole_yaml_document filepath
extract_three_keys lilypond_variable_request
instrument=movement.template.clone
run_requests instrument, lilypond_variable_request, filepath
x=filepath.extname
no_x=filepath.to_s.chomp x
output_filepath=no_x.concat LilyPond.output_extension
##print 'output_filepath.to_s=';p output_filepath.to_s
LilyPond.write_input_for_lilypond movement, instrument, output_filepath
end
end
run_lilypond
end</t>
<t tx="markdblackwell.20110823170927.1282">def self.run_lilypond
dos_separator= '\\'
programs_directory = 'Program Files'
## programs_directory = 'progra'
program_location = %w[C: LilyPond usr bin lilypond-windows.exe].insert(1,programs_directory).join dos_separator
arguments = '-dgui book.ly'
dos_quote = '"'
## `#{dos_quote}#{program_location}#{dos_quote} #{arguments}`
end</t>
<t tx="markdblackwell.20110823170927.1283">def self.run_requests instrument, lilypond_variable_request, filepath
##print 'instrument=';p instrument
lilypond_variable_request.each do |measure_key,measure_request_vector|
##print 'instrument.hash=';p instrument.hash
begin
m=(measure=instrument.hash.fetch measure_key)
rescue IndexError # Ruby 1.9.2 subclasses this to KeyError.
raise " In #{filepath}, problem with key #{measure_key}"
end
method_name='content' # Is default.
until measure_request_vector.empty?
data = measure_request_vector.shift
(method_name=data; next) if VariableRequest.methods.include? data
VariableRequest.execute_method method_name, measure, data
end
end
end</t>
<t tx="markdblackwell.20110823170927.1298">class Measure #:nodoc: all
<< constant >>
<< accessor >>
<< single line method >>
@others
end</t>
<t tx="markdblackwell.20110823170927.1299">BAR_SYMBOL = '|'
FILLER = 's'
INDENT = ' '*4</t>
<t tx="markdblackwell.20110823170927.1300">attr_reader :content, :default_music, :key, :time, :time_array</t>
<t tx="markdblackwell.20110823170927.1301">@others
</t>
<t tx="markdblackwell.20110823170927.1302">def content_no_barlines= s; @content = s end</t>
<t tx="markdblackwell.20110823170927.1303">def content= s; @content = "#{BAR_SYMBOL} #{s} #{BAR_SYMBOL}" end</t>
<t tx="markdblackwell.20110823170927.1304">def prefix s; @content = "#{s}\n" + @content end</t>
<t tx="markdblackwell.20110823170927.1305">def prefix_barlines s; @content = "#{BAR_SYMBOL} #{s} #{BAR_SYMBOL}\n" + @content end</t>
<t tx="markdblackwell.20110823170927.1306">def suffix s; @content += "\n#{s}" end</t>
<t tx="markdblackwell.20110823170927.1307">def suffix_barlines s; @content += "\n#{BAR_SYMBOL} #{s} #{BAR_SYMBOL}" end</t>
<t tx="markdblackwell.20110823170927.1308"></t>
<t tx="markdblackwell.20110823170927.1309"></t>
<t tx="markdblackwell.20110823170927.1310">def initialize k, ts, t
@key = k
@time_same = ts
@time_array=[t].flatten; t = 2==t.length ? t : (t.push 4)
count,beat = @time_array
@time = "#{count}/#{beat}"
@default_music = "#{FILLER}1*#{@time}"
@content = "#{BAR_SYMBOL} #{@default_music} #{BAR_SYMBOL}"
end</t>
<t tx="markdblackwell.20110823170927.1311">def to_s
time_line = @time_same ? nil : "\\time #{@time}"
key_line = "#{INDENT}% #{@key}"
[key_line, time_line, @content].compact.join "\n"
end</t>
<t tx="markdblackwell.20110823170927.1320">class Template #:nodoc: all
<< constant >>
<< accessor >>
@others
end</t>
<t tx="markdblackwell.20110823170927.1321">FIRST_MEASURE_TIME_COMPARISON_VALUE = false</t>
<t tx="markdblackwell.20110823170927.1322">attr_reader :hash, :measures</t>
<t tx="markdblackwell.20110823170927.1323"></t>
<t tx="markdblackwell.20110823170927.1324"></t>
<t tx="markdblackwell.20110823170927.1325">def create_measures keys, time_data
times=time_data.collect{|a| flatten a}
time_same=(1...times.length).map{|i| times.at(i-1)==(times.at i)}
time_same.unshift FIRST_MEASURE_TIME_COMPARISON_VALUE
@measures=(keys.zip time_same, times).map{|k,ts,t| (Measure.new k,ts,t).freeze}
end</t>
<t tx="markdblackwell.20110823170927.1326">def initialize keys, time_data
create_measures keys, time_data
@hash=Hash[keys.zip @measures]
end</t>
<t tx="markdblackwell.20110823170927.1327">def initialize_copy source
@hash=Hash[keys.zip @hash.values_at(*keys).map{|e| e.dup}]
end</t>
<t tx="markdblackwell.20110823170927.1335">class UseYaml #:nodoc: all
<< class accessor >>
<< script >>
@others
end</t>
<t tx="markdblackwell.20110823170927.1336">class << self
attr_reader :extension
end</t>
<t tx="markdblackwell.20110823170927.1338">@extension = %w[yml]</t>
<t tx="markdblackwell.20110823170927.1339"></t>
<t tx="markdblackwell.20110823170927.1340"></t>
<t tx="markdblackwell.20110823170927.1341">def self.get_yaml_documents filepath, required_number_of_yaml_documents
n=required_number_of_yaml_documents
result=Array.new
push_document=Proc.new{|e| result.push e}
f=File.new filepath, 'r'
##print 'filepath=';p filepath
YAML::load_documents f, &push_document
f.close
raise "#{filepath} must have #{n} YAML document(s), #{result.length} found." unless n==result.length
result
end</t>
<t tx="markdblackwell.20110823170927.1348">class VariableRequest #:nodoc: all
<< class accessor >>
<< script >>
@others
end</t>
<t tx="markdblackwell.20110823170927.1349">class << self
attr_reader :methods
end</t>
<t tx="markdblackwell.20110823170927.1350">@methods = (
%w[prefix suffix].product(['', '_barlines']) +
%w[content ].product(['','_no_barlines'])
).map!{|a| a.join}</t>
<t tx="markdblackwell.20110823170927.1351"></t>
<t tx="markdblackwell.20110823170927.1352"></t>
<t tx="markdblackwell.20110823170927.1353">def self.execute_method method_name, measure, data
m,d = measure,data
case method_name
when 'content'; m.content=d
when 'prefix'; m.prefix d
when 'suffix'; m.suffix d
when 'content_no_barlines'; m.content_no_barlines=d
when 'prefix_barlines'; m.prefix_barlines d
when 'suffix_barlines'; m.suffix_barlines d
else raise 'what?' end
end</t>
<t tx="markdblackwell.20110823170927.1366">class Movement #:nodoc: all
<< constant >>
<< accessor >>
@others
end</t>
<t tx="markdblackwell.20110823170927.1367">MOVEMENTS_DIRECTORY=App.initial_current_directory
TEMPLATE_FILENAME = Pathname 'template.yml'</t>
<t tx="markdblackwell.20110823170927.1368">attr_reader :directory, :filepaths, :measure_keys, :template</t>
<t tx="markdblackwell.20110823170927.1369"></t>
<t tx="markdblackwell.20110823170927.1370"></t>
<t tx="markdblackwell.20110823170927.1371"><< rdoc >>
def self.names
##print 'MOVEMENTS_DIRECTORY.to_s=';p MOVEMENTS_DIRECTORY.to_s
MOVEMENTS_DIRECTORY.entries.select do |e|
##print 'e.to_s=';p e.to_s
MOVEMENTS_DIRECTORY.join(e).directory? && ?.!=e.to_s[0]
end.map(&:to_s)
end</t>
<t tx="markdblackwell.20110823170927.1372"></t>
<t tx="markdblackwell.20110823170927.1373">def initialize s
##print 's=';p s
@directory=MOVEMENTS_DIRECTORY.join s
a = UseYaml.get_yaml_documents @directory.join(TEMPLATE_FILENAME), 2 # Must be exactly two YAML documents.
##print 'a.inspect=';p a.inspect
a=a.map{|e| e.nil? ? [] : e}
@measure_keys, time_data = a
##print '@measure_keys=';p @measure_keys
##print 'time_data=';p time_data
@template=Template.new @measure_keys, time_data
@filepaths=get_filepaths
end</t>
<t tx="markdblackwell.20110823170927.1374">def is_template filepath
# f=filepath
# x=f.extname
# 'template'==(f.basename.to_s.chomp x)
TEMPLATE_FILENAME==filepath.basename
end</t>
<t tx="markdblackwell.20110823170927.1375">private</t>
<t tx="markdblackwell.20110823170927.1376"><< rdoc >>
def get_filepaths
result=Array.new
no_extension=Array.new
@directory.find do |path|
b=path.basename.to_s
Find.prune if path.directory? && ?.==b[0]
next unless path.file?
x = path.extname.to_s
##print 'x=';p x
s=(! x.start_with? '.') ? x : x[1..-1]
if UseYaml.extension.member? s
##print 'path.inspect=';p path.inspect
result << path
no_extension << path.dirname.join(b.chomp x)
end
end
no_extension=no_extension.sort
raise unless no_extension.uniq==no_extension
result.sort.uniq
end</t>
<t tx="markdblackwell.20110823170927.1383">class App #:nodoc: all
<< class accessor >>
<< script >>
@others
end</t>
<t tx="markdblackwell.20110823170927.1384">class << self
attr_reader :initial_current_directory
end</t>
<t tx="markdblackwell.20110823170927.1386">@initial_current_directory = Pathname.pwd
</t>
<t tx="markdblackwell.20110823170927.1392">require 'yaml'
require 'pathname'
s=Pathname(__FILE__).join('..').cleanpath.realpath
$LOAD_PATH.unshift s # Isn't this already included, like '.'?
require 'app'
require 'lily_pond'
require 'main'
require 'measure'
require 'movement'
require 'template'
require 'use_yaml'
require 'variable_request'
</t>
<t tx="markdblackwell.20110823170927.1394">Main.run</t>
<t tx="markdblackwell.20110826175603.1481">def self.output_extension; OUTPUT_EXTENSION end</t>
<t tx="markdblackwell.20110827081420.1493"># Example: ['hostias']</t>
<t tx="markdblackwell.20110827081420.1506"># Example: soprano/note.yml</t>
<t tx="markdblackwell.20110831105007.1547"></t>
<t tx="markdblackwell.20110831105007.1548">def self.make_copyable_version movement
s = movement.template.measures.map{|e| "#{e.key}:\n- #{e.default_music}\n"}.join
filepath = movement.directory.join TEMPLATE_FILENAME_COPYABLE
f = File.open filepath, 'wb' # For Git, use Unix (LF) line endings.
f.print s
f.close
end
</t>
<t tx="markdblackwell.20110831105007.1550">@language ruby</t>
<t tx="markdblackwell.20110831105007.1551">private</t>
<t tx="markdblackwell.20110831121351.1570">Must be after other kinds of methods, and must contain the word, 'private'.</t>
<t tx="markdblackwell.20110831121351.1574">private
</t>
<t tx="markdblackwell.20110831121351.1575">TEMPLATE_FILENAME_COPYABLE = Pathname 'sample-yaml.txt'</t>
<t tx="markdblackwell.20110831121351.1576"></t>
<t tx="markdblackwell.20110831121351.1577"></t>
<t tx="markdblackwell.20110831121351.1578"></t>
<t tx="markdblackwell.20110831121351.1579"></t>
<t tx="markdblackwell.20110831121351.1580"></t>
<t tx="markdblackwell.20110831121351.1581"></t>
<t tx="markdblackwell.20110831121351.1582"></t>
<t tx="markdblackwell.20110831121351.1583"></t>
<t tx="markdblackwell.20110831121351.1610"></t>
<t tx="markdblackwell.20110831121351.1611"></t>
<t tx="markdblackwell.20110831121351.1612">@language ruby</t>
<t tx="markdblackwell.20110831121351.1613"></t>
<t tx="markdblackwell.20110831121351.1616">app/main.rb:55:in `run_requests': problem with key HosannaSixteenthHoldq; instrument is #<Template:0x284fad8> (RuntimeError)
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlckwell/yaml2lilypond/app/main.rb:50:in `each'
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlckwell/yaml2lilypond/app/main.rb:50:in `run_requests'
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlckwell/yaml2lilypond/app/main.rb:29:in `run'
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlckwell/yaml2lilypond/app/main.rb:22:in `each'
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlckwell/yaml2lilypond/app/main.rb:22:in `run'
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlckwell/yaml2lilypond/app/main.rb:18:in `each'
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlckwell/yaml2lilypond/app/main.rb:18:in `run'
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlckwell/yaml2lilypond/app/generate.rb:13</t>
<t tx="markdblackwell.20110831121351.1617"></t>
<t tx="markdblackwell.20110831121351.1618"></t>
<t tx="markdblackwell.20110831121351.1619"></t>
<t tx="markdblackwell.20110831121351.1939"></t>
<t tx="markdblackwell.20110831121351.1941">ruby/1.8/yaml.rb:217:in `load_documents': syntax error on line 20, col 3: ♥' (ArgumentError)
from C:/progra/ruby/1.8.7-p352/lib/ruby/1.8/yaml.rb:217:in `each_document'
from C:/progra/ruby/1.8.7-p352/lib/ruby/1.8/yaml.rb:232:in `load_documents'
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/use_yaml.rb:11:in `get_yaml_documents'
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/main.rb:13:in `get_sole_yaml_document'
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/main.rb:26:in `run'
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/main.rb:22:in `each'
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/main.rb:22:in `run'
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/main.rb:18:in `each'
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/main.rb:18:in `run'
from C:/Documents and Settings/Mark/My Documents/develop/GitHub/MarkDBlackwell/yaml2lilypond/app/generate.rb:13</t>
<t tx="markdblackwell.20110831121351.1942">Turned out to be missing LF after YAML's end of stream signal, '...'. What can I do about that? Not use it, myself, or warn people.</t>
<t tx="markdblackwell.20110914111846.1607"></t>
<t tx="markdblackwell.20110914111846.1608">(uncached) georgesawyer.20110825192845.1922
Diff...
#yaml2lilypond
Program works, but the documentation (and tests: it was written as a spike solution) are NOT READY YET.
A program to convert music specifications, from YAML format, into LilyPond (input) format.
It is written in Ruby.
##invocation
```bash
cd <directory containing LilyPond movement directories>
yaml2lilypond
```
##requirements
When yaml2lilypond is invoked, each tree below the current directory (in the filesystem) must contain the *.yml files of only a single musical movement (even if there is only one).
The easiest way is to make a subdirectory (in your LilyPond project), e.g., 'all-movements', and place the files pertaining to each musical movement in a separate, ('CHILD') subdirectory under it. For example, if your project were called, 'my-suite', then one of my-suite's filesystem children would be called, 'all-movements', and all-movements' children might be 'adagio', 'minuet' and 'sarabande'.
BTW, in LilyPond, you can and should be using relative paths, for example by specifying in your book.ly:
```lilypond
#(ly:set-option 'relative-includes #t)
```
Within each CHILD, there must be a file, 'template.yml' containing, for all the movement's measures:
* time signatures, and
* unique string identifiers
Any other *.yml files are converted to LilyPond input format. The output filenames will have the same full pathnames but with the extension, '.gly' (for 'generated Lilypond').
The program will generate a sample YAML file ('sample-yaml.txt') for you to copy measures from.
-
- Copyright (c) 2011 Mark D. Blackwell. See [MIT-LICENSE](MIT-LICENSE) for details.
</t>
<t tx="markdblackwell.20110914111846.1609">#yaml2lilypond
Program works, but the documentation (and tests: it was written as a spike solution) are NOT READY YET.
A program to convert music specifications, from YAML format, into LilyPond (input) format.
It is written in Ruby.
##invocation
```bash
cd <directory containing LilyPond movement directories>
yaml2lilypond
```
##requirements
When yaml2lilypond is invoked, each tree below the current directory (in the filesystem) must contain the *.yml files of only a single musical movement (even if there is only one).
The easiest way is to make a subdirectory (in your LilyPond project), e.g., 'all-movements', and place the files pertaining to each musical movement in a separate, ('CHILD') subdirectory under it. For example, if your project were called, 'my-suite', then one of my-suite's filesystem children would be called, 'all-movements', and all-movements' children might be 'adagio', 'minuet' and 'sarabande'.
BTW, in LilyPond, you can and should be using relative paths, for example by specifying in your book.ly:
```lilypond
#(ly:set-option 'relative-includes #t)
```
Within each CHILD, there must be a file, 'template.yml' containing, for all the movement's measures:
* time signatures, and
* unique string identifiers
Any other *.yml files are converted to LilyPond input format. The output filenames will have the same full pathnames but with the extension, '.gly' (for 'generated Lilypond').
The program will generate a sample YAML file ('sample-yaml.txt') for you to copy measures from.
</t>
<t tx="markdblackwell.20110914111846.1610">#yaml2lilypond
Program works, but the documentation (and tests: it was written as a spike solution) are NOT READY YET.
A program to convert music specifications, from YAML format, into LilyPond (input) format.
It is written in Ruby.
##invocation
```bash
cd <directory containing LilyPond movement directories>
yaml2lilypond
```
##requirements
When yaml2lilypond is invoked, each tree below the current directory (in the filesystem) must contain the *.yml files of only a single musical movement (even if there is only one).
The easiest way is to make a subdirectory (in your LilyPond project), e.g., 'all-movements', and place the files pertaining to each musical movement in a separate, ('CHILD') subdirectory under it. For example, if your project were called, 'my-suite', then one of my-suite's filesystem children would be called, 'all-movements', and all-movements' children might be 'adagio', 'minuet' and 'sarabande'.
BTW, in LilyPond, you can and should be using relative paths, for example by specifying in your book.ly:
```lilypond
#(ly:set-option 'relative-includes #t)
```
Within each CHILD, there must be a file, 'template.yml' containing, for all the movement's measures:
* time signatures, and
* unique string identifiers