├── .gitignore ├── .svn ├── entries ├── prop-base │ └── install.sh.svn-base └── text-base │ ├── CHANGELOG.svn-base │ ├── COPYING.svn-base │ ├── README.svn-base │ ├── TODO.svn-base │ ├── accidentals.lisp.svn-base │ ├── backend_cmn.lisp.svn-base │ ├── backend_ly.lisp.svn-base │ ├── backend_mid.lisp.svn-base │ ├── backend_xml.lisp.svn-base │ ├── backends.lisp.svn-base │ ├── beams.lisp.svn-base │ ├── classes.lisp.svn-base │ ├── data.lisp.svn-base │ ├── deps.lisp.svn-base │ ├── examples.lisp.svn-base │ ├── final.lisp.svn-base │ ├── fomus.asd.svn-base │ ├── install.sh.svn-base │ ├── interface.lisp.svn-base │ ├── load.lisp.svn-base │ ├── main.lisp.svn-base │ ├── marks.lisp.svn-base │ ├── misc.lisp.svn-base │ ├── other.lisp.svn-base │ ├── ottavas.lisp.svn-base │ ├── package.lisp.svn-base │ ├── parts.lisp.svn-base │ ├── postproc.lisp.svn-base │ ├── quantize.lisp.svn-base │ ├── split.lisp.svn-base │ ├── splitrules.lisp.svn-base │ ├── staves.lisp.svn-base │ ├── util.lisp.svn-base │ ├── version.lisp.svn-base │ └── voices.lisp.svn-base ├── CHANGELOG ├── COPYING ├── README ├── README.md ├── TODO ├── accidentals.lisp ├── backend_cmn.lisp ├── backend_ly.lisp ├── backend_mid.lisp ├── backend_xml.lisp ├── backends.lisp ├── beams.lisp ├── classes.lisp ├── data.lisp ├── deps.lisp ├── doc ├── .svn │ ├── entries │ ├── prop-base │ │ ├── ex_accents.jpg.svn-base │ │ ├── ex_canning.jpg.svn-base │ │ ├── ex_chords.jpg.svn-base │ │ ├── ex_chunks1.jpg.svn-base │ │ ├── ex_cm_poly1.jpg.svn-base │ │ ├── ex_cm_poly2.jpg.svn-base │ │ ├── ex_cm_poly3pt.jpg.svn-base │ │ ├── ex_cm_poly6pt.jpg.svn-base │ │ ├── ex_keysigs1.jpg.svn-base │ │ ├── ex_mark_objs.jpg.svn-base │ │ ├── ex_marksfile1.jpg.svn-base │ │ ├── ex_marksfile2.jpg.svn-base │ │ ├── ex_orch_sco.jpg.svn-base │ │ ├── ex_overser.jpg.svn-base │ │ ├── ex_perc1.jpg.svn-base │ │ ├── ex_perc2.jpg.svn-base │ │ ├── ex_perc_autodurs.jpg.svn-base │ │ ├── ex_percfile.jpg.svn-base │ │ ├── ex_pno_chords.jpg.svn-base │ │ ├── ex_poly_slurs.jpg.svn-base │ │ ├── ex_qtones.jpg.svn-base │ │ ├── ex_simp_ex.jpg.svn-base │ │ ├── ex_txt_accents.jpg.svn-base │ │ ├── ex_txt_perc.jpg.svn-base │ │ ├── ex_txt_simp_ex.jpg.svn-base │ │ ├── usage_ex1.jpg.svn-base │ │ ├── usage_ex2.jpg.svn-base │ │ └── usage_ex3.jpg.svn-base │ └── text-base │ │ ├── backends.xml.svn-base │ │ ├── ch01.html.svn-base │ │ ├── ch02.html.svn-base │ │ ├── ch02s02.html.svn-base │ │ ├── ch02s03.html.svn-base │ │ ├── ch02s04.html.svn-base │ │ ├── ch02s05.html.svn-base │ │ ├── ch03.html.svn-base │ │ ├── ch03s02.html.svn-base │ │ ├── ch03s03.html.svn-base │ │ ├── ch03s04.html.svn-base │ │ ├── ch03s05.html.svn-base │ │ ├── ch03s06.html.svn-base │ │ ├── ch03s07.html.svn-base │ │ ├── ch03s08.html.svn-base │ │ ├── ch04.html.svn-base │ │ ├── ch04s02.html.svn-base │ │ ├── ch04s03.html.svn-base │ │ ├── ch04s04.html.svn-base │ │ ├── ch04s05.html.svn-base │ │ ├── ch04s06.html.svn-base │ │ ├── ch04s07.html.svn-base │ │ ├── ch04s08.html.svn-base │ │ ├── ch04s09.html.svn-base │ │ ├── ch04s10.html.svn-base │ │ ├── ch05.html.svn-base │ │ ├── ch05s02.html.svn-base │ │ ├── ch05s03.html.svn-base │ │ ├── ch05s04.html.svn-base │ │ ├── ch06.html.svn-base │ │ ├── ch06s02.html.svn-base │ │ ├── ch06s03.html.svn-base │ │ ├── ch06s04.html.svn-base │ │ ├── ch07.html.svn-base │ │ ├── ch07s02.html.svn-base │ │ ├── ch07s03.html.svn-base │ │ ├── ch07s04.html.svn-base │ │ ├── ch07s05.html.svn-base │ │ ├── ch07s06.html.svn-base │ │ ├── ch07s07.html.svn-base │ │ ├── ch07s08.html.svn-base │ │ ├── ch07s09.html.svn-base │ │ ├── ch08.html.svn-base │ │ ├── ch09.html.svn-base │ │ ├── ch09s02.html.svn-base │ │ ├── ch09s03.html.svn-base │ │ ├── ch09s04.html.svn-base │ │ ├── ex_accents.jpg.svn-base │ │ ├── ex_canning.jpg.svn-base │ │ ├── ex_chords.jpg.svn-base │ │ ├── ex_chunks1.jpg.svn-base │ │ ├── ex_cm_poly1.jpg.svn-base │ │ ├── ex_cm_poly2.jpg.svn-base │ │ ├── ex_cm_poly3pt.jpg.svn-base │ │ ├── ex_cm_poly6pt.jpg.svn-base │ │ ├── ex_keysigs1.jpg.svn-base │ │ ├── ex_mark_objs.jpg.svn-base │ │ ├── ex_marksfile1.jpg.svn-base │ │ ├── ex_marksfile2.jpg.svn-base │ │ ├── ex_orch_sco.jpg.svn-base │ │ ├── ex_overser.jpg.svn-base │ │ ├── ex_perc1.jpg.svn-base │ │ ├── ex_perc2.jpg.svn-base │ │ ├── ex_perc_autodurs.jpg.svn-base │ │ ├── ex_percfile.jpg.svn-base │ │ ├── ex_pno_chords.jpg.svn-base │ │ ├── ex_poly_slurs.jpg.svn-base │ │ ├── ex_qtones.jpg.svn-base │ │ ├── ex_simp_ex.jpg.svn-base │ │ ├── ex_txt_accents.jpg.svn-base │ │ ├── ex_txt_perc.jpg.svn-base │ │ ├── ex_txt_simp_ex.jpg.svn-base │ │ ├── examples.xml.svn-base │ │ ├── fomus.css.svn-base │ │ ├── fomus.xml.svn-base │ │ ├── index.html.svn-base │ │ ├── init.xml.svn-base │ │ ├── install.xml.svn-base │ │ ├── intro.xml.svn-base │ │ ├── marks.xml.svn-base │ │ ├── objects.xml.svn-base │ │ ├── settings.xml.svn-base │ │ ├── style.xsl.svn-base │ │ ├── usage.xml.svn-base │ │ ├── usage_ex1.jpg.svn-base │ │ ├── usage_ex2.jpg.svn-base │ │ └── usage_ex3.jpg.svn-base ├── backends.xml ├── ch01.html ├── ch02.html ├── ch02s02.html ├── ch02s03.html ├── ch02s04.html ├── ch02s05.html ├── ch03.html ├── ch03s02.html ├── ch03s03.html ├── ch03s04.html ├── ch03s05.html ├── ch03s06.html ├── ch03s07.html ├── ch03s08.html ├── ch04.html ├── ch04s02.html ├── ch04s03.html ├── ch04s04.html ├── ch04s05.html ├── ch04s06.html ├── ch04s07.html ├── ch04s08.html ├── ch04s09.html ├── ch04s10.html ├── ch05.html ├── ch05s02.html ├── ch05s03.html ├── ch05s04.html ├── ch06.html ├── ch06s02.html ├── ch06s03.html ├── ch06s04.html ├── ch07.html ├── ch07s02.html ├── ch07s03.html ├── ch07s04.html ├── ch07s05.html ├── ch07s06.html ├── ch07s07.html ├── ch07s08.html ├── ch07s09.html ├── ch08.html ├── ch09.html ├── ch09s02.html ├── ch09s03.html ├── ch09s04.html ├── ex_accents.jpg ├── ex_canning.jpg ├── ex_chords.jpg ├── ex_chunks1.jpg ├── ex_cm_poly1.jpg ├── ex_cm_poly2.jpg ├── ex_cm_poly3pt.jpg ├── ex_cm_poly6pt.jpg ├── ex_keysigs1.jpg ├── ex_mark_objs.jpg ├── ex_marksfile1.jpg ├── ex_marksfile2.jpg ├── ex_orch_sco.jpg ├── ex_overser.jpg ├── ex_perc1.jpg ├── ex_perc2.jpg ├── ex_perc_autodurs.jpg ├── ex_percfile.jpg ├── ex_pno_chords.jpg ├── ex_poly_slurs.jpg ├── ex_qtones.jpg ├── ex_simp_ex.jpg ├── ex_txt_accents.jpg ├── ex_txt_perc.jpg ├── ex_txt_simp_ex.jpg ├── examples.xml ├── fomus.css ├── fomus.xml ├── index.html ├── init.xml ├── install.xml ├── intro.xml ├── marks.xml ├── objects.xml ├── settings.xml ├── style.xsl ├── usage.xml ├── usage_ex1.jpg ├── usage_ex2.jpg └── usage_ex3.jpg ├── examples.lisp ├── extra └── jianpu10b.ly ├── final.lisp ├── fomus.asd ├── install.sh ├── interface.lisp ├── load.lisp ├── main.lisp ├── marks.lisp ├── misc.lisp ├── modules ├── .svn │ ├── entries │ └── text-base │ │ ├── README.svn-base │ │ └── ads.lisp.svn-base ├── README ├── ads.lisp └── backends │ ├── .svn │ ├── entries │ └── text-base │ │ ├── notepro.lisp.svn-base │ │ └── timedump.lisp.svn-base │ ├── notepro.lisp │ └── timedump.lisp ├── other.lisp ├── ottavas.lisp ├── package.lisp ├── parts.lisp ├── postproc.lisp ├── quantize.lisp ├── split-changed.lisp ├── split.lisp ├── splitrules.lisp ├── staves.lisp ├── util.lisp ├── version.lisp └── voices.lisp /.gitignore: -------------------------------------------------------------------------------- 1 | *.fasl 2 | *~ 3 | -------------------------------------------------------------------------------- /.svn/prop-base/install.sh.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /.svn/text-base/CHANGELOG.svn-base: -------------------------------------------------------------------------------- 1 | Fixed a bug where spanners of certain types might cause errors (or SBCL to hang and eventually barf) 2 | Also added a :DETACHED option for text marks (it will break LilyPond compiling, though, unless you override LilyPond's text markup strings) 3 | Added :NOPOS option to text marks (can specify :UP, :DOWN or :NOPOS now) 4 | 5 | v0.2.28 6 | CLISP/filename annoyances fixed 7 | CLISP/LilyPond fix 8 | Fixed user-specified staves conflicting with voice assignments (need to test further) 9 | 10 | v0.2.27 11 | Chunks examples 12 | Work on chunks 13 | 14 | v0.2.26 15 | Improvements to spanners 16 | Some documentation that can be called up by the Lisp DOCUMENTATION function 17 | :STAFF, :STARTSTAFF-, :STAFF-, :ENDSTAFF- marks to override staff choices 18 | 19 | v0.2.25 20 | Fixed weird OpenMCL compiling error (caused by SLIME?) 21 | Lilypond 2.10 tuplet style fix (Anders) 22 | 23 | v0.2.24 24 | Fixed tuplet note values when they span an irregular number of beats (6:5, 8:7, etc.) 25 | 26 | v0.2.23 27 | Fixed XML adding redundant clef at beginning of output 28 | Fixed measure rests bug in XML output (caused SBCL to hang) 29 | 30 | v0.2.22 31 | Fixed instrument names and abbreviations in LilyPond 2.10 32 | Remove newlines from notetexts, etc.. 33 | Auto set timesig COMP slot to t for appropriate time signatures (6/8, etc.) 34 | Fix for textnotes in LilyPond (Kilian) 35 | Changed maximum tuplet size to more reasonable number 36 | 37 | v0.2.21 38 | Fixed bug where key signature algorithm was choking on rests 39 | 40 | v0.2.20 41 | Fixed small quantizing bug created in 0.2.12 (FOMUS occasionally couldn't find tuplets) 42 | 43 | v0.2.19 44 | Fixed inability to find LilyPond 2.10 executable 45 | 46 | v0.2.18 47 | Eliminated annoying messages 48 | 49 | v0.2.17 50 | Fixed another dumb error in accidentals (choked on empty parts) 51 | 52 | v0.2.16 53 | Efficiency tweaks 54 | Fixed a dumb error in accidentals created in v0.2.15 55 | 56 | v0.2.15 57 | Updated install.sh script 58 | 59 | v0.2.14 60 | Fix in MIDI backend for instruments that don't have a MIDI program change number (defaults to 0) 61 | Support for key signatures finished (auto-accidentals algorithm takes key signature into account)--some testing/tweaking probably still needed 62 | 63 | v0.2.13 64 | Fixed errors w/ compiling/loading modules 65 | 66 | v0.2.12 67 | Some module-compiling/loading enhancements w/ ASDF (Kilian) 68 | Fixed huge performance bottleneck noticeable especially in OpenMCL--now runs at least 30x faster in OpenMCL and slightly faster in other Lisps 69 | (small tweak in quantize function was all that was needed) 70 | Changed "plugins" to "modules" everywhere (seems to be a better name for them) 71 | 72 | v0.2.11 73 | Fixed some spanner bugs 74 | Timedump backend module 75 | 76 | v0.2.10 77 | Squashed a few bugs 78 | :NOTES keyword in .fms files for specifying chords 79 | AUTO-DYN-NODUP setting and cleaning repeated dynamic marks (more user control to be added) 80 | OFF tags in .fms file for shifting offsets over sections of file 81 | FOMUS uses ASDF (and ASDF-Binary-Locations) to determine where module .fasl files are placed 82 | Changed some setting names 83 | Fixed LilyPond backend bug involving alternate noteheads and grace notes 84 | Added MARKS slot to percussion instrument definition 85 | Added some more LilyPond settings 86 | Straightened out deffomusmodule and made it look more like defpackage 87 | Fixed bug with beaming in compound meters 88 | 89 | v0.2.9 90 | Fixed a modules bug (deffomusmodule macro) 91 | Fixed bug where automatically generated timesigs copied unwanted properties (ie. specified barlines) from neighboring timesigs 92 | 93 | v0.2.8 94 | Grace notes can have floating point durations 95 | :IGNORE mark can be used repeatedly 96 | INPUT-OFFSET setting (shift events before processing) 97 | Fixed minor bug in post-processing w/ voices and grace notes 98 | 99 | v0.2.7 100 | .fms file load errors now show entry number and line where error occurred 101 | Load-on-demand modules for accidentals, voices, staves/clefs, splitrules and backends 102 | Added :IGNORE mark (does nothing) 103 | Can compile command-line interface w/ CLISP 104 | (Experimental) Adaptive search (Kilian) 105 | (Experimental) Functionality for merging results of several fomus calls into one score (chunks) 106 | ".fms" files may contain "\" characters for reading several lines as one line 107 | Improved command line interface (added some options) 108 | Fixed install.sh bugs 109 | 110 | v0.2.6 111 | Fixed small error with INSTR-MIDIPRGCH-EX slot when specifying an instrument with modifications 112 | 113 | v0.2.5 114 | Mid-measure clef changes in MusicXML 115 | 116 | v0.2.4 117 | Fixed bug with multiple marks on one note in MusicXML backend 118 | 119 | v0.2.3 120 | REGISTER-BACKENDS function (Kilian)--removed +title+ +version+ from callback arguments and exported these (David) 121 | Fixed more CLISP issues in Windows (viewing/compiling in LilyPond and CMN, finding executables) 122 | (:SIZE :SMALL) and (:SIZE :TINY) marks (not in backends yet) 123 | Fixed bug where harmonics weren't being spread over tied notes 124 | Fixed bug involving 8va symbols over single notes/chords 125 | Fixed harmonic/flageolet bug in LilyPond 126 | Part name fix in LilyPond and CMN backends (Kilian) 127 | 128 | v0.2.2 129 | CLISP port nearly (or maybe all) complete (errors with loop macros--still testing, haven't tested in Winblows yet) 130 | Can choose which backends to compile with or leave out of installation 131 | MIDI backend also takes a user callback function as its PLAY argument 132 | 133 | v0.2.1 134 | Fixed error with some clef signatures in LilyPond (ones with underscores) 135 | 136 | v0.2.0 137 | Version bump 138 | -------------------------------------------------------------------------------- /.svn/text-base/README.svn-base: -------------------------------------------------------------------------------- 1 | FOMUS 2 | Lisp music notation formatter 3 | See file "COPYING" for terms of use and distribution. 4 | 5 | 6 | 7 | Fomus is alpha software, and still has a lot of testing and bug fixing to go 8 | before all of its features are useable. Not all features that appear in the 9 | documentation are implemented or working yet. 10 | 11 | 12 | The program is available via anonymous CVS. To download it, type the following: 13 | 14 | cd path_to_install_directory 15 | cvs -z3 -d :pserver:anonymous:anonymous@common-lisp.net:/project/fomus/cvsroot co fomus 16 | 17 | 18 | See the file "fomus.html" in the doc directory for instructions on how to use 19 | the program. The following command loads FOMUS into lisp: 20 | 21 | (load "path_to_fomus_directory/load.lisp") 22 | (use-package :fm) 23 | 24 | 25 | The program is being developed in CMUCL, but should also compile in SBCL and 26 | OpenMCL. It will eventually run in Allegro Common Lisp and CLISP. 27 | 28 | 29 | If you wish to report a bug, make FOMUS generate a debug file (the default 30 | filename is "/tmp/fomus.dbg") and send it to dpsenick(at)uiuc(dot)edu. See the 31 | DEBUG-FILENAME setting in the FOMUS documentation for more information. 32 | -------------------------------------------------------------------------------- /.svn/text-base/TODO.svn-base: -------------------------------------------------------------------------------- 1 | TODO LIST 2 | 3 | Immediate: 4 | 5 | Bugs: 6 | Weird number choices for some tuplets (12 instead of 6, 10 instead of 5, etc.)--should check neighboring tuplet numbers for consistency 7 | Double brackets shouldn't appear in the same place (6 violins example) 8 | Send list of XML issues to Sibelius/Finale tech. support 9 | In CLISP/Cygwin output from executables isn't suppressed (fixable?) 10 | Documentation: 11 | Module interface 12 | Proofreading 13 | More examples (eventually indexed and covering most/all features) 14 | Backends: 15 | MusicXML invisible rests (possible?) 16 | CMN grace notes preceding rests 17 | CMN tremolos 18 | CMN cautionary accidentals on chords 19 | CMN part groups/brackets 20 | MIDI output testing/adjusting/fine tuning 21 | Improvements: 22 | Shortcuts for some marks (example: (:slurto 1) to slur to next note, (:slurto 2) for next two, etc.) 23 | Check Finale and Siblius updates for changes in MusicXML import 24 | Laissez vibrer ties (options to automatically add l.v. ties with autodurs) 25 | Finish chunks support 26 | Finish implementing :invisible mark 27 | Allow forcing of staff choices (individual notes and entire voice) 28 | More control over harmonics 29 | Quantization modules 30 | Additions: 31 | Onset-to-onset durations 32 | Specifying percussion from MIDI info 33 | Automatic percussion instrument changes 34 | Splitting chords across staves 35 | Presets for customizing auto-algorithms 36 | Some more marks: 37 | pedal on/off 38 | double/triple tongue 39 | bartok pizz. 40 | Number of lines in staff (single-line for percussion) 41 | 42 | Short Term: 43 | 44 | Ornaments/trills with accidentals greater than a whole/half step (if notatable in backends) 45 | Proportional notation 46 | Support for polymeters in backends 47 | 48 | Long Term: 49 | 50 | Fractional meters and tuplets 51 | 52 | -------------------------------------------------------------------------------- /.svn/text-base/backends.lisp.svn-base: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3 | ;;************************************************************************************************** 4 | ;; FOMUS 5 | ;; backends.lisp 6 | ;;************************************************************************************************** 7 | 8 | (in-package :fomus) 9 | (compile-settings) 10 | 11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 12 | 13 | #+sbcl (eval-when (:compile-toplevel :load-toplevel :execute) (require :sb-posix)) 14 | 15 | (declaim (type (or symbol list) *backend* *output*)) 16 | (defparameter *backend* nil) 17 | (defparameter *output* (list (first (first *backendexts*)))) 18 | (defparameter *filename* (namestring (merge-pathnames "fomus" +tmp-path+))) 19 | 20 | (defun save-raw (filename parts) 21 | (declare (type list parts)) 22 | (when (>= *verbose* 1) (out ";; Saving raw output file ~S...~%" filename)) 23 | (with-standard-io-syntax 24 | (let ((*print-pretty* t)) 25 | (with-open-file (f filename :direction :output :if-exists :supersede) 26 | (format f ";; -*-lisp-*-~%;; ~A v~A.~A.~A Raw Output File~%~%" +title+ (first +version+) (second +version+) (third +version+)) 27 | (prin1 +version+ f) 28 | (fresh-line f) 29 | (prin1 parts f) 30 | (fresh-line f))))) 31 | 32 | ;; (defvar *registered-backends* (make-hash-table)) 33 | 34 | ;; (defun register-backend (backend callback) 35 | ;; (setf (gethash backend *registered-backends*) callback)) 36 | 37 | (defun backend (backend filename dir parts options process play view) 38 | (declare (ignorable options process play view) 39 | (type symbol backend) (type list parts) (type list options) (type boolean process) (type boolean view)) 40 | (let ((*old-objects* nil)) 41 | (flet ((format-comment (cstr) (apply #'format nil cstr +title+ +version+))) 42 | (unwind-protect 43 | (case backend 44 | ((:data :fomus)) 45 | (:raw (save-raw filename parts)) 46 | ((:none :chunk) nil) 47 | #-fomus-nocmn 48 | (:cmn (save-cmn parts (format-comment +cmn-comment+) filename options process view)) 49 | #-fomus-nolilypond 50 | (:lilypond (save-lilypond parts (format-comment +lilypond-comment+) filename options process view)) 51 | #-fomus-nomusicxml 52 | (:musicxml (save-xml parts (format-comment +xml-comment+) filename options)) 53 | #-fomus-nomusicxml 54 | (:musicxml-sibelius (save-xmlsibelius parts (format-comment +xml-comment+) filename options)) 55 | #-fomus-nomusicxml 56 | (:musicxml-finale (save-xmlfinale parts (format-comment +xml-comment+) filename options)) 57 | #-fomus-nomidi (:midi (save-midi parts filename options play)) 58 | (otherwise 59 | (load-fomus-module backend) 60 | (call-module backend '("Invalid backend ~S" backend) ; exported +title+ and +version+ so they can just be accessed as variables--seems redundant if they are passed as arguments 61 | parts filename options process view))) 62 | (#+cmu unix:unix-chdir #+sbcl sb-posix:chdir #+openmcl ccl:cwd #+allegro excl:chdir #+lispworks hcl:change-directory #+clisp ext:cd (namestring dir)))))) 63 | 64 | -------------------------------------------------------------------------------- /.svn/text-base/deps.lisp.svn-base: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3 | ;;************************************************************************************************** 4 | ;; FOMUS 5 | ;; deps.lisp 6 | ;;************************************************************************************************** 7 | 8 | (in-package :fomus) 9 | (compile-settings) 10 | 11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 12 | ;; COMMON MUSIC 13 | 14 | (declaim (type boolean *use-cm* *cm-exists*) 15 | (type (or function null) *cm-notefun* *cm-keynumfun* *cm-rhythmfun*)) 16 | (defparameter *use-cm* t) 17 | (defparameter *cm-exists* nil) 18 | 19 | (defparameter *cm-scale* nil) 20 | (defparameter *cm-notefun* nil) 21 | (defparameter *cm-keynumfun* nil) 22 | (defparameter *cm-rhythmfun* nil) 23 | (defparameter *cm-midi* nil) 24 | (defparameter *cm-events* nil) 25 | (defparameter *cm-rts* nil) 26 | (defparameter *cm-midipbend* nil) 27 | 28 | (defparameter *cm-midioff* nil) 29 | (defparameter *cm-midioffslot* nil) 30 | (defparameter *cm-mididur* nil) 31 | (defparameter *cm-mididurslot* nil) 32 | (defparameter *cm-midinote* nil) 33 | (defparameter *cm-midinoteslot* nil) 34 | (defparameter *cm-midichslot* nil) 35 | (defparameter *cm-midivel* nil) 36 | (defparameter *cm-midivelslot* nil) 37 | (defparameter *cm-progch* nil) 38 | 39 | (defun find-cm () 40 | (when (and (not *cm-exists*) (find-package "CM")) 41 | (when (>= *verbose* 2) (format t ";; Common Music package detected~%")) 42 | (setf *cm-exists* t 43 | *cm-notefun* (symbol-function (find-symbol "NOTE" :cm)) 44 | *cm-keynumfun* (symbol-function (find-symbol "KEYNUM" :cm)) 45 | *cm-rhythmfun* (symbol-function (find-symbol "RHYTHM" :cm)) 46 | *cm-midi* (find-symbol "MIDI" :cm) 47 | *cm-progch* (find-symbol "MIDI-PROGRAM-CHANGE" :cm) 48 | *cm-midioff* (symbol-function (find-symbol "OBJECT-TIME" :cm)) 49 | *cm-midioffslot* (find-symbol "TIME" :cm) 50 | *cm-mididur* (symbol-function (find-symbol "MIDI-DURATION" :cm)) 51 | *cm-mididurslot* (find-symbol "DURATION" :cm) 52 | *cm-midinote* (symbol-function (find-symbol "MIDI-KEYNUM" :cm)) 53 | *cm-midinoteslot* (find-symbol "KEYNUM" :cm) 54 | *cm-midichslot* (find-symbol "CHANNEL" :cm) 55 | *cm-midivel* (symbol-function (find-symbol "MIDI-AMPLITUDE" :cm)) 56 | *cm-midivelslot* (find-symbol "AMPLITUDE" :cm) 57 | *cm-events* (symbol-function (find-symbol "EVENTS" :cm)) 58 | *cm-midipbend* (find-symbol "MIDI-PITCH-BEND" :cm) 59 | *cm-rts* (ignore-errors (symbol-function (find-symbol "RTS" :cm))) 60 | ))) 61 | 62 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 63 | ;; COMMON MUSIC NOTATION 64 | 65 | (defparameter *cmn-exists* nil) 66 | 67 | (defun find-cmn () 68 | (when (and (not *cmn-exists*) (find-package "CMN")) 69 | (when (>= *verbose* 2) (format t ";; Common Music Notation package detected~%")) 70 | (setf *cmn-exists* t 71 | ))) -------------------------------------------------------------------------------- /.svn/text-base/final.lisp.svn-base: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3 | ;;************************************************************************************************** 4 | ;; FOMUS 5 | ;; final.lisp 6 | ;;************************************************************************************************** 7 | 8 | (in-package :fomus) 9 | (compile-settings) 10 | 11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 12 | 13 | (defparameter +initfilename+ (namestring (merge-pathnames ".fomus" (user-homedir-pathname)))) 14 | 15 | ;; initfile 16 | (defun load-initfile (&optional (filename +initfilename+) (info t)) 17 | "FOMUS init function: 18 | Reloads the \"~/.fomus\" initialization file" 19 | (with-open-file (f filename :direction :input :if-does-not-exist nil) 20 | (when f 21 | (when info (out ";; Loading initialization file ~S...~%" filename)) 22 | (loop 23 | with nt0 24 | for x = (read f nil 'eof) 25 | #-clisp until #-clisp (eq x 'eof) 26 | for y = #-clisp (read f nil 'eof) #+clisp (if (eq x 'eof) (loop-finish) (read f nil 'eof)) 27 | when (eq y 'eof) do (error "KEYWORD/ARGUMENT-PAIRS expected in initialization file") 28 | do (setf nt0 (find-symbol (conc-strings "*" (symbol-name x) "*") :fomus)) 29 | if nt0 do (unless (ignore-errors (eval `(progn (setf ,(find-symbol (conc-strings "*" (symbol-name x) "*") :fomus) ,y) t))) 30 | (format t ";; WARNING: Error setting ~S to value ~S in initialization file~%" x y)) 31 | else do (format t ";; WARNING: Unknown setting ~S in initialization file~%" x) 32 | finally 33 | (return t))))) 34 | 35 | (defparameter +fomus-dir+ #+asdf (or (ignore-errors (asdf:component-pathname (asdf:find-system :fomus))) *load-truename*) #-asdf *load-truename*) 36 | (defun register-fomus-modules (&optional (info t)) 37 | (map nil 38 | (lambda (file) 39 | (multiple-value-bind (value error) 40 | (ignore-errors (register-fomus-module file)) 41 | (when (and (null value) info) 42 | (format t ";; NOTE: Can't compile/register module file ~S~%; (~A)~%" (namestring file) (commentify (format nil "~A" error) 1))))) 43 | (nconc (directory (merge-pathnames "modules/*.lisp" +fomus-dir+)) 44 | (directory (merge-pathnames "modules/backends/*.lisp" +fomus-dir+)))) 45 | (when info (format t "~&")) 46 | t) 47 | 48 | (eval-when (:load-toplevel :execute) 49 | (export (mapcar (lambda (x) (find-symbol (conc-strings "*" (symbol-name (first x)) "*") :fomus)) +settings+) :fomus)) 50 | 51 | (eval-when (:load-toplevel :execute) (provide :fomus)) 52 | 53 | ;; feature 54 | (eval-when (:load-toplevel :execute) 55 | (pushnew :fomus *features*)) 56 | 57 | ;; print load greeting 58 | (eval-when (:load-toplevel :execute) 59 | (when (>= *verbose* 1) (format t "~&~%;; ~A v~A.~A.~A~%~A~%" 60 | +title+ 61 | (first +version+) (second +version+) (third +version+) 62 | (conc-stringlist (loop for e in +banner+ collect (format nil ";; ~A~%" e)))))) 63 | 64 | (eval-when (:load-toplevel :execute) 65 | (find-cm) (find-cmn)) 66 | 67 | (eval-when (:load-toplevel :execute) 68 | (unless (find-symbol "+FOMUS-INSTALL+" :common-lisp-user) 69 | (load-initfile) 70 | #-fomus-noautoreg (register-fomus-modules nil))) 71 | 72 | (defun fomus-exe (initfile opts basename quality verbosity &rest filename) 73 | (let ((*package* (find-package "FOMUS"))) 74 | (catcherr 75 | (load-initfile initfile nil) 76 | (register-fomus-modules nil) 77 | (let* ((v (when (find #\w opts) t)) 78 | (o (nconc (when (string/= quality "") (list :quality (ignore-errors (read-from-string quality)))) 79 | (when (string/= basename "") (list :filename basename)) 80 | (when (string/= verbosity "") (list :verbose (ignore-errors (read-from-string verbosity)))) 81 | (let ((x (nconc 82 | (when (find #\l opts) (list (list :lilypond :view v))) 83 | (when (find #\c opts) (list (list :cmn :view v))) 84 | (when (find #\m opts) (list (list :fomus))) 85 | (cond ((find #\f opts) (list (list :musicxml-finale))) 86 | ((find #\s opts) (list (list :musicxml-sibelius))) 87 | ((find #\x opts) (list (list :musicxml))))))) 88 | (when x (cons :output x)))))) 89 | (fomus-text (if (list1p filename) (first filename) filename) o #'fomus-textexec)))) 90 | (fresh-line) 91 | (finish-output) 92 | #+cmu (ext:quit) #+sbcl (sb-ext:quit) #+openmcl (ccl:quit) #+clisp (ext:quit)) 93 | 94 | -------------------------------------------------------------------------------- /.svn/text-base/fomus.asd.svn-base: -------------------------------------------------------------------------------- 1 | ;; -*-lisp-*- 2 | ;; ASDF System for FOMUS 3 | 4 | (asdf:defsystem "fomus" 5 | 6 | :description "Lisp music notation formatter" 7 | :version "0.2.28" 8 | :author "David Psenicka" 9 | :licence "LLGPL" 10 | 11 | :components 12 | ((:file "package") 13 | (:file "version" :depends-on ("package")) 14 | (:file "misc" :depends-on ("package")) 15 | (:file "deps" :depends-on ("package")) 16 | (:file "data" :depends-on ("misc" "deps")) 17 | (:file "classes" :depends-on ("data")) 18 | (:file "util" :depends-on ("classes")) 19 | 20 | (:file "splitrules" :depends-on ("util")) 21 | 22 | (:file "accidentals" :depends-on ("util")) 23 | (:file "beams" :depends-on ("util")) 24 | (:file "marks" :depends-on ("util")) 25 | (:file "other" :depends-on ("util")) 26 | (:file "ottavas" :depends-on ("util")) 27 | (:file "parts" :depends-on ("util")) 28 | (:file "postproc" :depends-on ("util")) 29 | (:file "split" :depends-on ("util" "splitrules")) 30 | (:file "staves" :depends-on ("util")) 31 | (:file "voices" :depends-on ("util")) 32 | (:file "quantize" :depends-on ("util" "splitrules")) 33 | 34 | #-fomus-nocmn (:file "backend_cmn" :depends-on ("util")) 35 | #-fomus-nolilypond (:file "backend_ly" :depends-on ("util")) 36 | #-fomus-nomusicxml (:file "backend_xml" :depends-on ("util")) 37 | #-fomus-nomidi (:file "backend_mid" :depends-on ("util")) 38 | (:file "backends" :depends-on (#-fomus-nocmn "backend_cmn" #-fomus-nolilypond "backend_ly" #-fomus-nomusicxml "backend_xml" #-fomus-nomidi "backend_mid" "version")) 39 | 40 | (:file "main" :depends-on ("accidentals" "beams" "marks" "other" "ottavas" "parts" "postproc" "split" "staves" "voices" "quantize" "backends")) 41 | 42 | (:file "interface" :depends-on ("main")) 43 | 44 | (:file "final" :depends-on ("version" "interface") :in-order-to ((load-op (load-op "interface")))) 45 | )) -------------------------------------------------------------------------------- /.svn/text-base/load.lisp.svn-base: -------------------------------------------------------------------------------- 1 | ;; -*-lisp-*- 2 | ;; Load file for FOMUS 3 | 4 | (loop with fl = '("package" "version" "misc" "deps" "data" "classes" "util" 5 | "splitrules" 6 | ("accidentals" "beams" "marks" "other" "ottavas" "parts" "postproc" "split" "staves" "voices" "quantize") 7 | (#-fomus-nocmn "backend_cmn" #-fomus-nolilypond "backend_ly" #-fomus-nomusicxml "backend_xml" #-fomus-nomidi "backend_mid") 8 | "backends" "main" "interface" "final") 9 | and nw 10 | for na in fl 11 | for cl = (if (listp na) (mapcar (lambda (x) (merge-pathnames x *load-truename*)) na) (list (merge-pathnames na *load-truename*))) 12 | for cn = (mapcar (lambda (x) (compile-file-pathname x)) cl) 13 | do (loop with nw0 14 | for cn0 in cn 15 | and cl0 in cl 16 | when (or nw 17 | (not (probe-file cn0)) 18 | (>= (file-write-date cl0) (file-write-date cn0))) 19 | do (compile-file cl0) (setf nw0 t) 20 | finally (setf nw nw0)) 21 | (map nil (lambda (x) (load x)) cn)) -------------------------------------------------------------------------------- /.svn/text-base/ottavas.lisp.svn-base: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3 | ;;************************************************************************************************** 4 | ;; FOMUS 5 | ;; ottavas.lisp 6 | ;;************************************************************************************************** 7 | 8 | (in-package :fomus) 9 | (compile-settings) 10 | 11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 12 | 13 | (declaim (type boolean *auto-ottavas*)) 14 | (defparameter *auto-ottavas* t) 15 | 16 | (declaim (type symbol *auto-ottavas-plugin* *auto-ottavas-module*)) 17 | (defparameter *auto-ottavas-plugin* nil) 18 | (defparameter *auto-ottavas-module* t) 19 | (declaim (inline auto-ottavas-fun)) 20 | (defun auto-ottavas-fun () (if (truep *auto-ottavas-module*) :ottavas1 *auto-ottavas-module*)) 21 | 22 | ;; maximum number of beats of rest before new ottava must be started 23 | (declaim (type (real (0)) *max-ottava-rest-dist*)) 24 | (defparameter *max-ottava-rest-dist* 3) 25 | 26 | (defun ottavas-byleglines (instr events) 27 | (declare (type instr instr) (type list events)) 28 | (when (instr-8uplegls instr) 29 | (loop 30 | with ub = (+ (notetowhite (lookup (loop-return-argmax (position c +clefs+ :key #'car) for c in (force-list (instr-clefs instr))) +clefs+)) 5) 31 | with u = (whitetonote (+ ub (* (car (instr-8uplegls instr)) 2))) 32 | and u0 = (whitetonote (+ ub (* (cdr (instr-8uplegls instr)) 2))) 33 | and uu and lo of-type (rational 0) = 0 and le 34 | for (e en) of-type (noteex (or noteex null)) on (remove-if-not #'notep events) 35 | for fo = (popmark e :8up) 36 | when (and (null uu) (or fo (> (event-writtennote e) u))) do (setf uu t) (addmark e :start8up-) 37 | when (> (event-writtennote e) u) do (setf lo (max lo (event-endoff e)) le e) ; last offset, last event 38 | when (and uu (not fo) 39 | (or (null en) ;; (>= (- (event-off e) lo) *max-ottava-rest-dist*) 40 | (and (<= (event-writtennote e) u0) (>= (- (event-off e) lo) *max-ottava-rest-dist*)))) do (setf uu nil) (addmark le :end8up-) 41 | finally 42 | (when uu (addmark le :end8up-)))) 43 | (when (instr-8dnlegls instr) 44 | (loop 45 | with lb = (- (notetowhite (lookup (loop-return-argmin (position c +clefs+ :key #'car) for c in (force-list (instr-clefs instr))) +clefs+)) 5) 46 | with l = (whitetonote (- lb (* (car (instr-8dnlegls instr)) 2))) 47 | and l0 = (whitetonote (- lb (* (cdr (instr-8dnlegls instr)) 2))) 48 | and ll and lo of-type (rational 0) = 0 and le 49 | for (e en) of-type (noteex (or noteex null)) on (remove-if-not #'notep events) 50 | for fo = (popmark e :8down) 51 | when (and (null ll) (or fo (< (event-writtennote e) l))) do (setf ll t) (addmark e :start8down-) 52 | when (< (event-writtennote e) l) do (setf lo (max lo (event-endoff e)) le e) 53 | when (and ll (not fo) 54 | (or (null en) ;; (>= (- (event-off e) lo) *max-ottava-rest-dist*) 55 | (and (>= (event-writtennote e) l0) (>= (- (event-off e) lo) *max-ottava-rest-dist*)))) do (setf ll nil) (addmark le :end8down-) 56 | finally 57 | (when ll (addmark le :end8down-)))) 58 | (print-dot)) 59 | 60 | (defun ottavas-rmmarks (events) 61 | (loop for e of-type (or noteex restex) in events 62 | do (loop for m of-type symbol in '(:8up :start8up- :8up- :end8up- :8down :start8down- :8down- :end8down-) 63 | do (rmmark e m)))) 64 | 65 | (defun ottavas (parts) 66 | (loop 67 | for p of-type partex in parts 68 | if (is-percussion p) do (ottavas-rmmarks (part-events p)) 69 | else do 70 | (get-usermarks (part-events p) :8up :start8up- :8up- :end8up- (lambda (e m) (declare (type (or noteex restex) e) (ignore m)) (addmark e :8up)) (part-name p)) 71 | (get-usermarks (part-events p) :8down :start8down- :8down- :end8down- (lambda (e m) (declare (type (or noteex restex) e) (ignore m)) (addmark e :8down)) (part-name p)) 72 | (case (auto-ottavas-fun) 73 | (:ottavas1 (ottavas-byleglines (part-instr p) (part-events p))) 74 | (otherwise (error "Unknown ottavas module ~S" *auto-ottavas-module*))))) 75 | 76 | (defun ottavas-generic (parts) 77 | (loop for p of-type partex in parts when (is-percussion p) do (ottavas-rmmarks (part-events p)))) -------------------------------------------------------------------------------- /.svn/text-base/package.lisp.svn-base: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3 | ;;************************************************************************************************** 4 | ;; FOMUS 5 | ;; package.lisp 6 | ;;************************************************************************************************** 7 | 8 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 9 | ;; PACKAGE 10 | 11 | ;; (eval-when (:compile-toplevel) 12 | ;; (let ((p (find-package :fomus))) 13 | ;; (when (and p (find-symbol "CM-STUB" p)) 14 | ;; (format t "~%~%;;; COMPILING FOMUS WITH COMMON MUSIC LOADED~%") 15 | ;; (format t ";;; IF THIS DOESN'T WORK:~%") 16 | ;; (format t ";;; 1. TRY IT AGAIN--IT MIGHT WORK THE SECOND TIME (IN CMUCL AND SBCL)~%") 17 | ;; (format t ";;; 2. COMPILE IT FIRST WITHOUT CM~%~%")))) 18 | ;; (eval-when (:compile-toplevel :load-toplevel) 19 | ;; (let ((p (find-package :fomus))) 20 | ;; (when p 21 | ;; (let ((s (find-symbol "CM-STUB" p))) 22 | ;; (when s 23 | ;; (unintern s p) 24 | ;; (map nil (lambda (x) (fmakunbound (find-symbol x p))) 25 | ;; '("OBJ-PARTID" "FOMUS" "MAKE-PART" "MAKE-NOTE" "GET-INSTR-SYMS" "FOMUS-FILE"))))))) 26 | 27 | (defpackage "FOMUS" 28 | (:nicknames "FM" "FMS") 29 | (:use "COMMON-LISP") 30 | (:documentation "FOMUS is an application for automatic formatting of music notation") 31 | (:export "FOMUS" "LOAD-INITFILE" ; interface functions 32 | "FOMUS-INIT" "FOMUS-NEWTIMESIG" "FOMUS-NEWPART" "FOMUS-NEWMARK" "FOMUS-NEWNOTE" "FOMUS-NEWREST" "FOMUS-EXEC" "FOMUS-PART" "FOMUS-FILE" 33 | "LIST-FOMUS-SETTINGS" "LIST-FOMUS-INSTRUMENTS" "LIST-FOMUS-INSTRGROUPS" "LIST-FOMUS-PERCUSSION" "LIST-FOMUS-CLEFS" 34 | "LIST-FOMUS-MEAS-DIVS" "LIST-FOMUS-TUPLET-DIVS" "GET-MIDI-INSTR" "IS-INSTR" "IS-CLEF" "GET-INSTR-SYMS" "GET-PERC-SYMS" 35 | "FOMUSCHUNK" "DEFFOMUSMODULE" "LOAD-FOMUS-MODULE" "LIST-FOMUS-MODULES" "REGISTER-FOMUS-MODULE" "REGISTER-FOMUS-MODULES" 36 | ; make/copy functions 37 | "MAKE-TIMESIG" "MAKE-TIMESIG-REPL" "MAKE-PART" "MAKE-MARK" "MAKE-NOTE" "MAKE-REST" "MAKE-INSTR" "MAKE-PERC" "COPY-INSTR" "COPY-PERC" "MAKE-MEAS" 38 | "COPY-TIMESIG" "COPY-TIMESIG-REPL" "COPY-EVENT" "COPY-PART" "COPY-MEAS" 39 | ; type predicates 40 | "FOMUSOBJP" "EVENTP" "MARKP" "DURP" "TIMESIGP" "PARTP" "NOTEP" "RESTP" "INSTRP" "PERCP" "MEASP" 41 | ; objects (meas is internal) 42 | "FOMUSOBJ-BASE" "EVENT-BASE" "MARK" "DUR-BASE" "TIMESIG-REPL" "TIMESIG" "NOTE" "REST" "PART" "INSTR" "PERC" "MEAS" ;;"KEYSIG" 43 | "OBJ-ID" "OBJ-PARTID" 44 | "EVENT-OFF" "EVENT-PARTID" "EVENT-PARTIDS" 45 | "TIMESIG-TIME" "TIMESIG-DIV" "TIMESIG-COMP" "TIMESIG-BEAT" "TIMESIG-PROPS" "TIMESIG-PARTIDS" "TIMESIG-REPL" 46 | "EVENT-DUR" "EVENT-MARKS" "EVENT-VOICE" "EVENT-NOTE" 47 | "PART-NAME" "PART-ABBREV" "PART-OPTS" "PART-EVENTS" "PART-INSTR" "PART-PARTID" 48 | ; instruments 49 | "INSTR-SYM" "INSTR-CLEFS" "INSTR-STAVES" "INSTR-MINP" "INSTR-MAXP" "INSTR-VOICELIM" "INSTR-TPOSE" "INSTR-LEGLS" "INSTR-8UPLEGLS" "INSTR-8DNLEGLS" 50 | "PERC-SYM" "PERC-STAFF" "PERC-NOTE" 51 | ; object extensions 52 | "EX-BASE" "NOTEEX" "RESTEX" "PARTEX" 53 | "MAKE-NOTEEX" "MAKE-RESTEX" "MAKE-PARTEX" 54 | "PART-MEAS" 55 | "EVENT-TUP" "EVENT-TIELT" "EVENT-TIERT" "EVENT-BEAMLT" "EVENT-BEAMRT" "EVENT-INV" "PART-PROPS" "PART-USERORD" 56 | "MEAS-TIMESIG" "MEAS-OFF" "MEAS-ENDOFF" "MEAS-EVENTS" "MEAS-PROPS" "MEAS-DIV" 57 | ; auxiliary accessors/functions 58 | ; caution: some only apply to OUTPUT .fms file extension objects, others only apply BEFORE calling fomus! 59 | "TIMESIG-OFF" "MEAS-VOICES" 60 | "ADDPROP" "GETPROP" "GETPROPS" "RMPROP" "COMBPROPS" "ADDMARK" "GETMARK" "GETMARKS" "RMMARK" "COMBMARKS" 61 | 62 | "+TITLE+" "+VERSION+")) 63 | 64 | (in-package :fomus) 65 | 66 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 67 | ;; GLOBAL 68 | 69 | (defmacro compile-settings () 70 | '(eval-when (:compile-toplevel) 71 | #+debug (declaim (optimize (safety 3) (debug 3))) 72 | #-debug (declaim (optimize (speed 3) (debug 0) (safety 0) #+(and cmu (not warn)) (ext:inhibit-warnings 3)) 73 | #+(and sbcl (not warn)) (sb-ext:muffle-conditions sb-ext:compiler-note)))) 74 | (compile-settings) 75 | 76 | (declaim (type (integer 0 2) *verbose*)) 77 | (defparameter *verbose* 1) 78 | 79 | ;; CLISP COMPATIBILITY 80 | 81 | #-clisp 82 | (defmacro mloop (&body forms) `(loop ,@forms)) 83 | #+clisp 84 | (defmacro mloop (&body forms) `(or (loop ,@forms) 0)) 85 | 86 | ;; PREVENT SILLY CM LOADING ERROR 87 | (intern "KEYSIG") 88 | ;; PREVENT WEIRD OPENMCL LOADING ERROR 89 | #+openmcl (eval-when (:load-toplevel :execute) (let ((s (find-symbol "INSTR" :common-lisp-user))) (when s (shadow s :common-lisp-user)))) 90 | -------------------------------------------------------------------------------- /.svn/text-base/version.lisp.svn-base: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3 | ;;************************************************************************************************** 4 | ;; FOMUS VERSION 5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 6 | 7 | (in-package :fomus) 8 | (compile-settings) 9 | 10 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 11 | 12 | (declaim (type string +title+) 13 | (type cons +version+ +banner+)) 14 | (defparameter +title+ "FOMUS") 15 | (defparameter +version+ '(0 2 28)) 16 | (defparameter +banner+ 17 | `("Lisp music notation formatter" 18 | "Copyright (c) 2005, 2006, 2007 David Psenicka, All Rights Reserved" 19 | "See file \"COPYING\" for terms of use and distribution.")) 20 | 21 | -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | Fixed a bug where spanners of certain types might cause errors (or SBCL to hang and eventually barf) 2 | Also added a :DETACHED option for text marks (it will break LilyPond compiling, though, unless you override LilyPond's text markup strings) 3 | Added :NOPOS option to text marks (can specify :UP, :DOWN or :NOPOS now) 4 | 5 | v0.2.28 6 | CLISP/filename annoyances fixed 7 | CLISP/LilyPond fix 8 | Fixed user-specified staves conflicting with voice assignments (need to test further) 9 | 10 | v0.2.27 11 | Chunks examples 12 | Work on chunks 13 | 14 | v0.2.26 15 | Improvements to spanners 16 | Some documentation that can be called up by the Lisp DOCUMENTATION function 17 | :STAFF, :STARTSTAFF-, :STAFF-, :ENDSTAFF- marks to override staff choices 18 | 19 | v0.2.25 20 | Fixed weird OpenMCL compiling error (caused by SLIME?) 21 | Lilypond 2.10 tuplet style fix (Anders) 22 | 23 | v0.2.24 24 | Fixed tuplet note values when they span an irregular number of beats (6:5, 8:7, etc.) 25 | 26 | v0.2.23 27 | Fixed XML adding redundant clef at beginning of output 28 | Fixed measure rests bug in XML output (caused SBCL to hang) 29 | 30 | v0.2.22 31 | Fixed instrument names and abbreviations in LilyPond 2.10 32 | Remove newlines from notetexts, etc.. 33 | Auto set timesig COMP slot to t for appropriate time signatures (6/8, etc.) 34 | Fix for textnotes in LilyPond (Kilian) 35 | Changed maximum tuplet size to more reasonable number 36 | 37 | v0.2.21 38 | Fixed bug where key signature algorithm was choking on rests 39 | 40 | v0.2.20 41 | Fixed small quantizing bug created in 0.2.12 (FOMUS occasionally couldn't find tuplets) 42 | 43 | v0.2.19 44 | Fixed inability to find LilyPond 2.10 executable 45 | 46 | v0.2.18 47 | Eliminated annoying messages 48 | 49 | v0.2.17 50 | Fixed another dumb error in accidentals (choked on empty parts) 51 | 52 | v0.2.16 53 | Efficiency tweaks 54 | Fixed a dumb error in accidentals created in v0.2.15 55 | 56 | v0.2.15 57 | Updated install.sh script 58 | 59 | v0.2.14 60 | Fix in MIDI backend for instruments that don't have a MIDI program change number (defaults to 0) 61 | Support for key signatures finished (auto-accidentals algorithm takes key signature into account)--some testing/tweaking probably still needed 62 | 63 | v0.2.13 64 | Fixed errors w/ compiling/loading modules 65 | 66 | v0.2.12 67 | Some module-compiling/loading enhancements w/ ASDF (Kilian) 68 | Fixed huge performance bottleneck noticeable especially in OpenMCL--now runs at least 30x faster in OpenMCL and slightly faster in other Lisps 69 | (small tweak in quantize function was all that was needed) 70 | Changed "plugins" to "modules" everywhere (seems to be a better name for them) 71 | 72 | v0.2.11 73 | Fixed some spanner bugs 74 | Timedump backend module 75 | 76 | v0.2.10 77 | Squashed a few bugs 78 | :NOTES keyword in .fms files for specifying chords 79 | AUTO-DYN-NODUP setting and cleaning repeated dynamic marks (more user control to be added) 80 | OFF tags in .fms file for shifting offsets over sections of file 81 | FOMUS uses ASDF (and ASDF-Binary-Locations) to determine where module .fasl files are placed 82 | Changed some setting names 83 | Fixed LilyPond backend bug involving alternate noteheads and grace notes 84 | Added MARKS slot to percussion instrument definition 85 | Added some more LilyPond settings 86 | Straightened out deffomusmodule and made it look more like defpackage 87 | Fixed bug with beaming in compound meters 88 | 89 | v0.2.9 90 | Fixed a modules bug (deffomusmodule macro) 91 | Fixed bug where automatically generated timesigs copied unwanted properties (ie. specified barlines) from neighboring timesigs 92 | 93 | v0.2.8 94 | Grace notes can have floating point durations 95 | :IGNORE mark can be used repeatedly 96 | INPUT-OFFSET setting (shift events before processing) 97 | Fixed minor bug in post-processing w/ voices and grace notes 98 | 99 | v0.2.7 100 | .fms file load errors now show entry number and line where error occurred 101 | Load-on-demand modules for accidentals, voices, staves/clefs, splitrules and backends 102 | Added :IGNORE mark (does nothing) 103 | Can compile command-line interface w/ CLISP 104 | (Experimental) Adaptive search (Kilian) 105 | (Experimental) Functionality for merging results of several fomus calls into one score (chunks) 106 | ".fms" files may contain "\" characters for reading several lines as one line 107 | Improved command line interface (added some options) 108 | Fixed install.sh bugs 109 | 110 | v0.2.6 111 | Fixed small error with INSTR-MIDIPRGCH-EX slot when specifying an instrument with modifications 112 | 113 | v0.2.5 114 | Mid-measure clef changes in MusicXML 115 | 116 | v0.2.4 117 | Fixed bug with multiple marks on one note in MusicXML backend 118 | 119 | v0.2.3 120 | REGISTER-BACKENDS function (Kilian)--removed +title+ +version+ from callback arguments and exported these (David) 121 | Fixed more CLISP issues in Windows (viewing/compiling in LilyPond and CMN, finding executables) 122 | (:SIZE :SMALL) and (:SIZE :TINY) marks (not in backends yet) 123 | Fixed bug where harmonics weren't being spread over tied notes 124 | Fixed bug involving 8va symbols over single notes/chords 125 | Fixed harmonic/flageolet bug in LilyPond 126 | Part name fix in LilyPond and CMN backends (Kilian) 127 | 128 | v0.2.2 129 | CLISP port nearly (or maybe all) complete (errors with loop macros--still testing, haven't tested in Winblows yet) 130 | Can choose which backends to compile with or leave out of installation 131 | MIDI backend also takes a user callback function as its PLAY argument 132 | 133 | v0.2.1 134 | Fixed error with some clef signatures in LilyPond (ones with underscores) 135 | 136 | v0.2.0 137 | Version bump 138 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | FOMUS 2 | Lisp music notation formatter 3 | See file "COPYING" for terms of use and distribution. 4 | 5 | 6 | 7 | Fomus is alpha software, and still has a lot of testing and bug fixing to go 8 | before all of its features are useable. Not all features that appear in the 9 | documentation are implemented or working yet. 10 | 11 | 12 | The program is available via anonymous CVS. To download it, type the following: 13 | 14 | cd path_to_install_directory 15 | cvs -z3 -d :pserver:anonymous:anonymous@common-lisp.net:/project/fomus/cvsroot co fomus 16 | 17 | 18 | See the file "fomus.html" in the doc directory for instructions on how to use 19 | the program. The following command loads FOMUS into lisp: 20 | 21 | (load "path_to_fomus_directory/load.lisp") 22 | (use-package :fm) 23 | 24 | 25 | The program is being developed in CMUCL, but should also compile in SBCL and 26 | OpenMCL. It will eventually run in Allegro Common Lisp and CLISP. 27 | 28 | 29 | If you wish to report a bug, make FOMUS generate a debug file (the default 30 | filename is "/tmp/fomus.dbg") and send it to dpsenick(at)uiuc(dot)edu. See the 31 | DEBUG-FILENAME setting in the FOMUS documentation for more information. 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### OVERVIEW 2 | 3 | fomus is a software application for formatting musical output written 4 | by David Psenicka (see: http://fomus.sourceforge.net). 5 | 6 | This repository is a package derived from the common lisp port of 7 | fomus with some small modifications due to lilypond api changes and 8 | some enhancements for my personal use. 9 | 10 | (c) of the modifications by Orm Finnendahl 2016, released under the 11 | LLGPL v2.0 (like the original code of David Psenicka), see file 12 | LICENSE, no warranties whatsoever. 13 | 14 | ### PREREQUISITES 15 | 16 | - sbcl Common Lisp (http://www.sbcl.org/) installed. 17 | - Quicklisp (https://www.quicklisp.org/beta/) installed. 18 | - lilypond and evince (or any other pdf viewer) installed. 19 | 20 | ### INSTALL 21 | 22 | 1. Link the folder "fomus" into "~/quicklisp/local-projects/". 23 | 24 | 25 | ### USAGE 26 | 27 | 1. Create a Text file with the name ".fomus" in your $HOME directory 28 | with the following contents (adapt to your needs and don't forget to 29 | set the correct path to the lilypond binary on your computer for 30 | :lilypond-exe): 31 | 32 | ``` 33 | :output '((:data) (:lilypond :view t)) 34 | 35 | :lilypond-exe "/path/to/lilypond" 36 | :lilypond-opts '("--pdf") 37 | :lilypond-out-ext "pdf" 38 | 39 | :lilypond-view-exe "/usr/bin/evince" 40 | :cmn-view-exe "/usr/bin/evince" 41 | 42 | :verbose 1 43 | :min-tuplet-dur 1 44 | :max-tuplet 13 45 | :caut-acc-ottavas t 46 | ``` 47 | 48 | 49 | 1. Load the project: 50 | 51 | ``` (ql:quickload "fomus") ``` 52 | 53 | 54 | 2. Generate a score (this score gets displayed using the command 55 | "/usr/bin/evince"; in case another viewer is used, change the relevant 56 | entry for :lilypond-view-exe in the ".fomus" file): 57 | 58 | ``` 59 | (in-package :fomus) 60 | 61 | (fomus 62 | ;; :output '(:lilypond :view t) 63 | :composer "" 64 | :parts 65 | (list 66 | (make-part 67 | :name "Klavier" 68 | :instr :piano 69 | :events 70 | (loop 71 | for off from 0 to 10 by 1/2 72 | collect (make-note :off off 73 | :dur (if (< off 10) 1/2 1) 74 | :note (+ 48 (random 25))))))) 75 | ``` 76 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | TODO LIST 2 | 3 | Immediate: 4 | 5 | Bugs: 6 | Weird number choices for some tuplets (12 instead of 6, 10 instead of 5, etc.)--should check neighboring tuplet numbers for consistency 7 | Double brackets shouldn't appear in the same place (6 violins example) 8 | Send list of XML issues to Sibelius/Finale tech. support 9 | In CLISP/Cygwin output from executables isn't suppressed (fixable?) 10 | Documentation: 11 | Module interface 12 | Proofreading 13 | More examples (eventually indexed and covering most/all features) 14 | Backends: 15 | MusicXML invisible rests (possible?) 16 | CMN grace notes preceding rests 17 | CMN tremolos 18 | CMN cautionary accidentals on chords 19 | CMN part groups/brackets 20 | MIDI output testing/adjusting/fine tuning 21 | Improvements: 22 | Shortcuts for some marks (example: (:slurto 1) to slur to next note, (:slurto 2) for next two, etc.) 23 | Check Finale and Siblius updates for changes in MusicXML import 24 | Laissez vibrer ties (options to automatically add l.v. ties with autodurs) 25 | Finish chunks support 26 | Finish implementing :invisible mark 27 | Allow forcing of staff choices (individual notes and entire voice) 28 | More control over harmonics 29 | Quantization modules 30 | Additions: 31 | Onset-to-onset durations 32 | Specifying percussion from MIDI info 33 | Automatic percussion instrument changes 34 | Splitting chords across staves 35 | Presets for customizing auto-algorithms 36 | Some more marks: 37 | pedal on/off 38 | double/triple tongue 39 | bartok pizz. 40 | Number of lines in staff (single-line for percussion) 41 | 42 | Short Term: 43 | 44 | Ornaments/trills with accidentals greater than a whole/half step (if notatable in backends) 45 | Proportional notation 46 | Support for polymeters in backends 47 | 48 | Long Term: 49 | 50 | Fractional meters and tuplets 51 | 52 | -------------------------------------------------------------------------------- /backends.lisp: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3 | ;;************************************************************************************************** 4 | ;; FOMUS 5 | ;; backends.lisp 6 | ;;************************************************************************************************** 7 | 8 | (in-package :fomus) 9 | (compile-settings) 10 | 11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 12 | 13 | #+sbcl (eval-when (:compile-toplevel :load-toplevel :execute) (require :sb-posix)) 14 | 15 | (declaim (type (or symbol list) *backend* *output*)) 16 | (defparameter *backend* nil) 17 | (defparameter *output* (list (first (first *backendexts*)))) 18 | (defparameter *filename* (namestring (merge-pathnames "fomus" +tmp-path+))) 19 | 20 | (defun save-raw (filename parts) 21 | (declare (type list parts)) 22 | (when (>= *verbose* 1) (out ";; Saving raw output file ~S...~%" filename)) 23 | (with-standard-io-syntax 24 | (let ((*print-pretty* t)) 25 | (with-open-file (f filename :direction :output :if-exists :supersede) 26 | (format f ";; -*-lisp-*-~%;; ~A v~A.~A.~A Raw Output File~%~%" +title+ (first +version+) (second +version+) (third +version+)) 27 | (prin1 +version+ f) 28 | (fresh-line f) 29 | (prin1 parts f) 30 | (fresh-line f))))) 31 | 32 | ;; (defvar *registered-backends* (make-hash-table)) 33 | 34 | ;; (defun register-backend (backend callback) 35 | ;; (setf (gethash backend *registered-backends*) callback)) 36 | 37 | (defun backend (backend filename dir parts options process play view) 38 | (declare (ignorable options process play view) 39 | (type symbol backend) (type list parts) (type list options) (type boolean process) (type boolean view)) 40 | (let ((*old-objects* nil)) 41 | (flet ((format-comment (cstr) (apply #'format nil cstr +title+ +version+))) 42 | (unwind-protect 43 | (case backend 44 | ((:data :fomus)) 45 | (:raw (save-raw filename parts)) 46 | ((:none :chunk) nil) 47 | #-fomus-nocmn 48 | (:cmn (save-cmn parts (format-comment +cmn-comment+) filename options process view)) 49 | #-fomus-nolilypond 50 | (:lilypond (save-lilypond parts (format-comment +lilypond-comment+) filename options process view)) 51 | #-fomus-nomusicxml 52 | (:musicxml (save-xml parts (format-comment +xml-comment+) filename options)) 53 | #-fomus-nomusicxml 54 | (:musicxml-sibelius (save-xmlsibelius parts (format-comment +xml-comment+) filename options)) 55 | #-fomus-nomusicxml 56 | (:musicxml-finale (save-xmlfinale parts (format-comment +xml-comment+) filename options)) 57 | #-fomus-nomidi (:midi (save-midi parts filename options play)) 58 | (otherwise 59 | (load-fomus-module backend) 60 | (call-module backend '("Invalid backend ~S" backend) ; exported +title+ and +version+ so they can just be accessed as variables--seems redundant if they are passed as arguments 61 | parts filename options process view))) 62 | (#+cmu unix:unix-chdir #+sbcl sb-posix:chdir #+openmcl ccl:cwd #+allegro excl:chdir #+lispworks hcl:change-directory #+clisp ext:cd (namestring dir)))))) 63 | 64 | -------------------------------------------------------------------------------- /deps.lisp: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3 | ;;************************************************************************************************** 4 | ;; FOMUS 5 | ;; deps.lisp 6 | ;;************************************************************************************************** 7 | 8 | (in-package :fomus) 9 | (compile-settings) 10 | 11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 12 | ;; COMMON MUSIC 13 | 14 | (declaim (type boolean *use-cm* *cm-exists*) 15 | (type (or function null) *cm-notefun* *cm-keynumfun* *cm-rhythmfun*)) 16 | (defparameter *use-cm* t) 17 | (defparameter *cm-exists* nil) 18 | 19 | (defparameter *cm-scale* nil) 20 | (defparameter *cm-notefun* nil) 21 | (defparameter *cm-keynumfun* nil) 22 | (defparameter *cm-rhythmfun* nil) 23 | (defparameter *cm-midi* nil) 24 | (defparameter *cm-events* nil) 25 | (defparameter *cm-rts* nil) 26 | (defparameter *cm-midipbend* nil) 27 | 28 | (defparameter *cm-midioff* nil) 29 | (defparameter *cm-midioffslot* nil) 30 | (defparameter *cm-mididur* nil) 31 | (defparameter *cm-mididurslot* nil) 32 | (defparameter *cm-midinote* nil) 33 | (defparameter *cm-midinoteslot* nil) 34 | (defparameter *cm-midichslot* nil) 35 | (defparameter *cm-midivel* nil) 36 | (defparameter *cm-midivelslot* nil) 37 | (defparameter *cm-progch* nil) 38 | 39 | (defun find-cm () 40 | (when (and (not *cm-exists*) (find-package "CM")) 41 | (when (>= *verbose* 2) (format t ";; Common Music package detected~%")) 42 | (setf *cm-exists* t 43 | *cm-notefun* (symbol-function (find-symbol "NOTE" :cm)) 44 | *cm-keynumfun* (symbol-function (find-symbol "KEYNUM" :cm)) 45 | *cm-rhythmfun* (symbol-function (find-symbol "RHYTHM" :cm)) 46 | *cm-midi* (find-symbol "MIDI" :cm) 47 | *cm-progch* (find-symbol "MIDI-PROGRAM-CHANGE" :cm) 48 | *cm-midioff* (symbol-function (find-symbol "OBJECT-TIME" :cm)) 49 | *cm-midioffslot* (find-symbol "TIME" :cm) 50 | *cm-mididur* (symbol-function (find-symbol "MIDI-DURATION" :cm)) 51 | *cm-mididurslot* (find-symbol "DURATION" :cm) 52 | *cm-midinote* (symbol-function (find-symbol "MIDI-KEYNUM" :cm)) 53 | *cm-midinoteslot* (find-symbol "KEYNUM" :cm) 54 | *cm-midichslot* (find-symbol "CHANNEL" :cm) 55 | *cm-midivel* (symbol-function (find-symbol "MIDI-AMPLITUDE" :cm)) 56 | *cm-midivelslot* (find-symbol "AMPLITUDE" :cm) 57 | *cm-events* (symbol-function (find-symbol "EVENTS" :cm)) 58 | *cm-midipbend* (find-symbol "MIDI-PITCH-BEND" :cm) 59 | *cm-rts* (ignore-errors (symbol-function (find-symbol "RTS" :cm))) 60 | ))) 61 | 62 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 63 | ;; COMMON MUSIC NOTATION 64 | 65 | (defparameter *cmn-exists* nil) 66 | 67 | (defun find-cmn () 68 | (when (and (not *cmn-exists*) (find-package "CMN")) 69 | (when (>= *verbose* 2) (format t ";; Common Music Notation package detected~%")) 70 | (setf *cmn-exists* t 71 | ))) -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_accents.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_canning.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_chords.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_chunks1.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_cm_poly1.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_cm_poly2.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_cm_poly3pt.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_cm_poly6pt.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_keysigs1.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_mark_objs.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_marksfile1.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_marksfile2.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_orch_sco.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_overser.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_perc1.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_perc2.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_perc_autodurs.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_percfile.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_pno_chords.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_poly_slurs.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_qtones.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_simp_ex.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_txt_accents.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_txt_perc.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/ex_txt_simp_ex.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/usage_ex1.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/usage_ex2.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/prop-base/usage_ex3.jpg.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:mime-type 3 | V 24 4 | application/octet-stream 5 | END 6 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch02.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Table of Contents
4 | FOMUS is available in tarball form here. 5 | Download the latest version and type something similar to the following at a UNIX prompt: 6 |
Example 2.1. Unzipping the Tarball
7 | 8 | cd path_to_install_directory 9 | tar -zxf path_to_tarball/fomus-0.2.0.tgz 10 |
11 |
12 | The current version is also available via Subversion, hosted at Common-Lisp.net. 13 | Type the following command at a UNIX prompt to download the latest version (you must have Subversion installed on your machine): 14 |
Example 2.2. Downloading from Subversion Repository
15 | 16 | mkdir fomus 17 | svn checkout svn://common-lisp.net/project/fomus/svn/fomus/tags/current fomus 18 |
19 |
20 | The development/unstable version can be downloaded as follows: 21 |
Example 2.3. Downloading the Development Version from Subversion Repository
22 | 23 | mkdir fomus 24 | svn checkout svn://common-lisp.net/project/fomus/svn/fomus/trunk fomus 25 |
26 |
27 | Future updates will then only require typing svn update
in the FOMUS directory.
28 |
4 | The program may be compiled and loaded by loading the file load.lisp
.
5 |
Example 2.4. Compiling and Loading
6 | 7 | CL-USER> (load "path_to_fomus_directory/load.lisp") 8 |
...
9 | 10 | CL-USER> (use-package :fm) 11 |
12 | The package name is FOMUS
, and can also be referred to with the abbreviations FMS
and FM
.
13 |
14 | A system definition file fomus.asd
is also provided for use with ASDF.
15 | To use it, make sure ASDF's central registry parameter contains the necessary path information and
16 | load it using the OPERATE
function (see the ASDF documentation for more information).
17 |
4 | The script file install.sh
can be run at a UNIX command prompt to install FOMUS as a command-line
5 | executable program. Right now this can only be done with SBCL, CMUCL, CLISP and
6 | OpenMCL in UNIX (it's been tested in OS X and Linux).
7 |
8 | Type the following to get a list of installation options: 9 |
Example 2.5. Running the Installation Script 1
10 | 11 | cd path_to_install_directory 12 | ./install.sh --help 13 |
14 | By default, the script tries to install the program into the subdirectories in /usr/local
. The commands for a default installation using SBCL
15 | would look like this:
16 |
Example 2.6. Running the Installation Script 2
17 | 18 | su - 19 | cd path_to_install_directory 20 | ./install.sh --sbcl 21 |
22 | There is also an option for uninstalling. To see how to run FOMUS as an executable,
23 | see Command Line Interface and Text File Interface.
24 |
4 | By default, FOMUS compiles and loads all of the backends listed in this documentation. You
5 | can leave any one of these out by adding noe the following keywords to the *FEATURES*
list (using PUSH
6 | or PUSHNEW
):
7 |
:FOMUS-NOCMN |
:FOMUS-NOLILYPOND |
:FOMUS-NOMUSICXML |
:FOMUS-NOMIDI |
8 | These must be added before loading or compiling.
9 | If you are recompiling with different keywords, be sure to delete all .fasl
files first to insure
10 | that all parts of the program are consistent.
11 |
12 | Also, FOMUS automatically tries to register modules by default when it loads into Lisp.
13 | Adding the feature :FOMUS-NOAUTOREG
tells the application to skip this step. Modules will then be
14 | inaccessible so only FOMUS's built-in functions can be used.
15 |
4 | Here are a few simple lines that you can put in your .emacs
file. They associate .fms
files
5 | with Lisp (actually, this example assumes SLIME is being used) and bind the key sequence "\C-c\C-o"
to run the
6 | FOMUS command-line program.
7 |
Example 2.7. Emacs Init Lines 1
8 | 9 | ;; fomus extension--editing works well enough in lisp mode 10 | (add-to-list 'auto-mode-alist '("\\.fms$" . lisp-mode)) 11 | 12 | ;; save buffers & invoke fomus 13 | (setq fomus-args "") 14 | (defun run-fomus () 15 | (interactive) 16 | (save-some-buffers) 17 | (let ((a (read-from-minibuffer "FOMUS arguments: " fomus-args))) 18 | (setq fomus-args a) 19 | (shell-command (format "fomus %s %S" a buffer-file-name)))) 20 | 21 | ;; add slime mode hook 22 | (defun custom-slime-mode-hook () 23 | (local-set-key "\C-c\C-o" 'run-fomus)) 24 | (add-hook 'slime-mode-hook 'custom-slime-mode-hook) 25 |
26 |
27 | Another option would be to use SLIME's SLIME-INTERACTIVE-EVAL
function instead of
28 | SHELL-COMMAND
:
29 |
Example 2.8. Emacs Init Lines 2
30 | 31 | ;; save buffers and invoke fomus in the default Lisp 32 | (setq fomus-args "") 33 | (defun run-fomus () 34 | (interactive) 35 | (save-some-buffers) 36 | (let ((a (read-from-minibuffer "FOMUS arguments: " fomus-args))) 37 | (setq fomus-args a) 38 | (slime-interactive-eval (format "(fomus %S %s)" buffer-file-name a)))) 39 |
40 |
Table of Contents
4 | Using FOMUS requires defining at least one part, filling these parts with events, then calling 5 | FOMUS's main function to process everything and output a score file for importing. 6 | There are several ways of doing this. 7 | The following sections explain these different approaches: 8 |
4 | FOMUS may be executed as a backend to Common Music using
5 | CM's EVENTS
function.
6 | Appending a ".ly"
or ".xml"
extension to the filename routes the processing to
7 | FOMUS. Parts and time signatures may also defined in CM
8 | with the NEW
macro and passed with all of FOMUS's settings to EVENTS
.
9 | A description of this interface is given
10 | here in the
11 | Common Music online documentation. Several examples are given below:
12 |
4 | If installed as a command-line executable program (see Installing as an Executable), 5 | FOMUS can be invoked from a UNIX shell prompt to process a text file 6 | in the format described above in Text File Interface. This is intended for users who 7 | don't want to use or learn Lisp and can generate the data some other way. 8 |
12 | Type fomus -h
to display the command format and list all of the available options. Examples of the file format are
13 | given in Text File Interface and Text Input File Examples.
14 |
4 | FOMUS can "splice" together the outputs of two or more runs of the FOMUS
5 | command. This allows sections or parts ("chunks") to be produced separately and put together later into a complete score. This allows the user
6 | to use different arguments and settings values with different sections of the score.
7 |
8 | This feature is "experimental" at the moment (it will be fully functional soon).
9 | FOMUS outputs a chunk object automatically on each successful run of the FOMUS
command.
10 | If no outputs are specified, then :CHUNK
or :NONE
must be given as a backend.
11 | A chunk is actually all of the measures in the processed output that contain anything other than a measure rest (ie. all of the measures that
12 | contain notation). So it can include either a part, several parts in a range of measures, every other measure over a certain range, etc..
13 | Chunks can only be merged together if there are no notational overlaps. (At the moment, they can't be "relocated" or given an offset--this
14 | will be added soon.) FOMUS considers parts with matching
15 | PARTID
values to be the same and will match them accordingly. New (or non-matching) parts
16 | may also be merged tegether into one score--FOMUS matches, adds, and reorders all of them automatically.
17 |
18 | There are several ways to tell FOMUS to merge chunks. Some examples are given here in both 19 | Lisp and command-line syntax: 20 |
Example 3.14. FOMUS Usage 13
21 | 22 | (fomus (list (fomus ...fomus_args_chunk1...) (fomus ...fomus_args_chunk2...)) :filename "path_to/myoutputfile" :output :musicxml-finale) 23 |
24 |
Example 3.15. FOMUS Usage 14
25 | 26 | (fomus (list "path_to/myfomuschunk1.fms" (fomus ...fomus_args_chunk2...) "path_to/myfomuschunk3.fms") :filename "path_to/myoutputfile" :output :cmn) 27 |
28 |
Example 3.16. FOMUS Usage 15 (Command Line)
29 | 30 | fomus -lw path_to/myfomuschunk1.fms path_to/myfomuschunk2.fms path_to/myfomuschunk3.fms 31 |
32 | In each case, two or three chunks are either created from another FOMUS
33 | command or read in from an input file. The chunks are then combined together and output as one file.
34 |
Table of Contents
4 | This chapter describes several important classes and structures that provide the main way of specifying all of the 5 | part, instrument, and notational information that is passed to FOMUS for processing. 6 | Each section gives a description of a class or structure, its constructor, and a list of its accessor functions. 7 | How these are actually used depends on the interface that the user chooses to use (See 8 | Usage for more information). 9 |
10 | All constructor functions have a corresponding copy function that take exactly the same 11 | keyword arguments plus one extra argument (the object to be copied). 12 | Any keyword/argument pairs supplied when a copy function is called indicate new replacement values. 13 | Objects may therefore be used as templates for creating new objects that differ only in one or two 14 | slot values. 15 |
16 | The actual class hierarchy isn't given here since it shouldn't be of any concern for most users. 17 | It is reflected somewhat in the prefixes that appear in the accessor function names. 18 |
4 | A TIMESIG-REPL
object is a "replacement"
5 | TIMESIG
object.
6 | They are used in the REPL
slot of
7 | TIMESIG
objects and in
8 | the FIXME setting, and are simply TIMESIG
objects with missing
9 | OFF
,
10 | PARTIDS
and
11 | REPL
slots.
12 | The use of these is optional.
13 | They are included for the sake of conciseness and to (hopefully) eliminate confusion.
14 |
15 | Since this class is nearly equivalent to the TIMESIG
class, no slot descriptions are given here.
16 | See the TIMESIG
class for an explanation of all the slots.
17 | The predicate function TIMESIGP
returns T
for both
18 | TIMESIG
and TIMESIG-REPL
classes.
19 |
Constructor:
20 | (MAKE-TIMESIG-REPL &key
21 | :ID
27 | id
22 | :TIME time
23 | :COMP comp
24 | :BEAT beat
25 | :DIV div
26 | :PROPS props
)
Copy Function:
28 | (COPY-TIMESIG-REPL
35 | timesig-repl
&key
29 | :ID id
30 | :TIME time
31 | :COMP comp
32 | :BEAT beat
33 | :DIV div
34 | :PROPS props
)
Predicate Function: (TIMESIGP
obj
)
Table of Contents
4 | Settings are arguments or parameters used to pass data to FOMUS for processing.
5 | There are a lot of them, but only a few of them are really necessary for most users.
6 | The most useful ones are listed below--look at these first before searching through the complete list.
7 | Many of the ones that aren't on the most useful list exist to provide some way of tweaking output or turning various modules on and off.
8 | Setting values can be passed to the FOMUS
function as keyword/argument pairs or
9 | bound as special variables, the names of which are derived by surrounding the symbol names with asterisks.
10 | All of the variables are exported symbols in the FOMUS
package.
11 |
12 | Settings that end in -MODULE
allow switching and replacing various sections of FOMUS
13 | with other algorithms. The code for these modules is located in the modules
subdirectory. Adding new or replacement functionality to
14 | FOMUS is done by dropping module files in here.
15 | The documentation here only describes built-in functionality--a
16 | complete list of modules to choose from may be obtained with the
17 | LIST-FOMUS-MODULES
function.
18 |
19 | See Initialization File for an explanation of how to modify default values for any of these settings. 20 |
4 | These are marks that are specified in TIMESIG
objects
5 | (and are called properties rather than marks). They either affect one location in the score at the
6 | TIMESIG
object's offset or the entire region of the score governed by that time signature.
7 |
8 | At the moment there's only one property, :BARLINE
that
9 | changes the type of barline that appears at the TIMESIG
's
10 | offset.
11 |
(:BARLINE
12 | |
4 | These are "marks" that are specified in PART
objects
5 | (and are called properties rather than marks). They either change how the part appears in the score or affect
6 | all of the objects in that part some way.
7 |
8 | At the moment there's only one property, :DISTR
that
9 | allows the user to distribute notes or rests across several other parts. This is done by voice so that
10 | the user may specify multiple parts for a single instrument but insert all of the events into only one of them.
11 | The user may then, for example, treat four violins as one instrument, inserting note events for all four instruments into
12 | one part and letting FOMUS's voice separating algorithm figure out how they are distributed to the actual parts that appear in the score.
13 |
14 | The syntax of this property is given below.
15 | The PARTID
argument specifies the part that notes and rests are moved to once all voices have been determined. The VOICE
or
16 | VOICEFROM
arguments specify which events are to be moved. VOICETO
, if given, specifies
17 | the voice the events will have once they have been moved. If VOICETO
isn't given, then the new voice defaults to
18 | the position of the argument in the list. (:DISTR (PRT1 2 3) (PRT2 1 4))
is then equivalent to
19 | (:DISTR (PRT1 (2 1) (3 2)) (PRT2 (1 1) (4 2)))
--events in voices 2 and 3 are distributed to the part PRT1
20 | as voices 1 and 2 while events in voices 1 and 4 are distributed to PRT2
as voices 1 and 2.
21 |
(:DISTR
22 | ( |
Table of Contents
4 | This chapter explains options specific to each of the possible output formats.
5 | One or more outputs or backends may be selected with the OUTPUT
setting.
6 | Most options are passed as keyword/argument pairs via this setting or in the
7 | OPTS
slot of the PART
8 | class. Current possible output symbols are :DATA
or :FOMUS
, :CHUNK
, :NONE
,
9 | :MUSICXML
, :MUSICXML-SIBELIUS
, :MUSICXML-FINALE
, :CMN
,
10 | :LILYPOND
and :MIDI
.
11 |
12 | The base output filename is specified using the FILENAME
setting.
13 | It may be overridden by the filename
option present in each of the outputs.
14 | Each output adds its own extension (for example, a LilyPond file gets a .ly
extension added).
15 |
4 | This produces a file with extension .fms
containing a dump of the data that is
5 | sent to FOMUS before any processing occurs.
6 | If this is the only output specified, FOMUS simply saves the data and returns without further processing.
7 | It may be specified using either the :DATA
or :FOMUS
keywords in the
8 | OUTPUT
setting.
9 | The file is editable and can be reloaded for editing and processing by calling the FOMUS
10 | function with the name of the file. See Text File Interface for a description of this file format.
11 |
4 | This is equivalent to the MusicXML output with "kludge" options set appropriately for Sibelius version 4.
5 | Use the :MUSICXML-SIBELIUS
keyword in the OUTPUT
setting for this.
6 |
4 | This is equivalent to the MusicXML output with "kludge" options set appropriately for Finale.
5 | Use the :MUSICXML-FINALE
keyword in the OUTPUT
setting for this.
6 |
4 | (See Chunks.)
5 | This keyword tells FOMUS to process the input and output a chunk.
6 | Use it when there are no other backends specified (FOMUS complains otherwise). The :NONE
keyword can also be used.
7 |
4 | All of FOMUS's default settings may be overridden using an initialization file that FOMUS looks for
5 | every time it loads.
6 | This file is named .fomus
and must be created in the user's home directory.
7 | To specify default settings, simply list keyword/argument pairs as if they were keyword arguments to the
8 | FOMUS
command.
9 |
Example 8.1. Initialization File Contents
10 | 11 | :output '((:data) (:lilypond :view t)) 12 | 13 | :lilypond-exe "/usr/local/bin/lilypond" 14 | :lilypond-opts '("--ps") 15 | :lilypond-out-ext "ps" 16 | 17 | :lilypond-view-exe "/usr/bin/ggv" 18 | :cmn-view-exe "/usr/bin/ggv" 19 | 20 | :verbose 1 21 | :composer "David Psenicka" 22 | :min-tuplet-dur 1 23 | :max-tuplet 13 24 | :caut-acc-ottavas t 25 |
26 |
Table of Contents
4 | These examples (will eventually) show most of FOMUS's functionality and hopefully eliminate the need to spend 5 | countless hours figuring out settings, how to create objects, etc.. Examples using different interfaces 6 | (see Usage) are given. 7 | The images were all generated using LilyPond 2.8. 8 |