Nanyin data characterization method and system
By recording and processing Nanyin Pipa audio with portable devices, a digital sequence of Nanyin music information is generated, which solves the problem that existing technology cannot accurately represent the characteristics of Nanyin, realizes the automated production and high-quality representation of Nanyin data sets, and improves the music generation model. expressiveness.
Patent Information
- Application Number
- CN202411195851.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-09-24
AI Technical Summary
Existing music representation methods cannot accurately represent the characteristics of Nanyin, making it difficult to apply Nanyin data sets to music generation models, and producing high-quality Nanyin data sets requires a lot of manpower and professional equipment.
A portable device is used to record Nanyin Pipa audio, and a corpus of Nanyin music information is generated through transcription, preprocessing and encoding. The mido library and Madmom library are used for beat tracking detection and time unit conversion. Finally, the corpus is encoded into a digital sequence for representation.
It has realized the automated production of Nanyin data sets, effectively integrated Nanyin features, reduced data acquisition and production costs, and improved the expressiveness of the music generation model.
Smart Images

Figure CN118692476A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of the intersection of artificial intelligence, deep learning and speech processing, and specifically relates to a Nanyin data characterization method and system. Background Art
[0002] The datasets currently used for music generation research mainly cover Western classical, jazz and pop music styles, and the instruments are mainly piano, saxophone and drums, such as Lakh MIDI dataset, Maestro dataset, JSB-Chorale, etc. Although there are a large number of datasets, their styles are different from Nanyin, resulting in the inability of existing music representation methods, such as MIDI-LIKE and REMI, to accurately represent the characteristics of Nanyin, and thus cannot be used in the model for Nanyin music generation.
[0003] For music that is not digitized and is used for music generation-related tasks, it takes a lot of manpower to produce a high-quality dataset with performance information. Beat tracking of the recorded audio usually requires the guidance of professionals, as well as professional equipment for audio collection to ensure the quality of the dataset.
[0004] In summary, for the acquisition of Nanyin dataset, we choose to use portable devices (smartphones, etc.) for recording to reduce the cost of data acquisition, and perform data representation after preprocessing the collected audio, which can enable the model to learn the characteristics of Nanyin more fully and perform better in generation tasks. Summary of the invention
[0005] The present invention aims to solve the deficiencies of the prior art and provides the following solutions:
[0006] A method for characterizing Nanyin data comprises the following steps:
[0007] S1. Collecting Nanyin Pipa audio, and transcribing the Nanyin Pipa audio to obtain a transcribed audio sample;
[0008] S2. Preprocessing the transcribed audio sample to obtain a corpus of southern music information;
[0009] S3. Encode the corpus, convert the encoded sequence into a digital sequence, and represent it in the form of a digital sequence.
[0010] Preferably, the method for obtaining the transcribed audio comprises:
[0011] S1.1. Record the audio of the Nanyin pipa played by a portable recording device to obtain a number of audio samples;
[0012] S1.2. segmenting the audio sample using Cubase to reduce the sequence length of the sample to obtain a plurality of segmented samples;
[0013] S1.3. Transcribe the plurality of segmented samples into midi format to obtain a plurality of transcribed audio samples.
[0014] Preferably, the pretreatment method comprises:
[0015] S2.1. Use the mido library to convert the transcribed audio sample into an editable midi object and traverse each audio track;
[0016] S2.2. Extract the time signature in the converted transcribed audio sample, and use the Madmom library to perform beat tracking detection to obtain a beat time estimate;
[0017] S2.3. Calculate the number of ticks per beat in the transcribed audio sample according to the time signature, and interpolate the number of ticks in the beat time estimation to obtain a time unit conversion mapping table;
[0018] S2.4. Calculate the tempo change table for each beat in the transcribed audio sample according to the time point of the beat tracking detection, and convert the time unit of the note and the time unit of the tempo change table into ticks using the time unit conversion mapping table;
[0019] S2.5. Calculate the actual time corresponding to the first strong beat based on the beat moment estimation, then calculate the difference between the actual time and the theoretical time corresponding to the first strong beat, and apply the difference to the tempo change table and the starting position of the note, so that the beat time in the transcribed audio sample is aligned with the theoretical time;
[0020] S2.6. Quantify the start time, duration, intensity and rhythm of the aligned transcribed audio samples according to a predefined mapping table to obtain the corpus of southern music information.
[0021] Preferably, the method for obtaining the digital sequence comprises:
[0022] S3.1. Encode the corpus into a compound word event sequence, and use the ignore tag to fill in the missing tag type of each time step in the compound word event sequence;
[0023] S3.2. Convert the compound word event sequence into the corresponding digital sequence and save it as an npy file.
[0024] The present invention also provides a Nanyin data characterization system, the system applies any of the above methods, and is characterized by comprising: a transcription module, a preprocessing module and an encoding module;
[0025] The transcription module is used to collect Nanyin Pipa audio, and transcribe the Nanyin Pipa audio to obtain a transcribed audio sample;
[0026] The preprocessing module preprocesses the transcribed audio sample to obtain a corpus of southern music music information;
[0027] The encoding module encodes the corpus and converts the encoded sequence into a digital sequence to represent it in a digital sequence.
[0028] Preferably, the transcription module comprises: an audio recording unit, an audio segmentation unit and a transcription unit;
[0029] The audio recording unit uses a portable recording device to record the audio of the Nanyin pipa played to obtain a number of audio samples;
[0030] The audio segmentation unit segments the audio sample using Cubase to reduce the sequence length of the sample and obtain a plurality of segmented samples;
[0031] The transcription unit transcribes the plurality of segmented samples into a MIDI format to obtain a plurality of transcribed audio samples.
[0032] Preferably, the preprocessing module includes: a first conversion unit, a beat detection unit, a first calculation unit, a second conversion unit, a second calculation unit and a quantization unit;
[0033] The first conversion unit converts the transcribed audio sample into an editable midi object using the mido library, and traverses each audio track;
[0034] The beat detection unit is used to extract the time signature in the converted transcribed audio sample, and use the Madmom library to perform beat tracking detection to obtain a beat time estimate;
[0035] The first calculation unit calculates the number of ticks per beat in the transcribed audio sample according to the beat signature, and interpolates the number of ticks in the beat time estimation to obtain a time unit conversion mapping table;
[0036] The second conversion unit calculates a tempo change table for each beat in the transcribed audio sample according to the time point of the beat tracking detection, and converts the time unit of the note and the time unit of the tempo change table into ticks using the time unit conversion mapping table;
[0037] The second calculation unit calculates the actual time corresponding to the first strong beat based on the beat moment estimation, then calculates the difference between the actual time and the theoretical time corresponding to the first strong beat, and applies the difference to the tempo variation table and the starting position of the note, so that the beat time in the transcribed audio sample is aligned with the theoretical time;
[0038] The quantization unit is used to quantize the start time, duration, strength and rhythm in the aligned transcribed audio samples according to a predefined mapping table to obtain the corpus of southern music music information.
[0039] Preferably, the encoding module comprises: an encoding unit and a sequence conversion unit;
[0040] The encoding unit is used to encode the corpus into a compound word event sequence, and fill in the missing tag type of each time step in the compound word event sequence with an ignore tag;
[0041] The sequence conversion unit converts the compound word event sequence into the corresponding digital sequence and saves it as an npy file.
[0042] Compared with the prior art, the present invention has the following beneficial effects:
[0043] The present invention is applicable to the Nanyin music generation model for the first time. The acquired audio data are all Nanyin pipa music, which can effectively solve the problem that there is no Nanyin data set at present. At the same time, the data set production of the present invention is fully automated. Only the original Nanyin pipa audio needs to be input to automatically complete the production of the symbol data set. The data representation method effectively integrates the characteristics of Nanyin, and provides data guarantee for subsequent generation tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0045] Figure 1 A schematic diagram of a method flow of an embodiment of the present invention;
[0046] Figure 2 Schematic diagram of the system structure of an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0049] Embodiment 1
[0050] In this embodiment, if Figure 1 As shown, a method for characterizing Nanyin data includes the following steps:
[0051] S1. Collect Nanyin Pipa audio, and transcribe the Nanyin Pipa audio to obtain a transcribed audio sample.
[0052] The method for obtaining transcribed audio includes: S1.1. Using a portable recording device to record the audio of a Nanyin pipa being played to obtain a number of audio samples; S1.2. Using Cubase to segment the audio samples to reduce the sequence length of the samples to obtain a number of segmented samples; S1.3. Transcribing the segmented samples into a midi format to obtain a number of transcribed audio samples.
[0053] In this embodiment, the method for obtaining the transcribed audio specifically includes:
[0054] S1.1. Collect the Nanyin Gongche notation data uploaded by "Quanzhou Nanyin Network", including fingering, score, and music, and use a portable recording device to record the audio of the pipa being played. The basic pitch of the pipa is tuned to A=442Hz. With unified data set parameters, save the file in mp3 or m4a format to obtain several audio samples.
[0055] S1.2. Considering that the generative model is limited by the length of the input sequence, in order to reduce the memory occupied during training and allow the model to generate longer music clips, Cubase is used to segment each recorded audio to reduce the sequence length of each input sample, which takes about 2-3 minutes to obtain several segmented samples. The generative model here refers to a music generation model that generates music using a represented digital sequence.
[0056] S1.3. Use the audio editing software Melodyne5 to check whether there is polyphony and noise, and delete them if any. Then identify the pitch information in the audio, capture the dynamic changes in the performance, estimate the start and end time, transcribe the mp3 or m4a file into a midi file, and obtain the transcribed audio sample.
[0057] S2. Preprocess the transcribed audio samples to obtain a corpus of Nanyin music information.
[0058] The preprocessing method includes: S2.1. Using the mido library to convert the transcribed audio sample into an editable midi object and traverse each audio track; S2.2. Extracting the time signature in the converted transcribed audio sample, and using the Madmom library to perform beat tracking detection to obtain a beat time estimate; S2.3. Calculating the number of ticks per beat in the transcribed audio sample according to the time signature, and interpolating the number of ticks in the beat time estimate to obtain a time unit conversion mapping table; S2.4. Calculating the tempo change table for each beat in the transcribed audio sample according to the time point of the beat tracking detection, And use the time unit conversion mapping table to convert the time units of the notes and the time units of the tempo change table into ticks; S2.5. Calculate the actual time corresponding to the first strong beat based on the beat moment estimation, then calculate the difference between the actual time and the theoretical time corresponding to the first strong beat, and apply the difference to the tempo change table and the starting position of the notes to align the beat time in the transcribed audio sample with the theoretical time; S2.6. Quantify the start time, duration, intensity and rhythm in the aligned transcribed audio sample according to the predefined mapping table to obtain a corpus of southern music information.
[0059] In this embodiment, the preprocessing method specifically includes:
[0060] S2.1. For each transcribed audio converted into MIDI format, use the mido library in Python to convert it into an editable MIDI object, traverse the "msg" type in each audio track, and if it is a "time_signature", extract its numerator and denominator respectively, where the numerator represents the number of beats in a measure, and the denominator represents how many notes each beat is.
[0061] S2.2. Load the audio file corresponding to the MIDI file, extract the time signature of the MIDI file according to the method in S2.1, use the Madmom library to track the beats, and get the beat time estimation: First, preprocess the audio signal so that it can be used as the input of the recurrent neural network (RNN), and use the Hanning window to perform overlapping segmentation on the audio signal, with 100 frames per second (fps); perform short-time Fourier transform (STFT) based on the above segmentation, discard the phase features, and only retain the amplitude features, because the human ear cannot perceive the phase change; to ensure the accuracy of the time domain and frequency domain, use three window sizes of 1024, 2048 and 4096 when performing STFT; limit the frequency band to the range of [30, 17000] Hz, and divide each octave into 3, 6 and 12 frequency bands according to the frequency distribution characteristics, corresponding to the above three window sizes; perform the first-order difference of the spectrum, and merge it with the original spectrum features as a feature (concat) to form the final input network feature; finally, the feature dimension of the input network is 314. In this embodiment, the two-part model of DBNDownBeatTrackingProcessor and RNNDownBeatProcessor in the madmom library is used. RNNDownBeatProcessor is responsible for the RNN network part, and DBNDownBeatTrackingProcessor is responsible for the dynamic Bayesian network part. From a macroscopic point of view, the positions of beats and downbeats are roughly determined by RNN, and then the hidden Markov model (HMM) determines the final position according to the periodic conditions. Using the long short-term memory network (LSTM), two probability values are output for each frame (the probability of a beat and the probability of a downbeat), and the larger value is taken as the classification result of the frame. Set the threshold θ=0.05, and only the results greater than the threshold are judged as beats or downbeats to reduce the interference of the blank parts at the beginning and end of the audio. The RNN network cannot perceive the periodicity of the downbeat, so HMM is needed to process the beat excitation function output by the RNN (a signal in which the probability of the beat occurring changes over time). HMM determines which positions are strong beats, which positions are weak beats, and which positions are not beats, and outputs the final beat time estimation result.
[0062] S2.3. When processing transcribed audio files in MIDI format, it is usually necessary to convert the time in seconds to the time in ticks (MIDI clock cycles), which can provide higher time accuracy than seconds and ensure accurate synchronization between different events. Define that each quarter note has 480 ticks, calculate the number of ticks per beat of the sample according to the time signature extracted by method 2.1, and interpolate in the rhythm moment estimation array output in method S2.2 to obtain the time unit conversion mapping table.
[0063] S2.4. To simulate the expressive rhythmic dynamics in music, the tempo change of each beat is calculated based on the beat moment estimation results obtained in S2.2:
[0064] ,
[0065] Then, the time unit conversion mapping table obtained in S2.3 is used to convert the time unit of the note and the time unit of the tempo change table into ticks.
[0066] S2.5. Calculate the symbol time corresponding to the first strong beat detected in the audio according to the beat time estimate obtained in S2.2:
[0067] ,
[0068] Among them, shift_align indicates the symbol time that should be shifted, ticks_per_beat indicates the number of ticks per beat, time_signature[0] indicates the number of beats per measure, and first_db_tick indicates the symbol time corresponding to the first strong beat; the value that should be shifted to make the actual start time of each beat correspond to the theoretical time is calculated, and the offset is applied to all tempo changes and note start positions to ensure that the beat time in the transcribed audio sample in midi format is aligned with the theoretical time.
[0069] S2.6. In order to reduce the vocabulary size, the start time, duration, intensity, and rhythm in the midi data are quantized according to a predefined mapping table, where 120 ticks are used as the unit time to facilitate the calculation of subsequent bar positions, and a corpus of southern music information is obtained.
[0070] S3. Encode the corpus and convert the encoded sequence into a digital sequence and represent it in the form of a digital sequence.
[0071] The method for obtaining a digital sequence includes: S3.1. Encoding the corpus into a compound word event sequence, and using the ignore tag to fill in the missing tag type of each time step in the compound word event sequence; S3.2. Converting the compound word event sequence into a corresponding digital sequence and saving it as an npy file.
[0072] In this embodiment, the method for obtaining the digital sequence specifically includes:
[0073] S3.1. In sequence modeling, a transformation function g( ) is used, which can transform a musical piece X into a time sequence with symbolic elements. , where ω iRepresents the label corresponding to the element in the music at this time step, i=1,2,...,T, T represents the length of the generated sequence. Given a certain number of such sequences, a neural sequence model can be trained, which uses an architecture such as Transformer to learn to generate new sequences S'; then, a deterministic inverse function g is used -1 ( ), a new piece of music is obtained from the generated sequence, that is, X'= g -1 (S'), the algorithms for implementing the conversion function and its inverse function may be different, so the same piece of music may have multiple sequence representations, e.g. and , represents a function that converts a musical piece X into a time series with symbolic elements by a midi-like method. Represents a function that converts a musical work X into a time series with symbolic elements by the REMI method. Different conversion functions (or sequence representations) have different vocabularies M, so S midi-like and S REMI There are differences on both T and M. midi-like or S REMI The elements in are called single tokens, i.e., ω i , which come from a predefined vocabulary , each tag is associated with a type set Associating with the types defined in , V can be divided into K subsets according to the tag type, that is, ; The marker sequence (such as S REMI ) is converted into a compound word sequence S CP First, similar tokens that jointly define a type of musical event are combined into a super token, that is, placed on the same time step. The musical event here can be a note-related event, that is, creating a new note; it can also be a beat-related event, such as marking the start of a new beat or a new measure. For example, in REMI, notes are created by consecutive tokens of [pitch], [duration], and [intensity], which are grouped in CP. In REMI, rhythm or chord changes only occur at the start of a beat, so we also group [bar_beat], [time signature], and [rhythm]. Therefore, the model can make multiple predictions (i.e., generate multiple tokens) at each time step. Secondly, the "[ignore]" token is used to fill in the missing token types in each time step, so that there are K tokens to predict in each time step. This is done to make modeling feasible, otherwise the shape and meaning of the target output at each time step will be uncertain. In other words, a compound word is composed of K word chunks, each of which comes from the corresponding subset , these word blocks are placed at the same time step t. Such a Nanyin sample can be expressed as ,in Here, the transformation function g( ) is considered as a stretch-compression technique, because the original sequence is first expanded to KT CP A single token sequence is then compressed into T CP Compound word sequence, generally speaking, To facilitate modeling of CP, the type set L is further divided into F families. For example, if L can be divided into two families, namely, the note family L N and the metric family L M , then we can get ,in, represents the empty set. Each compound word cp t Both with a family marker f t For cp related to the measurement t ,exist In this case, there will be Similarly, for the cp associated with a note t ,exist When .
[0074] S3.2. The sequence obtained by encoding the corpus in S3.1 is ,in, Indicates i The number of beats per minute at time steps ( tempo ) corresponding to the string, Indicates i The time signature at the time step ( time_signature ) corresponding to the string, Indicates i The position of the note in the measure at the time step ( bar_beat ) corresponding to the string, Indicates i The event type at the time step ( type ) corresponding to the string, Indicates i The pitch of the note at time steps ( pitch ) corresponding to the string, Indicates i The note duration at each time step ( duration ) corresponding to the string, Indicates i The note velocity at each time step ( velocity) corresponding string; all the values involved in the event build a mapping table, and convert the string sequence into a digital sequence according to the mapping table. For example, [8, 2, 2, 1, 0, 0, 0] means that the real values of tempo, time_signature, and bar_beat correspond to a value in the mapping table. Specifically, 8, 2, 2, 1, 0, 0, 0 respectively represent , , , , , , The value of type indicates the event type. When the value in the corresponding mapping table is 1, it indicates a beat-related event; at the beginning of each measure, there will be a sequence of [0, 0, 1, 1, 0, 0, 0], which means that this is the beginning of a measure, and the meaning of the numbers in the sequence is the same as above; [0,0, 0, 2, 15, 13, 10] The value in the corresponding mapping table is 2, indicating that this is a note-related event. Pitch, duration, and velocity are all mapped to a value in the table. The meaning of the numbers in the sequence is the same as above. All samples are traversed for processing, and the final results are stored in the npy file.
[0075] Embodiment 2
[0076] In this embodiment, if Figure 2 As shown, a Nanyin data representation system includes: a transcription module, a preprocessing module and an encoding module.
[0077] The transcription module is used to collect Nanyin Pipa audio and transcribe the Nanyin Pipa audio to obtain a transcribed audio sample.
[0078] The transcription module includes: an audio recording unit, an audio segmentation unit and a transcription unit. The audio recording unit uses a portable recording device to record the audio of the Nanyin Pipa played to obtain a number of audio samples; the audio segmentation unit uses Cubase to segment the audio samples to reduce the sequence length of the samples and obtain a number of segmented samples; the transcription unit transcribes the segmented samples into midi format to obtain a number of transcribed audio samples.
[0079] The preprocessing module preprocesses the transcribed audio samples to obtain a corpus of Nanyin music information.
[0080] The preprocessing module includes: a first conversion unit, a beat detection unit, a first calculation unit, a second conversion unit, a second calculation unit and a quantization unit. The first conversion unit uses the mido library to convert the transcribed audio sample into an editable midi object and traverses each audio track; the beat detection unit is used to extract the time signature in the converted transcribed audio sample, and uses the Madmom library to perform beat tracking detection to obtain a beat time estimate; the first calculation unit calculates the number of ticks per beat in the transcribed audio sample according to the time signature, and interpolates the number of ticks in the beat time estimate to obtain a time unit conversion mapping table; the second conversion unit calculates the tempo change table for each beat in the transcribed audio sample according to the time point of the beat tracking detection, and uses the time unit conversion mapping table to convert the time unit of the note and the time unit of the tempo change table into ticks; the second calculation unit calculates the actual time corresponding to the first strong beat based on the beat time estimate, and then calculates the difference between the actual time and the theoretical time corresponding to the first strong beat, and applies the difference to the tempo change table and the starting position of the note, so that the beat time in the transcribed audio sample is aligned with the theoretical time; the quantization unit is used to quantize the start time, duration, strength and rhythm in the aligned transcribed audio sample according to a predefined mapping table to obtain a corpus of southern music information.
[0081] The encoding module encodes the corpus and converts the encoded sequence into a digital sequence, which is represented in the form of a digital sequence.
[0082] The encoding module includes: encoding unit and sequence conversion unit. The encoding unit is used to encode the corpus into a compound word event sequence and use the ignore tag to fill the missing tag type of each time step in the compound word event sequence; the sequence conversion unit converts the compound word event sequence into a corresponding digital sequence and saves it as an npy file.
[0083] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A method for characterizing Nanyin data, characterized in that: The following steps are involved: S1. Collecting Nanyin Pipa audio, and transcribing the Nanyin Pipa audio to obtain a transcribed audio sample; S2. Preprocessing the transcribed audio sample to obtain a corpus of southern music information; S3. Encode the corpus, convert the encoded sequence into a digital sequence, and represent it in a digital sequence; The pretreatment method comprises: S2.
1. Use the mido library to convert the transcribed audio sample into an editable midi object and traverse each audio track; S2.
2. Extract the time signature in the converted transcribed audio sample, and use the Madmom library to perform beat tracking detection to obtain a beat time estimate; S2.
3. Calculate the number of ticks per beat in the transcribed audio sample according to the time signature, and interpolate the number of ticks in the beat time estimation to obtain a time unit conversion mapping table; S2.
4. Calculate the time point of each beat in the transcribed audio sample according to the beat tracking detection tempo The time unit conversion mapping table is used to convert the time unit of the note and the tempo The time unit of the change table is converted to ticks; S2.
5. Calculate the actual time corresponding to the first strong beat based on the beat moment estimation, then calculate the difference between the actual time and the theoretical time corresponding to the first strong beat, and apply the difference to the tempo change table and the starting position of the note, so that the beat time in the transcribed audio sample is aligned with the theoretical time; S2.
6. Quantify the start time, duration, intensity and rhythm of the aligned transcribed audio samples according to a predefined mapping table to obtain the corpus of southern music information.
2. According to claim 1, a method for characterizing Nanyin data, characterized in that: The method for obtaining the transcribed audio includes: S1.
1. Record the audio of the Nanyin pipa played by a portable recording device to obtain a number of audio samples; S1.
2. segmenting the audio sample using Cubase to reduce the sequence length of the sample to obtain a plurality of segmented samples; S1.
3. Transcribe the plurality of segmented samples into midi format to obtain a plurality of transcribed audio samples.
3. According to the method for characterizing Nanyin data as described in claim 1, it is characterized in that: The method for obtaining the digital sequence includes: S3.
1. Encode the corpus into a compound word event sequence, and use the ignore tag to fill in the missing tag type of each time step in the compound word event sequence; S3.
2. Convert the compound word event sequence into the corresponding digital sequence and save it as an npy file.
4. A Nanyin data characterization system, the system applying the method described in any one of claims 1 to 3, characterized in that: include: transcription module, preprocessing module and encoding module; The transcription module is used to collect Nanyin Pipa audio, and transcribe the Nanyin Pipa audio to obtain a transcribed audio sample; The preprocessing module preprocesses the transcribed audio sample to obtain a corpus of southern music music information; The encoding module encodes the corpus and converts the encoded sequence into a digital sequence to represent it in a digital sequence.
5. A Nanyin data characterization system according to claim 4, characterized in that: The transcription module includes: an audio recording unit, an audio segmentation unit and a transcription unit; The audio recording unit uses a portable recording device to record the audio of the Nanyin pipa played to obtain a number of audio samples; The audio segmentation unit segments the audio sample using Cubase to reduce the sequence length of the sample and obtain a plurality of segmented samples; The transcription unit transcribes the plurality of segmented samples into a MIDI format to obtain a plurality of transcribed audio samples.
6. According to claim 4, a Nanyin data characterization system is characterized in that: The preprocessing module includes: a first conversion unit, a beat detection unit, a first calculation unit, a second conversion unit, a second calculation unit and a quantization unit; The first conversion unit converts the transcribed audio sample into an editable midi object using the mido library, and traverses each audio track; The beat detection unit is used to extract the time signature in the converted transcribed audio sample, and use the Madmom library to perform beat tracking detection to obtain a beat time estimate; The first calculation unit calculates the number of ticks per beat in the transcribed audio sample according to the beat signature, and interpolates the number of ticks in the beat time estimation to obtain a time unit conversion mapping table; The second conversion unit calculates the time point of each beat in the transcribed audio sample according to the time point of the beat tracking detection. tempo The time unit conversion mapping table is used to convert the time unit of the note and the tempo The time unit of the change table is converted to ticks; The second calculation unit calculates the actual time corresponding to the first strong beat based on the beat moment estimation, then calculates the difference between the actual time and the theoretical time corresponding to the first strong beat, and applies the difference to the tempo a variation table and the starting positions of said notes so that the beat timing in said transcribed audio sample is aligned with the theoretical timing; The quantization unit is used to quantize the start time, duration, strength and rhythm in the aligned transcribed audio samples according to a predefined mapping table to obtain the corpus of southern music music information.
7. The Nanyin data characterization system according to claim 4, characterized in that: The encoding module includes: an encoding unit and a sequence conversion unit; The encoding unit is used to encode the corpus into a compound word event sequence, and fill in the missing tag type of each time step in the compound word event sequence with an ignore tag; The sequence conversion unit converts the compound word event sequence into the corresponding digital sequence and saves it as an npy file.
Citation Information
Patent Citations
Melody converting method and system
CN106875929A
Numbered musical notation image recognition and coding method and system based on real-time image streams
CN111639649A
Music accompaniment automatic generation method and system based on encoding-decoding network
CN111653256A
Music generation method based on Monte Carlo tree search
CN113793579A
Music generation method and device, computer readable medium and electronic equipment
CN116631359A
Cited By
Ethnic minority music database construction and application system
WO2026113437A1
