{"id":173,"date":"2015-12-29T11:52:01","date_gmt":"2015-12-29T18:52:01","guid":{"rendered":"https:\/\/supermediocre.org\/?p=173"},"modified":"2016-07-12T19:24:37","modified_gmt":"2016-07-13T01:24:37","slug":"analyzing-the-sound-of-commercial-instruments","status":"publish","type":"post","link":"https:\/\/supermediocre.org\/index.php\/2015\/12\/29\/analyzing-the-sound-of-commercial-instruments\/","title":{"rendered":"Analyzing Xylophone Sound Clips Found On the Web"},"content":{"rendered":"<p>As the previous posts note, the desired frequency ratios for the first 3 partials of a xylophone are 1:3:6. \u00a0However, I needed to know how accurate these frequencies had to be to yield a nice-sounding instrument. I couldn&#8217;t find comments on the web about the tuning accuracy requirements, so I set out to spectrally measure some instruments to serve as a guidepost. Specifically, I needed\u00a0to know how accurate I needed to tune the fundamental and higher partials.<\/p>\n<h2>Finding Sound Samples On the Web<\/h2>\n<p>The web was pretty skimpy when it came finding sound clips of xylophones.<\/p>\n<p>Here was the first clip that I found &#8211; basically a guy playing a C-major scale. There was no info on the type of xylophone he was playing, but it looked pretty decent.<\/p>\n<p><iframe loading=\"lazy\" title=\"How to Play the C Major Scale on the Xylophone\" width=\"474\" height=\"267\" src=\"https:\/\/www.youtube.com\/embed\/jG89pIDq6tg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>Here is another video that I found of a DeMarrow instrument. He hits some notes at the end of the video.<\/p>\n<p><iframe loading=\"lazy\" title=\"Xylophone by Doug DeMorrow\" width=\"474\" height=\"267\" src=\"https:\/\/www.youtube.com\/embed\/xr0Fw9b-OJk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>Finally, <a href=\"http:\/\/www.concertgoersguide.org\/onstage\/instruments\/thexylophone.php\">at \u00a0this site<\/a> I found a third clip of\u00a0a guy from the Oregon Symphony playing an xylophone. Again, the I couldn&#8217;t find the xylophone brand, but decided it must be a good one\u00a0if it is used in the symphony.<\/p>\n<h2>Spectral Analysis<\/h2>\n<p>So here is where the magic starts\u00a0&#8211; I wrote some software in Matlab that analyzes these clips to determine how accurately tuned the xylophone is. The tool, called AnalyzeClip, performs the following steps:<\/p>\n<ol>\n<li>Read the WAV file.<\/li>\n<li>Delineate\u00a0\u00a0each discrete note (i.e., each time a\u00a0bar is struck) into its own clip.<\/li>\n<li>For each clip, perform a windowed spectral analysis.<\/li>\n<li>Find the peaks in the spectrum (aka, the <em>modes).<\/em>\u00a0This identifies the frequencies associated with the fundamental frequency and the higher partials.<\/li>\n<li>Find the fundamental. This is the lowest mode and typically has the most power\u00a0(although not always &#8211; sometimes I found that the second partial had more power.)<\/li>\n<li>Associate the fundamental with the closest ideal note, assuming an equal-tempered scale with a 442 Hz reference pitch (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Equal_temperament\" target=\"_blank\">Wikipedia has a nice description of equal temperament<\/a>.)<\/li>\n<li>Compute the frequency error\u00a0of the fundamental relative\u00a0to the ideal desired pitch.<\/li>\n<\/ol>\n<p>The &#8220;ideal pitch&#8221; noted in the last step is computed for a an equal tempered scale with a 442 Hz reference. The notes in an equal tempered scale have a ratio that is given by 2^(1\/12) power, which is about 1.0595. So if you want to determine the frequencies associated with a note, just multiple the previous notes frequency by 1.0595. If you do this multiplication for 12 successive notes, the two\u00a0<em>bookending<\/em> notes will have a ration of 2, or an octave apart. For my 3.5 octave xylophone, the following table gives the desired frequency for each note.<\/p>\n<h2 id=\"tablepress-1-name\" class=\"tablepress-table-name tablepress-table-name-id-1\">Note frequencies<\/h2>\n\n<table id=\"tablepress-1\" class=\"tablepress tablepress-id-1\" aria-labelledby=\"tablepress-1-name\" aria-describedby=\"tablepress-1-description\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Bar Number<\/th><th class=\"column-2\">Note<\/th><th class=\"column-3\">Frequency<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1<\/td><td class=\"column-2\">F4<\/td><td class=\"column-3\">350.816<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">2<\/td><td class=\"column-2\">F#4<\/td><td class=\"column-3\">371.676<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">3<\/td><td class=\"column-2\">G4<\/td><td class=\"column-3\">393.777<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">4<\/td><td class=\"column-2\">G#4<\/td><td class=\"column-3\">417.192<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">5<\/td><td class=\"column-2\">A4<\/td><td class=\"column-3\">442.000<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">6<\/td><td class=\"column-2\">A#4<\/td><td class=\"column-3\">468.283<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-1\">7<\/td><td class=\"column-2\">B4<\/td><td class=\"column-3\">496.128<\/td>\n<\/tr>\n<tr class=\"row-9\">\n\t<td class=\"column-1\">8<\/td><td class=\"column-2\">C5<\/td><td class=\"column-3\">525.630<\/td>\n<\/tr>\n<tr class=\"row-10\">\n\t<td class=\"column-1\">9<\/td><td class=\"column-2\">C#5<\/td><td class=\"column-3\">556.885<\/td>\n<\/tr>\n<tr class=\"row-11\">\n\t<td class=\"column-1\">10<\/td><td class=\"column-2\">D5<\/td><td class=\"column-3\">589.999<\/td>\n<\/tr>\n<tr class=\"row-12\">\n\t<td class=\"column-1\">11<\/td><td class=\"column-2\">D#5<\/td><td class=\"column-3\">625.082<\/td>\n<\/tr>\n<tr class=\"row-13\">\n\t<td class=\"column-1\">12<\/td><td class=\"column-2\">E5<\/td><td class=\"column-3\">662.252<\/td>\n<\/tr>\n<tr class=\"row-14\">\n\t<td class=\"column-1\">13<\/td><td class=\"column-2\">F5<\/td><td class=\"column-3\">701.631<\/td>\n<\/tr>\n<tr class=\"row-15\">\n\t<td class=\"column-1\">14<\/td><td class=\"column-2\">F#5<\/td><td class=\"column-3\">743.352<\/td>\n<\/tr>\n<tr class=\"row-16\">\n\t<td class=\"column-1\">15<\/td><td class=\"column-2\">G5<\/td><td class=\"column-3\">787.554<\/td>\n<\/tr>\n<tr class=\"row-17\">\n\t<td class=\"column-1\">16<\/td><td class=\"column-2\">G#5<\/td><td class=\"column-3\">834.385<\/td>\n<\/tr>\n<tr class=\"row-18\">\n\t<td class=\"column-1\">17<\/td><td class=\"column-2\">A5<\/td><td class=\"column-3\">884.000<\/td>\n<\/tr>\n<tr class=\"row-19\">\n\t<td class=\"column-1\">18<\/td><td class=\"column-2\">A#5<\/td><td class=\"column-3\">936.565<\/td>\n<\/tr>\n<tr class=\"row-20\">\n\t<td class=\"column-1\">19<\/td><td class=\"column-2\">B5<\/td><td class=\"column-3\">992.256<\/td>\n<\/tr>\n<tr class=\"row-21\">\n\t<td class=\"column-1\">20<\/td><td class=\"column-2\">C6<\/td><td class=\"column-3\">1051.259<\/td>\n<\/tr>\n<tr class=\"row-22\">\n\t<td class=\"column-1\">21<\/td><td class=\"column-2\">C#6<\/td><td class=\"column-3\">1113.770<\/td>\n<\/tr>\n<tr class=\"row-23\">\n\t<td class=\"column-1\">22<\/td><td class=\"column-2\">D6<\/td><td class=\"column-3\">1179.998<\/td>\n<\/tr>\n<tr class=\"row-24\">\n\t<td class=\"column-1\">23<\/td><td class=\"column-2\">D#6<\/td><td class=\"column-3\">1250.165<\/td>\n<\/tr>\n<tr class=\"row-25\">\n\t<td class=\"column-1\">24<\/td><td class=\"column-2\">E6<\/td><td class=\"column-3\">1324.503<\/td>\n<\/tr>\n<tr class=\"row-26\">\n\t<td class=\"column-1\">25<\/td><td class=\"column-2\">F6<\/td><td class=\"column-3\">1403.263<\/td>\n<\/tr>\n<tr class=\"row-27\">\n\t<td class=\"column-1\">26<\/td><td class=\"column-2\">F#6<\/td><td class=\"column-3\">1486.705<\/td>\n<\/tr>\n<tr class=\"row-28\">\n\t<td class=\"column-1\">27<\/td><td class=\"column-2\">G6<\/td><td class=\"column-3\">1575.109<\/td>\n<\/tr>\n<tr class=\"row-29\">\n\t<td class=\"column-1\">28<\/td><td class=\"column-2\">G#6<\/td><td class=\"column-3\">1668.770<\/td>\n<\/tr>\n<tr class=\"row-30\">\n\t<td class=\"column-1\">29<\/td><td class=\"column-2\">A6<\/td><td class=\"column-3\">1768.000<\/td>\n<\/tr>\n<tr class=\"row-31\">\n\t<td class=\"column-1\">30<\/td><td class=\"column-2\">A#6<\/td><td class=\"column-3\">1873.131<\/td>\n<\/tr>\n<tr class=\"row-32\">\n\t<td class=\"column-1\">31<\/td><td class=\"column-2\">B6<\/td><td class=\"column-3\">1984.513<\/td>\n<\/tr>\n<tr class=\"row-33\">\n\t<td class=\"column-1\">32<\/td><td class=\"column-2\">C7<\/td><td class=\"column-3\">2102.518<\/td>\n<\/tr>\n<tr class=\"row-34\">\n\t<td class=\"column-1\">33<\/td><td class=\"column-2\">C#7<\/td><td class=\"column-3\">2227.540<\/td>\n<\/tr>\n<tr class=\"row-35\">\n\t<td class=\"column-1\">34<\/td><td class=\"column-2\">D7<\/td><td class=\"column-3\">2359.997<\/td>\n<\/tr>\n<tr class=\"row-36\">\n\t<td class=\"column-1\">35<\/td><td class=\"column-2\">D#7<\/td><td class=\"column-3\">2500.330<\/td>\n<\/tr>\n<tr class=\"row-37\">\n\t<td class=\"column-1\">36<\/td><td class=\"column-2\">E7<\/td><td class=\"column-3\">2649.007<\/td>\n<\/tr>\n<tr class=\"row-38\">\n\t<td class=\"column-1\">37<\/td><td class=\"column-2\">F7<\/td><td class=\"column-3\">2806.525<\/td>\n<\/tr>\n<tr class=\"row-39\">\n\t<td class=\"column-1\">38<\/td><td class=\"column-2\">F#7<\/td><td class=\"column-3\">2973.410<\/td>\n<\/tr>\n<tr class=\"row-40\">\n\t<td class=\"column-1\">39<\/td><td class=\"column-2\">G7<\/td><td class=\"column-3\">3150.218<\/td>\n<\/tr>\n<tr class=\"row-41\">\n\t<td class=\"column-1\">40<\/td><td class=\"column-2\">G#7<\/td><td class=\"column-3\">3337.540<\/td>\n<\/tr>\n<tr class=\"row-42\">\n\t<td class=\"column-1\">41<\/td><td class=\"column-2\">A7<\/td><td class=\"column-3\">3536.000<\/td>\n<\/tr>\n<tr class=\"row-43\">\n\t<td class=\"column-1\">42<\/td><td class=\"column-2\">A#7<\/td><td class=\"column-3\">3746.262<\/td>\n<\/tr>\n<tr class=\"row-44\">\n\t<td class=\"column-1\">43<\/td><td class=\"column-2\">B7<\/td><td class=\"column-3\">3969.026<\/td>\n<\/tr>\n<tr class=\"row-45\">\n\t<td class=\"column-1\">44<\/td><td class=\"column-2\">C8<\/td><td class=\"column-3\">4205.036<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<span id=\"tablepress-1-description\" class=\"tablepress-table-description tablepress-table-description-id-1\"><\/span>\n<!-- #tablepress-1 from cache -->\n<p>Notice that bar 5 (A4) has a pitch of exactly 442.00 Hz. This is because I referenced all of the other notes to this pitch.<\/p>\n<p>In my next post, I will show some results form the spectral analysis of the sound bites that I found on the web.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As the previous posts note, the desired frequency ratios for the first 3 partials of a xylophone are 1:3:6. \u00a0However, I needed to know how accurate these frequencies had to be to yield a nice-sounding instrument. I couldn&#8217;t find comments on the web about the tuning accuracy requirements, so I set out to spectrally measure &hellip; <a href=\"https:\/\/supermediocre.org\/index.php\/2015\/12\/29\/analyzing-the-sound-of-commercial-instruments\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Analyzing Xylophone Sound Clips Found On the Web<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":199,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2],"tags":[3],"class_list":["post-173","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-xylophone","tag-xylophone"],"_links":{"self":[{"href":"https:\/\/supermediocre.org\/index.php\/wp-json\/wp\/v2\/posts\/173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/supermediocre.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/supermediocre.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/supermediocre.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/supermediocre.org\/index.php\/wp-json\/wp\/v2\/comments?post=173"}],"version-history":[{"count":11,"href":"https:\/\/supermediocre.org\/index.php\/wp-json\/wp\/v2\/posts\/173\/revisions"}],"predecessor-version":[{"id":965,"href":"https:\/\/supermediocre.org\/index.php\/wp-json\/wp\/v2\/posts\/173\/revisions\/965"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/supermediocre.org\/index.php\/wp-json\/wp\/v2\/media\/199"}],"wp:attachment":[{"href":"https:\/\/supermediocre.org\/index.php\/wp-json\/wp\/v2\/media?parent=173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/supermediocre.org\/index.php\/wp-json\/wp\/v2\/categories?post=173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/supermediocre.org\/index.php\/wp-json\/wp\/v2\/tags?post=173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}