;;; -*- Syntax: Common-Lisp; Package: COMMON-MUSIC; Base: 10; Mode: Lisp -*- ;;; This example plays the same simple melody as MIDI-mk.lisp but in a hocket on ;;; all 16 midi channels. (in-package :stella) (in-syntax :music-kit t) ;; First define a part for each channel and collect all parts into a list (defvar parts-list (loop for ch from 1 to 16 as name = (format nil "chan~d" ch) ; create a name for the part, "chan1, etc." collect (make-part :name name :flags +system+ :info (list "synthPatch:\"midi\"" ; specify midi synthpatch (concatenate 'string "midiChan:" (write-to-string ch)))) )) ;; the above make-part arguments provide what gets printed into "test.parts" ;; which looks like: ;; part ch1; ;; ch1 synthPatch:"midi" midiChan:1; (algorithm round-robin mkMidi (velocity 100 length 200) ;; instead of using "items" to set up a stream, ch-parts-list itself can be converted into a stream ;; -- try this to get the underlying code to the "items" macro -- ;; (macroexpand '(items xxx)) ;; (setf part (item (MAKE-INSTANCE 'CYCLIC-ITEM-STREAM :ITEMS parts-list) ) rhythm (item (rhythms e e e e q e e e e q e e q q h. e e e e e e e e e e q e e q q h. e e e e e e e e e e q e e q q h. tempo 220)) keyNum (item (degrees d4 e f f f e g f e d f e f g a d5 a4 c5 bf4 g e g bf a f d e g f g a d5 a4 c5 bf4 g e g bf a f d e g f e d) ))) (stella:stella)