Wind Chimes and eTCL Slot Calculator Demo Example, numerical analysis

Wind Chimes and eTCL Slot Calculator Demo Example

This page is under development. Comments are welcome, but please load any comments in the comments section at the bottom of the page. Please include your wiki MONIKER and date in your comment with the same courtesy that I will give you. Aside from your courtesy, your wiki MONIKER and date as a signature and minimal good faith of any internet post are the rules of this TCL-WIKI. Its very hard to reply reasonably without some background of the correspondent on his WIKI bio page. Thanks, gold 12Dec2018



Preface

gold Here are some calculations on tube lengths for pentatonic wind chimes from scrap materials. The impetus for these calculations was finding some scrap iron and bamboo on the roadside. Most of the testcases involve replicas or models, using assumptions and rules of thumb.


Introduction

The eTCL calculator is estimating a pentatonic set from a master length that sounds pleasing. In pseudocode, each new length L1 is [/ $length0 [ expr { pow([N1/N2],0.5) } ], where length0 is the master chime 1, N1&N2 are integers and N1 > N2.


Pentatonic Wind Chimes

Here is a design for pentatonic wind chimes. Pentatonic is a fancy name for five tones. However, additional chimes beyond five could be designed from the same scheme, using the calculator. Find a length of pipe or metal bar that gives a pleasing tone for the master chime. The master chime 1 would be the lowest tone and longest section of pipe. Any lesser cuts like chimes 2,3,4,&5 would be higher pitch. As a check or experimentation on the calculator, the user can recalculate the chimes 2,3,4,&5 using the formula values listed in the calculation subroutine. Although not necessary for the final design of pentatonic chimes, the alternate chime 1b and other alternate chimes are calculated also from integers N1 and N1.


The chime 1b is calculated from the master chime 1 length and conditions of N1=2 and N2=1 as the expected higher tone limit or upper boundary limit of the set, to avoid overlapping a second set of chimes. The entries of N1 & N2 are usually positive integers with condition N1 > N2, but the calculator will accept N1 & N2 as any positive and real numbers with decimal points. Using the N1&N2 variables, the user on the calculator can design alternate <+-> offset chimes or "sharp notes" with respect to chimes 2,3,4,&5.


Homebrew Chimes from Copper Pipe

Normally, soft metal chimes are attached and hung at approximately 2/9 length and struck at 1/2 length with a soft wood mallet. An initial cut for copper pipe was 15 & 15/16 inches (D), 15 inches (E), 13 & 5/8 inches (G), 12 & 7/8 inches (A), and 12 inches (B), ref Kim Brown. If the pipe ends are going to be either undercut, diamonded, or closed, then a fudge of a little extra length and dimension of 0.75X diameter should be left on the copper pipe cuts. For shiny appearence on copper, the copper pipe can be cleaned with copper polish, or vinegar & salt, and then thinly painted with polyurethane varnish. The attachment string length of each pipe is offset for an individual strike point or knock point with a level wooden hammer disk. The published musical notes were given, but do not seem consistent with some formulas.


The chime_nuts tell me that an empty 30 gallon propane tank makes a really good tone. I painted several empty propane tanks with glowing red paint and hung them in the trees in the backyard of my chime_nut friend.


Conclusions

For the middle school students, the web pages on chimes would lead into a good science project.


Pseudocode and Equations

set chimex [[/ $length0 [[ expr { pow([[N1/N2]],0.5) } ]]   

Homebrew Copper Pipe Chimes

table : Homebrew Copper Pipe Chimes printed inTCL format
chime Number, musical note:length inch fractions length inch decimal inch strike pointlength centimeters(2.54X)
chime 1 (D), master length: 15&15/16 15.937 8 40.479
chime 2, (E) : 1515 7.538.1
chime 3, (G) : 13&5/813.6257.5 34.607
chime 4, (A) : 12&7/8 12.8756.5 32.702
chime 5, (B) : 12.12. 6.5 30.48

Testcases Section


In planning any software, it is advisable to gather a number of testcases to check the results of the program. The math for the testcases can be checked by pasting statements in the TCL console. Aside from the TCL calculator display, when one presses the report button on the calculator, one will have console show access to the capacity functions (subroutines).


Testcase 1

table printed inTCL WIKI format
testcase number: 1
chime 1, master length: 30.
chime N1 integer: 5.
chime N2 integer: 4.
alternate chime from N1/N2 centimeters: 26.8
chime 2, centimeters: 26.8
chime 3, centimeters: 25.9
chime 4, centimeters: 24.4
chime 5, centimeters: 23.7

Testcase 2

table printed inTCL WIKI format
testcase number: 2
chime 1, master length: 40.
chime N1 integer: 5.
chime N2 integer: 4.
alternate chime from N1/N2 centimeters: 35.7
chime 2, centimeters: 35.7
chime 3, centimeters: 34.6
chime 4, centimeters: 32.6
chime 5, centimeters: 31.6

Testcase 3

table printed inTCL WIKI format
testcase number: 3
chime 1, master length: 100.
chime N1 integer: 5.
chime N2 integer: 4.
alternate chime from N1/N2 centimeters: 89.4
chime 2, centimeters: 89.4
chime 3, centimeters: 86.6
chime 4, centimeters: 81.6
chime 5, centimeters: 79.0

Screenshots Section

figure 1.

Wind Chimes and eTCL Slot Calculator Demo Example screen.png


References:

  • google <wind chimes>
  • wikipedia search engine <wind chimes>
  • wikipedia search engine <Mathematics of tubular wind chimes>
  • Tips for Making Wind Chimes, internet article By Sally Painter
  • asee.org, designing-a-wind-chime.pdf
  • physics.missouri.edu,Physics_of_Wind_Chimes.pdf, really good monograph
  • Book, Wind Chimes: Design and Construction
  • Modal Synthesis of Wind Chime Sounds with Stochastic Methods
  • Make copper wind chimes by: Chica
  • Make your own wind chimes , from mtu.edu

Appendix Code

appendix TCL programs and scripts

        # pretty print from autoindent and ased editor
        # Wind Chime Calculator
        # written on Windows XP on eTCL
        # working under TCL version 8.5.6 and eTCL 1.0.1
        # gold on TCL WIKI , 14jun2014
        # comment follows from gold, 12Dec2018
        # pretty print from autoindent and ased editor
        # Wind Chime Calculator V2
        # written on Windows XP on TCL
        # working under TCL version 8.6
        # Revamping older program from 2014.
        package require Tk
        namespace path {::tcl::mathop ::tcl::mathfunc}
        frame .frame -relief flat -bg aquamarine4
        pack .frame -side top -fill y -anchor center
        set names {{} {chime 1, master length centimeters:} }
        lappend names {N1  integer:}
        lappend names {N2  integer: }
        lappend names {answers: alternate chime 1b from N1/N2 length, centimeters: }
        lappend names {chime 2, length centimeters}
        lappend names {chime 3, length centimeters:}
        lappend names {chime 4, length centimeters: }
        lappend names {chime 5, length centimeters: }
        foreach i {1 2 3 4 5 6 7 8} {
            label .frame.label$i -text [lindex $names $i] -anchor e
            entry .frame.entry$i -width 35 -textvariable side$i
            grid .frame.label$i .frame.entry$i -sticky ew -pady 2 -padx 1 }
        proc about {} {
            set msg "Calculator for Wind Chimes V2
            from TCL ,
            # gold on  TCL Club, 12Dec2018  "
            tk_messageBox -title "About" -message $msg }
        proc self_help {} {
            set msg " Wind Chime Calculator V2
            from TCL Club ,
            # self help listing
            # problem, Wind Chime Calculator V2
            # 3 givens follow.
            1) master length centimeters:
            2) N1  integer:
            3) N2  integer:
            # condition, N1 > N2 , N1&N2 usually integers
            # Design for pentatonic wind chimes.
            # Pentatonic is a fancy name for five tones,
            # but suppose that additional chimes could
            # be designed from the same scheme.
            # Find a length of pipe or metal bar that
            # gives a pleasing tone for the master chime.
            # The master chime 1 would be the lowest tone
            # and any lesser cuts for chimes 2,3,4,&5
            # would be higher pitch.
            # Although not necessary for final design,
            # the alternate chime 1b is calculated also
            # from integers N1 and N1. N1 & N2 are usually
            # integers, but the calculator will accept
            # N1 & N2 as real numbers (decimal points).
            # The chime 1b is calculated from conditions
            # of N1=2 and N2=1 as the expected higher tone
            # limit or upper boundary of the set, to
            # avoid overlapping a second set of chimes.
            # Using the N1&N2 variables one can
            # design alternate offset chimes or "sharp notes"
            # with respect to chimes 2,3,4,&5.
            # Recommended procedure is push testcase
            # and fill frame,
            # change first three entries etc, push solve,
            # and then push report.
            # Report allows copy and paste
            # from console to conventional texteditor.
            # For testcases, testcase number is internal
            # to the calculator and will not be printed
            # until the report button is pushed
            # for the current result numbers.
            # >>> copyright notice <<<
            # This posting, screenshots, and TCL source code is
            # copyrighted under the TCL/TK license terms.
            # Editorial rights and disclaimers
            # retained under the TCL/TK license terms
            # and will be defended as necessary in court.
            Conventional text editor formulas
            or  formulas grabbed from internet
            screens can be pasted into green console.
            # gold on  TCL Club, 12Dec2018 "
            tk_messageBox -title "Self_Help" -message $msg }
        proc calculate {     } {
            global side1 side2 side3 side4 side5
            global side6 side7 side8 testcase_number
            incr testcase_number
            set $side1 [* $side1 1. ]
            set $side2 [* $side2 1. ]
            set $side3 [* $side3 1. ]
            set $side4 [* $side4 1. ]
            set N1 $side2
            set N2 $side3
            set length0 $side1
            set term1 [/ 1. 2. ]
            set term2 [/ 5. 4. ]
            set term3 [/ 4. 3. ]
            set term4 [/ 3. 2. ]
            set term5 [/ 8. 5. ]
            set term7 [/ $N1 $N2 ]
            set length2 [/ $length0 [ expr { pow($term2,$term1) } ] ]
            set length3 [/ $length0 [ expr { pow($term3,$term1) } ] ]
            set length4 [/ $length0 [ expr { pow($term4,$term1) } ] ]
            set length5 [/ $length0 [ expr { pow($term5,$term1) } ] ]
            set length6 [/ $length0 [ expr { pow($term7,$term1) } ] ]
            set side4 $length6
            set side5 $length2
            set side6 $length3
            set side7 $length4
            set side8 $length5
        }
        proc fillup {aa bb cc dd ee ff gg hh} {
            .frame.entry1 insert 0 "$aa"
            .frame.entry2 insert 0 "$bb"
            .frame.entry3 insert 0 "$cc"
            .frame.entry4 insert 0 "$dd"
            .frame.entry5 insert 0 "$ee"
            .frame.entry6 insert 0 "$ff"
            .frame.entry7 insert 0 "$gg"
            .frame.entry8 insert 0 "$hh"}
        proc clearx {} {
            foreach i {1 2 3 4 5 6 7 8} {
                .frame.entry$i delete 0 end } }
        proc reportx {} {
            global side1 side2 side3 side4 side5
            global side6 side7 side8 testcase_number
            console eval {.console config -bg palegreen}
            console eval {.console config -font {fixed 20 bold}}
            console eval {wm geometry . 40x20}
            console eval {wm title . " Wind Chime Calculator V2 Report, screen grab and paste from console 2 to texteditor"}
            console eval {. configure -background orange -highlightcolor brown -relief raised -border 30}
            console show;
            puts "%|table| printed in|TCL format |% "
            puts "&|testcase number:| $testcase_number| |& "
            puts "&|chime 1,  master length:| $side1| |& "
            puts "&|chime N1 integer: |$side2| |& "
            puts "&|chime N2 integer: |$side3| |& "
            puts "&|alternate chime 1b from N1/N2 centimeters: | $side4| |& "
            puts "&|chime 2, centimeters: |$side5| |& "
            puts "&|chime 3, centimeters: |$side6| |& "
            puts "&|chime 4, centimeters: | $side7| |& "
            puts "&|chime 5, centimeters: | $side8| |& "
        }
        frame .buttons -bg aquamarine4
        ::ttk::button .calculator -text "Solve" -command { calculate   }
        ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup 30. 2. 1.  21.2 26.8  25.8 24.5 23.7 }
        ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 40. 2.  1.  28.3 35.7  34.6 32.65 31.6 }
        ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 100. 2. 1.  70.7 89.4  86.6 81.6 79.05 }
        ::ttk::button .clearallx -text clear -command {clearx }
        ::ttk::button .about -text about -command about
        ::ttk::button .self_help -text self_help -command { self_help }
        ::ttk::button .cons -text report -command { reportx }
        ::ttk::button .exit -text exit -command {exit}
        pack .calculator  -in .buttons -side top -padx 10 -pady 5
        pack  .clearallx .cons .self_help .about .exit .test4 .test3 .test2   -side bottom -in .buttons
        grid .frame .buttons -sticky ns -pady {0 10}
        . configure -background aquamarine4 -highlightcolor brown -relief raised -border 30
        wm title . "Wind Chime Calculator V2"    

Pushbutton Operation

For the push buttons, the recommended procedure is push testcase and fill frame, change first three entries etc, push solve, and then push report. Report allows copy and paste from console.

For testcases in a computer session, the eTCL calculator increments a new testcase number internally, eg. TC(1), TC(2) , TC(3) , TC(N). The testcase number is internal to the calculator and will not be printed until the report button is pushed for the current result numbers (which numbers will be cleared on the next solve button.) The command { calculate; reportx } or { calculate ; reportx; clearx } can be added or changed to report automatically. Another wrinkle would be to print out the current text, delimiters, and numbers in a TCL wiki style table as

  puts " %| testcase $testcase_number | value| units |comment |%"
  puts " &| volume| $volume| cubic meters |based on length $side1 and width $side2   |&"  


Hidden Comments Section



Please place any comments here with your wiki MONIKER and date, Thanks.gold12Dec2018