Artificial intelligence-based adaptive-rhythm electronic piano accompaniment system

WO2026194795A1PCT designated stage Publication Date: 2026-09-24CHEN BIHONG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2026/083555
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-03-19
Filing Date
2026-03-14
Publication Date
2026-09-24

Smart Images

  • Figure CN2026083555_24092026_PF_FP_ABST
    Figure CN2026083555_24092026_PF_FP_ABST
Patent Text Reader

Abstract

An artificial intelligence-based adaptive-rhythm electronic piano accompaniment system, comprising: a single-key trigger module, used for indicating the progression of accompaniment; a velocity-control signal conversion module, used for converting a velocity signal obtained by a sensor into a music control signal; a storage module, used for storing accompaniment note sequence data of music; and an artificial intelligence accompaniment generation module, used for adjusting the rhythm of the accompaniment on the basis of a trigger signal and a playing tempo, and generating accompanying notes 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 dynamic volume adjustment module, and an audio output module. A control unit is used for receiving a user instruction and adjusting system setting parameters. The system can provide intelligent and adaptive accompaniment, and realize automatic adjustment of the playback tempo of accompaniment to match the singing tempo of a user, thereby improving the flexibility and expressiveness of performance, and improving performance experience.
Need to check novelty before this filing date? Find Prior Art

Description

An adaptive rhythm-based electronic piano accompaniment system based on artificial intelligence TECHNICAL FIELD

[0001] The present invention relates to the technical field, and particularly refers to an adaptive rhythm-based electronic piano accompaniment system based on artificial intelligence. BACKGROUND

[0002] In modern music performances, accompaniment is an important factor in improving singing effects. Traditional accompaniment methods usually rely on pre-recorded accompaniment tapes, and singers need to sing according to the rhythm and speed of the accompaniment tape. This method has the following main problems:

[0003] 1. Rhythm constraint:

[0004] The singer must strictly follow the rhythm and speed of the accompaniment tape, and cannot freely adjust according to their own emotional expression and live atmosphere.

[0005] The singer is easily limited by the accompaniment tape, making it difficult to improvise and express emotions during singing.

[0006] 2. Technical dependence:

[0007] In order to keep in time with the accompaniment tape, the singer needs to master certain techniques, such as staring at the lyrics subtitles on the screen to ensure not to deviate from the rhythm.

[0008] This method not only increases the burden of the singer, but also may affect the natural fluency of singing.

[0009] 3. Limited artistic expression:

[0010] Due to the fixed rhythm and speed, the singer has difficulty creating unique artistic expression in each performance, resulting in a lack of individuality and innovation in singing.

[0011] In order to overcome the limitations of the accompaniment tape, some singers choose to use traditional pianos for self-accompaniment. This method, although providing greater freedom, also has the following challenges:

[0012] 1. High technical requirements:

[0013] Piano playing requires long-term practice and professional training, which is a difficult obstacle for most amateur singers to overcome.

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

[0015] 2. High complexity:

[0016] Traditional piano has 88 keys, and the performer needs to master the corresponding notes of each key and can accurately play during the performance.

[0017] For non-professional performers, it is common to play wrong notes or rhythms, which seriously affects the singing effect.

[0018] Therefore, an electronic piano accompaniment system based on artificial intelligence adaptive rhythm is proposed to solve the existing problems. SUMMARY

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

[0020] To solve the above technical problems, the technical solution provided by the present application is an electronic piano accompaniment system based on artificial intelligence adaptive rhythm: 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, the audio output module and process them, and send the processing results to the related modules for processing.

[0022] The single key trigger module is provided with a trigger key for triggering the user during the performance to indicate the accompaniment, and the trigger signal generated by the trigger key is used as the indication signal of the accompaniment, and an inductive sensor unit is arranged below the key for detecting the force when the key is pressed and outputting a speed signal v.

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

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

[0025] Wherein: v is the speed signal output by the inductive sensor, k is the speed sensitivity coefficient, n is the speed response index, and b is the offset.

[0026] A storage module is configured to store accompaniment note sequence data of multiple songs, wherein the accompaniment note sequence of each song is composed of note numbers and optional sharps and flats and does not contain beat information, and the storage module also stores timbre parameter data, preset resonance parameters, parameter settings of a speed-control signal mapping formula, and parameters of a timbre synthesis model;

[0027] An artificial intelligence accompaniment generation module is electrically connected to the storage unit and configured to retrieve accompaniment note sequence data of a corresponding song from the storage module according to a single key that is triggered and a time sequence of the triggering module, adjust the playback speed of the accompaniment according to a current playing speed v (calculated by a time interval of a triggering signal), and generate appropriate accompaniment or harmony in real time; during the generation of the accompaniment, the accompaniment note sequence is analyzed, and harmonious accompaniment or harmony is generated according to the relevance between notes and music theory;

[0028] A pitch calculation unit is configured to calculate the pitch of the accompaniment according to the note numbers and sharps and flats in the accompaniment note sequence, and the calculation formula is as follows: pitch F base +F accidental

[0029] wherein F pitch is the calculated pitch of the accompaniment, F base is a reference pitch, n is the number of semitones corresponding to the note number, and the positive or negative value is determined according to the sharp or flat; when sharp, n takes a positive value; when flat, n takes a negative value; when double sharp or double flat, n is +2 or -2, respectively, and so on, and ΔF accidental is the frequency increment corresponding to each semitone;

[0030] A timbre parameter adjustment module is configured to adjust parameters required for generating timbre according to the accompaniment note sequence output by the artificial intelligence accompaniment generation module, the pitch calculated by the pitch calculation unit, and the dynamics signal.

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

[0032] In a specific synthesis process, the timbre data can be calculated by the following formula:

[0033] wherein 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.

[0034] The dynamic pitch adjustment module is electrically connected with the tone generation module and can dynamically adjust the pitch output of the tone generation module according to the range of notes triggered by the performer.

[0035] The tone smooth transition module is electrically connected with the tone generation module and can realize smooth transition of the tone between different notes or chords.

[0036] The automatic harmony generation module is electrically connected with the artificial intelligence accompaniment generation module and can generate harmonious harmony parts according to the main melody played by the performer.

[0037] The volume dynamic adjustment module dynamically adjusts the output volume according to the dynamics and rhythm changes of the performer.

[0038] The audio output module is used to convert the tone data into sound and output.

[0039] The control unit is used to receive user input instructions and adjust the system setting parameters according to the instructions.

[0040] As an improvement, the dynamic pitch adjustment module realizes dynamic adjustment of the pitch range, which is calculated by the following formula: dynamic base + ΔD trigger

[0041] Wherein: D dynamic is the dynamically adjusted pitch range, D base is the basic pitch range, ΔD trigger is the pitch adjustment amount calculated according to the triggered notes, when the performer triggers the notes beyond the basic pitch, ΔD trigger will be increased accordingly to expand the pitch range of the tone generation module.

[0042] As an improvement, the tone smooth transition module calculates the parameters of the tone smooth transition, which is calculated by the following formula:

[0043] Wherein: S transition is the transition tone parameter, S current is the current tone parameter, S target is the target tone parameter, and α is the smooth transition coefficient (0 ≤ α ≤ 1), which is used to control the smoothness and speed of the transition.

[0044] As an improvement, the automatic harmony generation module is used to calculate the pitch of the notes, which is calculated by the following formula: harmony melody + ΔF interval

[0045] Wherein: F harmony ​​F is the pitch of the accompaniment sound symbol melody Delta F is the pitch of the main melody symbol interval Delta F is the pitch of the main melody symbol

[0046] As an improvement, the volume dynamic adjustment module dynamically adjusts the output volume according to the force and rhythm changes of the performer, and the dynamic adjustment of the volume is realized through the following formula: V dynamic = V base + beta * F force + gamma * Delta V rhythm

[0047] Where V dynamic is the dynamically adjusted volume, V base is the basic volume, beta is the force volume influence coefficient, F force is the force of the performer, gamma is the rhythm change volume influence coefficient, and Delta V rhythm is the volume adjustment amount caused by rhythm change.

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

[0049] As an improvement, it also includes an interactive interface unit for displaying song selection menu, system status information and current playing song accompaniment note sequence (without beat information) to help users understand the current playing state; the interactive interface unit also supports touch operation, and users can adjust and select parameters through touch.

[0050] As an improvement, the artificial intelligence accompaniment generation module also includes a rhythm adaptive algorithm that intelligently adjusts the rhythm and speed of the accompaniment based on the user's playing speed v and rhythm changes, taking into account factors such as note interval, speed change rate, etc. to maintain synchronization with the user's playing.

[0051] As an improvement, it also includes a wireless communication module for establishing a wireless connection with a smart device to realize data transmission and remote control.

[0052] The advantages of the present application compared with the prior art are:

[0053] 1. Through the setting form of a single trigger key in the single key trigger module, the performer only needs to play this key to complete the accompaniment, greatly simplifying the playing process and reducing the technical requirements for the performer, which makes even ordinary users without piano foundation can easily get started and enjoy the fun of self-playing and singing.

[0054] 2、The system can automatically adjust the playback speed of the accompaniment according to the user's playing speed, which allows the user to freely control the rhythm and speed without being limited by the fixed accompaniment rhythm, truly realizing personalized music interpretation;

[0055] 3、The system can generate appropriate accompaniment or harmony in real time according to the user's note sequence and speed. The artificial intelligence accompaniment generation module can analyze the accompaniment note sequence and generate harmonious accompaniment or harmony according to the relevance between notes and music theory, making the accompaniment more rich and diverse;

[0056] 4、The automatic harmony generation module can generate harmonious harmony parts according to the user's main melody, making the accompaniment more complete, and the user can enjoy professional harmony effects without having to have harmony knowledge;

[0057] 5、Through the timbre parameter adjustment module and the timbre generation module, the timbre parameters can be adjusted in real time according to the user's notes and speed, and rich timbre data can be synthesized. In the timbre synthesis process, the physical process of instrument sound generation is simulated, making the generated timbre more natural and realistic;

[0058] 6、Through the dynamic range adjustment module, the timbre generation module can dynamically adjust the range output according to the user's triggered note range, making the timbre more flexible and able to adapt to different playing styles and music types;

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

[0060] 8、The interactive interface unit displays song selection menu, system status information and current song accompaniment note sequence, and the user can adjust and select parameters through touch operation, making the system more intuitive and easy to use. BRIEF DESCRIPTION OF DRAWINGS

[0061] Figure 1 is a structural schematic diagram of an electronic piano accompaniment system based on artificial intelligence adaptive rhythm. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical scheme and advantages of the embodiments of the application clearer, the technical scheme in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are part of the embodiments of the application, not all embodiments. The configuration of the embodiments of the application described and shown in the drawings can be arranged and designed in various different configurations.

[0063] In combination with the drawings shown, an artificial intelligence-based adaptive rhythm electronic piano accompaniment system 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.

[0064] 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 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 them, and send the processing results to the relevant modules for processing.

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

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

[0067] An inductive sensor unit is arranged below the piano key for detecting the force when the key is pressed and outputting a speed signal p.

[0068] Specifically, a pressure inductive sensor is arranged below the piano key, and in this embodiment, the pressure sensor is a pressure inductive sensor with a model number of FSR402, which can detect the force change when the user presses the key in real time and convert it into an electric signal. At the same time, the inductive sensor unit calculates the pressing speed of the user according to the electric signal change rate output by the pressure inductive sensor, and outputs the speed signal 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.

[0069] In the implementation process:

[0070] 1) Signal acquisition and transmission:

[0071] When the user presses the piano key of the electronic piano, the pressure inductive sensor arranged below the piano key detects the force change in real time and converts it into an electric signal.

[0072] The electric signal is then transmitted to the inductive sensor unit for further processing of the electric signal.

[0073] 2) Signal processing and calculation:

[0074] After the inductive sensor unit receives the electrical signal, it analyzes the rate of change of the signal to calculate the pressing speed of the user's key.

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

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

[0077] After the speed-control signal conversion module receives the speed signal, it will convert it into a control signal that controls the playback speed of the accompaniment according to the pre-set speed-control signal mapping formula.

[0078] The control signal is sent to the control unit to adjust the playback speed of the accompaniment to match the user's performance rhythm.

[0079] When the user presses the trigger key, the pressure sensor immediately starts working and converts the force of the key 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.

[0080] Specifically, the following calculation formula is used:

[0081] Where v represents the pressing speed, and ΔF represents the change in the electrical signal output by the pressure sensor in a time interval Δt.

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

[0083] Once the inductive sensor unit calculates the pressing speed, it 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 pre-set speed-control signal mapping relationship, thereby adjusting the playback speed of the accompaniment.

[0084] In specific implementation,

[0085] Assume:

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

[0087] Time interval: we choose 0.1 seconds 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 seconds and calculate the change in the output value;

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

[0089] 0.1 seconds later: the user continues to press the trigger key, the output value of the pressure sensor increases to 100 units.

[0090] That is, the pressing speed:

[0091] ΔF = 100 - 50 = 30 units (the amount of change of the electrical signal in 0.1 seconds)

[0092] Δt = 0.1 seconds

[0093] 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 speed control signal;

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

[0095] 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;

[0096] Specifically, the speed-control signal conversion module converts the pressing force signal output by the pressure sensor from the single key trigger module into a music speed control signal. The music control signal will directly affect the speed and other parameters of the accompaniment, thereby realizing adaptive accompaniment effects based on the user's pressing force.

[0097] In specific implementation,

[0098] Suppose:

[0099] v is 500 units / second;

[0100] k is set to 2.0, indicating that it is sensitive to the change in force;

[0101] n is set to 1.5, so that the influence of speed change on the control signal gradually increases;

[0102] b is set to 0.1 to ensure that there is also a certain control signal output at zero pressing force;

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

[0104] At this moment, the accompaniment speed increases by 25%.

[0105] A storage module is configured to store accompaniment note sequence data of multiple songs, wherein each song's accompaniment note sequence is composed of note numbers and optional accidentals, and does not contain beat information, and the storage module also stores timbre parameter data, preset resonance parameters, parameter settings of a speed-control signal mapping formula, and parameters of a timbre synthesis model.

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

[0107] Accompaniment note sequence data

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

[0109] Accidentals: For notes that require sharps or flats, the corresponding sharp or flat identifier is appended to the note number during storage.

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

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

[0112] Timbre parameter data

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

[0114] Form: Timbre parameters are stored in digital or analog form, used by the timbre synthesis module to generate corresponding timbres.

[0115] Preset resonance parameters

[0116] Function: Resonance parameters are used to adjust the resonance effect of timbres, making timbres more full and natural.

[0117] Storage form: Resonance parameters are stored in digital form and can be preset and adjusted according to song style and emotional needs.

[0118] Parameter settings of speed-control signal mapping formula

[0119] Content: Includes parameters of the mapping formula used in the velocity-control signal conversion unit, such as dynamic sensitivity coefficient and dynamic response index.

[0120] Function: These parameters determine the mapping relationship between pressing dynamics and music control signals, affecting the change in the speed of accompaniment.

[0121] Parameters of timbre synthesis model

[0122] Content: Timbre synthesis model for generating actual timbre signals from timbre parameters and resonance parameters.

[0123] Parameters: Model parameters include filter coefficients, oscillator frequencies, envelope generator parameters, which determine the characteristics and changes of timbre.

[0124] Artificial intelligence accompaniment generation module, electrically connected with the storage unit, for triggering the sequence of the single key trigger module, retrieving the accompaniment note sequence data of the corresponding song from the storage module, and adjusting the playback speed of the accompaniment according to the current playing speed v, and generating real-time accompaniment or harmony; during the accompaniment generation process, analyze the accompaniment note sequence, and generate harmonious accompaniment or harmony according to the relevance between notes and music theory.

[0125] Specifically,

[0126] 1) Accompaniment note sequence retrieval

[0127] a) Trigger mechanism: When the user plays a single key of the electronic piano, the artificial intelligence accompaniment generation module will identify the key triggered and its trigger sequence, and identify the specific key triggered. At the same time, the artificial intelligence accompaniment generation module also records the sequence of the user playing the keys, so as to subsequently retrieve the corresponding accompaniment note sequence according to this sequence.

[0128] b) Data retrieval: The artificial intelligence accompaniment generation module pre-establishes the mapping relationship between the electronic piano keys and the accompaniment note sequence in the storage module, which can be based on the melody, chord progression or specific section of the song to set, and then when the keys played by the user and their sequence match the pre-set mapping relationship, the artificial intelligence accompaniment generation module will retrieve the accompaniment note sequence data of the corresponding song from the storage module, including the notes, time values, pitches, etc. Information of accompaniment.

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

[0130] Suppose the user is playing a song "Dreamy Melody" stored in the electronic piano system.

[0131] Trigger mechanism:

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

[0133] The artificial intelligence accompaniment generation module immediately captures this action and identifies that the key triggered is the C key.

[0134] The artificial intelligence accompaniment generation module records the sequence of the keys played by the user, that is, the first key played is the C key.

[0135] Data retrieval:

[0136] According to the preset mapping relationship, the artificial intelligence accompaniment generation module knows that when the user plays the C key, the accompaniment note sequence of "Dreamy Melody" should be retrieved.

[0137] The artificial intelligence accompaniment generation module retrieves the accompaniment note sequence data of "Dreamy Melody" from the storage module, including the notes, time values, pitches, etc.

[0138] Speed adjustment:

[0139] The artificial intelligence accompaniment generation module adjusts the playback speed of the accompaniment according to the music speed control signal from the speed-control signal conversion module, so that it is consistent with the user's singing speed.

[0140] According to the music speed control signal from the speed-control signal conversion module, the artificial intelligence accompaniment generation module adjusts the playback speed of the accompaniment, so that it is consistent with the user's singing speed.

[0141] 2) Accompaniment or harmony generation

[0142] a) Note relevance analysis

[0143] Note feature extraction:

[0144] First, the artificial intelligence accompaniment generation module retrieves the accompaniment note sequence from the storage module and extracts features for each note. Feature extraction can include note pitch (in half or whole steps), time value (in beats), dynamics (in decibels or relative values), etc.

[0145] For example, each note in the note sequence can be represented as a vector, such as (pitch, time value, dynamics).

[0146] Relevance identification:

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

[0148] Relevance can include chord construction (such as major triad, minor triad, etc.), melody direction (such as ascending, descending, stable, etc.), rhythm pattern (such as strong-weak, weak-strong, etc.), etc.

[0149] In specific implementation, convolutional neural networks (CNN) can be used to capture local features in the note sequence (such as chord construction), and recurrent neural networks (RNN) or long short-term memory networks (LSTM) can be used to capture temporal features in the note sequence (such as melody direction and rhythm pattern).

[0150] b) Application of music theory and accompaniment or harmony generation

[0151] Applications of harmony theory:

[0152] Based on the principles of harmony in music theory, the module generates accompaniment or harmony that harmonizes with the main melody.

[0153] Harmonic principles can include chord progressions (such as the I-IV-VI chord progression), harmonic colors (such as bright, dark, etc.), and counterpoint (such as parallel fifths, octave avoidance, etc.).

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

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

[0156] Rule-based methods typically rely on harmonic rules in music theory, such as formulas for generating the next chord from the current chord.

[0157] For example, if the current chord is a C major chord (CEG), according to the principles of harmonic progression, the next chord could be an F major chord (FAC) or a G major chord (GBD), etc.

[0158] Data-driven approaches utilize machine learning models such as neural networks for harmony generation.

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

[0160] Input features can include the pitch vector, duration, dynamics, and previous chord sequences of the current chord.

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

[0162] Real-time generation and adjustment:

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

[0164] To achieve real-time generation, the module needs to be characterized by low latency and high efficiency.

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

[0166] When implementing this:

[0167] Suppose a user is playing a song called "Dream Journey" stored in an electronic piano system.

[0168] Note feature extraction and correlation recognition:

[0169] The AI-generated accompaniment module retrieves the accompaniment note sequence of "Dream Journey" from the storage module.

[0170] Feature extraction is performed on each note to obtain its pitch, duration, dynamics, and other features.

[0171] A combined model of convolutional neural networks (CNN) and recurrent neural networks (RNN) is used to analyze note sequences and identify correlations such as chord structure, melodic direction, and rhythmic patterns.

[0172] Applications of harmony theory to accompaniment or harmony generation:

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

[0174] For example, in the climax of a song, if the current chord is a C major chord, the module predicts the next chord to be a G major chord based on the principles of harmonic progression and generates the corresponding accompaniment or harmony.

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

[0176] Real-time adjustment and synchronization:

[0177] When the user changes the playing speed, the AI ​​accompaniment generation module adjusts the playback speed of the accompaniment or harmony in real time to maintain synchronization with the user's playing.

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

[0179] The pitch calculation unit is used to calculate the pitch of the accompaniment based on the note numbers and sharps / flats in the accompaniment note sequence. The calculation formula is as follows: F pitch =F base +n·ΔF accidental

[0180] Among them, F pitch To calculate the accompaniment pitch, F base The base pitch is given by n, where n is the number of semitones corresponding to the note number, and its value is determined by the sharps and flats. For a sharp, n is positive; for a flat, n is negative; for a double sharp or double flat, n is +2 or -2 respectively, and so on. ΔF accidentalThis represents the frequency increment corresponding to each semitone.

[0181] Specifically, the pitch calculation unit is responsible for calculating the accompaniment pitch based on the input accompaniment note sequence, combined with the reference pitch, the number of semitones corresponding to the note numbers, and the frequency increment corresponding to each semitone.

[0182] In specific implementation

[0183] 1) Input data

[0184] a) Accompaniment note sequence:

[0185] Includes the numerical representation of musical notes (such as the numbers or MIDI tone symbols corresponding to C, D, E, etc.).

[0186] Acceleration and decrement marks (such as boost #, decrement b, double boost xx or double decrement bb, etc.).

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

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

[0189] The frequency increment (ΔF) corresponding to each semitone accidental ):

[0190] It can be calculated using the twelve-tone equal temperament; for A4 = 440Hz, ΔF accidental It is approximately 32.26 Hz (i.e., the frequency difference between two adjacent semitones).

[0191] 2) Specific calculations

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

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

[0194] b) Determine the frequency increment (ΔF) corresponding to each semitone. accidental ):

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

[0196] c) Analyzing the accompaniment note sequence:

[0197] Extract the numerical representation of musical notes and their sharps and flats.

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

[0199] The number of basic semitones of a note is determined by its relative position to a reference pitch (such as A4).

[0200] Adjust the number of semitones according to the sharps and flats: 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.

[0201] e) Calculate the accompaniment pitch using the formula (F). pitch ):

[0202] Determine the reference pitch (F) base ), number of semitones (n) and frequency increment (ΔF) accidental Substitute the values ​​into the formula to perform the calculation.

[0203] 3) Specific calculation example

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

[0205] Reference pitch (F) base ): A4 = 440Hz.

[0206] The frequency increment (ΔF) corresponding to each semitone accidental ): ΔF accidental =32.26Hz.

[0207] Analysis of the accompaniment note sequence:

[0208] Note: C4 (the basic semitone number is -9, relative to A4).

[0209] Accidents: # (sharp, semitone number plus 1).

[0210] Calculate the number of semitones (n) corresponding to the note numbers: n = -9 + 1 = -8.

[0211] Calculate the accompaniment pitch using the formula (F) pitch ): F pitch =F base +n·ΔF accidental =440+(-8)×32.26=440-258.08=181.92Hz

[0212] 5) Output Results

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

[0214] The timbre parameter adjustment module adjusts the parameters required for timbre generation based on the accompaniment note sequence output by the AI ​​accompaniment generation module and the pitch and tempo signals calculated by the pitch calculation unit.

[0215] Specifically, the timbre parameter adjustment module receives note sequences, pitch, and tempo signals, and adjusts the parameters of the timbre generator. These parameters include, but are not limited to, filter parameters, oscillator parameters, and envelope generator parameters, which together determine the final generated timbre.

[0216] In specific implementation

[0217] 1) Input data

[0218] a) Accompaniment note sequence: provided by the AI ​​accompaniment generation module, including the digital representation of notes (such as C4, D5, etc.), time values, performance technique markings, and other information.

[0219] b) Pitch: Calculated by the pitch calculation unit based on the numerical representation and sharps / flats in the note sequence, in Hertz (Hz).

[0220] c) Tempo signal: indicates the playing speed of notes, used to simulate tempo changes in real accompaniment.

[0221] 2) Mathematical Model and Calculation Formula

[0222] a) Filter parameter adjustment

[0223] Cutoff Frequency Adjustment: The cutoff frequency (fc) of the filter is related to the pitch (F) and velocity signal (V). Assuming the reference cutoff frequency (fc0) is a fixed value, the adjustment formula is as follows: f c =f co +k1·(FF ref )+k2·v

[0224] Among them, F ref This is the reference pitch (e.g., A4 = 440Hz), while k1 and k2 are adjustment coefficients set according to the instrument type and desired timbre. For example, for a piano tone, let's assume f... co =1000Hz, k1=0.1, k2=0.01.

[0225] Formant Adjustment: The relationship between the formant (Q value) and the pitch and tempo signals can be simply set as a linear relationship: Q = Q0 + k3·(FF) ref )+k4·V

[0226] Where Q0 is the reference resonance peak, and k3 and k4 are adjustment coefficients. For example, Q0 = 1.0, k3 = 0.005, and k4 = 0.001.

[0227] b) Oscillator parameter adjustment

[0228] Frequency adjustment: The frequency of the oscillator is directly related to the pitch, and can be simply set to: f osc =F pitch

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

[0230] Amplitude adjustment: The amplitude (A) is linearly related to the velocity signal.

[0231] Among them, A max It is the maximum amplitude of the oscillator.

[0232] c) Envelope generator parameter adjustment

[0233] Attack time adjustment: Attack time is inversely proportional to the speed signal; the higher the speed, the shorter the attack time.

[0234] Where `tattack,max` is the maximum onset time, and `k5` is the adjustment factor. For example, `tattack,max` = 0.1 seconds, `k5` = 0.1.

[0235] Decay time and release time adjustment: These parameters can also be inversely proportional to the speed signal, but the adjustment range is smaller.

[0236] 3) Specific data and calculation examples

[0237] Suppose we are generating a piano tone, with the following specific data:

[0238] a) Input data:

[0239] Note sequence: C4, quarter note, no sharps or flats.

[0240] Pitch: F pitch =261.63Hz (standard frequency of C4).

[0241] Force signal: V=25.

[0242] Calculation process:

[0243] Filter parameters: f c =f co +k1·(FF ref )+k2·v=1000+0.1·(261.63-440)+0.01·25=982.41Hz Q=Q0+k3·(FF ref )+k4·V=1.0+0.005·(261.63-440)+0.01·25=0.941

[0244] Oscillator parameters: f osc =F pitch =261.63Hz

[0245] Envelope generator parameters:

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

[0247] 4) Output Results

[0248] After processing by the timbre parameter adjustment module, a set of adjusted timbre parameters is output:

[0249] Filter cutoff frequency: 982.41Hz

[0250] Filter resonance peak: 0.941

[0251] Oscillator frequency: 261.63Hz

[0252] Oscillator amplitude: 0.5A max

[0253] Attack time: 0.0285s

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

[0255] The timbre generation module is electrically connected to the AI ​​accompaniment generation module and the timbre parameter adjustment module. It simulates the physical process of musical instrument sound production and calculates and synthesizes timbre data based on the parameters output by the timbre parameter adjustment module.

[0256] In the specific synthesis process, the timbre data can be calculated using the following formula:

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

[0258] 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 timbre of various musical instruments.

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

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

[0261] Filter: Used to filter the waveform output by the oscillator, thereby changing the spectral characteristics of the tone.

[0262] Envelope generator: Used to control the amplitude changes of audio signals to simulate the dynamics of playing real musical instruments.

[0263] 1) Oscillator output

[0264] Assuming a sinusoidal oscillator is used, its output waveform is as follows:

[0265] Among them, f i f provided for the tone parameter adjustment module osc ;

[0266] 2) Filter output

[0267] Using a low-pass filter, its transfer function is:

[0268] Among them, w c =2πf c f c It is the cutoff frequency of the filter (provided by the tone parameter adjustment module).

[0269] The filter output is: y filtered (t)=y(t)*h(t)

[0270] Where * denotes convolution operation, and h(t) is the impulse response of the filter.

[0271] 3) Envelope generator output

[0272] Using the ADSR (Attack-Decrease-Sustain-Release) envelope, its output is:

[0273] Among them, A max It is the maximum amplitude, t attack It is the onset time, t decay It is the decay time, t hold It is the duration, t releasek Release time (both provided by the tone parameter adjustment module), A sustain It is the amplitude of the sustained phase.

[0274] 4) Specific data and calculation examples:

[0275] Suppose we are generating a piano tone, with the following specific data:

[0276] a) Oscillator parameters:

[0277] Frequency f osc = 261.63Hz (standard frequency of C4)

[0278] Amplitude A = 0.5 (assuming the maximum amplitude is 1.0)

[0279] b) Filter parameters:

[0280] Cutoff frequency f c = 982.41Hz (calculated by the timbre parameter adjustment module)

[0281] Formant Q = 0.941 (calculated from the timbre parameter adjustment module)

[0282] c) Envelope generator parameters:

[0283] Attack time t attack = 0.0285 seconds

[0284] decay time t decay =0.1 seconds

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

[0286] Release time t releasek =0.1 seconds

[0287] Continuous phase amplitude A sustain =0.5 (same as amplitude)

[0288] 5) Calculation process:

[0289] a) Oscillator output: Y(t)=0.5·sin(2π·261.63·t)

[0290] b) Filter output:

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

[0292] c) Envelope generator output:

[0293] The amplitude value at each time point is calculated based on the ADSR envelope formula.

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

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

[0296] During the duration (0.1285 seconds ≤ t < 0.6285 seconds): A(t) = 0.5

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

[0298] 6) Output Results

[0299] After processing 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 of the waveform by the filter, and the control of the signal amplitude by the envelope generator, thereby simulating the timbre of a piano.

[0300] 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.

[0301] Specifically, the dynamic pitch range adjustment module achieves dynamic adjustment of the pitch range, which is calculated using the following formula: D dynamic =D base +ΔD trigger

[0302] Where: D dynamic For the dynamically adjusted vocal range, D base Basic range, ΔD trigger ΔD is the range adjustment calculated based on the triggered note. When the note triggered by the performer exceeds the basic range, ΔD... trigger This will be increased accordingly to expand the range of the timbre generation module.

[0303] Specifically, the dynamic range adjustment module is electrically connected to the timbre generation module, which can monitor the range of notes triggered by the performer in real time and dynamically adjust the range output of the timbre generation module according to this range.

[0304] During implementation, the range of notes triggered by the performer is monitored in real time, and the range adjustment (ΔD) is calculated based on this range. trigger This allows for dynamic adjustment of the timbre generation module's range output. Under the influence of the dynamic range adjustment module, the timbre generation module's range output can change dynamically to adapt to the range of notes triggered by the performer.

[0305] In specific implementation

[0306] 1) Assumption:

[0307] Basic vocal range D base It is set from C3 to C5 (i.e., from middle C to high C), a total of two octaves.

[0308] 2) Range of notes triggered by the performer:

[0309] Suppose the range of notes triggered by the performer is from C3 to G5 (i.e., middle C to high G), which exceeds the basic range of C3 to C5.

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

[0311] Since G5 (high frequency) exceeds the basic frequency range C5, the frequency range adjustment needs to be increased to cover G5.

[0312] Assume that the range adjustment for each note is 0.5 semitones.

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

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

[0315] 4) Dynamically adjust the audio range output:

[0316] According to formula D dynamic =D base +ΔD trigger Calculate the dynamically adjusted vocal range.

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

[0318] The dynamic pitch range adjustment module sends adjustment instructions to the timbre generation module, which then adjusts its pitch range output accordingly to cover the range of notes triggered by the performer.

[0319] The timbre smoothing module is electrically connected to the timbre generation module, enabling smooth timbre transitions between different notes or chords;

[0320] Specifically, the timbre smoothing transition module calculates the parameters for timbre smoothing transition using the following formula:

[0321] Among them, S transition For the transitioned timbre parameters, S current S represents the current timbre parameter. 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.

[0322] Specifically, the timbre smoothing transition module is electrically connected to the timbre generation module to achieve a smooth transition between different notes or chords. The timbre smoothing transition module calculates transition parameters to ensure that the timbre remains natural and smooth during changes, avoiding abrupt timbre jumps.

[0323] In practical implementation:

[0324] Initial state setting

[0325] S current : Current tone parameters, assuming it is the parameter value of piano tone A.

[0326] S target : Target timbre parameters, assumed to be the parameter values ​​for string timbre B.

[0327] α: Smooth transition coefficient. Users prefer a smoother transition process and set it to 0.2 (indicating a slower transition speed).

[0328] During the transition, the value of α gradually increases from 0 to 1 over time. Assuming the transition time is 1 second, we can divide this process into 10 steps (each step lasting 0.1 seconds) and calculate the timbre parameters for each step.

[0329] The timbre generation module calculates S based on the results of each step. transition The value is used to generate the corresponding timbre signal. The user can then hear the effect of a smooth transition from piano timbre A to string timbre B.

[0330] The automatic harmony generation module is electrically connected to the artificial intelligence accompaniment generation module, and can generate harmonious harmonic parts based on the main melody played by the performer.

[0331] Specifically, the automatic harmony generation module is used to calculate the pitch of the phonological symbols, specifically using the following formula: F harmony =F melody +ΔF interval

[0332] Among them, F harmony For the pitch of the harmonic note, F melody The pitch of the main melody note, ΔF interval This is the interval difference between the harmony and the main melody. This value can be adjusted according to preset harmony rules or user selection.

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

[0334] In practical implementation:

[0335] 1) Main theme data

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

[0337] Each note lasts for one beat.

[0338] 2) Harmony rules:

[0339] Choose a simple harmonic rule: for each melody note, generate a harmonic note a third above it (i.e., the harmonic progression of a major triad).

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

[0341] 3) Harmony generation calculation

[0342] According to formula F harmony =F melody +ΔF interval We can calculate the chords corresponding to each main melody note.

[0343] Based on the above calculations, we obtained the harmonic section that harmoniously matches the main melody. The specific results are as follows:

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

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

[0346] The dynamic volume adjustment module dynamically adjusts the output volume according to the dynamics and rhythm changes of the performer.

[0347] Specifically, the volume dynamic adjustment module dynamically adjusts the output volume according to the dynamics and rhythm changes of the performer, achieving dynamic volume adjustment through the following formula: V dynamic =V base +β·F force +γ·ΔV rhythm

[0348] Among them, V dynamic V represents the dynamically adjusted volume level. base The base volume level, β is the coefficient of influence of velocity on volume, F force The dynamics of the performance, γ is the coefficient of influence of rhythmic variation on volume, and ΔV rhythm The amount of volume adjustment caused by rhythm changes.

[0349] Specifically, the dynamic volume adjustment module can dynamically adjust the output volume in real time according to the changes in the user's playing force and rhythm. This not only enhances the expressiveness of the music but also makes the performance more vivid and realistic.

[0350] In practical implementation:

[0351] 1) Basic volume settings:

[0352] Set the base volume V base It is 70dB.

[0353] 2) Setting the force influence coefficient:

[0354] The effect coefficient β of velocity on volume is set to 2. This means that when the playing velocity increases by 1 unit, the volume will increase by 2 dB.

[0355] 3) Setting the influence coefficient and adjustment amount of rhythm changes:

[0356] The influence coefficient γ of rhythm changes on volume is set to 1.5.

[0357] Volume adjustment ΔV due to rhythm changes rhythm It can be calculated based on the rate of change in rhythm. For example, when the rhythm speeds up, ΔV rhythm It can be a positive value, indicating that the volume needs to be increased; when the rhythm slows down, ΔV rhythm It can be a negative value, indicating that the volume needs to be reduced.

[0358] 4) Real-time intensity and rhythm detection:

[0359] The player's playing force F is detected in real time by a sensing sensor unit. force .

[0360] 5) Dynamic volume adjustment:

[0361] Based on the above formula, the dynamically adjusted volume V is calculated in real time. dynamic .

[0362] The calculated V dynamic It is used to adjust the output volume of electronic pianos, enabling dynamic volume control.

[0363] An audio output module is used to convert the timbre data into sound and output it.

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

[0365] The control unit is used to receive user input commands and adjust the system settings parameters according to the commands.

[0366] In this embodiment, the control unit uses an STM32 series microcontroller. The control unit receives user input commands and adjusts the system settings parameters accordingly to ensure the audio output module operates as required by the user.

[0367] In practice,

[0368] 1) Receiving user input:

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

[0370] User interfaces may take the form of physical buttons, knobs, touchscreens, or software interfaces, allowing users to perform intuitive operations.

[0371] 2) Parsing instructions:

[0372] The control unit can parse user input commands and identify user intentions and needs.

[0373] Commands may include volume adjustment, channel balance, audio format selection, sample rate setting, etc.

[0374] 3) Adjust system settings:

[0375] Based on the parsed instructions, the control unit can adjust the system setting parameters of the audio output module.

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

[0377] 4) Feedback on adjustment results:

[0378] The control unit may provide feedback to the user on the adjusted system settings or status through a display screen, sound prompts, or other means.

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

[0380] It also includes a resonance simulation circuit unit, which processes the generated timbre data for resonance effects based on preset resonance parameters, in order to simulate the soundbox effect of a traditional piano.

[0381] Specifically, the resonance simulation circuit unit simulates the resonance phenomenon of musical instruments in nature. Based on preset resonance parameters, it processes the generated timbre data to simulate the resonance box effect of a traditional piano, thereby enhancing the richness and three-dimensionality of the sound and improving the performance experience.

[0382] Through the resonance analog circuit unit, this system can produce richer and more three-dimensional sound effects, enhancing the realism and immersion of the performance. Furthermore, by adjusting the frequency and amplitude of the resonance, it can adapt to different musical styles and performance needs, increasing the flexibility and versatility of the performance.

[0383] Based on preset resonance parameters, the generated timbre data is processed to simulate the resonance box effect of a traditional piano, thereby enhancing the realism and layering of the audio output.

[0384] Resonance parameters, including resonance frequency, decay time, and reverberation effect, can be adjusted via the control unit.

[0385] Specifically:

[0386] 1) Resonance frequency adjustment

[0387] a) Hardware connection: The resonant frequency adjustment circuit in the resonant analog circuit unit is connected to the control unit via an I2C or SPI interface. The circuit contains components such as variable resistors or digital potentiometers for adjusting the resonant frequency.

[0388] b) User input: The user selects the desired resonant frequency via a knob or touchscreen.

[0389] c) Algorithm calculation: The control unit has a built-in algorithm that calculates the corresponding control signals based on user input.

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

[0391] e) Feedback mechanism: The resonance analog circuit unit detects the current resonance frequency in real time and transmits the feedback signal back to the control unit to ensure the accuracy of the adjustment.

[0392] The following is the executable code:

[0393] 2) Decay time adjustment

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

[0395] b) User input: The user selects the desired decay time via a slider or touchscreen.

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

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

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

[0399] The following is the executable code:

[0400] 3) Reverb effect adjustment

[0401] a) Hardware connection: The reverb effect generation circuit and the control unit are connected via a digital audio interface (such as I2S or SPDIF). The circuit contains a digital signal processing (DSP) chip to generate the reverb effect.

[0402] Software implementation:

[0403] b) User input: Users select the desired reverberation type (such as room, hall, lobbies, etc.) and reverberation time via the touchscreen.

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

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

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

[0407] The following is the executable code:

[0408] It also includes an interactive interface unit, which displays the song selection menu, system status information, and the accompaniment note sequence of the currently played song, so that users can understand the current performance status; the interactive interface unit also supports touch operation, and users can adjust and select parameters by touch.

[0409] The interactive interface unit is responsible for displaying the song selection menu, system status information, and the accompaniment note sequence of the currently played song to the user, and supports touch operation so that the user can understand the current performance status and adjust and select parameters.

[0410] 1) Composition of interactive interface units

[0411] Display screen:

[0412] It uses a high-resolution color touchscreen that supports multi-touch, ensuring smooth and accurate user operation.

[0413] User interface design:

[0414] 2) Interface layout:

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

[0416] Central area: Displays the sequence of notes accompanying the currently played song, presented in either standard musical notation or simplified musical notation.

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

[0418] 3) Interface elements:

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

[0420] Buttons: Used by users to trigger specific actions, such as selecting songs or adjusting parameters.

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

[0422] 4) Touch operation implementation

[0423] Gesture recognition:

[0424] It supports gestures such as swiping, double-tapping, and long-pressing, improving the convenience and intuitiveness of operation.

[0425] Interaction logic:

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

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

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

[0429] 5) Information display

[0430] Song selection menu:

[0431] The app displays the titles and thumbnails of multiple songs, allowing users to select different songs to play by touching the screen.

[0432] It supports browsing by category, such as by style, difficulty level, etc.

[0433] System status information:

[0434] The top area of ​​the interface displays the current system settings, such as volume, timbre, and resonance parameters.

[0435] Users can adjust these parameters in real time by touching the sliders or buttons on the screen.

[0436] The current sequence of notes for the accompaniment of the song being played:

[0437] The central area of ​​the interface displays the sequence of notes accompanying the currently played song, presented in either staff notation or simplified musical notation.

[0438] The note sequence updates in real time as the user plays, helping the user understand the current performance status.

[0439] It also includes a wireless communication module for establishing a wireless connection with smart devices to enable data transmission and remote control.

[0440] Specifically:

[0441] 1) Hardware selection and connection

[0442] a) Wireless communication module options:

[0443] Bluetooth module: Choose a module such as HC-05 / 06 or ESP32, which is suitable for short-range communication and easy to pair with smartphones or tablets.

[0444] Wi-Fi module: Choose such as ESP8266 or ESP32 (which has built-in Wi-Fi functionality), suitable for scenarios requiring longer-distance communication or remote control via the Internet.

[0445] Connection method:

[0446] Connect the wireless communication module to the microcontroller via a UART, SPI, or I2C interface.

[0447] Ensure that the power supply and ground connections are correct to guarantee that the module functions properly.

[0448] 2) Communication Protocol and Configuration

[0449] a) Bluetooth communication:

[0450] Use Bluetooth Classic (SPP) or Bluetooth Low Energy (BLE) protocols.

[0451] The configuration module is in slave mode, waiting for smart devices to connect.

[0452] For BLE, services and characteristics are defined for data transmission and control.

[0453] b)Wi-Fi communication:

[0454] The configuration module connects to the specified Wi-Fi network (SSID and password).

[0455] Data transmission is achieved using the TCP / IP protocol and via Socket communication.

[0456] You can set up a web server or REST API endpoint for smart devices to access.

[0457] In implementation, the wireless communication module enables wireless connection and data transmission with external devices (such as mobile phones, computers, audio systems, etc.). Utilizing radio waves for data transmission avoids the cumbersome and limited nature of traditional wired connections, improving the system's flexibility and convenience.

[0458] 1) Data transmission

[0459] Enables audio data transmission with smart devices. For example, it allows real-time transmission of music played on an electronic piano to a smartphone or tablet for playback or recording.

[0460] Enables the transmission of sheet music data, such as sending sheet music from the system to a smartphone or tablet for display and editing.

[0461] 2) Remote control

[0462] Remotely control the electronic piano's playback, pause, and volume adjustment functions using smart devices such as smartphones or tablets.

[0463] Enables remote update and maintenance functions, such as downloading the latest sheet music and firmware updates via wireless network.

[0464] The present invention and its embodiments have been described above. This description is not restrictive, and the accompanying drawings are only one embodiment of the present invention; the actual structure is not limited thereto. In conclusion, if those skilled in the art are inspired by this description and design similar structures and embodiments without departing from the spirit of the invention, such designs should fall within the protection scope of the present invention.

Claims

1. An adaptive rhythm electronic piano accompaniment system based on artificial intelligence, characterized in that: It includes a single-key trigger module, a speed-control signal conversion module, a storage module, an AI 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 dynamic volume adjustment module, an audio output module, and a control unit; The control unit is used to receive and process information from the single-key trigger module, speed-control signal conversion module, storage module, artificial intelligence accompaniment generation module, pitch calculation unit, timbre parameter adjustment module, timbre generation module, dynamic range adjustment module, timbre smooth transition module, automatic harmony generation module, volume dynamic adjustment module, and audio output module, and simultaneously send the processing results to the relevant modules for further processing. The single-key trigger module has a trigger key for the user to trigger during performance to indicate the progress of the accompaniment. The trigger signal generated by the trigger key serves as the indication signal for the progress of the accompaniment. A sensing sensor unit is set below the key to detect the force when the key is pressed and output the pressing speed signal v. The speed-control signal conversion module is used to receive and process speed signals from the sensor according to a preset speed-control signal mapping, and convert them into corresponding music control signals. Specifically, the speed-control signal mapping formula is as follows: Where: v is the speed signal output by the sensor, k is the speed sensitivity coefficient, n is the speed response exponent, and b is the offset. The storage module is used to store the accompaniment note sequence data of multiple songs. The accompaniment note sequence of each song consists of note numbers and optional sharps and flats, and does not contain beat information. It also stores timbre parameter data, preset resonance parameters, parameter settings of the tempo-control signal mapping formula, and parameters of the timbre synthesis model. The AI-powered accompaniment generation module is electrically connected to the storage unit. It retrieves the accompaniment note sequence data of the corresponding song from the storage module based on the triggered single key and the time sequence of the triggering module. It also adjusts the playback speed of the accompaniment according to the current playing speed v and generates accompaniment or harmony in real time. During the accompaniment generation process, it analyzes the accompaniment note sequence and generates harmonious accompaniment or harmony based on the correlation between notes and music theory. The pitch calculation unit is used to calculate the pitch of the accompaniment based on the note numbers and sharps / flats in the accompaniment note sequence. The calculation formula is as follows: F pitch =F base +n·ΔF accidental Among them, F pitch To calculate the accompaniment pitch, F base The base pitch is denoted by n, which represents the semitone number corresponding to the note number. Its value is determined by the sharps or flats; n is positive for sharps and negative for flats; for double sharps or double flats, n is +2 or -2 respectively, and so on. ΔF accidental This represents the frequency increment corresponding to each semitone. The timbre parameter adjustment module adjusts the parameters required for timbre generation based on the accompaniment note sequence output by the AI ​​accompaniment generation module and the pitch and velocity signals calculated by the pitch calculation unit. The timbre generation module is electrically connected to the AI ​​accompaniment generation module and the timbre parameter adjustment module. It simulates the physical process of musical instrument sound production and calculates and synthesizes timbre data based on the parameters output by the timbre parameter adjustment module. In the specific synthesis process, the timbre data can be calculated using the following formula: wherein: Y(t) is the synthesized timbre data, A i is the amplitude of the i-th harmonic, and fi is the frequency of the i-th harmonic, Let N be the phase of the i-th harmonic, and N be 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. The timbre smoothing module is electrically connected to the timbre generation module, enabling smooth timbre transitions between different notes or chords; The automatic harmony generation module is electrically connected with the artificial intelligence accompaniment generation module and is capable of generating a harmonious harmony part according to a main melody played by a player; The volume dynamic adjustment module dynamically adjusts the volume of the output according to the dynamics and rhythm changes of the player; The audio output module is used for converting the tone color data into sound and outputting the sound; The control unit is used for receiving an instruction input by a user and adjusting the setting parameters of the system according to the instruction.

2. The adaptive tempo based electronic piano accompaniment system using artificial intelligence as claimed in claim 1, wherein: The dynamic pitch range adjustment module achieves dynamic adjustment of the pitch range, specifically calculated using the following formula: D dynamic =D base +ΔD trigger Where: D dynamic For the dynamically adjusted vocal range, D base Basic range, ΔD trigger ΔD is the range adjustment calculated based on the triggered note. When the note triggered by the performer exceeds the basic range, ΔD... trigger This will be increased accordingly to expand the range of the timbre generation module.

3. The adaptive tempo based electronic piano accompaniment system using artificial intelligence as claimed in claim 1, wherein: The timbre smooth transition module calculates parameters of timbre smooth transition, and the parameters are calculated through the following formula: Among them, S transition For the transitioned timbre parameters, S current S represents the current timbre parameter. 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 adaptive tempo based electronic piano accompaniment system using artificial intelligence as claimed in claim 1, wherein: The automatic harmony generation module is used to calculate the pitch of the phonological symbols, specifically using the following formula: F harmony =F melody +ΔF interval Among them, F harmony For the pitch of the harmonic note, F melody The pitch of the main melody note, ΔF interval This is the interval difference between the harmony and the main melody. This value can be adjusted according to preset harmony rules or user selection.

5. The adaptive tempo based electronic piano accompaniment system using artificial intelligence as claimed in claim 1, wherein: The dynamic volume adjustment module dynamically adjusts the output volume based on the dynamics and rhythm changes of the performer, using the following formula: V dynamic =V base +β·F force +γ·ΔV rhythm Among them, V dynamic V represents the dynamically adjusted volume level. base The base volume level, β is the coefficient of influence of velocity on volume, F force The dynamics of the performance, γ is the coefficient of influence of rhythmic variation on volume, and ΔV rhythm The amount of volume adjustment caused by rhythm changes.

6. The adaptive tempo based electronic piano accompaniment system using artificial intelligence as claimed in claim 1, wherein: The resonance simulation circuit unit is further included, which is used for performing resonance effect processing on the generated tone color data according to preset resonance parameters, so as to simulate the resonance box effect of a traditional piano.

7. The adaptive tempo based electronic piano accompaniment system using artificial intelligence as claimed in claim 1, wherein: The interactive interface unit is further included, which is used for displaying a song selection menu, system state information and an accompaniment note sequence of a currently played song, so that the user can know the current playing state. The interactive interface unit further supports touch operation, and the user can adjust and select parameters through touch.

8. The adaptive tempo based electronic piano accompaniment system using artificial intelligence as claimed in claim 1, wherein: The wireless communication module is further included, which is used for establishing wireless connection with a smart device, realizing data transmission and remote control.