Electronic piano accompaniment system with adaptive rhythm based on artificial intelligence

Through the electronic piano accompaniment system based on artificial intelligence, the problems of rhythm constraints, technical dependence and artistic performance limitations in existing music accompaniment methods are solved, and the singer's free adjustment of rhythm and speed and the improvement of artistic performance are achieved.

CN120183367APending Publication Date: 2025-06-20陈必红
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510327526.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

The existing music accompaniment methods have problems such as rhythm constraints, technical dependence and artistic expression limitations, especially in the singing process, it is difficult to achieve emotional expression and improvisation.

Method used

An electronic piano accompaniment system based on artificial intelligence is adopted. The system includes a single-key trigger module, a speed-control signal conversion module, an artificial intelligence accompaniment generation module, etc., which can adjust the accompaniment in real time according to the performer's speed and rhythm to generate harmonious accompaniment or harmony.

Benefits of technology

It has achieved that singers can freely adjust the rhythm and speed during the singing process, reduce technical dependence, enhance artistic expression, and make the singing more personalized and creative.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120183367A_ABST
    Figure CN120183367A_ABST
Patent Text Reader

Abstract

The invention provides a self-adaptive rhythm electronic piano accompaniment system based on artificial intelligence, and the system comprises a single-key triggering module which is used for indicating an accompaniment process; the speed-control signal conversion module is used for converting the speed signal acquired by the inductive sensor into a music control signal; the storage module is used for storing accompaniment note sequence data of the song; and the artificial intelligence accompaniment generation module adjusts the accompaniment rhythm according to the trigger signal and the playing speed, and generates accompaniment sound or harmony in real time. The system further comprises a pitch calculation unit, a timbre parameter adjustment module, a timbre generation module, a dynamic range adjustment module, a timbre smooth transition module, an automatic harmony generation module, a volume dynamic adjustment module and an audio output module. The control unit receives a user instruction and adjusts system setting parameters. Intelligentization and self-adaption of the accompaniment can be achieved, self-adjustment of the playing speed of the accompaniment is achieved, the playing speed of the accompaniment is kept consistent with the singing speed of the user, the playing flexibility and expressive force are improved, and the playing experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field, and specifically refers to an electronic piano accompaniment system with an adaptive rhythm based on artificial intelligence. Background Art

[0002] In modern music performances, accompaniment is an important factor in enhancing the singing effect. Traditional accompaniment methods usually rely on pre-recorded accompaniment tapes, and singers need to sing according to the rhythm and speed of the accompaniment tapes. The following main problems exist in this way:

[0003] 1. Rhythm constraint:

[0004] Singers must strictly follow the rhythm and speed of the accompaniment tape and cannot freely adjust according to their own emotional expressions and the on-site atmosphere.

[0005] Singers are easily restricted by the accompaniment tape and it is difficult to improvise and express emotions during the singing process.

[0006] 2. Technical dependence:

[0007] To keep in time with the accompaniment tape, singers need to master certain techniques, such as staring at the lyrics subtitles on the screen to ensure that they do not deviate from the rhythm.

[0008] This way not only increases the burden on singers but also may affect the natural fluency of the singing.

[0009] 3. Limited artistic expression:

[0010] Due to the fixed rhythm and speed, it is difficult for singers to create a unique artistic expression in each performance, resulting in a lack of personality and innovation in the singing.

[0011] To overcome the limitations of the accompaniment tape, some singers choose to play the traditional piano while singing. Although this way provides greater freedom, the following challenges also exist:

[0012] 1. High technical requirements:

[0013] Piano playing requires long-term practice and professional training, which is an insurmountable obstacle for most amateur singers.

[0014] Players need to pay attention to melody, harmony and rhythm at the same time, which is easy to distract and affect the singing performance.

[0015] 2. High complexity:

[0016] The traditional piano has 88 keys, and players need to master the notes corresponding to each key proficiently and be able to play accurately during the performance.

[0017] For non-professional performers, playing wrong notes or rhythms is a common problem, which will seriously affect the singing effect.

[0018] Therefore, an electronic piano accompaniment system with adaptive rhythm based on artificial intelligence is proposed to solve the existing deficiencies. Summary of the Invention

[0019] The technical problem to be solved by the present invention is to overcome the above-mentioned technical defects and provide an electronic piano accompaniment system with adaptive rhythm based on artificial intelligence.

[0020] To solve the above technical problems, the technical solution provided by the present invention is an electronic piano accompaniment system with adaptive rhythm based on artificial intelligence: including a single-key trigger module, a speed-control signal conversion module, a storage module, an artificial intelligence accompaniment generation module, a pitch calculation unit, a timbre parameter adjustment module, a timbre generation module, a dynamic range adjustment module, a timbre smooth transition module, an automatic harmony generation module, a volume dynamic adjustment module, an audio output module, and a control unit;

[0021] The control unit is used to receive the information of the single-key trigger module, the speed-control signal conversion module, the storage module, the artificial intelligence accompaniment generation module, the pitch calculation unit, the timbre parameter adjustment module, the timbre generation module, the dynamic range adjustment module, the timbre smooth transition module, the automatic harmony generation module, the volume dynamic adjustment module, and the audio output module and process it, and at the same time send the processing result to the relevant module for processing;

[0022] The single-key trigger module is provided with a trigger key, which is used for the user to trigger during the performance to indicate the progress of the accompaniment. The trigger signal generated by the trigger key is used as the indication signal for the progress of the accompaniment. An induction sensor unit is arranged below the key to detect the force when the key is pressed and output a speed signal v;

[0023] The speed-control signal conversion module is used to receive and process the speed signal from the induction sensor according to the preset speed-control signal mapping and convert it into a corresponding music control signal;

[0024] Specifically, the speed-control signal mapping formula is:

[0025]

[0026] Where: v is the speed signal output by the induction sensor, k is the speed sensitivity coefficient, n is the speed response exponent, and b is the offset;

[0027] A storage module for storing the accompaniment note sequence data of multiple songs. The accompaniment note sequence of each song consists of note numbers and optional accidentals, and does not contain beat information. At the same time, timbre parameter data, preset resonance parameters, parameter settings of the speed-control signal mapping formula, and parameters of the timbre synthesis model are stored;

[0028] An artificial intelligence accompaniment generation module, electrically connected to the storage unit, for retrieving the corresponding song's accompaniment note sequence data from the storage module according to the triggered single key and the time sequence of the trigger module, adjusting the playback speed of the accompaniment according to the current playing speed v (calculated from the time interval of the trigger signal), and generating appropriate accompaniment sounds or harmonies in real time; During the accompaniment generation process, analyze the accompaniment note sequence and generate harmonious accompaniment sounds or harmonies according to the relevance between notes and music theory;

[0029] A pitch calculation unit for calculating the accompaniment pitch according to the note numbers and accidentals in the accompaniment note sequence. The calculation formula is as follows:

[0030] F pitch =F base +n·ΔF accidental

[0031] Wherein, F pitch is the calculated accompaniment pitch, F base is the reference pitch, n is the number of half-tones corresponding to the note number, and its positive or negative value is determined according to the accidental; for a sharp, n takes a positive value; for a flat, n takes a negative value; for a double sharp or double flat, n is +2 or -2 respectively, and so on, ΔF accidental is the frequency increment corresponding to each half-tone;

[0032] A timbre parameter adjustment module, which adjusts the parameters required for timbre generation according to the accompaniment note sequence output by the artificial intelligence accompaniment generation module, the pitch calculated by the pitch calculation unit, and the intensity signal;

[0033] A timbre generation module, electrically connected to the artificial intelligence accompaniment generation module and the timbre parameter adjustment module, simulates the physical process of musical instrument sound production, and calculates and synthesizes timbre data according to the parameters output by the timbre parameter adjustment module;

[0034] During the specific synthesis process, the timbre data can be calculated through the following formula:

[0035]

[0036] Where: Y(t) is the synthesized timbre data, A i is the amplitude of the i-th harmonic, f i is the frequency of the i-th harmonic, is the phase of the i-th harmonic, and N is the number of harmonics;

[0037] A dynamic pitch range adjustment module, electrically connected to the tone generation module, capable of dynamically adjusting the pitch range output of the tone generation module according to the note range triggered by the performer;

[0038] A tone smooth transition module, electrically connected to the tone generation module, capable of achieving a smooth transition of tones between different notes or chords;

[0039] An automatic harmony generation module, electrically connected to the artificial intelligence accompaniment generation module, capable of generating a harmonious harmony part according to the main melody played by the performer;

[0040] A volume dynamic adjustment module, dynamically adjusting the output volume according to the intensity and rhythm changes of the performer's playing;

[0041] An audio output module for converting the tone data into sound and outputting it.

[0042] A control unit for receiving instructions input by the user and adjusting the setting parameters of the system according to the instructions;

[0043] As an improvement, the dynamic pitch range adjustment module realizes the dynamic adjustment of the pitch range, which is specifically calculated by the following formula:

[0044] D dynamic =D base +ΔD trigger

[0045] Where: D dynamic is the pitch range after dynamic adjustment, D base is the basic pitch range, ΔD trigger is the pitch range adjustment amount calculated according to the triggered note. When the note triggered by the performer exceeds the basic pitch range, ΔD trigger will increase accordingly to expand the pitch range coverage of the tone generation module.

[0046] As an improvement, the tone smooth transition module calculates the parameters for tone smooth transition, which are specifically calculated by the following formula:

[0047]

[0048] Where, S transition is the tone parameter after transition, S current is the current tone parameter, S target is the target tone parameter, and α is the smooth transition coefficient (0 ≤ α ≤ 1), used to control the smoothness and speed of the transition.

[0049] As an improvement, the automatic harmony generation module is used to calculate the pitch of the sounding note, which is specifically calculated by the following formula:

[0050] Fharmony = F melody + ΔF interval

[0051] Wherein, F harmony is the pitch of the harmony note, F melody is the pitch of the main melody note, and ΔF interval is the interval difference between the harmony and the main melody, and this value can be adjusted according to preset harmony rules or user selection.

[0052] As an improvement, the volume dynamic adjustment module dynamically adjusts the output volume according to the playing strength and rhythm changes of the player, and realizes the dynamic adjustment of the volume through the following formula:

[0053] V dynamic = V base + β·F force + γ·ΔV rhythm

[0054] Wherein, V dynamic is the volume size after dynamic adjustment, V base is the basic volume size, β is the influence coefficient of strength on volume, F force is the playing strength of the player, γ is the influence coefficient of rhythm change on volume, and ΔV rhythm is the volume adjustment amount brought by the rhythm change.

[0055] As an improvement, it further includes a resonance simulation circuit unit, which processes the generated timbre data according to preset resonance parameters to simulate the resonance box effect of a traditional piano.

[0056] As an improvement, it further includes an interaction interface unit, which is used to display a song selection menu, system status information, and the current played song accompaniment note sequence (excluding beat information) so that the user can understand the current playing state; the interaction interface unit also supports touch operations, and the user can adjust and select parameters by touching.

[0057] As an improvement, the artificial intelligence accompaniment generation module further includes a rhythm adaptive algorithm, which intelligently adjusts the rhythm and speed of the accompaniment based on the playing speed v and rhythm changes of the user. During the algorithm implementation process, factors such as the time interval between notes and the speed change rate are considered to maintain synchronization with the user's playing.

[0058] As an improvement, it further includes a wireless communication module, which is used to establish a wireless connection with a smart device to realize data transmission and remote control.

[0059] The advantages of the present invention compared with the prior art are:

[0060] 1. Through the setting form of a single trigger key in the single key trigger module, the performer only needs to play this one key to complete the accompaniment, greatly simplifying the performance process and reducing the requirements for the performer's skills. This enables even ordinary users without piano foundation to easily get started and enjoy the fun of playing and singing by themselves;

[0061] 2. The system can automatically adjust the playback speed of the accompaniment according to the speed at which the user plays, enabling the user to freely control the rhythm and speed without being restricted by the rhythm of a fixed accompaniment tape, truly realizing personalized music performance;

[0062] 3. The system can generate appropriate accompaniment sounds or harmonies in real time according to the note sequence and speed played by the user. The artificial intelligence accompaniment generation module can analyze the accompaniment note sequence and generate harmonious accompaniment sounds or harmonies based on the relevance between notes and music theory, making the accompaniment more rich and diverse;

[0063] 4. The automatic harmony generation module can generate harmonious harmony parts according to the main melody played by the user, making the accompaniment more complete. The user can enjoy professional harmony effects without the need to have harmony knowledge;

[0064] 5. Through the timbre parameter adjustment module and the timbre generation module, the timbre parameters can be adjusted in real time according to the notes and speed played by the user, and rich timbre data can be synthesized. During the timbre synthesis process, by simulating the physical process of musical instrument sound production, the generated timbre is more natural and realistic;

[0065] 6. Through the dynamic range adjustment module, the range output of the timbre generation module can be dynamically adjusted according to the note range triggered by the user, making the timbre more flexible and adaptable to different performance styles and music types;

[0066] 7. Through the timbre smooth transition module, smooth transition of timbre can be achieved between different notes or chords, avoiding sudden changes in timbre and making the performance more smooth and natural;

[0067] 8. Through the interaction interface unit, a song selection menu, system status information, and the current song accompaniment note sequence being played are displayed. At the same time, the user can perform parameter adjustment and selection through touch operations, making the system more intuitive and easy to use. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 is a schematic structural diagram of an artificial intelligence-based adaptive rhythm electronic piano accompaniment system of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0069] To make the objectives, technical solutions, and advantages of the embodiments of the invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the invention in conjunction with the accompanying drawings in the embodiments of the invention. Obviously, the described embodiments are some, but not all, of the embodiments of the invention. Usually, the components of the embodiments of the invention described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations.

[0070] As shown in the accompanying drawings, an electronic piano accompaniment system with an adaptive rhythm based on artificial intelligence includes a single-key trigger module, a speed-control signal conversion module, a storage module, an artificial intelligence accompaniment generation module, a pitch calculation unit, a timbre parameter adjustment module, a timbre generation module, a dynamic pitch range adjustment module, a timbre smooth transition module, an automatic harmony generation module, a volume dynamic adjustment module, an audio output module, and a control unit;

[0071] The control unit is used to receive information from the single-key trigger module, the speed-control signal conversion module, the storage module, the artificial intelligence accompaniment generation module, the pitch calculation unit, the timbre parameter adjustment module, the timbre generation module, the dynamic pitch range adjustment module, the timbre smooth transition module, the automatic harmony generation module, the volume dynamic adjustment module, and the audio output module, process it, and at the same time send the processing results to relevant modules for processing;

[0072] The single-key trigger module is provided with at least one trigger key, which is used for the user to trigger during the performance to indicate the progress of the accompaniment. The trigger signal generated by the trigger key is used as an indication signal v for the progress of the accompaniment;

[0073] The single-key trigger module includes at least one key for triggering the playback of the accompaniment. This key is designed as a single operation interface, and the user starts and continuously controls the playback of the accompaniment notes by pressing this key;

[0074] An induction sensor unit is arranged below the key, which is used to detect the force when the key is pressed and output a speed signal p;

[0075] Specifically, a pressure induction sensor is installed below the key. In this embodiment, the pressure sensor uses a pressure induction sensor of model FSR402, which can detect the change in the force when the user presses the key in real time and convert it into an electrical signal. At the same time, the induction sensor unit will calculate the pressing speed of the user's key press according to the change rate of the electrical signal output by the pressure induction sensor, and the induction sensor unit outputs it to the speed-control signal conversion module in the form of a speed signal, so as to facilitate the speed-control signal conversion module to adjust the playback speed of the accompaniment to match the user's performance rhythm.

[0076] During the implementation process:

[0077] 1) Signal acquisition and transmission:

[0078] When the user presses a key on the electronic piano, the pressure - sensitive sensor located beneath the key will detect the change in the key - pressing force in real - time and convert it into an electrical signal.

[0079] This electrical signal is then transmitted to the induction sensor unit for further processing of the signal.

[0080] 2) Signal processing and calculation:

[0081] After receiving the electrical signal, the induction sensor unit will analyze the rate of change of the signal to calculate the pressing speed of the user's key - pressing.

[0082] The calculated pressing speed is converted into a speed signal and output to the speed - control signal conversion module.

[0083] 3) Speed - control signal conversion and adjustment:

[0084] After receiving the speed signal, the speed - control signal conversion module will convert it into a control signal for controlling the accompaniment playback speed according to the preset speed - control signal mapping formula.

[0085] This control signal is sent to the control unit to adjust the playback speed of the accompaniment to match the user's playing rhythm.

[0086] When the user presses the trigger key, the pressure - sensitive sensor immediately starts to work, converting the key - pressing force into a corresponding electrical signal. This electrical signal changes over time, and its rate of change directly reflects the pressing speed of the user's key - pressing.

[0087] Specifically, it is obtained through the following calculation formula:

[0088]

[0089] Among them, \(v\) represents the pressing speed, and \(\Delta F\) represents the change in the electrical signal output by the pressure - sensitive element within a time interval \(\Delta t\).

[0090] Using this formula, the speed of the user's key - pressing can be accurately calculated and converted into a speed signal that can be recognized by the speed - control signal conversion module.

[0091] Once the induction sensor unit calculates the pressing speed, the induction sensor unit sends the speed signal to the speed - control signal conversion module. The speed - control signal conversion module will convert the speed signal into a corresponding music control signal according to the preset speed - control signal mapping relationship, thereby adjusting the playback speed of the accompaniment.

[0092] During specific implementation,

[0093] Suppose:

[0094] Output range of the pressure sensor: 0 - 500 units (this range represents the minimum to maximum electrical signal intensity that the pressure sensor can detect).

[0095] Time interval: We choose 0.1 second as a time interval for calculating the pressing speed. This means that the system will detect the output value of the pressure sensor every 0.1 second and calculate its change;

[0096] Initial moment: When the user starts pressing the trigger key, the output value of the pressure sensor is 50 units.

[0097] After 0.1 second: The user continues to press the trigger key, and the output value of the pressure sensor increases to 100 units.

[0098] That is, the calculation of the pressing speed:

[0099] ΔF = 100 - 50 = 30 units (the change in the electrical signal within 0.1 second)

[0100] Δt = 0.1 second

[0101]

[0102] The speed - control signal conversion module is used to receive and process the speed signal from the induction sensor according to the preset speed - control signal mapping, and convert it into the corresponding music speed control signal;

[0103] Specifically, the speed - control signal mapping formula is:

[0104]

[0105] Where: v is the speed signal output by the induction sensor, k is the speed sensitivity coefficient, n is the speed response exponent, and b is the offset;

[0106] Specifically, the speed - control signal conversion module converts the pressing force signal output by the pressure sensor of the single - key trigger module into a music speed control signal. The music control signal will directly affect parameters such as the speed of the accompaniment, thus realizing the adaptive accompaniment effect based on the user's pressing force.

[0107] During specific implementation,

[0108] Assume:

[0109] v is 500 units / second;

[0110] k is set to 2.0, indicating being more sensitive to the change in force;

[0111] n is set to 1.5, making the influence of the speed change on the control signal gradually increase;

[0112] Set b to 0.1 to ensure that there is a certain control signal output even at zero pressing force;

[0113] That is, the music speed control signal is:

[0114]

[0115] At this time, the accompaniment speed increases by 25%.

[0116] A storage module for storing the accompaniment note sequence data of multiple songs. The accompaniment note sequence of each song consists of note numbers and optional accidentals, and does not contain beat information. At the same time, timbre parameter data, preset resonance parameters, parameter settings of the speed-control signal mapping formula, and parameters of the timbre synthesis model are stored;

[0117] Specifically, the storage module is responsible for storing the accompaniment note sequence data of multiple songs.

[0118] Accompaniment note sequence data

[0119] Storage form: The accompaniment note sequence of each song is stored in digital form, and each note corresponds to a specific digital identifier.

[0120] Accidentals: For notes that need to be sharp or flat, the corresponding accidental identifier will be appended after the note number during storage.

[0121] Beat information: The accompaniment note sequence does not contain beat information.

[0122] Number of songs: The storage module can store the accompaniment note sequences of multiple songs, and the number of songs is determined according to the storage capacity and system design requirements.

[0123] Timbre parameter data

[0124] Content: Includes timbre parameters of various musical instruments, such as piano, violin, guitar, etc.

[0125] Form: The timbre parameters are stored in digital or analog form and are used by the timbre synthesis module to generate corresponding timbres.

[0126] Preset resonance parameters:

[0127] Function: The resonance parameters are used to adjust the resonance effect of the timbre to make the timbre more plump and natural.

[0128] Storage form: The resonance parameters are stored in digital form and can be preset and adjusted according to the song style and emotional needs.

[0129] Parameter settings of the speed-control signal mapping formula

[0130] Content: Parameters of the mapping formula used in the speed-control signal conversion unit, such as the force sensitivity coefficient and the force response exponent.

[0131] Function: These parameters determine the mapping relationship between the pressing force and the music control signal, and affect the change in the speed of the accompaniment.

[0132] Parameters of the timbre synthesis model

[0133] Content: The timbre synthesis model is used to generate an actual timbre signal based on timbre parameters and resonance parameters.

[0134] Parameters: The model parameters include filter coefficients, oscillator frequencies, and envelope generator parameters, which determine the characteristics and variations of the timbre.

[0135] The artificial intelligence accompaniment generation module, electrically connected to the storage unit, is used to retrieve the accompaniment note sequence data of the corresponding song from the storage module according to the order of the single key trigger module being triggered, adjust the playback speed of the accompaniment according to the current playing speed v, and generate accompaniment or harmony in real time; during the accompaniment generation process, analyze the accompaniment note sequence and generate harmonious accompaniment or harmony according to the relevance between the notes and music theory.

[0136] Specifically,

[0137] 1) Retrieval of the accompaniment note sequence

[0138] a) Trigger mechanism: When the user plays a single key on the electronic piano, the artificial intelligence accompaniment generation module will identify the triggered key and its trigger order, and identify the specific key that is triggered. At the same time, the artificial intelligence accompaniment generation module will also record the order of the keys played by the user for subsequent retrieval of the corresponding accompaniment note sequence according to this order.

[0139] b) Data retrieval: The artificial intelligence accompaniment generation module pre-establishes a mapping relationship between the electronic piano keys and the accompaniment note sequences in the storage module, which can be specifically set based on the melody, chord progression, or specific musical passages of the song. Then, when the keys played by the user and their order match the preset mapping relationship, the artificial intelligence accompaniment generation module will retrieve the accompaniment note sequence data of the corresponding song from the storage module, including information such as the notes, durations, and pitches of the accompaniment.

[0140] c) Speed adjustment: The artificial intelligence accompaniment generation module will adjust the playback speed of the accompaniment in real time according to the user's current playing speed v to ensure that the accompaniment is synchronized with the user's singing.

[0141] Suppose the user is playing a song "Dream Song" stored in the electronic piano system.

[0142] Trigger mechanism:

[0143] The user played the key corresponding to the first note of the song "Kinderszenen" (such as the C key).

[0144] The artificial intelligence accompaniment generation module immediately captured this action and identified that the triggered key was the C key.

[0145] The artificial intelligence accompaniment generation module recorded the order of the keys played by the user, that is, the first key played was the C key.

[0146] Data retrieval:

[0147] According to the preset mapping relationship, when the artificial intelligence accompaniment generation module learned that the user played the C key, it should retrieve the accompaniment note sequence of "Kinderszenen".

[0148] The artificial intelligence accompaniment generation module retrieved the accompaniment note sequence data of "Kinderszenen" from the storage module, including information such as the notes, durations, and pitches of the accompaniment.

[0149] Speed adjustment:

[0150] The artificial intelligence accompaniment generation module real-time sensed the playing speed v of the user through the induction sensor unit.

[0151] According to the music speed control signal from the speed-control signal conversion module, the artificial intelligence accompaniment generation module adjusted the playing speed of the accompaniment to be consistent with the singing speed of the user.

[0152] 2) Accompaniment or harmony generation

[0153] a) Note correlation analysis

[0154] Note feature extraction:

[0155] First, the artificial intelligence accompaniment generation module retrieved the accompaniment note sequence from the storage module and extracted features for each note. Feature extraction can include the pitch of the note (in units of semitones or whole tones), duration (in units of beats), dynamics (expressed in decibels or relative values), etc.

[0156] For example, for each note in the note sequence, it can be represented in vector form, such as (pitch, duration, dynamics).

[0157] Correlation identification:

[0158] Next, the module used machine learning algorithms (such as neural networks, hidden Markov models, etc.) to analyze the note sequence and identify the correlations between notes.

[0159] The relevance can include chord formations (such as major chords, minor chords, etc.), melody trends (such as ascending, descending, stable, etc.), rhythm patterns (such as strong-weak, weak-strong, etc.).

[0160] In specific implementations, a convolutional neural network (CNN) can be used to capture local features (such as chord formations) in the note sequence, and a recurrent neural network (RNN) or long short-term memory network (LSTM) can be used to capture temporal features (such as melody trends and rhythm patterns) in the note sequence.

[0161] b) Music theory application and accompaniment or harmony generation

[0162] Harmony theory application:

[0163] Based on the harmony principles in music theory, the module will generate accompaniment or harmony that is harmonious with the main melody.

[0164] Harmony principles can include chord progressions (such as the I-IV-V-I chord progression), harmony colors (such as bright, dull, etc.), counterpoint (such as parallel fifths, octave avoidance, etc.).

[0165] To achieve this goal, the module can use a pre-trained harmony generation model, which is trained with a large amount of harmony data (such as classical music, pop music, etc.) to learn the rules and patterns of harmony generation.

[0166] In the harmony generation process, rule-based methods or data-driven methods can be used.

[0167] Rule-based methods usually rely on harmony rules in music theory, such as formulas for generating the next chord based on the current chord.

[0168] For example, if the current chord is a C major chord (C-E-G), according to the principle of harmony progression, the next chord may be an F major chord (F-A-C) or a G major chord (G-B-D), etc.

[0169] Data-driven methods use machine learning models such as neural networks for harmony generation.

[0170] For example, a multi-layer perceptron (MLP) or a convolutional neural network (CNN) can be used to predict the next chord.

[0171] Input features can include the pitch vector, duration, dynamics of the current chord, and the previous chord sequence, etc.

[0172] The output is the pitch vector of the next chord.

[0173] Real-time generation and adjustment:

[0174] The accompaniment or harmony is generated in real time and can be flexibly adjusted according to the changes in the user's playing.

[0175] To achieve real-time generation, the module needs to have the characteristics of low latency and high efficiency.

[0176] In specific implementation, efficient machine learning algorithms and hardware acceleration technologies (such as GPU acceleration) can be used to improve the generation speed.

[0177] The specific implementation is as follows:

[0178] Suppose the user is playing a song "Dream Journey" stored in the electronic piano system.

[0179] Note feature extraction and correlation recognition:

[0180] The artificial intelligence accompaniment generation module retrieves the accompaniment note sequence of "Dream Journey" from the storage module.

[0181] Feature extraction is performed on each note to obtain features such as pitch, duration, and intensity of the note.

[0182] A combined model of convolutional neural network (CNN) and recurrent neural network (RNN) is used to analyze the note sequence to identify correlations such as chord formation, melody trend, and rhythm pattern.

[0183] Harmony theory application and accompaniment or harmony generation:

[0184] Based on the harmony principle in music theory, the module uses a pre-trained harmony generation model to generate accompaniment or harmony that is harmonious with the main melody.

[0185] For example, at the climax of the song, when the current chord is C major chord, the module predicts the next chord as G major chord according to the principle of harmony progression and generates the corresponding accompaniment or harmony.

[0186] To achieve real-time generation, the module uses efficient machine learning algorithms and hardware acceleration technologies (such as GPU acceleration) to improve the generation speed.

[0187] Real-time adjustment and synchronization:

[0188] When the user changes the playing speed, the artificial intelligence accompaniment generation module adjusts the playing speed of the accompaniment or harmony in real time to maintain synchronization with the user's playing.

[0189] When the user plays different melodies or rhythms, the artificial intelligence accompaniment generation module dynamically adjusts the content and structure of the accompaniment or harmony to adapt to the changes in the user's playing.

[0190] A pitch calculation unit, which is used to calculate the pitch of the accompaniment according to the note numbers and accidentals in the accompaniment note sequence. The calculation formula is as follows:

[0191] F pitch = F base + n·ΔF accidental

[0192] where F pitch is the calculated pitch of the accompaniment, F base is the reference pitch, n is the number of half - tones corresponding to the note number, and its positive or negative value is determined according to the accidental. When it is a sharp, n takes a positive value; when it is a flat, n takes a negative value; when it is a double - sharp or double - flat, n is +2 or -2 respectively, and so on. ΔF accidental is the frequency increment corresponding to each half - tone.

[0193] Specifically, the pitch calculation unit is responsible for calculating the pitch of the accompaniment based on the input accompaniment note sequence, combined with the reference pitch, the number of half - tones corresponding to the note number, and the frequency increment corresponding to each half - tone.

[0194] In specific implementation

[0195] 1) Input data

[0196] a) Accompaniment note sequence:

[0197] It contains the digital representation of the notes (such as the numbers corresponding to C, D, E, etc. or MIDI note numbers).

[0198] Accidentals (such as sharp #, flat b, double - sharp xx or double - flat bb, etc.).

[0199] b) Reference pitch (F base ):

[0200] It is usually the frequency of the A4 note, such as 440Hz, but it can also be other reference pitches.

[0201] Frequency increment corresponding to each half - tone (ΔF accidental ):

[0202] It can be calculated by the equal - tempered scale. For A4 = 440Hz, ΔF accidental is approximately 32.26Hz (i.e., the frequency difference between two adjacent half - tones).

[0203] 2) Specific calculation

[0204] a) Determine the reference pitch (F base ):

[0205] Assume the reference pitch is A4 = 440Hz.

[0206] b) Determine the frequency increment corresponding to each half - tone (ΔFaccidental ):

[0207] For A4 = 440 Hz, ΔF accidental is approximately 32.26 Hz.

[0208] c) Analyze the accompaniment note sequence:

[0209] Extract the numerical representation of the note and the accidental.

[0210] d) Calculate the number of semitones (n) corresponding to the note number:

[0211] Determine the basic number of semitones of the note according to its relative position to the reference pitch (such as A4).

[0212] Adjust the number of semitones according to the accidental. Add a positive value for a sharp, subtract a negative value for a flat, add +2 for a double sharp, subtract -2 for a double flat, and so on.

[0213] e) Apply the calculation formula to calculate the accompaniment pitch (F pitch ):

[0214] Substitute the determined reference pitch (F base ), the number of semitones (n), and the frequency increment (ΔF accidental ) into the formula for calculation.

[0215] 3) Specific calculation examples

[0216] Assume that the accompaniment note sequence contains a C#4 note:

[0217] Reference pitch (F base ):

[0218] A4 = 440 Hz.

[0219] Frequency increment per semitone (ΔF accidental ):

[0220] ΔF accidental = 32.26 Hz.

[0221] Analyze the accompaniment note sequence:

[0222] Note: C4 (basic number of semitones is -9, relative to A4).

[0223] Accidental: # (sharp, add 1 to the number of semitones).

[0224] Calculate the number of semitones (n) corresponding to the note number:

[0225] n = -9 + 1 = -8.

[0226] Apply the calculation formula to calculate the accompaniment pitch (F pitch ):

[0227] F pitch = F base + n·ΔF accidental = 440 + (-8)×32.26 = 440 - 258.08 = 181.92 Hz

[0228] 5) Output result

[0229] After the above calculation steps, the pitch calculation unit outputs the accompaniment pitch of each note in the accompaniment note sequence.

[0230] The timbre parameter adjustment module adjusts the parameters required for timbre generation according to the accompaniment note sequence output by the artificial intelligence accompaniment generation module, the pitch calculated by the pitch calculation unit, and the speed signal;

[0231] Specifically, the timbre parameter adjustment module receives the note sequence, pitch, and speed signal, and adjusts the parameters of the timbre generator. These parameters include but are not limited to filter parameters, oscillator parameters, envelope generator parameters, etc., which together determine the finally generated timbre.

[0232] During specific implementation

[0233] 1) Input data

[0234] a) Accompaniment note sequence: Provided by the artificial intelligence accompaniment generation module, containing information such as digital representations of notes (such as C4, D5, etc.), note durations, performance technique markings, etc.

[0235] b) Pitch: Calculated by the pitch calculation unit based on the digital representation and accidentals in the note sequence, in hertz (Hz).

[0236] c) Speed signal: Represents the playing speed of the notes and is used to simulate the speed changes in real accompaniment.

[0237] 2) Mathematical model and calculation formula

[0238] a) Filter parameter adjustment

[0239] Cutoff frequency adjustment: The cutoff frequency (fc) of the filter is related to the pitch (F) and the velocity signal (V). Assuming the reference cutoff frequency (fc0) is a certain fixed value, the adjustment formula is as follows:

[0240] f c = f co + k1·(F - F ref ) + k2·v

[0241] where, F refis the reference pitch (e.g., A4 = 440 Hz), and k1 and k2 are adjustment coefficients, which are set according to the instrument type and timbre requirements. For example, for the piano timbre, assume f co = 1000 Hz, k1 = 0.1, k2 = 0.01.

[0242] Formant adjustment: The relationship between the formant (Q value) and the pitch and velocity signals can be simply set as a linear relationship:

[0243] Q = Q0 + k3·(F - F ref ) + k4·V

[0244] where Q0 is the reference formant, and k3 and k4 are adjustment coefficients. For example, Q0 = 1.0, k3 = 0.005, k4 = 0.001.

[0245] b) Oscillator parameter adjustment

[0246] Frequency adjustment: The frequency of the oscillator is directly related to the pitch and can be simply set as:

[0247] f osc = F pitch

[0248] That is, the frequency of the oscillator is equal to the pitch.

[0249] Amplitude adjustment: The amplitude (A) has a linear relationship with the velocity signal:

[0250]

[0251] where A max is the maximum amplitude of the oscillator.

[0252] c) Envelope generator parameter adjustment

[0253] Attack time adjustment: The attack time is inversely proportional to the velocity signal. The greater the velocity, the shorter the attack time:

[0254]

[0255] where t attack,max is the maximum attack time, and k5 is the adjustment coefficient. For example, t attack,max = 0.1 second, k5 = 0.1.

[0256] Decay time and release time adjustment: These parameters can also be inversely proportional to the velocity signal, but the adjustment range is small.

[0257] 3) Specific data and calculation examples

[0258] Suppose we are generating a piano timbre, and the specific data is as follows:

[0259] a) Input data:

[0260] Note sequence: C4, quarter note duration, no accidentals.

[0261] Pitch: Fpitch = 261.63 Hz (standard frequency of C4).

[0262] Velocity signal: V = 25.

[0263] Calculation process:

[0264] Filter parameters:

[0265] f c = f co + k1·(F - F ref ) + k2·v = 1000 + 0.1·(261.63 - 440) + 0.01·25 = 982.41 Hz

[0266] Q = Q0 + k3·(F - F ref ) + k4·V = 1.0 + 0.005·(261.63 - 440) + 0.01·25 = 0.941

[0267] Oscillator parameters:

[0268] f osc = F pitch = 261.63 Hz

[0269] (assuming A max is 1.0)

[0270] Envelope generator parameters:

[0271]

[0272] (The decay time and release time are set according to specific requirements, and the calculation process is omitted here)

[0273] 4) Output result

[0274] After being processed by the timbre parameter adjustment module, a set of adjusted timbre parameters are output:

[0275] Filter cut-off frequency: 982.41 Hz

[0276] Filter resonance peak: 0.941

[0277] Oscillator frequency: 261.63 Hz

[0278] Oscillator amplitude: 0.5A max

[0279] Attack time: 0.0285s

[0280] These parameters will be passed to the timbre generation module to generate piano notes with a specific timbre.

[0281] The timbre generation module is electrically connected to the artificial intelligence accompaniment generation module and the timbre parameter adjustment module, simulates the physical process of musical instrument sound production, and calculates and synthesizes timbre data according to the parameters output by the timbre parameter adjustment module;

[0282] During the specific synthesis process, the timbre data can be calculated through the following formula:

[0283]

[0284] Where: Y(t) is the synthesized timbre data, A i is the amplitude of the i-th harmonic, f i is the frequency of the i-th harmonic, is the phase of the i-th harmonic, and N is the number of harmonics;

[0285] Specifically, the timbre generation module receives parameters from the timbre parameter adjustment module, such as filter parameters, oscillator parameters, envelope generator parameters, etc., and uses these parameters to generate audio signals to simulate the timbres of various musical instruments.

[0286] The timbre generation module uses waveform synthesis technology, combines filters, oscillators, and envelope generators to generate timbres. The model structure is as follows:

[0287] Oscillator: Used to generate basic waveforms, such as sine waves, square waves, sawtooth waves, etc.

[0288] Filter: Used to filter the waveform output by the oscillator and change the spectral characteristics of the timbre.

[0289] Envelope generator: Used to control the amplitude change of the audio signal and simulate the playing dynamics of real musical instruments.

[0290] 1) Oscillator output

[0291] Assume a sine wave oscillator is used, and its output waveform is:

[0292]

[0293] Where, f i is the f provided by the timbre parameter adjustment module osc ;

[0294] 2) Filter output

[0295] A low-pass filter is used, and its transfer function is:

[0296]

[0297] where w c = 2πf c , and f c is the cut-off frequency of the filter (provided by the timbre parameter adjustment module).

[0298] The output of the filter is:

[0299] y filtered (t) = y(t) * h(t)

[0300] where * represents the convolution operation, and h(t) is the impulse response of the filter.

[0301] 3) Output of the envelope generator

[0302] An ADSR (attack - decay - sustain - release) envelope is adopted, and its output is:

[0303]

[0304] where A max is the maximum amplitude, t attack is the attack time, t decay is the decay time, t hold is the sustain time, t releasek is the release time (all provided by the timbre parameter adjustment module), and A sustain is the amplitude during the sustain phase.

[0305] 4) Specific data and calculation examples:

[0306] Suppose we are generating a piano timbre, and the specific data is as follows:

[0307] a) Oscillator parameters:

[0308] The frequency f osc = 261.63 Hz (the standard frequency of C4)

[0309] The amplitude A = 0.5 (assuming the maximum amplitude is 1.0)

[0310] b) Filter parameters:

[0311] The cut-off frequency f c = 982.41 Hz (calculated by the timbre parameter adjustment module)

[0312] The resonance peak Q = 0.941 (calculated by the timbre parameter adjustment module)

[0313] c) Envelope generator parameters:

[0314] The attack time t attack= 0.0285 seconds

[0315] Decay time t decay = 0.1 seconds

[0316] Duration t hold = 0.5 seconds (assuming the note value is a quarter note)

[0317] Release time t releasek = 0.1 seconds

[0318] Amplitude A during the sustain phase sustain = 0.5 (same as the amplitude)

[0319] 5) Calculation process:

[0320] a) Oscillator output:

[0321] Y(t) = 0.5·sin(2π·261.63·t)

[0322] b) Filter output:

[0323] The oscillator output is filtered using a low-pass filter to obtain the filtered waveform y filtered (t).

[0324] c) Envelope generator output:

[0325] According to the ADSR envelope formula, calculate the amplitude value at each time point.

[0326] For example, during the attack phase (0 ≤ t < 0.0285 seconds):

[0327]

[0328] During the decay phase (0.0285 seconds ≤ t < 0.1285 seconds):

[0329]

[0330] During the sustain phase (0.1285 seconds ≤ t < 0.6285 seconds):

[0331] A(t) = 0.5

[0332] During the release phase (0.6285 seconds ≤ t < 0.7285 seconds):

[0333]

[0334] 6) Output result

[0335] After being processed by the timbre generation module, an audio signal with a specific timbre is output. This signal combines the basic waveform generated by the oscillator, the filtering process of the waveform by the filter, and the control of the signal amplitude by the envelope generator, thus realizing the simulation of the piano timbre.

[0336] The dynamic pitch range adjustment module, electrically connected to the timbre generation module, can dynamically adjust the pitch range output of the timbre generation module according to the note range triggered by the performer;

[0337] Specifically, the dynamic pitch range adjustment module realizes the dynamic adjustment of the pitch range, which is specifically calculated by the following formula:

[0338] D dynamic = D base + ΔD trigger

[0339] Where: D dynamic is the pitch range after dynamic adjustment, D base is the basic pitch range, and ΔD trigger is the pitch range adjustment amount calculated according to the triggered note. When the note triggered by the performer exceeds the basic pitch range, ΔD trigger will increase accordingly to expand the pitch range coverage of the timbre generation module.

[0340] Specifically, the dynamic pitch range adjustment module is electrically connected to the timbre generation module, can real-time monitor the note range triggered by the performer, and dynamically adjust the pitch range output of the timbre generation module according to this range.

[0341] During implementation, the note range triggered by the performer is real-time monitored, and the pitch range adjustment amount (ΔD trigger ) is calculated based on this range, and then the pitch range output of the timbre generation module is dynamically adjusted. Under the action of the dynamic pitch range adjustment module, the pitch range output of the timbre generation module can change dynamically to adapt to the note range triggered by the performer.

[0342] During specific implementation

[0343] 1) Assume:

[0344] The basic pitch range D base is set to C3 to C5 (i.e., middle C to high C), a total of two octaves.

[0345] 2) The note range triggered by the performer:

[0346] Assume that the note range triggered by the performer is from C3 to G5 (i.e., middle C to high G), which exceeds the basic pitch range of C3 to C5.

[0347] 3) Calculate the pitch range adjustment amount (ΔD trigger ):

[0348] Since G5 (high frequency) exceeds the basic pitch range of C5, it is necessary to increase the pitch range adjustment amount to cover G5.

[0349] Assume that the pitch range adjustment amount for each note is 0.5 semitones.

[0350] There are 3 semitones from C5 to G5 (G5 - C5 = G5 - F#5 + F#5 - E5 + E5 - C5 = 3 semitones).

[0351] Therefore, the pitch range adjustment amount ΔD trigger = 3 × 0.5 = 1.5 semitones.

[0352] 4) Dynamically adjust the pitch range output:

[0353] According to the formula D dynamic = D base + ΔD trigger , calculate the pitch range after dynamic adjustment.

[0354] D dynamic = C3 to C5 + 1.5 semitones = C3 to G5.

[0355] The dynamic pitch range adjustment module sends an adjustment instruction to the timbre generation module, and the timbre generation module adjusts its pitch range output accordingly to cover the note range triggered by the performer.

[0356] The timbre smooth transition module, electrically connected to the timbre generation module, can achieve smooth transition of timbre between different notes or chords;

[0357] Specifically, the timbre smooth transition module calculates the parameters for timbre smooth transition, which are specifically calculated through the following formula:

[0358]

[0359] where S transition is the timbre parameter after transition, S current is the current timbre parameter, S target is the target timbre parameter, and α is the smooth transition coefficient (0 ≤ α ≤ 1), which is used to control the smoothness and speed of the transition.

[0360] Specifically, the timbre smooth transition module is electrically connected to the timbre generation module to achieve smooth transition of timbre between different notes or chords. The timbre smooth transition module ensures that the timbre remains natural and smooth during the change process by calculating the transition parameters, avoiding abrupt timbre jumps.

[0361] In specific implementation:

[0362] Initial state setting

[0363] S current : The current timbre parameter, assumed to be the parameter value of piano timbre A.

[0364] s target : The target timbre parameter, assumed to be the parameter value of string timbre B.

[0365] α: The smooth transition coefficient. The user hopes for a relatively gentle transition process and sets it to 0.2 (indicating a slow transition speed);

[0366] During the transition process, as time goes by, the value of α will gradually increase from 0 to 1. Assuming the transition time is 1 second, we can divide this process into 10 steps (each step is 0.1 second) and calculate the timbre parameter for each step.

[0367] The timbre generation module generates the corresponding timbre signal according to the S transition value calculated for each step. The user can then hear the effect of smoothly transitioning from piano timbre A to string timbre B.

[0368] The automatic harmony generation module, electrically connected to the artificial intelligence accompaniment generation module, can generate a harmonious harmony part according to the main melody played by the performer;

[0369] Specifically, the automatic harmony generation module is used to calculate the pitch of the harmony note, which is specifically calculated through the following formula:

[0370] F harmony = F melody + ΔF interval

[0371] where F harmony is the pitch of the harmony note, F melody is the pitch of the main melody note, and ΔF interval is the pitch interval between the harmony and the main melody, and this value can be adjusted according to the preset harmony rules or user selection.

[0372] Specifically, through the electrical connection with the artificial intelligence accompaniment generation module, the automatic harmony generation module can analyze the main melody played by the performer in real time and generate a harmonious matching harmony part.

[0373] In the specific implementation:

[0374] 1) Main melody data

[0375] Assume the main melody is composed of the notes of the C major scale, and the specific note sequence is: C4, D4, E4, F4, G4, A4, B4, C5.

[0376] The duration of each note is 1 beat.

[0377] 2) Harmony rules:

[0378] Select a simple harmony rule: for each main melody note, generate a harmony note that is a third above it (i.e., the harmony progression of a major triad).

[0379] For example, for the main melody note C4, the generated harmony note is E4 (a third above C4).

[0380] 3) Harmony generation calculation

[0381] According to the formula F harmony = F melody + ΔF interval , we can calculate the harmony note corresponding to each main melody note

[0382] Based on the above calculation, we obtain the harmony part that matches the main melody harmoniously. The specific results are as follows:

[0383] Main melody: C4, D4, E4, F4, G4, A4, B4, C5

[0384] Harmony part: E4, F#4, G#4, A4, B4, C5, D5, E5

[0385] The volume dynamic adjustment module dynamically adjusts the output volume according to the playing strength and rhythm changes of the performer;

[0386] Specifically, the volume dynamic adjustment module dynamically adjusts the output volume according to the playing strength and rhythm changes of the performer, and realizes the dynamic adjustment of the volume through the following formula:

[0387] V dynamic = V base + β·F force + γ·ΔV rhythm

[0388] Where, V dynamic is the volume size after dynamic adjustment, V base is the basic volume size, β is the influence coefficient of strength on volume, F force is the playing strength of the performer, γ is the influence coefficient of rhythm change on volume, and ΔV rhythm is the volume adjustment amount brought by the rhythm change.

[0389] Specifically, the volume dynamic adjustment module can dynamically adjust the output volume in real time according to the playing strength and rhythm changes of the user. It not only enhances the expressiveness of the music, but also makes the performance more vivid and closer to reality.

[0390] In specific implementation:

[0391] 1) Basic volume setting:

[0392] Set the basic volume V base to 70 dB.

[0393] 2) Force influence coefficient setting:

[0394] Set the influence coefficient β of force on volume to 2. This means that when the playing force increases by 1 unit, the volume will increase by 2 dB.

[0395] 3) Rhythm change influence coefficient and adjustment amount setting:

[0396] Set the influence coefficient γ of rhythm change on volume to 1.5.

[0397] The volume adjustment amount ΔV caused by rhythm change rhythm can be calculated according to the change speed of the rhythm. For example, when the rhythm speeds up, ΔV rhythm may be a positive value, indicating that the volume needs to increase; when the rhythm slows down, ΔV rhythm may be a negative value, indicating that the volume needs to decrease.

[0398] 4) Real-time force and rhythm detection:

[0399] Real-time detect the playing force F of the performer through the induction sensor unit force .

[0400] 5) Volume dynamic adjustment:

[0401] According to the above formula, calculate the dynamically adjusted volume V in real time dynamic .

[0402] Apply the calculated V dynamic to the output volume of the digital piano to achieve dynamic adjustment of the volume.

[0403] An audio output module for converting the tone data into sound and outputting it.

[0404] The audio output module converts the processed tone data into a sound signal and outputs it to a speaker or other audio device, enabling the user to hear the actual sound.

[0405] A control unit for receiving instructions input by the user and adjusting the setting parameters of the system according to the instructions.

[0406] In this embodiment, the control unit uses a microcontroller of the STM32 series. The control unit is used to receive instructions input by the user and adjust the setting parameters of the system according to these instructions to ensure that the audio output module can work according to the user's needs.

[0407] During specific implementation,

[0408] 1) Receive user input:

[0409] The control unit is provided with a user interface for receiving instructions from the user.

[0410] The user interface may be in the form of a physical button, a knob, a touch screen, a software interface, etc., facilitating intuitive operation by the user.

[0411] 2) Parse the instruction:

[0412] The control unit can parse the instructions input by the user to identify the user's intentions and requirements.

[0413] The instructions may include volume adjustment, channel balance, audio format selection, sampling rate setting, etc.

[0414] 3) Adjust the system setting parameters:

[0415] According to the parsed instructions, the control unit can adjust the system setting parameters of the audio output module.

[0416] These parameters may include volume level, channel balance ratio, audio processing algorithm, sampling rate of the digital-to-analog converter, etc.

[0417] 4) Feedback the adjustment result:

[0418] The control unit may feedback the adjusted system setting parameters or status to the user through a display screen, a sound prompt, etc.

[0419] This helps the user understand the working status of the current audio output module and make further adjustments.

[0420] It also includes a resonance simulation circuit unit that processes the generated timbre data according to preset resonance parameters to simulate the resonance box effect of a traditional piano.

[0421] Specifically, the resonance simulation circuit unit simulates the resonance phenomenon when musical instruments produce sounds in nature, processes the generated timbre data according to preset resonance parameters, simulates the resonance box effect of a traditional piano, enhances the richness and stereoscopic sense of the sound, and improves the performance experience.

[0422] Through the resonance simulation circuit unit, the system can produce more rich and stereoscopic sound effects, enhancing the realism and immersion of the performance. At the same time, by adjusting the frequency and amplitude of the resonance, it can also adapt to different music styles and performance requirements, improving the flexibility and diversity of the performance;

[0423] According to the preset resonance parameters, the generated timbre data is processed for resonance effect to simulate the resonance box effect of a traditional piano and enhance the authenticity and layering of the audio output.

[0424] The resonance parameters include resonance frequency, decay time, reverberation effect, etc., and can be adjusted through the control unit.

[0425] Specifically:

[0426] 1) Resonance frequency adjustment

[0427] a) Hardware connection: The resonance frequency adjustment circuit in the resonance simulation circuit unit is connected to the control unit through the I2C or SPI interface. The circuit contains components such as variable resistors or digital potentiometers for adjusting the resonance frequency.

[0428] b) User input: The user selects the desired resonance frequency through a knob or touch screen.

[0429] c) Algorithm calculation: The control unit has a built-in algorithm to calculate the corresponding control signal based on the user input.

[0430] d) Output control signal: The control unit outputs the calculated control signal to the resonance frequency adjustment circuit, and the circuit adjusts the value of the variable resistor according to the control signal, thereby changing the resonance frequency.

[0431] e) Feedback mechanism: The resonance simulation circuit unit real-time detects the current resonance frequency and sends a feedback signal back to the control unit to ensure the accuracy of the adjustment.

[0432] The following is the execution code:

[0433]

[0434]

[0435]

[0436] 2) Decay time adjustment

[0437] a) Hardware connection: The decay time adjustment circuit in the resonance simulation circuit unit is connected to the control unit through the UART interface. The circuit contains components such as resistors and capacitors for adjusting the decay time of the resonance signal.

[0438] b) User input: The user selects the desired decay time through a slider or touch screen.

[0439] c) Algorithm calculation: The control unit has a built-in algorithm to calculate the corresponding resistor or capacitor value based on the user input.

[0440] d) Output control signal: The control unit outputs the calculated control signal to the decay time adjustment circuit, and the circuit adjusts the value of the resistor or capacitor according to the control signal, thereby changing the decay time of the resonance signal.

[0441] e) Real-time monitoring: The control unit monitors the adjusted decay time in real time to ensure that it meets the user's requirements.

[0442] The following is the execution code:

[0443]

[0444]

[0445]

[0446] 3) Reverberation effect adjustment

[0447] a) Hardware connection: The reverberation effect generation circuit is connected to the control unit through a digital audio interface (such as I2S or SPDIF). The circuit contains a digital signal processing (DSP) chip for generating the reverberation effect.

[0448] Software implementation:

[0449] b) User input: The user selects the desired reverberation type (such as room, hall, auditorium, etc.) and reverberation time through the touch screen.

[0450] c) Algorithm calculation: The control unit has a built-in reverberation effect algorithm and calculates the corresponding reverberation parameters (such as filter coefficients, delay time, etc.) according to the user input.

[0451] d) Output control signal: The control unit outputs the calculated control signal to the reverberation effect generation circuit, and the circuit adjusts the parameters of the DSP chip according to the control signal to generate the desired reverberation effect.

[0452] e) Audio mixing: The control unit mixes the original audio signal with the generated reverberation effect and outputs the final audio signal.

[0453] The following is the execution code:

[0454]

[0455]

[0456]

[0457]

[0458] It also includes an interactive interface unit, which is used to display a song selection menu, system status information, and the musical accompaniment note sequence of the currently played song, so that the user can understand the current performance status; the interactive interface unit also supports touch operations, and the user can adjust parameters and make selections through touch.

[0459] The interactive interface unit is responsible for displaying a song selection menu, system status information, and the musical accompaniment note sequence of the currently played song to the user, and supports touch operations, so that the user can understand the current performance status and make parameter adjustments and selections.

[0460] 1) Composition of the interactive interface unit

[0461] Display screen:

[0462] A high-resolution color touch screen is selected, which supports multi-touch to ensure the smoothness and accuracy of user operations.

[0463] User interface design:

[0464] 2) Interface layout:

[0465] Top area: Displays system status information, such as volume, timbre, resonance parameters, etc.

[0466] Middle area: Displays the musical accompaniment note sequence of the currently played song, presented in the form of a staff or numbered musical notation.

[0467] Bottom area: Displays the song selection menu, listing the titles and thumbnails of multiple songs.

[0468] 3) Interface elements:

[0469] Icons: Used to represent different functions, such as play, pause, stop, select, etc.

[0470] Buttons: Used for the user to trigger specific operations, such as selecting a song, adjusting parameters, etc.

[0471] Slider: Used to adjust volume, timbre, resonance parameters, etc.

[0472] 4) Implementation of touch operations

[0473] Gesture recognition:

[0474] Supports gestures such as swiping, double-tapping, and long-pressing to improve the convenience and intuitiveness of operations.

[0475] Interaction logic:

[0476] When the user touches an icon or button on the screen, the corresponding operation is triggered, such as selecting a song, adjusting parameters, etc.

[0477] The slider is used to adjust parameter values in real time, such as volume, timbre, resonance parameters, etc.

[0478] Users can switch the displayed content by touching different areas on the screen, such as viewing system status information, the accompaniment note sequence of the currently played song, etc.

[0479] 5) Information display

[0480] Song selection menu:

[0481] List the titles and thumbnails of multiple songs. Users can select different songs to play by touching the screen.

[0482] Support classified browsing, such as classification by style, difficulty level, etc.

[0483] System status information:

[0484] Display the current system setting parameters, such as volume, timbre, resonance parameters, etc., in the top area of the interface.

[0485] Users can adjust these parameters in real time by touching the slider or button on the screen.

[0486] Accompaniment note sequence of the currently played song:

[0487] Display the accompaniment note sequence of the currently played song in the middle area of the interface, presented in the form of a staff or numbered musical notation.

[0488] The note sequence is updated in real time as the user plays, helping the user understand the current playing status.

[0489] It also includes a wireless communication module for establishing a wireless connection with a smart device to achieve data transmission and remote control.

[0490] Specifically:

[0491] 1) Hardware selection and connection

[0492] a) Wireless communication module options:

[0493] Bluetooth module: Select modules such as HC-05 / 06 or ESP32, suitable for short-distance communication and convenient for pairing with smartphones or tablets.

[0494] Wi-Fi module: Select modules such as ESP8266 or ESP32 (with built-in Wi-Fi function), suitable for scenarios that require longer-distance communication or remote control via the Internet.

[0495] )b Connection method:

[0496] Connect the wireless communication module to the microcontroller through UART, SPI or I2C interface.

[0497] Ensure that the power supply and ground wire are correctly connected to ensure the normal operation of the module.

[0498] 2) Communication Protocol and Configuration

[0499] a) Bluetooth Communication:

[0500] Use the Bluetooth Classic (SPP) or Bluetooth Low Energy (BLE) protocol.

[0501] Configure the module to slave mode and wait for the smart device to connect.

[0502] For BLE, define services and characteristics for data transmission and control.

[0503] b) Wi-Fi Communication:

[0504] Configure the module to connect to the specified Wi-Fi network (SSID and password).

[0505] Use the TCP / IP protocol to achieve data transmission through Socket communication.

[0506] A web server or REST API endpoint can be set up for smart devices to access.

[0507] During implementation, the wireless communication module realizes wireless connection and data transmission with external devices (such as mobile phones, computers, audio systems, etc.). Using radio waves for data transmission avoids the cumbersome and restrictive nature of traditional wired connections and improves the flexibility and convenience of the system.

[0508] 1) Data Transmission

[0509] Realize audio data transmission with smart devices. For example, transmit the music played by an electronic piano in real time to a smartphone or tablet for playing or recording.

[0510] Realize the transmission of sheet music data, such as sending the sheet music in this system to a smartphone or tablet for display and editing.

[0511] 2) Remote Control

[0512] Through smart devices such as smartphones or tablets, remotely control functions such as play, pause, and volume adjustment of the electronic piano.

[0513] Realize remote update and maintenance functions, such as downloading the latest sheet music, firmware updates, etc. through the wireless network.

[0514] The above describes the present invention and its implementation manners. Such description is not restrictive. What is shown in the drawings is only one of the implementation manners of the present invention, and the actual structure is not limited thereto. In general, if those of ordinary skill in the art are inspired by it and, without departing from the gist of the present invention, design similar structural manners and embodiments to this technical solution without creative efforts, they shall fall within the protection scope of the present invention.

Claims

1. An electronic piano accompaniment system with adaptive rhythm based on artificial intelligence, characterized in that: It includes a single-key trigger module, a speed-control signal conversion module, a storage module, an artificial intelligence accompaniment generation module, a pitch calculation unit, a timbre parameter adjustment module, a timbre generation module, a dynamic range adjustment module, a timbre smooth transition module, an automatic harmony generation module, a volume dynamic adjustment module, an audio output module and a control unit; The control unit is used to receive and process information from a single key trigger module, a speed-control signal conversion module, a storage module, an artificial intelligence accompaniment generation module, a pitch calculation unit, a timbre parameter adjustment module, a timbre generation module, a dynamic range adjustment module, a timbre smooth transition module, an automatic harmony generation module, a volume dynamic adjustment module, and an audio output module, and send the processing results to relevant modules for processing; The single-key trigger module is provided with a trigger key, which is used to be triggered by the user to indicate the progress of the accompaniment during the performance. The trigger signal generated by the trigger key is used as an indication signal for the progress of the accompaniment. An induction sensor unit is provided under the key to detect the force when the key is pressed and output a pressing speed signal v; A speed-control signal conversion module, for receiving and processing the speed signal from the induction sensor according to a preset speed-control signal mapping, and converting it into a corresponding music control signal; Specifically, the speed-control signal mapping formula is: Where: v is the speed signal output by the induction sensor, k is the speed sensitivity coefficient, n is the speed response index, and b is the offset; A storage module, for storing accompaniment note sequence data of multiple songs, wherein the accompaniment note sequence of each song consists of note numbers and optional sharp and flat signs, and does not contain beat information, and also stores timbre parameter data, preset resonance parameters, parameter settings of the speed-control signal mapping formula, and parameters of the timbre synthesis model; The artificial intelligence accompaniment generation module is electrically connected to the storage unit, and is used to retrieve the accompaniment note sequence data of the corresponding song from the storage module according to the time sequence of the triggered single key and the trigger module, and adjust the playing speed of the accompaniment according to the current playing speed v, and generate accompaniment or harmony in real time; in the accompaniment generation process, the accompaniment note sequence is analyzed, and harmonious accompaniment or harmony is generated according to the correlation between the notes and music theory; The pitch calculation unit is used to calculate the accompaniment pitch according to the note numbers and sharps in the accompaniment note sequence. The calculation formula is as follows: F pitch =F base +n·ΔF accidental Among them, F pitch is the calculated accompaniment pitch, F base is the base pitch, n is the number of semitones corresponding to the note number, and its positive or negative value is determined by the sharp sign; when the sharp sign is used, n takes a positive value; when the flat sign is used, n takes a negative value; when the double sharp or double flat is used, n is +2 or -2 respectively, and so on. accidental The frequency increment corresponding to each semitone; A timbre parameter adjustment module adjusts the parameters required for timbre generation according to the accompaniment note sequence output by the artificial intelligence accompaniment generation module and the pitch and velocity signals calculated by the pitch calculation unit; The timbre generating module is electrically connected to the artificial intelligence accompaniment generating module and the timbre parameter adjusting module, simulates the physical process of the musical instrument sounding, and calculates and synthesizes the timbre data according to the parameters output by the timbre parameter adjusting module; In the specific synthesis process, the timbre data can be calculated by the following formula: Where: Y(t) is the synthesized timbre data, A i is the amplitude of the ith harmonic, f i is the frequency of the ith harmonic, is the phase of the i-th harmonic, N is the number of harmonics; The dynamic range adjustment module is electrically connected to the timbre generation module and can dynamically adjust the range output of the timbre generation module according to the range of notes triggered by the performer; A timbre smooth transition module is electrically connected to the timbre generation module and can realize a smooth transition of timbre between different notes or chords; The automatic harmony generation module is electrically connected to the artificial intelligence accompaniment generation module and can generate harmonious harmony parts according to the main melody played by the performer; The volume dynamic adjustment module dynamically adjusts the output volume according to the player's playing strength and rhythm changes; An audio output module, used for converting the timbre data into sound and outputting the sound; The control unit is used to receive instructions input by the user and adjust the setting parameters of the system according to the instructions.

2. The electronic piano accompaniment system with adaptive rhythm based on artificial intelligence according to claim 1, characterized in that: The dynamic range adjustment module realizes the dynamic adjustment of the range, which is specifically calculated by the following formula: D dynamic =D base +ΔD trigger Where: D dynamic D is the range of the sound after dynamic adjustment. base is the basic range, ΔD trigger The range adjustment calculated based on the trigger note. When the player triggers a note beyond the basic range, ΔD trigger It will be increased accordingly to expand the range coverage of the timbre generation module.

3. The electronic piano accompaniment system with adaptive rhythm based on artificial intelligence according to claim 1, characterized in that: The timbre smooth transition module calculates the parameters of the timbre smooth transition, which are specifically calculated by the following formula: Among them, S transition is the timbre parameter after transition, S current is the current timbre parameter, S target is the target timbre parameter, and α is the smooth transition coefficient (0≤α≤1), which is used to control the smoothness and speed of the transition.

4. The electronic piano accompaniment system with adaptive rhythm based on artificial intelligence according to claim 1, characterized in that: The automatic harmony generation module is used to calculate the pitch of the sound note, which is specifically calculated by the following formula: F harmony =F melody +ΔF interval Among them, F harmony is the pitch of the harmony note, F melody is the pitch of the main melody note, ΔF interval is the interval difference between the harmony and the main melody, which can be adjusted according to preset harmony rules or user selection.

5. The electronic piano accompaniment system with adaptive rhythm based on artificial intelligence according to claim 1, characterized in that: The volume dynamic adjustment module dynamically adjusts the output volume according to the player's playing strength and rhythm changes, and realizes the dynamic adjustment of the volume through the following formula: V dynamic =V base +β·F force +γ·ΔV rhythm Among them, V dynamic V is the volume after dynamic adjustment. base is the basic volume, β is the coefficient of influence of intensity on volume, F force is the strength of the player’s playing, γ is the influence coefficient of rhythm change on volume, ΔV rhythm The amount of volume adjustment for rhythm changes.

6. The electronic piano accompaniment system with adaptive rhythm based on artificial intelligence according to claim 1, characterized in that: It also includes a resonance simulation circuit unit, which performs resonance effect processing on the generated tone data according to preset resonance parameters to simulate the resonance box effect of a traditional piano.

7. The electronic piano accompaniment system with adaptive rhythm based on artificial intelligence according to claim 1, characterized in that: It also includes an interactive interface unit for displaying a song selection menu, system status information, and a sequence of accompaniment notes of a currently played song so that a user can understand the current performance status; The interactive interface unit also supports touch operation, and users can adjust and select parameters by touch.

8. The electronic piano accompaniment system with adaptive rhythm based on artificial intelligence according to claim 1, characterized in that: It also includes a wireless communication module for establishing a wireless connection with a smart device to achieve data transmission and remote control.

Citation Information

Cited By

  • Intelligent four-key tone musical instrument for Chinese playing and singing

    CN121506061A

  • Intelligent four-key tone piano for Chinese pentatonic playing

    CN121506061B