A kind of melody generation method and system

文档序号:1757129 发布日期:2019-11-29 浏览:23次 中文

阅读说明:本技术 一种旋律生成方法及系统 (A kind of melody generation method and system ) 是由 黄颂国 杨淦 张叶君 姚文清 于 2019-08-28 设计创作,主要内容包括:本发明涉及计算机应用技术领域,其目的在于提供一种旋律生成方法及系统。本发明公开了一种旋律生成方法,包括以下步骤:收集已有的MIDI文件,根据MIDI文件生成指定的旋律特征,然后根据指定的旋律特征构建旋律数据模型;建立算法生成器,从旋律数据模型中匹配并提取可用的旋律特征,然后将可用的旋律特征输入算法生成器中;算法生成器根据可用的旋律特征生成最终旋律。本发明还公开了一种旋律生成系统,包括原始数据预处理模块、数据筛选模块和算法生成模块。本发明可利用已有的MIDI文件自动创作新的旋律,有效降低旋律的创作成本。(The present invention relates to computer application technologies, and its purpose is to provide a kind of melody generation method and systems.The invention discloses a kind of melody generation methods, comprising the following steps: collects existing MIDI file, according to the melody characteristics that MIDI file generated is specified, then constructs melody data model according to specified melody characteristics;Hash generator Hash is established, matched from melody data model and extracts available melody characteristics, then inputs available melody characteristics in hash generator Hash;Hash generator Hash generates final melody according to available melody characteristics.The invention also discloses a kind of melody to generate system, including initial data preprocessing module, data screening module and algorithm generation module.The present invention can create automatically new melody using existing MIDI file, and the creation cost of melody is effectively reduced.)

1. a kind of melody generation method, it is characterised in that: the following steps are included:

Existing MIDI file is collected, according to the melody characteristics that MIDI file generated is specified, then according to specified melody characteristics Construct melody data model;

Hash generator Hash is established, matched from melody data model and extracts available melody characteristics, then by available melody Feature inputs in hash generator Hash;

Hash generator Hash generates final melody according to available melody characteristics.

2. a kind of melody generation method according to claim 1, it is characterised in that: after collecting MIDI file, also to MIDI File carries out Screening Treatment and standardization processing.

3. a kind of melody generation method according to claim 2, it is characterised in that: building melody data model specifically includes Following steps:

Existing MIDI file is collected, original MIDI file set is constituted;

MIDI file in original MIDI file set is screened, available MIDI file set is obtained;

Standardization processing is carried out to the MIDI file in available MIDI file set, removal can use the MIDI in MIDI file set The empty segment of file beginning, obtains specification MIDI file set;

MIDI file in specification MIDI file set is parsed, specified melody characteristics are extracted;

Melody data model is constructed according to specified melody characteristics.

4. a kind of melody generation method according to claim 3, it is characterised in that: in original MIDI file set MIDI file is screened, and specific step is as follows:

S1021. judge whether any MIDI file is single-tone rail or single instrumental audio, if then entering step S1022, if otherwise Enter step S1023, until by original MIDI file set all MIDI files judgement after the completion of, hash generator Hash according to Available melody characteristics generate final melody;

S1022. determine that the MIDI file is pure melody file, then return step S1021;

S1023. the MIDI file is rejected from MIDI file set, then return step S1021.

5. a kind of melody generation method according to claim 1, it is characterised in that: hash generator Hash is established, from melody number According to being matched in model and extracting available melody characteristics, then available melody characteristics are inputted in hash generator Hash, it is specific to wrap Include following steps:

Establish hash generator Hash;

Parameter is inputted to hash generator Hash, and is found from melody data model according to the parameter of input and to input parameter matched Melody characteristics;The parameter wherein inputted includes at least one of genre parameters, tonality parameter and speed parameter;

Melody characteristics are screened according to the first screening rule, obtain available melody characteristics;

Available melody characteristics are fed back to hash generator Hash and are learnt, initialization algorithm generator.

6. a kind of melody generation method according to claim 5, it is characterised in that: hash generator Hash utilizes decision Tree algorithms In random forest melody characteristics are learnt, obtain new data set, then feed back new data set to algorithm again In generator.

7. a kind of melody generation method according to claim 1, it is characterised in that: hash generator Hash is according to available melody Feature generates final melody, specifically includes the following steps:

The available melody characteristics in hash generator Hash are screened again according to the second screening rule;

Hash generator Hash carries out data update, generates final melody.

8. a kind of melody for any one of claim 1 to 7 melody generation method generates system, it is characterised in that: including original Beginning data preprocessing module, data screening module and algorithm generation module;

The data preprocessing module, for collecting existing MIDI file, according to MIDI file generated specify melody characteristics, Screening Treatment and standardization processing are carried out to MIDI file, then construct melody data model according to specified melody characteristics;

Then the data screening module will can be used for matching from melody data model and extracting available melody characteristics Melody characteristics input algorithm generation module in;

The algorithm generation module generates final melody for establishing hash generator Hash, and according to available melody characteristics.

Technical field

The present invention relates to computer application technologies, more particularly to a kind of melody generation method and system.

Background technique

Melody is the primary essential of music.Several musical sounds are often referred to be formed organized, rhythm by artistic conception Sequence.What monophonic constitute by certain pitch, duration and volume, with logic factor carried out.Melody is by many sounds Happy fundamental, such as mode, rhythm, beat, dynamics, tone color perform ways and means, are organically combined into.Currently, melody Generation be typically derived from the inspiration of composer and, however, the energy of people is limited, melody caused to generate by manually creating melody Cost it is excessively high, while be unfavorable for increase melody formation efficiency.

Summary of the invention

In order to solve the above problems existing in the present technology, the present invention provides a kind of melody generation method and systems.

The technical solution adopted by the present invention is that:

A kind of melody generation method, comprising the following steps:

Existing MIDI file is collected, according to the melody characteristics that MIDI file generated is specified, then according to specified melody Feature construction melody data model;

Hash generator Hash is established, matched from melody data model and extracts available melody characteristics, it then will be available Melody characteristics input in hash generator Hash;

Hash generator Hash generates final melody according to available melody characteristics.

Preferably, after collecting MIDI file, Screening Treatment and standardization processing also are carried out to MIDI file.

It is further preferred that building melody data model specifically includes the following steps:

Existing MIDI file is collected, original MIDI file set is constituted;

MIDI file in original MIDI file set is screened, available MIDI file set is obtained;

Standardization processing is carried out to the MIDI file in available MIDI file set, removal can be in MIDI file set The empty segment of MIDI file beginning, obtains specification MIDI file set;

MIDI file in specification MIDI file set is parsed, specified melody characteristics are extracted;

Melody data model is constructed according to specified melody characteristics.

It is further preferred that being screened to the MIDI file in original MIDI file set, specific step is as follows:

S1021. judge whether any MIDI file is single-tone rail or single instrumental audio, if then entering step S1022, if Otherwise S1023 is entered step, after the completion of by all MIDI files judgement in original MIDI file set, hash generator Hash Final melody is generated according to available melody characteristics;

S1022. determine that the MIDI file is pure melody file, then return step S1021;

S1023. the MIDI file is rejected from MIDI file set, then return step S1021.

Preferably, hash generator Hash is established, matched from melody data model and extracts available melody characteristics, then will In available melody characteristics input hash generator Hash, specifically includes the following steps:

Establish hash generator Hash;

Parameter is inputted to hash generator Hash, and is found from melody data model and input parameter according to the parameter of input The melody characteristics matched;The parameter wherein inputted includes at least one of genre parameters, tonality parameter and speed parameter;

Melody characteristics are screened according to the first screening rule, obtain available melody characteristics;

Available melody characteristics are fed back to hash generator Hash and are learnt, initialization algorithm generator.

It is further preferred that hash generator Hash learns melody characteristics using the random forest in decision Tree algorithms, New data set is obtained, then feeds back new data set in hash generator Hash again.

Preferably, hash generator Hash generates final melody according to available melody characteristics, specifically includes the following steps:

The available melody characteristics in hash generator Hash are screened again according to the second screening rule;

Hash generator Hash carries out data update, generates final melody.

A kind of melody generation system, including initial data preprocessing module, data screening module and algorithm generation module;

The data preprocessing module, for collecting existing MIDI file, according to the specified melody of MIDI file generated Feature carries out Screening Treatment and standardization processing to MIDI file, then constructs melody data mould according to specified melody characteristics Type;

Then the data screening module will for matching from melody data model and extracting available melody characteristics In available melody characteristics input algorithm generation module;

The algorithm generation module generates final melody for establishing hash generator Hash, and according to available melody characteristics.

The beneficial effects of the present invention are:

1) new melody is created automatically using existing MIDI file, the creation cost of melody is effectively reduced.Specifically, Firstly, the present invention utilizes existing MIDI file, the cost for establishing song lyric database can effectively reduce;In addition, this implementation Example can match available melody characteristics, be then inputted in hash generator Hash, finally generate final melody by hash generator Hash, To avoid the problem that melody caused by artificially creating creates at high cost and low efficiency.

2) repetitive rate for generating melody can be reduced, keeps the melody generated more high-quality;Specifically, the present invention makes full use of number According to bring variability, not only solve the problems, such as that repetitive rate caused by lacking because of data is excessively high, but also solve pure algorithm and bring Style Single-issue, the melody guaranteed is more high-quality.

Detailed description of the invention

In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.

Fig. 1 is the flow chart of embodiment 1 in the present invention;

Fig. 2 is the flow chart of embodiment 3 in the present invention;

Fig. 3 is the structural block diagram of embodiment 4 in the present invention.

Specific embodiment

With reference to the accompanying drawing and specific embodiment come the present invention is further elaborated.It should be noted that for Although the explanation of these way of example is to be used to help understand the present invention, but and do not constitute a limitation of the invention.It is public herein The specific structure and function detail opened are only used for description example embodiments of the present invention.However, can with many alternative forms come The present invention is embodied, and is not construed as limiting the invention in embodiment set forth herein.

It will be appreciated that though various units may be described herein using term first, second etc., but these units It should not be limited by these terms.These terms are only used to distinguish a unit and another unit.Such as it can be by Unit one is referred to as second unit, and similarly second unit can be referred to as first unit, shows without departing from of the invention The range of example embodiment.

It should be appreciated that being only a kind of pass for describing affiliated partner to the term "and/or" being likely to occur in this article Connection relationship indicates may exist three kinds of relationships, for example, A and/or B, can indicate: individualism A, individualism B are deposited simultaneously In tri- kinds of situations of A and B;To the term "/and " being likely to occur in this article, it is to describe another affiliated partner relationship, indicates There may be two kinds of relationships, for example, A/ and B, can indicate: two kinds of situations of individualism A, individualism A and B;In addition, for The character "/" being likely to occur herein, typicallying represent forward-backward correlation object is a kind of "or" relationship.

If should be appreciated that, it can when unit being referred to as with another unit " connection ", " connected " or " coupling " herein To be directly connected with another unit or couple or temporary location may exist.Relatively, if herein by unit be referred to as with When another unit " being connected directly " or " direct-coupling ", indicate that temporary location is not present.Additionally, it should solve in a similar manner Release for describing the relationship between unit other words (for example, " ... between " to " between directly existing ... ", " adjacent " To " direct neighbor " etc.).

It should be appreciated that terms used herein are only used for description specific embodiment, it is not intended to limit example of the invention Embodiment.If used herein, singular "a", "an" and "the" is intended to include plural form, unless context Contrary is explicitly indicated.If being also understood that, term " includes ", " including ", "comprising" and/or " containing " are herein By in use, specified stated feature, integer, step, operation, unit and/or component existence, and be not excluded for one Or other multiple features, quantity, step, operation, unit, component and/or their combination existence or increase.

It should be appreciated that it will be further noted that the function action occurred may go out with attached drawing in some alternative embodiments Existing sequence is different.For example, depending on related function action, can actually substantially be executed concurrently, or sometimes Two figures continuously shown can be executed in reverse order.

It should be appreciated that providing specific details, in the following description in order to which example embodiment is understood completely. However, those of ordinary skill in the art are it is to be understood that implementation example embodiment without these specific details. Such as system can be shown in block diagrams, to avoid with unnecessary details come so that example is unclear.In other instances, may be used Or not show well-known process, structure and technology unnecessary details, to avoid making example embodiment unclear.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:歌词节奏生成方法、设备、存储介质及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!