Added music21 and csound examples

This commit is contained in:
2023-06-28 00:55:56 +03:00
parent fe65c87ed2
commit 7d6ba407bd
14 changed files with 577 additions and 20 deletions

View File

@ -0,0 +1,20 @@
from music21 import *
from ziffers import *
# Create melody string
melody = "q 0 2 4 r e 1 4 3 2 s 0 1 2 6 e 2 8 2 1 h 0"
#bass_line = "(q 0 2 4 6 e 1 4 3 2 s 0 1 2 6 e 2 8 2 1 h 0)-7"
# Parse ziffers notation to melody from string
parsed = zparse(melody)
#parsed_bass = zparse(bass_line)
# Convert to music21 object
s2 = to_music21(parsed, time="4/4")
# Merge melody and bass line
#s2.append(to_music21(parsed_bass, time="4/4"))
# Write to midi file under examples/music21/midi folder
s2.write('midi', fp='examples/music21/output/ziffers_example.mid')