Wind Chimes calculates the physical dimensions needed to tune wind chime elements to a desired frequency. Given the material, cross-sectional shape, and dimensions of the chime, it computes the required length using acoustic physics formulas and also outputs the optimal suspension drill point (at 22.42% of the length, the nodal point for the fundamental mode). For cylindrical tubes, it additionally calculates the Helmholtz-style air column resonance frequency. The program supports three shapes — circular rod, rectangular bar, and hollow cylinder — with material-dependent speed-of-sound constants stored in a two-element array.
Program Structure
The program is a linear, menu-driven calculator that proceeds through a series of prompts before computing results. There is no main loop returning to a top-level menu; instead, after displaying results, GO TO 290 at line 380 re-prompts for a new frequency, allowing the user to explore different pitches for the same material, shape, and dimensions without re-entering all parameters.
- Lines 10–50: Initialization — set display offset
n=4and load material speed constants into arrays(2). - Lines 60–90: Material selection menu (Aluminum/Steel/Glass vs. Brass/Copper), input stored in
m. - Lines 110–150: Shape selection menu (rod, bar, cylinder), input stored in
s, overwriting the array variable. - Lines 170–280: Dimension input and computation of the radius-of-gyration factor
kin centimeters. - Lines 290–380: Frequency input, length computation, drill-point output, and optional air-resonance output for cylinders.
Acoustic Physics
The core formula at line 320 is derived from the Euler-Bernoulli beam vibration equation. The length l is computed as:
l = SQR(1.133 * PI * k * s(m) / f) / 2.54
Here k is the radius of gyration (in cm), s(m) is the longitudinal speed of sound for the material (in cm/s), and f is the desired frequency in Hz. The factor 1.133 encapsulates the mode-shape constant for a free-free bar. The result is divided by 2.54 to convert from centimeters to inches.
The radius of gyration k is calculated differently per shape:
- Circular rod:
k = d/4 * 2.54— diameter divided by 4 gives radius of gyration for a solid circle, then converted to cm. - Rectangular bar:
k = d/SQR(12) * 2.54— thickness divided by √12, the standard formula for a rectangle’s radius of gyration about its neutral axis. - Hollow cylinder:
k = SQR(d*d + (d-t)*(d-t)) / 4 * 2.54— an approximation using outer diameterdand wall thicknesst.
The drill point at line 340 is fixed at 22.42% of the length, corresponding to the nodal points of the fundamental transverse vibration mode of a free-free bar, where a suspension hole causes minimal damping.
The air resonance formula at line 370, 3390 / (l + 0.29*d), approximates the fundamental resonance of an open cylinder using the speed of sound in air (≈ 13,390 inches/s, since l is in inches), with an end correction of 0.29*d.
Variable Name Collision
A notable anomaly is that the array s(2) declared and populated in lines 30–50 shares its name with the scalar variable s used from line 150 onward to hold the shape choice. In most Sinclair BASICs, a numeric array DIM s(2) and a simple variable s are stored separately and do not conflict, so this works correctly. However, after the INPUT s at line 150, the expression s(m) at line 320 still correctly indexes the array. This dual use of the identifier s is legal but could confuse a reader.
Display Technique
Lines 100 and 160 use PRINT AT to place inverse-video arrow markers (>) on the screen alongside the current menu selection, providing a simple visual indicator. The offset variable n=4 aligns the markers with the printed menu items. This is a lightweight substitute for a proper highlight-bar mechanism.
Material Constants
| Index | Material | s(m) value (cm/s) |
|---|---|---|
| 1 | Aluminum / Steel / Glass | 500,000 |
| 2 | Brass / Copper | 330,000 |
These values approximate the longitudinal speed of sound in the respective metals, which governs the stiffness-to-mass ratio and hence the vibration frequency of the bar.
Source Code
10 REM \{20}\{1}>> Wind Chimes <<\{20}\{0} by Carter Scholz \* Sync, N/D 1983
20 LET n=4
30 DIM s(2)
40 LET s(1)=5e5
50 LET s(2)=3.3e5
60 PRINT "MATERIAL?"
70 PRINT "1. Aluminum/Steel/Glass"
80 PRINT "2. Brass/Copper"
90 INPUT m
100 PRINT AT m,0;"\{20}\{1}>\{20}\{0}"; AT n,0;
110 PRINT "SHAPE?"
120 PRINT "1. Circular (ROD)"
130 PRINT "2. Rectangular (BAR)"
140 PRINT "3. Cylindrical"
150 INPUT s
160 PRINT AT s+n,0;"\{20}\{1}>\{20}\{0}"; AT 9,0;
170 IF s <>2 THEN PRINT "DIAMETER? ";
180 IF s=2 THEN PRINT "THICKNESS OF BAR? ";
190 INPUT d
200 PRINT d
210 LET k=d/4*2.54
220 IF s=1 THEN GO TO 290
230 LET k=d/ SQR 12*2.54
240 IF s=2 THEN GO TO 290
250 PRINT "THICKNESS OF CYLINDER? ";
260 INPUT t
270 PRINT t,
280 LET k= SQR (d*d+(d-t)*(d-t))/4*2.54
290 PRINT AT 12,0;"FREQUENCY? ";
300 INPUT "FREQUENCY? ";f
310 PRINT f,
320 LET l= SQR (1.133* PI*k*s(m)/f)/2.54
330 PRINT '"LENGTH=";l;" inches",
340 PRINT "DRILL AT ";l*.2242;" inches",
350 IF s <>3 THEN GO TO 290
360 PRINT "AIR RESONANCE AT MULTIPLES OF ",
370 PRINT 3390/(l+.29*d);" HZ",
380 GO TO 290
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.
