Exemple #1
0
    m = Melopy('canon', 50)
    melody = []

    for start in ['d4', 'a3', 'b3m', 'f#3m', 'g3', 'd3', 'g3', 'a3']:
        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():