├── .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 | Chapter 2. Installation

Chapter 2. Installation

Table of Contents

Downloading
Compiling/Loading
Installing as an Executable
Customizing the Installation
Simple Emacs Interface

Downloading

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 |

29 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch02s02.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Compiling/Loading

Compiling/Loading

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 |

18 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch02s03.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Installing as an Executable

Installing as an Executable

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 |

25 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch02s04.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Customizing the Installation

Customizing the Installation

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 |

16 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch02s05.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Simple Emacs Interface

Simple Emacs Interface

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 |

41 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch03.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Chapter 3. Usage

Chapter 3. Usage

Table of Contents

Interface 1
Interface 2
Text File Interface
Common Music Interface
Command Line Interface
Chunks
Other Interface Functions

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 |

9 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch03s05.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Common Music Interface

Common Music Interface

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 |

Example 3.11. FOMUS Usage 10

13 | 
14 | (To be completed.)
15 | 	

Example 3.12. FOMUS Usage 11

16 | 
17 | (To be completed.)
18 | 	

19 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch03s06.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Command Line Interface

Command Line Interface

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 |

Example 3.13. FOMUS Usage 12

 9 | 
10 | fomus my_data_file.fms
11 | 	

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 |

15 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch03s07.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Chunks

Chunks

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 |

35 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch04.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Chapter 4. Objects

Chapter 4. Objects

Table of Contents

Class PART
Class TIMESIG
Class TIMESIG-REPL
Class KEYSIG
Class NOTE
Class REST
Class MARK
Structure INSTR
Structure PERC

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 |

19 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch04s04.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Class TIMESIG-REPL

Class TIMESIG-REPL

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 id 22 | :TIME time 23 | :COMP comp 24 | :BEAT beat 25 | :DIV div 26 | :PROPS props) 27 |

Copy Function: 28 | (COPY-TIMESIG-REPL timesig-repl &key 29 | :ID id 30 | :TIME time 31 | :COMP comp 32 | :BEAT beat 33 | :DIV div 34 | :PROPS props) 35 |

Predicate Function: (TIMESIGP obj)

36 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch04s05.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Class KEYSIG

Class KEYSIG

4 | (This class is not implemented yet.) 5 |

6 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch05.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Chapter 5. Settings

Chapter 5. Settings

Table of Contents

Most Useful FOMUS Settings
Complete FOMUS Settings
Program Settings
Backend Options
Global
Objects
Parts
Time Signatures
Plugins
Plugins On/Off
Quantizing
Staves
Ottavas
Accidentals
Cautionary Accidentals
Grace Notes
Measure/Tuplet Divisions
Note Splitting/Tying
Beams
Alphabetical Listing of Settings

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 |

21 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch05s02.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Most Useful FOMUS Settings

Most Useful FOMUS Settings

:VERBOSE:EVENTS:MAX-TUPLET-DUR
:OUTPUT:INPUT-BEAT-VALUE:QUARTERTONES
:FILENAME:INPUT-OFFSET:ACC-THROUGHOUT-MEAS
:QUALITY:BEAT-DIVISION:AUTO-CAUTIONARY-ACCS
:GLOBAL:MAX-TUPLET:AUTO-PERCUSSION-DURS
:PARTS:MIN-TUPLET-DUR:DEFAULT-GRACE-DUR
4 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch06s03.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | TIMESIG Properties

TIMESIG Properties

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 | :SINGLE|:DOUBLE|:FINAL|:REPEATLEFT|:REPEATRIGHT|:REPEATLEFTRIGHT|:INVISIBLE)
13 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch06s04.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | PART Properties

PART Properties

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 | (partid voice|(voicefrom voiceto) ...) ...)
23 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch07.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Chapter 7. Outputs

Chapter 7. Outputs

Table of Contents

Data
LilyPond
LilyPond Options
Alphabetical Listing of Options
MusicXML
MusicXML Options
Alphabetical Listing of Options
MusicXML for Sibelius
MusicXML for Finale
Common Music Notation
CMN Options
Alphabetical Listing of Options
MIDI
MIDI Options
Alphabetical Listing of Options
CHUNK

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 |

16 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch07s02.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Data

Data

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 |

12 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch07s05.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | MusicXML for Sibelius

MusicXML for Sibelius

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 |

7 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch07s06.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | MusicXML for Finale

MusicXML for Finale

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 |

7 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch07s09.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | CHUNK

CHUNK

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 |

8 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch08.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Chapter 8. Initialization File

Chapter 8. Initialization File

Table of Contents

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 |

27 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ch09.html.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | Chapter 9. Examples

Chapter 9. Examples

Table of Contents

Lisp Examples
Common Music Examples
Text Input File Examples

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 |

9 | -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_accents.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_accents.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_canning.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_canning.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_chords.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_chords.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_chunks1.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_chunks1.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_cm_poly1.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_cm_poly1.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_cm_poly2.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_cm_poly2.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_cm_poly3pt.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_cm_poly3pt.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_cm_poly6pt.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_cm_poly6pt.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_keysigs1.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_keysigs1.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_mark_objs.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_mark_objs.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_marksfile1.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_marksfile1.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_marksfile2.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_marksfile2.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_orch_sco.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_orch_sco.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_overser.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_overser.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_perc1.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_perc1.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_perc2.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_perc2.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_perc_autodurs.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_perc_autodurs.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_percfile.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_percfile.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_pno_chords.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_pno_chords.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_poly_slurs.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_poly_slurs.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_qtones.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_qtones.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_simp_ex.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_simp_ex.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_txt_accents.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_txt_accents.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_txt_perc.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_txt_perc.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/ex_txt_simp_ex.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/ex_txt_simp_ex.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/fomus.css.svn-base: -------------------------------------------------------------------------------- 1 | p { 2 | font-family: arial, serif; 3 | } 4 | 5 | h1 { 6 | text-decoration: underline; 7 | } 8 | 9 | h2 { 10 | background-color: RGB(255, 200, 200); 11 | text-decoration: underline; 12 | } 13 | 14 | div.example { 15 | background-color: RGB(255, 255, 215); 16 | } 17 | 18 | img { 19 | background-color: white; 20 | padding: 8px; 21 | border-style: double; 22 | } 23 | 24 | a { 25 | color: RGB(0, 0, 100); 26 | } 27 | -------------------------------------------------------------------------------- /doc/.svn/text-base/fomus.xml.svn-base: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | ]> 13 | 14 | 15 | FOMUS Documentation 16 | Version 0.2.26 17 | 5/24/2007 18 | 19 | David 20 | Psenicka 21 | dpsenick(at)uiuc(dot)edu 22 | 23 | 24 | Copyright © 2005, 2006, 2007 David Psenicka, All Rights Reserved 25 | See file "COPYING" for terms of use and distribution. 26 | 27 | 28 | &intro; 29 | &install; 30 | &usage; 31 | &objects; 32 | &settings; 33 | &marks; 34 | &backends; 35 | &init; 36 | &examples; 37 | 38 | -------------------------------------------------------------------------------- /doc/.svn/text-base/init.xml.svn-base: -------------------------------------------------------------------------------- 1 | 2 | Initialization File 3 |
4 | 5 | All of FOMUS's default settings may be overridden using an initialization file that FOMUS looks for 6 | every time it loads. 7 | This file is named .fomus and must be created in the user's home directory. 8 | To specify default settings, simply list keyword/argument pairs as if they were keyword arguments to the 9 | FOMUS command. 10 | 11 | Initialization File Contents 12 | 13 | 28 | 29 | 30 | 31 |
32 |
33 | -------------------------------------------------------------------------------- /doc/.svn/text-base/intro.xml.svn-base: -------------------------------------------------------------------------------- 1 | 2 | Introduction 3 |
4 | 5 | FOMUS (FOrmat MUSic) is a music notation tool for computer music composers. 6 | It is written in the Lisp programming language, and has been tested in the following interpreters: 7 | CMUCL (version 19), 8 | SBCL (version 0.9.4), 9 | OpenMCL (version 1), 10 | CLISP (version 2), 11 | Allegro (version 7) and 12 | LispWorks (version 4). 13 | As the program becomes more stable, it will also be tested in other lisp implementations. Supported operating systems are 14 | Linux, Max OS X and Windows. 15 | The purpose of it is to facilitate the conversion of "raw" algorithmic output data into readable music notation, a process that can be 16 | frustrating and time consuming since it often requires dumping data into some intermediary format (such as MIDI) and importing 17 | it into a notation program that only does a mediocre job of conversion. 18 | FOMUS attempts to remove this frustration by making a reasonably intelligent attempt at 19 | spelling notes, quantizing offsets and durations into readable rhythms, 20 | laying out the information into voices and staves, and other tasks (such as where to include clef changes or ottava markings). 21 | The user may also specify extra information such as articulations, text markings, time signature changes, 22 | notational details of musical instruments, etc.. 23 | When the program is run, it outputs a file suitable for importing straight into a notation program, 24 | after which a small amount of editing and layout work should be required to create a finished musical score. 25 | 26 | 27 | Following is a list of some of the tasks FOMUS is designed to automate: 28 | 29 | Part grouping and ordering 30 | Transposition and checking of instrument ranges 31 | Note spelling (semitones and quartertones are currently supported) and cautionary accidentals 32 | Rhythmic quantizing (with tuplet choices that minimize the amount of error between input offsets and notational offsets) 33 | Distribution of notes into voices and staves 34 | Note splitting and tying, taking into account metrical divisions, dotted rhythms, and other special cases 35 | Decisions regarding placement of clef changes and ottava brackets 36 | Layout of articulations, slurs, beams, dynamic and text markings, and other notational elements 37 | 38 | 39 | 40 | The following output formats are supported: 41 | 42 | MusicXML 43 | Common Music Notation (almost implemented) 44 | LilyPond 45 | MIDI File/Playback through Common Music 46 | 47 | MusicXML files will import (more or less) into popular notation programs like 48 | Finale 49 | and Sibelius. 50 | 51 | 52 | FOMUS integrates with Common Music, 53 | using some of its functionality if present and also functioning as a backend. 54 | FOMUS has also been designed to allow selection of modules that use different algorithms to perform the same tasks. 55 | As new functions are added, users can select the ones that give them the best results. 56 | These will be added to the program over time. 57 | 58 | 59 | FOMUS is still in its initial (alpha) development stage, so please expect many bugs. 60 | If you wish to report one, please look at the DEBUG-FILENAME 61 | setting to see how to create a debug file and e-mail it to dpsenick(at)uiuc(dot)edu. 62 | Please send me suggestions and comments. 63 | 64 | 65 | Thanks to Rick Taube, Kilian Sprotte, Mika Kuuskankare and Rob Canning for their help and suggestions. 66 | Also thanks to Kilian Sprotte for developing code for the test suite, available in the SVN repository as fomustest. 67 | 68 |
69 |
70 | -------------------------------------------------------------------------------- /doc/.svn/text-base/style.xsl.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fomus.css 6 | 7 | 8 | -------------------------------------------------------------------------------- /doc/.svn/text-base/usage_ex1.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/usage_ex1.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/usage_ex2.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/usage_ex2.jpg.svn-base -------------------------------------------------------------------------------- /doc/.svn/text-base/usage_ex3.jpg.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/.svn/text-base/usage_ex3.jpg.svn-base -------------------------------------------------------------------------------- /doc/ch01.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch01.html -------------------------------------------------------------------------------- /doc/ch02.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch02.html -------------------------------------------------------------------------------- /doc/ch02s02.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch02s02.html -------------------------------------------------------------------------------- /doc/ch02s03.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch02s03.html -------------------------------------------------------------------------------- /doc/ch02s04.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch02s04.html -------------------------------------------------------------------------------- /doc/ch02s05.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch02s05.html -------------------------------------------------------------------------------- /doc/ch03.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch03.html -------------------------------------------------------------------------------- /doc/ch03s02.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch03s02.html -------------------------------------------------------------------------------- /doc/ch03s03.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch03s03.html -------------------------------------------------------------------------------- /doc/ch03s04.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch03s04.html -------------------------------------------------------------------------------- /doc/ch03s05.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch03s05.html -------------------------------------------------------------------------------- /doc/ch03s06.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch03s06.html -------------------------------------------------------------------------------- /doc/ch03s07.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch03s07.html -------------------------------------------------------------------------------- /doc/ch03s08.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch03s08.html -------------------------------------------------------------------------------- /doc/ch04.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch04.html -------------------------------------------------------------------------------- /doc/ch04s02.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch04s02.html -------------------------------------------------------------------------------- /doc/ch04s03.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch04s03.html -------------------------------------------------------------------------------- /doc/ch04s04.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch04s04.html -------------------------------------------------------------------------------- /doc/ch04s05.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch04s05.html -------------------------------------------------------------------------------- /doc/ch04s06.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch04s06.html -------------------------------------------------------------------------------- /doc/ch04s07.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch04s07.html -------------------------------------------------------------------------------- /doc/ch04s08.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch04s08.html -------------------------------------------------------------------------------- /doc/ch04s09.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch04s09.html -------------------------------------------------------------------------------- /doc/ch04s10.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch04s10.html -------------------------------------------------------------------------------- /doc/ch05.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch05.html -------------------------------------------------------------------------------- /doc/ch05s02.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch05s02.html -------------------------------------------------------------------------------- /doc/ch05s03.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch05s03.html -------------------------------------------------------------------------------- /doc/ch05s04.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch05s04.html -------------------------------------------------------------------------------- /doc/ch06.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch06.html -------------------------------------------------------------------------------- /doc/ch06s02.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch06s02.html -------------------------------------------------------------------------------- /doc/ch06s03.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch06s03.html -------------------------------------------------------------------------------- /doc/ch06s04.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch06s04.html -------------------------------------------------------------------------------- /doc/ch07.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch07.html -------------------------------------------------------------------------------- /doc/ch07s02.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch07s02.html -------------------------------------------------------------------------------- /doc/ch07s03.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch07s03.html -------------------------------------------------------------------------------- /doc/ch07s04.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch07s04.html -------------------------------------------------------------------------------- /doc/ch07s05.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch07s05.html -------------------------------------------------------------------------------- /doc/ch07s06.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch07s06.html -------------------------------------------------------------------------------- /doc/ch07s07.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch07s07.html -------------------------------------------------------------------------------- /doc/ch07s08.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch07s08.html -------------------------------------------------------------------------------- /doc/ch07s09.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch07s09.html -------------------------------------------------------------------------------- /doc/ch08.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch08.html -------------------------------------------------------------------------------- /doc/ch09.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch09.html -------------------------------------------------------------------------------- /doc/ch09s02.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch09s02.html -------------------------------------------------------------------------------- /doc/ch09s03.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch09s03.html -------------------------------------------------------------------------------- /doc/ch09s04.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ch09s04.html -------------------------------------------------------------------------------- /doc/ex_accents.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_accents.jpg -------------------------------------------------------------------------------- /doc/ex_canning.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_canning.jpg -------------------------------------------------------------------------------- /doc/ex_chords.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_chords.jpg -------------------------------------------------------------------------------- /doc/ex_chunks1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_chunks1.jpg -------------------------------------------------------------------------------- /doc/ex_cm_poly1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_cm_poly1.jpg -------------------------------------------------------------------------------- /doc/ex_cm_poly2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_cm_poly2.jpg -------------------------------------------------------------------------------- /doc/ex_cm_poly3pt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_cm_poly3pt.jpg -------------------------------------------------------------------------------- /doc/ex_cm_poly6pt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_cm_poly6pt.jpg -------------------------------------------------------------------------------- /doc/ex_keysigs1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_keysigs1.jpg -------------------------------------------------------------------------------- /doc/ex_mark_objs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_mark_objs.jpg -------------------------------------------------------------------------------- /doc/ex_marksfile1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_marksfile1.jpg -------------------------------------------------------------------------------- /doc/ex_marksfile2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_marksfile2.jpg -------------------------------------------------------------------------------- /doc/ex_orch_sco.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_orch_sco.jpg -------------------------------------------------------------------------------- /doc/ex_overser.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_overser.jpg -------------------------------------------------------------------------------- /doc/ex_perc1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_perc1.jpg -------------------------------------------------------------------------------- /doc/ex_perc2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_perc2.jpg -------------------------------------------------------------------------------- /doc/ex_perc_autodurs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_perc_autodurs.jpg -------------------------------------------------------------------------------- /doc/ex_percfile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_percfile.jpg -------------------------------------------------------------------------------- /doc/ex_pno_chords.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_pno_chords.jpg -------------------------------------------------------------------------------- /doc/ex_poly_slurs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_poly_slurs.jpg -------------------------------------------------------------------------------- /doc/ex_qtones.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_qtones.jpg -------------------------------------------------------------------------------- /doc/ex_simp_ex.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_simp_ex.jpg -------------------------------------------------------------------------------- /doc/ex_txt_accents.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_txt_accents.jpg -------------------------------------------------------------------------------- /doc/ex_txt_perc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_txt_perc.jpg -------------------------------------------------------------------------------- /doc/ex_txt_simp_ex.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/ex_txt_simp_ex.jpg -------------------------------------------------------------------------------- /doc/fomus.css: -------------------------------------------------------------------------------- 1 | p { 2 | font-family: arial, serif; 3 | } 4 | 5 | h1 { 6 | text-decoration: underline; 7 | } 8 | 9 | h2 { 10 | background-color: RGB(255, 200, 200); 11 | text-decoration: underline; 12 | } 13 | 14 | div.example { 15 | background-color: RGB(255, 255, 215); 16 | } 17 | 18 | img { 19 | background-color: white; 20 | padding: 8px; 21 | border-style: double; 22 | } 23 | 24 | a { 25 | color: RGB(0, 0, 100); 26 | } 27 | -------------------------------------------------------------------------------- /doc/fomus.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | ]> 13 | 14 | 15 | FOMUS Documentation 16 | Version 0.2.26 17 | 5/24/2007 18 | 19 | David 20 | Psenicka 21 | dpsenick(at)uiuc(dot)edu 22 | 23 | 24 | Copyright © 2005, 2006, 2007 David Psenicka, All Rights Reserved 25 | See file "COPYING" for terms of use and distribution. 26 | 27 | 28 | &intro; 29 | &install; 30 | &usage; 31 | &objects; 32 | &settings; 33 | &marks; 34 | &backends; 35 | &init; 36 | &examples; 37 | 38 | -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/index.html -------------------------------------------------------------------------------- /doc/init.xml: -------------------------------------------------------------------------------- 1 | 2 | Initialization File 3 |
4 | 5 | All of FOMUS's default settings may be overridden using an initialization file that FOMUS looks for 6 | every time it loads. 7 | This file is named .fomus and must be created in the user's home directory. 8 | To specify default settings, simply list keyword/argument pairs as if they were keyword arguments to the 9 | FOMUS command. 10 | 11 | Initialization File Contents 12 | 13 | 28 | 29 | 30 | 31 |
32 |
33 | -------------------------------------------------------------------------------- /doc/intro.xml: -------------------------------------------------------------------------------- 1 | 2 | Introduction 3 |
4 | 5 | FOMUS (FOrmat MUSic) is a music notation tool for computer music composers. 6 | It is written in the Lisp programming language, and has been tested in the following interpreters: 7 | CMUCL (version 19), 8 | SBCL (version 0.9.4), 9 | OpenMCL (version 1), 10 | CLISP (version 2), 11 | Allegro (version 7) and 12 | LispWorks (version 4). 13 | As the program becomes more stable, it will also be tested in other lisp implementations. Supported operating systems are 14 | Linux, Max OS X and Windows. 15 | The purpose of it is to facilitate the conversion of "raw" algorithmic output data into readable music notation, a process that can be 16 | frustrating and time consuming since it often requires dumping data into some intermediary format (such as MIDI) and importing 17 | it into a notation program that only does a mediocre job of conversion. 18 | FOMUS attempts to remove this frustration by making a reasonably intelligent attempt at 19 | spelling notes, quantizing offsets and durations into readable rhythms, 20 | laying out the information into voices and staves, and other tasks (such as where to include clef changes or ottava markings). 21 | The user may also specify extra information such as articulations, text markings, time signature changes, 22 | notational details of musical instruments, etc.. 23 | When the program is run, it outputs a file suitable for importing straight into a notation program, 24 | after which a small amount of editing and layout work should be required to create a finished musical score. 25 | 26 | 27 | Following is a list of some of the tasks FOMUS is designed to automate: 28 | 29 | Part grouping and ordering 30 | Transposition and checking of instrument ranges 31 | Note spelling (semitones and quartertones are currently supported) and cautionary accidentals 32 | Rhythmic quantizing (with tuplet choices that minimize the amount of error between input offsets and notational offsets) 33 | Distribution of notes into voices and staves 34 | Note splitting and tying, taking into account metrical divisions, dotted rhythms, and other special cases 35 | Decisions regarding placement of clef changes and ottava brackets 36 | Layout of articulations, slurs, beams, dynamic and text markings, and other notational elements 37 | 38 | 39 | 40 | The following output formats are supported: 41 | 42 | MusicXML 43 | Common Music Notation (almost implemented) 44 | LilyPond 45 | MIDI File/Playback through Common Music 46 | 47 | MusicXML files will import (more or less) into popular notation programs like 48 | Finale 49 | and Sibelius. 50 | 51 | 52 | FOMUS integrates with Common Music, 53 | using some of its functionality if present and also functioning as a backend. 54 | FOMUS has also been designed to allow selection of modules that use different algorithms to perform the same tasks. 55 | As new functions are added, users can select the ones that give them the best results. 56 | These will be added to the program over time. 57 | 58 | 59 | FOMUS is still in its initial (alpha) development stage, so please expect many bugs. 60 | If you wish to report one, please look at the DEBUG-FILENAME 61 | setting to see how to create a debug file and e-mail it to dpsenick(at)uiuc(dot)edu. 62 | Please send me suggestions and comments. 63 | 64 | 65 | Thanks to Rick Taube, Kilian Sprotte, Mika Kuuskankare and Rob Canning for their help and suggestions. 66 | Also thanks to Kilian Sprotte for developing code for the test suite, available in the SVN repository as fomustest. 67 | 68 |
69 |
70 | -------------------------------------------------------------------------------- /doc/style.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fomus.css 6 | 7 | 8 | -------------------------------------------------------------------------------- /doc/usage_ex1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/usage_ex1.jpg -------------------------------------------------------------------------------- /doc/usage_ex2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/usage_ex2.jpg -------------------------------------------------------------------------------- /doc/usage_ex3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ormf/fomus/d1ce3420f2393a79aad57f9c643915f20474285f/doc/usage_ex3.jpg -------------------------------------------------------------------------------- /final.lisp: -------------------------------------------------------------------------------- 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 | ;;; (pushnew :debug *features*) 57 | ) 58 | 59 | ;; print load greeting 60 | (eval-when (:load-toplevel :execute) 61 | (when (>= *verbose* 1) (format t "~&~%;; ~A v~A.~A.~A~%~A~%" 62 | +title+ 63 | (first +version+) (second +version+) (third +version+) 64 | (conc-stringlist (loop for e in +banner+ collect (format nil ";; ~A~%" e)))))) 65 | 66 | (eval-when (:load-toplevel :execute) 67 | (find-cm) (find-cmn)) 68 | 69 | (eval-when (:load-toplevel :execute) 70 | (unless (find-symbol "+FOMUS-INSTALL+" :common-lisp-user) 71 | (load-initfile) 72 | #-fomus-noautoreg (register-fomus-modules nil))) 73 | 74 | (defun fomus-exe (initfile opts basename quality verbosity &rest filename) 75 | (let ((*package* (find-package "FOMUS"))) 76 | (catcherr 77 | (load-initfile initfile nil) 78 | (register-fomus-modules nil) 79 | (let* ((v (when (find #\w opts) t)) 80 | (o (nconc (when (string/= quality "") (list :quality (ignore-errors (read-from-string quality)))) 81 | (when (string/= basename "") (list :filename basename)) 82 | (when (string/= verbosity "") (list :verbose (ignore-errors (read-from-string verbosity)))) 83 | (let ((x (nconc 84 | (when (find #\l opts) (list (list :lilypond :view v))) 85 | (when (find #\c opts) (list (list :cmn :view v))) 86 | (when (find #\m opts) (list (list :fomus))) 87 | (cond ((find #\f opts) (list (list :musicxml-finale))) 88 | ((find #\s opts) (list (list :musicxml-sibelius))) 89 | ((find #\x opts) (list (list :musicxml))))))) 90 | (when x (cons :output x)))))) 91 | (fomus-text (if (list1p filename) (first filename) filename) o #'fomus-textexec)))) 92 | (fresh-line) 93 | (finish-output) 94 | #+cmu (ext:quit) #+sbcl (sb-ext:exit) #+openmcl (ccl:quit) #+clisp (ext:quit)) 95 | 96 | -------------------------------------------------------------------------------- /fomus.asd: -------------------------------------------------------------------------------- 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 | ;;; :depends-on () 12 | :components 13 | ((:file "package") 14 | (:file "version" :depends-on ("package")) 15 | (:file "misc" :depends-on ("package")) 16 | (:file "deps" :depends-on ("package")) 17 | (:file "data" :depends-on ("misc" "deps")) 18 | (:file "classes" :depends-on ("data")) 19 | (:file "util" :depends-on ("classes")) 20 | 21 | (:file "splitrules" :depends-on ("util")) 22 | 23 | (:file "accidentals" :depends-on ("util")) 24 | (:file "beams" :depends-on ("util")) 25 | (:file "marks" :depends-on ("util")) 26 | (:file "other" :depends-on ("util")) 27 | (:file "ottavas" :depends-on ("util")) 28 | (:file "parts" :depends-on ("util")) 29 | (:file "postproc" :depends-on ("util")) 30 | (:file "split" :depends-on ("util" "splitrules")) 31 | (:file "staves" :depends-on ("util")) 32 | (:file "voices" :depends-on ("util")) 33 | (:file "quantize" :depends-on ("util" "splitrules")) 34 | 35 | #-fomus-nocmn (:file "backend_cmn" :depends-on ("util")) 36 | #-fomus-nolilypond (:file "backend_ly" :depends-on ("util")) 37 | #-fomus-nomusicxml (:file "backend_xml" :depends-on ("util")) 38 | #-fomus-nomidi (:file "backend_mid" :depends-on ("util")) 39 | (:file "backends" :depends-on (#-fomus-nocmn "backend_cmn" #-fomus-nolilypond "backend_ly" #-fomus-nomusicxml "backend_xml" #-fomus-nomidi "backend_mid" "version")) 40 | 41 | (:file "main" :depends-on ("accidentals" "beams" "marks" "other" "ottavas" "parts" "postproc" "split" "staves" "voices" "quantize" "backends")) 42 | 43 | (:file "interface" :depends-on ("main")) 44 | 45 | (:file "final" :depends-on ("version" "interface") :in-order-to ((load-op (load-op "interface")))) 46 | )) 47 | -------------------------------------------------------------------------------- /load.lisp: -------------------------------------------------------------------------------- 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)) -------------------------------------------------------------------------------- /modules/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 221 5 | svn://common-lisp.net/project/fomus/svn/fomus/trunk/modules 6 | svn://common-lisp.net/project/fomus/svn 7 | 8 | 9 | 10 | 2007-01-08T23:00:58.634657Z 11 | 147 12 | dpsenicka 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 2a51dca0-4d0b-0410-81ff-d9860c232a2a 28 | 29 | backends 30 | dir 31 | 32 | README 33 | file 34 | 35 | 36 | 37 | 38 | 2014-05-13T12:44:58.033613Z 39 | 5881a4e60539428dd8c2c5a814227943 40 | 2006-12-02T19:54:05.013524Z 41 | 104 42 | dpsenicka 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 3269 65 | 66 | ads.lisp 67 | file 68 | 69 | 70 | 71 | 72 | 2014-05-13T12:44:58.033613Z 73 | e42e2bf0a6cc896ffca3e965c8fc52a6 74 | 2006-12-02T19:54:05.013524Z 75 | 104 76 | dpsenicka 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 12105 99 | 100 | -------------------------------------------------------------------------------- /modules/.svn/text-base/README.svn-base: -------------------------------------------------------------------------------- 1 | This README contains some information for developing modules 2 | 3 | 4 | 5 | DEFMODULE 6 | 7 | Put this declaration at the top of the module file (it needs to be at the top) to define the module. FOMUS will automatically scan the module 8 | directory and use these headers to register, compile and load them. 9 | 10 | DEFMODULE is a wrapper for DEFPACKAGE and accepts the following keywords: 11 | fomus-specific: type keyname use initfun entryfun description preload filename-ext 12 | arguments passed to defpackage: shadowing-import-from package-name import-from intern size export 13 | 14 | type = one of :accidentals :voices :staves/clefs :splitrules :quantize or :backend for now 15 | keyname = keyword ID for this module 16 | initfun = callback initialization function w/ no arguments (not really necessary in Lisp, but it's included anyways) 17 | entryfun = function to replace fomus's default function (arguments differ depending on context) 18 | documentation = passed to defpackage and also printed out when list-fomus-modules is called 19 | preload = form that is executed before anything else (for loading dependencies) 20 | filename-ext = string such as "xml" or "ly" added to output filename--only use w/ backends (optional--without this, the base filename is passed to the module function) 21 | (all other arguments) = same as equivalent args in defpackage (deffomusmodule acts as an extension to defpackage) 22 | 23 | DEFMODULE takes care of defining the package, also adds a FOMUS-MODULENAME module to the *MODULES* list (FOMUS uses this) 24 | It also adds an (in-package ...) 25 | 26 | Example: 27 | 28 | (deffomusmodule 29 | (:keyname :nokey2) (:type :accidentals) (:entryfun acc-nokey2) 30 | (:use :iterate) ; automatically uses common-lisp and fomus packages 31 | (:export #:make-int-var-from-to #:make-int-var-domain #:post #:ads #:example #:acc-nokey2) 32 | (:preload (asdf:operate 'asdf:load-op :iterate)) 33 | (:documentation "(Experimental) Note-spelling algorithm by Kilian Sprotte using an adaptive search approach")) 34 | 35 | 36 | 37 | CALLBACK FUNCTION 38 | 39 | There needs to be a callback function, specified by the :entryfun argument to DEFFOMUSMODULE. The API is different for each module type 40 | and might have to change depending on module requirements. 41 | 42 | 43 | 44 | DATA 45 | 46 | Some data that can be imported from the fomus package that might be useful (things will be added as I go through the code to clean things up & add comments): 47 | 48 | (defparameter +nokey-niceints1+ (vector '(0) '(-1 1) '(-1 1) '(0 2) '(-2 0) '(-1 1) '(-1 1))) ; best spellings from unison to 7th (0 = perfect, -1/1 = min/maj, -2/2 = dim/aug) 49 | (defparameter +nokey-niceints2+ (vector '(-2 2) '(-2 2) '(-2 2) '(-2) '(2) '(-2 2) '(-2 2))) ; 2nd best spellings 50 | (defparameter +nokey-penalty+ (vector '(1) '(-1 1) '(-1) '(1) '(-1 1) '(-1 1) '(-1))) ; for ea. white key, location of neighboring black keys (1/2 step lower or higher) 51 | (defparameter +nokey-harmints+ (vector 0 1 1 2 2 3 4 4 5 5 6 6)) ; when two notes are "linked", required interval given the chromatic distance 52 | 53 | *verbose* ; the verbosity level (usually only print something if *verbose* >= 2) 54 | 55 | 56 | 57 | FUNCTIONS 58 | 59 | See "misc.lisp" for general miscellaneous things and "util.lisp" for fomus-specific functions 60 | An important one is print-dot in util.lisp--prints a progress dot only if some number of seconds has elapsed since the last one (insert this somewhere in your code) 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /modules/README: -------------------------------------------------------------------------------- 1 | This README contains some information for developing modules 2 | 3 | 4 | 5 | DEFMODULE 6 | 7 | Put this declaration at the top of the module file (it needs to be at the top) to define the module. FOMUS will automatically scan the module 8 | directory and use these headers to register, compile and load them. 9 | 10 | DEFMODULE is a wrapper for DEFPACKAGE and accepts the following keywords: 11 | fomus-specific: type keyname use initfun entryfun description preload filename-ext 12 | arguments passed to defpackage: shadowing-import-from package-name import-from intern size export 13 | 14 | type = one of :accidentals :voices :staves/clefs :splitrules :quantize or :backend for now 15 | keyname = keyword ID for this module 16 | initfun = callback initialization function w/ no arguments (not really necessary in Lisp, but it's included anyways) 17 | entryfun = function to replace fomus's default function (arguments differ depending on context) 18 | documentation = passed to defpackage and also printed out when list-fomus-modules is called 19 | preload = form that is executed before anything else (for loading dependencies) 20 | filename-ext = string such as "xml" or "ly" added to output filename--only use w/ backends (optional--without this, the base filename is passed to the module function) 21 | (all other arguments) = same as equivalent args in defpackage (deffomusmodule acts as an extension to defpackage) 22 | 23 | DEFMODULE takes care of defining the package, also adds a FOMUS-MODULENAME module to the *MODULES* list (FOMUS uses this) 24 | It also adds an (in-package ...) 25 | 26 | Example: 27 | 28 | (deffomusmodule 29 | (:keyname :nokey2) (:type :accidentals) (:entryfun acc-nokey2) 30 | (:use :iterate) ; automatically uses common-lisp and fomus packages 31 | (:export #:make-int-var-from-to #:make-int-var-domain #:post #:ads #:example #:acc-nokey2) 32 | (:preload (asdf:operate 'asdf:load-op :iterate)) 33 | (:documentation "(Experimental) Note-spelling algorithm by Kilian Sprotte using an adaptive search approach")) 34 | 35 | 36 | 37 | CALLBACK FUNCTION 38 | 39 | There needs to be a callback function, specified by the :entryfun argument to DEFFOMUSMODULE. The API is different for each module type 40 | and might have to change depending on module requirements. 41 | 42 | 43 | 44 | DATA 45 | 46 | Some data that can be imported from the fomus package that might be useful (things will be added as I go through the code to clean things up & add comments): 47 | 48 | (defparameter +nokey-niceints1+ (vector '(0) '(-1 1) '(-1 1) '(0 2) '(-2 0) '(-1 1) '(-1 1))) ; best spellings from unison to 7th (0 = perfect, -1/1 = min/maj, -2/2 = dim/aug) 49 | (defparameter +nokey-niceints2+ (vector '(-2 2) '(-2 2) '(-2 2) '(-2) '(2) '(-2 2) '(-2 2))) ; 2nd best spellings 50 | (defparameter +nokey-penalty+ (vector '(1) '(-1 1) '(-1) '(1) '(-1 1) '(-1 1) '(-1))) ; for ea. white key, location of neighboring black keys (1/2 step lower or higher) 51 | (defparameter +nokey-harmints+ (vector 0 1 1 2 2 3 4 4 5 5 6 6)) ; when two notes are "linked", required interval given the chromatic distance 52 | 53 | *verbose* ; the verbosity level (usually only print something if *verbose* >= 2) 54 | 55 | 56 | 57 | FUNCTIONS 58 | 59 | See "misc.lisp" for general miscellaneous things and "util.lisp" for fomus-specific functions 60 | An important one is print-dot in util.lisp--prints a progress dot only if some number of seconds has elapsed since the last one (insert this somewhere in your code) 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /modules/backends/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 221 5 | svn://common-lisp.net/project/fomus/svn/fomus/trunk/modules/backends 6 | svn://common-lisp.net/project/fomus/svn 7 | 8 | 9 | 10 | 2007-01-08T23:00:58.634657Z 11 | 147 12 | dpsenicka 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 2a51dca0-4d0b-0410-81ff-d9860c232a2a 28 | 29 | timedump.lisp 30 | file 31 | 32 | 33 | 34 | 35 | 2014-05-13T12:44:58.025613Z 36 | 12ebe5a63bfb38e8df65c6b4d5280d1c 37 | 2006-12-10T04:32:53.043673Z 38 | 121 39 | dpsenicka 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 2986 62 | 63 | notepro.lisp 64 | file 65 | 66 | 67 | 68 | 69 | 2014-05-13T12:44:58.025613Z 70 | 05c4a03a578a7dd1fd70f73cf7f60ce8 71 | 2007-01-08T23:00:58.634657Z 72 | 147 73 | dpsenicka 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 1513 96 | 97 | -------------------------------------------------------------------------------- /modules/backends/.svn/text-base/notepro.lisp.svn-base: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | 3 | ;; NOTEPRO--Backend Module 4 | ;; David Psenicka 5 | 6 | ;; Outputs a NotePro file for use with M4C 7 | 8 | ;; Options: 9 | 10 | 11 | 12 | (deffomusmodule 13 | (:keyname :notepro) (:type :backend) (:entryfun do-notepro) (:filename-ext "np") 14 | (:import-from #:fomus #:force-list #:*verbose* #:out) 15 | (:documentation "(Unfinished) Outputs a NotePro file for use with M4C")) 16 | 17 | ;; timesig is given in the form of a cons 18 | ;; barline is the barline property (:double, etc.) for the measure if present (applies to the BEGINNING of the measure) 19 | (defstruct (timedump (:copier nil) (:predicate timedumpp)) 20 | off endoff dur timesig barline) 21 | 22 | (defun do-timedump (parts filename options process view) 23 | (declare (ignorable parts filename options process view)) 24 | (out ";; ERROR: NotePro backend doesn't work yet~%") 25 | #|(when (>= *verbose* 1) (out ";; Saving NotePro file ~S...~%" filename))|#) 26 | 27 | ;; (destructuring-bind (&key callback partids &allow-other-keys) options 28 | ;; (if callback 29 | ;; (loop for e in (or (force-list partids) (list (part-partid (first parts)))) 30 | ;; for p = (find e parts :key #'part-partid) 31 | ;; do (funcall callback 32 | ;; (loop with bl for m in (part-meas p) 33 | ;; collect (make-timedump :off (meas-off m) :endoff (meas-endoff m) 34 | ;; :dur (- (meas-endoff m) (meas-off m)) :timesig (timesig-time (meas-timesig m)) 35 | ;; :barline bl) 36 | ;; do (setf bl (second (getprop m :barline)))) 37 | ;; filename)) 38 | ;; (format t ";; ERROR: Need a user callback function for timedump~%"))) 39 | -------------------------------------------------------------------------------- /modules/backends/.svn/text-base/timedump.lisp.svn-base: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | 3 | ;; TIMEDUMP--Backend Module 4 | ;; David Psenicka 5 | 6 | ;; A very simple backend that sends timing information (measure onsets, offsets, durations and time signatures) to a user-defined callback 7 | ;; function for dumping timing info into a data file or generating a click track, etc.. 8 | 9 | ;; The user callback function looks like this: 10 | 11 | ;; (defun my-callback (list-of-structs filename) ... 12 | 13 | ;; "list-of-structs" is a list of timedump structs (see the defstruct definition below). Pass the function to TIMEDUMP with a :CALLBACK 14 | ;; keyword argument. Each timedump struct represents a measure of the score. 15 | ;; "filename" is the base filename (w/o extension), given as a string 16 | 17 | ;; Options: 18 | ;; callback = user callback function 19 | ;; partids = optional (for polymetric scores): partid or list of partids (callback is called once for each partid in list) 20 | 21 | 22 | ;; Example: 23 | 24 | ;; (load-fomus-module :timedump) ; (don't normally have to do this, but it needs to be loaded so the symbols are accessible) 25 | ;; (use-package :fomus-timedump) 26 | ;; (defun savetimes (list filename) 27 | ;; (format t ";; Dumping measure downbeats to ~S~%" (concatenate 'string filename ".txt")) 28 | ;; (with-open-file (f (concatenate 'string filename ".txt") :direction :output :if-exists :supersede) 29 | ;; (loop for e in (cons 0 (mapcar #'timedump-endoff list)) do (format f "~A;~%" (float e))))) 30 | 31 | ;; (fomus "/home/david/code/projects/perc/score1.fms" :filename "/home/david/code/projects/perc/score1" :output (list :timedump :callback #'savetimes)) 32 | 33 | 34 | (deffomusmodule 35 | (:keyname :timedump) (:type :backend) (:entryfun do-timedump) 36 | (:export #:timedump #:timedump-off #:timedump-endoff #:timedump-dur #:timedump-timesig #:timedump-barline) 37 | (:import-from #:fomus #:force-list #:*verbose* #:out) 38 | (:documentation "A simple backend that sends measure offsets to a user callback function (for storing time info, creating click tracks, etc.--see timedump.lisp for info)")) 39 | 40 | ;; timesig is given in the form of a cons 41 | ;; barline is the barline property (:double, etc.) for the measure if present (applies to the BEGINNING of the measure) 42 | (defstruct (timedump (:copier nil) (:predicate timedumpp)) 43 | off endoff dur timesig barline) 44 | 45 | (defun do-timedump (parts filename options process view) 46 | (declare (ignore process view)) 47 | (when (>= *verbose* 1) (out ";; Dumping time/measure data...~%")) 48 | (destructuring-bind (&key callback partids &allow-other-keys) options 49 | (if callback 50 | (loop for e in (or (force-list partids) (list (part-partid (first parts)))) 51 | for p = (find e parts :key #'part-partid) 52 | do (funcall callback 53 | (loop with bl for m in (part-meas p) 54 | collect (make-timedump :off (meas-off m) :endoff (meas-endoff m) 55 | :dur (- (meas-endoff m) (meas-off m)) :timesig (timesig-time (meas-timesig m)) 56 | :barline bl) 57 | do (setf bl (second (getprop m :barline)))) 58 | filename)) 59 | (format t ";; ERROR: Need a user callback function for timedump~%")))) 60 | -------------------------------------------------------------------------------- /modules/backends/notepro.lisp: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | 3 | ;; NOTEPRO--Backend Module 4 | ;; David Psenicka 5 | 6 | ;; Outputs a NotePro file for use with M4C 7 | 8 | ;; Options: 9 | 10 | 11 | 12 | (deffomusmodule 13 | (:keyname :notepro) (:type :backend) (:entryfun do-notepro) (:filename-ext "np") 14 | (:import-from #:fomus #:force-list #:*verbose* #:out) 15 | (:documentation "(Unfinished) Outputs a NotePro file for use with M4C")) 16 | 17 | ;; timesig is given in the form of a cons 18 | ;; barline is the barline property (:double, etc.) for the measure if present (applies to the BEGINNING of the measure) 19 | (defstruct (timedump (:copier nil) (:predicate timedumpp)) 20 | off endoff dur timesig barline) 21 | 22 | (defun do-timedump (parts filename options process view) 23 | (declare (ignorable parts filename options process view)) 24 | (out ";; ERROR: NotePro backend doesn't work yet~%") 25 | #|(when (>= *verbose* 1) (out ";; Saving NotePro file ~S...~%" filename))|#) 26 | 27 | ;; (destructuring-bind (&key callback partids &allow-other-keys) options 28 | ;; (if callback 29 | ;; (loop for e in (or (force-list partids) (list (part-partid (first parts)))) 30 | ;; for p = (find e parts :key #'part-partid) 31 | ;; do (funcall callback 32 | ;; (loop with bl for m in (part-meas p) 33 | ;; collect (make-timedump :off (meas-off m) :endoff (meas-endoff m) 34 | ;; :dur (- (meas-endoff m) (meas-off m)) :timesig (timesig-time (meas-timesig m)) 35 | ;; :barline bl) 36 | ;; do (setf bl (second (getprop m :barline)))) 37 | ;; filename)) 38 | ;; (format t ";; ERROR: Need a user callback function for timedump~%"))) 39 | -------------------------------------------------------------------------------- /modules/backends/timedump.lisp: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | 3 | ;; TIMEDUMP--Backend Module 4 | ;; David Psenicka 5 | 6 | ;; A very simple backend that sends timing information (measure onsets, offsets, durations and time signatures) to a user-defined callback 7 | ;; function for dumping timing info into a data file or generating a click track, etc.. 8 | 9 | ;; The user callback function looks like this: 10 | 11 | ;; (defun my-callback (list-of-structs filename) ... 12 | 13 | ;; "list-of-structs" is a list of timedump structs (see the defstruct definition below). Pass the function to TIMEDUMP with a :CALLBACK 14 | ;; keyword argument. Each timedump struct represents a measure of the score. 15 | ;; "filename" is the base filename (w/o extension), given as a string 16 | 17 | ;; Options: 18 | ;; callback = user callback function 19 | ;; partids = optional (for polymetric scores): partid or list of partids (callback is called once for each partid in list) 20 | 21 | 22 | ;; Example: 23 | 24 | ;; (load-fomus-module :timedump) ; (don't normally have to do this, but it needs to be loaded so the symbols are accessible) 25 | ;; (use-package :fomus-timedump) 26 | ;; (defun savetimes (list filename) 27 | ;; (format t ";; Dumping measure downbeats to ~S~%" (concatenate 'string filename ".txt")) 28 | ;; (with-open-file (f (concatenate 'string filename ".txt") :direction :output :if-exists :supersede) 29 | ;; (loop for e in (cons 0 (mapcar #'timedump-endoff list)) do (format f "~A;~%" (float e))))) 30 | 31 | ;; (fomus "/home/david/code/projects/perc/score1.fms" :filename "/home/david/code/projects/perc/score1" :output (list :timedump :callback #'savetimes)) 32 | 33 | 34 | (deffomusmodule 35 | (:keyname :timedump) (:type :backend) (:entryfun do-timedump) 36 | (:export #:timedump #:timedump-off #:timedump-endoff #:timedump-dur #:timedump-timesig #:timedump-barline) 37 | (:import-from #:fomus #:force-list #:*verbose* #:out) 38 | (:documentation "A simple backend that sends measure offsets to a user callback function (for storing time info, creating click tracks, etc.--see timedump.lisp for info)")) 39 | 40 | ;; timesig is given in the form of a cons 41 | ;; barline is the barline property (:double, etc.) for the measure if present (applies to the BEGINNING of the measure) 42 | (defstruct (timedump (:copier nil) (:predicate timedumpp)) 43 | off endoff dur timesig barline) 44 | 45 | (defun do-timedump (parts filename options process view) 46 | (declare (ignore process view)) 47 | (when (>= *verbose* 1) (out ";; Dumping time/measure data...~%")) 48 | (destructuring-bind (&key callback partids &allow-other-keys) options 49 | (if callback 50 | (loop for e in (or (force-list partids) (list (part-partid (first parts)))) 51 | for p = (find e parts :key #'part-partid) 52 | do (funcall callback 53 | (loop with bl for m in (part-meas p) 54 | collect (make-timedump :off (meas-off m) :endoff (meas-endoff m) 55 | :dur (- (meas-endoff m) (meas-off m)) :timesig (timesig-time (meas-timesig m)) 56 | :barline bl) 57 | do (setf bl (second (getprop m :barline)))) 58 | filename)) 59 | (format t ";; ERROR: Need a user callback function for timedump~%")))) 60 | -------------------------------------------------------------------------------- /ottavas.lisp: -------------------------------------------------------------------------------- 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)))) -------------------------------------------------------------------------------- /package.lisp: -------------------------------------------------------------------------------- 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" 43 | "TIMESIG" 44 | "NOTE" 45 | "REST" "PART" "INSTR" "PERC" "MEAS" 46 | "KEYSIG" 47 | "OBJ-ID" "OBJ-PARTID" 48 | "EVENT-OFF" "EVENT-PARTID" "EVENT-PARTIDS" 49 | "TIMESIG-TIME" "TIMESIG-DIV" "TIMESIG-COMP" "TIMESIG-BEAT" "TIMESIG-PROPS" "TIMESIG-PARTIDS" "TIMESIG-REPL" 50 | "EVENT-DUR" "EVENT-MARKS" "EVENT-VOICE" "EVENT-NOTE" 51 | "PART-NAME" "PART-ABBREV" "PART-OPTS" "PART-EVENTS" "PART-INSTR" "PART-PARTID" 52 | ; instruments 53 | "INSTR-SYM" "INSTR-CLEFS" "INSTR-STAVES" "INSTR-MINP" "INSTR-MAXP" "INSTR-VOICELIM" "INSTR-TPOSE" "INSTR-LEGLS" "INSTR-8UPLEGLS" "INSTR-8DNLEGLS" 54 | "PERC-SYM" "PERC-STAFF" "PERC-NOTE" 55 | ; object extensions 56 | "EX-BASE" "NOTEEX" "RESTEX" "PARTEX" 57 | "MAKE-NOTEEX" "MAKE-RESTEX" "MAKE-PARTEX" 58 | "PART-MEAS" 59 | "EVENT-TUP" "EVENT-TIELT" "EVENT-TIERT" "EVENT-BEAMLT" "EVENT-BEAMRT" "EVENT-INV" "PART-PROPS" "PART-USERORD" 60 | "MEAS-TIMESIG" "MEAS-OFF" "MEAS-ENDOFF" "MEAS-EVENTS" "MEAS-PROPS" "MEAS-DIV" 61 | ; auxiliary accessors/functions 62 | ; caution: some only apply to OUTPUT .fms file extension objects, others only apply BEFORE calling fomus! 63 | "TIMESIG-OFF" "MEAS-VOICES" 64 | "ADDPROP" "GETPROP" "GETPROPS" "RMPROP" "COMBPROPS" "ADDMARK" "GETMARK" "GETMARKS" "RMMARK" "COMBMARKS" 65 | 66 | "+TITLE+" "+VERSION+")) 67 | 68 | (in-package :fomus) 69 | 70 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 71 | ;; GLOBAL 72 | 73 | (defmacro compile-settings () 74 | '(eval-when (:compile-toplevel) 75 | #+debug (declaim (optimize (safety 3) (debug 3))) 76 | #-debug (declaim (optimize (speed 3) (debug 0) (safety 0) #+(and cmu (not warn)) (ext:inhibit-warnings 3)) 77 | #+(and sbcl (not warn)) (sb-ext:muffle-conditions sb-ext:compiler-note)))) 78 | (compile-settings) 79 | 80 | (declaim (type (integer 0 2) *verbose*)) 81 | (defparameter *verbose* 1) 82 | 83 | ;; CLISP COMPATIBILITY 84 | 85 | #-clisp 86 | (defmacro mloop (&body forms) `(loop ,@forms)) 87 | #+clisp 88 | (defmacro mloop (&body forms) `(or (loop ,@forms) 0)) 89 | 90 | ;; PREVENT SILLY CM LOADING ERROR 91 | (intern "KEYSIG") 92 | ;; PREVENT WEIRD OPENMCL LOADING ERROR 93 | #+openmcl (eval-when (:load-toplevel :execute) (let ((s (find-symbol "INSTR" :common-lisp-user))) (when s (shadow s :common-lisp-user)))) 94 | -------------------------------------------------------------------------------- /version.lisp: -------------------------------------------------------------------------------- 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 | --------------------------------------------------------------------------------