OrganProject

Check-in [d386cb24e6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Completed stop list in the menus
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d386cb24e6be547ad8503a0c1da9e79535cd5c7b
User & Date: 200002852 2009-08-19 23:44:40
Context
2009-08-20
03:42
Added wavetables and quick presets check-in: 9970a88933 user: 200002852 tags: trunk
2009-08-19
23:44
Completed stop list in the menus check-in: d386cb24e6 user: 200002852 tags: trunk
22:01
Cleaned up the menu construction code a little bit. check-in: 4a81302b24 user: 200002852 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to terminal/makeMenus.tcl.

91
92
93
94
95
96
97







98
99
100
101
102
103
104
...
257
258
259
260
261
262
263




















































264
265
266
267
268
269
270
...
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
...
393
394
395
396
397
398
399

400
401
402
403
404
405
406
    set cname [string map {
	{ 2/3} TWOTHIRDS { 3/5} THREEFIFTHS { 1/3} ONETHIRD
	{ 1/7} ONESEVENTH
    } $cname]
    regsub -all {[^[:alnum:]]} $cname _ cname
    set cname STOP_[string toupper $cname]
    dict set stopCNames $cname {}







    return $cname
}
 
#------------------------------------------------------------------------------
#
# makeMenu --
#
................................................................................
	makeMenu $menuName stopMenuHandler $flags $back \
	    $line1 $line2 $line3 {*}$keys
    }
}
 
#------------------------------------------------------------------------------
#




















































# indent --
#
#	Emit the C code.
#
# Parameters:
#	CFile - Channel where the C code should be written
#	lines - Lines of text to write
................................................................................
    {}
}

selectionMenu flueMenu programMenu \
    "1:8'   2:4'   3:2 2/3'" \
    "4:2'   5:1 3/5' 6:1 1/3'" \
    "7:1 1/7' 8:1'   9: <1'" \
    1 flue8Menu









selectionMenu flue8Menu flueMenu {*}{
    {1:String}
    {2:Principal}
    {3:Flute}
    1 string8Menu


}

stopMenu string8Menu flue8Menu {*}{
    {Aeoline 8' A}
    {Aeoline 8' B}
    {Echo String 8'}
    {Gamba 8'}
................................................................................
    {Geigen Diapason 8'}
    {Gemshorn Harmonic}
    {Viole d'Orch. 8' *}
    {Viole d'Orchestre}
    {Violin 8'}
}































































































alphabeticalMenu reedMenu programMenu {*}{





































































}

selectionMenu mixtMenu programMenu {*}{
    {1:Carillon  2:Cornet}
    {3:Mixture   4:Others}
    {}
    1 carillonMenu 2 cornetMenu 3 mixtureMenu 4 mixtOtherMenu
................................................................................
# Write the literal pool

puts $CFile "/* String literals */"
puts $CFile ""
dict for {val slot} $stringIndex {
    set val [string map {
	{ 2/3} \\2\\4 { 3/5} \\3\\5 { 1/3} \\1\\4 { 1/7} \\1\\7

    } $val]
    # TODO - Look up 
    puts $CFile "static const char S$slot\[\] PROGMEM = \"$val\";"
}

# Write the menu declarations








>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|
>
>
>
>
>
>
>
>






>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
...
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
...
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
...
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
    set cname [string map {
	{ 2/3} TWOTHIRDS { 3/5} THREEFIFTHS { 1/3} ONETHIRD
	{ 1/7} ONESEVENTH
    } $cname]
    regsub -all {[^[:alnum:]]} $cname _ cname
    set cname STOP_[string toupper $cname]
    dict set stopCNames $cname {}
    set shorter [string map {
	{ 2/3} \2\4 { 3/5} \3\5 { 1/3} \1\4 { 1/7} \1\7
	Oboe Oboe oe \xef
    } $stopName]
    if {[string length $shorter] > 18} {
	puts "$stopName: name too long?"
    }
    return $cname
}
 
#------------------------------------------------------------------------------
#
# makeMenu --
#
................................................................................
	makeMenu $menuName stopMenuHandler $flags $back \
	    $line1 $line2 $line3 {*}$keys
    }
}
 
#------------------------------------------------------------------------------
#
# alphabeticalStopMenu --
#
#	Make a hierarchical menu for stops too numerous to enumerate
#	in a scrolling list. Use telephone keypad selections
#	to break out the stops.
#
# Parameters:
#	name - Name of the menu
#	back - Parent menu; where the 'Back' button should go.
#	args - Names of the available stops from this menu
#
#------------------------------------------------------------------------------

proc alphabeticalStopMenu {name back args} {
    set kp {}
    set vector [lrepeat 10 {}]
    foreach {key chars} {
		2 abc	3 def
	4 ghi	5 jkl	6 mno
	7 pqrs  8 tuv	9 wxyz
    } {
	foreach ch [split $chars {}] {
	    dict set kp $ch $key
	}
    }
    foreach stop $args {
	set c1 [string tolower [string index $stop 0]]
	if {[dict exists $kp $c1]} {
	    set ind [dict get $kp $c1]
	} else {
	    set ind 1
	}
	set l [lindex $vector $ind]
	lappend l $stop
	lset vector $ind $l
    }
    set dispatch {}
    for {set key 0} {$key < 10} {incr key} {
	if {[llength [lindex $vector $key]] > 0} {
	    lappend dispatch $key $name$key
	}
    }
    alphabeticalMenu $name $back {*}$dispatch
    for {set key 0} {$key < 10} {incr key} {
	if {[llength [lindex $vector $key]] > 0} {
	    stopMenu $name$key $name {*}[lindex $vector $key]
	}
    }
}
# 
#------------------------------------------------------------------------------
#
# indent --
#
#	Emit the C code.
#
# Parameters:
#	CFile - Channel where the C code should be written
#	lines - Lines of text to write
................................................................................
    {}
}

selectionMenu flueMenu programMenu \
    "1:8'   2:4'   3:2 2/3'" \
    "4:2'   5:1 3/5' 6:1 1/3'" \
    "7:1 1/7' 8:1'   9: <1'" \
    1 flue8Menu \
    2 flue4Menu \
    3 flue223Menu \
    4 flue2Menu \
    5 flue135Menu \
    6 flue113Menu \
    7 flue117Menu \
    8 flue1Menu \
    9 flue0Menu

selectionMenu flue8Menu flueMenu {*}{
    {1:String}
    {2:Principal}
    {3:Flute}
    1 string8Menu
    2 principal8Menu
    3 flute8Menu
}

stopMenu string8Menu flue8Menu {*}{
    {Aeoline 8' A}
    {Aeoline 8' B}
    {Echo String 8'}
    {Gamba 8'}
................................................................................
    {Geigen Diapason 8'}
    {Gemshorn Harmonic}
    {Viole d'Orch. 8' *}
    {Viole d'Orchestre}
    {Violin 8'}
}

stopMenu principal8Menu flue8Menu {*}{
    {Cornopean 8' A}
    {Cornopean 8' B}
    {Diapason 8'}
    {Dulciana 8'}
    {Horn Diapason 8'}
    {Phonon Diapason 8'}
    {Principal (Harm)}
    {Principal 8' A}
    {Principal 8' B}
    {Principal Bright}
}

alphabeticalStopMenu flute8Menu flue8Menu {*}{
    {Allen Sound 8'}
    {Blockfloete 8'}
    {Blockfloete 8' B}
    {Chrysoglott}
    {Concert Flute}
    {Flute&Soft String}
    {Flute 8'}
    {Flute 8'&Fife 1/2'}
    {Flute Dolce 8' A}
    {Flute Dolce 8' B}
    {Flute Harm 8' A}
    {Flute Harm 8' B}
    {Gedeckt No. 2 8'}
    {Harmonic Flute 8'}
    {Klein Gedeckt 8'}
    {Koppelfloete 8' A}
    {Koppelfloete 8' B}
    {Open Flute 8' *}
    {Quintade F 8'}
    {Quintade P 8'}
    {Quintaden 8'}
    {Quintaden No. 2 8'}
    {Quintaden No. 3 8'}
    {Quintadena P 8'}
    {Quintadena PP 8'}
    {Rohrfloete 8'}
    {Rohrfloete P 8'}
    {Stopped Flute 8' *}
}

stopMenu flue4Menu flueMenu {*}{
    {Flute 4'}
    {Flute F 4'}
    {Flute P 4'}
    {Quintadena 4'}
    {Quintadena P 4'}
    {Rohrfloete P 4'}
    {Salicet 4'}
    {Salizional 4'}
}

stopMenu flue223Menu flueMenu {*}{
    {Flute 2 2/3'}
    {Quinte 2 2/3'}
}

stopMenu flue2Menu flueMenu {*}{
    {Doublette 2'}
    {Blockfloete 2'}
    {Flute 2' F}
    {Flute 2' P}
}

stopMenu flue135Menu flueMenu {*}{
    {Flute 1 3/5' P}
}

stopMenu flue113Menu flueMenu {*}{
    {Flute 1 1/3'}
    {Larigot No. 1 1 1/3'}
    {Larigot No. 2 1 1/3'}
}

stopMenu flue117Menu flueMenu {*}{
    {Septieme 1 1/7'}
    {Septieme Diss. 1 1/7}
}

stopMenu flue1Menu flueMenu {*}{
    {Fife 1'}
    {Fife Harmonic 1'}
}

stopMenu flue0Menu flueMenu {*}{
    {Flute 23rd 8/9'}
    {Flute 24th 4/5'}
    {Flute 25th 8/11'}
    {Flute 29th}
}

alphabeticalStopMenu reedMenu programMenu {*}{
    {Barpfeife No. 1 8'}
    {Barpfeife No. 2 8'}
    {Bassoon 8' A}
    {Bassoon 8' B}
    {Bombarde 8'}
    {Chorus Reed}
    {Clarinet 8'}
    {Clarinet Harmonic}
    {Clarinet Metal MF}
    {Clarinet Metal F}
    {Clarinet Wood}
    {Clarion Harm 4'}
    {Classic Reed No. 1}
    {Cornet 8'}
    {Cornopean 8' A}
    {Cornopean 8' B}
    {Cromorne 8'}
    {Dulzian 8'}
    {Echo Horn 8'}
    {English Horn 8'}
    {English Post Horn}
    {Festival Trumpet}
    {French Horn #1 8'}
    {French Horn #2 8'}
    {French Horn #3 8'}
    {Harm Trumpet 8'}
    {Horn 8'}
    {Kinura No. 1 8'}
    {Kinura No. 2 8'}
    {Krumet 8'}
    {Krummhorn Harm 8'}
    {Krummhorn No. 1 8'}
    {Krummhorn No. 2 8'}
    {Krummregal 8'}
    {Musette 8'}
    {Oboe Horn 8'}
    {Orch. Oboe 8'}
    {Orch. Schalmei 8'}
    {Orch. Tuba 8'}
    {Petit Rankett 8'}
    {Posaune 8'}
    {Post Horn 8'}
    {Rankett 8' A}
    {Rankett 8' B}
    {Reed Chorus 8'&4'}
    {Reed Extender}
    {Reed Harm Bright}
    {Reed Harm Medium}
    {Regal 8'}
    {Saxophone 8'}
    {Sine Chorus A}
    {Sine Chorus B}
    {Singend Regal #1}
    {Singend Regal #2}
    {Singend Regal #3}
    {Solo Reed}
    {Spanish Trumpet 8'}
    {Stereo Reed Even}
    {Stereo Reed Odd}
    {Tenor Saxophone 8'}
    {Trompette 8' A}
    {Trompette 8' B}
    {Trompette Harm #1}
    {Trompette Harm #2}
    {Trumpet 8'}
    {Tuba 8'}
    {Voix Humaine 8' A}
    {Voix Humaine 8' B}
    {Waldhorn 8'}
}

selectionMenu mixtMenu programMenu {*}{
    {1:Carillon  2:Cornet}
    {3:Mixture   4:Others}
    {}
    1 carillonMenu 2 cornetMenu 3 mixtureMenu 4 mixtOtherMenu
................................................................................
# Write the literal pool

puts $CFile "/* String literals */"
puts $CFile ""
dict for {val slot} $stringIndex {
    set val [string map {
	{ 2/3} \\2\\4 { 3/5} \\3\\5 { 1/3} \\1\\4 { 1/7} \\1\\7
	Oboe Oboe oe \\xef\"\"
    } $val]
    # TODO - Look up 
    puts $CFile "static const char S$slot\[\] PROGMEM = \"$val\";"
}

# Write the menu declarations