#!/usr/bin/env python

from pyknon.genmidi import Midi
from pyknon.musiclib import NoteSeq, Note


def demo():
    notes1 = NoteSeq("D4 F#8 A Bb4")
    notes2 = NoteSeq([Note(2, dur=1), Note(6, dur=0.5),
                      Note(9, dur=0.5), Note(10, dur=1)])
    midi = Midi(2, tempo=90)
    midi.seq_notes(notes1, track=0)
    midi.seq_notes(notes2, track=1)
    midi.write_file("demo.mid")


if __name__ == "__main__":
    demo()

@@ -87,33 +87,10 @@
 eSeq
-, Note%0A%0A%0Adef demo():%0A    
+%0A%0A
 note
@@ -122,126 +122,8 @@
 4%22)%0A
-    notes2 = NoteSeq(%5BNote(2, dur=1), Note(6, dur=0.5),%0A                      Note(9, dur=0.5), Note(10, dur=1)%5D)%0A    
 midi
@@ -130,17 +130,17 @@
  = Midi(
-2
+1
 , tempo=
@@ -143,20 +143,16 @@
 mpo=90)%0A
-    
 midi.seq
@@ -179,112 +179,32 @@
 =0)%0A
-    midi.seq_notes(notes2, track=1)%0A    midi.write_file(%22demo.mid%22)%0A%0A%0Aif __name__ == %22__main__%22:%0A    demo(
+midi.write_file(%22demo.mid%22
 )%0A

simplify demo