def main(): timeSig = str(raw_input("Enter desired time signature (x/x): ")) while timeSig.find("/") == -1: timeSig = str( raw_input("Time signature must contain a '/'. Please reenter: ")) timeCount = timeSig.split("/") total = int( timeCount[0]) ##top of time signature; amount of beats to generate beat = int(timeCount[1] ) ##bottom of time signature; what constitutes a single beat inputKey = raw_input("Enter desired key (X Major/X Minor): ") note = inputKey[0:2].strip() ##Note can be 1-2 chars.. G, G# etc.. m = Melopy('generated_clip') keys = None ## checking if input key is minor/major and calling corresponding Melopy method if inputKey.upper().find("MINOR") != -1: keys = melopy.generateScale("melodic_minor", note) elif inputKey.upper().find("MAJOR") != -1: keys = melopy.generateScale("major", note) ##calling recursive method with 'curr' parameter as 0, and the list of note time values we will be using generated(total, 0, ["semiquaver", "quaver", "quarter", "half"], keys, m, beat) m.render()
def main(): m = Melopy('mary') d = os.path.dirname(__file__) if len(d): m.parsefile(d + '/scores/mary.mlp') else: m.parsefile('scores/mary.mlp') m.render()
def main(): m = Melopy('furelise') d = os.path.dirname(__file__) if len(d): m.parsefile(d + '/scores/furelise.mlp') else: m.parsefile('scores/furelise.mlp') m.render() m.play()
def main(): m = Melopy('entertainer') m.tempo = 140 d = os.path.dirname(__file__) if len(d): m.parsefile(d + '/scores/entertainer.mlp') else: m.parsefile('scores/entertainer.mlp') m.render()
import sys; sys.path.append('../melopy/') from melopy import Melopy if __name__ == "__main__": song = Melopy('twinkle') song.tempo = 160 song.wave_type = 'square' part1notes = ['C', 'G', 'A', 'G', 'F', 'E', 'D', 'C'] part2notes = ['G', 'F', 'E', 'D'] def twinkle(notes): for i in range(len(notes)): song.add_quarter_note(notes[i]) if i % 4 == 3: song.add_quarter_rest() else: song.add_quarter_note(notes[i]) twinkle(part1notes) twinkle(part2notes) twinkle(part2notes) twinkle(part1notes) song.render() # Licensed under The MIT License (MIT) # See LICENSE file for more
def main(): m = Melopy('menuet') m.parsefile(os.path.dirname(__file__) + '/meeps/menuet.mp') m.render()
melodyMaker() melodyMaker() melodyMaker() melodyMaker() melodyMaker() melodyMaker() melodyMaker() melodyMaker() # formatted +="&&&" # #blankBar() bassMaker() bassMaker() bassMaker() bassMaker() bassMaker() bassMaker() bassMaker() bassMaker() ############################# print "note list: " + formatted #string to be parsed by melopy m.parse(formatted) #renders .wav file set as Melopy init m.render()
def main(): m = Melopy('entertainer') m.tempo = 140 m.parsefile(os.path.dirname(__file__) + '/scores/entertainer.mlp') m.render()
def main(): m = Melopy('furelise') m.parsefile(os.path.dirname(__file__) + '/meeps/furelise.mp') m.parsefile(os.path.dirname(__file__) + '/meeps/furelise_left.mp', 0) m.render()
def main(): m = Melopy('mary') m.parsefile(os.path.dirname(__file__) + '/meeps/mary.mp') m.render()
if start.endswith('m'): scale = minor_scale(start[:-1]) else: scale = major_scale(start) scale.insert(0, scale[0][:-1] + str(int(scale[0][-1]) - 1)) [melody.append(note) for note in scale] m.add_melody(melody, 0.2) m.add_rest(0.4) m.add_note('d4', 0.4) m.add_rest(0.1) m.add_note(['d4', 'a4', 'd5'], 0.8) m.render() # Licensed under The MIT License (MIT) # See LICENSE file for more ########NEW FILE######## __FILENAME__ = entertainer from melopy import Melopy import os def main(): m = Melopy('entertainer') m.tempo = 140 d = os.path.dirname(__file__) if len(d):
def main(): m = Melopy("entertainer") m.tempo = 140 m.parsefile(os.path.dirname(__file__) + "/meeps/entertainer.mp") m.render()
def main(): m = Melopy('furelise') m.parsefile(os.path.dirname(__file__) + '/meeps/furelise.mp') m.render()
def main(): m = Melopy('mary') m.parsefile(os.path.dirname(__file__) + '/scores/mary.mlp') m.render()
def main(): m = Melopy('menuet') m.parsefile(os.path.dirname(__file__) + '/scores/menuet.mlp') m.render()
def main(): m = Melopy('furelise') m.parsefile(os.path.dirname(__file__) + '/scores/furelise.mlp') m.render()