[Function]
(midi-file-print midifile {keyword value}*)

Prints the contents of midifile to a stream and returns midifile as its value.

midi-file-print supports the following keyword arguments:

:stream {stream}
The stream to print midifile to. The default value is the standard output.
:track number
The MIDI track number to print. The default value is 0.

Examples:

Example 1. Printing the contents of a MIDI file to the standard output.

(define (simp reps)
  (process repeat reps
           output (new midi :time (now)
                       :duration 1
                       :keynum (between 50 90))
           wait .5))

(events (list (new midi-program-change :time 0 :program 30)
              (simp 12))
        "test.mid" :timesig '(2 4) :tempo 120)
 "test.mid"

(midi-file-print "test.mid")
File: test.mid 
Format: 0
Tracks: 1
Division: 480
Track 0, length 123
       0 #<Tempo Change 500 ms>
       0 #<Time Signature 2/4 (24 clocks, 8 32nds)>
       0 #<Program-Change 0 "distortion-guitar">
       0 #<Note-On 0 53 64>
     240 #<Note-On 0 62 64>
     240 #<Note-Off 0 53 127>
       0 #<Note-On 0 88 64>
     240 #<Note-Off 0 62 127>
       0 #<Note-On 0 74 64>
     240 #<Note-Off 0 88 127>
       0 #<Note-On 0 64 64>
     240 #<Note-Off 0 74 127>
       0 #<Note-On 0 57 64>
     240 #<Note-Off 0 64 127>
       0 #<Note-On 0 68 64>
     240 #<Note-Off 0 57 127>
       0 #<Note-On 0 70 64>
     240 #<Note-Off 0 68 127>
       0 #<Note-On 0 77 64>
     240 #<Note-Off 0 70 127>
       0 #<Note-On 0 81 64>
     240 #<Note-Off 0 77 127>
       0 #<Note-On 0 62 64>
     240 #<Note-Off 0 81 127>
       0 #<Note-On 0 68 64>
     240 #<Note-Off 0 62 127>
     240 #<Note-Off 0 68 127>
 "test.mid"

See also: