-dnl WARNING WARNING WARNING WARNING
-dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4
dnl aclocal.m4 -*-shell-script-*-
dnl StepMake subroutines for configure.in
])
AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
- AC_ARG_ENABLE(tex-tfmdir,
- [ enable-tex-tfmdir=DIR set the tex-directory where cmr10.tfm lives (default: use kpsewhich)],
- [TFMDIR=$enableval],
- [TFMDIR=auto] )
+ AC_ARG_ENABLE(tfm-path,
+ [ enable-tfm-path=PATH set path of tex directories where tfm files live, esp.: cmr10.tfm (default: use kpsewhich)],
+ [tfm_path=$enableval],
+ [tfm_path=auto] )
AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
- AC_MSG_CHECKING(for TeX TFM directory)
- if test "x$TFMDIR" = xauto ; then
- if test "x$TEX_TFMDIR" = "x" ; then
- if test "x$KPSEWHICH" != "xno" ; then
- CMR10=`kpsewhich tfm cmr10.tfm`
- TEX_TFMDIR=`dirname $CMR10`
- else
- AC_STEPMAKE_WARN(Please set TEX_TFMDIR (to where cmr10.tfm lives):
- TEX_TFMDIR=/usr/local/TeX/lib/tex/fonts ./configure)
- fi
+ AC_MSG_CHECKING(for tfm path)
+
+ TFM_FONTS="cmr msam"
+
+ if test "x$tfm_path" = xauto ; then
+ if test "x$KPSEWHICH" != "xno" ; then
+ for i in $TFM_FONTS; do
+ dir=`$KPSEWHICH tfm ${i}10.tfm`
+ TFM_PATH="$TFM_PATH `dirname $dir`"
+ done
+ else
+ AC_STEPMAKE_WARN(Please specify where cmr10.tfm lives:
+ ./configure --enable-tfm-path=/usr/local/TeX/lib/tex/fonts)
fi
+ else
+ TFM_PATH=$tfm_path
fi
- AC_MSG_RESULT($TEX_TFMDIR)
- AC_SUBST(TEX_TFMDIR)
+
+ TFM_PATH=`echo $TFM_PATH | tr ':' ' '`
+ AC_MSG_RESULT($TFM_PATH)
+ AC_SUBST(TFM_PATH)
])
AC_DEFUN(AC_STEPMAKE_TEXMF, [
AC_DEFUN([GUILE_FLAGS],[
## The GUILE_FLAGS macro.
AC_MSG_CHECKING(for Guile)
- if $guile_config link > /dev/null ; then
- :
- else
+ if ! $guile_config link > /dev/null ; then
AC_MSG_RESULT("cannot execute $guile_config")
AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
exit 1
showln -sf $LILYPOND_SOURCEDIR/scripts/out/as2text $prefix/bin/as2text
-
testmkdir $prefix/share
rm -rf $prefix/share/lilypond
showln -sf $sources/lilypond $prefix/share/lilypond
BUILDDIR=`pwd`
-LOCALES="de it nl fr"
+LOCALES="de fr it ja nl ru"
for i in $LOCALES; do
dir=$BUILDDIR/share/locale/$i/LC_MESSAGES
if test ! -x $dir ; then
done
rm -f afm; showln -sf $BUILDDIR/mf/out afm
rm -f tfm; showln -sf $BUILDDIR/mf/out tfm
-if test "x$TEX_TFMDIR" = "x" ; then
- CMR10=`kpsewhich tfm cmr10.tfm`
- TEX_TFMDIR=`dirname $CMR10`
-fi
-rm -f cmtfm; showln -sf $TEX_TFMDIR $BUILDDIR/cmtfm
+TFM_FONTS="cmr msam"
+for i in $TFM_FONTS; do
+ dir=`kpsewhich tfm ${i}10.tfm`
+ TFM_PATH="$TFM_PATH `dirname $dir`"
+done
+
+# urg: GNU make's $(word) index starts at 1
+i=1
+for dir in $TFM_PATH; do
+ rm -f $BUILDDIR/tfm.$i;
+ showln -s $dir $BUILDDIR/tfm.$i
+ i=$((i + 1))
+done
if [ -f ../.gdbinit.lilypond ];
then
echo Starting configuration
echo
-(set -x; TEX_TFMDIR=$TEX_TFMDIR ./configure --prefix=$prefix --enable-debugging --enable-printing --enable-checking --disable-optimise)
+(set -x; ./configure --prefix=$prefix --enable-debugging --enable-printing --enable-checking --disable-optimise)
echo "Making tags in background..."
make TAGS > /dev/null 2>&1 &
program_prefix = @program_prefix@
program_suffix = @program_suffix@
EXTRA_LIBES = @EXTRA_LIBES@ @LIBS@
-TEX_TFMDIR = @TEX_TFMDIR@
+TFM_PATH = @TFM_PATH@
+TFM_SUFFIXES = @TFM_SUFFIXES@
RANLIB = @RANLIB@
DEFS = @DEFS@
#SET_MAKE = @SET_MAKE@
return "";
}
+/**
+ Add an directory, return false if failed
+ */
+bool
+File_path::try_add (String s)
+{
+ if (s == "")
+ s = ".";
+ FILE * f = fopen (s.ch_C(), "r");
+ if (!f)
+ return false;
+ fclose (f);
+
+ push (s);
+ return true;
+}
+
void
File_path::add (String s)
{
- push (s);
+ push (s);
}
String
Array<String>::push;
String str ()const;
- void add (String str);
+ bool try_add (String str);
+ void add (String);
void parse_path (String);
};
\notes \relative c''
{
\property Staff. createKeyOnClefChange = ##t
- \key bes; c2 \key c \minor; c2
+ \key bes; c2
+% \key c ; % \minor;
+ \key es ; % \minor;
+ c2
\break
- \key bes \major; c2 \clef alto; c2 \key d; c1
+ \key bes ; % \major;
+ c2 \clef alto; c2 \key d; \clef treble; c2
+ \property Staff. keySignature = #'((2 . -1) (6 . -1) (4 . -1))
+ e2
}
}
[cis8 d e f] [e! a b cis'] |
es e f e a a' a a' |
\clef "bass"; }
- [es16 c' b a] [g f es d] [c d es d] [c Bes As G] |
+ [es16 c' b a] [g f es d] [c d es d] [c bes, as, g,] |
\clef "violin";
\keysignature c;
}
-Audio_key::Audio_key (Key_def const& k)
+Audio_key::Audio_key () // Key_def const& k)
{
- key_ = k;
+ //fixme.
}
Audio_dynamic::Audio_dynamic (Real volume)
Key_change_req::Key_change_req (Key_change_req const&s)
: Request (s)
{
- key_ = s.key_ ? new Key_def (*s.key_) : 0;
+ key_ = s.key_ ? new Newkey_def (*s.key_) : 0;
}
Key_change_req::~Key_change_req ()
#ifndef AUDIO_ITEM_HH
#define AUDIO_ITEM_HH
- #include <typeinfo>
+#include <typeinfo>
#include "lily-proto.hh"
#include "string.hh"
#include "audio-element.hh"
-#include "key-def.hh"
+
#include "musical-pitch.hh"
#include "moment.hh"
#include "drul-array.hh"
class Audio_key : public Audio_item
{
public:
- Audio_key (Key_def const& key);
-
- Key_def key_;
+ Audio_key (); //Newkey_def const& key);
+ // FIXME
};
class Audio_instrument : public Audio_item
protected:
virtual void before_line_breaking ();
- virtual Molecule do_brew_molecule () const;
+ Molecule do_brew_molecule () const;
virtual Real get_bar_size () const;
};
#endif // BAR_HH
virtual void before_line_breaking ();
virtual void after_line_breaking ();
- virtual Molecule do_brew_molecule () const;
+ Molecule do_brew_molecule () const;
Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
private:
Breathing_sign (SCM s);
protected:
virtual void after_line_breaking ();
- virtual Molecule do_brew_molecule () const;
+ Molecule do_brew_molecule () const;
};
#endif // BREATHING_SIGN_HH
Molecule ly_text2molecule (SCM scm) const;
Chord_name(SCM s);
protected:
- virtual Molecule do_brew_molecule () const;
+ Molecule do_brew_molecule () const;
};
#include "array.hh"
#include "duration.hh"
#include "musical-pitch.hh"
-#include "key-def.hh"
+#include "newkey-def.hh"
#include "protected-scm.hh"
class Break_req : public Request {
Routines for sharps and flats are separated,
so that caller may identify non-conventional keys.
*/
+/*
+ UGH!
+ */
class Key_change_req : public Request
{
public:
Key_change_req ();
~Key_change_req();
Key_change_req(Key_change_req const &);
- Key_def *key_;
+ Newkey_def *key_;
protected:
VIRTUAL_COPY_CONS(Music);
Crescendo(SCM);
protected:
VIRTUAL_COPY_CONS(Score_element);
- virtual Molecule do_brew_molecule() const;
+ Molecule do_brew_molecule() const;
private:
Molecule get_symbol() const;
class Dots : public Item
{
protected:
- virtual Molecule do_brew_molecule () const;
+ Molecule do_brew_molecule () const;
virtual void after_line_breaking ();
public:
static SCM scheme_molecule (SCM);
protected:
- virtual Molecule do_brew_molecule () const;
+ Molecule do_brew_molecule () const;
void after_line_breaking ();
VIRTUAL_COPY_CONS (Score_element);
protected:
- virtual Molecule do_brew_molecule () const;
+ Molecule do_brew_molecule () const;
Interval do_height () const;
void after_line_breaking ();
-/*
- key-def.hh -- declare Key_def
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1999--2000 Jan Nieuwenhuizen <janneke@gnu.org>
-
- */
-#ifndef KEY_DEF_HH
-#define KEY_DEF_HH
-
-#include "array.hh"
-#include "musical-pitch.hh"
-
-/**
- Universal key definition (Should rename class Key to 'Accidentals'?)
-
- FIXME: merge key.hh and key-def.hh classes.
-
- FIXME: use Scheme data structs for this.
- */
-class Key_def
-{
-public:
- Key_def ();
-
- Array<Musical_pitch> pitch_arr_;
- int modality_i_;
- bool ordinary_key_b_;
-
- /// squash the octaves to 1
- void squash_octaves ();
-
- /// return number accidentals in key; ordinary key only
- int ordinary_accidentals_i () const;
-
- /// return number of flats in key
- int flats_i () const;
-
- /// return number of sharps in key
- int sharps_i () const;
-
- /// modality == 3
- bool minor_b () const;
-
- void transpose (Musical_pitch d);
-};
-
-#endif /* KEY_DEF_HH */
+#error
#ifndef KEYGRAV_HH
#define KEYGRAV_HH
-
-#include "engraver.hh"
-
-#include "musical-pitch.hh"
-#include "protected-scm.hh"
-#include "newkey.hh"
-
-
-/**
- Make the key signature.
- */
-class Key_engraver : public Engraver {
- void create_key(bool);
- void read_req (Key_change_req const * r);
-
-public:
- Key_engraver();
-
- VIRTUAL_COPY_CONS(Translator);
-
- /*
- TODO: move these into properties.
- */
- Newkey key_;
- Key_change_req * keyreq_l_;
- Key_item * item_p_;
-
- Protected_scm old_accs_;
- Protected_scm new_accs_;
-
- bool key_changed_b() const;
-
-protected:
- virtual bool do_try_music (Music *req_l);
- virtual void do_process_music();
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
- virtual void acknowledge_element (Score_element_info);
-};
-
+#error
#endif // KEYGRAV_HH
protected:
- virtual Molecule do_brew_molecule() const;
+ Molecule do_brew_molecule() const;
};
#endif // KEYITEM_HH
~Key_performer();
protected:
- void do_print() const;
virtual bool do_try_music (Music* req_l);
virtual void do_process_music ();
virtual void do_pre_move_processing ();
void add_pitch (Musical_pitch, bool cautionary, bool natural);
protected:
virtual void before_line_breaking ();
- virtual Molecule do_brew_molecule() const;
+ Molecule do_brew_molecule() const;
};
#endif // LOCALKEYITEM_HH
void add_column (Item*);
Molecule compound_rest (int)const;
protected:
- virtual Molecule do_brew_molecule () const;
+ Molecule do_brew_molecule () const;
VIRTUAL_COPY_CONS (Score_element);
virtual void do_add_processing ();
--- /dev/null
+/*
+ newkey-def.hh -- declare Newkey_def
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef NEWKEY_DEF_HH
+#define NEWKEY_DEF_HH
+
+#include "protected-scm.hh"
+#include "musical-pitch.hh"
+
+class Newkey_def
+{
+
+public:
+ Protected_scm pitch_alist_;
+
+ Newkey_def();
+
+ /// return number of flats in key
+ int flats_i () const;
+
+ /// return number of sharps in key
+ int sharps_i () const;
+ int accs_i (int) const;
+
+ void transpose (Musical_pitch d);
+};
+
+#endif /* NEWKEY_DEF_HH */
+
+
Note_head (SCM);
protected:
virtual void before_line_breaking ();
- virtual Molecule do_brew_molecule() const;
+ Molecule do_brew_molecule() const;
};
#endif // NOTEHEAD_HH
{
protected:
virtual void after_line_breaking ();
- virtual Molecule do_brew_molecule () const;
+ Molecule do_brew_molecule () const;
public:
static SCM scheme_molecule (SCM);
///executed directly after the item is added to the Paper_score
virtual void do_add_processing ();
- virtual Molecule do_brew_molecule ()const;
+ Molecule do_brew_molecule ()const;
static Interval dim_cache_callback (Dimension_cache const*);
Score_element * unsmob_element (SCM);
-#define MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(TYPE) \
-SCM \
-TYPE::scheme_molecule (SCM smob) \
-{ \
- TYPE * b = dynamic_cast<TYPE*> (unsmob_element (smob)); \
- return b ? b->do_brew_molecule ().create_scheme () : SCM_EOL; \
-} \
- \
+#define MAKE_SCHEME_SCORE_ELEMENT_NON_DEFAULT_CALLBACKS(TYPE) \
void \
TYPE ## __init_functions () \
{ \
\
ADD_SCM_INIT_FUNC(TYPE ## _molecule, TYPE ## __init_functions); \
+#define MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(TYPE) \
+MAKE_SCHEME_SCORE_ELEMENT_NON_DEFAULT_CALLBACKS(TYPE);\
+SCM \
+TYPE::scheme_molecule (SCM smob) \
+{ \
+ TYPE * b = dynamic_cast<TYPE*> (unsmob_element (smob)); \
+ return b ? b->do_brew_molecule ().create_scheme () : SCM_EOL; \
+} \
+ \
+
#endif // STAFFELEM_HH
protected:
- virtual Molecule do_brew_molecule () const;
+ Molecule do_brew_molecule () const;
virtual Array<Offset> get_encompass_offset_arr () const;
Bezier get_curve () const;
Drul_array<Real> dy_f_drul_;
protected:
VIRTUAL_COPY_CONS(Score_element);
- virtual Molecule do_brew_molecule() const;
+ Molecule do_brew_molecule() const;
};
#endif // STAFFSYM_HH
class Stem_tremolo : public Item {
protected:
Stem * stem_l () const;
- virtual Molecule do_brew_molecule () const;
+ Molecule do_brew_molecule () const;
static Interval dim_callback (Score_element*, Axis);
public:
virtual void before_line_breaking();
static Interval dim_callback (Score_element const*,Axis);
- virtual Molecule do_brew_molecule() const;
+ Molecule do_brew_molecule() const;
void set_spacing_hints () ;
};
public:
static SCM scheme_molecule (SCM);
-VIRTUAL_COPY_CONS (Score_element);
+ VIRTUAL_COPY_CONS (Score_element);
Sustain_pedal (SCM);
protected:
- virtual Molecule do_brew_molecule () const;
+ // Molecule do_brew_molecule () const;
virtual void after_line_breaking ();
};
Text_item (SCM s);
protected:
- virtual Molecule do_brew_molecule () const;
+ Molecule do_brew_molecule () const;
};
#endif /* Text_ITEM_HH */
virtual Direction get_default_dir() const;
protected:
- virtual Molecule do_brew_molecule () const;
+ Molecule do_brew_molecule () const;
virtual Array<Offset> get_encompass_offset_arr () const;
Bezier get_curve () const;
Molecule time_signature (int, int)const;
protected:
- virtual Molecule do_brew_molecule() const;
+ Molecule do_brew_molecule() const;
public:
Time_signature (SCM);
static SCM scheme_molecule (SCM);
void calc_dy (Real *) const;
void calc_position_and_height (Real*,Real *dy)const;
- virtual Molecule do_brew_molecule () const;
+ Molecule do_brew_molecule () const;
VIRTUAL_COPY_CONS(Score_element);
virtual void do_add_processing ();
virtual void after_line_breaking ();
void add_bar (Bar*);
protected:
- virtual Molecule do_brew_molecule () const;
+ Molecule do_brew_molecule () const;
VIRTUAL_COPY_CONS (Score_element);
virtual void do_add_processing ();
#include "lookup.hh"
#include "staff-symbol-referencer.hh"
-const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */
-const int SHARP_TOP_PITCH=4; /* ais and bis typeset in lower octave */
-
Key_item::Key_item (SCM s)
: Item (s)
{
}
+/*
+ FIXME: too much hardcoding here.
+ */
+const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */
+const int SHARP_TOP_PITCH=4; /* ais and bis typeset in lower octave */
+
/*
FIXME: key-item should just get a list of (position, acc), and leave
#include "audio-item.hh"
-
-
ADD_THIS_TRANSLATOR (Key_performer);
Key_performer::Key_performer ()
{
}
-void
-Key_performer::do_print () const
-{
-#ifndef NPRINT
- if (key_req_l_)
- key_req_l_->print ();
-#endif
-}
-
void
Key_performer::do_process_music ()
{
if (key_req_l_ && key_req_l_->key_)
{
- audio_p_ = new Audio_key (*key_req_l_->key_);
+ audio_p_ = new Audio_key (); // *key_req_l_->key_);
Audio_element_info info (audio_p_, key_req_l_);
announce_element (info);
key_req_l_ = 0;
#include "musical-request.hh"
#include "command-request.hh"
-#include "local-key-engraver.hh"
#include "local-key-item.hh"
-#include "key-engraver.hh"
#include "debug.hh"
#include "key-item.hh"
#include "tie.hh"
virtual void process_acknowledged ();
virtual void do_removal_processing ();
public:
-
- Newkey local_key_;
+
+ SCM last_accs_;
Key_engraver *key_grav_l_;
Array<Note_req* > mel_l_arr_;
Array<Item*> support_l_arr_;
Local_key_engraver();
bool self_grace_b_;
Grace_align_item * grace_align_l_;
- Timing_translator * time_trans_l_ ;
};
key_grav_l_ = 0;
key_item_p_ =0;
grace_align_l_ =0;
- time_trans_l_ = 0;
+ last_accs_ = SCM_EOL;
}
+
void
Local_key_engraver::do_creation_processing ()
{
- /*
- UGHGUHGUH.
-
- Breaks if Key_engraver is removed from under us.
- */
- Translator * result =
- daddy_grav_l()->get_simple_translator ("Key_engraver");
-
- key_grav_l_ = dynamic_cast<Key_engraver *> (result);
-
- if (!key_grav_l_)
- {
- warning (_ ("out of tune:"));
- warning (_f ("can't find: `%s'", "Key_engraver"));
- }
- else
- {
- local_key_ = key_grav_l_->key_;
- }
-
- /*
- TODO
- (if we are grace) get key info from parent Local_key_engraver
- */
-
- Translator * tr = daddy_grav_l()->get_simple_translator ("Timing_engraver"); // ugh
- time_trans_l_ = dynamic_cast<Timing_translator*> (tr);
+ last_accs_ = get_property ("keySignature");
}
void
Local_key_engraver::process_acknowledged ()
{
+ SCM localsig = get_property ("localKeySignature");
+
if (!key_item_p_ && mel_l_arr_.size())
{
SCM f = get_property ("forgetAccidentals");
Item * support_l = support_l_arr_[i];
Note_req * note_l = mel_l_arr_[i];
+ int n = note_l->pitch_.notename_i_;
+ int o = note_l->pitch_.octave_i_;
+ int a = note_l->pitch_.accidental_i_;
+
/* see if there's a tie that "changes" the accidental */
/* works because if there's a tie, the note to the left
is of the same pitch as the actual note */
- int prev_acc =local_key_.get (note_l->pitch_.octave_i_,
- note_l->pitch_.notename_i_);
- bool different = prev_acc != note_l->pitch_.accidental_i_;
+ SCM prev = scm_assoc (gh_cons (gh_int2scm (o), gh_int2scm (n)), localsig);
+ if (prev == SCM_BOOL_F)
+ prev = scm_assoc (gh_int2scm (n), localsig);
+ int prev_acc = (prev == SCM_BOOL_F) ? 0 : gh_scm2int (gh_cdr (prev));
+ bool different = prev_acc != a;
bool tie_changes = tied_l_arr_.find_l (support_l) && different;
if (!forget
- && (note_l->forceacc_b_
- || !different)
+ && (note_l->forceacc_b_ || different)
&& !tie_changes)
{
if (!key_item_p_)
}
- bool extra_natural
- = sign (prev_acc) * (prev_acc - note_l->pitch_.accidental_i_) == 1 ;
+ bool extra_natural =
+ sign (prev_acc) * (prev_acc - a) == 1
+ && abs(prev_acc) == 2;
key_item_p_->add_pitch (note_l->pitch_,
note_l->cautionary_b_,
if (!forget)
{
- local_key_.set (note_l->pitch_.octave_i_, note_l->pitch_.notename_i_,
- note_l->pitch_.accidental_i_);
+ localsig = scm_assoc_set_x (localsig, gh_cons (gh_int2scm (o),
+ gh_int2scm (n)),
+ gh_int2scm (a));
+
#if 0
+ /*
+ TESTME!
+ */
if (!tied_l_arr_.find_l (support_l))
{
local_key_.clear_internal_forceacc (note_l->pitch_);
void
Local_key_engraver::do_removal_processing ()
{
- // TODO: signal accidentals to Local_key_engraver the
+ // TODO: if grace ? signal accidentals to Local_key_engraver the
}
void
SCM smp = get_property ("measurePosition");
Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
+ SCM sig = get_property ("keySignature");
if (!mp)
{
- if (!to_boolean (get_property ("noResetKey")) && key_grav_l_)
- local_key_= key_grav_l_->key_;
+ if (!to_boolean (get_property ("noResetKey")))
+ daddy_trans_l_->set_property ("localKeySignature", sig);
}
- else if (key_grav_l_ && key_grav_l_->key_changed_b ())
+ else if (last_accs_ != sig)
{
- local_key_ = key_grav_l_->key_;
+ daddy_trans_l_->set_property ("localKeySignature", sig);
}
}
global_path.parse_path (env_sz);
- char *suffixes[] = {"ly", "afm", "scm", "tfm", "cmtfm", "ps", 0};
+ /*
+ Should use kpathsea, this is getting out of hand.
+ */
+ char *suffixes[] = {"ly", "afm", "scm", "tfm", "ps", 0};
+ String prefix = prefix_directory;
+ if (prefix.empty_b ()) prefix = DIR_DATADIR;
for (char **s = suffixes; *s; s++)
{
- if (!prefix_directory.empty_b())
- global_path.add (prefix_directory + to_str ('/') + String (*s));
- else
- global_path.add (String (DIR_DATADIR) + to_str ('/') + String(*s));
+ String p = prefix + to_str ('/') + String (*s);
+
+ global_path.add (p);
+ /* Urg: GNU make's $(word) index starts at 1 */
+ int i = 1;
+ while (global_path.try_add (p + to_str (".") + to_str (i)))
+ i++;
}
}
String
Midi_key::str () const
{
- int sharps_i = audio_l_->key_.sharps_i ();
- int flats_i = audio_l_->key_.flats_i ();
+ // fxime.
+ int sharps_i = 0; //audio_l_->key_.sharps_i ();
+ int flats_i = 0; //audio_l_->key_.flats_i ();
// midi cannot handle non-conventional keys
if (flats_i && sharps_i)
String str = "ff5902";
str += String_convert::i2hex_str (accidentals_i, 2, '0');
- str += String_convert::i2hex_str ((int)audio_l_->key_.minor_b (), 2, '0');
+
+ // (int)audio_l_->key_.minor_b ()
+ str += String_convert::i2hex_str (0, 2, '0');
return String_convert::hex2bin_str (str);
}
{"in", IN_T},
{"lyrics", LYRICS},
{"key", KEY},
- {"keysignature", KEYSIGNATURE},
{"mark", MARK},
{"musicalpitch", MUSICAL_PITCH},
{"time", TIME_T},
{"relative", RELATIVE},
{"remove", REMOVE},
{"repeat", REPEAT},
- {"repetitions", REPETITIONS},
{"addlyrics", ADDLYRICS},
{"score", SCORE},
{"script", SCRIPT},
--- /dev/null
+/*
+ newkey-def.cc -- implement Newkey_def
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "newkey-def.hh"
+#include "misc.hh"
+
+
+Newkey_def::Newkey_def()
+{
+ pitch_alist_ = SCM_EOL;
+}
+
+void
+Newkey_def::transpose (Musical_pitch p)
+{
+ SCM newlist = SCM_EOL;
+ for (SCM s = pitch_alist_; gh_pair_p (s); s = gh_cdr (s))
+ {
+ SCM k = gh_caar (s);
+
+ if (gh_pair_p (k))
+ {
+ Musical_pitch orig (gh_list (gh_car (k), gh_cdr (k), gh_cdr (s), SCM_UNDEFINED));
+
+ orig.transpose (p);
+
+ SCM key = gh_cons (gh_int2scm (orig.octave_i_),
+ gh_int2scm (orig.notename_i_));
+
+ newlist = gh_cons (gh_cons (key, gh_int2scm (orig.accidental_i_)),
+ newlist);
+ }
+ else if (gh_number_p (k))
+ {
+ Musical_pitch orig (gh_list (gh_int2scm (0), k, gh_cdar (s), SCM_UNDEFINED));
+ orig.transpose (p);
+
+ SCM key =gh_int2scm (orig.notename_i_);
+ newlist = gh_cons (gh_cons (key, gh_int2scm (orig.accidental_i_)),
+ newlist);
+ }
+ }
+
+ pitch_alist_ = newlist;
+}
%token IN_T
%token INVALID
%token KEY
-%token KEYSIGNATURE
%token LYRICS
%token MARK
%token MEASURES
%token RELATIVE
%token REMOVE
%token REPEAT
-%token REPETITIONS
%token ADDLYRICS
%token SCM_T
%token SCORE
%type <i> tremolo_type
%type <i> int unsigned
%type <i> script_dir
-%type <i> optional_modality
+
%type <id> identifier_init
%type <duration> steno_duration optional_notemode_duration
%type <duration> entered_notemode_duration explicit_duration
%type <pitch> steno_musical_pitch musical_pitch absolute_musical_pitch
%type <pitch> steno_tonic_pitch
-%type <pitch_arr> pitch_list chord_additions chord_subtractions chord_notes chord_step
+%type <pitch_arr> chord_additions chord_subtractions chord_notes chord_step
%type <music> chord
%type <pitch> chord_note chord_inversion chord_bass
%type <midi> midi_block midi_body
key_p->key_ = 0;
$$ = key_p;
}
-/* UGH. optional. */
-
- | KEY NOTENAME_PITCH optional_modality {
- Key_change_req *key_p= new Key_change_req;
- Key_def d;
- d.pitch_arr_.push (*$2);
- d.ordinary_key_b_ = true;
- d.modality_i_ = $3;
-
- key_p->key_ = new Key_def (d);
- $$ = key_p;
- delete $2;
- }
- | KEYSIGNATURE pitch_list {
+/*
+TODO: Support for minor/major keys; make `major-scale' settable.
+*/
+ | KEY NOTENAME_PITCH {
Key_change_req *key_p= new Key_change_req;
- Key_def d;
- d.pitch_arr_ = *$2;
- d.ordinary_key_b_ = false;
-
- key_p->key_ = new Key_def(d);
- $$ = key_p;
- delete $2;
+ key_p->key_ = new Newkey_def;
+
+ key_p->key_->pitch_alist_ = scm_eval (ly_symbol2scm ("major-scale"));
+ key_p->key_->transpose (* $2);
+ $$ = key_p;
}
;
}
;
-optional_modality:
- /* empty */ {
- $$ = 0;
- }
- | int {
- $$ = $1;
- }
- ;
-
sup_quotes:
'\'' {
$$ = 1;
/*
UTILITIES
*/
+
+/*
+ FIXME: use scm.
+*/
+/*
pitch_list: {
$$ = new Array<Musical_pitch>;
}
delete $2;
}
;
-
+*/
int_list:
/**/ {
s = get_property ("start" + String (p->name_ ));
}
- if (s != SCM_UNDEFINED)
+ if (gh_string_p (s))
{
if (p->name_ == String ("Sustain"))
{
- p->item_p_ = new Sustain_pedal (SCM_EOL);
- p->item_p_->set_elt_property ("text", s);
+ // fixme: Item should be sufficient.
+ p->item_p_ = new Text_item (get_property ("basicSustainPedalProperties"));
}
else
{
- p->item_p_ = new Text_item (SCM_EOL);
+ p->item_p_ = new Text_item (get_property ("basicPedalProperties"));
+ }
p->item_p_->set_elt_property ("text", s);
// guh
- p->item_p_->set_elt_property ("style", ly_str02scm ("italic"));
- }
Side_position_interface si (p->item_p_);
si.set_axis (Y_AXIS);
// todo: init with basic props.
- p->item_p_->set_elt_property ("no-spacing-rods" , SCM_BOOL_T);
- p->item_p_->set_elt_property ("self-alignment-X", gh_int2scm (0));
p->item_p_->add_offset_callback (Side_position_interface::aligned_on_self, X_AXIS);
p->item_p_->add_offset_callback (Side_position_interface::centered_on_parent, X_AXIS);
announce_element (Score_element_info (p->item_p_,
void
Sustain_pedal::after_line_breaking ()
{
+ return ;
/*
UGH. Should work automatically via offset callback.
*/
i.set_direction (d);
}
-Molecule
-Sustain_pedal::do_brew_molecule () const
+MAKE_SCHEME_SCORE_ELEMENT_NON_DEFAULT_CALLBACKS(Sustain_pedal);
+
+
+SCM
+Sustain_pedal::scheme_molecule (SCM smob)
{
+ Score_element * e = unsmob_element (smob);
+
Molecule mol;
- SCM glyph = get_elt_property ("text");
- if (glyph == SCM_UNDEFINED)
- return mol;
+ SCM glyph = e->get_elt_property ("text");
+ if (!gh_string_p (glyph))
+ return mol.create_scheme();
String text = ly_scm2string (glyph);
for (int i = 0; i < text.length_i (); i++)
{
- String idx = String ("pedal-") + String (&text.byte_C ()[i], 1);
- Molecule m = lookup_l ()->afm_find (idx);
- if (m.empty_b ())
- continue;
- Real kern = 0;
- if (i)
+ String idx ("pedal-");
+ if (text.cut_str (i, 3) == "Ped")
{
- SCM s = scm_eval (gh_list (ly_symbol2scm ("pedal-kerning"),
- ly_str02scm (String (&text.byte_C ()[i - 1], 1).ch_C ()),
- ly_str02scm (String (&text.byte_C ()[i], 1).ch_C ()),
- SCM_UNDEFINED));
- if (gh_number_p (s))
- {
- Staff_symbol_referencer_interface st (this);
- Real staff_space = st.staff_space ();
- kern = gh_scm2double (s) * staff_space;
- }
+ idx += "Ped";
+ i += 2;
}
- mol.add_at_edge (X_AXIS, RIGHT, m, kern);
+ else
+ idx += String (&text.byte_C ()[i], 1);
+ Molecule m = e->lookup_l ()->afm_find (idx);
+ if (!m.empty_b ())
+ mol.add_at_edge (X_AXIS, RIGHT, m, 0);
}
- return mol;
+ return mol.create_scheme ();
}
-
-
Sustain_pedal ::Sustain_pedal(SCM s )
: Item (s)
-{}
+{
+}
int idx = int (((maxht - step) <? y - minht) / step);
idx = idx >? 0;
- SCM l = scm_eval (gh_list (ly_symbol2scm ("style-to-cmr"),
- ly_str02scm ("brace"),
- SCM_UNDEFINED));
+ SCM l = scm_assoc (ly_str02scm ("brace"),
+ scm_eval (ly_symbol2scm ("cmr-alist")));
String nm = "feta-braces";
if (l != SCM_BOOL_F)
stopStartSustain = #"*Ped."
startUnaChorda = #"una chorda"
stopUnaChorda = #"tre chorde"
+
\consists "Piano_pedal_engraver";
\consists "Script_engraver";
\consists "Script_column_engraver";
defaultBarType = #"|"
systemStartDelimiterGlyph = #'bar-line
+ %
+ % what order to print accs. We could compute this,
+ % but computing is more work than putting it here.
+ %
+ % Flats come first, then sharps.
+ keyAccidentalOrder = #'(
+ (6 . -1) (2 . -1) (5 . -1 ) (1 . -1) (4 . -1) (0 . -1) (3 . -1)
+ (3 . 1) (0 . 1) (4 . 1) (1 . 1) (5 . 1) (2 . 1) (6 . 1)
+ )
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% default settings, mainly for breakable items
% in alphabetical order
+ % TODO: uniform naming.;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
basicBarlineProperties = #`(
(break-align-symbol . Staff_bar)
(molecule-callback . ,Text_item::scheme_molecule)
(style . "italic")
)
+ basicPedalProperties = #`(
+ (molecule-callback . ,Text_item::scheme_molecule)
+ (style . "italic")
+ (no-spacing-rods . #t)
+ (self-alignment-X . 0)
+
+ )
basicTextProperties = #`( )
basicRestProperties = #`(
(molecule-callback . ,Rest::scheme_molecule)
basicSlurProperties = #`(
(molecule-callback . ,Slur::scheme_molecule)
)
-
+ basicSustainPedalProperties = #`(
+ (no-spacing-rods . #t)
+ (molecule-callback . ,Sustain_pedal::scheme_molecule)
+ (self-alignment-X . 0)
+ )
basicSystemStartDelimiterProperties = #`(
(molecule-callback . ,System_start_delimiter::scheme_molecule)
(collapse-height . 1.0)
tar --exclude='*.dvi' --exclude='*.tex' --exclude='*.ps' --exclude='*.ppm' -czf $(outdir)/examples.tar.gz *-examples.html `find input mutopia -type d -name 'out-www' -print`
+
+my_tfm_path=$(TFM_PATH) /tmp /tmp /tmp /tmp /tmp /tmp
localinstall:
mkdir -p $(datadir)
- rm -f $(datadir)/cmtfm
- $(LN_S) $(TEX_TFMDIR) $(datadir)/cmtfm
+ $(foreach i, 1 2 3 4 5, rm -f $(datadir)/tfm.$(i); $(LN_S) $(word $(i), $(my_tfm_path)) $(datadir)/tfm.$(i) ; )
local-WWW-clean:
$(SHELL) $(depth)/buildscripts/clean-fonts.sh
)
)
-;; (define (ly-warn s) (error s))
-(define (break-align-spacer this next)
- (let ((entry (assoc (list this next) space-alist)))
- (if entry
- (cdr entry)
- (begin (ly-warn (string-append "Unknown spacing pair `" this "', `" next "'"))
- '(minimum-space 0.0)))))
-
-
(define (find-notehead-symbol duration style)
(case style
((cross) "2cross")
)
(define script-alist '())
-(define (articulation-to-scriptdef a)
- (assoc a script-alist)
- )
-
-;; Map style names to TeX font names. Return false if
-;; no font name found.
-(define (style-to-cmr s)
- (assoc s cmr-alist )
- )
-
-
(define font-name-alist '())
(define (font-command name-mag)
)
)
+
+(define major-scale
+ '(
+ (0 . 0)
+ (1 . 0)
+ (2 . 0)
+ (3 . 0)
+ (4 . 0)
+ (5 . 0)
+ (6 . 0)
+ )
+ )
])
AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
- AC_ARG_ENABLE(tex-tfmdir,
- [ enable-tex-tfmdir=DIR set the tex-directory where cmr10.tfm lives (default: use kpsewhich)],
- [TFMDIR=$enableval],
- [TFMDIR=auto] )
+ AC_ARG_ENABLE(tfm-path,
+ [ enable-tfm-path=PATH set path of tex directories where tfm files live, esp.: cmr10.tfm (default: use kpsewhich)],
+ [tfm_path=$enableval],
+ [tfm_path=auto] )
AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
- AC_MSG_CHECKING(for TeX TFM directory)
- if test "x$TFMDIR" = xauto ; then
- if test "x$TEX_TFMDIR" = "x" ; then
- if test "x$KPSEWHICH" != "xno" ; then
- CMR10=`kpsewhich tfm cmr10.tfm`
- TEX_TFMDIR=`dirname $CMR10`
- else
- AC_STEPMAKE_WARN(Please set TEX_TFMDIR (to where cmr10.tfm lives):
- TEX_TFMDIR=/usr/local/TeX/lib/tex/fonts ./configure)
- fi
+ AC_MSG_CHECKING(for tfm path)
+
+ TFM_FONTS="cmr msam"
+
+ if test "x$tfm_path" = xauto ; then
+ if test "x$KPSEWHICH" != "xno" ; then
+ for i in $TFM_FONTS; do
+ dir=`$KPSEWHICH tfm ${i}10.tfm`
+ TFM_PATH="$TFM_PATH `dirname $dir`"
+ done
+ else
+ AC_STEPMAKE_WARN(Please specify where cmr10.tfm lives:
+ ./configure --enable-tfm-path=/usr/local/TeX/lib/tex/fonts)
fi
+ else
+ TFM_PATH=$tfm_path
fi
- AC_MSG_RESULT($TEX_TFMDIR)
- AC_SUBST(TEX_TFMDIR)
+
+ TFM_PATH=`echo $TFM_PATH | tr ':' ' '`
+ AC_MSG_RESULT($TFM_PATH)
+ AC_SUBST(TFM_PATH)
])
AC_DEFUN(AC_STEPMAKE_TEXMF, [