1. bookAHEAD OF PRINT
Dettagli della rivista
License
Formato
Rivista
eISSN
2444-8656
Prima pubblicazione
01 Jan 2016
Frequenza di pubblicazione
2 volte all'anno
Lingue
Inglese
Accesso libero

The Composition System of Pop Music Movement Based on Finite Element Differential Equations

Pubblicato online: 15 Jul 2022
Volume & Edizione: AHEAD OF PRINT
Pagine: -
Ricevuto: 27 Feb 2022
Accettato: 20 Apr 2022
Dettagli della rivista
License
Formato
Rivista
eISSN
2444-8656
Prima pubblicazione
01 Jan 2016
Frequenza di pubblicazione
2 volte all'anno
Lingue
Inglese
Introduction

The key technologies commonly used in the algorithmic composition include Markov chain, random process, knowledge base system based on music rules, music grammar, artificial neural network technology, genetic algorithm, etc. Composer Wolfgang Amadeus Mozart used dice to generate random numbers. They compose music by combining pieces of music. John Cage used the sensor's board and how the pieces were moved across the board to trigger the sound to form a melody [1]. Charles Dorje composes music by calculating the Earth's magnetic field changes by computer. The above music composition methods have high requirements on the professional quality of composers. It cannot be popularized in printed children's books. Huang Zhifang from Shanghai Normal University uses feedback from wearable devices to trigger music algorithms. The method completes music generation according to converting human body movements into random signals. Some scholars have designed an algorithm for composing music based on the characteristics of the Rubik's Cube. The algorithm's core is to apply the principle of random numbers to complete the music generation.

In this paper, an algorithm for converting images into music is established based on finite element differential equations [2]. We use digital images captured or stored in electronic devices as composition material to provide children with inspiration and motivation for composition. We obtain a piece of music melody through an idea to achieve the effect of both pictures, text, and sound.

Research on the principle of random number generation based on finite element differential equations

A melody consists of sounds with pitch, duration, timbre, and volume. It is arranged successively on the score. We pick the notes or pieces of music and number them. We choose the number based on the number of points that appear in the dice roll. We roll the dice multiple times and combine the notes or pieces of music in the order in which the dice points appear [3]. This forms a random melody or harmony of music. We program the finite element differential equation to use random numbers to index into an array of selected pitches. The indexed frequency values form a pitch sequence. This audio can be used for automatic composition. We set the sounding duration of the song. In the finite element differential equations, we choose the frequencies in the array by using random numbers. At this point, we enter Beep. Vi can get a melody. The program block diagram is shown in Figure 1. The program can select the frequency value through the index value generated by the random number and play it in order.

Figure 1

Random number generation melody block diagram

Research on the relationship between digital images and melody

Melody is the main component of music. The creation of melody depends on inspiration. It cannot be obtained by mere reason. So composition requires a certain amount of randomness. However, the algorithm of dice music generating melody cannot complete the control of the direction of the generated melody [4]. It cannot predict the direction of the generated melody. We need to introduce materials to limit random numbers. We determine the evolution of the pitch by the tremendous and low changes of the line. Grayscale histograms have linearly varying features in two-dimensional coordinates. It can be associated with a melody line. The grayscale histogram of a digital image is an important parameter reflecting the characteristics of the picture. A grayscale histogram consists of a series of data. It also tends to go up and down. It can be translated into musical sequences. Because the grayscale histogram takes the form of random variation, the grayscale histogram in the digital image can replace the random number to control the generation of the melody.

The array formed by the grayscale histogram of the image is denoted as Array1. There are 256 elements in Array1. The process of playing back 256 values is lengthy. Therefore, we need to select the value to control. We choose a specific gray level and manage the number of random numbers. Its formula is: T=[256/c] T = \left[{256/c} \right]

Where T is the number of values to be taken. c is the interval for selecting data. The grayscale histogram of a digital image is obtained by counting the pixels of each grayscale. The value of the grayscale histogram of different photos is different. Some discounts are much more significant than the maximum index of the array [5]. The fluctuation of the random value is close to the fluctuation trend of the grayscale histogram. The formula that controls the output of the new array Array2 is: Ai=n=ic(i+1)c1Ln/p {A_i} = \sum\limits_{n = i \cdot c}^{\left({i + 1} \right) \cdot c - 1} {{L_n}/p}

Ln is the number of pixels whose gray level is n in the image. p is the total number of image pixels processed. Ai is the F-th element in the array Array2, i = 0 ~ T − 1. We reduce the uncertainty of generating the melody and then select the frequency values of 8 tones to form an array. The frequency values of the C major scale we decided on are 261.63Hz, 293.66Hz, 329.63Hz, 349.23Hz, 392Hz, 440Hz, 493.88Hz, 523.25Hz. The index values are arranged in order from 0 to 7. We build an array of C significant scales. We improve the harmony of the generated melodies [6]. We make an array based on the principles of triad formation. We choose triads to form the audio frequency values of 261.63Hz, 329.63Hz, 392Hz, 523.25Hz, 784.89Hz, 1045.2Hz, 1306.5Hz, 1568.7Hz. The index values are arranged from 0 to 7, and a triad array is established. We can get a melody by indexing the C major scale array through the elements in the exhibition Array2, and playing it. We generate an array Array3 of frequencies generated by the index values. Its formula is: Bi=(S1)Ai/Amax {B_i} = \left({S - 1} \right){A_i}/{A_{\max}}

S is the size of the array of notes. Amax is the most considerable value in array Array2. Bi is the i element in the exhibition Array3.

Research on the principle of MIDI file generation

MIDI is short for Musical Instrument Digital Interface. A MIDI file is a music sequence record file consisting of instructions. The finite element differential equations generate MIDI files by writing hexadecimal strings to binary files. Certain lines in the MIDI file have certain functions [7]. Enter lines to get a MIDI file. We convert the generated musical melodies into MIDI files. We need to convert the frequency value into the pitch number in the MIDI file. Its formula is: Ni=log1.05946(Bi16.345) {N_i} = {\log _{1.05946}}\left({{{{B_i}} \over {16.345}}} \right)

Bi is the i element in array Array3. It is the numerical magnitude of the frequency. Ni is the pitch number corresponding to the i sound in the MIDI file.

Variational Methods for Audio Denoising
ROF model

We describe the audio degradation process as follows: g(x,y)=I(x,y)+n(x,y) g\left({x,y} \right) = I\left({x,y} \right) + n\left({x,y} \right)

In the formula, I2 : Ω ⊂ R2R represents the original grayscale audio. Ω is the definition domain of audio. g(x, y) represents the frequency with noise. n(x, y) represents additive noise [8]. The total variational regularization model replaces its L2 norm with the L1 gradient norm. At this point we have TV[I(x,y)]=Ω|DI(x,y)|dxdy TV\left[{I\left({x,y} \right)} \right] = \int {\int_\Omega {\left| {DI\left({x,y} \right)} \right|dxdy}}

Where A represents the derivative of I in the distributional sense. DI(x, y) variational bounded function space is defined as follows: BV(Ω)={IL1(Ω):Ω|DI|dΩ<+} BV\left(\Omega \right) = \left\{{I \in {L^1}\left(\Omega \right):\int {\int_\Omega {\left| {DI} \right|d\Omega < + \infty}}} \right\}

We take the half-norm-total variation of the Banach space as the regularization term. At this point we get the ROF model: E(I)=infuBV(Ω){12Ω(gI)2dΩ+μΩ|DI|dΩ} E\left(I \right) = \mathop {inf}\limits_{u \in BV\left(\Omega \right)} \left\{{{1 \over 2}\int {\int_\Omega {{{\left({g - I} \right)}^2}d\Omega + \mu \int {\int_\Omega {\left| {DI} \right|d\Omega}}}}} \right\}

This is a minimization functional extreme value problem. The first term in the formula is called the loyalty term. This allows the recovered audio I to maintain the main characteristics of the noisy audio g. The second term is called the regular term. The purpose is to get smooth recovered audio. μ > 0 is called the scale parameter. It can balance the loyalty term and the regularity term. We use the variational method to derive the Euler-Lagrange equation for this function as follows: (gI)+μdiv(DI|DI|)=0 \left({g - I} \right) + \mu div\left({{{DI} \over {\left| {DI} \right|}}} \right) = 0

The corresponding diffusion equation is as follows: {It=(gI)+μdiv(DI|DI|)I|t=0=g(x,y)It|Ω=0 \left\{{\matrix{{{{\partial I} \over {\partial t}} = \left({g - I} \right) + \mu div\left({{{DI} \over {\left| {DI} \right|}}} \right)} \hfill \cr {I\left| {_{t = 0} = g\left({x,y} \right)} \right.} \hfill \cr {{{\partial I} \over {\partial t}}\left| {_{\partial \Omega} = 0} \right.} \hfill \cr}} \right.

The ROF model is a nonlinear anisotropic diffusion equation. The diffusion coefficient |∇u|−1 controls the diffusion behavior of the diffusion equation. It diffuses only in the orthogonal direction of the audio gradient but not in the gradient direction [9]. However, false edge directions are obtained in areas where the audio grayscale changes are flatter. If the audio grayscale is still diffused along the edge direction at this time, the noise suppression will be insufficient, and the “staircase effect” will appear.

Fourth-order PDE denoising model

We use a fourth-order PDE to suppress the “staircase effect effectively”. The fourth-order PDE does not turn the audio into several color blocks with different grayscale values like the second-order PDE. Still, it smoothes the audio into a grayscale gradient area. We establish the minimization energy functional as follows: E(I)=infuBV(Ω){12Ω(gI)2dΩ+μΩ|DI|dΩ} E\left(I \right) = \mathop {inf}\limits_{u \in BV\left(\Omega \right)} \left\{{{1 \over 2}\int {\int_\Omega {{{\left({g - I} \right)}^2}d\Omega + \mu \int {\int_\Omega {\left| {DI} \right|d\Omega}}}}} \right\}

Where Δ is the Laplace operator. It is similar to the ROF model. We use the variational method to derive the Euler-Lagrange equation for this function as follows: (gI)+μΔ(ΔI|ΔI|)=0 \left({g - I} \right) + \mu \Delta \left({{{\Delta I} \over {\left| {\Delta I} \right|}}} \right) = 0

The corresponding diffusion equation is as follows: {It=(gI)+μΔ(ΔI|ΔI|)I|t=0=g(x,y)In|Ω=0 \left\{{\matrix{{{{\partial I} \over {\partial t}} = \left({g - I} \right) + \mu \Delta \left({{{\Delta I} \over {\left| {\Delta I} \right|}}} \right)} \hfill \cr {I\left| {_{t = 0} = g\left({x,y} \right)} \right.} \hfill \cr {{{\partial I} \over {\partial n}}\left| {_{\partial \Omega} = 0} \right.} \hfill \cr}} \right.

Establishment of a music melody model based on digital image generation based on finite element differential equations

Four subvi are established by finite element differential equations. At this point, we complete the reading, processing, and conversion of the specified digital image. The first level is named grayscale histogram vi. Its function is to read the selected digital image stored in the electronic device and output the image information [10]. The second level is named data selection vi. The function is to process the data of the previous story and control the number of output data. This makes the output array data trend close to the grayscale histogram's fluctuation trend. The third level is named melody generation vi. The function converts the given array into a melody and plays it. The fourth level is called MIDI file generation vi. The position is to generate a MIDI file from the generated song. We implement the calling of each sub-vi by connecting the four sub-vis through the top-level vi. The block diagram of the top-level vi is shown in Figure 2.

Figure 2

Block diagram of top-level vi

Reading of digital image data

The reading of digital image data is completed by the grayscale histogram vi. It reads the image through the IMAQ module of finite element differential equations. We first establish an image cache through the Create control in IMAQ and then use the ReadFile power in IMAQ to develop a path to read the image [11]. The system obtains the grayscale histogram of the image file through the Histogram control in IMAQ. We convert the grayscale histogram of the image to an array Array1. At the same time, we obtain the pixel number p of the image through the pixel number control Areapixels. The output data is passed to the next level vi.

Processing of digital image data

The processing of digital image data is done by data selection vi. This sub-vi function controls the number of output data for processing the array formed by the grayscale histogram. This makes the output array Array2 keep the trend in the collection Array1. We process the data according to formula (1). We process the data in Array1 and generate array Array2 according to formula (2).

Generation of music melody

The generation of music melody is completed by music generation vi. We process the data according to formula (3). The program block diagram is shown in Figure 3. We index the frequency array by converting the elements into index values. We pass Beep. vi plays and outputs the collection Array3 at the same time.

Figure 3

The block diagram of the melody generation vi

Generation of MIDI files

MIDI vi generates the MIDI file. The system converts the frequency value in Array3 into the serial number representing the pitch in the MIDI file through formula (4). We transform the generated melody into a MIDI file to record the developed theme. This can facilitate the study and modification of the piece.

Validation of the model
Verification analysis of different grayscale images

The grayscale histogram reflects the number of pixels in the image at each grayscale. The grayscale histograms of different digital images may have the same trend. The parameter γ specifies the shape of the grayscale histogram curve of the digital image. We gamma transform the same image to achieve brightness adjustment [12]. In this way, different grayscale histograms can be obtained to generate melody lines. Fig. 4 is the Lena image under different γ values, and Fig. 5 is the gray histogram of the image under different γ values.

Figure 4

Lena plots for different γ values

Figure 5

Grayscale histograms of images with different gamma values

The generated melody lines are close to the trend of the original grayscale histogram. At this point, the purpose of the design has been achieved. The melody line fluctuation reflects the grayscale histogram's fluctuation trend. A light image with a few tonal layers is straight at the front of the melody line. At this time, the generated melody line has few fluctuations and simple changes. The notes in the melody mostly appear in the bass part.

Generation results and analysis of different scales

Figure 4(c) has the richest details. The melody line generated at this time has the most significant fluctuation. We select the C major diatonic scale and the triad to create the music score by processing Fig. 4(c). The results are shown in Figure 6.

Figure 6

Melody scores generated by different scale combinations

It is observed that Figure 6(a) is a melody generated using the C major diatonic scale. Adjacent intervals are not necessarily harmonious. The randomness of melody generation is significant. It can closely reflect the changing trend of the gray histogram. Figure 6(b) The melody produced using triads to form sounds is more harmonious. It is suitable for chord arpeggio generation.

Conclusion

This paper mainly studies the algorithm of generating music melody based on the digital image grayscale histogram based on the finite element differential equation. We analyze the relationship between digital image grayscale histograms and the musical piece. We convert the grayscale histogram of a given digital image into a theme and build a music melody algorithm. We have established an algorithm for generating musical melody based on the grayscale histogram of digital images based on finite element differential equations. We take the standard Lena diagram in printing to verify the algorithm of generating music melody from a digital image grayscale histogram. At this time, we analyze the music melody effect and get a more harmonious music effect. We convert the music melody algorithm to a MIDI file. The article can be played on the computer through music editing software. At this point, we complete the verification of the music melody algorithm.

Figure 1

Random number generation melody block diagram
Random number generation melody block diagram

Figure 2

Block diagram of top-level vi
Block diagram of top-level vi

Figure 3

The block diagram of the melody generation vi
The block diagram of the melody generation vi

Figure 4

Lena plots for different γ values
Lena plots for different γ values

Figure 5

Grayscale histograms of images with different gamma values
Grayscale histograms of images with different gamma values

Figure 6

Melody scores generated by different scale combinations
Melody scores generated by different scale combinations

Isea, R. An Algorithm to Predict the Possible SARS-CoV-2 Mutations. International Journal of Coronaviruses., 2021; 3(1): 1–7 IseaR. An Algorithm to Predict the Possible SARS-CoV-2 Mutations International Journal of Coronaviruses 2021 3 1 1 7 10.14302/issn.2692-1537.ijcv-21-3804 Search in Google Scholar

Morris, J. W., Prey, R., & Nieborg, D. B. Engineering culture: logics of optimization in music, games, and apps. Review of Communication., 2021; 21(2): 161–175 MorrisJ. W. PreyR. NieborgD. B. Engineering culture: logics of optimization in music, games, and apps Review of Communication 2021 21 2 161 175 10.1080/15358593.2021.1934522 Search in Google Scholar

Zhang, X., & Alijla, B. Research on inheritance and innovation mode of erhu art development based on intelligent algorithm. Journal of Intelligent & Fuzzy Systems., 2019; 37(3): 3327–3334 ZhangX. AlijlaB. Research on inheritance and innovation mode of erhu art development based on intelligent algorithm Journal of Intelligent & Fuzzy Systems 2019 37 3 3327 3334 10.3233/JIFS-179135 Search in Google Scholar

Zheng, Y. Optimization Research of Multimedia Technology Based on Multi-Chromosome Genetic Algorithm in College Music Teaching. Tobacco Regulatory Science., 2021; 7(5): 1958–1965 ZhengY. Optimization Research of Multimedia Technology Based on Multi-Chromosome Genetic Algorithm in College Music Teaching Tobacco Regulatory Science 2021 7 5 1958 1965 10.18001/TRS.7.5.116 Search in Google Scholar

Maasø, A., & Hagen, A. N. Metrics and decision-making in music streaming. Popular Communication., 2020; 18(1): 18–31 MaasøA. HagenA. N. Metrics and decision-making in music streaming Popular Communication 2020 18 1 18 31 10.1080/15405702.2019.1701675 Search in Google Scholar

Wang, A., & Gao, X. Hybrid variable-scale clustering method for social media marketing on user generated instant music video. Tehnički vjesnik., 2019; 26(3): 771–777 WangA. GaoX. Hybrid variable-scale clustering method for social media marketing on user generated instant music video Tehnički vjesnik. 2019 26 3 771 777 Search in Google Scholar

Lüders, M. Ubiquitous tunes, virtuous archiving and catering for algorithms: the tethered affairs of people and music streaming services. Information, Communication & Society., 2021; 24(15): 2342–2358 LüdersM. Ubiquitous tunes, virtuous archiving and catering for algorithms: the tethered affairs of people and music streaming services Information, Communication & Society 2021 24 15 2342 2358 10.1080/1369118X.2020.1758742 Search in Google Scholar

Shi, Z., He, Q., & Liu, Y. Accelerating parallel Jacobi method for matrix eigenvalue computation in DOA estimation algorithm. IEEE Transactions on Vehicular Technology., 2020; 69(6): 6275–6285 ShiZ. HeQ. LiuY. Accelerating parallel Jacobi method for matrix eigenvalue computation in DOA estimation algorithm IEEE Transactions on Vehicular Technology 2020 69 6 6275 6285 10.1109/TVT.2020.2984705 Search in Google Scholar

Zhou, Z., & Wang, X. Rational design and structure-based engineering of alkaline pectate lyase from Paenibacillus sp. 0602 to improve thermostability. BMC biotechnology., 2021; 21(1): 1–12 ZhouZ. WangX. Rational design and structure-based engineering of alkaline pectate lyase from Paenibacillus sp. 0602 to improve thermostability BMC biotechnology 2021 21 1 1 12 10.1186/s12896-021-00693-8809173533941157 Search in Google Scholar

Çitil, H. Important Notes for a Fuzzy Boundary Value Problem. Applied Mathematics and Nonlinear Sciences., 2019;4(2): 305–314 ÇitilH. Important Notes for a Fuzzy Boundary Value Problem Applied Mathematics and Nonlinear Sciences 2019 4 2 305 314 10.2478/AMNS.2019.2.00027 Search in Google Scholar

Selvi, M. & Rajendran, L. Application of modified wavelet and homotopy perturbation methods to nonlinear oscillation problems. Applied Mathematics and Nonlinear Sciences., 2019; 4(2): 351–364 SelviM. RajendranL. Application of modified wavelet and homotopy perturbation methods to nonlinear oscillation problems Applied Mathematics and Nonlinear Sciences 2019 4 2 351 364 10.2478/AMNS.2019.2.00030 Search in Google Scholar

Zhang, L., Zhao, M., & Zhao, D. Bipartite graph link prediction method with homogeneous nodes similarity for music recommendation. Multimedia Tools and Applications., 2020;79(19): 13197–13215 ZhangL. ZhaoM. ZhaoD. Bipartite graph link prediction method with homogeneous nodes similarity for music recommendation Multimedia Tools and Applications 2020 79 19 13197 13215 10.1007/s11042-019-08451-x Search in Google Scholar

Articoli consigliati da Trend MD

Pianifica la tua conferenza remota con Sciendo