当前位置:网站首页>[music] playing "over fire" based on MATLAB [including Matlab source code 1875]
[music] playing "over fire" based on MATLAB [including Matlab source code 1875]
2022-06-11 01:58:00 【Poseidon light】
One 、 How to get the code
How to get the code 1:
【 music 】 be based on matlab play 《 Overdo 》【 contain Matlab Source code 1875 period 】
How to get the code 2:
By subscribing to Ziji Shenguang blog Paid column , With proof of payment , Private Blogger , This code is available .
remarks :
Subscribe to Ziji Shenguang blog Paid column , Free access to 1 Copy code ( The period of validity From the Subscription Date , Valid for three days );
Two 、 Introduction to the study of music generation
1 Preface
In recent years, many virtual singers have appeared on the Internet , For example, Sony's virtual singer sonizi , With cartoon 、CG Image and role presentation , Combined sound by speech synthesis engine ( for example VOCALOID 2) Based on the development of virtual singer software role . Recently, Tencent video also launched 《 The children of tomorrow 》 show , In the program, the two-dimensional virtual players are startled “ Haze He Z”, Haze He Z With an original song 《 can 》 Competition , As soon as it appeared, it aroused the discussion of the vast number of Internet users . thus it can be seen , Music composition has great entertainment significance .
Music synthesis is a part of speech signal processing , Belong to Matlab One of the important application fields of software , Matlab It has powerful drawing and computing ability , master Matlab Use of software , It has laid a foundation for the future research of electronic information , So I hope I can do it by myself on the computer Matlab Realize the synthesis of your favorite music .
2 Overview of the development of music generation technology
Computer music , seeing the name of a thing one thinks of its function , It means using computer software and cooperating with MIDI The keyboard makes open music , He can compose and express music , It is also a new form of music expression , In recent years, it is especially hot at home and abroad . In recent years in our country , Computer music has also become a trend .
2.1 The sprout of music generation technology
Early game music was not as usable as it is now CD High quality recording with high-level sound quality , Because there was not enough technical support for the game console at that time . So the game music needs to be synthesized , Designers must embed the basic sound synthesis engine into the hardware of the game console . Chip music was born , This is the sprout of music generation technology .
2.2 Matlab In music generation
Matlab ( Matrix lab ) yes MATrix LABoratory Abbreviation , It can be used for algorithm development , Data visualization , Data analysis, numerical calculation and so on , Is a very excellent technology application software .
Music for different instruments , Analyze with audio software , You can get the difference of audio signals of different musical instruments , Then you can go through Matlab Simulate the audio signal , To get the sounds of different instruments , Realize virtual performance .
3 The background and significance of music generation research
3.1 The research background of music generation
The application of computer music technology is very extensive , For example, music creation , Music education and music score making , And greatly improve the efficiency of music creation and production . At the same time, people make music , The playing process is simplified , And can participate in the creation and production , Be able to listen to and appreciate your own music . Modern technology makes everyone's dream of becoming a musician come true . This is conducive to the popularization and promotion of music and computer technology , It plays an inestimable role in the future development .
3.2 The entertainment significance of music generation
At present, with the progress and development of Technology , There have been many virtual singers , Among them, the most famous is the future of Chu Yin . It is from CRYPTON FUTUREMEDIA utilize YAMAHA Of VOCALOID A series of speech synthesis programs to carry out the audio source of card method . This software has brought great changes to synthetic technology , But some parts still need to be further improved .“ Virtual singer ” and “ Hertz He Z” The appearance of virtual singers , It also brings great vitality to the entertainment circle , thus it can be seen , The study of music synthesis has great entertainment significance .
3.3 The significance of music generation to music creation
Traditional music creation is a long-term , complex , A job that requires multi-party cooperation . But computer generated music , The composer can do the work by himself , At the same time, it can also better reflect their own music ideas in the creative process . Producers can also constantly modify their music during the creation process , The efficiency of music creation has been improved .
4 Research methods of music generation
4.1 Realize music generation
Matlab Music playing can be realized by sound Function implementation , There are three variables (Y, fs, bits) Each represents the input signal 、 Sampling rate 、 Bit rate . The sampling rate here is set to fs=44100. Input signal Y It is usually a sine wave , Such as A·sin (2·pi·w·t) . among A Controls the size of the sound , w Controlling the level of the sound , t The range controls the length of the sound . The bit rate adopts the default value . The editing of sound quality and timbre is not involved here .
The frequency of sound is shown in the table 1 Shown , Pitch and frequency are exponentially related , They satisfy the following relationship , p It's pitch , f It's the frequency .f=440x2 (p-69) /12, Every semitone rise in pitch , p+1.
Through the understanding of the above knowledge , We can use matlab To make music .
surface 1 The frequency of sound 
4.2 Fourier series to achieve music generation
To realize the synthesis of music , First of all, we should understand the three characteristics of sound : tone , Loudness and timbre [.
The pitch is the pitch , The main factor affecting tone is the frequency of sound wave . Loudness is the strength of a sound , The main factor affecting loudness is the vibration amplitude of sound wave . The change of timbre is caused by the harmonic wave in the music waveform , Different instruments have different timbres , So the harmonics are different .
4.2.1 tone
Every piece of music has a tone , Every roll call (do re mi) The fundamental frequency is not fixed , The tone determines the fundamental frequency value of the medium roll in the music . For example, the score is 1=C, It means that the tone is C Regulation “1 (do) ” The fundamental frequency of is 261.6Hz, If the score is 1=E be “1 (do) ” The frequency is 239.6Hz, The score is 1=G be “1 (do) ” The frequency is 392.1Hz, “3 (mi) ” The frequency is 493.9Hz.
4.2.2 timbre
The difference in timbre is due to the effect of harmonics , In the field of music, we often call harmonics overtones . When we determine the pitch of the score , We only specify the fundamental frequency of the roll call , But I can't tell what instrument makes the sound , Only monotonous do re mi. And different instruments , His envelope waveforms are also different . Because the envelope waveform of music is very complex , We will approximately linearize the complex envelope function , So the envelope of music waveform is usually broken line type .
4.2.3 The law of twelve averages
The law of twelve averages , Also known as the law of twelve equal processes , It's a kind of music method , Divide an octave into twelve equal parts , Each bisection is called a semitone , It's the main tuning method . because “ The law of five degrees ” and “ The law of twelve averages ” The pronunciation is very similar and the twelve mean law can solve the problem of transfer , therefore , It is widely used in keyboard instruments and symphony orchestras .
To facilitate the analysis of the above three features , We need to analyze the spectrum of the signal , That is, using Fourier transform , Get the spectrum structure of the music signal , Extract its spectral characteristics .
To compose a piece of music , You need to know the fundamental frequency of the music 、 Harmonic composition, etc . Therefore, Fourier analysis must be performed [4].
Using this formula , The Fourier transform value of any frequency point can be calculated .
4 The principle of music score analysis
This experiment selects songs despacito Parse and compose . First of all, let's introduce some basic knowledge of music score , Pictured 1 Shown : The song itself has a quarter beat , The note with a horizontal line under it is one eighth of a beat , Two horizontal lines are one sixteenth of a beat , Tempo can be understood as speed .
The small black dots at the bottom of each note indicate that the tone drops by an octave , Two means two octaves lower .
The dot after each note means that the note is repeated again but the beat is increased by one ( For example, one quarter beat becomes one eighth beat ) . And if the note is followed by a horizontal line , It means that this note is repeated again , The beat is the same .
Because the tune of this song is D transfer , So according to 12 The calculation method of the law of averages , First A=440Hz.12 The adjacency of a chromatic scale is 12 2 (122≈1.0594631) then B=440Hz x 1.0594631=466.16Hz B=466.16Hz x 1.0594631=493.88Hz C=493.88Hz x1.0594631=523.25Hz therefore D=554.36Hz.
3、 ... and 、 Partial source code
fs = 44100; % Sampling rate
dt = 1/fs;
T16 = 0.25;
t16 = [0:dt:T16];
[temp k] = size(t16);
t8=linspace(0,2*T16,2*k);
t8fd=linspace(0,3*T16,3*k);
t4=linspace(0,4*T16,4*k);
t4fd=linspace(0,5*T16,5*k);
t2fd=linspace(0,7*T16,7*k);
t2=linspace(0,6*T16,6*k);
[temp i] = size(t4);
[temp j] = size(t8);
Four 、 Running results
Only music effect , No visual effects
5、 ... and 、matlab Edition and references
1 matlab edition
2014a
2 reference
[1] Zhang Zihao . be based on Matlab The study of music production in [J]. Electronic production . 2018,(16)
3 remarks
This part of the introduction is taken from the Internet , For reference only , If infringement , Contact deletion
边栏推荐
- Elsevier ---elseviewer--- preprint online publishing notice
- LeetCode 1024 Video Stitching (dp,jump game)
- Leetcode 652 find duplicate subtrees (recommended by DFS)
- 并发编程基础底层原理学习(四)
- 2021-3-1MATLAB写cnn的mnist数据库训练
- 【MATLAB】图像压缩编码(DCT、RLE)
- Leetcode 698 partition to K equal sum subsets (DFS pruning)
- (solved) latex -- cancel the superscript display of references in the text (gbt7714-2015 will lead to the default superscript reference) (tutorial on mixed use of superscript and flush)
- Kubernetes binary installation (v1.20.15) (VII) plug a work node
- 数据库概述
猜你喜欢

关于概率统计中的排列组合
![[leetcode] different binary search trees (recursion - recursion + memory search optimization - dynamic programming)](/img/ae/a6e7b8ebb098f631344024ffa80e76.jpg)
[leetcode] different binary search trees (recursion - recursion + memory search optimization - dynamic programming)

逻辑漏洞 / 业务漏洞

【BSP视频教程】BSP视频教程第17期:单片机bootloader专题,启动,跳转配置和调试下载的各种用法(2022-06-10)

Win11画图工具没了怎么重新安装

Clip paper details

基于Gin、Gorm实现的在线练习系统之项目梳理

2021-02-27MATLAB的图像处理

【云原生 | Kubernetes篇】Ingress案例实战

1个月不到暴增900万播放量,B站3个流量增长密码!
随机推荐
"It looks like robbing tickets but actually robbing money". Don't be fooled by fancy ticket robbing products again and again
Matlab array other common operation notes
2021-07-18 ROS笔记-基础和通讯
Win11怎么更改管理员头像?Win11更换管理员头像的方法
神经网络极简史,神经网络知识点整理
[leetcode] path sum II (first glimpse recursion + backtracking)
How to reinstall win11 drawing tool when it is missing
Threejs: pit encountered in drawing Bessel curve with two-point coordinates
2021-2-26 compilation of programming language knowledge points
Flutter status management
2021-2-14 gephi学习笔记
[matlab] image transform (Fourier transform, discrete cosine transform)
2021-3-1MATLAB写cnn的mnist数据库训练
爱思唯尔---Elseviewer---预印本在线发表通知
Within one month, the broadcasting volume has increased by 9million, and station B has three traffic growth passwords!
5月B站榜单丨飞瓜数据UP主成长排行榜(B站平台)发布
[leetcode] construct a binary tree by traversing the sequence from front to middle (continuous optimization)
【MATLAB】图像分割
[leetcode] different binary search trees (recursion - recursion + memory search optimization - dynamic programming)
Dialog alertdialog, simpledialog, showmodalbottomsheet, showtoast shutter custom dialog