Skip to content

Latest commit

 

History

History
73 lines (52 loc) · 1.61 KB

README.org

File metadata and controls

73 lines (52 loc) · 1.61 KB

cm-svg adds a svg backend to cm. It is a seperate package depending on svg-import-export and the common lisp version of Common Music.

Installation

with asdf or quicklisp:

(require 'cm-svg)

with quicklisp:

(ql:quickload "cm-svg")

Example:

(in-package :cm)

(events
 (process
   for keynum in '(60 62 64 65 67)
   output (new midi :time (now) :keynum keynum :duration 0.5)
   wait 0.5)
 "/tmp/test.svg"
 :piano-roll-vis t
 :staff-system-vis t
 :showgrid t
 :x-scale 8)

;;; -> "/tmp/test.svg"

Importing from svg:

(defparameter *myseq* (import-events "/tmp/test.svg" :x-scale 1/8))

Converting to MIDI:

(events
 (import-events "/tmp/test.svg" :x-scale 1/8)
 "test.midi"
 :play nil)

;;; -> "/tmp/test.midi"

When cm-incudine is installed and rts is started the svg file can be played in realtime using midi:

(sprout *myseq*)

Note: cm-svg is not defined as a package on its own. It is evaluated within the :cm package, extending its functionality.