]> git.donarmstrong.com Git - lilypond.git/commitdiff
lots of changes (see diff :-)
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 20 Sep 2002 22:48:50 +0000 (22:48 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 20 Sep 2002 22:48:50 +0000 (22:48 +0000)
32 files changed:
ChangeLog
lily/include/lily-guile.hh
lily/include/ly-modules.hh [new file with mode: 0644]
lily/input-file-results.cc
lily/key-performer.cc
lily/lily-guile.cc
lily/ly-module.cc [new file with mode: 0644]
lily/midi-item.cc
lily/music-output-def.cc
lily/my-lily-lexer.cc
lily/note-head.cc
lily/paper-def.cc
lily/paper-outputter.cc
lily/parser.yy
lily/score.cc
lily/staff-performer.cc
ly/init.ly
ly/paper-init.ly
scm/c++.scm
scm/clef.scm
scm/font.scm
scm/grob-description.scm
scm/grob-property-description.scm
scm/lily.scm
scm/midi.scm
scm/music-functions.scm
scm/output-lib.scm
scm/pdf.scm
scm/pdftex.scm
scm/ps.scm
scm/sketch.scm
scm/tex.scm

index 0c59df748844e8be1edcf501d1a5f6c37af1843e..f84ff1a77a4bed4581db6b39c12fa08768063c73 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2002-09-20  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/ly-module.cc: new file.
+
 2002-09-17  Rune Zedeler  <rune@zedeler.dk>
 
        * lily/accidental-engraver.cc: Also work with partial measures.
index f311dd250a1e80fe43f606940922bfd3cf7acea4..c0aed3729c52edea1efbd2925f655b7c02eb1e77 100644 (file)
@@ -227,9 +227,6 @@ SCM ly_split_list (SCM s, SCM list);
 SCM ly_unique (SCM list);
 
 
-SCM ly_make_anonymous_module ();
-void ly_copy_module_variable (SCM dest, SCM src);
-SCM ly_module_to_alist (SCM mod);
 
 /*
   snarfing.
diff --git a/lily/include/ly-modules.hh b/lily/include/ly-modules.hh
new file mode 100644 (file)
index 0000000..a96d0a1
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+  ly-modules.hh -- declare  module related helper functions 
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef LY_MODULES_HH
+#define LY_MODULES_HH
+
+SCM ly_make_anonymous_module ();
+void ly_copy_module_variables (SCM dest, SCM src);
+SCM ly_module_to_alist (SCM mod);
+SCM ly_module_lookup (SCM module, SCM sym);
+SCM ly_module_symbols (SCM mod);
+void  ly_reexport_module (SCM mod);
+
+#endif /* LY_MODULES_HH */
+
index 718bdcd308acb8c59c7eb06835d0eb0f76c6d47b..7bf1e3324f27d10afafa1f9300c7aa38d9312173 100644 (file)
@@ -30,6 +30,7 @@
 #include "source.hh"
 #include "lily-version.hh"
 #include "scm-hash.hh"
+#include "ly-modules.hh"
 
 
 LY_DEFINE(ly_set_point_and_click_x, "set-point-and-click!", 1, 0, 0,
index 7401a637de01672927c1ce887d804afc064152bd..bb4094a1e6dbd198205678a2b596bd478e87818b 100644 (file)
@@ -44,6 +44,10 @@ Key_performer::create_audio_elements ()
 {
   if (key_req_) 
     {
+
+      /*
+       UGH. primitive-eval.
+       */
       SCM pitchlist = key_req_->get_mus_property ("pitch-alist");
       SCM proc = scm_primitive_eval (ly_symbol2scm ("accidentals-in-key")); 
       SCM acc = gh_call1 (proc, pitchlist);
index d7b7bbebace7b29492851438514377a7bfce213e..5f483c4fc737f195cc9ac19bcf7f6d63d70e6a52 100644 (file)
@@ -193,16 +193,6 @@ void add_scm_init_func (void (*f) ())
   scm_init_funcs_->push (f);
 }
 
-#if 0
-SCM
-ly_use_module (SCM module)
-{
-  scm_call_1 (SCM_VARIABLE_REF (process_use_modules_var),
-             scm_list_1 (scm_list_1 (convert_module_name (name))));
-  return SCM_UNSPECIFIED;
-}
-#endif
-
 void
 ly_init_ly_module (void *data)
 {
@@ -714,51 +704,3 @@ robust_list_ref(int i, SCM l)
   return gh_car(l);
 }
 
-static int module_count;
-
-void
-ly_init_anonymous_module (void * data)
-{
-  scm_c_use_module ("lily");  
-}
-
-SCM
-ly_make_anonymous_module ()
-{
-  String s = "*anonymous-ly-" + to_string (module_count++) +  "*";
-  SCM mod = scm_c_define_module (s.to_str0(), ly_init_anonymous_module, 0);
-  scm_module_define (mod, ly_symbol2scm ("symbols-defined-here"), SCM_EOL);
-  return mod;
-}
-
-void
-ly_copy_module_variable (SCM dest, SCM src)
-{
-  SCM defd = ly_symbol2scm ("symbols-defined-here");
-  SCM dvar = scm_module_lookup (src, ly_symbol2scm ("symbols-defined-here"));
-  SCM lst =  scm_variable_ref (dvar);
-  for (SCM s =lst; gh_pair_p (s); s  = gh_cdr (s))
-    {
-      SCM var  = scm_module_lookup (src, gh_car (s));
-      scm_module_define (dest, gh_car (s),
-                        scm_variable_ref (var));
-    }
-
-  scm_module_define (dest, defd, lst);
-}
-
-SCM
-ly_module_to_alist (SCM mod)
-{
-  SCM defd = ly_symbol2scm ("symbols-defined-here");
-  SCM dvar = scm_module_lookup (mod, defd);
-  SCM lst = scm_variable_ref (dvar);
-
-  SCM alist =  SCM_EOL;
-  for (SCM s =lst; gh_pair_p (s); s  = gh_cdr (s))
-    {
-      SCM var  = scm_module_lookup (mod, gh_car (s));
-      alist= scm_cons (scm_cons (gh_car(s), scm_variable_ref (var)), alist);
-    }
-  return alist;
-}
diff --git a/lily/ly-module.cc b/lily/ly-module.cc
new file mode 100644 (file)
index 0000000..632ea22
--- /dev/null
@@ -0,0 +1,115 @@
+/*   
+ly-module.cc --  implement guile module stuff.
+
+source file of the GNU LilyPond music typesetter
+
+(c) 2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "string.hh"
+#include "lily-guile.hh"
+#include "ly-modules.hh"
+
+static int module_count;
+
+void
+ly_init_anonymous_module (void * data)
+{
+  scm_c_use_module ("lily");  
+}
+
+SCM
+ly_make_anonymous_module ()
+{
+  String s = "*anonymous-ly-" + to_string (module_count++) +  "*";
+  SCM mod = scm_c_define_module (s.to_str0(), ly_init_anonymous_module, 0);
+  return mod;
+}
+
+void
+ly_copy_module_variables (SCM dest, SCM src)
+{
+  SCM obarr= SCM_MODULE_OBARRAY(src);
+  SCM syms = SCM_EOL;
+
+  for (int i = 0;  i < SCM_VECTOR_LENGTH (obarr); i++)
+    {
+      for( SCM s = scm_vector_ref(obarr, SCM_MAKINUM (i));
+          gh_pair_p (s); s = gh_cdr (s))
+       {
+         scm_module_define (dest, gh_caar (s), scm_variable_ref (gh_cdar(s)));
+       }
+    }
+}
+
+SCM
+ly_module_symbols (SCM mod)
+{
+  SCM obarr= SCM_MODULE_OBARRAY(mod);
+  SCM syms = SCM_EOL;
+
+  for (int i = 0;  i < SCM_VECTOR_LENGTH (obarr); i++)
+    {
+      for( SCM s = scm_vector_ref(obarr, SCM_MAKINUM (i));
+          gh_pair_p (s); s = gh_cdr (s))
+       {
+         syms = scm_cons (gh_caar (s), syms);
+       }
+    }
+  return syms;
+}
+
+
+
+SCM
+ly_module_to_alist (SCM mod)
+{
+  SCM obarr= SCM_MODULE_OBARRAY(mod);
+  SCM alist = SCM_EOL;
+
+  for (int i = 0;  i < SCM_VECTOR_LENGTH (obarr); i++)
+    {
+      for( SCM s = scm_vector_ref(obarr, SCM_MAKINUM (i));
+          gh_pair_p (s); s = gh_cdr (s))
+       {
+         alist = scm_acons (gh_caar (s), scm_variable_ref (gh_cdar (s)),
+                                                           alist);
+       }
+    }
+  return alist;
+}
+
+/*
+  Lookup SYM, but don't give error when it is not defined.
+ */
+SCM
+ly_module_lookup (SCM module, SCM sym)
+{
+  SCM var;
+#define FUNC_NAME __FUNCTION__
+  SCM_VALIDATE_MODULE (1, module);
+
+  var = scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F);
+  return var;
+}
+
+SCM export_function ;
+
+void
+ly_export (SCM module, SCM namelist)
+{
+  if (!export_function)
+    {
+      export_function = scm_permanent_object (scm_c_lookup ("module-export!"));
+    }
+  
+  scm_call_2 (SCM_VARIABLE_REF (export_function),
+             module, namelist);
+}
+
+void
+ly_reexport_module (SCM mod)
+{
+  ly_export (mod, ly_module_symbols (mod));
+}
index f13edbbd0a905ef2a331d67a480230cedd811d85..2a0b6a274fbc7407ec5015bda5eb3479b1bf0a7d 100644 (file)
@@ -135,6 +135,10 @@ Midi_instrument::string () const
 {
   Byte program_byte = 0;
   bool found = false;
+
+  /*
+    UGH. don't use eval.
+   */
   SCM proc = scm_primitive_eval (ly_symbol2scm ("midi-program")); 
   SCM program = gh_call1 (proc, ly_symbol2scm (audio_->str_.to_str0 ()));
   found = (program != SCM_BOOL_F);
index 401bcb08103da491252b856299ba7d943e58306d..089cdb5cf4df4d220fada9bae719b39207f90d59 100644 (file)
@@ -16,6 +16,7 @@
 #include "main.hh"
 #include "file-path.hh"
 #include "lily-guile.hh"
+#include "ly-modules.hh"
 
 #include "ly-smobs.icc"
 
@@ -58,8 +59,7 @@ Music_output_def::Music_output_def (Music_output_def const &s)
   scaled_fonts_ = scm_list_copy (s.scaled_fonts_);  
 
   scope_= ly_make_anonymous_module ();
-  ly_copy_module_variable (scope_, s.scope_);
-
+  ly_copy_module_variables (scope_, s.scope_);
 }
 
 
@@ -167,15 +167,12 @@ void
 Music_output_def::set_variable (SCM sym, SCM val)
 {
   scm_module_define (scope_, sym, val);
-  
-  SCM var = scm_module_lookup (scope_, ly_symbol2scm ("symbols-defined-here"));
-  scm_variable_set_x (var, gh_cons (sym,  scm_variable_ref (var)));
 }
 
 SCM
 Music_output_def::lookup_variable (SCM sym) const
 {
-  SCM var = scm_module_lookup (scope_, sym);
+  SCM var = ly_module_lookup (scope_, sym);
 
   return scm_variable_ref (var);
 }
index 5dcab4430bb88f34893a46cfcbc1cd6c3340c4a0..ce77d49cc65575066d4022bcc4e772cff06e324f 100644 (file)
@@ -23,6 +23,8 @@
 #include "main.hh"
 #include "input.hh"
 #include "moment.hh"
+#include "ly-modules.hh"
+
 
 static Keyword_ent the_key_tab[]={
   {"alias", ALIAS},
@@ -108,9 +110,13 @@ My_lily_lexer::My_lily_lexer ()
 void
 My_lily_lexer::add_scope (SCM module)
 {
+  ly_reexport_module (scm_current_module());
   scm_set_current_module (module);
   for (SCM s = scopes_; gh_pair_p (s); s = gh_cdr (s))
     {
+      /*
+       UGH. how to do this more neatly? 
+      */      
       SCM expr = scm_list_n (ly_symbol2scm ("module-use!"),
                             module, scm_list_n (ly_symbol2scm ("module-public-interface"),
                                                 gh_car (s), SCM_UNDEFINED),
@@ -120,7 +126,6 @@ My_lily_lexer::add_scope (SCM module)
     }
   
   scopes_ = scm_cons (module, scopes_);
-  scm_display (scm_current_module(), scm_current_output_port());
 }
 
 SCM
@@ -145,10 +150,11 @@ My_lily_lexer::lookup_identifier (String s)
 {
   SCM sym = ly_symbol2scm (s.to_str0());
   for (SCM s = scopes_; gh_pair_p (s); s = gh_cdr (s))
-  {
-    SCM var = scm_module_lookup (gh_car (s), sym);
-    return scm_variable_ref (var);
-  }
+    {
+      SCM var = ly_module_lookup (gh_car (s), sym);
+      if (var != SCM_BOOL_F)
+       return scm_variable_ref(var);
+    }
 
   return SCM_UNSPECIFIED;
 }
@@ -175,11 +181,8 @@ My_lily_lexer::set_identifier (SCM name, SCM s)
 
   SCM sym = scm_string_to_symbol (name);
   SCM mod = gh_car (scopes_);
-  SCM var = scm_module_lookup (mod, ly_symbol2scm ("symbols-defined-here"));
 
-  scm_variable_set_x (var, gh_cons (sym,  scm_variable_ref (var)));
   scm_module_define (mod, sym, s);
-  scm_c_export (ly_symbol2string(sym).to_str0(), NULL);
 }
 
 My_lily_lexer::~My_lily_lexer ()
index 16c58ebaea15aa1137b235a6ea3dc07e50862290..f8abf0e057a4b05dc4ab2e7559cd02034f98cac3 100644 (file)
@@ -111,16 +111,9 @@ internal_brew_molecule (Grob *me, bool ledger_take_space)
       return Molecule();
     }
 
-  /*
-    ugh: use gh_call () / scm_apply ().
-
-    UGH: use grob-property.
-  */
   SCM log = gh_int2scm (Note_head::get_balltype (me));
-  SCM exp = scm_list_n (ly_symbol2scm ("find-notehead-symbol"), log,
-                       ly_quote_scm (style),
-                       SCM_UNDEFINED);
-  SCM scm_font_char = scm_primitive_eval (exp);
+  SCM proc = me->get_grob_property ("glyph-name-procedure");
+  SCM scm_font_char = scm_call_2 (proc, log, style);
   String font_char = "noteheads-" + ly_scm2string (scm_font_char);
 
   Font_metric * fm = Font_interface::get_default_font (me);
index 8cc0f7ada5fac3037bf06a4b695fee227eba73a3..82a4ade8a7667538a4cac8d87ff955b790c0e60f 100644 (file)
@@ -20,6 +20,8 @@
 #include "scm-hash.hh"
 #include "input-file-results.hh" // urg? header_global
 #include "paper-outputter.hh"
+#include "ly-modules.hh"
+
 
 /*
   This is an almost empty thing. The only substantial thing this class
@@ -128,7 +130,7 @@ Paper_def::find_font (SCM fn, Real m)
     }
   else
     {
-      SCM var =  scm_module_lookup (scope_, ly_symbol2scm ("outputscale"));
+      SCM var =   ly_module_lookup (scope_, ly_symbol2scm ("outputscale"));
       m /= gh_scm2double (scm_variable_ref (var));
 
       f = all_fonts_global->find_font (ly_scm2string (fn));
index 796f94079c2db0f6193f6c069ba5facd98fdd8ab..e914793377f41f66f38123d3a76938d8aec8baf1 100644 (file)
@@ -23,6 +23,8 @@
 #include "lily-version.hh"
 #include "paper-def.hh"
 #include "input-file-results.hh"
+#include "ly-modules.hh"
+
 
 
 /*
@@ -94,6 +96,9 @@ Paper_outputter::output_scheme (SCM scm)
 void
 Paper_outputter::output_scope (SCM mod, String prefix)
 {
+  if (!SCM_MODULEP (mod))
+    return ;
+  
   SCM al = ly_module_to_alist (mod);
   for (SCM s = al ; gh_pair_p (s); s = ly_cdr (s))
     {
index 2754f6dd79ba0fc0a4d4cb98776d5ac6e1b79845..9e8574733d2fe9445ef1c3266cc3b870f5e5541d 100644 (file)
@@ -60,6 +60,7 @@ this.
 #include "auto-change-iterator.hh"
 #include "un-relativable-music.hh"
 #include "chord.hh"
+#include "ly-modules.hh"
 
 bool
 regular_identifier_b (SCM id)
index 650d7da8ea4097e6f246a531c02bd7ae1709d6c2..b1bf3dc749280cc2250621676f39751b7463cbd9 100644 (file)
@@ -21,6 +21,8 @@
 #include "cpu-timer.hh"
 #include "main.hh"
 #include "paper-def.hh"
+#include "ly-modules.hh"
+
 
 
 /*
@@ -58,7 +60,7 @@ Score::Score (Score const &s)
     defs_.push (s.defs_[i]->clone ());
   errorlevel_ = s.errorlevel_;
   header_ = ly_make_anonymous_module ();
-  ly_copy_module_variable (header_, s.header_);
+  ly_copy_module_variables (header_, s.header_);
 }
 
 Score::~Score ()
index 56d31210b110cf79ae9aeb0ccebc15ea6265e6f5..0d64b09cecef78ff303ff308cdf853cb81a58770 100644 (file)
@@ -88,7 +88,11 @@ Staff_performer::create_audio_elements ()
 void
 Staff_performer::stop_translation_timestep ()
 {
-  SCM proc = scm_primitive_eval (ly_symbol2scm ("percussion-p")); 
+  /*
+    UGH. -> don't use eval.
+  */
+  
+  SCM proc = scm_primitive_eval (ly_symbol2scm ("percussion?")); 
   SCM drums = gh_call1 (proc, ly_symbol2scm (instrument_string_.to_str0 ()));
   audio_staff_->channel_ = (drums == SCM_BOOL_T ? 9 : -1 );
   if (name_)
index 67a55d1bc9875ee8178f2b2b43cb0336ae89afff..1d6a26434ba18827755210c59a88014c8222edd8 100644 (file)
@@ -1,5 +1,7 @@
 % Toplevel initialisation file. 
-#(use-modules (lily))
+
+#(define-public point-and-click #f)
+#(define-public midi-debug #f)
 
 \version "1.5.68"
 
index 04a4eb881d36bafbfcbdc26d5b3e9e51636b642a..26ec0b72336de7084ed275cf2bae5ac12bb5716b 100644 (file)
@@ -10,6 +10,6 @@
 linewidth = \hsize - 2.\cm
 % Leave the textheight calculation to the geometry package. /MB
 %textheight = \vsize - 4.\cm
-
+raggedright = ##f
 indent = \linewidth / 14.0
 
index 41bd34139e4243869fe608a20859336feafc449a..9cd9d8cd914f13058acbdfebd9d970cbcb808b58 100644 (file)
@@ -7,30 +7,30 @@
 
 ;;; Note: this file can't be used without LilyPond executable
 
-(define (number-pair?  x)
+(define-public (number-pair?  x)
   (and (pair? x)
        (number? (car x)) (number? (cdr x))))
-(define (number-or-grob? x)
+(define-public (number-or-grob? x)
   (or (ly-grob? x) (number? x))
   )
 
-(define (grob-list? x)
+(define-public (grob-list? x)
   (list? x))
 
-(define (moment-pair?  x)
+(define-public (moment-pair?  x)
   (and (pair? x)
        (moment? (car x)) (moment? (cdr x))))
 
-(define (boolean-or-symbol? x)
+(define-public (boolean-or-symbol? x)
   (or (boolean? x) (symbol? x)))
 
-(define (number-or-string? x)
+(define-public (number-or-string? x)
   (or (number? x) (string? x)))
 
-(define (markup? x)
+(define-public (markup? x)
   (or (string? x) (list? x)))
 
-(define (scheme? x) #t)
+(define-public (scheme? x) #t)
 
 (define type-p-name-alist
   `(
@@ -120,7 +120,7 @@ is the  first to satisfy CRIT "
 
 
 ; Make a function that checks score element for being of a specific type. 
-(define (make-type-checker symbol)
+(define-public (make-type-checker symbol)
   (lambda (elt)
     ;;(display  symbol)
     ;;(eq? #t (ly-get-grob-property elt symbol))
@@ -132,7 +132,7 @@ is the  first to satisfy CRIT "
       (cdr cell)
       (car cell)))
 
-(define (repeat-name-to-ctor name)
+(define-public (repeat-name-to-ctor name)
   (let*
       ((supported-reps
        `(("volta" . ((iterator-ctor . ,Volta_repeat_iterator::constructor)
index 50d853c0df2315e68d5d083093ad7af9502aa577..45e6edcd5039c464e86f6394b554ecf5ad9b4da3 100644 (file)
@@ -88,7 +88,7 @@
   )
 )
 
-(define (clef-name-to-properties cl)
+(define-public (clef-name-to-properties cl)
   (let ((e '())
        (c0 0)
        (oct 0)
index 116382de82236e6911b92f0703dc103016561222..b45ccc8266fbb3d876779dc40bb37530b278612d 100644 (file)
             paper20-style-sheet-alist))
        font-list-alist)))
 
-(define (make-style-sheet sym)
+(define-public (make-style-sheet sym)
   `((fonts . ,(append paper-style-sheet-alist
                      (cdr (assoc sym font-list-alist))))
     (font-defaults
index 169118c83214b1580d39cc90ded53c84dcf46e01..ea627e1d3558fc12daf6f08ba38a47a230db3a5e 100644 (file)
      . (
        (style . default)
        (molecule-callback . ,Note_head::brew_molecule)
+       (glyph-name-procedure . ,find-notehead-symbol)
        (Y-offset-callbacks  . (,Staff_symbol_referencer::callback))
        (stem-attachment-function . ,note-head-style->attachment-coordinates)
        (meta . ((interfaces . (rhythmic-head-interface font-interface note-head-interface staff-symbol-referencer-interface item-interface ))))
index 28bdce85bff520ea60d5e405eff39bdfc3efab3f..7c7f299833345993ea3ea89e23d898d7109494c3 100644 (file)
@@ -221,6 +221,8 @@ beaming style: stems stop at innermost beams.")
 
 (grob-property-description 'glyph string? "a string determining what (style) of  glyph is typeset. Valid choices depend on the function that is reading this property. .")
 (grob-property-description 'glyph-name string? "a name of character within font.")
+(grob-property-description 'glyph-name-procedure procedure? "Return
+name of character within font.")
 
 (grob-property-description 'gap number? "Size of a gap in a variable symbol.")
 
index e96acb9dccad7e08d67ea942279363562fea2f65..c5e67c2e2002ceeffde59e60d738ef712973d4b8 100644 (file)
@@ -12,7 +12,7 @@
 (use-modules (ice-9 regex))
 ; (use-modules (lily))
 
-(display "hallo\n")
+;;(display "hallo\n")
 ;;(display (make-duration 1  2))
 ;;(write standalone (current-error-port))
 
 ;;; General settings
 ;; debugging evaluator is slower.
 
-;(debug-enable 'debug)
+(debug-enable 'debug)
 ;(debug-enable 'backtrace)
-;(read-enable 'positions)
+(read-enable 'positions)
 
 
-
-(define point-and-click #f)
-(define security-paranoia #f)
-(define midi-debug #f)
+(define-public security-paranoia #f)
 
 (define (line-column-location line col file)
   "Print an input location, including column number ."
 (define ifndef "First run this through cpp.")
   
 (define-public default-script-alist '())
-(define font-name-alist  '())
 
 (if (not (defined? 'standalone))
     (define standalone (not (defined? 'ly-gulp-file))))
 
 ;; The regex module may not be available, or may be broken.
-(define use-regex
+(define-public use-regex
   (let ((os (string-downcase (vector-ref (uname) 0))))
     (not (equal? "cygwin" (substring os 0 (min 6 (string-length os)))))))
 
-;; If you have trouble with regex, define #f
-(define use-regex #t)
-;;(define use-regex #f)
 
 
 ;;; Un-assorted stuff
      output-alist)
    ))
 
-(define (find-dumper format )
+(define-public (find-dumper format )
   (let*
       ((d (assoc format output-alist)))
     
index e4b57135efcf2cd653c0d7a59674aee3804d7361..0f85275124583d08a11f37ec725eb334b0c378a8 100644 (file)
@@ -26,7 +26,7 @@
        )
       absolute-volume-alist))
 
-(define (default-dynamic-absolute-volume s)
+(define-public (default-dynamic-absolute-volume s)
   (let ((entry (assoc s absolute-volume-alist)))
     (if entry
        (cdr entry))))
 )
 
 
-(define (default-instrument-equalizer s)
+(define-public (default-instrument-equalizer s)
   (let ((entry (assoc s instrument-equalizer-alist)))
     (if entry
        (cdr entry))))
 
-;; returns whether the instrument should use midi channel 9
-(define (percussion-p instrument)
+
+(define-public (percussion? instrument)
+  "
+returns whether the instrument should use midi channel 9
+"
   (let* ((inst  (symbol->string instrument))
          (entry (assoc inst instrument-names-alist))
        )
      (and entry (>= (cdr entry) 32768))
   )
 )
-
-;; returns the program of the instrument
-(define (midi-program instrument)
+(define-public (midi-program instrument)
+"
+returns the program of the instrument
+"
   (let* ((inst  (symbol->string instrument))
          (entry (assoc inst instrument-names-alist))
        )
 
 ;; 90 == 90/127 == 0.71 is supposed to be the default value
 ;; urg: we should set this at start of track
-(define dynamic-default-volume 0.71)
+(define-public dynamic-default-volume 0.71)
 
-;; Count number of sharps minus number of flats
-(define (accidentals-in-key pitch-list)
+(define-public (accidentals-in-key pitch-list)
+  "Count number of sharps minus number of flats"
   (apply + (map cdr pitch-list)))
 
-;; Characterise the key as major if the alteration of the 
-;; third scale note is the same as that of the main note.
-;; Note: MIDI cannot handle other tonalities than major/minor.
-(define (major-key pitch-list)
+(define-public (major-key pitch-list)
+  "Characterise the key as major if the alteration of the 
+third scale note is the same as that of the main note.
+Note: MIDI cannot handle other tonalities than major/minor.
+"
   ;; This charactersition is only true for a scale that starts at `c'.
   (if (not (equal? (car pitch-list) '(0 . 0)))
       (begin
index f9d0d9da1f8221d2bc66e5ffd40d5e279279d961..9849a22e21dd7e5e7f16c4981ef591d2c2051954 100644 (file)
@@ -123,7 +123,7 @@ Fingering_engraver."
 ;;;;;;;;;;;;;;;;
 
 
-(define (make-grob-property-set grob gprop val)
+(define-public (make-grob-property-set grob gprop val)
   "Make a M-exp that sets GPROP to VAL in GROBS. Does a pop first, i.e.
 this is not an override 
 "
@@ -138,8 +138,9 @@ this is not an override
      m
    
    ))
-   
-(define (make-grob-property-revert grob gprop)
+
+
+(define-public (make-grob-property-revert grob gprop)
   "Revert the grob property GPROP for GROB."
    (let* ((m (ly-make-music  "Music")))
      (ly-set-mus-property! m 'iterator-ctor Pop_property_iterator::constructor)
@@ -150,7 +151,7 @@ this is not an override
    
    ))
    
-(define (make-voice-props-set n)
+(define-public (make-voice-props-set n)
   (make-sequential-music
    (append
       (map (lambda (x) (make-grob-property-set x 'direction
@@ -160,7 +161,7 @@ this is not an override
    )
   ))
 
-(define (make-voice-props-revert)
+(define-public (make-voice-props-revert)
   (make-sequential-music
    (list
       (make-grob-property-revert 'Tie 'direction)
@@ -171,7 +172,7 @@ this is not an override
    ))
   )
 
-(define (context-spec-music m context . rest)
+(define-public (context-spec-music m context . rest)
   "Add \context CONTEXT = foo to M. "
   
   (let* ((cm (ly-make-music "Context_specced_music")))
@@ -183,19 +184,19 @@ this is not an override
     cm
   ))
 
-(define (make-sequential-music elts)
+(define-public (make-sequential-music elts)
   (let*  ((m (ly-make-music "Sequential_music")))
     (ly-set-mus-property! m 'elements elts)
     m
   ))
 
-(define (make-simultaneous-music elts)
+(define-public (make-simultaneous-music elts)
   (let*  ((m (ly-make-music "Simultaneous_music")))
     (ly-set-mus-property! m 'elements elts)
     m
     ))
 
-(define (music-separator? m)
+(define-public (music-separator? m)
   "Is M a separator."
   (let* ((n (ly-get-mus-property m 'name )))
     (and (symbol? n) (equal? 'separator n))
@@ -335,7 +336,7 @@ this is not an override
   m
   )
 
-(define toplevel-music-functions
+(define-public toplevel-music-functions
   (list check-start-chords
        voicify-music
 
index 8db3a6f1f6ac689a7e20f0ef15f63fa002982ce9..71eb4129a2c33fc180120a5cdad4a3eeaa65c9ba 100644 (file)
 ;; do nothing in .scm output
 (define (comment s) "")
 
-(define (numbers->string l)
+(define-public (numbers->string l)
   (apply string-append (map ly-number->string l)))
 
 ; (define (chop-decimal x) (if (< (abs x) 0.001) 0.0 x))
      (number->string n8)
      (number->string (remainder (- n (+ (* n64 64) (* n8 8))) 8)))))
 
-(define (inexact->string x radix)
+(define-public (inexact->string x radix)
   (let ((n (inexact->exact x)))
     (number->string n radix)))
 
 
-(define (control->string c)
+(define-public (number-pair->string c)
   (string-append (number->string (car c)) " "
                 (number->string (cdr c)) " "))
 
 
 
 ;; silly, use alist? 
-(define (find-notehead-symbol duration style)
+(define-public (find-notehead-symbol duration style)
   (case style
    ((xcircle) "2xcircle")
    ((harmonic) "0neo_mensural")
@@ -213,7 +213,7 @@ centered, X==1 is at the right, X == -1 is at the left."
      '(1.0 . 0.0)
      )))
 
-(define (string-encode-integer i)
+(define-public (string-encode-integer i)
   (cond
    ((= i  0) "o")
    ((< i 0)   (string-append "n" (string-encode-integer (- i))))
index 62ee967d7a9eef91516097d776ad1219cdc42bbe..6e91201bea9fbb426c0aa84fd77f68959fefd0c4 100644 (file)
@@ -24,7 +24,7 @@
 
 (define currentpoint (cons 0 0))
 (define (showcp) 
-  (string-append (control->string currentpoint) " "))
+  (string-append (number-pair->string currentpoint) " "))
 (define (moveto x y)
   (set! currentpoint (cons x y))
   (string-append (showcp) "m "))
index a3bd441da5878a6ed5eb835e20c117609dcda358..944f071b6dd4b5bb2469227d1c7e49882a8628b5 100644 (file)
@@ -18,6 +18,9 @@
             (ice-9 string-fun)   
             )
 
+
+(define font-name-alist  '())
+
 (define this-module (current-module))
 (define (unknown) 
   "%\n\\unknown%\n")
index ab2520e3b1f35a3c80b28ebc7f6df4a161e79e05..4be3fecf8b275ec5f8fd7282347c417a658adc0b 100644 (file)
@@ -10,6 +10,8 @@
 (define-module (scm ps)
   )
 
+(define font-name-alist  '())
+
 (define this-module (current-module))
 
 (debug-enable 'backtrace)
@@ -26,6 +28,7 @@
  
 (use-modules
  (guile)
+ (lily)
 )
 
 
 ;; what the heck is this interface ?
 (define (dashed-slur thick dash l)
   (string-append 
-   (apply string-append (map control->string l)) 
+   (apply string-append (map number-pair->string l)) 
    (ly-number->string thick) 
    " [ "
    (ly-number->string dash)
 ;; two beziers
 (define (bezier-sandwich l thick)
   (string-append 
-   (apply string-append (map control->string l))
+   (apply string-append (map number-pair->string l))
    (ly-number->string thick)
    " draw_bezier_sandwich "))
 
 ;; two beziers with round endings
 (define (bezier-bow l thick)
   (string-append 
-   (apply string-append (map control->string l))
+   (apply string-append (map number-pair->string l))
    (ly-number->string thick)
    " draw_bezier_sandwich "
    (bezier-ending (list-ref l 3) (list-ref l 0) (list-ref l 5))
index e5b2cd7a54caedfc0af8b99694289b521dee8b1f..70e84d592e511cc1cd66ab08d0d141fdfdacffce 100644 (file)
 ;; what the heck is this interface ?
 (define (dashed-slur thick dash l)
   (string-append 
-   (apply string-append (map control->string l)) 
+   (apply string-append (map number-pair->string l)) 
    (ly-number->string thick) 
    " [ "
    (ly-number->string dash)
index d6e6c9d54364b4f91458e6a7db2def9bdf2b16c2..30195baac7189b281a5f49e072e853b338b027e8 100644 (file)
             (ice-9 string-fun)
             (ice-9 format)
             (guile)
+            (lily)
             )
 
 (define this-module (current-module))
 
 ;;;;;;;;
 ;;;;;;;; DOCUMENT ME!
-;;;;;;;; 
+;;;;;;;;
+
+(define font-name-alist  '())
+
 (define (tex-encoded-fontswitch name-mag)
   (let* ((iname-mag (car name-mag))
         (ename-mag (cdr name-mag)))