MidiShare Player Library for schemers


Jacques Herry

35, résid Corlay

22300 Lannion




Doc for mzPlayer3216 mzscheme extension. It's free... Use at your own risk look at gnu LGPL licence. Download the user and developer packages from http://www.grame.fr/MidiShare and install.

Download PLT package from http://www.cs.rice.edu/CS/PLT/packages/drscheme .The lib player library version 2.0 is donwloadable at ftp://www.grame.fr/pub/ For the functions utilisation, read the official doc in MidiShare developer distribution.

Diffs are commented in the list below.

And the doc are in MidiPlayer.pdf and MidiShare.pdf provided with MidiShare developer package or from ftp.grame.fr from the documentation directory.You need intall MidiShare before using this package. Look at MidiShare.htm for installation.


Scheme Grame Comments
"open-player" OpenPlayer  
"close-player" ClosePlayer  
"start-player" StartPlayer  
"cont-player" Contplayer  
"stop-player" StopPlayer  
"pause-player" PausePlayer  
"make-pos-player" add for scheme

(define my-pos make-pos-player

bar beat unit)
"set-pos-bbu-player!" SetPosBBUPlayer  
"set-pos-ms-player!" SetPosMsPlayer  
"set-loop-player!" SetLoopPlayer  
"set-loop-start-bbu-player!" SetLoopStartBBUPlayer  
"set-loop-end-bbu-player!" SetLoopEndBBUPlayer  
"set-loop-start-ms-player" SetLoopStartMsPlayer  
"set-loop-end-ms-player!" SetLoopEndMsPlayer  


"set-synchro-in-player!" SetSynchroInPlayer  
"set-synchro-out-player!" SetSynchroOutPlayer  
"set-smpte-offset-player! SetSMPTEOffsetPlayer You should make one smpte struct before.(bug here ? prehaps don't use)
"set-tempo-player!" SetTempoPlayer  




Without arg provide the filled state struct (define my-state (get-state-player player))

After you can use this "my-state" all the time you want st struct values. As in C (memory economie I presume)

(get-state-player player my-state)

fill the struct my-state with the desired values
"get-end-score-player" GetEndScorePlayer  
"forward-step-player" ForwardStepPlayer  
"backward-step-player" BackwardStepPlayer  


"get-all-track-player" GetAllTrackPlayer  
"get-track-player" GetTrackPlayer  
"set-param-player!" SetParamPlayer  
"get-param-player" GetParamPlayer  


"insert-all-track-player" InsertAllTrackPlayer  
"insert-track-player" InsertTrackPlayer  

Add for scheme.

*see sample of use in play.scm

(define my-info (make-midi-file-infos format timedef clicks tracks))

As in C struct, for "midi-file-load" and save below



"midi-file-save" MidiFileSave As in C


*warning this in c return eror code

here return midi-infos scheme structure

As in C 

(midi-file-load "file.mid" my-info)

return player error code my-info structure is filled with all information from the midi-file loaded so you can look at with "midi-file-infos-'fieldName'".