Method for realizing electronic harmonica based on polyphonic-chromatic scale fusion
By combining a high-precision air pressure sensor array with intelligent algorithms, the functions of diatonic and chromatic harmonicas have been integrated, solving the problem that existing electronic harmonicas cannot simultaneously achieve harmonic effects and scale integrity, and improving the convenience of playing and the naturalness of timbre transitions.
Patent Information
- Application Number
- CN202511320950.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-16
- Publication Date
- 2025-12-12
AI Technical Summary
Existing electronic harmonica products fail to effectively integrate the harmonic effects of diatonic harmonicas and the complete scale function of chromatic harmonicas, resulting in performers needing to prepare multiple harmonicas to cope with different performance scenarios, and the operation methods are fixed, making it difficult to meet diverse needs.
It employs a high-precision air pressure sensor array combined with intelligent algorithms to detect air pressure changes in real time and determine the playing mode, automatically switching between polyphonic or chromatic modes to achieve the fusion of harmonic effects and complete scales.
Users can play different styles of music without having to carry multiple harmonicas, improving the convenience and flexibility of playing, and ensuring the true reproduction of tone and precise control of the performance.
Smart Images

Figure CN121122216A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application generally relate to the technical field of electronic harmonica, and in particular, to a method for implementing an electronic harmonica based on the fusion of diatonic-half-step scales. BACKGROUND
[0002] As a kind of long history free reed instrument, harmonica has developed various structural forms since its appearance in the 19th century, among which diatonic harmonica, chromatic harmonica and half-step harmonica constitute the three major mainstream systems of modern harmonica family. Diatonic harmonica is popular in Asia, especially in China, because of its unique natural harmonic effect produced by double-row reed design and bright and pleasant timbre characteristics, and becomes an ideal choice for performing national music and popular music; while half-step harmonica realizes complete half-step coverage through ingenious transposition key mechanism, which makes it show unique advantages in classical music and jazz music and other works that require complex harmony and modulation. Although these two kinds of harmonicas have their own advantages, the traditional structure determines their limitations in function: diatonic harmonica needs to be replaced by a musical instrument or special blowing skills to express half-step, while the operation of half-step harmonica keys forms a high technical threshold for beginners, and it also lacks the characteristic timbre of diatonic harmonica. This contradiction between function and ease of use has long restricted the popularity and development of harmonica art.
[0003] With the development of electronic technology, digital musical instruments have emerged in the field of traditional harmonicas. The electronic harmonicas on the market mainly simulate a single type, some of which imitate the harmonic effect of diatonic harmonica, and others use the key design of half-step harmonica, but none of them can effectively integrate the functional characteristics of the two types of harmonicas. In terms of sound simulation, most of the existing products use sampling playback technology, which has limited simulation accuracy of reed vibration and air flow; in terms of operation mode, the function settings are fixed, which is difficult to meet the diversified performance needs. At present, there is no product design that can balance the ease of operation of diatonic harmonica and the complete scale of half-step harmonica, which makes performers need to prepare and learn multiple harmonicas to cope with different performance scenarios. SUMMARY
[0004] To solve the above problems, the present application combines high-precision air pressure sensor array and intelligent algorithm, the system can detect air pressure changes in real time and judge the performance blowing of blowing, automatically sound according to the blowing mode, integrate the harmonic effect of diatonic harmonica and the complete scale function of half-step harmonica in one electronic harmonica, so that users can perform different styles of music without carrying multiple harmonicas.
[0005] According to embodiments of the present application, a method for implementing an electronic harmonica based on the fusion of diatonic-half-step scales is provided.
[0006] In the first aspect of the present application, a method for implementing an electronic organ based on the fusion of complex tone-half tone scale is provided. The method comprises: Step S01: Before blowing, the user selects the complex tone or half tone scale mouthpiece to be blown and installs it on the organ. The system intelligently judges the current mouthpiece type and sets the corresponding mouthpiece shielding data according to the type of the organ; Step S02: After blowing, the air pressure sensor is used to collect the blowing air pressure value of the organ and calculate the blowing air pressure change value of the organ; Step S03: According to the absolute value of the current blowing air pressure change, it is judged whether to calculate the blowing air pressure change parameter, and whether the blowing air pressure change absolute value of the maximum blowing is blowing or sucking; Step S04: Calculate the comparison parameter of all blowing according to the blowing air pressure change parameter; Step S05: Compare the size of all blowing comparison parameters to determine the main mouthpiece with the largest comparison parameter. Detect if the half tone key is pressed and get the calculation of the main mouthpiece sound note according to the blowing mode. Detect the main mouthpiece sound state. If it has been sounding, adjust the loudness. If it has not been sounding, select the sound channel output mode according to the current blowing mode.
[0007] Further, the blowing shielding data is specifically: 0, not allowed to blow and suck; 1, allowed to blow; 2, allowed to suck; 3, allowed to blow and suck.
[0008] Further, the left or right edge of the complex tone blowing mouthpiece in step S01 is built-in magnet, N or S facing the organ, and HALL chip is installed at the left or right edge of the organ corresponding to the blowing.
[0009] Further, the specific steps of step S01 are: the system judges whether the HALL output deviates from the middle level. If the output level deviates from the middle level, the organ mode is switched to complex tone organ, and the blowing shielding data of each blowing is set to: odd blowing is 1, even blowing is 2; If no level deviation is detected, the organ mode is switched to half tone organ, and the blowing shielding data of each blowing is set to: odd blowing is 3, even blowing is 0.
[0010] Further, the formula of the blowing air pressure change value in step S02 is: , Wherein, is the i-th blowing air pressure change value, is the i-th blowing air pressure value, is the default blowing air pressure value; The formula of the blowing air pressure change parameter in step S03 is: , Wherein, the i-th puffer air pressure change parameter, the i-th puffer air pressure change value, the puffer default air pressure value.
[0011] Further, the step of judging whether the puffer with the largest absolute value of puffer air pressure change is blowing or sucking in step S03 is: if the puffer air pressure change value is positive, it is blowing, and BlowDrawFlag is set to 1; if the puffer air pressure change value is negative, it is sucking, and BlowDrawFlag is set to 2.
[0012] Further, the specific step of step S05 is: finding the largest comparison parameter of all puffer corresponding puffer shielding data and BlowDrawFlag after calculation, and the corresponding puffer is the main puffer. If the main puffer is not in pronunciation, the pronunciation is made according to the puffer type judged in step S01. If it is a complex tone mode, two sound channels are pronounced, and the fine tuning frequencies of the two sound channels are different. If it is a semitone mode, a single sound channel is pronounced. The algorithm for calculating the puffer shielding data and BlowDrawFlag is: input value={puffer shielding data, BlowDrawFlag}; when the input value={0, 1}, the output is 0; when the input value={0, 2}, the output is 0; when the input value={1, 1}, the output is 1; when the input value={1, 2}, the output is 0; when the input value={2, 1}, the output is 0; when the input value={2, 2}, the output is 2; when the input value={3, 1}, the output is 1; and when the input value={3, 2}, the output is 2.
[0013] In the second aspect of the present application, a device for implementing an electronic organ based on complex tone-semitone fusion is provided. The device comprises: a puffer mode judgment module: for selecting a complex tone puffer or a semitone puffer to be played by a user before playing, and intelligently judging the current puffer type and setting the corresponding puffer shielding data according to the type of the organ; an air pressure change value calculation module: for collecting the puffer air pressure value of the organ by using an air pressure sensor after playing, and calculating the puffer air pressure change value of the organ; a blowing and sucking mode judgment module: for judging whether to calculate the puffer air pressure change parameter according to the absolute value of the current puffer air pressure change, and judging whether the puffer with the largest absolute value of puffer air pressure change is blowing or sucking; a comparison parameter calculation module: for calculating the comparison parameters of all puffers according to the puffer air pressure change parameter; Blowing pronunciation module: used for comparing the sizes of all blowing comparison parameters to determine the blowing with the largest comparison parameter as the main blowing, detecting whether the semitone key is pressed, and obtaining the calculation main blowing pronunciation note according to the blowing mode, detecting the main blowing pronunciation state, adjusting the loudness if the pronunciation has been made, and selecting the sound channel output mode according to the current blowing mode if the pronunciation has not been made.
[0014] In a third aspect of the application, an electronic device is provided. The electronic device comprises a memory and a processor, the memory having stored thereon a computer program, the processor implementing the method according to the first aspect of the application when executing the program.
[0015] In a fourth aspect of the application, a computer readable storage medium is provided, having stored thereon a computer program, the program being executed by a processor to implement the method according to the first aspect of the application.
[0016] The present application combines high-precision air pressure sensor array with intelligent algorithm, the system can detect air pressure changes in real time and judge the performance blowing during blowing, automatically pronounce according to blowing mode, integrate the harmony effect of polyphonic harmonica and the complete scale function of semitone harmonica in one electronic harmonica, users do not need to carry multiple harmonicas to play different styles of music.
[0017] It should be understood that the content described in the summary section is not intended to limit the key or important features of the embodiments of the present application, nor to limit the scope of the present application. Other features of the present application will become apparent through the following description.
[0018] Advantages of the present application: 1. The harmony effect of polyphonic harmonica and the complete scale function of semitone harmonica are integrated in one electronic harmonica, and users do not need to carry multiple harmonicas to play different styles of music; 2. Through simple blowing installation operation, users can seamlessly switch between polyphonic mode and semitone mode without changing harmonicas, improving the convenience and flexibility of performance; 3. The built-in high-precision air pressure sensor can accurately capture blowing strength and air flow changes, ensuring accurate reproduction of timbre and accurate control of performance, and through intelligent algorithm processing and analysis of sensor data, the two-in-one harmonica can realize more natural and smooth timbre conversion and scale switching, improving the performance experience. BRIEF DESCRIPTION OF DRAWINGS
[0019] The above and other features, advantages, and aspects of embodiments of the present application will become more apparent by referring to the following detailed description in conjunction with the accompanying drawings, in which: Figure 1 An algorithm implementation flowchart of a method for implementing an electronic harmonica based on polyphonic-semitone scale fusion according to an embodiment of the present application is shown; Figure 2 Fig. 1 shows a schematic diagram of a structure of a chromatic harmonica mouthpiece according to an embodiment of the present application; Figure 3 Fig. 2 shows a schematic diagram of a structure of a chromatic harmonica mouthpiece after installation according to an embodiment of the present application; Figure 4 Fig. 3 shows a schematic diagram of a structure of a diatonic harmonica mouthpiece after installation according to an embodiment of the present application; Figure 5 Fig. 4 shows a block diagram of a device according to an embodiment of the present application; Figure 6 Fig. 5 shows a schematic diagram of an apparatus according to an embodiment of the present application. DETAILED DESCRIPTION
[0020] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0021] According to the embodiments of the present application, a method for implementing an electronic harmonica based on a fusion of chromatic and diatonic scales is provided. By combining a high-precision air pressure sensor array and an intelligent algorithm, the system can detect air pressure changes in real time and determine the performance mouthpiece during blowing. The electronic harmonica can automatically produce sound according to the blowing mode, integrate the harmonic effect of the chromatic harmonica and the complete scale function of the diatonic harmonica in one electronic harmonica, and enable users to perform different styles of music without carrying multiple harmonicas.
[0022] In order to more clearly explain the method for implementing an electronic harmonica based on a fusion of chromatic and diatonic scales, two specific embodiments will be described below. However, it should be noted that the embodiments are only used to better illustrate the present application and do not constitute an improper limitation on the present application.
[0023] The method for implementing an electronic harmonica based on a fusion of chromatic and diatonic scales will be further described in detail below with two specific examples: In this embodiment, the selection of the chromatic harmonica mode and the diatonic harmonica mode is automatically selected by the user installing different mouthpieces. This selection can install different sensors on the mouthpiece, so that the harmonica can automatically identify which mouthpiece is installed on the harmonica, and automatically switch the harmonica mode.
[0024] As shown in Figure 2 The left or right edge of the chromatic harmonica mouthpiece is embedded with a magnet, and the N or S is directed towards the harmonica. A HALL chip is installed at the left or right edge of the harmonica corresponding to the mouthpiece. In this embodiment, the S pole is directed towards the body, and the diatonic harmonica mouthpiece does not have a magnet, and a HALL chip is installed at the left edge of the harmonica corresponding to the mouthpiece. When the chromatic harmonica mouthpiece is installed on the harmonica, the HALL chip will output a low level under the action of the magnet, deviating from the output of the intermediate level. The program will detect the change of this signal, and consider that the chromatic harmonica mouthpiece is installed on the harmonica, and thus switch the current blowing mode to the chromatic mode.
[0025] When the diatonic harmonica mouthpiece is installed on the harmonica, there is no magnet, and the HALL chip will always output an intermediate level. The program will detect this signal and consider that the diatonic harmonica mouthpiece is installed on the harmonica, and thus switch the current blowing mode to the diatonic mode.
[0026] The upper and lower rows of reeds of the chromatic harmonica sound at the same time, and the electronic harmonica needs to simulate this unique effect of sound emission, that is, 2 sound channels emit sound and each sound channel emits the same tone and sound, but the frequency of the 2 sound channels is different, with a difference of 5-10 cents. In this way, the sound emitted by the 2 sound channels can form the effect of beat, and the sound emission effect of 2 reeds can be simulated.
[0027] And the diatonic harmonica is single-reed sound emission, and the electronic harmonica also needs to simulate this sound emission effect to distinguish from the chromatic harmonica.
[0028] In the design, each mouthpiece of the electronic harmonica can blow and suck to emit sound, but when set to chromatic harmonica sound emission, a single mouthpiece can only suck or blow. Each mouth of the diatonic harmonica can blow and suck, but the distance between the mouths is larger than that of the chromatic harmonica. This harmonica uses a pair of chromatic harmonica mouthpieces to realize the function of a single diatonic harmonica mouthpiece: the first or second mouth can blow and suck to emit sound, and the other mouth does not emit sound when blowing and sucking. This is equivalent to widening the distance between the blowing and sucking mouthpieces, avoiding the possibility of misblowing and sucking.
[0029] The electronic harmonica of this embodiment also needs to use a specific algorithm for cooperation design, which is: define each mouthpiece shielding data DrawBlowBit[]: 0 does not allow blowing and sucking, 1 allows blowing, 2 allows sucking, and 3 allows blowing and sucking.
[0030] The data of the chromatic harmonica set mouthpiece is 1, 2, 1, 2, 1, 2…, which represents that the mouthpiece can blow, suck, blow, suck, blow, and suck…
[0031] The settings for the mouthpiece on a chromatic harmonica are 3, 0, 3, 0, 3, 0…, which means the mouthpiece can be used for blowing and drawing, empty, blowing and drawing, empty, blowing and drawing, empty…
[0032] Step S01: Before playing, the user selects the mouthpiece they want to play and installs it on the harmonica. The system determines the current mouthpiece type and sets the corresponding mouthpiece DrawBlowBit data according to the harmonica type.
[0033] Specifically: The system determines whether the HALL output deviates from the middle level. If the output level deviates from the middle level, the harmonica mode is switched to polyphonic harmonica, and the DrawBlowBit data for each mouthpiece is set to: 1, 2, 1, 2, 1, 2…; if no level deviation is detected, the harmonica mode is switched to chromatic harmonica, and the DrawBlowBit data for each mouthpiece is set to: 3, 0, 3, 0, 3, 0….
[0034] Step S02: After playing begins, the air pressure value of the harmonica's mouthpiece is collected using an air pressure sensor, and the change value of the harmonica's mouthpiece air pressure is calculated.
[0035] The formula for the change in mouth pressure is: , in, Let i be the change in air pressure at the i-th nozzle. Let i be the air pressure value at the i-th nozzle. This is the default air pressure value for the nozzle.
[0036] Step S03: Determine whether to calculate the mouthpiece pressure change parameter based on the absolute value of the current mouthpiece pressure change, and determine whether the mouthpiece with the largest absolute value of mouthpiece pressure change is blowing or inhaling.
[0037] The specific steps are as follows: detect whether the change value of the blowing air pressure exceeds the preset valve. If it does not exceed the preset valve, set the air pressure change parameter to 0. If the pressure exceeds the predetermined valve value, the air pressure change parameter for that nozzle is set, and the specific formula is as follows: , in, Let i be the parameter representing the change in air pressure at the i-th nozzle. Let i be the change in air pressure at the i-th nozzle. This is the default air pressure value for the nozzle.
[0038] Identify the mouthpiece with the largest absolute change in mouthpiece pressure. If the change in mouthpiece pressure is positive, it is considered blowing air, and BlowDrawFlag is set to 1. If the change in mouthpiece pressure is negative, it is considered inhaling air, and BlowDrawFlag is set to 2.
[0039] Step S04: Calculate the comparison parameters for all nozzles based on the nozzle air pressure change parameters.
[0040] The specific steps are as follows: detect whether the change value of the blowing air pressure exceeds the set preset valve. If it does not exceed the preset valve, set its comparison parameter to 0. If the change values of all sensors do not exceed the set preset valve, then turn off the main tone and chord tone that have been uttered. If the pressure exceeds the predetermined valve, the comparison parameter for all nozzles is set to a weighted average of their own pressure change parameter and the pressure change parameters of the left and right sensors, using the following formula: , in, For the comparison parameter of the i-th blowhole, Let i be the parameter representing the change in air pressure at the i-th nozzle. Parameters of air pressure change at the (i-1)th nozzle. The parameter for the change in air pressure at the (i+1)th nozzle is k, where k is the weight, 1≤i≤n, and n is the total number of nozzles.
[0041] If the current blowing nozzle is the first blowing nozzle, i.e., i=1, then If the current blowing nozzle is the last blowing nozzle, i.e., when i=n, then .
[0042] Step S05: Compare the values of all mouthpiece comparison parameters to determine the mouthpiece with the largest comparison parameter as the master mouthpiece. Detect whether the semitone button is pressed, and obtain and calculate the note to be pronounced by the master mouthpiece according to the mouthpiece mode. Detect the master mouthpiece's pronunciation status. If it is already producing sound, adjust the loudness. If it is not producing sound, select the channel output mode according to the current mouthpiece mode.
[0043] Specifically, find the largest non-zero comparison parameter after calculating DrawBlowBit and DrawBlowFlag for all blowholes; the corresponding blowhole is the main blowhole.
[0044] The specific algorithm for calculating DrawBlowBit and BlowDrawFlag is as follows: Input value = {DrawBlowBit, BlowDrawFlag}; When the input value = {0, 1}, output 0; When the input value = {0, 2}, output 0; When the input value = {1, 1}, output 1; Input value = {1, 2}, output 0; Input value = {2, 1}, output 0; Input value = {2, 2}, output 2; Input value = {3, 1}, output 1; Input value = {3, 2}, output 2.
[0045] If the main mouth is already producing sound, adjust its loudness according to the air pressure parameters.
[0046] If the main mouth is not producing sound, then the sound is produced according to the mouthpiece type determined in step S01. If it is a polyphonic mode, then both channels produce sound, and the fine-tuning frequencies of these two channels are set to differ by a few cents; if it is a chromatic mode, then a mono voice is produced.
[0047] The harmonica has 24 mouthpieces, with a preset valve value of 4 and a default mouthpiece air pressure value. Let's take an example with a value of 100 and a weight of k=0.5: Example 1: Choose a mouthpiece to install on the harmonica, with each mouthpiece corresponding to a note on a traditional diatonic harmonica.
[0048] The harmonica's mouthpiece contains a HALL chip, allowing the system to detect low levels and switch the harmonica to polyphonic mode. Therefore, mouthpieces 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, and 23 only respond to changes in blowing air pressure and set DrawBlowBit to 1; mouthpieces 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, and 24 only respond to changes in inhaled air pressure and set DrawBlowBit to 2. Figure 3 As shown.
[0049] After the first playing, the air pressure sensor collected the air pressure values at the mouthpiece of the harmonica, as shown in Table 1: Table 1
[0050] The changes in mouth pressure are shown in Table 2: Table 2
[0051] The absolute values of the air pressure changes at nozzles 7, 8, 9, and 10 exceeded the predetermined valve values. The air pressure change parameters for these nozzles were 0.14, 0.29, 0.3, and 0.12, respectively.
[0052] The 9th nozzle has the largest absolute change in air pressure. If the air pressure value of the nozzle is positive, then it is blowing air, and BlowDrawFlag is set to 1.
[0053] If the absolute value of the air pressure change at the remaining nozzles does not exceed the predetermined valve, then the air pressure change parameter is set to 0. Therefore, the air pressure change parameters for the 24 nozzles are shown in Table 3. Table 3
[0054] The comparison parameters for all blowholes are calculated as shown in Table 4: Table 4
[0055] All the non-zero embouchures corresponding to the DrawBlowBit and DrawBlowFlag calculations are 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, and 23. The embouchure with the largest comparison parameter is the 9th embouchure, so the 9th embouchure is the main embouchure. No semitone key was pressed, and since this is the first time playing, the 9th embouchure is not producing any sound. Based on the judgment that this performance is in polyphonic mode, the two channels of the main embouchure are producing sound, and the fine-tuning frequency of these two channels is set to be ±5 cents different, forming the unique harmonic effect of the polyphonic harmonica.
[0056] Continue playing the harmonica. If the second blow is still the 9th blow, repeat the above steps. The only difference is that after determining that the 9th blow is the main blow, the main blow is producing sound. In this case, you need to adjust the volume of the main blow according to the air pressure parameters.
[0057] Continue playing the harmonica. After the third time, the air pressure sensor collected the air pressure values at the mouthpiece of the harmonica, as shown in Table 5. Table 5
[0058] The changes in mouth pressure are shown in Table 6: Table 6
[0059] The absolute values of the air pressure changes at nozzles 13, 14, and 15 exceeded the predetermined valve values. The air pressure change parameters for these nozzles were 0.1, 0.3, and 0.12, respectively.
[0060] The 14th mouthpiece has the largest absolute change in mouthpiece pressure. If the change in mouthpiece pressure is negative, it indicates inhalation, and BlowDrawFlag is set to 2.
[0061] If the absolute value of the air pressure change at the remaining nozzles does not exceed the predetermined valve, then the air pressure change parameter is set to 0. Therefore, the air pressure change parameters for the 24 nozzles are shown in Table 7. Table 7
[0062] The comparison parameters for all blowholes are calculated as shown in Table 8: Table 8
[0063] The non-zero values for all embouchures after calculation using DrawBlowBit and DrawBlowFlag are 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, and 24. The embouchure with the largest comparison parameter is embouchure number 14. Therefore, embouchure number 14 is the master embouchure. Since no semitone button is pressed, embouchure number 14 is not producing sound. Based on this, the performance is determined to be in polyphonic mode. Therefore, both channels of the master embouchure are producing sound, and the fine-tuning frequencies of these two channels are set to differ by ±5 cents.
[0064] Example 2: Select the mouthpieces from the chromatic harmonica and install them onto the harmonica. Each mouthpiece corresponds one-to-one with the mouthpieces of two diatonic harmonicas: that is, the mouthpiece is connected to one of the diatonic harmonica mouthpieces (using odd-numbered mouthpieces as an example below), while the mouthpiece of the other diatonic harmonica is covered and does not produce sound. Specifically, mouthpieces 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, and 23 of the diatonic harmonica correspond to mouthpieces 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12 of the chromatic harmonica, while mouthpieces 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, and 24 of the diatonic harmonica are covered. Figure 4 As shown.
[0065] Specifically, the covered mouthpieces can also be odd-numbered mouthpieces, that is: odd-numbered mouthpieces are 0, and even-numbered mouthpieces are 3, as long as the designed chromatic mouthpieces are aligned with the even-numbered mouthpieces, while the odd-numbered mouthpieces are covered.
[0066] Since there is no magnet installed inside the mouthpiece of the chromatic harmonica, the system cannot detect the level deviation of HALL. Switching the harmonica mode to chromatic mode, mouthpieces 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, and 23 can be blown and drawn, that is, mouthpieces 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12 in chromatic mode can be blown and drawn, and BlowDrawFlag is set to 3; mouthpieces 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, and 24 cannot be blown and drawn, and BlowDrawFlag is set to 0.
[0067] After the first playing, the air pressure sensor collected the air pressure values at the mouthpiece of the harmonica, as shown in Table 9: Table 9
[0068] The changes in mouth pressure are shown in Table 10: Table 10
[0069] If the absolute value of the air pressure change at the 9th nozzle exceeds the predetermined valve value, then the air pressure change parameter for that nozzle is set to 0.3.
[0070] The 9th mouthpiece has the largest absolute change in air pressure. If the change in air pressure at the mouthpiece is positive, then it is considered blowing air.
[0071] If the absolute value of the air pressure change at the remaining nozzles does not exceed the predetermined valve, then the air pressure change parameter is set to 0. Therefore, the air pressure change parameters for the 24 nozzles are shown in Table 11. Table 11
[0072] If the absolute value of the air pressure change at the 9th nozzle exceeds the predetermined valve value, then the comparison parameters for all nozzles are calculated as shown in Table 12: Table 12
[0073] If the non-zero number of all embouchures calculated by DrawBlowBit and DrawBlowFlag is an odd number, then the embouchure with the largest comparison parameter is the 9th embouchure. Therefore, the 9th embouchure is the main embouchure. Since no semitone button is pressed and this is the first time playing, the 9th embouchure is not producing any sound. Based on the judgment that this performance is in chromatic mode, the main embouchure is made to produce the corresponding scale.
[0074] Specifically, if a semitone button is detected, the 9th embouchure will produce a note by raising the pitch by one semitone by pressing the corresponding note button plus the semitone button.
[0075] Continue playing the harmonica. If the second blow is still the 9th blow, repeat the above steps. The only difference is that after determining that the 9th blow is the main blow, the main blow is producing sound. In this case, you need to adjust the volume of the main blow according to the air pressure parameters.
[0076] Continue playing the harmonica. After the third time, the air pressure sensor collected the air pressure values at the mouthpiece of the harmonica, as shown in Table 13. Table 13
[0077] The changes in mouth pressure are shown in Table 14: Table 14
[0078] The absolute values of the air pressure changes at nozzles 22, 23, and 24 exceeded the predetermined valve values. The air pressure change parameters at the nozzles were -0.1, -0.3, and -0.08, respectively.
[0079] The 23rd nozzle has the largest absolute value of pressure change, indicating a negative pressure change and thus intake. The absolute values of pressure changes for the remaining nozzles do not exceed the predetermined valve value, so the pressure change parameter is set to 0. Therefore, the pressure change parameters for the 24 nozzles are shown in Table 15. Table 15
[0080] The comparison parameters for all blowholes are calculated as shown in Table 16: Table 16
[0081] If the non-zero number of all embouchures calculated using DrawBlowBit and DrawBlowFlag is odd, then the embouchure with the largest comparison parameter is the 23rd embouchure. Therefore, the 23rd embouchure is the master embouchure. Since no semitone key is pressed, and the 23rd embouchure is not producing sound, it is determined that this performance is in chromatic mode. Therefore, the master embouchure produces the corresponding note.
[0082] Based on the same inventive concept, this invention also proposes a device for implementing an electronic harmonica based on polyphonic-chromatic fusion. The implementation of this device can be found in the implementation of the method described above; repeated details will not be repeated. Figure 5 As shown, the device 100 includes: Blowing Mode Judgment Module 101: Before playing begins, the user selects the polyphonic or chromatic blowing mouthpiece to be played and installs it on the harmonica. The system intelligently determines the current blowing mouthpiece type and sets the corresponding blowing mouthpiece shielding data according to the type of harmonica. Air pressure change calculation module 102: After playing begins, it uses an air pressure sensor to collect the air pressure value of the harmonica's mouthpiece and calculate the air pressure change value of the harmonica's mouthpiece. Blowing / Sucking Mode Judgment Module 103: Used to determine whether to calculate the blowing / sucking mode change parameter based on the absolute value of the current blowing / sucking mode change, and to determine whether the blowing / sucking mode with the largest absolute value of the blowing / sucking mode change is blowing or sucking. Comparison parameter calculation module 104: used to calculate the comparison parameters of all mouthpieces based on the mouthpiece air pressure change parameters; The mouthpiece sound production module 105 is used to compare the size of all mouthpiece comparison parameters to determine the mouthpiece with the largest comparison parameter as the master mouthpiece, detect whether the semitone button is pressed, and obtain and calculate the main mouthpiece's sound production note according to the mouthpiece mode. If the main mouthpiece is already producing sound, the loudness is adjusted; if it is not producing sound, the channel output mode is selected according to the current mouthpiece mode.
[0083] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the described module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0084] like Figure 6 As shown, the device includes a central processing unit (CPU), which can perform various appropriate actions and processes based on computer program instructions stored in read-only memory (ROM) or loaded from storage units into random access memory (RAM). The RAM can also store various programs and data required for device operation. The CPU, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0085] Multiple components in the device are connected to the I / O interface, including: input units such as keyboards and mice; output units such as various types of displays and speakers; storage units such as disks and optical discs; and communication units such as network interface cards (NICs), modems, and wireless transceivers. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0086] The processing unit executes the various methods and processes described above, such as method steps S01 to S05. For example, in some embodiments, method steps S01 to S05 may be implemented as a computer software program tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more steps of method steps S01 to S05 described above may be performed. Alternatively, in other embodiments, the CPU may be configured to execute method steps S01 to S05 by any other suitable means (e.g., by means of firmware).
[0087] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload programmable logic devices (CPLDs), and so on.
[0088] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0089] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0090] Furthermore, although the operations are described in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the invention. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.
[0091] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for implementing an electronic harmonica based on polyphonic-chromatic fusion, characterized in that, The method includes: Step S01: Before playing, the user selects the polyphonic or chromatic mouthpiece to be played and installs it on the harmonica. The system intelligently determines the current mouthpiece type and sets the corresponding mouthpiece shielding data according to the type of harmonica. Step S02: After playing begins, the air pressure value of the harmonica's mouthpiece is collected using an air pressure sensor, and the change value of the harmonica's mouthpiece air pressure is calculated. Step S03: Determine whether to calculate the mouthpiece pressure change parameter based on the absolute value of the current mouthpiece pressure change, and determine whether the mouthpiece with the largest absolute value of mouthpiece pressure change is blowing or inhaling; Step S04: Calculate the comparison parameters for all nozzles based on the nozzle air pressure change parameters; Step S05: Compare the values of all mouthpiece comparison parameters to determine the mouthpiece with the largest comparison parameter as the master mouthpiece. Detect whether the semitone button is pressed, and obtain and calculate the note to be pronounced by the master mouthpiece according to the mouthpiece mode. Detect the master mouthpiece's pronunciation status. If it is already producing sound, adjust the loudness. If it is not producing sound, select the channel output mode according to the current mouthpiece mode.
2. The method for implementing an electronic harmonica based on polyphonic-chromatic fusion according to claim 1, characterized in that, The specific data for the blowhole shielding is as follows: 0 disallows blowing and suction, 1 allows blowing, 2 allows suction, and 3 allows both blowing and suction.
3. The method for implementing an electronic harmonica based on polyphonic-chromatic fusion according to claim 2, characterized in that, In step S01, a magnet is built into the left or right edge of the polyphonic mouthpiece, with N or S facing the harmonica, and a HALL chip is installed at the left or right edge of the corresponding mouthpiece on the harmonica.
4. The method for implementing an electronic harmonica based on polyphonic-chromatic fusion according to claim 3, characterized in that, The specific steps of step S01 are as follows: The system determines whether the HALL output deviates from the middle level. If the output level deviates from the middle level, the harmonica mode is switched to polyphonic harmonica, and the masking data of each mouthpiece is set as follows: odd mouthpieces are 1 and even mouthpieces are 2. If no level deviation is detected, the harmonica mode is switched to chromatic harmonica, and the masking data of each mouthpiece is set as follows: odd mouthpieces are 3 and even mouthpieces are 0.
5. The method for implementing an electronic harmonica based on polyphonic-chromatic fusion according to claim 1, characterized in that, The formula for the change in nozzle air pressure mentioned in step S02 is: , in, Let i be the change in air pressure at the i-th nozzle. Let i be the air pressure value at the i-th nozzle. This is the default air pressure value for the nozzle; The formula for the nozzle air pressure change parameter mentioned in step S03 is: , in, Let i be the parameter representing the change in air pressure at the i-th nozzle. Let i be the change in air pressure at the i-th nozzle. This is the default air pressure value for the nozzle.
6. The method for implementing an electronic harmonica based on polyphonic-chromatic fusion according to claim 5, characterized in that, The step S03, which determines whether the mouthpiece with the largest absolute change in mouthpiece pressure is blowing or inhaling, is as follows: if the change in mouthpiece pressure is positive, it is blowing, and BlowDrawFlag is set to 1; if the change in mouthpiece pressure is negative, it is inhaling, and BlowDrawFlag is set to 2.
7. The method for implementing an electronic harmonica based on polyphonic-chromatic fusion according to claim 6, characterized in that, The specific steps of step S05 are as follows: find the blowhole shielding data corresponding to all blowholes and the largest non-zero comparison parameter after BlowDrawFlag calculation. The corresponding blowhole is the main blowhole. If the main blowhole is already producing sound, adjust its loudness according to the air pressure parameter. If the main mouth is not producing sound, then sound is produced according to the mouthpiece type determined in step S01. If it is a polyphonic mode, both channels produce sound, and the fine-tuning frequencies of the two channels are different; if it is a chromatic mode, then a single channel produces sound. The specific algorithm for calculating the mouthpiece masking data and BlowDrawFlag is as follows: Input value = {mouthpiece masking data, BlowDrawFlag}; When input value = {0, 1}, output 0; When input value = {0, 2}, output 0; When input value = {1, 1}, output 1; Input value = {1, 2}, output 0; Input value = {2, 1}, output 0; Input value = {2, 2}, output 2; Input value = {3, 1}, output 1; Input value = {3, 2}, output 2.
8. A device based on an electronic harmonica with polyphonic-chromatic fusion, characterized in that, The device implements the method as described in any one of claims 1 to 7, comprising: Blowing Mode Judgment Module: Before playing begins, the user selects the polyphonic or chromatic blowing mode to install on the harmonica. The system intelligently determines the current blowing mode type and sets the corresponding blowing mode masking data according to the type of harmonica. Air pressure change calculation module: After playing begins, it uses an air pressure sensor to collect the air pressure value of the harmonica's mouthpiece and calculates the change value of the air pressure in the harmonica's mouthpiece. Blowing / Suction Mode Judgment Module: Used to determine whether to calculate the blowing / suction pressure change parameter based on the absolute value of the current blowing / suction pressure change, and to determine whether the blowing / suction with the largest absolute value of the blowing / suction pressure change is blowing or sucking. Comparison Parameter Calculation Module: Used to calculate the comparison parameters for all nozzles based on the nozzle air pressure change parameters; The mouthpiece sound production module is used to compare the magnitude of the comparison parameters of all mouthpieces to determine the mouthpiece with the largest comparison parameter as the master mouthpiece. It detects whether the semitone button is pressed, and obtains and calculates the main mouthpiece's sound note according to the mouthpiece mode. If the main mouthpiece is producing sound, it adjusts the loudness; if it is not producing sound, it selects the channel output mode according to the current mouthpiece mode.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.
