Music arrangement method and device and electronic equipment
By generating and combining the combination of the music block, the music telescopic function in the existing technology cannot achieve the problem of naturalness and accurate control of the playback duration, and achieve high -quality music arrangement effects.
Patent Information
- Application Number
- CN202411364571.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-24
AI Technical Summary
The existing music scaling function cannot achieve natural listening experience and precise control of playback time, resulting in large output errors.
Combining the base phrase and fade-out music chunks to match the preset playback time by taking the base segment and using a telescopic logic algorithm to generate fadeout music chunks based on the preset playback duration.
The music effect of the natural hearing and the accurate control of the playback duration is achieved, and the output error is reduced.
Smart Images

Figure CN119360806A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of music arrangement, and in particular, to a music arrangement method, device, and electronic device. Background Art
[0002] "Time stretching" or "time compression" is a common music production technique, usually referring to a method of changing the length of music. Its purpose is to change the playing time of the music while maintaining the original timbre (speed and pitch, etc.). Its main use is, for example, to match a piece of music with a video, the length of the music and the video needs to correspond, so as to produce a better coordination effect.
[0003] If the duration of audio and video do not match, users will try to modify the duration of the music, such as cutting it by themselves, or automatically cutting it through the built-in music stretching function of products such as Adobe or Cyberlink. The existing music stretching function will cause an unnatural listening experience, and it is impossible to finely make the music close to the length specified by the user, which will result in a large output error. Summary of the invention
[0004] In response to the problems existing in the above-mentioned prior art, the embodiments of the present application provide a music arrangement method, device, and electronic device, which can achieve a music effect with natural listening experience and precise control of playback duration by processing fade-out music blocks.
[0005] In a first aspect, an embodiment of the present application provides a music arrangement method, comprising the following steps:
[0006] Get the basic music segment;
[0007] According to the preset playing time of the music, generating a fade-out music block by a telescoping logic algorithm; and
[0008] The basic music segment and the fade-out music block are combined to obtain finished music that matches the preset playing time.
[0009] Furthermore, the obtaining of the basic music segment includes:
[0010] The material combination is combined with the basic arrangement to obtain the basic music segment.
[0011] Furthermore, the basic music segment includes a plurality of music blocks, and the duration of the plurality of music blocks is the same.
[0012] Furthermore, the step of generating a fade-out music block by a scaling logic algorithm according to a preset playing time includes:
[0013] Obtaining a multiple of the preset playing time divided by the time length of a single music block of the basic music segment;
[0014] rounding down the multiple to an integer multiple; and
[0015] The actual playing time of the music is subtracted from the product of the integer multiple and the time length of the single music block to obtain the time length of the fade-out music block, so as to generate the fade-out music block.
[0016] Further, after obtaining the duration of the fade-out music block by subtracting the product of the integer multiple and the duration of the single music block from the actual playback duration to generate the fade-out music block, the method further includes:
[0017] When the obtained duration of the fade-out music block is less than the preset minimum duration, the duration of a single music block of the basic music segment is used as the duration of the fade-out music block, and the actual playing duration of the music is the product of the integer multiple and the duration of the single music block.
[0018] Further, after obtaining the duration of the fade-out music block by subtracting the product of the integer multiple and the duration of the single music block from the actual playback duration to generate the fade-out music block, the method further includes:
[0019] When the obtained duration of the fade-out music block is less than the preset minimum duration, the last music block of the basic music section is faded out to serve as the fade-out music block.
[0020] Further, after obtaining the duration of the fade-out music block by subtracting the product of the integer multiple and the duration of the single music block from the actual playback duration to generate the fade-out music block, the method further includes:
[0021] When the obtained duration of the fade-out music block is greater than the preset minimum duration, the content of the fade-out music block is set to be the same as the content of the last music block of the basic music section.
[0022] In a second aspect, the present application also provides a music arrangement device, including:
[0023] A music segment acquisition module is used to acquire basic music segments;
[0024] A music block generation module, used to generate a fade-out music block through a telescoping logic algorithm according to a preset playing time of the music; and
[0025] The finished product acquisition module is used to combine the basic music section and the fade-out music block to obtain the finished music that matches the preset playback duration.
[0026] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is configured to implement the music arrangement method according to the first aspect described above when executing the program.
[0027] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, wherein the computer program is used to implement the music arranging method according to the first aspect above.
[0028] The embodiments of the present application bring the following beneficial effects:
[0029] In the music arrangement method provided in the embodiment of the present application, after obtaining the basic music segment, a fade-out music block is generated according to the preset playing time of the music through a telescopic logic algorithm, and the basic music segment and the fade-out music block are combined to obtain a finished music that matches the preset playing time. Therefore, the music arrangement method provided in the embodiment of the present application can achieve a music effect with natural listening and precise control of the playing time by processing the fade-out music block. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0031] Figure 1 A schematic diagram of a music arrangement method according to an embodiment of the present invention;
[0032] Figure 2a and Figure 2b An example diagram of a basic arrangement involved in the music arrangement method provided in an embodiment of the present application;
[0033] Figure 3 This is an example diagram of the process of generating a basic music segment involved in the music arrangement method provided in an embodiment of the present application.
[0034] Figure 4a to Figure 4g An example diagram of the generation process of the final arrangement or finished music involved in the music arrangement method provided in the embodiment of the present application;
[0035] Figure 5 A structural block diagram of a music arrangement device provided in an embodiment of the present application;
[0036] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0037] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments described in the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0039] In the specification and claims of this application and the above-mentioned drawings, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "multiple" means two or more. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to the specific circumstances.
[0040] Figure 1 FIG. 1 is a flowchart of a music arrangement method according to an embodiment of the present application. Figure 1 As shown, the music arrangement method of the embodiment of the present application includes the following steps:
[0041] S101: Obtain basic music segments;
[0042] Specifically, the basic music segment, that is, the initial music that has not been time-stretched or time-compressed, has its playback duration not processed accordingly, sounds unnatural, and does not reach the user's preset music playback duration.
[0043] S102: generating a fade-out music block by a telescoping logic algorithm according to a preset playing time of the music; and
[0044] Specifically, a fade-out music block refers to a music block in which sound or the like gradually fades out and disappears. The fade-out music block is usually the last music block of a basic music segment, and it ends the music in a gradually weakening manner. According to the preset playing time of the music, the fade-out music block is generated by a telescoping logic algorithm, so that the generated music can sound natural and the playing time can be precisely controlled.
[0045] S103: combining the basic music segment and the fade-out music block to obtain finished music that matches the preset playing time.
[0046] As described above, after the fade-out music block is generated, the fade-out music block is combined with the basic music segment to obtain the finished music that matches the preset playback duration, so as to complete the music arrangement operation.
[0047] Therefore, in the music arrangement method provided in the embodiment of the present application, after obtaining the basic music segment, a fade-out music block is generated according to the preset playing time of the music through a telescopic logic algorithm, and the basic music segment and the fade-out music block are combined to obtain a finished music that matches the preset playing time. Therefore, the music arrangement method provided in the embodiment of the present application can achieve a music effect with a natural listening sense and precise control of the playing time by processing the fade-out music block.
[0048] Further, refer to Figure 2a , Figure 2b and Figure 3 In some embodiments of the present application, the step of obtaining a basic music segment includes:
[0049] The material combination is combined with the basic arrangement to obtain the basic music segment.
[0050] like Figure 2a and Figure 2b As shown, the basic arrangement shown includes 4 music blocks, and the music blocks are used in combination with the audio in the material. The material combination is a collection of music materials (lead, pad, bass, drum) with four tracks. The audio in the collection must have the same music speed (BPM, Beat Per Minute, beats per minute). For example, there are two eight-beat music lengths in the material combination. Therefore, if the music speed of the material is 120BPM, the length of the material is 8 seconds. If the music speed of the material is 90BPM, the length of the material is 10.6666666666667 seconds. If the music speed of the material is 75BPM, the length of the material is 12.8 seconds. If the music speed of the material is 60BPM, the length of the material is 16 seconds. Figure 3 As shown, the basic arrangement shown is composed of four blocks horizontally. If the music speed of the material is 75BPM, then the length of the basic music segment after the material is combined with the basic arrangement is 12.8*4, that is, 51.2 seconds.
[0051] Furthermore, in some embodiments of the present application, the basic music segment includes a plurality of music blocks, and the plurality of music blocks have the same duration.
[0052] As mentioned above, the basic arrangement shown is composed of a total of four music blocks horizontally, and the duration of each music block is the same. For example, if the music speed of the material is 75BPM, then the length of the basic music segment after the basic arrangement is used is 12.8*4, that is, 51.2 seconds.
[0053] Further, in some embodiments of the present application, generating a fade-out music block by a scaling logic algorithm according to a preset playback duration includes:
[0054] Obtaining a multiple of the preset playing time divided by the time length of a single music block of the basic music segment;
[0055] rounding down the multiple to an integer multiple; and
[0056] The actual playing time of the music is subtracted from the product of the integer multiple and the time length of the single music block to obtain the time length of the fade-out music block, so as to generate the fade-out music block.
[0057] Specifically, the music arrangement method provided in the embodiment of the present application can extend or shorten the duration of the fade-out music block through the above steps, so that the total duration of the fade-out music block and other music blocks is equal to the preset playback duration, thereby achieving precise control of the playback duration of the final arrangement.
[0058] Further, in some embodiments of the present application, after subtracting the product of the integer multiple and the duration of the single music block from the actual playback duration to obtain the duration of the fade-out music block to generate the fade-out music block, the method further includes:
[0059] When the obtained duration of the fade-out music block is less than the preset minimum duration, the duration of a single music block of the basic music segment is used as the duration of the fade-out music block, and the actual playing duration of the music is the product of the integer multiple and the duration of the single music block.
[0060] Specifically, if the duration of the fade-out music block obtained according to the steps described above is too short, the listening quality of the final finished music is poor. Therefore, when the duration of the fade-out music block obtained is less than the preset minimum duration, such as 3 seconds, the duration of a single music block of the basic music segment is used as the duration of the fade-out music block, and the actual playback duration of the music is the product of the integer multiple and the duration of the single music block. At this time, there will be a certain time error between the actual playback duration of the music and the preset playback duration, and the range of the time error is between 0 and 3 seconds. The music arrangement method provided in the embodiment of the present application can ensure that the actual playback duration is close to the preset playback duration through the above operation, and at the same time can improve the listening quality of the finished music.
[0061] The music arrangement method provided in the embodiment of the present application, wherein the computer code of the telescoping logic algorithm is as follows:
[0062]
[0063] Figure 4a to Figure 4gThis is an example diagram of the generation process of the final arrangement or finished music involved in the music arrangement method provided in an embodiment of the present application, wherein the fade-out music block is generated by the above code.
[0064] Further, in some embodiments of the present application, after subtracting the product of the integer multiple and the duration of the single music block from the actual playback duration to obtain the duration of the fade-out music block to generate the fade-out music block, the method further includes:
[0065] When the obtained duration of the fade-out music block is less than the preset minimum duration, the last music block of the basic music section is faded out to serve as the fade-out music block.
[0066] That is, if the duration of the fade-out music block is too short, the listening quality of the final finished music will be poor. Therefore, when the duration of the fade-out music block is less than the preset minimum duration, for example, 3 seconds, the last music block of the basic music segment will be faded out as the fade-out music block, thereby ensuring the smoothness of the finished music and improving the listening quality of the finished music.
[0067] Further, in some embodiments of the present application, after obtaining the duration of the fade-out music block by subtracting the product of the integer multiple and the duration of the single music block from the actual playback duration to generate the fade-out music block, the method further includes:
[0068] When the obtained duration of the fade-out music block is greater than the preset minimum duration, the content of the fade-out music block is set to be the same as the content of the last music block of the basic music section.
[0069] As mentioned above, the fade-out music block refers to a music block in which the sound gradually fades out and disappears. The fade-out music block is usually the last music block of the basic music section, which completes the end of the music in a gradually weakening manner. When the duration of the fade-out music block obtained is greater than the preset minimum duration, the content of the fade-out music block is set to be the same as the content of the last music block of the basic music section, thereby further improving the listening experience of the finished music.
[0070] Figure 5 2 is a structural block diagram of the music arrangement device 200 provided in the embodiment of the present application. Figure 5 As shown, the music arrangement device 200 of the embodiment of the present application includes: a music segment acquisition module 210, a music block generation module 220 and a finished product acquisition module 230, wherein:
[0071] The music segment acquisition module 210 is used to acquire the basic music segment;
[0072] A music block generation module 220, configured to generate a fade-out music block by a scaling logic algorithm according to a preset playing time of the music; and
[0073] The finished product acquisition module 230 is used to combine the basic music section and the fade-out music block to obtain the finished music that matches the preset playing time.
[0074] In the music arrangement device provided in the embodiment of the present application, after obtaining the basic music segment, a fade-out music block is generated according to the preset playing time of the music through a telescopic logic algorithm, and the basic music segment and the fade-out music block are combined to obtain a finished music that matches the preset playing time. Therefore, the music arrangement method provided in the embodiment of the present application can achieve a music effect with natural listening and precise control of the playing time by processing the fade-out music block.
[0075] It should be noted that the specific implementation method of the music arranging device of the embodiment of the present application is similar to the specific implementation method of the music arranging method of the embodiment of the present application. Please refer to the description of the method part for details, and no further details will be given here.
[0076] Figure 6 Schematic diagram of the structure of an electronic device 300 according to an embodiment of the present application.
[0077] like Figure 6 As shown, the electronic device 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from the storage part 302 to a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The CPU 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0078] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed, so that a computer program read therefrom is installed into the storage section 308 as needed.
[0079] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a machine-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 309, and / or installed from a removable medium 311. When the computer program is executed by a central processing unit (CPU) 301, the above-mentioned functions defined in the electronic device of the present application are executed.
[0080] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electronic device, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0081] In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction-executing electronic device, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction-executing electronic device, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0082] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the processing receiving device, method and computer program product according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the aforementioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based electronic device that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0083] The units or modules involved in the embodiments described in this application may be implemented by software or hardware. The units or modules described may also be arranged in a processor, and the processor is used to implement the music arrangement method when executing the program:
[0084] Get the basic music segment;
[0085] According to the preset playing time of the music, generating a fade-out music block by a telescoping logic algorithm; and
[0086] The basic music segment and the fade-out music block are combined to obtain finished music that matches the preset playing time.
[0087] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently and not be assembled into the electronic device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the music arrangement method described in the present application:
[0088] Get the basic music segment;
[0089] According to the preset playing time of the music, generating a fade-out music block by a telescoping logic algorithm; and
[0090] The basic music segment and the fade-out music block are combined to obtain finished music that matches the preset playing time.
[0091] As another aspect, the present application further provides a computer program product, which may be included in the electronic device described in the above embodiment; or may exist independently without being installed in the electronic device. The above computer program product stores one or more programs, and when the above programs are used by one or more processors to execute the music arrangement method described in the present application:
[0092] Get the basic music segment;
[0093] According to the preset playing time of the music, generating a fade-out music block by a telescoping logic algorithm; and
[0094] The basic music segment and the fade-out music block are combined to obtain finished music that matches the preset playing time.
[0095] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. All equivalent structural changes made by using the contents of the present application specification and drawings under the application concept of the present application, or directly / indirectly used in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A music arrangement method, characterized in that: The following steps are involved: Get the basic music segment; According to the preset playing time of the music, a fade-out music block is generated by a telescoping logic algorithm; and The basic music segment and the fade-out music block are combined to obtain finished music that matches the preset playing time.
2. The music arrangement method according to claim 1, characterized in that: The obtaining of the basic music segment comprises: The material combination is combined with the basic arrangement to obtain the basic music segment.
3. The music arrangement method according to claim 2, characterized in that: The basic music segment includes a plurality of music blocks, and the duration of the plurality of music blocks is the same.
4. The music arrangement method according to claim 3, characterized in that: The method of generating a fade-out music block by a scaling logic algorithm according to a preset playing time includes: Obtaining a multiple of the preset playing time divided by the time length of a single music block of the basic music segment; rounding down the multiple to an integer multiple; and The actual playing time of the music is subtracted from the product of the integer multiple and the time length of the single music block to obtain the time length of the fade-out music block, so as to generate the fade-out music block.
5. The music arrangement method according to claim 4, characterized in that: After obtaining the duration of the fade-out music block by subtracting the product of the integer multiple and the duration of the single music block from the actual playback duration to generate the fade-out music block, the method further includes: When the obtained duration of the fade-out music block is less than the preset minimum duration, the duration of a single music block of the basic music segment is used as the duration of the fade-out music block, and the actual playing duration of the music is the product of the integer multiple and the duration of the single music block.
6. The music arrangement method according to claim 5, characterized in that: After obtaining the duration of the fade-out music block by subtracting the product of the integer multiple and the duration of the single music block from the actual playback duration to generate the fade-out music block, the method further includes: When the obtained duration of the fade-out music block is less than the preset minimum duration, the last music block of the basic music section is faded out to serve as the fade-out music block.
7. The music arrangement method according to claim 5, characterized in that: After obtaining the duration of the fade-out music block by subtracting the product of the integer multiple and the duration of the single music block from the actual playback duration to generate the fade-out music block, the method further includes: When the obtained duration of the fade-out music block is greater than the preset minimum duration, the content of the fade-out music block is set to be the same as the content of the last music block of the basic music section.
8. A music arrangement device, characterized in that: include: A music segment acquisition module is used to acquire basic music segments; A music block generation module, used to generate a fade-out music block through a telescoping logic algorithm according to a preset playing time of the music; and The finished product acquisition module is used to combine the basic music section and the fade-out music block to obtain the finished music that matches the preset playback duration.
9. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor is used to implement the music arranging method according to any one of claims 1 to 7 when executing the program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is used to implement the music arranging method according to any one of claims 1-7.