CN108694934A - A kind of bitmap-converted is the method for music rhythm - Google Patents

A kind of bitmap-converted is the method for music rhythm Download PDF

Info

Publication number
CN108694934A
CN108694934A CN201810457260.XA CN201810457260A CN108694934A CN 108694934 A CN108694934 A CN 108694934A CN 201810457260 A CN201810457260 A CN 201810457260A CN 108694934 A CN108694934 A CN 108694934A
Authority
CN
China
Prior art keywords
pitch
bitmap
music rhythm
converted
read
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810457260.XA
Other languages
Chinese (zh)
Other versions
CN108694934B (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.)
Shaanxi University of Science and Technology
Original Assignee
Shaanxi University of Science and Technology
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 Shaanxi University of Science and Technology filed Critical Shaanxi University of Science and Technology
Priority to CN201810457260.XA priority Critical patent/CN108694934B/en
Publication of CN108694934A publication Critical patent/CN108694934A/en
Application granted granted Critical
Publication of CN108694934B publication Critical patent/CN108694934B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10HELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
    • G10H7/00Instruments in which the tones are synthesised from a data store, e.g. computer organs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10HELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
    • G10H1/00Details of electrophonic musical instruments
    • G10H1/32Constructional details
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10HELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
    • G10H2220/00Input/output interfacing specifically adapted for electrophonic musical tools or instruments
    • G10H2220/155User input interfaces for electrophonic musical instruments
    • G10H2220/441Image sensing, i.e. capturing images or optical patterns for musical purposes or musical control purposes

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Auxiliary Devices For Music (AREA)
  • Electrophonic Musical Instruments (AREA)

Abstract

The invention discloses a kind of methods that bitmap-converted is music rhythm, and several musical alphabets are chosen in musical alphabet-frequency table of comparisons, and the musical alphabet of selection and frequency are corresponded to, pitch permutation table is obtained, and the tenuto duration of single note is arranged and plays the number of note;Then bitmap images are read by image reading module, and obtains the grey level histogram of bitmap images;It reuses Do statement and reads the corresponding Y value of arbitrary abscissa, the Y value of reading is converted to pitch call number, by the call number of generation by genesis sequence input index control, corresponding pitch is extracted in pitch permutation table finally by index control, it is played back by buzzer, one section of music rhythm is formed with this.It the method for the invention realizes the function of converting message bit pattern to music rhythm, breaches traditional music or plays the pattern of melody, become a kind of pattern of new generation music.

Description

A kind of bitmap-converted is the method for music rhythm
Technical field
The invention belongs to AR technical fields, and in particular to a kind of bitmap-converted is the method for music rhythm.
Background technology
In the electronic product epoch prevailing, in order to protect children's vision, " plate son book " the i.e. children's book equipped demand of entertaining property It measures increasing.Based on LabVIEW, establish a kind of music game algorithm, by will not no music knowledge child, design is a kind of Music game allows children to obtain one section of music rhythm by a sub-picture, by means of AR technologies, realizes picture and text and sound and cyclopentadienyl Effect improves children's book equipped interest, while the also potentiality of exploitation child music creation.For not receiving music knowledge Trained people can use the data in Program extraction image to automatically generate music rhythm, this process enhances people and picture and text The interaction effect of information also allows user to become creator while the audiovisual demand for meeting user.There is music theory Knowledge-based The people of plinth can also obtain one section of random music rhythm by program, to obtain the material of the inspiration and composition of creation.
Invention content
The object of the present invention is to provide a kind of methods that bitmap-converted is music rhythm, realize and convert picture to music Function.
The technical solution adopted in the present invention is that a kind of bitmap-converted is the method for music rhythm, passes through graphic programming LISP program LISP is realized, is included the following steps:
Step 1, pitch permutation table is established:
Several musical alphabets are chosen in musical alphabet-frequency table of comparisons, an array control is established in graphical programming language program Musical alphabet is arranged in order by part by the corresponding frequency input matrix of the musical alphabet of selection, and according to frequency sequence, obtains pitch row List.
Step 2, melody play parameter is set:
Two values control is established, be respectively used to that the tenuto duration of single note is arranged and plays the number of note.
Step 3, the characteristic information of bitmap images is read:
Bitmap images are read by image reading module, and obtain the grey level histogram of bitmap images.
Step 4 handles bitmap images information:
The corresponding Y value of arbitrary abscissa is read using Do statement, an ordinate number is read per circulation primary Value, and the Y value (number for indicating each gray-level pixels) of reading is converted to pitch index according to following formula Number.
N=A-[A/f]×f (1)
Wherein A is the numerical value of the corresponding ordinate of any one abscissa in grey level histogram, and N is call number, and f is to choose The number of musical alphabet.
Step 5, music rhythm is played:
The call number generated in step 4 is inputted into index control by genesis sequence, by indexing control in pitch permutation table It is middle to extract corresponding pitch, the pitch information of output is played back by buzzer, is played with this series of with not unisonance High sound forms one section of music rhythm.
The features of the present invention also characterized in that:
Further, the preferred LabVIEW programs of the graphical programming language program are programmed compared to traditional text, Compiler process can be simplified using the compilation process of figure block diagram, core of the invention is just to be by identification graphics Melody.Described image read module is the IMAQ modules in LabVIEW programs, and the Do statement recycles for For, described to indulge It is Index Array controls that coordinate values, which are converted to pitch call number and use Unbundle by Name controls, the index control, Part.
Further, step 2 grey level histogram has 256 gray levels, and the number of broadcasting is related to gray level, broadcasting The number of note is 0~256.
Further, for a certain Zhang Weitu, for cycles read fixed one group of Y value in rate-determining steps 4, make The bitmap corresponds to one section of fixed melody.
The principle of the present invention is:The last point of grey level histogram has the variation that height rises and falls, with five lines in music notation It is similar to compose the variation that melodic line height rises and falls.The present invention is indulged by the grey level histogram of analysis bitmap using on grey level histogram The variation of coordinate values is converted into melodic line and plays out.Grey level histogram is corresponded with the pitch permutation table set, By one section of sound with different pitches of this Relation acquisition, then one section of music rhythm is generated according to certain played in order.
The invention has the advantages that the method for the invention realizes the function of converting message bit pattern to music rhythm, It breaches traditional music or plays the pattern of melody, become a kind of new model generating music, diversified bitmap can be turned Different music is turned to, the interaction effect of people and graph text information is enhanced, is also allowed while the audiovisual demand for meeting user User becomes creator.This method can be realized by graphical programming language program, high degree of automation, and future can answer For variety carrier, realizes commercialization, have broad application prospects.
Description of the drawings
Fig. 1 is the method flow diagram that bitmap-converted of the present invention is music rhythm;
Fig. 2 is musical alphabet-frequency meter in embodiment;
Fig. 3 is the pitch permutation table that embodiment is provided with;
Fig. 4 is the setting of embodiment play parameter;
Fig. 5 is embodiment bitmap images;
Fig. 6 is the program chart that embodiment reads image information;
Fig. 7 is the grey level histogram of embodiment bitmap;
Fig. 8 is the trend of embodiment index change;
Fig. 9 is the program chart that embodiment plays music rhythm.
Specific implementation mode
Present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments, but the present invention is not limited to These embodiments.
Bitmap-converted of the present invention be music rhythm method realized by LabVIEW programs, referring to Fig.1, specifically according to Lower step is implemented:
Step 1, pitch permutation table is established:
Musical alphabet-frequency table of comparisons is the frequency that the height of sound is corresponded to sound so that sound can be by objective and science Be depicted, there are 88 audio standards in general musical alphabet-frequency table of comparisons at present.
This method chooses several musical alphabets in musical alphabet-frequency table of comparisons.With the frequency of standard pronunciation A4 be 440Hz the case where Under, meet the frequency of the sound of human auditory's impression between 27.5Hz~4186.0Hz, meets listening for people to ensure to generate melody Feel impression, preferably 8~88 musical alphabets in musical alphabet-frequency table of comparisons.
An Array Control is established in LabVIEW program chart front panels, the corresponding frequency of the musical alphabet of selection is inputted into square Musical alphabet, and is arranged in order by battle array according to frequency sequence, put in order can be from high to low, can also be from low to high, Can also stochastic inputs, pitch permutation table is obtained after arranging.Orderly arrangement is straight convenient for inputting and being conducive to reflection gray scale The figure line of square figure and the relationship of pitch.The result that stochastic inputs generate is more difficult to predict.Musical alphabet put in order from high to low and from The variation of the low to high melody algorithmically without difference, generated simply by algorithm from high to low or from low to high.
Step 2, melody play parameter is set:
Two LabVIEW numerical value controls are established, be respectively used to that the tenuto duration of single note is arranged and play the number of note Mesh, the wherein number of note are 0~256, and unit is a.Note number determines the length of melody;The tenuto duration range of note It is 50~300000, unit is millisecond, and tenuto duration indicates the time span of each note sounding of melody, determines melody Rhythm.
Step 3, the characteristic information of image is read:
Image is read by the IMAQ modules of LabVIEW, image buffer storage is established by the Create controls in IMAQ first, It uses the ReadFile in IMAQ to establish the path for reading image again, image file is obtained by the Histogram controls in IMAQ Grey level histogram.
Step 4 handles image information:
Using the histogram obtained in Unbundle by Name controls processing step 3, reads and appoint in For recycles block diagram It anticipates the corresponding Y value of an abscissa, and will indicate the number (ordinate) of each gray-level pixels according to following formula It is converted to pitch call number, then For cycles will produce a call number each time.
N=A-[A/f]×f (1)
Wherein A is the numerical value of the corresponding ordinate of any one abscissa in grey level histogram, and N is call number, and f is to choose The number of musical alphabet.
Number of notes in step 2 determines the number of For cycles, that is, determines the number of call number.For is followed each time Ring can be read the corresponding Y value of any one abscissa, can be according to cross when reading the corresponding Y value of abscissa Coordinate sequence is successively read (from left to right).
Step 5, music rhythm is played:
A series of call numbers generated in step 4 are inputted into Index Array controls by the genesis sequence of call number, are passed through Index Array controls extract corresponding pitch in pitch permutation table, and the pitch information of output is played out by buzzer Come, a series of sounds with different pitches are played with this, form one section of music rhythm.
It is random when Y value corresponding due to For cycle reading abscissas, different indexes can be generated Number combination, and then form different music rhythm.If it is desired to a certain Zhang Weitu is made just to correspond to one section of melody, control can be passed through For cycles read fixed one group of Y value and realize.
Embodiment
Now illustrate the making and operating process of the present invention by taking a pictures give out music melody as an example.
(1) pitch permutation table is established:It is chosen in musical alphabet-frequency table of comparisons and chooses fixed 8 musical alphabets, musical alphabet-frequency control Table is as shown in Figure 2.The musical alphabet of selection be C6, D6, E6, F6, G6, A6, B6, C7, corresponding frequency be 1046.5Hz, 1174.7Hz, 1318.5Hz, 1396.9Hz, 1568.0Hz, 1760.0HZ, 1979.5HZ, 2093.0Hz, and according to frequency height It is arranged in order from low to high.A matrix is established in LabVIEW program chart front panels, it is complete by the frequency input matrix of selection It is as shown in Figure 3 at the pitch permutation table of input.
(2) play parameter is set:Establish two LabVIEW numerical value controls.First numerical value control is named as duration (milli Second), input numerical value completes the setting of the duration played to single note.Second numerical value control is named as note number, inputs number It is worth as the control for playing number of notes.The note number of broadcasting is set as 20, unit is a;The pronunciation duration of each note is set It is 300, unit is millisecond.Parameter setting is as shown in Figure 4.
(3) message bit pattern is read:Image is read by the IMAQ modules of LabVIEW, passes through the Create in IMAQ first Control establishes image buffer storage, then the path for reading image, bitmap such as Fig. 5 institutes of selection are established with the ReadFile controls in IMAQ Show.The grey level histogram of image file is obtained by the Histogram controls in IMAQ.It is programmed reading using IMAQ modules For program chart as shown in fig. 6, generating grey level histogram, grey level histogram is as shown in Figure 7.
(4) image information is handled:Using the histogram information obtained in Unbundle by Name controls obtaining step 3, The numerical value for arbitrarily reading the corresponding ordinate of 8 abscissas according to abscissa sequence in For recycles block diagram, recycles 8 times, goes forward side by side altogether Row processing will indicate that the number of each gray-level pixels is converted to pitch index, such as Fig. 8.
N=A-[A/8]×8
Wherein A is the numerical value of the corresponding ordinate of any one abscissa in grey level histogram, and N is call number, f=8.
(5) music rhythm is played:In program chart, the numerical value control that note number is inputted in step 2 is connected to For and is followed Ring block diagram input terminal, 1 input terminal of Index Array control call connected node controls parameter in LabVIEW input duration 2 input terminal of numerical value control call connected node control parameter of (millisecond).It is suitable by generating according to the call number generated in step 4 Sequence inputs the Index Array controls in LabVIEW, is extracted in pitch permutation table by Index Array controls corresponding The pitch information of output is inputted Index Array controls, the kernel32.dll carried by calling system and broadcasting by pitch One sound.It runs program and reads picture, the call number broadcasting that generation is constantly read by For cycles block diagram in step 4 is a series of Sound with different pitches plays music rhythm by way of buzzer, forms one section of music rhythm.Program is as shown in Figure 9.

Claims (4)

1. a kind of bitmap-converted is the method for music rhythm, which is characterized in that it is realized by graphical programming language program, including Following steps:
Step 1, pitch permutation table is established:
Several musical alphabets are chosen in musical alphabet-frequency table of comparisons, an Array Control is established in graphical programming language program, it will The corresponding frequency input matrix of musical alphabet of selection, and be arranged in order musical alphabet according to frequency sequence, obtain pitch permutation table;
Step 2, melody play parameter is set:
Two values control is established, be respectively used to that the tenuto duration of single note is arranged and plays the number of note;
Step 3, the characteristic information of bitmap images is read:
Bitmap images are read by image reading module, and obtain the grey level histogram of bitmap images;
Step 4 handles bitmap images information:
The corresponding Y value of arbitrary abscissa is read using Do statement, a Y value is read per circulation primary, And the Y value of reading is converted to pitch call number according to following formula,
N=A-[A/f]×f (1)
Wherein A is the numerical value of the corresponding ordinate of any one abscissa in grey level histogram, and N is call number, and f is to choose musical alphabet Number;
Step 5, music rhythm is played:
The call number generated in step 4 is inputted into index control by genesis sequence, is carried in pitch permutation table by indexing control Corresponding pitch is taken, the pitch information of output is played back by buzzer, is played with this series of with different pitches Sound forms one section of music rhythm.
2. bitmap-converted according to claim 1 is the method for music rhythm, which is characterized in that the graphic programming language Speech program is LabVIEW programs, and described image read module is the IMAQ modules in LabVIEW programs, and the Do statement is For is recycled, described that Y value is converted to pitch call number using Unbundle by Name controls, the index control For Index Array controls.
3. bitmap-converted according to claim 1 is the method for music rhythm, which is characterized in that the step 2 played The number of note is 0~256.
4. bitmap-converted according to claim 1 is the method for music rhythm, which is characterized in that for a certain Zhang Weitu, The cycles of for described in rate-determining steps 4 read fixed one group of Y value, and the bitmap is made to correspond to one section of fixed melody.
CN201810457260.XA 2018-05-14 2018-05-14 Method for converting bitmap into music melody Active CN108694934B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810457260.XA CN108694934B (en) 2018-05-14 2018-05-14 Method for converting bitmap into music melody

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810457260.XA CN108694934B (en) 2018-05-14 2018-05-14 Method for converting bitmap into music melody

Publications (2)

Publication Number Publication Date
CN108694934A true CN108694934A (en) 2018-10-23
CN108694934B CN108694934B (en) 2022-10-21

Family

ID=63847436

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810457260.XA Active CN108694934B (en) 2018-05-14 2018-05-14 Method for converting bitmap into music melody

Country Status (1)

Country Link
CN (1) CN108694934B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113160781A (en) * 2021-04-12 2021-07-23 广州酷狗计算机科技有限公司 Audio generation method and device, computer equipment and storage medium
CN114495871A (en) * 2022-01-26 2022-05-13 浙江大学软件学院(宁波)管理中心(宁波软件教育中心) Method, system and device for generating music melody based on multi-line characteristic information

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1287320A (en) * 1999-09-03 2001-03-14 北京航空航天大学 Method of converting image information into music
EP1369839A1 (en) * 2002-06-03 2003-12-10 Swisscom Mobile AG Processor based method and system for the production of an audio image out of graphical data
JP2005208150A (en) * 2004-01-20 2005-08-04 Kokichi Tanihira Music generating system
US20060132714A1 (en) * 2004-12-17 2006-06-22 Nease Joseph L Method and apparatus for image interpretation into sound
WO2014089881A1 (en) * 2012-12-10 2014-06-19 Zhang Su Picture touch and read playing system and method
CN104156371A (en) * 2013-05-15 2014-11-19 好看科技(深圳)有限公司 Method and device for browsing images with hue changing along with musical scales

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1287320A (en) * 1999-09-03 2001-03-14 北京航空航天大学 Method of converting image information into music
EP1369839A1 (en) * 2002-06-03 2003-12-10 Swisscom Mobile AG Processor based method and system for the production of an audio image out of graphical data
JP2005208150A (en) * 2004-01-20 2005-08-04 Kokichi Tanihira Music generating system
US20060132714A1 (en) * 2004-12-17 2006-06-22 Nease Joseph L Method and apparatus for image interpretation into sound
WO2014089881A1 (en) * 2012-12-10 2014-06-19 Zhang Su Picture touch and read playing system and method
CN104156371A (en) * 2013-05-15 2014-11-19 好看科技(深圳)有限公司 Method and device for browsing images with hue changing along with musical scales

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
GIHOON GO ET AL.: "《Generating music using a picture and a transform system》", 《ICCAS 2010》 *
P.B.L.MEIJER: "《An experimental system for auditory image representations》", 《 IEEE TRANSACTIONS ON BIOMEDICAL ENGINEERING》 *
田亚男等: "基于提升小波变换的图像可听化方法", 《东北大学学报(自然科学版)》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113160781A (en) * 2021-04-12 2021-07-23 广州酷狗计算机科技有限公司 Audio generation method and device, computer equipment and storage medium
CN113160781B (en) * 2021-04-12 2023-11-17 广州酷狗计算机科技有限公司 Audio generation method, device, computer equipment and storage medium
CN114495871A (en) * 2022-01-26 2022-05-13 浙江大学软件学院(宁波)管理中心(宁波软件教育中心) Method, system and device for generating music melody based on multi-line characteristic information

Also Published As

Publication number Publication date
CN108694934B (en) 2022-10-21

Similar Documents

Publication Publication Date Title
Sessions Musical experience of composer, performer, listener
Bailin Achieving extraordinary ends: An essay on creativity
Garnett The aesthetics of interactive computer music
CN106598948B (en) Emotion identification method based on shot and long term Memory Neural Networks combination autocoder
CN109002433A (en) A kind of document creation method and device
CN111583891B (en) Automatic musical note vector composing system and method based on context information
CN108877749A (en) A kind of generation method and system of E.E.G AI music
CN109272808B (en) Interactive system for music beat rhythm teaching and science popularization
CN106898345A (en) Phoneme synthesizing method and speech synthetic device
CN101409070A (en) Music reconstruction method base on movement image analysis
CN108694934A (en) A kind of bitmap-converted is the method for music rhythm
Savery et al. Shimon the robot film composer and deepscore: An lstm for generation of film scores based on visual analysis
CN103425901A (en) Original sound data organizer
Nikolsky et al. The evolution of human music in light of increased prosocial behavior: a new model
KR20220145675A (en) Method and device for evaluating ballet movements based on ai using musical elements
Read A study of non-linguistic utterances for social human-robot interaction
Velardo et al. Automatic melody composition and evolution: a cognitive-based approach
Hansen Memorising music for solo piano performance: A theoretical framework
CN113838445B (en) Song creation method and related equipment
Liang et al. Research on generating xi'an drum music based on generative adversarial network
Ekeus et al. The melody triangle: exploring pattern and predictability in music
Breen Art and analogy through evolutionary computation
Tran Music On Canvas: A Quest to Generate Art That Evokes the Feeling of Music
Xu Self‐Psychological Control and Creativity of Music Creation in Multimusic Environment
Dzuris et al. Data abstraction in cognitive models for compositional design in music

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