I'm using a Lisp MIDI library for a small project I'm working on. Just to get started, I'm trying to write a simple MIDI file that plays middle C. However I can't seem to get this to work and can not find any documentation on how to do this sort of thing. Here is my code:
(defun make-track ()
(list
(make-instance 'midi:note-on-message
:time 0
:key 60
:velocity 100
:status 0)
(make-instance 'midi:note-off-message
:time 128
:key 60 :velocity 100
:status 0)))
(defun make-tracks ()
(list (make-track)))
(defun try-to-write-midi-file ()
(let* ((my-midi-file (make-instance 'midi:midifile
:format 1
:tracks (make-tracks)
:division 25)))
(midi:write-midi-file my-midi-file "opus.mid")))
It is creating a MIDI file but one of 0 seconds duration, which does not seem to have a middle C playing in it.
Can anyone tell me what I'm doing wrong here?