You can make music programmatically. This time I coded the first part of the tulip.
pyknon.py
# -*- coding: utf-8 -*-
from pyknon.genmidi import Midi
from pyknon.music import NoteSeq
#Scale? The set
notes1 = NoteSeq("C D E")
notes2 = NoteSeq("C D E")
notes3 = NoteSeq("G E D C D E D")
#Generate Midi instance by specifying tempo
midi = Midi(tempo=90)
#Connect notes 1 to 3 by specifying the time when the sound sounds
midi.seq_notes(notes1)
midi.seq_notes(notes2, time=4)
midi.seq_notes(notes3, time=8)
#File writing
midi.write("demo.mid")
This is great and interesting!
pypi github document-like Correspondence table between MIDI note numbers and frequencies
Recommended Posts