CN112237740A - Beat data extraction method and device, electronic equipment and computer readable medium - Google Patents

Beat data extraction method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN112237740A
CN112237740A CN202011157762.4A CN202011157762A CN112237740A CN 112237740 A CN112237740 A CN 112237740A CN 202011157762 A CN202011157762 A CN 202011157762A CN 112237740 A CN112237740 A CN 112237740A
Authority
CN
China
Prior art keywords
beat
data
basic
beat data
audio file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011157762.4A
Other languages
Chinese (zh)
Other versions
CN112237740B (en
Inventor
张辰
傅思齐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202011157762.4A priority Critical patent/CN112237740B/en
Publication of CN112237740A publication Critical patent/CN112237740A/en
Application granted granted Critical
Publication of CN112237740B publication Critical patent/CN112237740B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/54Controlling the output signals based on the game progress involving acoustic signals, e.g. for simulating revolutions per minute [RPM] dependent engine sounds in a driving game or reverberation against a virtual wall
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/68Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/683Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/6063Methods for processing data by generating or executing the game program for sound processing
    • A63F2300/6072Methods for processing data by generating or executing the game program for sound processing of an input signal, e.g. pitch and rhythm extraction, voice recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Theoretical Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Auxiliary Devices For Music (AREA)

Abstract

The disclosure relates to a method and a device for extracting beat data, electronic equipment and a computer readable medium, and belongs to the technical field of computers. The method comprises the following steps: acquiring an audio file, and sampling beat points in the audio file to obtain basic beat data of the audio file; acquiring music channels corresponding to the audio files, and distributing the basic beat data to each music channel; and obtaining audio beat data corresponding to the audio file according to the basic beat data distributed in each music channel. According to the method and the device, the basic beat data of the audio file are distributed to each music channel through a certain distribution method, so that the multi-channel audio beat data are generated quickly, and the efficiency of extracting the beat data can be improved greatly.

Description

Beat data extraction method and device, electronic equipment and computer readable medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for extracting beat data, an electronic device, and a computer readable medium.
Background
A Music Game (Music Game) is one of electronic Game types, and a system converts the rhythm of Music into visual beat points, and players play the Game by performing matching operations according to the visual beat points on an interface.
The core of music game development is that the music tempo is extracted and converted into visualized beat points. However, the existing audio sampling process simply records the beat points in the music, and distributes the beat points to each music channel through manpower, which is time-consuming and labor-consuming, and the efficiency of extracting the beat points is low.
In view of this, there is a need in the art for a method capable of improving the extraction efficiency of the beat points.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure is directed to a method for extracting beat data, an apparatus for extracting beat data, an electronic device, and a computer readable medium, so as to improve the efficiency of extracting beat points at least to a certain extent.
According to a first aspect of the present disclosure, there is provided a method of extracting beat data, including:
acquiring an audio file, and sampling beat points in the audio file to obtain basic beat data of the audio file;
acquiring music channels corresponding to the audio files, and distributing the basic beat data to each music channel;
and obtaining audio beat data corresponding to the audio file according to the basic beat data distributed in each music channel.
In an exemplary embodiment of the present disclosure, the sampling the beat points in the audio file to obtain the basic beat data of the audio file includes:
acquiring a sampling function and the array length of a sampling array in the sampling function;
determining the sampling density of each frame of audio in the audio file according to the array length of the sampling array;
and sampling the beat point of each frame of audio in the audio file according to the sampling density through the sampling function to obtain basic beat data of the audio file.
In an exemplary embodiment of the present disclosure, the sampling a beat point of each frame of audio in the audio file according to the sampling density by the sampling function to obtain basic beat data of the audio file includes:
determining a target beat point in each frame of audio;
sampling a target beat point in each frame of audio according to the sampling density through the sampling function to obtain basic beat data of the target beat point;
obtaining basic beat data of all beat points in each frame of audio according to the basic beat data of the target beat point;
and obtaining the basic beat data of the audio file according to the basic beat data of all beat points in each frame of audio.
In an exemplary embodiment of the present disclosure, the method further comprises:
acquiring a data conversion window function in the sampling function;
converting the basic beat data of the audio file into a corresponding display height value through the data conversion window function;
acquiring basic beat data of a current display frame, and displaying the basic beat data on an interface according to a display height value corresponding to the basic beat data of the current display frame.
In an exemplary embodiment of the present disclosure, the displaying the basic beat data on an interface according to a display height value corresponding to the basic beat data of the current display frame includes:
acquiring a standard height value of the basic beat data when the basic beat data is displayed on an interface;
determining a scaling ratio according to the display height value corresponding to the basic beat data and the standard height value;
and adjusting the display height value corresponding to the basic beat data according to the scaling, and displaying the basic beat data on an interface according to the adjusted display height value.
In an exemplary embodiment of the present disclosure, the allocating the basic tempo data into the respective music channels includes:
acquiring the type of the audio file, and determining a target distribution rule from a plurality of preset distribution rules according to the type of the audio file;
determining the distribution sequence of each music channel according to the target distribution rule;
and sequentially distributing the basic beat data to the music channels in an idle state according to the distribution sequence of the music channels.
In an exemplary embodiment of the present disclosure, the sequentially allocating the basic beat data to the music channels in an idle state according to the allocation order of the music channels includes:
acquiring the occurrence time of each beat point in the basic beat data and the duration time of the beat point;
judging whether the music channel is in an idle state or not when the current beat point is distributed according to the occurrence time and the duration time of the last beat point distributed in the music channel;
if the music channel is in an idle state, distributing the current beat point to the music channel;
and if the music channel is in a blocking state, skipping the current beat point and continuing to distribute the next beat point.
According to a second aspect of the present disclosure, there is provided an extraction apparatus of beat data, including:
the basic beat acquisition module is used for acquiring an audio file and sampling beat points in the audio file to obtain basic beat data of the audio file;
the music channel distribution module is used for acquiring music channels corresponding to the audio files and distributing the basic beat data to the music channels;
and the audio beat determining module is used for obtaining audio beat data corresponding to the audio file according to the basic beat data distributed in each music channel.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above methods of extracting beat data via execution of the executable instructions.
According to a fourth aspect of the present disclosure, there is provided a computer-readable medium having stored thereon a computer program which, when executed by a processor, implements the method of extracting beat data of any one of the above.
The exemplary embodiments of the present disclosure may have the following advantageous effects:
in the method for extracting beat data according to the exemplary embodiment of the present disclosure, basic beat data is obtained by sampling beat points in an audio file that meet basic sampling requirements, and then the basic beat data of the audio file is automatically distributed to each music channel by a certain distribution method, so as to obtain final multi-channel audio beat data. Through the extraction method of the beat data in the disclosed example embodiment, on one hand, no manpower is consumed in the distribution process of the basic beat data, and the efficiency of extracting the beat data can be greatly improved while the manpower cost is saved; on the other hand, basic beat data is distributed to each music channel by configuring different distribution functions, so that extraction of various different types of music beat points can be adapted.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
Fig. 1 shows a flowchart illustrating an extraction method of beat data according to an exemplary embodiment of the present disclosure;
fig. 2 shows a schematic flow diagram of sampling underlying beat data of an audio file according to an example embodiment of the present disclosure;
fig. 3 shows a schematic flow chart of obtaining basic beat data by a sampling function according to an example embodiment of the present disclosure;
FIG. 4 shows a flow diagram of assigning music channels according to an example embodiment of the present disclosure;
FIG. 5 shows a flow diagram of assigning music channels according to an assignment sequence in an example embodiment of the present disclosure;
FIG. 6 shows a flow diagram of a beat point visualization of an example embodiment of the present disclosure;
fig. 7 shows a flowchart of a beat point visualization according to a corresponding display height according to an example embodiment of the present disclosure;
fig. 8 schematically shows a schematic diagram of visualizing beat points, according to a specific embodiment of the present disclosure;
fig. 9 is a flowchart illustrating an extraction method of beat data according to an embodiment of the present disclosure;
fig. 10 shows a block diagram of an extraction apparatus of beat data of an example embodiment of the present disclosure;
FIG. 11 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The present exemplary embodiment first provides a method of extracting beat data. Referring to fig. 1, the method for extracting beat data may include the following steps:
step S110, an audio file is obtained, and beat points in the audio file are sampled to obtain basic beat data of the audio file.
And S120, acquiring music channels corresponding to the audio files, and distributing the basic beat data to each music channel.
And S130, obtaining audio beat data corresponding to the audio file according to the basic beat data distributed in each music channel.
The method for extracting beat data provided in the present exemplary embodiment can be used for beat point extraction of a music game. A Music Game (MUG, sound G, sound play, etc.) is one type of electronic Game, and a player plays a Game by performing an action in accordance with a screen instruction in accordance with Music and rhythm.
A music game generally comprises a large number of music tracks, the system can convert the rhythm of the music into visual beat points, a player can increase scores by performing matched operations according to the visual beat points provided in the game, and scores can be deducted or not calculated under the opposite condition. Even if some games have similar blood volume limit, if there are too many mistakes or the blood volume does not reach a certain requirement at the end, the Game Over (Game Over) will be forced to end. In addition, some games require a certain minimum score, and if not achieved, the game is ended. The final objectives of the game are to pursue Full Combo (commonly called Full-blown, i.e. no mistake), All Perfect (commonly called song-picking, i.e. best judgment of All notes played), etc.
With the development of games, music games are expanding, from the early stage of key-press operation to the playing of corresponding musical instruments to the integration of elements of various other games. However, no matter how innovative, the core experience of a music game is not separated from two major elements: melody and beat. That is, the focus of music game development is to extract and convert the music tempo into visualized beat points, the more accurate the beat points are, the better the game experience of the player is. Therefore, there is a lot of work in the development of music games in the extraction of music tempo points.
In the method for extracting beat data according to the exemplary embodiment of the present disclosure, basic beat data is obtained by sampling beat points in an audio file that meet basic sampling requirements, and then the basic beat data of the audio file is automatically distributed to each music channel by a certain distribution method, so as to obtain final multi-channel audio beat data. Through the extraction method of the beat data in the disclosed example embodiment, on one hand, no manpower is consumed in the distribution process of the basic beat data, and the efficiency of extracting the beat data can be greatly improved while the manpower cost is saved; on the other hand, basic beat data is distributed to each music channel by configuring different distribution functions, so that extraction of various different types of music beat points can be adapted.
Next, the above steps of the present exemplary embodiment will be described in more detail with reference to fig. 2 to 8.
In step S110, an audio file is obtained, and beat points in the audio file are sampled to obtain basic beat data of the audio file.
In this exemplary embodiment, a beat point refers to an instantaneous intensity signal or an instantaneous frequency signal in a piece of audio to indicate a point of a distinct change in the piece of audio. And the basic beat data of the audio file refers to beat points in the audio file that meet the basic sampling requirement.
In the present exemplary embodiment, the acquisition of the beat point may be performed by an AudioSource component in the Unity game engine (a component in the Unity engine used to manage audio playing). Firstly, the acquired audio file is imported into a Unity engine, the Unity engine processes the imported audio file, and the audio is played through an AudioSource component.
In this exemplary embodiment, as shown in fig. 2, sampling beat points in an audio file to obtain basic beat data of the audio file may specifically include the following steps:
step S210, a sampling function is obtained, and the array length of a sampling array in the sampling function is obtained.
In this exemplary embodiment, the AudioSource component in the Unity engine may provide a sampling function, and directly obtain audio map data in the audio file through the combination of the sampling functions.
The sampling function includes a sampling array for storing sample data, and the array length is generally n-th power of 2, the minimum is 64, and the maximum is 8192.
S220, determining the sampling density of each frame of audio in the audio file according to the array length of the sampling array.
The array length of the sampling array represents the sampling density of each frame of audio in the audio file, i.e., the number of samples of the sampled beat points in each frame of audio. For example, if the array length of the sampling array is 64, the number of samples of the sampled beat point in each frame of audio is 64.
And S230, sampling the beat point of each frame of audio in the audio file according to the sampling density through a sampling function to obtain basic beat data of the audio file.
In this exemplary embodiment, as shown in fig. 3, sampling the beat point of each frame of audio in the audio file according to the sampling density by using a sampling function to obtain the basic beat data of the audio file, which may specifically include the following steps:
step s310, a target beat point in each frame of audio is determined.
And S320, sampling the target beat point in each frame of audio through a sampling function according to the sampling density to obtain basic beat data of the target beat point.
Step S330, obtaining the basic beat data of all beat points in each frame of audio according to the basic beat data of the target beat point.
And S340, obtaining basic beat data of the audio file according to the basic beat data of all beat points in each frame of audio.
In the present exemplary embodiment, the basic beat data of all beat points in each frame of audio can be obtained by sampling values of target beat points in this frame of audio. The target beat point may be one beat point or a plurality of beat points. For example, when the number of samples of a beat point sampled in one frame of audio is 64, a first sample beat point of the 64 sample beat points may be used as a target beat point, and a sampling value of the first sample beat point may be used as basic beat data of all beat points in the one frame of audio; alternatively, the first 3 or the first 5 of the 64 sample beat points may be used as target beat points, the sample values with the target beat points are added and averaged, and then the average of the sample values of the target beat points is used as the basic beat data of all beat points in the frame of audio. And finally, integrating the basic beat data of each frame in the audio file to obtain the basic beat data of the audio file. By the method, the sampling times of each frame can be reduced, and the efficiency is further improved.
In summary, the sampling function is to actually divide the audio of one frame into the number of parts with the same length as the array of the sampling array, determine the sampling value of each sample, and finally obtain the basic beat data of the audio file.
In step S120, music channels corresponding to the audio file are acquired, and the basic beat data is distributed to each music channel.
In the present exemplary embodiment, the music channel refers to a channel used to manage a beat point in a music game. The basic tempo data may be distributed to the music channels by a certain rule, for example, the music channel may be distributed by setting a distribution function.
In this exemplary embodiment, as shown in fig. 4, allocating the basic beat data to each music channel may specifically include the following steps:
step S410, the type of the audio file is obtained, and a target distribution rule is determined from a plurality of preset distribution rules according to the type of the audio file.
In the present exemplary embodiment, the type of audio file to be acquired is actually a type required for the music game for which the audio file is acquired.
The plurality of preset allocation rules may include: weight assignment according to music channels, random assignment, or assignment according to a continuous pattern, etc. Determining a target distribution rule from a plurality of preset distribution rules according to the type of the audio file, namely determining a target distribution rule by judging the distribution requirement corresponding to the audio file. For example, a music game for which the audio file is used needs to display a continuous regular period of beat points corresponding to the music tempo, the section may use a rule assigned according to a continuous pattern type.
And S420, determining the distribution sequence of each music channel according to the target distribution rule.
Different distribution rules correspond to different distribution orders of music channels. For example, if the music channels are distributed according to the weights, the weights of the music channels are determined firstly, and then the distribution sequence of the music channels is determined according to the sequence of the weights from high to low; if the music channel allocation is random, the allocation sequence of the music channels can be randomly determined according to a simple random rule; if the music channel is distributed according to the continuous pattern type, the distribution sequence of the music channel can be determined according to the preset pattern type rule.
And S430, sequentially distributing the basic beat data to the music channels in the idle state according to the distribution sequence of the music channels.
The music channel in the idle state refers to a music channel to which no previously assigned tempo point is assigned yet in the stay state when the current tempo point is assigned.
In this exemplary embodiment, as shown in fig. 5, sequentially allocating the basic beat data to the music channels in the idle state according to the allocation sequence of the music channels may specifically include the following steps:
step s510, the occurrence time of each beat point in the basic beat data and the duration of the beat point are obtained.
In the present exemplary embodiment, it is first necessary to determine the occurrence time of the beat point. In a music game, the beat points are generally required to be displayed in advance, and a certain preparation time is provided for a player, so that the advance time for the occurrence of a note animation needs to be set, and the time for the player to click a button is ensured to be the advance time plus the occurrence time of the beat points in the game. In addition, the duration of the beat point needs to be determined, corresponding to the duration of each note animation in the game, so as to ensure that the audio beat points are not too dense, and the note animation at the previous beat point is extruded by the note animation at the next beat point without being played.
Step s520, according to the occurrence time and duration time of the last beat point allocated in the music channel, it is determined whether the music channel is in an idle state when the current beat point is allocated.
If the time point when the current beat point is distributed is greater than or equal to the sum of the appearance time point of the previous beat point and the duration of the previous beat point, the music channel is in an idle state when the current beat point is distributed.
And S530, if the music channel is in an idle state, distributing the current beat point to the music channel.
And if the music channel is in an idle state, distributing the current beat point to the music channel, and acquiring the occurrence time and the duration time of the current beat point for judging the state of the music channel during the distribution of the subsequent beat point.
And S540, if the music channel is in a blocking state, skipping the current beat point and continuing to distribute the next beat point.
If the music channel is in a blocking state, the current beat point is ignored, and the next beat point is directly distributed.
In this exemplary embodiment, the beat point may be visually displayed on the interface. As shown in fig. 6, the method for visually displaying the beat point may specifically include the following steps:
and S610, acquiring a data conversion window function in the sampling function.
In this exemplary embodiment, the sampling function comprises a data conversion window function for converting the data signal. The more complex the algorithm of the conversion, the softer the sound, but the slower the speed. Generally, the conversion effect is better when the BlackmanHarris (a window function) mode is selected.
And S620, converting the basic beat data of the audio file into a corresponding display height value through a data conversion window function.
Sampling values of all sampling points can be obtained through the data conversion window function, and the display height value of corresponding basic beat data conversion can be determined according to the sampling values.
And S630, acquiring basic beat data of the current display frame, and displaying the basic beat data on an interface according to the display height value corresponding to the basic beat data of the current display frame.
In this example embodiment, the beat point of a certain frame in the music channel may be visually displayed on the interface according to the corresponding basic beat data.
As shown in fig. 7, displaying the basic beat data on the interface according to the display height value corresponding to the basic beat data of the current display frame may specifically include the following steps:
and S710, acquiring a standard height value of the basic beat data when the basic beat data is displayed on an interface.
Because the display range of the interface is limited, and the audio data of each song is greatly changed, a proportional value of the rectangular height needs to be provided, and the display height value of the basic beat data on the interface is limited, so that the whole view is changed within a reasonable height range. First, a standard height value of basic beat data when displayed on an interface is obtained, and a maximum value that can be displayed on the interface can be used as a standard value.
And S720, determining a scaling according to the display height value and the standard height value corresponding to the basic beat data.
The method comprises the steps of firstly determining the maximum value of display height values corresponding to basic beat data of a current display frame to be displayed, and then determining the scaling of the display height values corresponding to all the basic beat data in the current display frame according to the ratio of the maximum value of the display height values to a standard height value.
And S730, adjusting the display height value corresponding to the basic beat data according to the scaling, and displaying the basic beat data on an interface according to the adjusted display height value.
And after the display height value corresponding to the basic beat data is adjusted according to the scaling, displaying the basic beat data with the display height matched with the display interface on the interface. As shown in fig. 8, there are 64 sampling points in the basic beat data of a certain frame, a corresponding display height is determined according to the sampling value of each sampling point, and the display height is visually displayed on the interface after being adjusted.
In step S130, audio beat data corresponding to the audio file is obtained according to the basic beat data allocated in each music channel.
After the basic beat data are sequentially distributed into each music channel, the multi-channel audio beat data corresponding to the audio file can be obtained according to the basic beat data distributed in each music channel. And importing the multi-channel audio beat data corresponding to the audio file into the game to generate the music game with the corresponding rhythm class.
In addition, customized sampling threshold values and sampling minimum intervals of the beat points can be set for different audio files to meet different game difficulty requirements. And the beat point log can be printed, the time data stored in the derived audio beat data can be displayed in real time, and subsequent reference and other configurations are facilitated.
Fig. 9 is a complete flowchart in an embodiment of the present disclosure, which is used for extracting the beat points in the music game, and the beat points in the music game can be quickly generated by the Unity game engine, and is an illustration of the above steps in the exemplary embodiment, and specific steps in the flowchart are as follows:
and step S901, importing the audio file into a game engine and starting a sampling tool.
And step S903, configuring key parameters of the sampling function and the distribution function.
Step S905, playing the audio file and starting sampling.
And calculating beat points which accord with basic sampling requirements in the audio file through a sampling function to obtain basic beat data.
And S907, detecting an idle music channel conforming to the rule of the distribution function.
If there is a free music channel, go to step S909; if there is no free music channel, the process proceeds to step S911.
Step s909. place the beat point into the idle music channel.
Step S911, the beat point is ignored.
And step S913, updating the states of all music channels.
And S915, visually displaying the beat points of the music channel.
And S917, judging whether the audio file is played completely.
If the audio file is not played, returning to the step S905, repeating the steps, and continuing to distribute the music channels; if the audio file is played, the process proceeds to step S919, and the sampling and distributing process is ended.
And S919, exporting the multi-channel beat data of the audio file.
It should be noted that although the various steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Furthermore, the present disclosure also provides an extraction apparatus for beat data. Referring to fig. 10, the extraction means of the beat data may include a basic beat acquisition module 1010, a music channel assignment module 1020, and an audio beat determination module 1030. Wherein:
the basic beat acquisition module 1010 may be configured to acquire an audio file, and sample beat points in the audio file to obtain basic beat data of the audio file;
the music channel allocation module 1020 may be configured to obtain music channels corresponding to the audio files, and allocate the basic beat data to each music channel;
the audio beat determining module 1030 may be configured to obtain audio beat data corresponding to an audio file according to the basic beat data allocated in each music channel.
In some exemplary embodiments of the present disclosure, the basic beat acquisition module 1010 may include a sampling function acquisition unit, a sampling density determination unit, and a beat point sampling unit. Wherein:
the sampling function acquisition unit can be used for acquiring a sampling function and the array length of a sampling array in the sampling function;
the sampling density determining unit can be used for determining the sampling density of each frame of audio in the audio file according to the array length of the sampling array;
the beat point sampling unit can be used for sampling beat points of each frame of audio in the audio file according to the sampling density through a sampling function to obtain basic beat data of the audio file.
In some exemplary embodiments of the present disclosure, the beat point sampling unit may include a target beat point determination unit, a target beat point sampling unit, a single frame data acquisition unit, and a basic beat data acquisition unit. Wherein:
the target beat point determination unit may be configured to determine a target beat point in each frame of audio;
the target beat point sampling unit can be used for sampling the target beat point in each frame of audio according to the sampling density through a sampling function to obtain basic beat data of the target beat point;
the single-frame data acquisition unit may be configured to obtain basic beat data of all beat points in each frame of audio according to the basic beat data of the target beat point;
the basic beat data acquisition unit may be configured to obtain basic beat data of the audio file according to the basic beat data of all beat points in each frame of audio.
In some exemplary embodiments of the present disclosure, the basic tempo acquisition module 1010 may further include a window function acquisition unit, a display height value determination unit, and a tempo data display unit. Wherein:
the window function acquiring unit may be configured to acquire a data conversion window function in the sampling function;
the display height value determination unit may be configured to convert basic beat data of the audio file into a corresponding display height value through a data conversion window function;
the beat data display unit can be used for acquiring basic beat data of a current display frame and displaying the basic beat data on the interface according to a display height value corresponding to the basic beat data of the current display frame.
In some exemplary embodiments of the present disclosure, the beat data display unit may include a standard height value acquisition unit, a scaling determination unit, and a display height value adjustment unit. Wherein:
the standard height value acquiring unit may be configured to acquire a standard height value of the basic beat data when the basic beat data is displayed on the interface;
the scaling determining unit may be configured to determine a scaling according to the display height value and the standard height value corresponding to the basic tempo data;
the display height value adjusting unit may be configured to adjust a display height value corresponding to the basic beat data according to the scaling, and display the basic beat data on the interface according to the adjusted display height value.
In some exemplary embodiments of the present disclosure, the music channel allocation module 1020 may include a target allocation rule determination unit, an allocation order determination unit, and a beat data allocation unit. Wherein:
the target distribution rule determining unit may be configured to obtain a type of the audio file, and determine a target distribution rule from a plurality of preset distribution rules according to the type of the audio file;
the distribution order determination unit may be configured to determine a distribution order of the respective music channels according to a target distribution rule;
the beat data allocation unit may be configured to sequentially allocate the basic beat data into music channels in an idle state according to an allocation order of the music channels.
In some exemplary embodiments of the present disclosure, the beat data allocation unit may include a beat point parameter acquisition unit, a channel state judgment unit, a beat point allocation unit, and a beat point skipping unit. Wherein:
the beat point parameter acquiring unit may be configured to acquire occurrence time of each beat point in the basic beat data and duration time of the beat point;
the channel state judging unit may be configured to judge whether the music channel is in an idle state when the current beat point is allocated, according to the occurrence time and duration time of the last beat point allocated in the music channel;
the beat point distribution unit may be configured to distribute the current beat point to the music channel if the music channel is in an idle state;
the beat point skipping unit may be configured to skip the current beat point and continue the distribution of the next beat point if the music channel is in the blocking state.
The details of each module/unit in the above device for extracting beat data have been described in detail in the corresponding method embodiment section, and are not described herein again.
FIG. 11 illustrates a schematic structural diagram of a computer system suitable for use with the electronic device to implement an embodiment of the invention.
It should be noted that the computer system 1100 of the electronic device shown in fig. 11 is only an example, and should not bring any limitation to the functions and the scope of the application of the embodiment of the present invention.
As shown in fig. 11, the computer system 1100 includes a Central Processing Unit (CPU)1101, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)1102 or a program loaded from a storage section 1108 into a Random Access Memory (RAM) 1103. In the RAM 1103, various programs and data necessary for system operation are also stored. The CPU 1101, ROM 1102, and RAM 1103 are connected to each other by a bus 1104. An input/output (I/O) interface 1105 is also connected to bus 1104.
The following components are connected to the I/O interface 1105: an input portion 1106 including a keyboard, mouse, and the like; an output portion 1107 including a signal output unit such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 1108 including a hard disk and the like; and a communication section 1109 including a network interface card such as a LAN card, a modem, or the like. The communication section 1109 performs communication processing via a network such as the internet. A driver 1110 is also connected to the I/O interface 1105 as necessary. A removable medium 1111 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1110 as necessary, so that a computer program read out therefrom is mounted into the storage section 1108 as necessary.
In particular, according to an embodiment of the present invention, the processes described below with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 1109 and/or installed from the removable medium 1111. When the computer program is executed by a Central Processing Unit (CPU)1101, various functions defined in the system of the present application are executed.
It should be noted that the computer readable media shown in the present disclosure may be computer readable signal media or computer readable storage media or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method as described in the embodiments below.
It should be noted that although in the above detailed description several modules of the device for action execution are mentioned, this division is not mandatory. Indeed, the features and functionality of two or more of the modules described above may be embodied in one module, in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module described above may be further divided into embodiments by a plurality of modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for extracting beat data, comprising:
acquiring an audio file, and sampling beat points in the audio file to obtain basic beat data of the audio file;
acquiring music channels corresponding to the audio files, and distributing the basic beat data to each music channel;
and obtaining audio beat data corresponding to the audio file according to the basic beat data distributed in each music channel.
2. The method for extracting beat data according to claim 1, wherein the sampling beat points in the audio file to obtain basic beat data of the audio file comprises:
acquiring a sampling function and the array length of a sampling array in the sampling function;
determining the sampling density of each frame of audio in the audio file according to the array length of the sampling array;
and sampling the beat point of each frame of audio in the audio file according to the sampling density through the sampling function to obtain basic beat data of the audio file.
3. The method for extracting beat data according to claim 2, wherein the obtaining of the basic beat data of the audio file by sampling the beat points of each frame of audio in the audio file according to the sampling density through the sampling function comprises:
determining a target beat point in each frame of audio;
sampling a target beat point in each frame of audio according to the sampling density through the sampling function to obtain basic beat data of the target beat point;
obtaining basic beat data of all beat points in each frame of audio according to the basic beat data of the target beat point;
and obtaining the basic beat data of the audio file according to the basic beat data of all beat points in each frame of audio.
4. The method of extracting beat data according to claim 2, further comprising:
acquiring a data conversion window function in the sampling function;
converting the basic beat data of the audio file into a corresponding display height value through the data conversion window function;
acquiring basic beat data of a current display frame, and displaying the basic beat data on an interface according to a display height value corresponding to the basic beat data of the current display frame.
5. The method for extracting beat data according to claim 4, wherein the displaying the basic beat data on an interface according to the display height value corresponding to the basic beat data of the current display frame includes:
acquiring a standard height value of the basic beat data when the basic beat data is displayed on an interface;
determining a scaling ratio according to the display height value corresponding to the basic beat data and the standard height value;
and adjusting the display height value corresponding to the basic beat data according to the scaling, and displaying the basic beat data on an interface according to the adjusted display height value.
6. The method for extracting tempo data according to claim 1, wherein said distributing said basic tempo data into respective said music channels comprises:
acquiring the type of the audio file, and determining a target distribution rule from a plurality of preset distribution rules according to the type of the audio file;
determining the distribution sequence of each music channel according to the target distribution rule;
and sequentially distributing the basic beat data to the music channels in an idle state according to the distribution sequence of the music channels.
7. The method for extracting tempo data according to claim 6, wherein said sequentially allocating the basic tempo data into the music channels in an idle state according to the allocation order of the music channels comprises:
acquiring the occurrence time of each beat point in the basic beat data and the duration time of the beat point;
judging whether the music channel is in an idle state or not when the current beat point is distributed according to the occurrence time and the duration time of the last beat point distributed in the music channel;
if the music channel is in an idle state, distributing the current beat point to the music channel;
and if the music channel is in a blocking state, skipping the current beat point and continuing to distribute the next beat point.
8. An extraction device of beat data, characterized by comprising:
the basic beat acquisition module is used for acquiring an audio file and sampling beat points in the audio file to obtain basic beat data of the audio file;
the music channel distribution module is used for acquiring music channels corresponding to the audio files and distributing the basic beat data to the music channels;
and the audio beat determining module is used for obtaining audio beat data corresponding to the audio file according to the basic beat data distributed in each music channel.
9. An electronic device, comprising:
a processor; and
a memory for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the extraction method of beat data according to any one of claims 1 to 7.
10. A computer-readable medium on which a computer program is stored, characterized in that the program, when executed by a processor, implements the extraction method of beat data according to any one of claims 1 to 7.
CN202011157762.4A 2020-10-26 2020-10-26 Beat data extraction method and device, electronic equipment and computer readable medium Active CN112237740B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011157762.4A CN112237740B (en) 2020-10-26 2020-10-26 Beat data extraction method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011157762.4A CN112237740B (en) 2020-10-26 2020-10-26 Beat data extraction method and device, electronic equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN112237740A true CN112237740A (en) 2021-01-19
CN112237740B CN112237740B (en) 2024-03-15

Family

ID=74169911

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011157762.4A Active CN112237740B (en) 2020-10-26 2020-10-26 Beat data extraction method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN112237740B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001029647A (en) * 1999-07-16 2001-02-06 Snk Corp Music game system and its memory medium
CN101577114A (en) * 2009-06-18 2009-11-11 北京中星微电子有限公司 Method and device for implementing audio visualization
CN104346147A (en) * 2013-07-29 2015-02-11 人人游戏网络科技发展(上海)有限公司 Method and device for editing rhythm points of music games
US9286383B1 (en) * 2014-08-28 2016-03-15 Sonic Bloom, LLC System and method for synchronization of data and audio
CN110019931A (en) * 2017-12-05 2019-07-16 腾讯科技(深圳)有限公司 Audio frequency classification method, device, smart machine and storage medium
CN111782866A (en) * 2019-04-04 2020-10-16 阿里巴巴集团控股有限公司 Drawing method, drawing device, terminal equipment and computer storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001029647A (en) * 1999-07-16 2001-02-06 Snk Corp Music game system and its memory medium
CN101577114A (en) * 2009-06-18 2009-11-11 北京中星微电子有限公司 Method and device for implementing audio visualization
CN104346147A (en) * 2013-07-29 2015-02-11 人人游戏网络科技发展(上海)有限公司 Method and device for editing rhythm points of music games
US9286383B1 (en) * 2014-08-28 2016-03-15 Sonic Bloom, LLC System and method for synchronization of data and audio
CN110019931A (en) * 2017-12-05 2019-07-16 腾讯科技(深圳)有限公司 Audio frequency classification method, device, smart machine and storage medium
CN111782866A (en) * 2019-04-04 2020-10-16 阿里巴巴集团控股有限公司 Drawing method, drawing device, terminal equipment and computer storage medium

Also Published As

Publication number Publication date
CN112237740B (en) 2024-03-15

Similar Documents

Publication Publication Date Title
CN109348274B (en) Live broadcast interaction method and device and storage medium
WO2019232928A1 (en) Musical model training method, music creation method, devices, terminal and storage medium
CN110246472B (en) Music style conversion method and device and terminal equipment
US11511200B2 (en) Game playing method and system based on a multimedia file
CN106611603A (en) Audio processing method and audio processing device
CN109190879B (en) Method and device for training adaptation level evaluation model and evaluating adaptation level
KR101648931B1 (en) Apparatus and method for producing a rhythm game, and computer program for executing the method
CN102124488A (en) Game data generation based on user provided song
CN113707111B (en) Method and computer program for processing music score data displayed in multiple lines into playing data
CN111399745A (en) Music playing method, music playing interface generation method and related products
CN108766460B (en) Voice-based interaction method and system
CN113096689A (en) Song singing evaluation method, equipment and medium
CN101661783A (en) Information processing apparatus, program, and information processing method
CN112237740B (en) Beat data extraction method and device, electronic equipment and computer readable medium
CN109410972B (en) Method, device and storage medium for generating sound effect parameters
CN111185006A (en) Information processing method and device in game, storage medium and electronic equipment
CN113821189B (en) Audio playing method, device, terminal equipment and storage medium
CN110097618A (en) A kind of control method, device, vehicle and the storage medium of music animation
CN111276113B (en) Method and device for generating key time data based on audio
CN111782868A (en) Audio processing method, device, equipment and medium
JP2022122706A (en) Sound generating method using machine learning model, training method for machine learning model, sound generating device, training device, sound generating program, and training program
CN111508454A (en) Music score processing method and device, electronic equipment and storage medium
CN111753127A (en) Music information processing and recommending method and device
CN112435644B (en) Audio signal output method and device, storage medium and computer equipment
US11609948B2 (en) Music streaming, playlist creation and streaming architecture

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant