Full text
Research Article Irene Brito*, José João Almeida, Gaspar J. Machado Automatic Exercise Generation for Exploring Connections between Mathematics and Music https://doi.org/10.1515/edu-2022-0183 received October 27, 2022; accepted March 22, 2023 Abstract: Mathematics and Music are closely connected and their multifaceted relationship has been explored since ancient times. Pythagoras was one of the first who discovered and formalized one of those connections by studying the arithmetic of musical intervals, expressing them by numerical ratios and relating ratios to consonance/dissonance notions, being the Pythagorean tuning and scale based on arithmetic principles. Another interesting link between Mathematics and Music is the geometric approach to musical composition. Geometric patterns are present in different musical style compositions and some composing techniques, such as the 12-tone technique, use geometric transformations, involving also applications of modular arithmetic and set theory to Music. The aim of this work is to present existing relations between Mathematics and Music and to propose automatic exercise generation for exploring and studying those relations. The exercises are generated using the system MVGEN and the LaTeX package MusiXTeX. The generation process and the automatically generated exercises can be used for creating learning and assessment materials for education in Mathematics and Music, linking Science and Art. Keywords: Mathematics, Music, STEAM, automatic exercise generation, multiple-choice question 1 Introduction In the context of science, technology, engineering, arts and mathematics (STEAM)education, the existing relations between Mathematics and Music inspire researchers and teachers to focus more on creating interdisciplinary projects, integrating both subjects. Obvious main educational objectives and learning outcomes are the learning of Mathematics through Music or the learning of Music through Mathematics. From the mathematical point of view, the education and research projects can be useful for understanding the mathematical foundations of Music and the relevance of Mathematics in the musical development and for recognizing and discovering diverse applications of Mathematics to Music. In the literature, one can find several scientific treatments about the theory in Mathematics and Music (see e.g. Assayag, Feichtinger, & Rodrigues, 1997; Benson, 2007; Fauvel, Flood, & Wilson, 2006; Harkleroad, 2007; Wright, 2009; and references therein)and also studies about interdisciplinary works in education with the integration of both subjects. Monferrer- Sales, Lorenzo-Valentín, and Mas (2014)presented an interdisciplinary educational project in a Bachelor’sdegree, where fractal geometry was applied to musical composition. Martínez-Jiménez, Cuadrado-Méndez, and Gómez-Rey (2019) proposed an interdisciplinary approach for teaching Music and Mathematics, that was applied by students of a degree in primary education. Li et al. (2022)studied and confirmed the effectiveness of a project-based STEAM program on the development of students’creativity, where Mathematics was applied in measuring pitch, volume, tempo, and rhythm in music.Viladotetal.(2018)explored the changing contexts in SpainandEnglandinrelationtotheintegratedapproachof teaching Music and Mathematics. Da Silva (2020)investigated the nature of aesthetic mathematical experiences and presented a pedagogic model for Mathematics teaching and learning through Music. Other interesting interdisciplinary projects in Mathematics and Music teaching were, for example, reported in Lovemore, Robertson, and Graven (2021), Milne and Calilhanna (2019),and Montiel Hernández (2017). * Corresponding author: Irene Brito, Departamento de Matemática e Centro de Matemática, Universidade do Minho, 4800 Guimarães, Portugal, e-mail: [email protected] José João Almeida: Departamento de Informática, Algoritmi, Universidade do Minho, 4710 Braga, Portugal, e-mail: [email protected] Gaspar J. Machado: Departamento de Matemática e Centro de Física, Universidade do Minho, 4800 Guimarães, Portugal, e-mail: [email protected] Open Education Studies 2023; 5: 20220183 Open Access. © 2023 the author(s), published by De Gruyter. This work is licensed under the Creative Commons Attribution 4.0 International License.
In general, all studies indicate a favorable attitude toward cross-curricular approaches of Mathematics and Music in education and an increasing interest in developing these kinds of projects (see, e.g., Viladot et al., 2018). It becomes therefore more and more necessary to create and develop resources to support the integrated approach of teaching and research in Mathematics and Music. There exist several Music composing software, see, e.g., the review presented by Laato, Laine, and Sutinen (2019), who investigated the affordances of Music composing technologies for learning Mathematics and categorized and reviewed 57 Music composing software (see, e.g., Cope, 2015; Manaris & Kohn, 2016)and concluded that music composing is a promising activity through which Mathematics and Music theory can be learned. However, one can hardly find software or studies that deal directly with the automatic generation of exercises for Mathematics and Music. In Almeida et al. (2013), the exercise generation system Passarola was presented that can be applied to the generation of Music exercises (as an example, the generation of a chord recognition exercise was presented in that article). Recently, the exercise generation system MVGEN was developed and applied to the automatic generation of exercises in higher education Mathematics (see Brito, Almeida, & Machado, 2019; Brito, Machado, & Almeida, 2022). The advantage of that system is that it is self-contained, it is based on Perl and LaTeX language, useful for the generation of exercises in Mathematics, and it permits controlling the entire generation process and adapting flexibly the design and generation of exercises to the context of Music through the inclusion of the MusiXTeX package. The aim of this work is, on the one hand, to present a short introduction to topics of Mathematics and Music, by explaining existing relations, and, on the other hand, to propose automatic exercise generation for exploring and studying those relations using the system MVGEN. This article is structured as follows. Section 2 contains a brief introduction to Mathematics and Music, where in the first subsection, the arithmetic of musical intervals is explained and in the second subsection, a geometric approach to musical composition is presented. Section 3 deals with the automatic exercise generation with the system MVGEN, where different examples of exercises about the topics of the previous section are considered and their generation in MVGEN explained. In Section 4, a pedagogical experience and analysis are presented. Section 5 contains the conclusions. 2 Mathematics and Music In Mathematics and Music, the relation between arithmetic and musical intervals plays an important role, since it has been applied over the centuries to establish the different musical tuning systems and associated scales. Here, the Pythagorean tuning will be considered in the first subsection. Another topic that will then be addressed in the second subsection is the relation between geometry and music, where geometric transformations are presented as a means for creating musical motifs and for composing Music. 2.1 Arithmetic of Musical Intervals Pythagoras was one of the first who discovered and formalized one of the connections between Mathematics and Music. Pythagoras studied the arithmetic of musical intervals. He experimented with the tones produced by strings of different lengths and expressed musical intervals by numerical ratios. Pythagoras discovered a relationship between musical harmony and the mathematical harmony by relating ratios to consonance/dissonance notions. The Pythagorean tuning and the associated Pythagorean scale were derived based on arithmetic principles. The Pythagoreans discovered relations between musical intervals and numerical ratios on a monochord (seeFigure1 ). Reducing a chord to the half of its total length, then the sound produced by the half chord will form an Figure 1: Monochord. 2Irene Brito et al.
interval of octave with respect to the sound produced by the whole chord. The sound that we will hear is one octave higher than the sound obtained with the total chord. Defining the length ratio by dividing the length of the reduced chord, in this case half of the length, by the total length, one can determine the length ratio associated to the octave interval which is 1/2. Now, dividing the chord into 12 units of equal length and considering the chord reduced to 8 units (see Figure 1), then the sound produced with the reduced chord will form an interval of fifth with respect to the sound produced with the chord having total length. The length ratio 8/12 =2/3 can therefore be associated with the interval of fifth. The numerical ratios defined by the length ratios are associated with the frequencies of tones. The frequency ratios are inversely related with the length ratios. For example, reducing the chord to one half of its total length implies that the frequency will go up by the factor 2, or, reducing the chord to 2/3 of its total length implies that the frequency will go up by the factor 3/2. Table 1 contains the length and frequency ratios associated with the intervals of octave, fifth and fourth, where the length ratios are illustrated on the monochord in Figure 1. The musical intervals can be constructed using the arithmetic of proportions. The product of two proportions corresponds to the sum of two intervals. The division of two proportions corresponds to the difference of two intervals. Considering the frequency ratios, since the sum of an interval of fifth and an interval of fourth gives an octave, where we will write fifth +fourth =octave, in terms of ratios this equation corresponds to ⋅= 3 24 32 . Considering the difference of intervals, since octavefourth =fifth, then dividing the frequency ratio of the octave by the frequency ratio of the fourth interval, one obtains the frequency ratio of the fifth: =⋅= 223 43 2 . 4 3 In the Pythagorean tuning system, all intervals of the musical scale are constructed using the interval of fifth with ratio 3/2. For example, going up two fifths from the note C, one obtains the note D (which is separated by an interval of ninth from C), and going down one octave one obtains the note D that forms and interval of major second with respect to the initial note C. The frequency ratio associated with the interval of major second can therefore be obtained as follows: ⋅= 29 8 . 3 23 2 Proceeding in the same way by going up intervals of fifth and going down octave intervals, one can determine the frequency ratios of the other intervals listed in Table 2. One can observe that the ratios of octave, fifth, and fourth are simple depending on low integers. In contrast, the other intervals, for example, the interval of major seventh, have ratios depending on higher integers. These differences were related by the Pythagoreans to the consonance and dissonance of the sound produced by the interval. Intervals with simple ratios, formed with the lowest integers, were perceived to be more consonant than intervals with frequency ratios formed with higher integers. 2.2 Geometric Approach to Musical Composition Geometric and musical transformations are related as follows. The geometric transformations: translation, reflection at an horizontal axis and reflection at a vertical axis correspond to the musical transformations: transposition, inversion, and retrograde, respectively. Let T n ,I,andR denote the transposition of nhalftones, the inversion, and the retrograde, respectively. These musical transformations are applied, for example, in the 12-tone compositional technique. The 12-tone technique uses themes that are sequences of 12 notes of the chromatic scale that must Table 1: Intervals and numerical ratios Interval Length ratio Frequency ratio Octave 6/12 =1/2 2 Fifth 8/12 =2/3 3/2 Fourth 9/12 =3/4 4/3 Table 2: Pythagorean tuning –intervals and frequency ratios Interval Frequency ratio Major second 9/8 Major third 81/64 Fourth 4/3 Fifth 3/2 Major sixth 27/16 Major seventh 243/128 Octave 2 Exercise Generation for Mathematics and Music 3
come from different pitch classes. Each pitch class occurs once and only once in the theme. The sequences are called tone rows. The composition consists of an original tone row and it can have additional rows that are created by applying T n ,I,andRtransformations, or combinations of those transformations ( T I n , T R n , TIR n), to the original tone row. Modular arithmetic can be used to obtain the tones resulting from applying the transformations to a given pitch taking into account the equivalent pitch classes. If the difference of two integers aand bis a multiple of 12, then aand bare congruent modulo 12 (12 is a divisor of their difference). In arithmetic mod 12, one has, for example, 10 +7=5(mod 12). The set Z 12 ={0,1,…,11}contains the integers mod 12. These integers are assigned to the 12 pitch classes as indicated in the modular clock in Figure 2. A transposition moves a sequence of pitches up (or down)by a given number of halftones, where T n , ∈nN 0 , denotes the transposition moving nhalftones up (and − T n , nhalftones down). Consider a sequence of pitches = X ( ) …xx,, K1,x 1 ,…,x K ∈Z 12 . The transposition of the sequence of pitches Xis defined by ()( )=+…+TX x n x n,, nK1. Example: Consider the sequence of pitches given by X=(4, 7, 0, 9), in the first bar of Figure 3, then ( ) TX 3=(7, 10, 3, 0) corresponds to the motif presented in the second bar. A retrograde reverses the order of the pitches of a given sequence. Consider a sequence of pitches ( ) =… X xx,, K1, x 1 ,…,x K ∈Z 12 . The retrograde of the sequence of pitches Xis defined by ()( )=… − RX x x x,,, KK11 . Example: Given the sequence of pitches X=(4, 7, 0, 9), in the first bar of Figure 4, then, applying the retrograde to X, one obtains ( ) RX =(9, 0, 7, 4), corresponding to the motif presented in the second bar. The inversion reflects the pitches of a given sequence about 0. Consider a sequence of pitches ( ) =… X xx,, K1, x 1 ,…,x K ∈Z 12 . The inversion of Xis defined by ()=IX ()−…−xx12 , , 12 K1. On the modular clock, the inversion corresponds to a reflection about an axis passing through 0 and 6 (see Figure 5). Example: Consider the sequence of pitches given by X=(4, 7, 0, 9), in the first bar of Figure 6. Applying the inversion to that sequence, one obtains ( ) IX =(12 –4, 12 –7, 12 –0, 12 –9)=(8, 5, 0, 3), corresponding to the motif in the second bar. The inversion can also be obtained by reflecting the original motif on the modular clock as illustrated in Figure 7, where the red lines connect the notes of the original motif and the reflected blue lines connect the notes of the inversion motif. 3 Automatic Exercise Generation In this section, exercises about the topics presented in the previous section will be considered and their generation using the system MVGEN will be explained. Figure 2: Modular clock with pitch class integers. Figure 3: Sequence of pitches Xand transposition T X . 3 () Figure 4: Sequence of pitches Xand retrograde RX.() Figure 5: Inversion as a reflection on the modular clock. 4Irene Brito et al.
3.1 MVGEN MVGEN is a multi-version question and test generation system, a Domain Specific Language, developed in PERL, that uses LaTeX as typographical language and allows the random generation of different question types and the random creation of a large number of different question and test versions. The system has the advantage that it is simple and self-contained. With MVGEN, one can generate, for example, multiple-choice, multiple-selection, numeric response, matching, ordering, and free response questions for different education domains. Applications to the generation of multiple-choice questions for higher education Mathematics have been presented in Brito et al. (2022). The reader is also referred to Brito et al. (2019),where a more detailed description about MVGEN and a presentation of various kinds of exercises that can be generated with this system can be found. Multiple-choice questions in MVGEN are written in LaTeX and stored in a database. These questions can easily be built by providing a stem together with a list containing one or more keys and a list with three or more distractors (considering questions with four options), where an additional table allows introducing associated random parameters in the stem and in the choices to generate different question versions. The questions in the database are structured as follows: #qn stem #v list with 1 or more keys #f list with 3 or more distractors #tab table with instances (values or text) a::b::… MVGEN extracts then randomly one correct option from #v and three distractors from #f and shuffles the options for each question version. The stem, key, and distractors can depend on random parameters defined in the table #tab. Together with the test file containing the questions, MVGEN also generates a verification file for each question. This file allows the instructor to verify if the exercise is correctly built up. Since the system uses LaTeX language, questions for Mathematics and Music can be generated with the additional package MusiXTeX that allows musical typesetting in LaTeX. In the following two subsections, examples of multiple-choice questions generated in MVGEN for Mathematics and Music about the topics introduced in the previous section are presented. 3.2 Arithmetic and Music To study the relation between Arithmetic and Music, exercises about musical intervals and their associated frequency ratios can be constructed in the following examples, where the Pythagorean tuning system was considered. Example 1 Consider the question in Figure 8. In this exercise, the aim is to determine the interval formed by two notes, where the corresponding frequencies are known. Therefore, the frequencies of both notes should be divided and the simplified ratio can then be associated with the correct interval. Figure 6: Sequence of pitches Xand inversion IX . () Figure 7: Inversion on the modular clock. Figure 8: Example 1 –multiple-choice question about intervals and frequency ratios. Exercise Generation for Mathematics and Music 5
This multiple-choice question was generated with the following code: #q2 Consider the Pythagorean tuning system. Determine the interval defined by the note of frequency $f=100$Hz and the note of frequency $f=$#freq Hz. #v #int #f major third fifth major seventh octave #tab freq :: int $\frac{900}{8}$ :: major second $\frac{400}{3}$ :: fourth $\frac{2700}{16}$:: major sixth The three rows in the table contain three frequency values to be instanced in the stem (in #freq),defining the frequency of the second note. These frequency values are associated with the intervals listed in the second column int of the table, which define the key #int of the multiple-choice question. Each time the question is generated, a different row is randomly selected, and three distractors from the list of four options are randomly chosen. The key and the three distractors appear then in a shuffled form in the question. Figure 9 contains the output of the questions in the verification file, corresponding to the three rows in the table. The correct and false options are indicated by “v”and “f”, respectively. Example 2 Consider the question in Figure 10. In this exercise, the objective is to establish an equation by identifying the given product with the frequency ratio of the interval of major seventh, to solve the equation for xand then to determine the interval associated with the obtained frequency ratio. This multiple-choice question was generated with the following code: #q2 Let $x$ be the frequency ratio of a musical interval in Pythagorean tuning. Knowing that multiplying $x$ by $#ratio$, one obtains an interval of #int, then $x$ corresponds to an interval of: #v #intx. #f #false. fifth. major sixth. major seventh. Figure 9: Verification file for Example 1. Figure 10: Example 2 –multiple-choice question about intervals and frequency ratios. 6Irene Brito et al.
#tab ratio :: int :: intx :: false \frac{3}{2} :: major seventh :: major third :: major second \frac{4}{3} :: fifth :: major second :: major third \frac{9}{8} :: fifth :: fourth :: major second In this exercise, the interval of xis identified by intx in the table #tab. One of the three intervals listed in the column will appear in the key through the random row selection when generating the exercise. Multiplying the corresponding interval ratio by the ratio provided in the table leads to the interval int, where both ratio and int are associated with the selected interval intx in the same row. Concerning the distractors, the intervals fifth, major sixth, and major seventh are common distractors for the three available configurations (the three rows in the table)and another specific distractor represented by false is added to the list of false options, which varies with the selection of the row. Figure 11 presents the three possible question configurations, where one can identify the associated row instances in each exercise. Example 3 In the following exercise, see Figure 12, given a note and its corresponding frequency, the frequency of a new note has to be determined considering the Pythagorean scale. Therefore, the interval has to be determined between the two notes and the frequency of the given note has to be multiplied by the interval’s corresponding frequency ratio. In the example in Figure 12, since F forms and interval of fourth with respect to C, then, according to the Pythagorean tuning, the frequency of C must be multiplied by the ratio of 4/3 to obtain the frequency of F. This multiple-choice question was generated with the following code: #q3 Consider the Pythagorean tuning and the musical note $C$ with frequency $f=261$Hz. Then, the musical note #N has frequency #v $#freq$Hz. #f $#false$Hz. $\frac{522}{3}$Hz. $\frac{783}{4}$Hz. #tab N :: freq :: false G :: \frac{783}{2} :: \frac{1044}{3} F :: \frac{1044}{3} :: \frac{783}{2} In the stem of this multiple-choice question, note C and its frequency are given. The new note, represented by the parameter #N, is randomly selected from the table and can be F or G. The correct associated frequency is Figure 11: Verification file for Example 2. Figure 12: Example 3 –multiple-choice question about intervals and frequency ratios. Exercise Generation for Mathematics and Music 7
thus obtained by multiplying 261 Hz by 3/2 or 4/3, respectively, leading to the results in the second column of the table. The correct option will appear in #freq, as instance of the key. Two distractors in the list #f are common to both keys, and another distractor #false is obtained from the third column of the table. In this case, the key of the second row will be the distractor corresponding to the first key and conversely, so that all question versions will have displayed the same options (see Figure 13). 3.3 Geometry and Music The construction of exercises for studying the relation between Geometry and Music, where it is useful and more interesting to illustrate the geometric transformations in score notation, can be achieved with the LaTeX package MusiXTeX. Example 4 Consider the question in Figure 14. This multiple-choice question was generated with the following code: #q3 Determine the operator that transforms the musical motif presented in the first bar into the motif in the second bar of the following measure: \seqnbar{\Notes \qa{egjh}\en\bar\Notes \qa{j_l_ig}\en} #v $RT_3$ $T_3 R$ #f $RT_2$ $T_8R$ $T_8I$ In this exercise, the sequence of notes of the motif in the first bar and the transformed sequence in the second bar are indicated directly in the stem, where the command \seqnbar{…}was defined in the LaTeX layout file using the MusiXTeX instructions as follows: \def\seqnbar#1{ \begin{music} \setstaffs1{1} \setclef1{\treble} \generalmeter {\meterC} \startextract #1 \endextract \end{music}} The second motif was obtained from the first one by applying a retrograde and a transposition of three halftones. Since the combination of retrograde and transposition is commutative, two correct transformations are indicated in the list of keys #v and then three distractors are listed in #f. The aim is then to determine the correct operator that transforms the motif of the first bar into the motif of the second bar. The output in the verification file (see Figure 15)permits the instructor to verify if the exercise is correctly build up. Example 5 In the following exercise, see Figure 16, a musical motif is presented in the stem and the aim is to determine its inversion by identifying the correct inversion motif in the given options. Figure 13: Verification file for Example 3. Figure 14: Example 4 –multiple-choice question about musical transformations. 8Irene Brito et al.
This multiple-choice question was generated with the following code: #q4 Determine the Inversion of the motif in the following measure: \seqnbar{\Notes \qa{#notes} \en} #v \seqnbar{\Notes \qa{#inversion} \en} #f \seqnbar{\Notes \qa{#false1} \en} \seqnbar{\Notes \qa{#false2} \en} \seqnbar{\Notes \qa{#false3} \en} #tab notes :: inversion :: false1 :: false2 :: false3 cfgi :: cgf^j :: jgfc :: dfhc :: ^f^cig dfhc :: ^hg^dc :: chfd :: efgi :: ^h^c^d^f The motif that will appear in the stem is represented by #notes. When the exercise is generated, a row is randomly selected from the table, where the notes in the first column determine the motif in the stem. The associated notes in the second column form the corresponding inversion motif that will appear in the key given at #v, and the incorrect options in the false columns will appear as distractors to be instanced in the list #f. Figure 17 contains the output of the verification file corresponding to the instances in the first row of the table #tab and Figure 18, to the instances in the second row. In Figure 17, the original musical motif is given by the sequence X=(0, 5, 7, 11). One can confirm that the correct option is A, since I(X)=(12 –0, 12 –5, 12 –7, 12 –11)=(0, 7, 5, 1). Considering the second version in Figure 18, the original musical motif is given by the sequence X=(2, 5, 9, 0)and the correct option appears in A, since I(X)=(12 –2, 12 –5, 12 –9, 12 –0)=(10,7,3,0). Example 6 Consider the exercise in Figure 19, where the aim is to determine the new musical motif obtained by applying a combination of two transformations to a given motif. In this exercise, the musical motif in the stem is fixed and what will vary in the stem, when generating the exercise, is the transformation that should be applied to the motif. For that purpose, this multiple-choice question was generated with the following code: #q6 Determine #tr of the following musical motif: \seqnbar{\Notes \qa{fjhj}\en} #v \seqnbar{\Notes \qa{#true} \en} #f \seqnbar{\Notes \qa{#false1} \en} \seqnbar{\Notes \qa{#false2} \en} \seqnbar{\Notes \qa{#false3} \en} Figure 15: Verification file for Example 4. Figure 16: Example 5 –multiple-choice question about musical transformations. Exercise Generation for Mathematics and Music 9