Method, device and equipment for converting rain sound into musical instrument sound and storage medium

By collecting and adjusting the amplitude and frequency of rain sound signals and converting them into musical instrument audio signals, the problem of rain sound interference is solved and the driving experience is made more interesting and comfortable.

CN118629374AInactive Publication Date: 2024-09-10CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410755584.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-09-10
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When driving on rainy days, the interference of the rain sound to the sound environment in the car is difficult to control, affecting the comfort and driving experience of the driver and passengers.

Method used

By collecting the amplitude and frequency of the rain sound signal on the outer surface of the vehicle, adjusting its amplitude and frequency to match the preset mapping relationship, converting it into an instrument audio signal, the instrument sound is generated to replace the original rain sound.

Benefits of technology

It realizes the conversion of rain sounds into musical instrument sounds, improves the auditory experience of drivers and passengers, increases the fun and immersion of driving, and improves the sound environment in the car.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118629374A
    Figure CN118629374A
Patent Text Reader

Abstract

The invention provides a method, device and equipment for converting rain sound into musical instrument sound and a storage medium, and the method comprises the steps: collecting the amplitude and frequency of a rain sound signal on the outer surface of a vehicle, taking the amplitude range of the rain sound signal in a preset time threshold value as a target range, and adjusting the amplitude range of the collected rain sound signal to be within the target range; matching the amplitude of the rain sound signal with a preset first mapping relation, and determining a target tone of the rain sound signal; the frequency of the rain sound signal is matched with a preset second mapping relation, a target musical scale of the rain sound signal matched with a musical instrument is determined, and the musical instrument is determined according to the frequency range of the rain sound signal within a preset time threshold value; and converting the rain sound signal into an audio signal of the musical instrument based on the target tone and the target scale corresponding to the rain sound signal. Thus, rain sound is converted into musical instrument sound, unique hearing experience can be provided for a driver and passengers, and the interestingness and immersion of driving can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of sound conversion, and in particular to a method, device, equipment and storage medium for converting rain sound into musical instrument sound. Background Art

[0002] With the continuous upgrading of consumer demand and the continuous advancement of technology, cars are becoming more and more personalized, intelligent and comfortable. Vehicles are equipped with functions such as automatic driving, smart seats and smart air conditioning that can enhance the driving experience. The sound environment inside the car will also affect the driving and riding experience. Therefore, providing a quiet and comfortable sound environment inside the vehicle is becoming more and more important, especially for new energy vehicles. Electric vehicles have lower noise and vibration levels, which are more conducive to improving the sound environment inside the vehicle. In related technologies, the sound environment inside the vehicle is effectively improved mainly by setting sound insulation materials at key parts of the vehicle, reducing the transmission of road noise and vibration to the vehicle, and the microphone and speaker system inside the vehicle generating sound waves with opposite phases to the noise.

[0003] However, certain natural sounds, such as wind and rain, are difficult to control in terms of the sound environment inside the car. In particular, when driving in the rain, traffic jams are prone to occur, and raindrops hitting the car body will produce additional noise, affecting the comfort of the driver and passengers and resulting in a poor driving experience. Therefore, it is necessary to improve the driving experience when driving in the rain. Summary of the invention

[0004] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0005] In view of the above-mentioned shortcomings of the prior art, the present application discloses a method, device, equipment and storage medium for converting rain sound into musical instrument sound to solve at least one of the above-mentioned technical problems.

[0006] In a first aspect, the present application provides a method for converting rain sound into the sound of a musical instrument, comprising: collecting the amplitude and frequency of a rain sound signal on the outer surface of a vehicle, and taking the amplitude range of the rain sound signal within a preset time threshold as a target range, adjusting the amplitude range of the collected rain sound signal to within the target range; matching the amplitude of the rain sound signal with a preset first mapping relationship to determine a target pitch of the rain sound signal, wherein the preset first mapping relationship represents a mapping relationship between an amplitude interval and a pitch, and each amplitude interval is a preset number of amplitude ranges into which the target range is divided; matching the frequency of the rain sound signal with a preset second mapping relationship to determine a target scale of the rain sound signal, wherein the preset second mapping relationship represents a mapping relationship between a scale and a frequency of a musical instrument, and the musical instrument is determined by the frequency range of the rain sound signal within the preset time threshold; based on the target pitch and the target scale corresponding to the rain sound signal, converting the rain sound signal into an audio signal of the musical instrument.

[0007] In one embodiment of the present application, before adjusting the amplitude range of the collected rain sound signal to within the target range, it also includes: after denoising the rain sound signal, comparing the rain sound signal with a preset scale range; taking the rain sound signal that is not within the preset scale range as the target rain sound signal; adjusting the frequency of the target rain sound signal so that the frequency of the target rain sound signal is within the preset scale range; when the frequencies of the rain sound signals are all within the preset scale range, adjusting the amplitude range of the rain sound signal.

[0008] In one embodiment of the present application, adjusting the amplitude range of the collected rain sound signal to within the target range includes: dividing the collected rain sound signal to obtain the rain sound signals within a plurality of preset time periods; matching the amplitude range of the rain sound signal within each preset time period with the target range; if the amplitude range of the rain sound signal within the preset time period is not within the target range, gradually reducing or amplifying the rain sound signal within the preset time period in proportion until it is adjusted to within the target range.

[0009] In one embodiment of the present application, matching the frequency of the rain sound signal with a preset second mapping relationship to determine the target scale of the rain sound signal includes: querying a preset first mapping table according to the frequency range to determine one of the musical instruments, the first mapping table including the musical instruments corresponding one to one to each of the frequency ranges; matching the frequency of the rain sound signal with the preset second mapping relationship to determine one of the target scales of the rain sound signal; or, querying a preset second mapping table according to the frequency range to determine at least two of the musical instruments, the preset second mapping table including at least two musical instruments corresponding to each of the frequency ranges; matching the frequency of the rain sound signal with the preset second mapping relationship to determine at least two of the target scales of the rain sound signal.

[0010] In one embodiment of the present application, after determining the target scale of the rain sound signal, it also includes: dynamically adjusting the musical instrument according to the change of the frequency range of the rain sound signal; wherein, if the frequency range of the rain sound signal changes within adjacent preset intervals, the frequency range of the rain sound signal within the preset interval with a collection time later is input into the preset first mapping table, or the preset second mapping table, to replace the musical instrument.

[0011] In one embodiment of the present application, collecting rain sound signals from outside a vehicle includes: providing a sensor for collecting the rain sound signal inside the vehicle, wherein the sensor is covered with sound insulation material; when collecting the rain sound signal, conditioning the rain sound signal using the sensor so that the intensity of the rain sound signal is within a preset intensity range.

[0012] In one embodiment of the present application, the conditioning of the rain sound signal using the sensor includes: if the intensity of the rain sound signal is lower than the minimum value within the preset intensity range, amplifying the rain sound signal; if the intensity of the rain sound signal is higher than the maximum value within the preset intensity range, attenuating the rain sound signal.

[0013] In a second aspect, the present application provides a device for converting rain sound into the sound of a musical instrument, comprising: an acquisition module, used to collect the amplitude and frequency of a rain sound signal on the outer surface of a vehicle, and taking the amplitude range of the rain sound signal within a preset time threshold as a target range, adjusting the amplitude range of the collected rain sound signal to within the target range; a tone determination module, used to match the amplitude of the rain sound signal with a preset first mapping relationship, and determine the target tone of the rain sound signal, the preset first mapping relationship represents the mapping relationship between amplitude intervals and tones, and each amplitude interval is a preset number of amplitude ranges divided by the target range; a scale determination module, used to match the frequency of the rain sound signal with a preset second mapping relationship, and determine the target scale of the rain sound signal, the preset second mapping relationship represents the mapping relationship between the scale and frequency of a musical instrument, and the musical instrument is determined by the frequency range of the rain sound signal within the preset time threshold; a conversion module, used to convert the rain sound signal into an audio signal of the musical instrument based on the target tone and the target scale of the rain sound signal.

[0014] In a third aspect, the present application also provides an electronic device comprising: a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the method of converting rain sounds into musical instrument sounds as described in the above embodiments.

[0015] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer executes the method of converting rain sounds into musical instrument sounds as described in the above embodiments.

[0016] Beneficial effects of the present application: The present application proposes a method, device, equipment and storage medium for converting rain sound into musical instrument sound. By collecting the amplitude and frequency of the rain sound signal on the outer surface of the vehicle, and taking the amplitude range of the rain sound signal within a preset time threshold as the target range, the amplitude range of the collected rain sound signal is adjusted to the target range; the amplitude of the adjusted rain sound signal is matched with a preset first mapping relationship to determine the target pitch of the rain sound signal, the preset first mapping relationship represents the mapping relationship between the amplitude interval and the pitch, and each amplitude interval is a preset number of amplitude ranges divided by the target range; the frequency of the rain sound signal is matched with a preset second mapping relationship to determine the target scale of the rain sound signal, the preset second mapping relationship represents the mapping relationship between the scale and frequency of the musical instrument, and the musical instrument is determined by the frequency range of the rain sound signal within the preset time threshold; based on the target pitch and target scale corresponding to the rain sound signal, the rain sound signal is converted into an audio signal of the musical instrument. In this way, the conversion of rain sound into musical instrument sound is achieved, and this conversion can not only provide a unique auditory experience for the driver and passengers, but also increase the fun and immersion of driving.

[0017] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0019] Figure 1 is a schematic diagram of an implementation environment of a method for converting rain sound into musical instrument sound, shown in an exemplary embodiment of the present application;

[0020] Figure 2 is a flow chart of a method for converting rain sound into musical instrument sound, shown in an exemplary embodiment of the present application;

[0021] Figure 3 is a block diagram of a device for converting rain sound into musical instrument sound, shown in an exemplary embodiment of the present application;

[0022] Figure 4 It is a structural diagram of a computer system suitable for implementing the electronic device of the present application, shown as an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0023] The following will describe the implementation methods of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, not for limiting the scope of protection of the present application.

[0024] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.

[0025] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.

[0026] See also Figure 1 , is a schematic diagram of an implementation environment of a method for converting rain sound into musical instrument sound according to an exemplary embodiment of the present application. Figure 1 As shown, the implementation environment includes a vehicle end 110 and a controller 120, wherein the controller 120 is embedded in the vehicle end 110, and is used to implement a method of converting rain sounds into musical instrument sounds. The controller 120 includes but is not limited to a vehicle computer system, a vehicle-mounted computer, a vehicle controller, etc. By converting the sound of raindrops hitting the vehicle body into musical instrument sounds, the mood of the driver and passengers is soothed, and the fun and immersion of driving are increased.

[0027] See also Figure 2 , is a flow chart of a method for converting rain sound into musical instrument sound according to an exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown in FIG. 1 is shown in FIG. 1 . It should be understood that the method may also be applicable to other exemplary implementation environments, and this embodiment does not limit the implementation environment to which the method is applicable. Figure 2 As shown, in an exemplary embodiment, the method for converting rain sound into musical instrument sound includes at least steps S210 to S240, which are described in detail as follows:

[0028] Step S210, collecting the amplitude and frequency of the rain sound signal on the outer surface of the vehicle, and taking the amplitude range of the rain sound signal within a preset time threshold as the target range, adjusting the amplitude range of the collected rain sound signal to within the target range.

[0029] Specifically, a sensor for collecting rain sound signals is arranged inside the vehicle, and the sensor is covered with sound insulation materials to avoid the influence of noise and interference when collecting rain sound, so as to ensure that a clear and accurate rain sound signal is obtained; when collecting rain sound signals, the sensor is used to condition the rain sound signals so that the amplitude of the rain sound signals is within a preset amplitude range. Among them, the frequency of the rain sound signal is the number of vibrations of the collected rain sound signal within each preset number of seconds, and the amplitude of the rain sound signal is the displacement of the collected rain sound signal within each preset number of seconds. The preset number of seconds is usually set to 500 milliseconds or 1 second, and can be adjusted according to actual needs.

[0030] In one embodiment of the present application, in order to more accurately capture the sound of raindrops hitting the vehicle body, a highly sensitive sensor is used to collect rain sound signals, such as piezoelectric sound sensors and capacitive sound sensors. The installation locations of the sensors include at least the top of the vehicle's cabin, the windows, the center of the ceiling and the windshield, and multiple sensors can be installed at each installation location to work together to collect rain sound signals more comprehensively. In addition, in order to capture the details and dynamic changes of the sound of raindrops hitting the vehicle body, the selection of the sampling rate and quantization bit number of the sensor is very important. The sampling rate determines the frequency at which the rain sound signal is digitized, that is, the number of times the sound waveform is sampled per second. The quantization bit number determines the accuracy of the digitization of the rain sound signal, that is, the range of rain sound intensity that can be represented by each sampling point. Therefore, the sampling rate is set to 44.1kHz at the lowest, and the quantization bit number is usually selected to be 16 or 24 bits to reduce the loss of the rain sound signal during the digitization process.

[0031] In one embodiment of the present application, the sensor is partially covered with sound insulation material, but not completely wrapped by the sound insulation material, so as to ensure that the sensor can reduce unnecessary noise interference and improve the signal-to-noise ratio of the rain sound signal to maintain sensitivity to the rain sound. In addition, after the sensor collects the rain sound signal, it can also use digital filter technology to further remove environmental noise, improve the purity of the rain sound signal, and make the rain sound signal easier to process and identify later.

[0032] Specifically, when raindrops fall into the area that the sensor can detect, the size of the raindrops (i.e., the amount of rain) directly affects the size of the impact sound. If the amount of rain is very small, the sound of the raindrops will be very weak, resulting in a very limited fluctuation range of the rain sound signal collected by the sensor, and it is almost difficult to distinguish different sound intensities. Therefore, if the intensity of the rain sound signal is lower than the minimum value within the preset intensity range, the sensor is adjusted to gain the rain sound signal; if the intensity of the rain sound signal is higher than the maximum value within the preset intensity range, the sensor is adjusted to attenuate the rain sound signal, and the echo cancellation algorithm is used to reduce the impact of the echo on the collection of the rain sound signal. In this way, by automatically adjusting the gain of the sensor, the collected rain sound signal can be enhanced or reduced, so that its intensity range is maintained within an appropriate range, so that it is easier to distinguish rain sounds of different sizes, and the intensity of the collected rain sound signal is easy to distinguish, which is conducive to the subsequent processing of the rain sound signal.

[0033] In one embodiment of the present application, after the sensor collects the rain sound signal, the rain sound signal is denoised according to a noise elimination algorithm to further eliminate unnecessary interference items such as environmental noise, electrical noise, such as wind noise, human voice, tire noise, etc., to make the rain sound signal clearer.

[0034] In one embodiment of the present application, in order to avoid the influence of high and low notes beyond the scale division on the subsequent rain sound conversion instrument sound, especially the super high notes will cause the generated instrument sound to have a significant sense of interruption, destroy the continuity and integrity of the instrument sound, and seriously affect the listening experience of the driver and passengers. Therefore, after the rain sound signal is denoised, the rain sound signal is compared with the preset scale range; the rain sound signal that is not within the preset scale range is used as the target rain sound signal; the frequency of the target rain sound signal is adjusted so that the frequency of the target rain sound signal is within the preset scale range; when the frequencies of the rain sound signals are all within the preset scale range, the amplitude range of the rain sound signal is adjusted.

[0035] Specifically, the collected rain sound signals are divided to obtain rain sound signals within a plurality of preset time periods; the amplitude range of the rain sound signals within each preset time period is matched with the target range; if the amplitude range of the rain sound signals within the preset time period is not within the target range, the rain sound signals within the preset time period are gradually reduced or amplified in proportion until they are adjusted to within the target range.

[0036] In one embodiment of the present application, the amount of rainfall may change over time. In order to keep the overall intensity of different rain sound signals collected in real time consistent, the amplitude range of the collected rain sound signals needs to be adjusted to ensure that no distortion occurs when the subsequent musical instrument sounds are generated, and the musical instrument sounds are more balanced. In order to avoid adjusting the amplitude only when a new rain sound signal is collected, which results in too frequent adjustments and increased workload, taking the preset time threshold and the preset time period as one minute as an example, the amplitude range of the rain sound signal collected within the first minute is used as the target range. The subsequent rain sound signals with each minute as the time period, such as the rain sound signals within the second minute and the third minute, are adjusted proportionally if their corresponding amplitude ranges are not within the target range. The proportional adjustment actually refers to proportional adjustment of the amplitudes of all rain sound signals within each preset time period.

[0037] Step S220, matching the amplitude of the rain sound signal with a preset first mapping relationship to determine the target pitch of the rain sound signal, wherein the preset first mapping relationship represents a mapping relationship between an amplitude interval and a pitch, and each amplitude interval is a preset number of amplitude ranges divided by the target range.

[0038] In one embodiment of the present application, in order to maintain the volume temperature of the generated instrument sound during the playback process and avoid the change of volume too large or too small, which may cause discomfort and sound distortion, the amplitude of all the collected rain sound signals is adjusted to fall within the target range. Therefore, the target range is divided into equal parts to obtain a preset number of amplitude intervals, and the tone corresponding to each amplitude interval is set. For example, the target range is divided into 7 amplitude intervals, and each amplitude interval corresponds to 7 tones 1 to 7 in order from low to high, namely C, D, E, F, G, A, B, or the pentatonic scale commonly used in traditional music, that is, the target range is divided into 5 amplitude intervals, wherein the preset number is determined by the type of musical instrument. In this way, by determining the amplitude interval in which the amplitude of the modulated rain sound signal is located, the tone corresponding to the rain sound signal can be determined. In practical applications, the collected rain sound signal can be divided into rain sound signals within a plurality of preset seconds, and the tone corresponding to the amplitude of the rain sound signal within each preset second is determined, for example, the amplitude of the rain sound signal within every 500 milliseconds is divided into comparisons with each amplitude interval.

[0039] Step S230, matching the frequency of the rain sound signal with a preset second mapping relationship to determine the target scale of the rain sound signal, wherein the preset second mapping relationship represents the mapping relationship between the scale and frequency of the musical instrument, and the musical instrument is determined by the frequency range of the rain sound signal within a preset time threshold.

[0040] In one embodiment of the present application, in actual applications, in order to generate the smoothness and dynamics of the sound of a musical instrument, the collected rain sound signal can be divided into rain sound signals within a plurality of preset seconds, and the musical scale matched by the frequency of the rain sound signal within each preset second is determined, for example, the frequency of the rain sound signal within every 500 milliseconds is divided into the frequency of the musical scale for matching.

[0041] Specifically, a preset first mapping table is queried according to the frequency range to determine a musical instrument, and the first mapping table includes musical instruments corresponding to each frequency range one by one; the frequency of the rain sound signal is matched with a preset second mapping relationship to determine a target scale of the rain sound signal; or, a preset second mapping table is queried according to the frequency range to determine at least two musical instruments, and the preset second mapping table includes at least two musical instruments corresponding to each frequency range; the frequency of the rain sound signal is matched with the preset second mapping relationship to determine at least two target scales of the rain sound signal.

[0042] In one embodiment of the present application, since different musical instruments may be adapted to different tonality, for example, C key is commonly used for instruments such as violin, acoustic guitar and erhu, D key is commonly used for instruments such as viola and instrumental guitar, and E key is commonly used for instruments such as guzheng and piano, and the frequency of the scale under each mode will change. Because it is necessary to determine the instrument to be converted before determining the scale corresponding to the rain signal. Therefore, the type of musical instrument is selected according to the frequency range of the rain signal within the preset time threshold, that is, the frequency range of which mode is more suitable for the frequency range, and then the instrument adapted to the mode is determined. If the frequency range of the rain signal within the preset time threshold covers multiple modes, the instrument corresponding to the mode with the most covered frequency range is matched. Among them, what instrument is adapted, the preset second mapping table is queried according to the frequency of the rain signal, and the scale of the adapted instrument is determined, that is, the scale of the adapted instrument is used as the target scale of the rain signal. If multiple instruments are adapted, the scale of each adapted instrument is used as a target scale. In this way, a better auditory experience can be brought to the user.

[0043] In one embodiment of the present application, the rain sound signal can be converted into the sounds of multiple musical instruments, that is, a mapping relationship between different frequency ranges and multiple musical instrument combinations is constructed to generate a second mapping table for rain sounds to further enhance the user's auditory experience.

[0044] In another embodiment of the present application, the musical instrument can also be determined by a control instruction from the user. If a control instruction is received from the user regarding the type of musical instrument carried, the musical instrument is determined according to the control instruction, that is, if the type of musical instrument carried by the control instruction is a guitar, the converted musical instrument sound is determined to be the sound of a guitar. Furthermore, the mapping relationship between the frequency range represented by the first mapping table or the second mapping table and the musical instrument can be adjusted according to the control instruction from the user or the acquired user habit information, which includes the musical instrument corresponding to the historical frequency range set by the user. In this way, the musical instrument sound converted from the rain sound is more in line with the user's preferences, bringing a personalized auditory experience to the driver and passengers.

[0045] Specifically, the musical instrument can also be dynamically adjusted according to the change of the frequency range of the rain sound signal; if the frequency range of the rain sound signal changes within adjacent preset intervals, the frequency range of the rain sound signal within the subsequent preset interval will be input into the preset first mapping table, or the preset second mapping table, to replace the musical instrument.

[0046] In one embodiment of the present application, in order to make the instrument sound converted from rain sound more interesting, it is determined whether to change the instrument at every preset interval; for example, if the instruments corresponding to the frequency ranges of the rain sound signal in the first minute and the rain sound signal in the second minute are different, the instrument is changed. In addition, in order to ensure that the transition between two adjacent sections of different instrument sounds is smooth and natural after the root wind instrument, transition sound processing such as glissando and legato can be added between different instrument sounds to avoid abruptness or incoordination.

[0047] It should be noted that the execution order of the above step S220 and step S230 is not limited.

[0048] Step S240: converting the rain sound signal into an audio signal of a musical instrument based on the pitch and scale matched with the rain sound signal.

[0049] In one embodiment of the present application, the audio signal of the musical instrument is converted into an analog audio signal and can be output using devices such as speakers in the car, so that the driver and passengers can enjoy the sound of the musical instrument converted from the sound of rain, which soothes the mood of the driver and passengers and increases the fun and immersion of driving.

[0050] See also Figure 3 , is a block diagram of a device for converting rain sound into musical instrument sound according to an exemplary embodiment of the present application. The device can be applied to Figure 1 It should be understood that the present application does not limit the implementation environment of the device. Figure 3 As shown, in an exemplary embodiment, the apparatus for converting rain sound into musical instrument sound comprises at least an acquisition module 310, a tone determination module 320, a scale determination module 330 and a conversion model 340, which are described in detail as follows:

[0051] The acquisition module 310 is used to collect the amplitude and frequency of the rain sound signal on the outer surface of the vehicle, and adjust the amplitude range of the collected rain sound signal to within the target range by taking the amplitude range of the rain sound signal within a preset time threshold as the target range;

[0052] A tone determination module 320 is used to match the amplitude of the rain sound signal with a preset first mapping relationship to determine a target tone of the rain sound signal, wherein the preset first mapping relationship represents a mapping relationship between an amplitude interval and a tone, and each amplitude interval is a preset number of amplitude ranges divided by the target range;

[0053] a musical scale determination module 330, configured to match the frequency of the rain sound signal with a preset second mapping relationship to determine a target musical scale of the rain sound signal, wherein the preset second mapping relationship represents a mapping relationship between the musical scale and the frequency of the musical instrument, and the musical instrument is determined by the frequency range of the rain sound signal within a preset time threshold;

[0054] The conversion module 340 is used to convert the rain sound signal into an audio signal of a musical instrument based on the target pitch and the target scale of the rain sound signal.

[0055] It should be noted that the device for converting rain sounds into musical instrument sounds provided in the above embodiment and the method for converting rain sounds into musical instrument sounds provided in the above embodiment belong to the same concept, and the contents of the operations performed by each module have been described in detail in the method embodiment and will not be repeated here.

[0056] The present application also provides an electronic device, including: a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the method of converting rain sounds into musical instrument sounds as in the above embodiment.

[0057] See also Figure 4 , shows a schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application. It should be noted that, Figure 4 The computer system 400 of the electronic device shown is only an example and should not bring any limitation to the functions and application scope of the embodiments of the present application.

[0058] like Figure 4 As shown, the computer system 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 402 or the program loaded from the storage part 407 to the random access memory (RAM) 403, such as executing the method in the above embodiment. In the RAM 403, various programs and data required for system operation are also stored. The CPU 401, the ROM 402 and the RAM 403 are connected to each other through the bus 404. The input / output (I / O) interface 405 is also connected to the bus 404.

[0059] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 408 including a hard disk, etc.; and a communication section 404 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 409 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed so that a computer program read therefrom is installed into the storage section 408 as needed.

[0060] 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 computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 409, and / or installed from the removable medium 411. When the computer program is executed by the central processing unit (CPU) 401, various functions defined in the system of the present application are executed. It should be noted that the method of converting the sound of rain into the sound of an instrument and the device for converting the sound of rain into the sound of an instrument have been described in detail in the above-mentioned method embodiment, and will not be repeated here.

[0061] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the method of converting rain sound into musical instrument sound as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0062] It should be noted that the computer-readable medium shown in the embodiment of 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, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, system or device, 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), a 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. 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, wherein a computer-readable computer program is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, 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 conjunction with an instruction execution system, system or device. A computer program contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0063] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned 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 or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0064] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0065] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A method for converting rain sound into musical instrument sound, characterized in that: include: The amplitude and frequency of the rain sound signal on the outer surface of the vehicle are collected, and the amplitude range of the rain sound signal within a preset time threshold is taken as a target range, and the amplitude range of the collected rain sound signal is adjusted to within the target range; Matching the amplitude of the rain sound signal with a preset first mapping relationship to determine a target pitch of the rain sound signal, wherein the preset first mapping relationship represents a mapping relationship between an amplitude interval and a pitch, and each of the amplitude intervals is a preset number of amplitude ranges into which the target range is divided; Matching the frequency of the rain sound signal with a preset second mapping relationship to determine a target scale of the rain sound signal, wherein the preset second mapping relationship represents a mapping relationship between a scale and a frequency of a musical instrument, and the musical instrument is determined by a frequency range of the rain sound signal within the preset time threshold; The rain sound signal is converted into an audio signal of the musical instrument based on the target pitch and the target scale corresponding to the rain sound signal.

2. The method of converting rain sound into musical instrument sound according to claim 1, characterized in that: Before adjusting the amplitude range of the collected rain sound signal to within the target range, the method further includes: After denoising the rain sound signal, comparing the rain sound signal with a preset scale range; Taking the rain sound signal that is not within the preset scale range as the target rain sound signal; Adjusting the frequency of the target rain sound signal so that the frequency of the target rain sound signal is within the preset scale range; When the frequencies of the rain sound signals are all within the preset scale range, the amplitude range of the rain sound signals is adjusted.

3. The method of converting rain sound into musical instrument sound according to claim 1, characterized in that: The step of adjusting the amplitude range of the collected rain sound signal to within the target range includes: Dividing the collected rain sound signal to obtain the rain sound signal in a plurality of preset time periods; Matching the amplitude range of the rain sound signal within each preset time period with the target range; If the amplitude range of the rain sound signal within the preset time period is not within the target range, the rain sound signal within the preset time period is gradually reduced or amplified in proportion until it is adjusted to be within the target range.

4. The method of converting rain sound into musical instrument sound according to claim 1, characterized in that: The matching the frequency of the rain sound signal with a preset second mapping relationship to determine a target scale of the rain sound signal includes: According to the frequency range, a preset first mapping table is searched to determine a musical instrument, wherein the first mapping table includes the musical instruments corresponding to each frequency range one by one; Matching the frequency of the rain sound signal with the preset second mapping relationship to determine a target scale of the rain sound signal; or, Querying a preset second mapping table according to the frequency range to determine at least two of the musical instruments, wherein the preset second mapping table includes at least two musical instruments corresponding to each of the frequency ranges; The frequency of the rain sound signal is matched with the preset second mapping relationship to determine at least two target scales of the rain sound signal.

5. The method of converting rain sound into musical instrument sound according to claim 4, characterized in that: After determining the target scale of the rain sound signal, the method further includes: dynamically adjusting the musical instrument according to changes in the frequency range of the rain sound signal; Among them, if the frequency range of the rain sound signal changes within adjacent preset intervals, the frequency range of the rain sound signal within the preset interval with a collection time later is input into the preset first mapping table, or the preset second mapping table, to replace the musical instrument.

6. The method of converting rain sound into musical instrument sound according to any one of claims 1 to 5, characterized in that: Collect rain sound signals from the vehicle's exterior surface, including: A sensor for collecting the rain sound signal is arranged inside the vehicle, and the sensor is covered with sound insulation material; When collecting the rain sound signal, the sensor is used to condition the rain sound signal so that the intensity of the rain sound signal is within a preset intensity range.

7. The method of converting rain sound into musical instrument sound according to claim 6, characterized in that: The step of conditioning the rain sound signal by using the sensor includes: If the intensity of the rain sound signal is lower than the minimum value within the preset intensity range, amplifying the rain sound signal; If the intensity of the rain sound signal is higher than the maximum value within the preset intensity range, the rain sound signal is attenuated.

8. A device for converting rain sound into musical instrument sound, characterized in that: include: An acquisition module is used to collect the amplitude and frequency of the rain sound signal on the outer surface of the vehicle, and take the amplitude range of the rain sound signal within a preset time threshold as a target range, and adjust the amplitude range of the collected rain sound signal to within the target range; a tone determination module, configured to match the amplitude of the rain sound signal with a preset first mapping relationship to determine a target tone of the rain sound signal, wherein the preset first mapping relationship represents a mapping relationship between an amplitude interval and a tone, and each of the amplitude intervals is a preset number of amplitude ranges into which the target range is divided; a musical scale determination module, configured to match the frequency of the rain sound signal with a preset second mapping relationship to determine a target musical scale of the rain sound signal, wherein the preset second mapping relationship represents a mapping relationship between the musical scale and the frequency of a musical instrument, and the musical instrument is determined by the frequency range of the rain sound signal within the preset time threshold; A conversion module is used to convert the rain sound signal into an audio signal of the musical instrument based on the target pitch and the target scale of the rain sound signal.

9. An electronic device, characterized in that: include: processor, memory, and communications bus; The communication bus is used to connect the processor and the memory; The processor is configured to execute the computer program stored in the memory to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is used to make a computer execute the method according to any one of claims 1 to 7.