本文整理汇总了Python中Song.reset方法的典型用法代码示例。如果您正苦于以下问题:Python Song.reset方法的具体用法?Python Song.reset怎么用?Python Song.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Song
的用法示例。
在下文中一共展示了Song.reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AutoMusic
# 需要导入模块: import Song [as 别名]
# 或者: from Song import reset [as 别名]
def AutoMusic(self, parent, page_type, loadpic, waitpic,
incontainer, outcontainer, records, music):
"""
This is a callback function for 'Generate' button.
It takes the selected inputs from the listbox,
make an AutoComposeSong object, and execute its functions
to output a MIDI file.
* See 'AutoComposeSong.py' for the detailed explanation
on how these methods work.
"""
genre = self.genreList[int(self.gr_listbox.curselection()[0])]
key = eval(self.keyList[int(self.key_listbox.curselection()[0])])
cp = self.cpList[int(self.cp_listbox.curselection()[0])]
title = self.title.get()
mode = Tonics
numPhrase = 4
beat = 72
if self.entry_field.get() == '':
userInput = []
else:
userInput = Song()
userInput.reset()
userInputMelody = wrapNote(self.entry_field.get().split('-'))
userInputTimes = constant_times(userInputMelody, 2, beat)
userInput.wrapNotesAndTimes(userInputMelody, userInputTimes)
autoSong = AutoComposeSong()
autoSong.reset()
autoSong.setTitle(title)
autoSong.setup(genre, key, mode, cp, numPhrase, beat, userInput)
autoSong.exportMidi(1, 'Output MIDIs/' + title + '.mid')
self.page_factory(parent, page_type, loadpic, waitpic,
incontainer, outcontainer, records, autoSong)