10 REM -- PRESSURE DISTRIBUTION IN FLUTE -- ALL LOSSES 20 REM SET FOR 29.4 DEGREE WAVELENGTH, 185 MOUTH HOLE 30 REM AND CONN DIMENSIONS. 40 CLEAR : SCREEN 11: KEY OFF 50 PRINT "ENTER DESIRED FINGERING ON LINES 100 - 130" 60 PRINT "USE 0 FOR OPEN HOLE, 1 FOR CLOSED, 2 FOR NON-EXISTENT" 70 PRINT : PRINT 80 DIM A$(19), V(180), ACT(180), PWRFLO(180) 90 DATA TR1,TR2,C#,C#,C,B,A#,A,G#1,G#2,G,F#,F,E,D#,D,C#,C,B 100 PRINT " A G# D#" 110 PRINT " C# C# B A# G F# F E D C# C B" 120 PRINT " TR1 TR2 C G# " 130 DATA 1, 1, 1, 2, 1, 1, 1, 0 ,1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 140 FOR K = 1 TO 19: READ A$(K): NEXT K 150 DIM B(19) 160 FOR K = 1 TO 19: READ B(K): NEXT K 170 PRINT " "; 180 FOR K = 1 TO 19: PRINT B(K); : NEXT K 190 PRINT : PRINT 200 INPUT "NOTE NAME FOR ABOVE FINGERING"; D$ 210 GOSUB 1640 220 INPUT "DO YOU WANT (1) THIS OR (2) ANOTHER FREQUENCY"; CH 230 IF CH = 1 THEN 270 240 IF CH = 2 THEN 260 250 GOTO 220 260 INPUT "FREQUENCY WANTED"; F 262 GOSUB 1800 270 PI = 3.141593: W = 2 * PI / L 280 EX = .00268 / L ^ .5: REM LOSS COEFFICIENT ALPHA 290 DIM C(21, 3): REM INCLUDES 0 COLUUMN 300 FOR K = 0 TO 19 310 FOR P = 0 TO 3 320 READ C(K, P) 330 NEXT P, K 335 DM = -C(0, 0) 500 REM ** THESE KEY DATA FOR WIMBERLY BENNETT SCALE 505 REM * POS. H A B 510 DATA -383.0,50, 0, 0 520 DATA -129.6,51,.22,.12: 'TR1 530 DATA -113.8,51,.22,.12: 'TR2 540 DATA -96,58,.26,.14 : 'C# VENT 550 DATA -82.6,1E5,0,0 : 'C# EXTRA 560 DATA -63.7,22.6,.7,.4 : 'C THUMB 570 DATA -44,24.3,.7,.4 : 'B 580 DATA -22,21.3,1.2,.6 : 'B FLAT 590 DATA 0,21.3,1.2,.6 : 'A REFERENCE POSITION 600 DATA 21.6,24.3,.7,.4 : 'G# BACK 610 DATA 22.1,25.5,.7,.4 : 'G# TOP 620 DATA 45.6,22.8,1,.5 : 'G 630 DATA 72,19.8,1.5,.7 : 'F# 640 DATA 100.,19.8,1.5,.7 : 'F 650 DATA 128.9,19.8,1.5,.7: 'E 660 DATA 158.8,17.9,1.4,.8: 'D SHARP 670 DATA 192.3,17.9,1.4,.8: 'D 680 DATA 225.8,17.9,1.4,.8: 'C# 690 DATA 262.0,17.9,1.4,.8: 'C (FOR END USE H=5.8, A AND B =0) 700 DATA 307.7,5.8,0,0 : 'B END (FOR C FOOT USE H=1E5) 800 B(0) = 0 830 INPUT "DO YOU WANT TO REVIEW PARAMETERS (Y OR N)"; F$ 840 IF F$ = "N" THEN 880 850 IF F$ = "Y" GOTO 1560 860 GOTO 830 880 CLS 890 PRINT "WAVELENGTH="; L; " MM" 900 LOCATE 25, 1: PRINT "DIST REFL. R ANGLE ENGY STD PWR FLOW PRESSURE" 910 PRINT 920 I = 19 930 IF B(I) = 2 THEN I = I - 1: GOTO 930 940 DN = C(I, 0) 950 R = 1: ANG = PI: 'r is magnitude and ang is angle of reflection coefficient 960 GOSUB 1470: REM--GETS END EFFECT AND STARTS AT X=0 970 VR = 1: V(0) = V 980 REM PRINT X, R, ANG, ACT(X / 10), V(0) 990 IF B(I) = 1 THEN KL$ = "CLOSED": GOTO 1010 1000 IF B(I) = 0 THEN KL$ = "OPEN" 1010 REM USING "###.#"; DN - C(I, 0); : PRINT TAB(14); A$(I); TAB(20); KL$; ","; TAB(28); "ANGLE = "; ANG * 57.296; TAB(50); "REFL ="; R 1020 I = I - 1 1030 IF I < 0 GOTO 1050 1040 IF DN - C(I, 0) < INT(X + 10) THEN 1150 1050 T = X: X = 10 * INT(X / 10 + 1): IN = X - T: 'Increment of distance 1060 IF X > 690 GOTO 1230 1070 GOSUB 1390 1080 X = INT(X + .001) 1090 EN = EXP(EX * X) * VR: 'EN IS THE PRESSURE OF THE DOWNGOING WAVE 1100 V(X / 10) = V * EN: 'PRESSURE AT POINT X 1110 ACT(X / 10) = EN ^ 2 * (1 + R ^ 2): 'STORED ENERGY DENSITY 1120 PWRFLO(X / 10) = EN ^ 2 * (1 - R ^ 2): 'NET DOWNWARD FLOW OF POWER 1130 REM PRINT X; TAB(8); R; TAB(24); ANG * 57.296; TAB(36); ACT(X / 10); TAB(48); PWRFLO(X /10); TAB(60); V(X /10) 1140 IF I > -.5 GOTO 1040 ELSE GOTO 1050 1150 IF B(I) = 2 THEN I = I - 1: GOTO 1040 1160 IN = DN - C(I, 0) - X: X = X + IN 1170 GOSUB 1390 1180 IF B(I) = 1 THEN DX = (C(I, 2) - C(I, 3)) / 2 - (C(I, 2) + C(I, 3)) / 2 * COS(ANG): ANG = ANG + 2 * W * DX: R = R * (1 - 2 * EX * DX): GOTO 990 1190 V1 = V 1200 GOSUB 1470 1210 VR = V1 / V * VR 1220 GOTO 990 1230 REM- GETS MAXIMA FOR NORMALIZATION 1240 FOR N = 0 TO 70 1250 IF V(N) > VM THEN VM = V(N) 1262 IF ACT(N) > ACTM THEN ACTM = ACT(N) 1264 IF PWRFLO(N) > PWRM THEN PWRM = PWRFLO(N) 1260 NEXT N 1270 PRINT "DO YOU WANT TO:" 1280 PRINT " (1) SEE NORMALIZED PRESSURES" 1290 PRINT " (2) DISPLAY GRAPH OF PRESSURE" 1295 PRINT " (3) DISPLAY GRAPH OF STORED ENERGY" 1300 PRINT " (4) DISPLAY GRAPH OF POWER FLOW" 1305 PRINT " (5) TRY ANOTHER FREQUENCY" 1310 INPUT "WHICH"; CA 1320 ON CA GOTO 1330, 1832, 2170, 3000, 40 1330 LOCATE 25, 1: PRINT STRING$(80, " ") 1340 FOR J = 0 TO 19 1350 PRINT TAB(1); 10 * J; TAB(6); V(J) / VM; TAB(21); 10 * (J + 20); TAB(26); V(J + 20) / VM; 1360 PRINT TAB(41); 10 * (J + 40); TAB(46); V(J + 40) / VM; TAB(61); 10 * (J + 60); TAB(66); V(J + 60) / VM 1370 NEXT J 1380 INPUT "READY"; REDY: GOTO 1270 1390 REM -- CHANGE OF ANGLE 1400 ANG = ANG + 2 * IN * W 1410 R = R * (1 - 2 * EX * IN) 1420 D2 = 1 + R ^ 2 - 2 * R * COS(ANG) 1430 G = (1 - R ^ 2) / D2 1440 B = -2 * R * SIN(ANG) / D2 1450 V = SQR(D2) 1460 RETURN 1470 REM -- OPEN KEY EFFECT 1480 G = G + 14.32 / C(I, 1) ^ 2: 'TWICE radiation loss for bore diam 10.7mm -allows roughly for viscous and interaction 1490 B = B - 1 / W / C(I, 1) 1500 R = SQR((B ^ 2 + (1 - G) ^ 2) / (B ^ 2 + (1 + G) ^ 2)) 1510 DE = 1 - B ^ 2 - G ^ 2 1520 ANG = ATN(2 * B / DE) 1530 IF DE > 0 THEN ANG = ANG + PI 1540 V = SQR(1 + R ^ 2 - 2 * R * COS(ANG)): 'pressure in bore at this X 1550 RETURN 1560 PRINT TAB(5); "KEY"; TAB(11); "POSITION"; TAB(23); "H"; TAB(31); "A"; 1570 PRINT TAB(39); "B": PRINT 1580 FOR K = 1 TO 19 1590 PRINT TAB(5); A$(K); 1600 PRINT TAB(15); C(K, 0); TAB(23); C(K, 1); TAB(31); C(K, 2); TAB(39); C(K, 3) 1610 NEXT K 1620 PRINT "DISTANCE FROM A-HOLE TO MOUTH END ="; DM: INPUT "READY"; RDY: GOTO 880 1630 INPUT "NOTE"; D$ 1640 B$ = LEFT$(D$, 1) 1650 Q = ASC(B$) 1660 IF Q > 71 OR Q < 65 GOTO 200 1670 ON (Q - 64) GOTO 1680, 1690, 1700, 1710, 1720, 1730, 1740 1680 AN = 9: GOTO 1750 1690 AN = 11: GOTO 1750 1700 AN = 0: GOTO 1750 1710 AN = 2: GOTO 1750 1720 AN = 4: GOTO 1750 1730 AN = 5: GOTO 1750 1740 AN = 7: GOTO 1750 1750 IF MID$(D$, 2, 1) = "#" THEN BN = AN + 1 ELSE BN = AN 1760 CN$ = RIGHT$(D$, 1) 1770 CN = VAL(CN$) 1780 FL = 100 * (12 * CN + BN) 1790 F = 16.3516 * 2 ^ (FL / 1200) 1800 L = 346000! * (1 - .165 / F ^ .5) / F: REM WAVELENGTH ABOUT 74 DEG F. 1810 REM FOR 80 DEGREE F WAVELENGTH USE 348500 1820 PRINT "FREQUENCY="; F; " TUBE WAVELENGTH="; L 1830 RETURN 1832 CLS : PRINT TAB(25); "PRESSURE FOR NOTE "; D$; " WAVELENGTH "; L; 1834 WINDOW (-10, -.2)-(700, 1.1) 1836 FOR X = 0 TO 700 STEP 10 1838 PSET (690 - X, V(X / 10) / VM) 1840 NEXT X 1880 LINE (-10, 0)-(700, 0) 1890 FOR K = 1 TO 19 1892 IF B(K) <> 0 THEN GOTO 1897 1894 COR = 690 - DN + C(K, 0) 1896 LINE (COR, 0)-(COR, -.05): LOCATE 28, (COR + 9) / 8.9 + 1: PRINT A$(K); 1897 NEXT K 1898 LINE (690 - DN - DM, 0)-(690 - DN - DM, 1) 1900 IK$ = INKEY$: IF IK$ = "" GOTO 1900 1910 GOTO 1270 1920 REM START GRAPH PRINTOUT ************** 1930 LPRINT CHR$(27); "x4": REM TURNS IBM OFF 1940 LPRINT CHR$(30) 1950 LPRINT "NOTE FINGERED :"; D$; " WAVELENGTH USED="; L; "MM" 1960 LPRINT " A G# D# " 1970 LPRINT " C# C# B A# G F# F E D C# C B" 1980 LPRINT " TR1 TR2 C G#' " 1990 LPRINT " "; 2000 FOR K = 1 TO 19: LPRINT B(K); : NEXT K 2010 LPRINT : LPRINT 2020 FOR X4 = 700 TO 0 STEP -10 2030 Y4 = INT(220 * V(X4 / 10) / VM + .5) 2040 LPRINT USING "###"; X4; : LPRINT " "; CHR$(156); 2050 LPRINT CHR$(8); 2060 T4 = INT(Y4 / 6): REM TAB NO. 2070 Z4 = Y4 - 6 * T4: REM REMAINDER 2080 LPRINT STRING$(T4, " "); 2090 LPRINT CHR$(27); "K"; CHR$(Z4 + 1); CHR$(8); : REM KICKS IN GRAPHICS FOR Z4+1 ELEMENTS 2100 IF Z4 = 0 THEN GOTO 2120 2110 FOR N = 1 TO Z4: LPRINT CHR$(0); : NEXT N 2120 LPRINT CHR$(56); : REM PRINTS DOTS 8, 16, & 32 TO MAKE MARK 2130 LPRINT TAB(50); V(X4 / 10) / VM 2140 NEXT X4 2150 LPRINT CHR$(27); "@" 2160 GOTO 1270 2170 REM GRAPH OF STORED ENERGY 2832 CLS : PRINT TAB(15); "STORED ENERGY DENSITY FOR NOTE "; D$; ", WAVELENGTH ="; L 2834 WINDOW (-10, -.2)-(700, 1.1) 2836 FOR X = 0 TO 700 STEP 10 2838 PSET (690 - X, ACT(X / 10) / ACTM) 2840 NEXT X 2880 LINE (-10, 0)-(700, 0) 2890 FOR K = 1 TO 19 2892 IF B(K) <> 0 THEN GOTO 1897 2894 COR = 690 - DN + C(K, 0) 2896 LINE (COR, 0)-(COR, -.05): LOCATE 28, (COR + 9) / 8.9 + 1: PRINT A$(K); 2897 NEXT K 2898 LINE (690 - DN - DM, 0)-(690 - DN - DM, 1) 2900 IK$ = INKEY$: IF IK$ = "" GOTO 1900 3000 REM GRAPH OF POWER FLOW 3010 CLS : PRINT TAB(25); "POWER FLOW ALONG TUBE FOR "; D$; " WAVELENGTH "; L; 3020 WINDOW (-10, -.2)-(700, 1.1) 3030 FOR X = 0 TO 700 STEP 10 3040 PSET (690 - X, PWRFLO(X / 10) / PWRM) 3050 NEXT X 3060 LINE (-10, 0)-(700, 0) 3070 FOR K = 1 TO 19 3080 IF B(K) <> 0 THEN GOTO 3110 3090 COR = 690 - DN + C(K, 0) 3100 LINE (COR, 0)-(COR, -.05): LOCATE 28, (COR + 9) / 8.9 + 1: PRINT A$(K); 3110 NEXT K 3120 LINE (690 - DN - DM, 0)-(690 - DN - DM, 1) 3122 FOR K = 1 TO 19 3124 IF B(K) <> 0 THEN GOTO 3128 3128 NEXT K 3130 IK$ = INKEY$: IF IK$ = "" GOTO 1900