-
Notifications
You must be signed in to change notification settings - Fork 0
/
writeTune1.qml
1663 lines (1642 loc) · 44.9 KB
/
writeTune1.qml
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
//AwriteTuneXa.qml
// 4 Jan 2019
// Copyright (C) 2019 Joe McCarty
import QtQuick 2.1
import QtQuick.Controls 1.0
import MuseScore 1.0
import FileIO 1.0
import QtQuick.Dialogs 1.2
import QtQuick.Window 2.0
import QtQuick.Controls.Styles 1.3
import QtQuick.Layouts 1.1
MuseScore {
menuPath: "Plugins.writeTune1"
version: "2.0"
description: qsTr("This plugin exports from a Score to
text in a file.")
ApplicationWindow{
id:window
flags: Qt.Window |Qt.WindowStaysOnTopHint|Qt.WindowTitleHint
visible: true
width: 500; height: 500;
////
menuBar: MenuBar {
id:menubar1
Menu {
title: "File"
MenuItem { text: "Open..."
onTriggered: {
fileDialog.open();
}
}//end Open
MenuItem { text: "Save As..."
onTriggered: {
saveFileDialog.open();
}
}//end SaveAs
MenuItem { text: "Close"
onTriggered: {window.close(); Qt.quit();}
}//end close
}//end file menu
Menu {
title: "Edit"
MenuItem { text: "Copy..."
onTriggered: {
if (typeof curScore === 'undefined') return;
findSegment(0,0); //(voice,staff)
copyFromSelection(ta0);//.text);
findSegment(0,0); //(voice,staff)
}
}//end Copy
MenuItem { text: "Paste..."
onTriggered: {
findSegment(0,0); //(voice,staff)
pasteit(ta0.text,0);
findSegment(0,0); //(voice,staff)
}
}//end Paste
MenuItem { text: "Paste Reverse..."
onTriggered: {
findSegment(0,0); //(voice,staff)
pasteit(ta0.text,1);
findSegment(0,0); //(voice,staff)
}
}//end Paste Reverse
MenuItem { text: "Paste Half Time..."
onTriggered: {
findSegment(0,0); //(voice,staff)
pastehalf(ta0.text,1,2);
findSegment(0,0); //(voice,staff)
}
}//end PasteHalf
MenuItem { text: "Paste Double Time..."
onTriggered: {
findSegment(0,0); //(voice,staff)
pastehalf(ta0.text,2,1);
findSegment(0,0); //(voice,staff)
}
}//end PasteDouble
MenuItem { text: "Invert tune..."
onTriggered: {
findSegment(0,0); //(voice,staff)
showPage1();
findSegment(0,0); //(voice,staff)
}
}//end invert
}//end Edit Menu
Menu {
title: "Edit2"
MenuItem { text: "Chords,Notes, Rests..."
onTriggered: {
showPage2();
findSegment(0,0);
}
}//end chords,notes,rests
MenuItem { text: "Scales..."
onTriggered: {
findSegment(0,0);
showPage3();
}
}//end scales
}//end edit2
Menu {
title: "Knit"
MenuItem { text: "Knit Chords,Notes, Rests..."
onTriggered: {
showPage4();
findSegment(0,0);
}
}//end chords,notes,rests
MenuItem { text: "Knit Tunes..."
onTriggered: {
showPage5();
findSegment(0,0);
}
}//end knit tunes
MenuItem { text: "Knit Rhythm..."
onTriggered: {
showPage6();
findSegment(0,0);
}
}//end knit rhythm
}//end knit
}//end Menu bar
FileIO {
id: myFile
onError: console.log(msg + " Filename = " + myFile.source)
}//end FileIO
FileDialog {
id: fileDialog
title: qsTr("Please choose a file")
onAccepted: {
var filename = fileDialog.fileUrl
console.log("fn= ",filename);
if(filename){
myFile.source = filename;
//read file and put it in the TextArea
ta0.text = myFile.read();
}//end if filename
}//end onAccepted
}//end FileDialog
FileIO {
id: savFile
source: tempPath() + "/my_file.xml"
// onError: console.log(msg)
onError: console.log(msg + " Filename = " + savFile.source)
}//end FileIO
FileDialog {
id: saveFileDialog
selectExisting: false
nameFilters: ["Text files (*.txt)", "All files (*)"]
onAccepted: {
var filename = saveFileDialog.fileUrl;
filename= filename.toString().replace("file://", "").replace(/^\/(.:\/)(.*)$/, "$1$2");
console.log(filename)
console.log(filename);
if(filename){
savFile.source = filename;
console.log( savFile.write(ta0.text));
}//end if filename
}//end onAccepted
}//end FileDialog
////
Rectangle {
id:rect0
visible:true
color: "lightgrey"
anchors.top:menubar1.bottom
anchors.left: window.left
anchors.right:window.right
anchors.bottom: window.bottom
////
Column {
width:window.width
spacing:10
TextArea {
id:ta0
visible:true
anchors.topMargin: 10
anchors.bottomMargin: 10
anchors.leftMargin: 10
anchors.rightMargin: 10
width:parent.width
height:150
wrapMode: TextEdit.WrapAnywhere
textFormat: TextEdit.PlainText
}//end TextArea ta0
////
TextArea {
id:ta1
visible:true
anchors.topMargin: 10
anchors.bottomMargin: 10
anchors.leftMargin: 10
anchors.rightMargin: 10
width:parent.width
height:150
wrapMode: TextEdit.WrapAnywhere
textFormat: TextEdit.PlainText
}//end TextArea ta1
////
GroupBox {
id:chordtypeGroupbox
title: "Select Chord Type"
visible:true
anchors.leftMargin: 10
anchors.topMargin: 10
ComboBox {
id: chordType
model: ListModel {
id: chordTypeList
ListElement { text : "major"; note: "0, 4, 7";}
ListElement { text : "minor"; note: "0, 3, 7";}
ListElement { text : "major7"; note: "0, 4, 7, 11";}
ListElement { text : "minor7"; note: "0, 3, 7, 10";}
ListElement { text : "augmented"; note: "0, 4, 8";}
ListElement { text : "diminished"; note: "0, 3, 6";}
ListElement { text : "diminished7"; note: "0, 3, 6, 9";}
//
ListElement { text : "+5"; note: "0, 4, 8";}
ListElement { text : "1"; note: "0";}
ListElement { text : "11"; note: "0, 4, 7, 10, 14, 17";}
ListElement { text : "11+"; note: "0, 4, 7, 10, 14, 18";}
ListElement { text : "13"; note: "0, 4, 7, 10, 14, 17, 21";}
ListElement { text : "5"; note: "0, 7";}
ListElement { text : "6"; note: "0, 4, 7, 9";}
ListElement { text : "6*9"; note: "0, 4, 7, 9, 14";}
ListElement { text : "7"; note: "0, 4, 7, 10";}
ListElement { text : "7+5"; note: "0, 4, 8, 10";}
ListElement { text : "7+5-9"; note: "0, 4, 8, 10, 13";}
ListElement { text : "7-10"; note: "0, 4, 7, 10, 15";}
ListElement { text : "7-11"; note: "0, 4, 7, 10, 16";}
ListElement { text : "7-13"; note: "0, 4, 7, 10, 20";}
ListElement { text : "7-5"; note: "0, 4, 6, 10";}
ListElement { text : "7-9"; note: "0, 4, 7, 10, 13";}
ListElement { text : "7sus2"; note: "0, 2, 7, 10";}
ListElement { text : "7sus4"; note: "0, 5, 7, 10";}
ListElement { text : "9"; note: "0, 4, 7, 10, 14";}
ListElement { text : "9+5"; note: "0, 10, 13";}
ListElement { text : "9sus4"; note: "0, 5, 7, 10, 14";}
ListElement { text : "M"; note: "0, 4, 7";}
ListElement { text : "M7"; note: "0, 4, 7, 11";}
ListElement { text : "a"; note: "0, 4, 8";}
ListElement { text : "add11"; note: "0, 4, 7, 17";}
ListElement { text : "add13"; note: "0, 4, 7, 21";}
ListElement { text : "add2"; note: "0, 2, 4, 7";}
ListElement { text : "add4"; note: "0, 4, 5, 7";}
ListElement { text : "add9"; note: "0, 4, 7, 14";}
ListElement { text : "dim"; note: "0, 3, 6";}
ListElement { text : "dim7"; note: "0, 3, 6, 9";}
ListElement { text : "dom7"; note: "0, 4, 7, 10";}
ListElement { text : "halfdim"; note: "0, 3, 6, 10";}
ListElement { text : "halfdiminished"; note: "0, 3, 6, 10";}
ListElement { text : "i"; note: "0, 3, 6";}
ListElement { text : "i7"; note: "0, 3, 6, 9";}
ListElement { text : "m"; note: "0, 3, 7";}
ListElement { text : "m+5"; note: "0, 3, 8";}
ListElement { text : "m11"; note: "0, 3, 7, 10, 14, 17";}
ListElement { text : "m11+"; note: "0, 3, 7, 10, 14, 18";}
ListElement { text : "m13"; note: "0, 3, 7, 10, 14, 17, 21";}
ListElement { text : "m6"; note: "0, 3, 7, 9";}
ListElement { text : "m6*9"; note: "0, 3, 9, 7, 14";}
ListElement { text : "m7"; note: "0, 3, 7, 10";}
ListElement { text : "m7+5"; note: "0, 3, 8, 10";}
ListElement { text : "m7+5-9"; note: "0, 3, 8, 10, 13";}
ListElement { text : "m7+9"; note: "0, 3, 7, 10, 14";}
ListElement { text : "m7-5"; note: "0, 3, 6, 10";}
ListElement { text : "m7-9"; note: "0, 3, 7, 10, 13";}
ListElement { text : "m7b5"; note: "0, 3, 6, 10";}
ListElement { text : "m9"; note: "0, 3, 7, 10, 14";}
ListElement { text : "m9+5"; note: "0, 10, 14";}
ListElement { text : "madd11"; note: "0, 3, 7, 17";}
ListElement { text : "madd13"; note: "0, 3, 7, 21";}
ListElement { text : "madd2"; note: "0, 2, 3, 7";}
ListElement { text : "madd4"; note: "0, 3, 5, 7";}
ListElement { text : "madd9"; note: "0, 3, 7, 14";}
ListElement { text : "maj"; note: "0, 4, 7";}
ListElement { text : "maj11"; note: "0, 4, 7, 11, 14, 17";}
ListElement { text : "maj9"; note: "0, 4, 7, 11, 14";}
ListElement { text : "min"; note: "0, 3, 7";}
ListElement { text : "sus2"; note: "0, 2, 7";}
ListElement { text : "sus4"; note: "0, 5, 7";}
}//end model
currentIndex: 0
}//end combobox
}//end chordtypeGroupbox
///
GroupBox {
id:scaletypeGroupbox
title: "Select Scale Type"
visible:true
anchors.leftMargin: 10
anchors.topMargin: 10
ComboBox {
id: scaleType
width:100
model: ListModel {
id: scaleTypeList
ListElement { text:" major "; note:" 60,62,64,65,67,69,71,72" ;}
ListElement { text:" minor "; note:" 60,62,63,65,67,68,70,72" ;}
ListElement { text:" chromatic "; note:" 60,61,62,63,64,65,66,67,68,69,70,71,72" ;}
///
ListElement { text:" aeolian "; note:" 60,62,63,65,67,68,70,72" ;}
ListElement { text:" ahirbhairav "; note:" 60,61,64,65,67,69,70,72" ;}
ListElement { text:" augmented "; note:" 60,63,64,67,68,71,72" ;}
ListElement { text:" augmented2 "; note:" 60,61,64,65,68,69,72" ;}
ListElement { text:" bartok "; note:" 60,62,64,65,67,68,70,72" ;}
ListElement { text:" bhairav "; note:" 60,61,64,65,67,68,71,72" ;}
ListElement { text:" blues_major "; note:" 60,62,63,64,67,69,72" ;}
ListElement { text:" blues_minor "; note:" 60,63,65,66,67,70,72" ;}
ListElement { text:" chinese "; note:" 60,64,66,67,71,72" ;}
ListElement { text:" diatonic "; note:" 60,62,64,65,67,69,71,72" ;}
ListElement { text:" diminished "; note:" 60,61,63,64,66,67,69,70,72" ;}
ListElement { text:" diminished2 "; note:" 60,62,63,65,66,68,69,71,72" ;}
ListElement { text:" dorian "; note:" 60,62,63,65,67,69,70,72" ;}
ListElement { text:" egyptian "; note:" 60,62,65,67,70,72" ;}
ListElement { text:" enigmatic "; note:" 60,61,64,66,68,70,71,72" ;}
ListElement { text:" gong "; note:" 60,62,64,67,69,72" ;}
ListElement { text:" harmonic_major "; note:" 60,62,64,65,67,68,71,72" ;}
ListElement { text:" harmonic_minor "; note:" 60,62,63,65,67,68,71,72" ;}
ListElement { text:" hex_aeolian "; note:" 60,63,65,67,68,70,72" ;}
ListElement { text:" hex_dorian "; note:" 60,62,63,65,67,70,72" ;}
ListElement { text:" hex_major6 "; note:" 60,62,64,65,67,69,72" ;}
ListElement { text:" hex_major7 "; note:" 60,62,64,67,69,71,72" ;}
ListElement { text:" hex_phrygian "; note:" 60,61,63,65,68,70,72" ;}
ListElement { text:" hex_sus "; note:" 60,62,65,67,69,70,72" ;}
ListElement { text:" hindu "; note:" 60,62,64,65,67,68,70,72" ;}
ListElement { text:" hirajoshi "; note:" 60,62,63,67,68,72" ;}
ListElement { text:" hungarian_minor "; note:" 60,62,63,66,67,68,71,72" ;}
ListElement { text:" indian "; note:" 60,64,65,67,70,72" ;}
ListElement { text:" ionian "; note:" 60,62,64,65,67,69,71,72" ;}
ListElement { text:" iwato "; note:" 60,61,65,66,70,72" ;}
ListElement { text:" jiao "; note:" 60,63,65,68,70,72" ;}
ListElement { text:" kumoi "; note:" 60,62,63,67,69,72" ;}
ListElement { text:" leading_whole "; note:" 60,62,64,66,68,70,71,72" ;}
ListElement { text:" locrian "; note:" 60,61,63,65,66,68,70,72" ;}
ListElement { text:" locrian_major "; note:" 60,62,64,65,66,68,70,72" ;}
ListElement { text:" lydian "; note:" 60,62,64,66,67,69,71,72" ;}
ListElement { text:" lydian_minor "; note:" 60,62,64,66,67,68,70,72" ;}
ListElement { text:" major_pentatonic "; note:" 60,62,64,67,69,72" ;}
ListElement { text:" marva "; note:" 60,61,64,66,67,69,71,72" ;}
ListElement { text:" melodic_major "; note:" 60,62,64,65,67,68,70,72" ;}
ListElement { text:" melodic_minor "; note:" 60,62,63,65,67,69,71,72" ;}
ListElement { text:" melodic_minor_asc "; note:" 60,62,63,65,67,69,71,72" ;}
ListElement { text:" melodic_minor_desc "; note:" 60,62,63,65,67,68,70,72" ;}
ListElement { text:" messiaen1 "; note:" 60,62,64,66,68,70,72" ;}
ListElement { text:" messiaen2 "; note:" 60,61,63,64,66,67,69,70,72" ;}
ListElement { text:" messiaen3 "; note:" 60,62,63,64,66,67,68,70,71,72" ;}
ListElement { text:" messiaen4 "; note:" 60,61,62,65,66,67,68,71,72" ;}
ListElement { text:" messiaen5 "; note:" 60,61,65,66,67,71,72" ;}
ListElement { text:" messiaen6 "; note:" 60,62,64,65,66,68,70,71,72" ;}
ListElement { text:" messiaen7 "; note:" 60,61,62,63,65,66,67,68,69,71,72" ;}
ListElement { text:" minor_pentatonic "; note:" 60,63,65,67,70,72" ;}
ListElement { text:" mixolydian "; note:" 60,62,64,65,67,69,70,72" ;}
ListElement { text:" neapolitan_major "; note:" 60,61,63,65,67,69,71,72" ;}
ListElement { text:" neapolitan_minor "; note:" 60,61,63,65,67,68,71,72" ;}
ListElement { text:" octatonic "; note:" 60,62,63,65,66,68,69,71,72" ;}
ListElement { text:" pelog "; note:" 60,61,63,67,68,72" ;}
ListElement { text:" phrygian "; note:" 60,61,63,65,67,68,70,72" ;}
ListElement { text:" prometheus "; note:" 60,62,64,66,71,72" ;}
ListElement { text:" purvi "; note:" 60,61,64,66,67,68,71,72" ;}
ListElement { text:" ritusen "; note:" 60,62,65,67,69,72" ;}
ListElement { text:" romanian_minor "; note:" 60,62,63,66,67,69,70,72" ;}
ListElement { text:" scriabin "; note:" 60,61,64,67,69,72" ;}
ListElement { text:" shang "; note:" 60,62,65,67,70,72" ;}
ListElement { text:" spanish "; note:" 60,61,64,65,67,68,70,72" ;}
ListElement { text:" super_locrian "; note:" 60,61,63,64,66,68,70,72" ;}
ListElement { text:" todi "; note:" 60,61,63,66,67,68,71,72" ;}
ListElement { text:" whole "; note:" 60,62,64,66,68,70,72" ;}
ListElement { text:" whole_tone "; note:" 60,62,64,66,68,70,72" ;}
ListElement { text:" yu "; note:" 60,63,65,67,70,72" ;}
ListElement { text:" zhi "; note:" 60,62,65,67,69,72" ;}
}//end model
currentIndex: 0
}
}//end scaletype groupbox
////
GroupBox {
id:chordinvGroupbox
title: "Select Chord Inversion"
visible:true
anchors.leftMargin: 10
anchors.topMargin: 10
Label {
id:cib3Labela
anchors.leftMargin: 10
anchors.topMargin: 10
text: "Chord Inversion = "
}//end Label
Label {
id:cib3Label
anchors.left:cib3Labela.right
anchors.leftMargin: 10
anchors.topMargin: 10
text: "0"
}//end Label
Button{
id:ciupButton
anchors.left:cib3Label.right
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Up")
onClicked: {
var x=cib3Label.text;
if(x<8){
x++;
}
cib3Label.text=x;
}//end on clicked
}//end upbutton
Button{
id:cidownButton
anchors.left:ciupButton.right
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Down")
onClicked: {
var x=cib3Label.text;
if(x>-8){
x--; //pitch=pitch-12;//+(gb3Label.text-4)*12;
}
cib3Label.text=x;
}//end on clicked
}//end downButton
}//end chordinvGroupbox
///
GroupBox {
id:pitchGroupbox
visible:true
title: "Enter Note or Chord Pitch"
anchors.leftMargin: 10
anchors.topMargin: 10
Column{
GroupBox {
id:pitchGroupbox1
visible:true
title: "Enter Note or Chord Pitch"
anchors.leftMargin: 10
anchors.topMargin: 10
Label {
id:gb3Labela
anchors.leftMargin: 10
anchors.topMargin: 10
text: "Octave = "
}//end Label
Label {
id:gb3Label
anchors.left:gb3Labela.right
anchors.leftMargin: 10
anchors.topMargin: 10
text: "4"
}//end Label
Button{
id:upButton
anchors.left:gb3Label.right
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Up")
onClicked: {
var x=gb3Label.text;
if(x<10){
x++;
pitch=pitch+12;
}
gb3Label.text=x;
keyboard.title=getnotename(pitch);
}//end on clicked
}//end upbutton
Button{
id:downButton
anchors.left:upButton.right
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Down")
onClicked: {
var x=gb3Label.text;
if(x>0){
x--;
pitch=pitch-12;//+(gb3Label.text-4)*12;
}
gb3Label.text=x;
keyboard.title=getnotename(pitch);
}//end on clicked
}//end downButton
}//end pitchGB1
///
GroupBox {
id:keyboard
title: "60 C4"
anchors.leftMargin: 10
anchors.topMargin: 10
Row{
Button{
id:cnote
text: "C"
onClicked:{setnote(0);}
}//end button
Button{
id:csnote
text: "C#"
onClicked:{setnote(1);}
}//end button
Button{
id:dnote
text: "D"
onClicked:{setnote(2);}
}//end button
Button{
id:dsnote
text: "D#"
onClicked:{setnote(3);}
}//end button
Button{
id:enote
text: "E"
onClicked:{setnote(4);}
}//end button
Button{
id:fnote
text: "F"
onClicked:{setnote(5);}
}//end button
Button{
id:fsnote
text: "F#"
onClicked:{setnote(6);}
}//end button
Button{
id:gnote
text: "G"
onClicked:{setnote(7);}
}//end button
Button{
id:gsnote
text: "G#"
onClicked:{setnote(8);}
}//end button
Button{
id:anote
text: "A"
onClicked:{setnote(9);}
}//end button
Button{
id:asnote
text: "A#"
onClicked:{setnote(10);}
}//end button
Button{
id:bnote
text: "B"
onClicked:{setnote(11);}
}//end button
Button{
id:c5snote
text: "C"
onClicked:{setnote(12);}
}//end button
}//end row
}//end keyboard groupbox
}//end column
}//end pitchgb
///
GroupBox {
id:durationGroupbox
visible:true
title: "Select Note, Chord or Rest Duration"
anchors.leftMargin: 10
anchors.topMargin: 10
Column{
GroupBox{
id:durGB
visible:true
anchors.leftMargin: 10
anchors.topMargin: 10
Row{
Button{
id:ndNumupButton
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Up")
onClicked: {
var x=ndNumLabel.text;
x++;
ndNumLabel.text=x;
}//end on clicked
}//end upbutton
Button{
id:ndNumdownButton
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Down")
onClicked: {
var x=ndNumLabel.text;
if(x>1){
x--;
}
ndNumLabel.text=x;
}//end on clicked
}//end downButton
///
Label {
id:ndNumLabela
anchors.leftMargin: 10
anchors.topMargin: 10
text: "Note Duration = "
}//end Label
Label {
id:ndNumLabel
anchors.leftMargin: 10
anchors.topMargin: 10
text: "1"
}//end Label
Label {
id:ndNumLabelb
anchors.leftMargin: 10
anchors.topMargin: 10
text: "/"
}//end Label
Label {
id:ndDenLabel
anchors.leftMargin: 10
anchors.topMargin: 10
text: "8"
}//end Label
Button{
id:ndDenupButton
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Up")
onClicked: {
var x=ndDenLabel.text;
if(x<32)x=x*2;
ndDenLabel.text=x;
}//end on clicked
}//end upbutton
Button{
id:ndDendownButton
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Down")
onClicked: {
var x=ndDenLabel.text;
if(x>1)x=x/2;
ndDenLabel.text=x;
}//end on clicked
}//end downButton
}//end row
}//end duroupbox
GroupBox {
id:tkeys
visible:true
anchors.leftMargin: 10
anchors.topMargin: 10
Row{
Button{
id:thirty2
text: "1/32"
onClicked:{
ndDenLabel.text=32;
ndNumLabel.text=1;
}
}//end button
Button{
id:sixteenth
text: "1/16"
onClicked:{
ndDenLabel.text=16;
ndNumLabel.text=1;
}
}//end button
Button{
id:eighth
text: "1/8"
onClicked:{
ndDenLabel.text=8;
ndNumLabel.text=1;
}
}//end button
Button{
id:quarter
text: "1/4"
onClicked:{
ndDenLabel.text=4;
ndNumLabel.text=1;
}
}//end button
Button{
id:half
text: "1/2"
onClicked:{
ndDenLabel.text=2;
ndNumLabel.text=1;
}
}//end button
Button{
id:whole
text: "1/1"
onClicked:{
ndDenLabel.text=1;
ndNumLabel.text=1;
}
}//end button
}//end row
}//end tkeys GB
}//end Column
}//end durationb GB
////
GroupBox {
id: useOctshiftGB
visible:true
title: "Use Octave Shift After Inversion"
width:parent.width
Column {
spacing: 10
CheckBox {
id:useOctaveShiftCB
text: "Use Octave Shift"
checked: true
}//end cb
}//end Column
}//end useOctshiftGB
////
GroupBox {
id:scaledir
title: "Scale Direction"
visible:true
Row {
ExclusiveGroup { id: scale1Group }
RadioButton {
id:scaleup
text: "Up"
checked: true
exclusiveGroup: scale1Group
}//end radiobutton
RadioButton {
id:scaledown
text: "Down"
exclusiveGroup: scale1Group
}//end radiobutton
}//end Row
}//end scaledir groupbox
////
GroupBox {
id:msSyncGB
visible:true
title: "Musecore Selection Sync"
Row{
spacing:100
Button{
id:syncButton
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Sync")
onClicked: {
findSegment(0,0);
}//end on clicked
}//end syncButton
Label {
id:syncLabel
anchors.leftMargin: 10
anchors.topMargin: 10
text: "Full Score Selected"
}//end syncLabel
}//end row
}//end msSyncGB
////
Row{
GroupBox {
id:page1contol
visible:true
anchors.leftMargin: 10
anchors.topMargin: 10
Button {
id: applyButton
text: qsTranslate("PrefsDialogBase", "Invert")
onClicked: {
invertTune(ta0.text,pitch);//pivot);
}//end onclicked
}//end apply button
}//end page1control
////
GroupBox {
id:page2contol
visible:true
anchors.leftMargin: 10
anchors.topMargin: 10
Row{
Button{
id:restButton
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Rest")
onClicked: {
var sss="-1,Staff,0,Voice,0;";//1,8,60;
sss+=ndNumLabel.text;
sss+=",";
sss+=ndDenLabel.text;
sss+=",-1;";
console.log("Rest= ",sss);
pasteit(sss,0);
nextNote();
}//end on clicked
}//end restButton
Button{
id:noteButton
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Note")
onClicked: {
var sss="-1,Staff,0,Voice,0;";//1,8,60;
sss+=ndNumLabel.text;
sss+=",";
sss+=ndDenLabel.text;
sss+=",";
sss+=pitch;
sss+=";";
pasteit(sss,0);
nextNote();
}//end on clicked
}//end noteButton
Button{
id:chordButton
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Chord")
onClicked:{
var i;
var ichord,chordsx;
var chords=[];
var sss;
chordsx=chordType.model.get(chordType.currentIndex).note;
chordsx=chordsx.split(",");
for(i=0;i<chordsx.length;i++)
chords.push(parseInt(chordsx[i],10));
ichord=invertChord(chords,cib3Label.text);
sss="-1,Staff,0,Voice,0;";//1,8,60;
sss+=ndNumLabel.text;
sss+=",";
sss+=ndDenLabel.text;
for(i=0;i<ichord.length;i++){
sss+=",";
sss+=pitch+ichord[i];
}//next i
sss+=";";
pasteit(sss,0);
nextNote();
}//end on clicked
}//end chordButton
}//end row
}//end page2contol groupbox
////
GroupBox {
id:page3contol
visible:true
anchors.leftMargin: 10
anchors.topMargin: 10
Button{
id:scaleButton
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Scales")
onClicked: {
var sss="-1,Staff,0,Voice,0;";//msg header
var i;
var scale1,scale2;
var scale3=[];
var scale;
findSegment(0,0);
scale1=scaleType.model.get(scaleType.currentIndex).note;
console.log("Scale= ",scale1);
scale2=scale1.split(",");
for(i=0;i<scale2.length;i++)
scale3.push(parseInt(scale2[i],10));
scale=scale3;
if(scaledown.checked)scale=scale3.reverse();
for(i=0;i<scale.length;i++){
sss+=ndNumLabel.text;
sss+=",";
sss+=ndDenLabel.text;
sss+=",";
sss+=scale[i]-60+pitch;
sss+=";";
}//next i
sss+=":,";
pasteit(sss,0);
nextNote();
}//end on clicked
}//end restButton
}//end page3control groupbox
////
GroupBox {
id:page4contol
visible:true
anchors.leftMargin: 10
anchors.topMargin: 10
Row{
Button{
id:krestButton
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Rest")
onClicked: {
var sss="-1,Staff,0,Voice,0;";//1,8,60;
sss+=ndNumLabel.text;
sss+=",";
sss+=ndDenLabel.text;
sss+=",-1;";
console.log("Rest= ",sss);
kpaste(sss);
// pasteit(sss,0);
// nextNote();
}//end on clicked
}//end restButton
Button{
id:knoteButton
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Note")
onClicked: {
var sss="-1,Staff,0,Voice,0;";//1,8,60;
sss+=ndNumLabel.text;
sss+=",";
sss+=ndDenLabel.text;
sss+=",";
sss+=pitch;
sss+=";";
kpaste(sss);
// pasteit(sss,0);
// nextNote();
}//end on clicked
}//end noteButton
Button{
id:kchordButton
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Chord")
onClicked:{
var i;
var ichord,chordsx;
var chords=[];
var sss;
chordsx=chordType.model.get(chordType.currentIndex).note;
chordsx=chordsx.split(",");
for(i=0;i<chordsx.length;i++)
chords.push(parseInt(chordsx[i],10));
ichord=invertChord(chords,cib3Label.text);
sss="-1,Staff,0,Voice,0;";//1,8,60;
sss+=ndNumLabel.text;
sss+=",";
sss+=ndDenLabel.text;
for(i=0;i<ichord.length;i++){
sss+=",";
sss+=pitch+ichord[i];
}//next i
sss+=";";
kpaste(sss);
// pasteit(sss,0);
// nextNote();
}//end on clicked
}//end chordButton
}//end row
}//end page4contol groupbox
////
GroupBox {
id:page5contol
visible:true
anchors.leftMargin: 10
anchors.topMargin: 10
Row{
Button{
id:kcopy0tButton
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Copy 0")
onClicked: {
if (typeof curScore === 'undefined') return;
findSegment(0,0); //(voice,staff)
copyFromSelection(ta0);//.text);
findSegment(0,0); //(voice,staff)
}//end on clicked
}//end kcopy0tButton
Button{
id:kcopy1tButton
anchors.leftMargin: 10
anchors.topMargin: 10
text: qsTranslate("PrefsDialogBase", "Copy 1")
onClicked: {
if (typeof curScore === 'undefined') return;
findSegment(0,0); //(voice,staff)
copyFromSelection(ta1);//.text);
findSegment(0,0); //(voice,staff)
}//end on clicked