Fractals and music

: Many natural phenomena we find in our surroundings, are fractals. Studying and learning about fractals in classrooms is always a challenge for both teachers and students. We here show that the sound of musical instruments can be used as a good resource in the laboratory to study fractals. Measurement of fractal dimension which indicates how much fractal content is there, is always uncomfortable, because of the size of the objects like coastlines and mountains. A simple fractal source is always desirable in laboratories. Music serves to be a very simple and effective source for fractal dimension measurement. In this paper, we are suggesting that music which has an inherent fractal nature can be used as an object in classrooms to measure fractal dimensions. To find the fractal dimension we used the box-counting method. We studied the sound produced by different stringed instruments and some common noises. For good musical sound, the fractal dimension obtained is around 1.6882


Introduction
Many irregular objects and patterns found in nature are fractals. Fractals are often taught in undergraduate classrooms by giving examples of objects like mountains, trees and abstract mathematical shapes like the Koch curve (Ibrahim et al., 2021;Mitić et al., 2021). In a laboratory set-up, it is difficult to measure the fractional dimension associated with many natural fractals so teachers use mathematical objects to demonstrate the measurement of fractal dimension. Many schools or colleges may lack enough experimental facilities, which prevents eachers to pick up motivating and interesting topics like fractals for demonstration (Zembrowska & Kuźma, 2002). Paul Knutson and E. Dan Dahlberg reported a simple experiment to measure the fractal dimension of calcium carbonate crystal growth in the classroom (Knutson & Dahlberg, 2003). Michele Zanoni presented an experiment to measure the fractal dimension of Cauliflower (Zanoni, 2002). C. E. Creffield made a simple experiment to measure the fractal dimension of a resistor network that allow students to study resistor combinations beyond series and parallel (Creffield, 2021). Studies showed that studies on fractals will help to develop an interdisciplinary approach and cater active involvement of the learner (Souza et al., 2019). Fatih Karakus and Temel Kosaa analysed the pre-service teachers understanding of the concept of fractals by giving them projects to calculate fractal dimension of some natural objects (Karakuş & Kösa, 2010). The study concluded that, most of the teachers showed interest in the concept, but they do not believe the values of fractal dimension as their notion of dimension is based on classical Euclidean dimension. Pre-service teachers conceptualise fractal dimension as an attribute measured like length or area of the object and showed difficulties in finding the scaling factor (F. Karakus, 2016).
A study on students in different grades, showed that they experience problems in defining fractals and judging rules for pattern formation (Karakuş, 2013). Students sometimes misinterpret that, only regular patterns form fractals and they often fail to differentiate normal pattern and fractals (Karakuş, 2015). Learners identify pictures of fractals, but fail to draw the fractal shapes as they are not clear about the formation of fractals and lack the idea that infinite structure is one of the property of fractals (Fatih Karakus & Karatas, 2014). Introduction of fractals in the beginning of the course for undergraduates as seminars can cater the notion of advancement of the science and give them a first-hand experience (Hughes, 2003). Students have the notion that only objects possess fractal structure. But, practically many phenomena varying with time have fractal character associated with them (Feng et al., 2021;Shu et al., 2021;Yan et al., 2021). Sound is a good example of this. Sound samples of musical instruments are easily available and can be used to teach the concept of fractals in undergraduate classrooms.
When someone sings a song or play a musical instrument, the musical sound generated is not static, it changes with time. In the language of science, music is a dynamical system. A dynamical system is one in which the past state of the system has influence on both present and future states of the system and the influence is represented in the form of some mathematical function (Feldman, 2019). The changes taking place to such a system with time show deviation from the predicted path obtained by solving the mathematics. This indicates that music is a sequence of events that are interrelated and progresses with some amount of uncertainty. These deviations from expected path is inevitable (Kuzovlev, 2015). These natural variations are called fluctuations or noise (Selvam, 2017). In speech and music also natural variations in loudness and pitch are seen (Voss & Clarke, 1975). In 1990, studies on some compositions of Mozart and Back, Hsu and Hsu found that music has a fractal geometry (Hsu & Hsu, 1990). This indicates that, at different scales, the structure remains the same and due to this property, the music is considered as a fractal (Carpinteri et al., 2018;Hurd, 1988;Wiesenfeld, 2001). Before going to our studies on the fractals of music, let us discuss about fractals and the calculation of fractal dimension in the following subsection.

Fractals
In 1975, a new type of geometry found in objects in the nature was introduced by Mandelbrot and he named his finding as fractals (Mandelbrot, 1982). Fractals are structures that look irregular and we feel them as random but they exhibit self-similarity as we view them at different magnifications (Uahabi & Atounti, 2015). Before Mandelbrot, many mathematicians introduced the concepts of mathematical fractal structures such as Cantor set by Georg Cantor, Koch curve by Helge von Koch and Sierpinski triangle by Waclaw Sierpinski (Peitgen et al., 1992).  Figure 1 shows a Zebra which has similar patterns on its body parts mainly neck and legs. Figure 2 shows the clouds seen from a seashore that has highly irregular structure in a wide area and Momentum: Physics Education Journal, 6 (2), 2022, 121 Nishanth Pothiyodath, Udayanandan  it maintains the self-similarity in the enlarged view. There is repetition of some basic structure in both cases that can be identified on close examination. In many natural objects, the self-similarity indicates that the irregular shape possessed by them are maintained at different magnification (Madhushani & Sonnadara, 2012). The key feature to be a fractal is that the object must repeat the whole object in different enlarged views. Moreover, the self-similarity is statistical and hence there are deviations from the structure at different scales. Fractals in nature have different repeated patterns in the directions of different axes and this property is termed as self-affine nature of fractals (Duan et al., 2021).

Fractal dimension
We know that a line has dimension one, a square has dimension two and a cube has dimension three. How can we find these dimensions? Let us consider three squares A, B and C as shown in Figure 3. Three square boxes of different sizes are placed on square grids. Square A has sides of length 1 units of measure (in, cm or any other unit), B has sides of length 2 units of measure and C has 4 units of measure for its sides. The number of pieces of A needed to fill C is 16. We can write But, the number of pieces of B needed to cover C is 4. We can write 4 = 2 2 Here the side length of C is increased by factor of 2 compared with B and side length is increased by a factor of 4 compared with A and we call this factor as magnification factor or scaling factor. Hence in the above relations the number to which the powers are raised represent the magnification factor. In the above relations the exponent remains the same. We know that for a square, the dimension is two and here the exponent represents the dimension. So in general, we have Momentum: Physics Education Journal, 6 (2), 2022, 122 Nishanth Pothiyodath, Udayanandan  where n is the number of pieces required to fill the object, k is the scaling factor and D is the dimension. To find an expression for dimension we take logarithm and we get Let us use this relation to find the dimension of a Seirpinski triangle which is a fractal. The Figure 4 shows the formation of a Seirpinski triangle from equilateral triangle plotted using a Mathematica code given in the reference(Graphics -Creating a Sierpinski Gasket with the Missing Triangles Filled in -Mathematica Stack Exchange, n.d.). In this figure three (Figure 4) steps in the Sierpinski triangle formation is shown. In Figure 4, from the equilateral triangle a smaller one with half the side length of the original one is removed. This created three smaller equilateral triangles. In next step, from each of the three smaller equilateral triangle a smaller one with half the side length of those 3 equilateral triangles is removed. This creates a total of nine equilateral triangles. The process is repeated in next step and it creates 27 equilateral triangles and so on. Here after first step, we need three identical equilateral triangles to fill the shape and size and we get our original triangle if we enlarge side length by a factor of two. Hence we have Here we get a non-integer value. For fractals, the dimension is non-integer and this fractional dimension is termed as fractal dimension (Nishanth et al., 2020).

Fractals and chaos
Most systems in nature are dynamical and they exhibit chaotic behavior which indicates that small changes in the initial conditions affect largely on the progress of the system in time (De Jong, 1992). For example, it is often seen that weather and natural calamity predictions goes wrong practically due to minor deviations in the initial parameters chosen for prediction. It was Lorentz who identified the chaotic behavior of dynamical systems with his 'famous butterfly effect' (Oestreicher, 2007). Fractals are the picturization of chaotic behavior of the dynamical systems and they also exhibit identical geometry when observed at different scales (Biswas et al., 2018;Harrison, 1989).

Calculation of the fractal dimension
Practically to calculate the fractal dimension, the box-counting method is used (Swapna et al., 2021;Wu et al., 2020;Xu et al., 2017). In 2D, the set of points in the space forms a surface. To calculate the fractal dimension of a surface, square boxes of side length k are placed and n is the number of boxes needed to cover the entire surface. For boxes with different sizes, we have the power law relation of the form (Hsü, 1993).
Here q is a constant of proportionality and D is the dimension. Taking logarithm of the relation we get Momentum: Physics Education Journal, 6 (2), 2022, 123 Nishanth Pothiyodath, Udayanandan  Since q is a constant and as , we have This is the expression for fractal dimension. A slope is found by plotting log-log graph between n and k. The value of the slope gives the fractal dimension of that surface. Figure 5 shows square grid on an irregular shape. Such grids can be used to find fractal dimension by counting the number of boxes required to cover the shape.

Fractals and musical instruments
Audible sound is the best source to study about the fractals in the laboratory. Students can get the audio samples easily and they can get the fractal dimension within a short time using computational methods. Hsu and Hsu noticed that there is self-similarity in compositions of Bach and Mozart (Hsu & Hsu, 1991). Afterward, many authors studied the fractal characters associated with music and musical instruments (Bigerelle & Iost, 2000;Ornes, 2014). A. Das and P. Das studied the fractal character of classical, semi classical and light songs and found that the classical songs have high fractal dimension compared with semi classical and light songs(A. Das & Das, 2005). They also studied the fractal character of different musical instruments and found their harmonic character (Atin Das & Das, 2006). M. H. Niklasson and G. A. Niklasson studied different compositions and found that folk music has less fractal dimension compared with classical music (Niklasson & Niklasson, 2020). P. S. Meyer studied music of different styles and noises and reported that the fractal dimension of music is about 1.65 and the value varies between 1.6 and 1.69 (Meyer, 1993).
Any musical performance consists of the components such as lyrics, artist, scale, accompanying instruments and the effect of all these components are seen in the final outcome. But the fractal dimension of the music produced by the musical instruments are different from musical compositions. In this paper, we analyse the different sound samples of musical instruments and Momentum: Physics Education Journal, 6 (2), 2022, 124 Nishanth Pothiyodath, Udayanandan  noises. Earlier studies to introduce fractal dimension measurement (Carmo & Hõnnicke, 2021;Ching et al., 1994;García & Liu, 1995;Hartvigsen, 2000;Shore et al., 1992) are aimed at creating more interest among the students about the fractal structures, but many of them are time consuming, needs money and guidance of the teachers. But our method of measuring fractal dimension is very easy and less time consuming compared to the earlier works.

Methods
Sound samples of different musical instruments and some noises commonly found in our surroundings are collected. Each sample used in this study is with a time of 1s, as small fine samples give good and consistent values. Veena's log-log graph is shown in Figure 6. The frequency spectrum is plotted using MIR toolbox (Lartillot et al., 2008) available in Matlab. To plot the spectrum, the following comment is used Mirspectrum (filename, 'db') The spectrum is obtained after executing the comment using "Enter" button. The Figure 6 is saved using "Save'' option in file menu. The file is made black and white and stored in a bitmap format with a photo editing software. The fractal dimension of different sound samples are found using Fractalyse software available in the internet (Vuidel, n.d.). Following comments are used to find fractal dimension File Open Analyse Box A log-log plot of the sample will appear as a new window. A sample log-log plot obtained for Veena is shown in Figure 6. The blue line shows the data plotted and red line is the exact line of expected values. The value of the fractal dimension of the sound sample is also shown in the figure 6.

Results and Discussion
The fractal dimension obtained for various sound samples are given in the Table 1. The samples given in the Table 1 include the sound produced by different string instruments, some common noises in our surroundings and pure tones.
The fractal dimensions of the sound of the string instruments give well defined fractal values. Among the string instruments lowest value is obtained for Sarangi and highest is obtained for Tampura and Dilruba. The fractal dimension of musical instruments varies between 1.658 and 1.708. The mean fractal dimension is obtained as 1.6882. In a simple box counting method, typical fractal dimension remains between 1 and 2 which indicates that the dimension is between that of a line and Momentum: Physics Education Journal, 6 (2), 2022, 125 Nishanth Pothiyodath, Udayanandan Kandoth Murkoth Copyright © 2022, Momentum: Physics Education Journal, ISSN 2548-9127 (print) | 2548-9135 (online) a square (Mitić et al., 2020). Fractal dimension near 1 indicates ordered nature and fractal dimension near 2 indicates disordered nature (Crutchfield, 2012;Zmeskal et al., 2013). The obtained values show that music is a system with both order and randomness, the latter being slightly higher.

Conclusions
When we look at our surroundings, we see many things that lack a regular shape. But, at different magnification they are seen identical. Nature created these beautiful symmetries and we recognize them as 'Fractals' after Mandelbrot's discovery. Music also has an innate symmetry and to identify it, studies on fractal dimension is useful. Students are able to collect sound produced by different instruments and compare the sound of each instrument with fractal dimension. In our study on fractal dimension of musical instruments, we found that the fractal dimension of the music produced by instruments varies between 1.658 and 1.708. In this paper, we had shown that finding fractal dimension can be easily done if music is used as the source. This may motivate students to make more studies on fractals. We had shown that with freely available resources, the fractal dimensions of different musical sounds can be easily measured in a laboratory.