当前位置:网站首页>[music] playing blue and white porcelain based on MATLAB [including Matlab source code 1873]
[music] playing blue and white porcelain based on MATLAB [including Matlab source code 1873]
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 《 blue and white porcelain 》【 contain Matlab Source code 1873 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
边栏推荐
- 【MATLAB】图像复原
- 2021-02-27image processing of MATLAB
- LeetCode 1749 Maximum Absolute Sum of Any Subarray (dp)
- [error record] Android application security detection vulnerability repair (strandhogg vulnerability | set activity component android:taskaffinity= "")
- Leetcode 1094 car pooling (Analog)
- 数据库概述
- [leetcode] merge K ascending linked lists
- 【MATLAB】图像分割
- [leetcode] breadth first search level traversal general disassembly template
- 【MATLAB】图像基本运算(点运算、算术运算、缩放、旋转)
猜你喜欢

Win11触摸键盘主题如何更换?Win11更换触摸键盘主题的方法

Deep exploration of functions with indefinite parameters in C language

Interviewer: let me introduce the items in your resume. Tell me more about them, and attach the actual project

2021-2-26编程语言知识点整理

2.0 detailed explanation of ROS and Px4 communication
![[leetcode] restore binary search tree](/img/92/14c4d670f318f93297040241a61c41.jpg)
[leetcode] restore binary search tree
![[leetcode] path sum II (first glimpse recursion + backtracking)](/img/a8/54920e54a026ebef3eb0a1336e5b62.jpg)
[leetcode] path sum II (first glimpse recursion + backtracking)

On permutation and Combination in Probabilistic Statistics
![[leetcode] ordered linked list transformation binary search tree](/img/9f/86e819beb8dc678d79c3e307891402.jpg)
[leetcode] ordered linked list transformation binary search tree

(已解决)Latex--取消正文中参考文献引用的上标显示(gbt7714-2015会导致默认上角标引用)(上角标&平齐标混合使用教程)
随机推荐
Deep exploration of functions with indefinite parameters in C language
Xpath注入
【圖像處理】基於matlab GUI多功能圖像處理系統【含Matlab源碼 1876期】
Win11画图工具没了怎么重新安装
LeetCode 1029 Two City Scheduling (dp)
逻辑漏洞 / 业务漏洞
字节北京23k和拼多多上海28K,我该怎么选?
[matlab] basic image operation (point operation, arithmetic operation, scaling and rotation)
【HaaS Hands-On】全新视频节目上线 创意案例我们一起上手做 第一期E01: 物联网工程师 和你一起上手做遥控机械臂
1.3 introduction to ROS UAV
Derivation of Kalman filter (KF) and extended Kalman filter (EKF)
Sparrowrecsys recurrence record
關於概率統計中的排列組合
Kubernetes binary installation (v1.20.15) (VII) plug a work node
【图像处理】基于matlab GUI多功能图像处理系统【含Matlab源码 1876期】
【MATLAB】图像复原
Leetcode string problem
[BSP video tutorial] BSP video tutorial issue 17: single chip microcomputer bootloader topic, startup, jump configuration and various usage of debugging and downloading (2022-06-10)
【MATLAB】图像分割
1.2. Ros+px4 preliminary basic knowledge