Display method of user pitch bar and computer readable storage medium

By correcting the user's pitch value, the pitch of the higher or lower octave is mapped to the song's range. Combined with the display of drawing position and color differences, this solves the problems of the lack of rigor in the display of user pitch and the inability to compare the higher and lower octaves in the existing technology, and achieves more accurate pitch bar display and complete error correction information.

CN116844561BActive Publication Date: 2025-12-05FUJIAN STAR NET EVIDEO INFORMATION SYST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310833132.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-07
Publication Date
2025-12-05
Estimated Expiration
2043-07-07

AI Technical Summary

Technical Problem

Existing technologies lack rigor and error correction capabilities in displaying user pitch, and users cannot effectively observe pitch comparison results when singing an octave higher or lower.

Method used

By correcting the user's pitch value according to the song's range, user pitches that are higher or lower than an octave of the song are mapped to the song's range. The user's pitch bar and the standard pitch bar are then compared and displayed within the same range, taking into account differences in drawing position, width, height, and color.

Benefits of technology

It enables effective observation of pitch comparison results even when the user sings an octave higher or lower, ensuring the integrity of error correction information and reducing interface clutter.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116844561B_ABST
    Figure CN116844561B_ABST
Patent Text Reader

Abstract

The application discloses a user pitch bar display method and a computer readable storage medium. The method comprises the following steps: acquiring a current input audio segment in real time according to a preset time length, and acquiring a pitch value thereof as a current user pitch value; determining a target pitch bar corresponding to the current user pitch value in each standard pitch bar, and acquiring a pitch value, a time length and a drawing width and height of the target pitch bar; correcting the current user pitch value according to a vocal range corresponding to a song score; determining a drawing position and a drawing width and height of the current user pitch bar in a preset pitch bar area according to the corrected current user pitch value, an offset time and a time length corresponding to the current input audio segment, and a start and end time, a horizontal start and end position, a time length and a drawing width and height of the target pitch bar; and drawing the current user pitch bar in the pitch bar area according to the drawing position and the drawing width and height of the current user pitch bar. The application can display the user pitch bar more accurately and precisely.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of multimedia technology, and in particular to a user pitch bar display method and a computer readable storage medium. BACKGROUND

[0002] In song singing, generally, a standard pitch bar is used to display the pitch and rhythm of the user's singing process in order to achieve the purpose of error correction.

[0003] In the process of displaying, there are generally two schemes in the prior art:

[0004] One scheme is to fill the standard pitch bar at the corresponding position when the user sings correctly, and no filling is performed when the user sings incorrectly. In some fine tuning schemes, a cursor is used to indicate the current user pitch in real time, and the cursor slides in the pitch bar area over time. The advantage of this scheme is that the interface is clean (only the correct positions are filled in the singing process), and the significant disadvantage is the lack of rigorous error correction capability (because the positions where the user sings incorrectly are not marked as high or low, or how much).

[0005] Another scheme is to mark the user's singing pitch in real time with a color different from the standard pitch bar when the user sings. Because the basic principle of the pitch evaluation system is to calculate the user's pitch value once in a small time slice (such as 50 milliseconds), and then compare and display the standard pitch value; and the standard pitch bar is generally smooth in a period of time (such as within 2 seconds), therefore, when the user's pitch fluctuates in this period of time, a number of small pitch bars with scattered highs and lows are drawn, and the overall interface appears very messy. In some fine tuning schemes, the pitch bar is "combined and displayed" according to whether the current user pitch is close to the pitch at the nearby time. This fine tuning scheme can effectively solve the problem of messy interface, but it loses some rigor.

[0006] In addition, in the existing scheme, the pitch bar area generally only displays the pitch range of the song, and if the user sings in the low octave or high octave, the user's pitch bar will be displayed outside the pitch bar area, and at this time, the user cannot observe the pitch comparison result. SUMMARY

[0007] The technical problem to be solved by the present application is to provide a user pitch bar display method and a computer readable storage medium, which can more accurately and rigorously display the user pitch bar.

[0008] To solve the above technical problems, the technical scheme adopted by the present application is as follows: a user pitch bar display method, comprising:

[0009] According to the preset time length, the current input audio segment is acquired in real time, and a pitch value of the current input audio segment is acquired as a current user pitch value;

[0010] According to the offset time corresponding to the current input audio segment and the start and end times of each standard pitch bar corresponding to the song score, a target pitch bar corresponding to the current user pitch value is determined in each standard pitch bar, and a pitch value, a time length and a drawing height of the target pitch bar are acquired;

[0011] According to the pitch range corresponding to the song score, the current user pitch value is corrected;

[0012] According to the corrected current user pitch value, the offset time and the time length corresponding to the current input audio segment, and the start and end times, the horizontal start and end positions, the time length and the drawing height of the target pitch bar, the drawing position and the drawing height of the current user pitch bar in the preset pitch bar region are determined;

[0013] According to the drawing parameters of the current user pitch bar, the drawing parameters include the drawing position and the drawing height, and the current user pitch bar is drawn in the pitch bar region.

[0014] The application further provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize the method.

[0015] The application has the beneficial effect that the user pitch value is corrected according to the pitch range of the song, the user pitch higher or lower than the whole octave of the song is adaptively mapped into the pitch range of the song, the user pitch bar and the standard pitch bar are displayed in the same pitch range, the user can effectively observe the pitch comparison result when singing in the lowered octave or the higher octave, and the user pitch bar is displayed regardless of the correctness of singing, so that the integrity of the error correction information is ensured. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 The application provides a flowchart of a user pitch bar display method.

[0017] Figure 2 The application provides a flowchart of the method of the first embodiment.

[0018] Figure 3 The application provides a schematic diagram of the relationship between the pitch bar region and the pitch range of the first embodiment.

[0019] Figure 4 The application provides a color schematic diagram of the user pitch bar of the first embodiment.

[0020] Figure 5 The application provides a flowchart of step S4 of the second embodiment. DETAILED DESCRIPTION

[0021] To make the technical contents of the present application, the purposes achieved and the effects more comprehensible, the following will be described in detail in connection with the embodiments and with reference to the drawings.

[0022] Please refer to Figure 1 A display method of a user pitch bar, comprising:

[0023] According to the preset time length, the current input audio segment is acquired in real time, and the pitch value of the current input audio segment is acquired as the current user pitch value;

[0024] According to the offset time corresponding to the current input audio segment and the start and end times of each standard pitch bar corresponding to the song score, the target pitch bar corresponding to the current user pitch value is determined in each standard pitch bar, and the pitch value, time length and drawing width of the target pitch bar are acquired;

[0025] According to the pitch range corresponding to the song score, the current user pitch value is corrected;

[0026] According to the corrected current user pitch value, the offset time and time length corresponding to the current input audio segment, and the start and end times, horizontal start and end positions, time length and drawing width of the target pitch bar, the drawing position and drawing width of the current user pitch bar in the preset pitch bar area are determined;

[0027] According to the drawing parameters of the current user pitch bar, the drawing parameters include the drawing position and drawing width, and the current user pitch bar is drawn in the pitch bar area.

[0028] From the above description, it can be seen that the present application has the following beneficial effects: by correcting the user pitch value, the user pitch range can be correctly identified, and is shifted to the pitch range represented by the score pitch bar for contrast display, so that the user can still effectively observe the pitch comparison result when singing in the lowered or raised octave, and the integrity of the error correction information is ensured.

[0029] Further, the current user pitch value is corrected according to the pitch range corresponding to the song score, specifically:

[0030] According to the first correction formula, the corrected current user pitch value is calculated, the first correction formula is FixedUserPitch=UserPitch+12×round((NormalPitch-UserPitch) / 12), wherein UserPitch is the current user pitch value, FixedUserPitch is the corrected current user pitch value, NormalPitch is the pitch value of the target pitch bar, and round() represents the integer after rounding.

[0031] From the above description, by correcting the user pitch value by an integer multiple of an octave, the user can effectively observe the pitch comparison result when singing in a lowered or raised octave.

[0032] Further, the current user pitch value is corrected according to the vocal range corresponding to the song score, specifically:

[0033] An array of standard pitch values and an array of user pitch values are obtained, the array of user pitch values including pitch values of each input audio segment within a preset time period before the current time, and the array of standard pitch values including pitch values of target pitch bars corresponding to the input audio segments;

[0034] An octave shift array is calculated according to the array of standard pitch values and the array of user pitch values;

[0035] A corrected pitch value array is calculated according to the array of user pitch values and the octave shift array;

[0036] A deviation value array is calculated according to the array of standard pitch values and the corrected pitch value array;

[0037] An index of a deviation value less than a preset deviation threshold in the deviation value array is obtained, and a corrected octave shift array is obtained by retrieving the octave shift array according to the index;

[0038] The value appearing most frequently in the corrected octave shift array is counted as a final octave shift value;

[0039] The current user pitch value is corrected according to the final octave shift value.

[0040] From the above description, by analyzing the array of standard pitch values and the array of user pitch values in the previous period of time, the octave shift value of the user pitch value relative to the standard pitch value can be more accurately evaluated, and the pitch comparison result can be more accurately displayed.

[0041] Further, the octave shift array is calculated according to the array of standard pitch values and the array of user pitch values, the corrected pitch value array is calculated according to the array of user pitch values and the octave shift array, and the deviation value array is calculated according to the array of standard pitch values and the corrected pitch value array, specifically:

[0042] The octave shift array is calculated according to the octave shift array calculation formula OctaveShiftArray = round((NormalPitchArray-UserPitchArray) / 12);

[0043] According to a correction pitch value array calculation formula, a correction pitch value array is calculated, the correction pitch value array calculation formula being FixedUserPitchArray=UserPitchArray+12xOctaveShiftArray;

[0044] According to a deviation value array calculation formula, a deviation value array is calculated, the deviation value array calculation formula being DiffArray=abs(FixedUserPitchArray-NormalPitchArray);

[0045] Wherein, OctaveShiftArray represents an octave shift array, round() represents an integer after rounding, NormalPitchArray represents a standard pitch value array, UserPitchArray represents a user pitch value array, FixedUserPitchArray represents a correction pitch value array, DiffArray represents a deviation value array, and abs() represents an absolute value.

[0046] Further, the current user pitch value is corrected according to the final octave shift value, specifically as follows:

[0047] According to a second correction formula, the current user pitch value is corrected, the second correction formula being FixedUserPitch=UserPitch+12xOctaveShift, wherein UserPitch is the current user pitch value, FixedUserPitch is the corrected current user pitch value, and OctaveShift is the final octave shift value.

[0048] Further, the drawing parameter further includes a drawing color.

[0049] After the current user pitch value is corrected according to the vocal range corresponding to the song score, the method further includes:

[0050] According to the corrected current user pitch value and the pitch value of the target pitch bar, a drawing color of the current user pitch bar is determined.

[0051] Further, according to the corrected current user pitch value and the pitch value of the target pitch bar, the drawing color of the current user pitch bar is determined, specifically as follows:

[0052] If the corrected current user pitch value is equal to the pitch value of the target pitch bar, the drawing color of the current user pitch bar is set to a first color.

[0053] if an absolute value of a difference between the modified current user pitch value and the pitch value of the target pitch bar is less than or equal to a preset pitch difference threshold, setting a drawing color of the current user pitch bar as a second color;

[0054] if the absolute value of the difference between the modified current user pitch value and the pitch value of the target pitch bar is greater than the preset pitch difference threshold, setting the drawing color of the current user pitch bar as a third color;

[0055] The first color and the second color are analogous colors.

[0056] It can be known from the above description that the user pitch bar is drawn in the correct color with a lighter shade when the user pitch value deviates slightly from the pitch value of the target pitch bar, so that the degree of disorder of the interface is reduced while the pitch difference information is retained.

[0057] Further, the target pitch bar corresponding to the current user pitch value is determined from the offset time corresponding to the current input audio segment and the start and end times of each standard pitch bar corresponding to the song score, and includes:

[0058] If the offset time corresponding to the current input audio segment is between the start and end times of a standard pitch bar, the standard pitch bar is taken as the target pitch bar corresponding to the current user pitch value.

[0059] It can be known from the above description that the corresponding target pitch bar is accurately determined according to the time relationship.

[0060] Further, the real-time acquisition of the current input audio segment before the preset time length further includes:

[0061] The song score is acquired, and the standard pitch bar corresponding to the song score is displayed in the preset pitch bar region.

[0062] Further, a two-dimensional coordinate system is constructed with the lower left corner of the pitch bar region as the origin, the right direction as the positive direction of the X axis, and the upward direction as the positive direction of the Y axis.

[0063] The height of the pitch bar region is H, H=a×(MaxPitch-MinPitch), where MaxPitch and MinPitch are the maximum pitch value and the minimum pitch value in the song score respectively, and a is a preset mapping coefficient.

[0064] The longitudinal positions of the standard pitch bars in the pitch bar region are determined by a first longitudinal position calculation formula, and the first longitudinal position calculation formula is Normy i =a×(NormPitch i -MinPitch), where Normyi a longitudinal position of a standard pitch bar in the pitch bar region, NormPitch i a pitch value of the standard pitch bar.

[0065] Further, the drawing position and the drawing width of the current user pitch bar in the preset pitch bar region are determined according to the corrected current user pitch value, the offset time and the duration of the current input audio segment, and the start time, the horizontal start and end positions, the duration and the drawing width and height of the target pitch bar, specifically:

[0066] a longitudinal position of the current user pitch bar in the pitch bar region is calculated according to a second longitudinal position calculation formula, the second longitudinal position calculation formula is Usery=a×(FixedUserPitch-MinPitch), wherein Usery is the longitudinal position of the current user pitch bar in the pitch bar region, FixedUserPitch is the corrected current user pitch value, MinPitch is the minimum pitch value in the song score, and a is a preset mapping coefficient;

[0067] a horizontal position of the current user pitch bar in the pitch bar region is calculated according to a horizontal position calculation formula, the horizontal calculation formula is Userx=(UserTime-NormalStartTime) / NormalDuration×NormalW+XNormalStart, wherein Userx is the horizontal position of the current user pitch bar in the pitch bar region, UserTime is the offset time corresponding to the current input audio, NormalDuration is the duration of the target pitch bar, NormalDuration=NormalEndTime-NormalStartTime, NormalStartTime and NormalEndTime are the start time and the end time of the target pitch bar respectively, NormalW is the drawing width of the target pitch bar, NormalW=XNormalEnd-XNormalStart, and XNormalStart and XNormalEnd are the horizontal start position and the horizontal end position of the target pitch bar respectively;

[0068] the drawing width of the current user pitch bar is calculated according to a drawing width calculation formula, the drawing width calculation formula is w=UserDuration / NormalDuration×NormalW, wherein w is the drawing width of the current user pitch bar, and UserDuration is the duration of the current input audio;

[0069] According to the drawing height of the target pitch bar, the drawing height of the current user pitch bar is determined.

[0070] From the above description, it can be known that the vertical position of the pitch bar is determined according to the pitch value, so that the pitch relationship between different pitch bars can be intuitively embodied; and the horizontal start-stop position and width of the user pitch bar are determined according to the time proportion relationship of the current input audio in the target pitch bar, so that the horizontal alignment of the user pitch bar to the target pitch bar can be ensured.

[0071] The application further provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the method.

[0072] Embodiment one

[0073] Please refer to Figures 2-4 Embodiment one of the application is a display method of a user pitch bar, which can be applied to a multimedia terminal in an audio-visual place, such as a karaoke machine. Figure 2 As shown in the figure, the method comprises the following steps:

[0074] S1: obtaining a song score and displaying a standard pitch bar corresponding to the song score in a preset pitch bar area.

[0075] Specifically, a two-dimensional coordinate system is constructed with the lower left corner of the pitch bar area as the origin, the right direction as the positive direction of the X axis, and the upward direction as the positive direction of the Y axis.

[0076] The pitch bar area is a rectangular area with the upper left corner coordinate (0, H) and the lower right corner coordinate (W, 0), wherein H=a*(MaxPitch-MinPitch), MaxPitch and MinPitch are the maximum pitch value and the minimum pitch value in the song score respectively, and a is a preset mapping coefficient, and in the embodiment, a=5.

[0077] The vertical position of each standard pitch bar in the pitch bar area is determined by a first vertical position calculation formula, and the first vertical position calculation formula is:

[0078] Normy i =a*(NormPitch i -MinPitch);

[0079] Wherein, Normy i is the vertical position of a standard pitch bar in the pitch bar area, and NormPitch i is the pitch value of the standard pitch bar.

[0080] S2: obtaining a current input audio segment in real time according to a preset time length, and obtaining a pitch value of the current input audio segment as a current user pitch value.

[0081] In this embodiment, the preset time length is 50 ms, that is, a 50 ms input audio segment is acquired in real time as a current input audio segment, and a pitch value thereof is acquired as a current user pitch value in MIDI.

[0082] S3: determining a target pitch bar corresponding to the current user pitch value from the standard pitch bars according to the offset time corresponding to the current input audio segment and the start and end times of the standard pitch bars corresponding to the song score, and acquiring a pitch value, a time length and a drawing height of the target pitch bar.

[0083] Specifically, if the offset time corresponding to the current input audio segment is between the start and end times of a standard pitch bar, the standard pitch bar is taken as the target pitch bar corresponding to the current user pitch value,

[0084] wherein the offset time corresponding to the current input audio segment refers to the offset time relative to the start time of the song, that is, the start time of a standard pitch bar ≤ the offset time ≤ the end time of the standard pitch bar, the standard pitch bar is taken as the target pitch bar, and a pitch value NormalPitch, a time length NormalDuration, a drawing width NormalW and a drawing height NormalH thereof are acquired.

[0085] Further, if the offset time is between the interval times of two adjacent standard pitch bars, that is, if the offset time corresponding to the current input audio segment is between the end time of a first standard pitch bar and the start time of a second standard pitch bar, the first standard pitch bar or the second standard pitch bar is taken as the target pitch bar corresponding to the current user pitch value. Or the pitch bar corresponding to the current input audio segment is not displayed, that is, the current user pitch bar is not displayed.

[0086] S4: correcting the current user pitch value according to the pitch range corresponding to the song score.

[0087] Specifically, the corrected current user pitch value is calculated according to a first correction formula, the first correction formula is FixedUserPitch = UserPitch + 12 × round((NormalPitch - UserPitch) / 12), wherein UserPitch is the current user pitch value, FixedUserPitch is the corrected current user pitch value, NormalPitch is the pitch value of the target pitch bar, and round() represents an integer after rounding.

[0088] As shown in step S1, the height of the pitch bar area is calculated based on the maximum and minimum pitch values ​​in the song's score. Therefore, the height of the pitch bar area does not cover the entire pitch range, but only the range corresponding to the song's score. The user's singing pitch may be within the song's range, or it may be an octave higher or lower than the song's standard pitch. If the vertical position of the user's pitch bar is calculated based on the user's pitch value, it will be displayed outside the pitch bar area. For example, as... Figure 3 As shown, the dashed box represents the application interface area, with the pitch bar area located at the bottom of the interface. Assuming the song's score has a pitch range of 60-67, and the user sings an octave lower (67 is 55), the user's pitch bar would appear outside the interface area if the pitch value were mapped vertically. However, singing an octave higher or lower is still considered correct and should be displayed within the pitch bar area. Therefore, by correcting the user's pitch value by multiples of an integer octave, the pitch comparison result can still be effectively observed when the user sings an octave lower or higher.

[0089] S5: Based on the corrected current user pitch value, the offset time and duration corresponding to the current input audio segment, and the start and end times, horizontal start and end positions, duration, and drawing width and height of the target pitch bar, determine the drawing position and drawing width and height of the current user pitch bar within the pitch bar area.

[0090] Specifically, according to the second vertical position calculation formula Usery=a×(FixedUserPitch-MinPitch), the vertical position Usery of the current user's pitch bar within the pitch bar area is calculated, where FixedUserPitch is the corrected current user pitch value, MinPitch is the minimum pitch value in the song score, and a is a preset mapping coefficient.

[0091] A horizontal position Userx of the current user pitch bar in the pitch bar region is calculated according to a horizontal position calculation formula Userx = (UserTime - NormalStartTime) / NormalDuration * NormalW + XNormalStart, NormalDuration = NormalEndTime - NormalStartTime, NormalW = XNormalEnd - XNormalStart, wherein UserTime is the offset time corresponding to the current input audio, NormalDuration is the duration of the target pitch bar, NormalStartTime and NormalEndTime are the start time and the end time of the target pitch bar respectively, NormalW is the drawing width of the target pitch bar, and XNormalStart and XNormalEnd are the horizontal start position and the horizontal end position of the target pitch bar respectively.

[0092] A drawing width w of the current user pitch bar is calculated according to a drawing width calculation formula w = UserDuration / NormalDuration * NormalW, wherein UserDuration is the duration of the current input audio, i.e. the preset duration in step S2, which is 50 ms in this embodiment.

[0093] A drawing height of the current user pitch bar is determined according to the drawing height of the target pitch bar, i.e. the drawing height h of the current user pitch bar = the drawing height NormalH of the target pitch bar.

[0094] S6: A drawing color of the current user pitch bar is determined according to the corrected current user pitch value and the pitch value of the target pitch bar.

[0095] Specifically, if the corrected current user pitch value is equal to the pitch value of the target pitch bar, i.e. FixedUserPitch = NormalPitch, the drawing color of the current user pitch bar is set as a first color.

[0096] If the absolute value of the difference between the corrected current user pitch value and the pitch value of the target pitch bar is less than or equal to a preset pitch difference threshold, i.e. abs(FixedUserPitch - NormalPitch) ≤ a, the drawing color of the current user pitch bar is set as a second color. Wherein abs() represents taking an absolute value. In this embodiment, the pitch difference threshold a = 2.

[0097] If the absolute value of the difference between the fixed user pitch value and the pitch value of the target pitch bar is greater than a preset pitch difference threshold, i.e., abs(FixedUserPitch-NormalPitch) > a, the drawing color of the current user pitch bar is set to a third color.

[0098] The first color and the second color are analogous colors, and the first color and the third color are contrasting colors, as shown in FIG. 2. Figure 4 In this embodiment, the first color is green, the second color is light green, and the third color is red.

[0099] S7: Drawing the current user pitch bar in the pitch bar region according to the drawing position, the drawing width and height, and the drawing color of the current user pitch bar.

[0100] Specifically, the vertical position of the current user pitch bar in the pitch bar region, i.e., Usery, is taken as the horizontal center line position of the rectangle, the horizontal position of the current user pitch bar in the pitch bar region, i.e., Userx, is taken as the left boundary position of the rectangle, a rectangle with a width of w and a height of h is drawn, and the corresponding drawing color is filled, i.e., the current user pitch bar is represented.

[0101] In this embodiment, the user pitch value is corrected according to the pitch range of the song, the user pitch higher or lower than the whole octave of the song can be adaptively mapped into the pitch range of the song, the user pitch bar and the standard pitch bar are displayed in the same pitch range for comparison, so that the user can effectively observe the pitch comparison result when singing in a lower octave or a higher octave; at the same time, the user pitch bar is displayed regardless of the correctness of the singing, ensuring the integrity of the error correction information; and when the user pitch value is not greatly deviated from the pitch value of the target pitch bar, the user pitch bar is drawn in a lighter correct color, which can reduce the degree of interface clutter while retaining the pitch difference information.

[0102] Embodiment Two

[0103] Please refer to Figure 5 This embodiment is another implementation of step S4 in Embodiment One, as shown in FIG. 4, including the following steps: Figure 5

[0104] S401: Obtaining a standard pitch value array and a user pitch value array, wherein the user pitch value array includes the pitch values of each input audio segment in a preset time period before the current time, and the standard pitch value array includes the pitch values of the target pitch bars corresponding to the input audio segments.

[0105] ​In this embodiment, the preset time period is 5 seconds, that is, the pitch values of all input audio segments in the previous 5 seconds of the current input audio segment are obtained, and the length of each input audio segment is 50 ms, so in general, the pitch values of 100 input audio segments before the current input audio segment are obtained, and the pitch values of the target pitch bar corresponding to the 100 input audio segments are obtained as the standard pitch value array.

[0106] S402: According to the standard pitch value array and the user pitch value array, an octave shift array is calculated.

[0107] Specifically, the octave shift array is calculated according to the octave shift array calculation formula, and the octave shift array calculation formula is OctaveShiftArray = round((NormalPitchArray-UserPitchArray) / 12); wherein OctaveShiftArray represents the octave shift array, round() represents the integer after rounding, NormalPitchArray represents the standard pitch value array, and UserPitchArray represents the user pitch value array.

[0108] S403: According to the user pitch value array and the octave shift array, a corrected pitch value array is calculated.

[0109] Specifically, the corrected pitch value array FixedUserPitchArray is calculated according to the corrected pitch value array calculation formula, and the corrected pitch value array calculation formula is FixedUserPitchArray = UserPitchArray + 12 x OctaveShiftArray.

[0110] S404: According to the standard pitch value array and the corrected pitch value array, a deviation value array is calculated.

[0111] Specifically, the deviation value array DiffArray is calculated according to the deviation value array calculation formula, and the deviation value array calculation formula is DiffArray = abs(FixedUserPitchArray-NormalPitchArray); wherein abs() represents the absolute value.

[0112] S405: The index of the deviation value less than the preset deviation threshold in the deviation value array is obtained, and the corrected octave shift array is obtained by searching the octave shift array according to the index.

[0113] In this embodiment, the preset deviation threshold is 2.

[0114] S406: Count the value with the highest frequency in the modified octave shift array as the final octave shift value.

[0115] For example, assuming that the standard pitch value array NormalPitchArray = [60, 60, 60, 67, 67, 67], the user pitch value array UserPitchArray = [48, 47, 49, 60, 62, 60], the octave shift array OctaveShiftArray = [1, 1, 1, 1, 0, 1], the modified pitch value array FixedUserPitchArray = [60, 59, 61, 72, 62, 72], and the deviation value array DiffArray = [0, 1, 1, 5, 5, 5], the first to third values in the deviation value array DiffArray are all less than 2, the indexes satisfying the condition are 0, 1, and 2, the first to third values in the octave shift array are [1, 1, 1], and the modified octave shift array OctaveShiftArray = [1, 1, 1]. The value with the highest frequency in the modified octave shift array OctaveShiftArray is 1, and the final octave shift value OctaveShift = 1.

[0116]

[0117] S407: Modify the current user pitch value according to the final octave shift value.

[0118] Specifically, the current user pitch value is modified according to a second modification formula, the second modification formula being FixedUserPitch = UserPitch + 12 x OctaveShift, where UserPitch is the current user pitch value, FixedUserPitch is the modified current user pitch value, and OctaveShift is the final octave shift value.

[0119] If the user pitch value is equal to the integer multiple of 12 of the pitch value of the target pitch bar, there is no ambiguity, otherwise, there is ambiguity. For example, if the user pitch value is 6 higher than the pitch value of the target pitch bar, it can be understood that the user pitch value is 6 higher than the standard pitch value in the same octave, and the user pitch bar is drawn above the target pitch bar. It can also be understood that the user pitch value is one octave higher than the standard pitch value, and 6 lower than the standard pitch value.

[0120] The embodiment can more accurately evaluate the octave shift value of the user pitch value relative to the standard pitch value by analyzing the standard pitch value array and the user pitch value array in the previous period of time, thereby more accurately displaying the pitch comparison result. ​

[0121] Embodiment three

[0122] The embodiment is a computer readable storage medium corresponding to the above-mentioned embodiment, and a computer program is stored on the computer readable storage medium.

[0123] In summary, the present application provides a user pitch bar display method and a computer readable storage medium. By correcting the user pitch value according to the pitch range of the song, the user pitch higher or lower than the whole octave of the song can be adaptively mapped into the song pitch range. The user pitch bar and the standard pitch bar are displayed in the same pitch range, so that the user can effectively observe the pitch comparison result when singing in the lowered or raised octave. By determining the vertical position of the pitch bar according to the pitch value, the pitch relationship between different pitch bars can be intuitively reflected. By determining the horizontal start and end position and the width of the user pitch bar according to the time proportion relationship of the current input audio in the target pitch bar, the horizontal alignment of the user pitch bar to the target pitch bar can be ensured. At the same time, the user pitch bar is displayed regardless of the correctness of the singing, ensuring the integrity of the error correction information. By using a lighter correct color to draw the user pitch bar when the deviation between the user pitch value and the pitch value of the target pitch bar is small, the degree of interface clutter can be reduced while retaining the pitch difference information. The present application can more accurately display the user pitch bar.

[0124] The above-mentioned embodiments are not limited to the patent scope of the present application, and any equivalent transformation or direct or indirect application in the related technical field based on the content of the specification and drawings is also included in the patent protection scope of the present application.

Claims

1. A display method of a user pitch bar, characterized by, The method comprises the following steps: According to the preset time length, the current input audio segment is obtained in real time, and the pitch value of the current input audio segment is obtained as the current user pitch value; According to the offset time corresponding to the current input audio segment and the start and end times of each standard pitch bar corresponding to the song score, a target pitch bar corresponding to the current user pitch value is determined in each standard pitch bar, and the pitch value, time length and drawing width-height of the target pitch bar are obtained; According to the pitch range corresponding to the song score, the current user pitch value is corrected by an integral multiple of an octave; According to the corrected current user pitch value, the offset time and time length corresponding to the current input audio segment, and the start and end times, horizontal start and end positions, time length and drawing width-height of the target pitch bar, the drawing position and drawing width-height of the current user pitch bar in the preset pitch bar area are determined; According to the drawing parameters of the current user pitch bar, the drawing parameters include the drawing position and drawing width-height, and the current user pitch bar is drawn in the pitch bar area.

2. The display method of a user pitch ladder according to claim 1, wherein According to the pitch range corresponding to the song score, the current user pitch value is corrected, and the specific method is as follows: According to a first correction formula, the corrected current user pitch value is calculated, the first correction formula is FixedUserPitch=UserPitch+12×round((NormalPitch-UserPitch) / 12), wherein UserPitch is the current user pitch value, FixedUserPitch is the corrected current user pitch value, NormalPitch is the pitch value of the target pitch bar, and round() represents the integer after rounding.

3. The display method of a user pitch bar according to claim 1, wherein According to the pitch range corresponding to the song score, the current user pitch value is corrected, and the specific method is as follows: An array of standard pitch values and an array of user pitch values are obtained, the array of user pitch values includes the pitch values of each input audio segment in a preset time period before the current time, and the array of standard pitch values includes the pitch values of the target pitch bars corresponding to the input audio segments; According to the array of standard pitch values and the array of user pitch values, an octave displacement array is calculated; According to the array of user pitch values and the octave displacement array, a corrected pitch value array is calculated; According to the array of standard pitch values and the corrected pitch value array, a deviation value array is calculated; The index of the deviation value less than the preset deviation threshold in the deviation value array is obtained, and the corrected octave displacement array is obtained by searching the octave displacement array according to the index; The value with the highest frequency of occurrence in the corrected octave displacement array is counted as the final octave displacement value; According to the final octave displacement value, the current user pitch value is corrected.

4. The display method of a user pitch bar according to claim 3, wherein According to the array of standard pitch values and the array of user pitch values, an octave displacement array is calculated; according to the array of user pitch values and the octave displacement array, a corrected pitch value array is calculated; according to the array of standard pitch values and the corrected pitch value array, a deviation value array is calculated, and the specific method is as follows: According to an octave shift array calculation formula, an octave shift array is calculated, the octave shift array calculation formula being OctaveShiftArray=round((NormalPitchArray-UserPitchArray) / 12); According to a fixed user pitch value array calculation formula, a fixed user pitch value array is calculated, the fixed user pitch value array calculation formula being FixedUserPitchArray=UserPitchArray+12×OctaveShiftArray; According to a deviation value array calculation formula, a deviation value array is calculated, the deviation value array calculation formula being DiffArray=abs(FixedUserPitchArray-NormalPitchArray); Wherein, OctaveShiftArray represents an octave shift array, round() represents an integer after rounding, NormalPitchArray represents a standard pitch value array, UserPitchArray represents a user pitch value array, FixedUserPitchArray represents a fixed user pitch value array, DiffArray represents a deviation value array, and abs() represents an absolute value.

5. The display method of a user pitch bar according to claim 3, wherein The current user pitch value is corrected according to the final octave shift value, specifically as follows: The current user pitch value is corrected according to a second correction formula, the second correction formula being FixedUserPitch=UserPitch+12×OctaveShift, wherein UserPitch is the current user pitch value, FixedUserPitch is the corrected current user pitch value, and OctaveShift is the final octave shift value.

6. The display method of a user pitch ladder according to claim 1, wherein The drawing parameter further includes a drawing color. After the current user pitch value is corrected according to the vocal range corresponding to the song score, the method further includes: According to the corrected current user pitch value and the pitch value of the target pitch bar, the drawing color of the current user pitch bar is determined.

7. The display method of a user pitch bar according to claim 6, wherein According to the corrected current user pitch value and the pitch value of the target pitch bar, the drawing color of the current user pitch bar is determined, specifically as follows: If the corrected current user pitch value is equal to the pitch value of the target pitch bar, the drawing color of the current user pitch bar is set as a first color; If the absolute value of the difference between the corrected current user pitch value and the pitch value of the target pitch bar is less than or equal to a preset pitch difference threshold value, the drawing color of the current user pitch bar is set as a second color; If the absolute value of the difference between the corrected current user pitch value and the pitch value of the target pitch bar is greater than the preset pitch difference threshold value, the drawing color of the current user pitch bar is set as a third color; Wherein, the first color and the second color are analogous colors.

8. The display method of a user pitch ladder according to claim 1, wherein The method comprises the following steps: If the offset time corresponding to the current input audio segment is between the start time and the end time of a standard pitch bar, the standard pitch bar is taken as the target pitch bar corresponding to the current user pitch value.

9. The display method of a user pitch bar according to claim 1, wherein The method further comprises the following steps: The song score is obtained, and the standard pitch bar corresponding to the song score is displayed in a preset pitch bar area; A two-dimensional coordinate system is constructed with the lower left corner of the pitch bar area as the origin, the right direction as the positive direction of the X axis, and the upward direction as the positive direction of the Y axis; The height of the pitch bar area is H, H=a×(MaxPitch-MinPitch), wherein MaxPitch and MinPitch are the maximum pitch value and the minimum pitch value in the song score respectively, and a is a preset mapping coefficient; The longitudinal positions of the respective standard pitch bar within the pitch bar area are determined by a first longitudinal position calculation formula, which is Normy i = a x (NormPitch i - MinPitch), wherein Normy i is the longitudinal position of a standard pitch bar within the pitch bar area, and NormPitch i is the pitch value of the standard pitch bar.

10. The display method of a user pitch bar according to claim 9, wherein The method further comprises the following steps: The vertical position of the current user pitch bar in the pitch bar area is calculated according to a second vertical position calculation formula, the second vertical position calculation formula being Usery=a×(FixedUserPitch-MinPitch), wherein Usery is the vertical position of the current user pitch bar in the pitch bar area, FixedUserPitch is the corrected current user pitch value, MinPitch is the minimum pitch value in the song score, and a is a preset mapping coefficient; The horizontal position of the current user pitch bar in the pitch bar area is calculated according to a horizontal position calculation formula, the horizontal position calculation formula being Userx=(UserTime-NormalStartTime) / NormalDuration×NormalW+XNormalStart, wherein Userx is the horizontal position of the current user pitch bar in the pitch bar area, UserTime is the offset time corresponding to the current input audio, NormalDuration is the duration of the target pitch bar, NormalDuration=NormalEndTime-NormalStartTime, NormalStartTime and NormalEndTime are the start time and the end time of the target pitch bar respectively, NormalW is the drawing width of the target pitch bar, NormalW=XNormalEnd-XNormalStart, and XNormalStart and XNormalEnd are the horizontal start position and the horizontal end position of the target pitch bar respectively. According to a drawing width calculation formula, a drawing width of the current user pitch bar is calculated, the drawing width calculation formula being w=UserDuration / NormalDurationxNormalW, wherein w is the drawing width of the current user pitch bar, UserDuration is a time length of the current input audio; According to the drawing height of the target pitch bar, a drawing height of the current user pitch bar is determined.

11. A computer readable storage medium having stored thereon a computer program, characterized in that The program is executed by the processor to implement the method of any one of claims 1-10.

Citation Information

Patent Citations

  • Translation system comprising display apparatus and server and control method thereof

    CN104239394A

  • Method and apparatus for determining pitch deviation of audio content

    CN108206026A