CN108847204B - Music box and method for manufacturing sound tape of music box - Google Patents

Music box and method for manufacturing sound tape of music box Download PDF

Info

Publication number
CN108847204B
CN108847204B CN201810427687.5A CN201810427687A CN108847204B CN 108847204 B CN108847204 B CN 108847204B CN 201810427687 A CN201810427687 A CN 201810427687A CN 108847204 B CN108847204 B CN 108847204B
Authority
CN
China
Prior art keywords
sound
point
image
grid
color
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.)
Active
Application number
CN201810427687.5A
Other languages
Chinese (zh)
Other versions
CN108847204A (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.)
Guangdong Matview Intelligent Science & Technology Co ltd
Original Assignee
Guangdong Matview Intelligent Science & Technology 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 Guangdong Matview Intelligent Science & Technology Co ltd filed Critical Guangdong Matview Intelligent Science & Technology Co ltd
Priority to CN201810427687.5A priority Critical patent/CN108847204B/en
Publication of CN108847204A publication Critical patent/CN108847204A/en
Application granted granted Critical
Publication of CN108847204B publication Critical patent/CN108847204B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10FAUTOMATIC MUSICAL INSTRUMENTS
    • G10F5/00Details or accessories
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10FAUTOMATIC MUSICAL INSTRUMENTS
    • G10F1/00Automatic musical instruments
    • G10F1/06Musical boxes with plucked teeth, blades, or the like

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Auxiliary Devices For Music (AREA)

Abstract

The invention provides a music box and a method for manufacturing a sound band of the music box, wherein the method for manufacturing the sound band of the music box comprises the following steps: acquiring an HSB value of each pixel point in a target image, and performing color clustering processing on each pixel point of the target image according to the HSB value to obtain a color clustering image corresponding to the target image; normalizing the color blocks in the color clustering image to obtain a phonation point image corresponding to the target image; mapping the sound points in the sound point image to a preset line spectrogram to generate a sound point punching position graph; and controlling the punching equipment to punch holes at corresponding positions of the sound band according to the punching positions in the sound-producing point punching position diagram. By the method for manufacturing the sound band of the music box, the image can be converted into a section of specific melody, automatic music composition on the sound band by adopting the image is realized, the customization requirement of a user on music of the music box is met, and meanwhile, the punching error is reduced.

Description

Music box and method for manufacturing sound tape of music box
Technical Field
The invention relates to the technical field of music box manufacturing, in particular to a music box and a method for manufacturing a sound tape of the music box.
Background
The Music Box is also called Music Box (Music Box), which is a mechanical Musical instrument, and Music can be automatically played by rotating a chain ring in the Music Box. At present, the existing music boxes are mainly divided into two types, one is a sound tube type music box; one is a sound band type music box; the sound tube type music box rotates endlessly and circularly in the music box through the sound tube, so that the sound board is shifted to generate music, and therefore, the sound tube type music box can only generate a specific piece of music, and the music is played singly; the sound band type music box adopts the sound band to be inserted into the movement of the music box, the movement is adopted to read the sound band to generate music, the sound band and the music box are mutually independent, the music box can generate different music by replacing different sound bands, and the music playing function is rich. However, the prior sound band can only be used for manufacturing hollow sounding points on the sound band in a manual punching mode, and punching errors exist; secondly, the existing products only can punch holes on the sound tape according to music configured in the music box, the sound tape making of self-made music cannot be provided, the music for making the sound tape is single, and the customization requirements of users on the music of the music box cannot be met.
Disclosure of Invention
The invention aims to provide a music box and a sound band manufacturing method thereof, which can convert images into a section of specific melody, realize automatic composition on the sound band by adopting the images, meet the customization requirements of users on music of the music box and reduce punching errors.
The embodiment of the invention provides a method for manufacturing a sound tape of a music box, which comprises the following steps:
acquiring an HSB value of each pixel point in a target image, and performing color clustering processing on each pixel point of the target image according to the HSB value to obtain a color clustering image corresponding to the target image;
normalizing the color blocks in the color clustering image to obtain a phonation point image corresponding to the target image;
mapping the sound points in the sound point image to a preset line spectrogram to generate a sound point punching position graph;
and controlling the punching equipment to punch holes at corresponding positions of the sound band according to the punching positions in the sound-producing point punching position diagram.
Preferably, the mapping the sound points in the sound point image to a preset spectrogram to generate a sound point punching position map specifically includes:
mapping the pronunciation point image to a pre-established grid, and establishing a mapping relation between each pronunciation point in the pronunciation point image and each scale in the grid; each row of the grid corresponds to a scale, and each column of the grid corresponds to a time point;
extracting a scale corresponding to the pronunciation point in the pronunciation point image along the set direction of the grid according to the mapping relation, and generating a melody corresponding to the target image;
and mapping the sound points of the sound point images corresponding to the melodies into a preset line spectrogram, and generating the sound point punching position diagram.
Preferably, the extracting, according to the mapping relationship, a scale corresponding to a pronunciation point in the pronunciation point image along a set direction of the mesh to generate a melody corresponding to the target image further includes:
adjusting scales corresponding to each row of the grid, reestablishing the mapping relation between each pronunciation point in the pronunciation point image and each scale in the grid, and regenerating the melody corresponding to the target image to obtain N melodies corresponding to the target image;
respectively converting the N melodies corresponding to the target image into oscillograms to obtain N oscillograms in total;
respectively calculating the similarity between any one oscillogram and a plurality of template oscillograms pre-stored in an oscillogram template database, and extracting the maximum value of the similarity of any one oscillogram relative to the plurality of template oscillograms as a reference value of any one oscillogram;
extracting a waveform diagram corresponding to a maximum reference value from the N waveform diagrams;
extracting the melody corresponding to the waveform diagram corresponding to the maximum reference value as the target melody of the target image;
the step of mapping the sounding point of the sounding point image corresponding to the melody to a preset spectrogram to generate the sounding point punching position map specifically includes:
and mapping the sound producing points of the sound producing point image corresponding to the target melody to a preset line spectrogram, and generating the sound producing point punching position diagram.
Preferably, the normalizing the color patches in the color cluster image to obtain the phonation point image corresponding to the target image specifically includes:
acquiring a color block with the minimum area in the color clustering image, and setting the color block with the minimum area as a sound producing point;
adjusting other color blocks in the color clustering images to be integral multiples of the phonation points;
and generating the phonation point image according to the phonation points corresponding to the color blocks in the color clustering image.
Preferably, the mapping the pronunciation point image to a pre-established grid and establishing a mapping relationship between each pronunciation point in the pronunciation point image and each scale in the grid specifically include:
setting the area of the square grid and establishing the grid according to the area of the phonation point and a preset proportion;
mapping each sound point in the sound point image to the grid;
when the phonation points are distributed on the grid lines of the grid, respectively calculating the area occupation ratio of the phonation points in the adjacent grids connected with the grid lines, and distributing the phonation points to one grid with the larger area occupation ratio of the phonation points in the adjacent grids;
and establishing a mapping relation between each pronunciation point in the pronunciation point image and each scale in the grid according to the position of each pronunciation point in the pronunciation point image in the grid and the scale corresponding to each row in the grid.
Preferably, the extracting, according to the mapping relationship, a scale corresponding to the pronunciation point in the pronunciation point image along a set direction of the mesh to generate the melody corresponding to the target image specifically includes:
the set direction is a time axis direction formed by time points corresponding to each row of the grid;
extracting a scale corresponding to the pronunciation point in the pronunciation point image according to the mapping relation and the time axis direction corresponding to the grids;
when a plurality of sound producing points are positioned in any row of adjacent grids in the grid, the sound producing points are adjusted to be long tones of the scale corresponding to the any row;
extracting time points corresponding to the sound points in the sound point images according to the time axis direction;
and generating the melody corresponding to the target image according to the scale and the time point corresponding to the sound point in the sound point image.
Preferably, the obtaining of the HSB value of each pixel point in the target image and the color clustering processing of each pixel point of the target image according to the HSB value to obtain the color clustering image corresponding to the target image specifically include:
acquiring an HSB value of each pixel point in a target image;
according to the HSB value of each pixel point in the target image, acquiring the pixel points of which the hue distance exceeds a first threshold value in the target image, and acquiring a plurality of color mutation areas;
calculating the average hue value of adjacent pixel points of which the difference value of the HSB values in the color mutation area is smaller than a second threshold value, and aggregating the adjacent pixel points into color blocks corresponding to the average hue value;
and when the hue distance of the adjacent pixel points in the color mutation area is zero, generating the color clustering image according to the polymerized color block.
Preferably, the method for manufacturing the soundtrack of the music box further comprises:
collecting template melody;
and converting the template melody into a template oscillogram and storing the oscillogram in the oscillogram template database.
Preferably, the controlling the punching device to punch holes at the corresponding positions of the soundtrack according to the punching positions in the sound-emitting point punching position diagram specifically includes:
establishing a coordinate system on the sound-emitting point punching position diagram by taking the current position of the punching equipment as an origin, and acquiring coordinates of the punching position of the sound-emitting point punching position diagram on the coordinate system;
respectively calculating displacement vectors of two adjacent punching positions according to the coordinates of the punching positions by taking the original point of the coordinate system as an initial punching position; wherein the initial punch location does not punch;
and the punching equipment controls a laser puncher clamped on the mechanical arm to move on the sound band according to the displacement vector through the mechanical arm and punches holes at the end point position corresponding to the displacement vector.
An embodiment of the present invention further provides a music box, including: the music box comprises a shell, a core and a sound band manufactured by adopting the sound band manufacturing method of the music box, wherein the shell is provided with a through hole, a sound band inlet and a sound band outlet, and the core comprises a core main body, a hole reading assembly, a sound tooth, a sound board and a rocker assembly, wherein the hole reading assembly, the sound tooth, the sound board and the rocker assembly are arranged on the core main body; the movement main body is arranged inside the shell; the sound band is movably arranged on the movement main body through the sound band inlet; the rocker component is connected with the machine core main body through the through hole; the machine core main body is driven by the rocker to drive the sound band to move along the sound band outlet direction and drive the hole reading assembly to rotate so as to detect the hollow point of the sound band, and the machine core main body is used for controlling the sound teeth to stir the sound board when the hollow point of the sound band is detected.
Compared with the prior art, the method for manufacturing the sound band of the music box provided by the embodiment of the invention has the beneficial effects that: the method for manufacturing the sound band of the music box comprises the following steps: acquiring an HSB value of each pixel point in a target image, and performing color clustering processing on each pixel point of the target image according to the HSB value to obtain a color clustering image corresponding to the target image; normalizing the color blocks in the color clustering image to obtain a phonation point image corresponding to the target image; mapping the sound points in the sound point image to a preset line spectrogram to generate a sound point punching position graph; and controlling the punching equipment to punch holes at corresponding positions of the sound band according to the punching positions in the sound-producing point punching position diagram. By the method for manufacturing the sound band of the music box, the image can be converted into a section of specific melody, automatic music composition on the sound band by adopting the image is realized, the customization requirement of a user on music of the music box is met, and meanwhile, the punching error is reduced.
Drawings
Fig. 1 is a flowchart of a method for producing a soundtrack of a music box according to an embodiment of the present invention;
fig. 2 is a diagram of a sounding point punching position according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1 and fig. 2, fig. 1 is a flowchart of a method for manufacturing a soundtrack of a music box according to an embodiment of the present invention, and fig. 2 is a diagram of a punching position of a sound-emitting point according to the embodiment of the present invention; the method for manufacturing the sound band of the music box comprises the following steps:
s100: acquiring an HSB value of each pixel point in a target image, and performing color clustering processing on each pixel point of the target image according to the HSB value to obtain a color clustering image corresponding to the target image;
s200: normalizing the color blocks in the color clustering image to obtain a phonation point image corresponding to the target image;
s300: mapping the sound points in the sound point image to a preset line spectrogram to generate a sound point punching position graph;
s400: and controlling the punching equipment to punch holes at corresponding positions of the sound band according to the punching positions in the sound-producing point punching position diagram.
In the embodiment, after color clustering and normalization processing are performed on a target image through a music composing system, a sound-emitting point image is obtained, the sound-emitting point image is mapped into a preset line spectrogram, a sound-emitting point punching position diagram is generated, punching is performed on a corresponding position of a music tape according to a punching position in the sound-emitting point punching position diagram by adopting punching equipment, punching errors are reduced, the target image can be converted into a specific melody, automatic music composing on the music tape by adopting the target image is realized, and the customization requirement of a user on music of a music box is met; the invention can automatically create music melody according to different images, select the melody close to the mass aesthetic sense through machine analysis, solve the complexity of music creation, reduce the learning threshold of composing melody, quickly create a large amount of music melody, automatically complete sound band punching and be applied to music box playing. The method has wide application prospect in the field of music boxes.
In an alternative embodiment, S300: mapping the sound points in the sound point image to a preset spectrogram, and generating a sound point punching position map, which specifically comprises:
mapping the pronunciation point image to a pre-established grid, and establishing a mapping relation between each pronunciation point in the pronunciation point image and each scale in the grid; each row of the grid corresponds to a scale, and each column of the grid corresponds to a time point;
extracting a scale corresponding to the pronunciation point in the pronunciation point image along the set direction of the grid according to the mapping relation, and generating a melody corresponding to the target image;
and mapping the sound points of the sound point images corresponding to the melodies into a preset line spectrogram, and generating the sound point punching position diagram.
In this embodiment, the music composition system maps the obtained sounding point image into a preset grid after color clustering and normalization processing of the target image, establishes a mapping relationship between the sounding point and the scale, converts the target image into a specific music melody according to the time axis direction of the grid through the mapping relationship, provides the created melody for trial listening confirmation of the user, sends the sounding point punching position diagram corresponding to the melody confirmed by the user to punching equipment, and simultaneously the user can also select to download and store the created melody; the music composing system can simplify the process of making the music melody by establishing the grids, greatly reduce the time length and the cost of making the music melody and simultaneously reduce the difficulty of making the music.
In an optional embodiment, the extracting, according to the mapping relationship, a scale corresponding to a pronunciation point in the pronunciation point image along a set direction of the mesh to generate a melody corresponding to the target image further includes:
adjusting scales corresponding to each row of the grid, reestablishing the mapping relation between each pronunciation point in the pronunciation point image and each scale in the grid, and regenerating the melody corresponding to the target image to obtain N melodies corresponding to the target image;
respectively converting the N melodies corresponding to the target image into oscillograms to obtain N oscillograms in total;
respectively calculating the similarity between any one oscillogram and a plurality of template oscillograms pre-stored in an oscillogram template database, and extracting the maximum value of the similarity of any one oscillogram relative to the plurality of template oscillograms as a reference value of any one oscillogram;
extracting a waveform diagram corresponding to a maximum reference value from the N waveform diagrams;
extracting the melody corresponding to the waveform diagram corresponding to the maximum reference value as the target melody of the target image;
the step of mapping the sounding point of the sounding point image corresponding to the melody to a preset spectrogram to generate the sounding point punching position map specifically includes:
and mapping the sound producing points of the sound producing point image corresponding to the target melody to a preset line spectrogram, and generating the sound producing point punching position diagram.
In this embodiment, the music composition system may further adjust the scale corresponding to each row of the grid, reestablish the mapping relationship between each pronunciation point in the pronunciation point image and each scale in the grid, and regenerate the melody corresponding to the target image, so that a plurality of melodies are generated according to the grid. Each music style has a unique scale combination, and the melody created according to the scales in the unique scale combinations can have the characteristics of the national music, so that the scales of each row in the grid are set according to the creation style, and the created melody has a specific music style. For example, the chinese five-tone scale contains the following tones: 123561, respectively; japanese six-tone scale, contains the following tones: 6712346, respectively; romania minor scale, comprising the following tones: 671#234# 56. By changing the scale combination of each row in the grid, different styles of music melodies can be created. Therefore, N melodies corresponding to the target image can be obtained, then the N melodies are converted into oscillograms and are matched with a plurality of template oscillograms, the maximum value of the similarity of each oscillogram relative to the plurality of template oscillograms is extracted and is used as a reference value of each oscillogram, and then each oscillogram corresponds to one reference value; the melody corresponding to the oscillogram corresponding to the maximum reference value is obtained by comparing the reference value of each oscillogram and is used as the target melody of the target image, and the N generated melodies can be effectively screened by the method, so that the melody closest to the existing music melody creation style is obtained, and the melody creation quality is improved.
Further, in order to improve the quality of melody creation, the method for making the soundtrack of the music box further comprises:
collecting cover images corresponding to musical compositions of a plurality of playing musical instruments;
extracting HSB values of all pixel points in any one cover image, and carrying out color clustering processing on all pixel points of any one cover image according to the HSB values to obtain a template color clustering image corresponding to any one cover image, and obtaining N template color clustering images in total;
calculating the area ratio of each color patch in the template color clustering image, and obtaining the corresponding dominant hue and dominant hue area ratio of the template color clustering image as the color distribution of the template color clustering image;
carrying out statistical analysis on the color distribution of the N template color cluster images and the playing musical instruments corresponding to the template color cluster images, establishing a mapping relation between the color distribution of the template color cluster images and the playing musical instruments corresponding to the template color cluster images, and generating the tonal musical instrument comparison table;
extracting the dominant hue of the target image according to the color clustering image;
determining the type of the playing musical instrument according to the main tone of the target image and a preset tone musical instrument comparison table;
and extracting the scale corresponding to the pronunciation point in the pronunciation point image along the set direction of the grid according to the mapping relation, converting the scale corresponding to the pronunciation point in the pronunciation point image into audio by adopting the virtual instrument corresponding to the type of the played instrument, and generating the melody corresponding to the target image.
Specifically, the determining the type of the playing instrument according to the dominant hue of the target image and a preset hue instrument comparison table specifically includes:
calculating the area ratio of each color patch in the color clustering image corresponding to the target image to obtain the dominant hue area ratio corresponding to the dominant hue of the target image;
comparing the keytone and the keytone area ratio of the target image with a plurality of color distribution ratios in the tone instrument comparison table, and determining the playing instrument corresponding to the color distribution with the smallest difference between the keytone and the keytone area ratio of the target image in the tone instrument comparison table as the type of the playing instrument corresponding to the keytone in the color cluster image;
and determining the volume ratio of the musical instruments corresponding to the color blocks in the color cluster image according to the dominant hue of the target image and the dominant hue area ratio.
In this embodiment, a clustering algorithm is used to perform color clustering on the color clustering image, specifically, the dominant hue is partitioned, the neighboring points with near HSB color difference are continuously averaged and aggregated into the same color block, and the target image is processed into color block combinations of various dominant hues, such as triangle, circle, rectangle, and other graphic combinations, to obtain color block combinations of the dominant hue of the target image. And extracting the color value of each color block, namely the dominant hue of the target image, and respectively calculating the area ratio of each color block in the target image. Further, the area ratio of the color blocks in the color cluster image is larger than a set threshold value, and the color blocks are determined as the main tone of the target image.
Similarly, for a large number of collected cover images corresponding to musical compositions (such as CD, DVD, digital sound source and other musical compositions) of playing instruments, extracting HSB values of the cover images, continuously performing average aggregation on points with adjacent HSB values in the cover images, performing color clustering on the collected cover images respectively, processing the cover images into different color block combination areas, extracting color values of the color blocks and calculating the area ratio of the color blocks in the cover images to obtain the dominant hue and the area ratio of the cover images. Through statistical rule analysis, the rule of the dominant hue and area ratio of different playing instruments and the cover image is obtained, and a large amount of statistical data of the dominant hue and the area ratio of each dominant hue of the corresponding cover image of the playing instruments, namely the color distribution of the cover image, are obtained.
Because the color distribution condition of each picture is different, some expressions have more contents and richer color distribution, some expressions have less contents and more single color distribution, a threshold value is set to determine the number of the dominant colors of the target image, and the playing musical instruments are determined to be used singly or in combination according to the area ratio of the dominant colors. Comparing the obtained dominant hue and dominant hue area of the target image, comparing the data of the corresponding relation between various playing instruments and color distribution which are counted in advance and stored in the server, namely the tonal instrument comparison table, finding out the playing instrument corresponding to the color distribution closest to the dominant hue combination of the target image, and obtaining the playing instrument combination mode of the melody to be generated. For example, the target image includes M dominant colors, and based on the M dominant colors and the dominant color area ratios corresponding to the M dominant colors, corresponding M musical instruments can be determined and used to combine and generate the melody.
For example, when the area ratio of a certain color patch in the target image reaches 80% or more, a single musical instrument is used for playing. For another example, when the ratio of the dominant hue to the dominant hue distribution corresponding to the target image is: the mapping relation between various playing instruments and color distribution can be known according to the tone instrument comparison table, so that the playing instrument types corresponding to all the keytones in the target image are obtained, at the moment, the playing instruments corresponding to 40%, 30%, 20% and 10% keytones are simultaneously used for carrying out ensemble on the scales marked in the grid, and the corresponding volume is also distributed according to the proportion of the keytone area.
In an alternative embodiment, S200: normalizing the color patches in the color clustering image to obtain a phonation point image corresponding to the target image, which specifically comprises:
acquiring a color block with the minimum area in the color clustering image, and setting the color block with the minimum area as a sound producing point;
adjusting other color blocks in the color clustering images to be integral multiples of the phonation points;
and generating the phonation point image according to the phonation points corresponding to the color blocks in the color clustering image.
In an optional embodiment, the mapping the pronunciation point image to a pre-established grid, and establishing a mapping relationship between each pronunciation point in the pronunciation point image and each scale in the grid specifically includes:
setting the area of the square grid and establishing the grid according to the area of the phonation point and a preset proportion; each row of the grid corresponds to a scale, and each column of the grid corresponds to a time point;
mapping each sound point in the sound point image to the grid;
when the phonation points are distributed on the grid lines of the grid, respectively calculating the area occupation ratio of the phonation points in the adjacent grids connected with the grid lines, and distributing the phonation points to one grid with the larger area occupation ratio of the phonation points in the adjacent grids;
and establishing a mapping relation between each pronunciation point in the pronunciation point image and each scale in the grid according to the position of each pronunciation point in the pronunciation point image in the grid and the scale corresponding to each row in the grid.
In an optional embodiment, the extracting, according to the mapping relationship and along a set direction of the mesh, a scale corresponding to a pronunciation point in the pronunciation point image to generate a melody corresponding to the target image specifically includes:
the set direction is a time axis direction formed by time points corresponding to each row of the grid;
extracting a scale corresponding to the pronunciation point in the pronunciation point image according to the mapping relation and the time axis direction corresponding to the grids;
when a plurality of sound producing points are positioned in any row of adjacent grids in the grid, the sound producing points are adjusted to be long tones of the scale corresponding to the any row;
extracting time points corresponding to the sound points in the sound point images according to the time axis direction;
and generating the melody corresponding to the target image according to the scale and the time point corresponding to the sound point in the sound point image.
In an alternative embodiment, S100: the method comprises the steps of obtaining an HSB value of each pixel point in a target image, carrying out color clustering processing on each pixel point of the target image according to the HSB value, and obtaining a color clustering image corresponding to the target image, wherein the method specifically comprises the following steps:
acquiring an HSB value of each pixel point in a target image;
according to the HSB value of each pixel point in the target image, acquiring the pixel points of which the hue distance exceeds a first threshold value in the target image, and acquiring a plurality of color mutation areas;
calculating the average hue value of adjacent pixel points of which the difference value of the HSB values in the color mutation area is smaller than a second threshold value, and aggregating the adjacent pixel points into color blocks corresponding to the average hue value;
and when the hue distance of the adjacent pixel points in the color mutation area is zero, generating the color clustering image according to the polymerized color block.
In this embodiment, the range of the first threshold is 60 degrees to 130 degrees, and preferably, the first threshold is 60 degrees. The second threshold is 15 degrees. For example, when the hue distance between two pixel points in the target image exceeds 60 degrees, the color abrupt change region is determined. After the color mutation area is found out, adjacent pixel points in the target image are continuously analyzed, and the adjacent pixel points with the close HSB values are averaged and aggregated into a color block, for example, the HSB values of the adjacent pixel point A, B are respectively: the HSB values of the points A are H42 degrees, S43 degrees and B21 degrees, the HSB values of the points B are H38 degrees, S42 degrees and B25 degrees, the H values of the points A and B are A42 degrees and B38 degrees, the hue distance is within 15 degrees, the average values of the hue values of the points A and B are converged into a color block with a hue value of H40 degrees, different HSB values of adjacent points are repeatedly selected to analyze and calculate the hue average value until the hue average values of the adjacent points with the HSB values close to color difference are converged, finally, the target image is processed into a plurality of different color blocks, and the color cluster image is generated.
In an optional embodiment, the method for producing a soundtrack for a music box further comprises:
collecting template melody;
and converting the template melody into a template oscillogram and storing the oscillogram in the oscillogram template database.
In an optional embodiment, the controlling the punching device to punch holes at corresponding positions of the soundtrack according to the punching positions in the sound-emitting point punching position diagram specifically includes:
establishing a coordinate system on the sound-emitting point punching position diagram by taking the current position of the punching equipment as an origin, and acquiring coordinates of the punching position of the sound-emitting point punching position diagram on the coordinate system;
respectively calculating displacement vectors of two adjacent punching positions according to the coordinates of the punching positions by taking the original point of the coordinate system as an initial punching position; wherein the initial punch location does not punch;
and the punching equipment controls a laser puncher clamped on the mechanical arm to move on the sound band according to the displacement vector through the mechanical arm and punches holes at the end point position corresponding to the displacement vector.
In this embodiment, taking 15-tone soundtrack as an example, the soundtrack specification and the hole punching limit: the length of the sound band can be set according to the melody duration, the width of the sound band is set to 44 millimeters according to the width of the 15-tone movement, the thickness of the sound band is 0.3 millimeter, 50 beats or 100 half beats are provided in the range, the sound band is transversely provided with a pitch, the pitch is gradually increased from left to right, the beat is longitudinally provided, two solid lines are provided with one beat, and the solid lines are provided with half beats to adjacent dotted lines. The movement of the 15-tone sound band has 15 scales which are sequentially corresponding to the middle tone 1-time high tone 1 of the numbered musical notation from bottom to top. The phonation point punching holes are punched at the intersection of the horizontal line and the vertical line of the line spectrogram, as shown in figure 2, several points bdefghij sequentially correspond to the phonation point punching holes of the middle tone 1 to the high tone 1 of the numbered musical notation; because a movement of a 15-tone sound band reads out notes (punched sound points on the sound band) through the rotation of a thin shaft with 15 hole reading needles and shifts a sound board to sound by using sound teeth (the movement of the sound band is the same as that of the 15-tone movement), in one circle of the rotation of the thin shaft, if the sound at a certain pitch appears more than once (corresponding to adjacent and very close two sounds such as 1 and 1 of a numbered musical notation, and corresponding to adjacent holes with C sound on a solid line and a dotted line on the sound band), after the first sound appears, the same sound at the back can be ignored and cannot be read out, namely, the sound and the movement of the sound band with the same pitch in adjacent 1/4 beats can not be read out, and the limitation of fast-rhythm semitones of adjacent 1/4 beats exists, and the sound points can not continuously appear on two adjacent crossed lines of the same sound (the same row); as shown in fig. 2, if 1 appears once at point b, the next pronunciation point must be at point c to pronounce normally, but cannot appear at point h.
And the pronunciation point represented by each sub-grid in the grid corresponds to a transverse and vertical line crossing pronunciation point of a line spectrogram of the vocal cords, and the pronunciation points in the score grid are converted into pronunciation points of the vocal cords according to the corresponding relation to generate punching position information and a vocal cord pronunciation point punching image. When more than 2 sound points (long tones) continuously appear in the grid for one tone, only one sound point appears on the sound band, and the pause is enough for a corresponding number of cross points (beat duration).
The punching principle of the punching equipment is as follows: after the punching equipment receives a sounding point punching position diagram sent by a music system, a coordinate system is established, and sounding point punching position information and current position information, namely coordinates, of a laser puncher clamped by a mechanical arm on a line spectrum diagram of a sound band are extracted, the moving distance of a motor in x and y axes when the motor reaches each sounding point to punch is calculated from the current position, namely displacement vectors of two adjacent punching positions, and the laser puncher clamped by the mechanical arm is used for completing punching on the sound band according to the size of the corresponding sounding point and preset power.
An embodiment of the present invention further provides a music box, including: the music box comprises a shell, a core and a sound band manufactured by adopting the sound band manufacturing method of the music box, wherein the shell is provided with a through hole, a sound band inlet and a sound band outlet, and the core comprises a core main body, a hole reading assembly, a sound tooth, a sound board and a rocker assembly, wherein the hole reading assembly, the sound tooth, the sound board and the rocker assembly are arranged on the core main body; the movement main body is arranged inside the shell; the sound band is movably arranged on the movement main body through the sound band inlet; the rocker component is connected with the machine core main body through the through hole; the machine core main body is driven by the rocker to drive the sound band to move along the sound band outlet direction and drive the hole reading assembly to rotate so as to detect the hollow point of the sound band, and the machine core main body is used for controlling the sound teeth to stir the sound board when the hollow point of the sound band is detected.
Compared with the prior art, the method for manufacturing the sound band of the music box provided by the embodiment of the invention has the beneficial effects that: the method for manufacturing the sound band of the music box comprises the following steps: acquiring an HSB value of each pixel point in a target image, and performing color clustering processing on each pixel point of the target image according to the HSB value to obtain a color clustering image corresponding to the target image; normalizing the color blocks in the color clustering image to obtain a phonation point image corresponding to the target image; mapping the sound points in the sound point image to a preset line spectrogram to generate a sound point punching position graph; and controlling the punching equipment to punch holes at corresponding positions of the sound band according to the punching positions in the sound-producing point punching position diagram. By the method for manufacturing the sound band of the music box, the image can be converted into a section of specific melody, automatic music composition on the sound band by adopting the image is realized, the customization requirement of a user on music of the music box is met, and meanwhile, the punching error is reduced. The embodiment of the invention also provides the music box.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (10)

1. A method for manufacturing a sound band of a music box is characterized by comprising the following steps:
acquiring an HSB value of each pixel point in a target image, and performing color clustering processing on each pixel point of the target image according to the HSB value to obtain a color clustering image corresponding to the target image;
normalizing the color blocks in the color clustering image to obtain a phonation point image corresponding to the target image;
mapping the sound points in the sound point image to a preset line spectrogram to generate a sound point punching position graph;
and controlling the punching equipment to punch holes at corresponding positions of the sound band according to the punching positions in the sound-producing point punching position diagram.
2. The method for producing a soundtrack for a music box according to claim 1, wherein the step of mapping the sound points in the sound point image to a preset spectrogram to generate a sound point punching position map comprises:
mapping the pronunciation point image to a pre-established grid, and establishing a mapping relation between each pronunciation point in the pronunciation point image and each scale in the grid; each row of the grid corresponds to a scale, and each column of the grid corresponds to a time point;
extracting a scale corresponding to the pronunciation point in the pronunciation point image along the set direction of the grid according to the mapping relation, and generating a melody corresponding to the target image;
and mapping the sound points of the sound point images corresponding to the melodies into a preset line spectrogram, and generating the sound point punching position diagram.
3. The method for producing a musical band of a music box according to claim 2, wherein said extracting a scale corresponding to a sound-emitting point in said sound-emitting point image along a set direction of said mesh according to said mapping relationship to generate a melody corresponding to said target image, further comprises:
adjusting scales corresponding to each row of the grid, reestablishing the mapping relation between each pronunciation point in the pronunciation point image and each scale in the grid, and regenerating the melody corresponding to the target image to obtain N melodies corresponding to the target image;
respectively converting the N melodies corresponding to the target image into oscillograms to obtain N oscillograms in total;
respectively calculating the similarity between any one oscillogram and a plurality of template oscillograms pre-stored in an oscillogram template database, and extracting the maximum value of the similarity of any one oscillogram relative to the plurality of template oscillograms as a reference value of any one oscillogram;
extracting a waveform diagram corresponding to a maximum reference value from the N waveform diagrams;
extracting the melody corresponding to the waveform diagram corresponding to the maximum reference value as the target melody of the target image;
the step of mapping the sounding point of the sounding point image corresponding to the melody to a preset spectrogram to generate the sounding point punching position map specifically includes:
and mapping the sound producing points of the sound producing point image corresponding to the target melody to a preset line spectrogram, and generating the sound producing point punching position diagram.
4. The method for producing a soundtrack for a music box according to claim 1, wherein the normalizing the color blocks in the color cluster image to obtain a sound point image corresponding to the target image comprises:
acquiring a color block with the minimum area in the color clustering image, and setting the color block with the minimum area as a sound producing point;
adjusting other color blocks in the color clustering image to be integral multiples of the sound producing point corresponding to the color block with the minimum area;
and generating the phonation point image according to the phonation points corresponding to the color blocks in the color clustering image.
5. The method for producing a soundtrack for a music box according to claim 2, wherein the mapping of the sound-emitting point image to a pre-established grid to establish a mapping relationship between each sound-emitting point in the sound-emitting point image and each scale in the grid specifically comprises:
setting the area of the square grid and establishing the grid according to the area of the phonation point and a preset proportion;
mapping each sound point in the sound point image to the grid;
when the phonation points are distributed on the grid lines of the grid, respectively calculating the area occupation ratio of the phonation points in the adjacent grids connected with the grid lines, and distributing the phonation points to one grid with the larger area occupation ratio of the phonation points in the adjacent grids;
and establishing a mapping relation between each pronunciation point in the pronunciation point image and each scale in the grid according to the position of each pronunciation point in the pronunciation point image in the grid and the scale corresponding to each row in the grid.
6. The method for creating a soundtrack for a music box according to claim 2, wherein the extracting musical scales corresponding to the pronunciation points in the pronunciation point image along the set direction of the mesh according to the mapping relationship to generate the melody corresponding to the target image comprises:
the set direction is a time axis direction formed by time points corresponding to each row of the grid;
extracting a scale corresponding to the pronunciation point in the pronunciation point image according to the mapping relation and the time axis direction corresponding to the grids;
when a plurality of sound producing points are positioned in any row of adjacent grids in the grid, the sound producing points are adjusted to be long tones of the scale corresponding to the any row;
extracting time points corresponding to the sound points in the sound point images according to the time axis direction;
and generating the melody corresponding to the target image according to the scale and the time point corresponding to the sound point in the sound point image.
7. The method for producing a soundtrack of a music box according to claim 1, wherein the obtaining of the HSB value of each pixel point in the target image and the performing of color clustering processing on each pixel point of the target image according to the HSB value to obtain a color cluster image corresponding to the target image specifically comprises:
acquiring an HSB value of each pixel point in a target image;
according to the HSB value of each pixel point in the target image, acquiring the pixel points of which the hue distance exceeds a first threshold value in the target image, and acquiring a plurality of color mutation areas;
calculating the average hue value of adjacent pixel points of which the difference value of the HSB values in the color mutation area is smaller than a second threshold value, and aggregating the adjacent pixel points into color blocks corresponding to the average hue value;
and when the hue distance of the adjacent pixel points in the color mutation area is zero, generating the color clustering image according to the polymerized color block.
8. The method of manufacturing a soundtrack for a music box of claim 3, further comprising:
collecting template melody;
and converting the template melody into a template oscillogram and storing the oscillogram in the oscillogram template database.
9. The method for producing a soundtrack for a music box according to claim 1, wherein the controlling the punching device to punch holes at corresponding positions of the soundtrack according to the punching positions in the sound-emitting point punching position pattern, specifically comprises:
establishing a coordinate system on the sound-emitting point punching position diagram by taking the current position of the punching equipment as an origin, and acquiring coordinates of the punching position of the sound-emitting point punching position diagram on the coordinate system;
respectively calculating displacement vectors of two adjacent punching positions according to the coordinates of the punching positions by taking the original point of the coordinate system as an initial punching position; wherein the initial punch location does not punch;
and the punching equipment controls a laser puncher clamped on the mechanical arm to move on the sound band according to the displacement vector through the mechanical arm and punches holes at the end point position corresponding to the displacement vector.
10. A music box, comprising: the casing is provided with a through hole, a sound band inlet and a sound band outlet, and the movement comprises a movement main body, a reading hole assembly, a sound tooth, a sound board and a rocker assembly, wherein the reading hole assembly, the sound tooth, the sound board and the rocker assembly are arranged on the movement main body; the movement main body is arranged inside the shell; the sound band is movably arranged on the movement main body through the sound band inlet; the rocker component is connected with the machine core main body through the through hole; the machine core main body is driven by the rocker to drive the sound band to move along the sound band outlet direction and drive the hole reading assembly to rotate so as to detect the hollow point of the sound band, and the machine core main body is used for controlling the sound teeth to stir the sound board when the hollow point of the sound band is detected.
CN201810427687.5A 2018-05-07 2018-05-07 Music box and method for manufacturing sound tape of music box Active CN108847204B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810427687.5A CN108847204B (en) 2018-05-07 2018-05-07 Music box and method for manufacturing sound tape of music box

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810427687.5A CN108847204B (en) 2018-05-07 2018-05-07 Music box and method for manufacturing sound tape of music box

Publications (2)

Publication Number Publication Date
CN108847204A CN108847204A (en) 2018-11-20
CN108847204B true CN108847204B (en) 2020-05-22

Family

ID=64212717

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810427687.5A Active CN108847204B (en) 2018-05-07 2018-05-07 Music box and method for manufacturing sound tape of music box

Country Status (1)

Country Link
CN (1) CN108847204B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE3602879A1 (en) * 1986-01-31 1987-08-06 Herbert Dr Ing Juettemann Sliding-block attachment for mechanical musical instruments
JPH08234782A (en) * 1995-02-28 1996-09-13 Victor Co Of Japan Ltd Music reproducing device
CN1185617A (en) * 1996-12-19 1998-06-24 田景华 Method for using modulated colour dispersion spectrum to represent multiple digital signal and application thereof
JP2005165194A (en) * 2003-12-05 2005-06-23 Nippon Hoso Kyokai <Nhk> Music data converter and music data conversion program
CN102289778A (en) * 2011-05-10 2011-12-21 南京大学 Method for converting image into music
CN202473206U (en) * 2012-05-04 2012-10-03 王其健 Self-composing electronic music device
CN103928036A (en) * 2013-01-14 2014-07-16 联想(北京)有限公司 Method and device for generating audio file according to image
CN107871151A (en) * 2017-10-23 2018-04-03 广东数相智能科技有限公司 A kind of color bar code and its production method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE3602879A1 (en) * 1986-01-31 1987-08-06 Herbert Dr Ing Juettemann Sliding-block attachment for mechanical musical instruments
JPH08234782A (en) * 1995-02-28 1996-09-13 Victor Co Of Japan Ltd Music reproducing device
CN1185617A (en) * 1996-12-19 1998-06-24 田景华 Method for using modulated colour dispersion spectrum to represent multiple digital signal and application thereof
JP2005165194A (en) * 2003-12-05 2005-06-23 Nippon Hoso Kyokai <Nhk> Music data converter and music data conversion program
CN102289778A (en) * 2011-05-10 2011-12-21 南京大学 Method for converting image into music
CN202473206U (en) * 2012-05-04 2012-10-03 王其健 Self-composing electronic music device
CN103928036A (en) * 2013-01-14 2014-07-16 联想(北京)有限公司 Method and device for generating audio file according to image
CN107871151A (en) * 2017-10-23 2018-04-03 广东数相智能科技有限公司 A kind of color bar code and its production method and device

Also Published As

Publication number Publication date
CN108847204A (en) 2018-11-20

Similar Documents

Publication Publication Date Title
US10789921B2 (en) Audio extraction apparatus, machine learning apparatus and audio reproduction apparatus
US8706274B2 (en) Information processing apparatus, information processing method, and program
US20210295811A1 (en) Mapping characteristics of music into a visual display
US8173884B2 (en) Device and method for generating a note signal upon a manual input
US11568857B2 (en) Machine learning method, audio source separation apparatus, and electronic instrument
JP2008516289A (en) Method and apparatus for extracting a melody that is the basis of an audio signal
US20100300262A1 (en) Music difficulty level calculating apparatus and music difficulty level calculating method
US20110271187A1 (en) Musical Composition System
CN108960250B (en) Method and device for converting image into melody and computer readable storage medium
CN108805171A (en) Image is to the conversion method of music rhythm, device and computer readable storage medium
Bernardes et al. Harmony generation driven by a perceptually motivated tonal interval space
JP2008516288A (en) Extraction of melody that is the basis of audio signal
US6768046B2 (en) Method of generating a link between a note of a digital score and a realization of the score
US10121249B2 (en) Enhanced visualization of areas of interest in image data
CN108847204B (en) Music box and method for manufacturing sound tape of music box
JP2020021098A (en) Information processing equipment, electronic apparatus, and program
CN114220409A (en) Audio processing method and computer device
US20150157860A1 (en) Apparatus, system and method for music enjoyment and ability testing and rehabilitation retaining with cochlear implants
Bell MAPS AS SCORES:" TIMBRE SPACE" REPRESENTATIONS IN CORPUS-BASED CONCATENATIVE SYNTHESIS
CN113851098B (en) Melody style conversion method and device, terminal equipment and storage medium
Einbond et al. Embodying Spatial Sound Synthesis with AI in Two Compositions for Instruments and 3-D Electronics
WO2023062865A1 (en) Information processing apparatus, method, and program
Savelsberg Visualizing the Structure of Music
Marinissen The composition of concert music within the Digital Audio Workstation environment.
CN117975981A (en) Sound changing processing method, device, equipment and storage medium

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