+1.5.16.hjj2
+===========
+
+* Emacs-mode: Inserting tags
+
+* Enable python2.1/Python.h
+
+1.5.16.hwn1
+===========
+
+* Add unfold-repeats function (Rune Zedeler!) to standard init SCM file.
+
+* Bugfix: spacing is no longer confused by coupled clefs, where one of the
+clefs is loose, and the other not.
+
+* Robustness fix for Slur. Don't crash if attachment not set.
+
+* Arpeggios can now have arrows on the top or bottom to determine
+their direction. (MF code by Chris Jackson)
+
+* Symbol cache bugfix in system-start-delimiter.cc -- may switch
+symbol cache off for gcc 2.96?
+
+* MikTeX PDF detection bugfix (Mats Bengtsson)
+
+* Some more random hacking at midi2ly.py. (jcn1)
+
+* Inline unsmob_XXX functions. Speedup of 6% on wtk1-fugue2.
+
1.5.15.jcn1
===========
Rational (int, int);
Rational (double);
Rational (Rational const&r) { copy (r);}
+ Rational &operator = (Rational const &r) {
+ copy (r); return *this;
+ }
- Rational &operator = (Rational const &);
Rational &operator *= (Rational);
Rational &operator /= (Rational);
Rational &operator += (Rational);
return (*this += r);
}
-/*
- be paranoid about overiding libg++ stuff
- */
-Rational &
-Rational::operator = (Rational const &r)
-{
- copy (r);
- return *this;
-}
-
String
Rational::str () const
{
--- /dev/null
+
+
+
+\version "1.4.8"
+\score { \notes
+ \context PianoStaff <
+ \context Staff = up { \clef G
+ c'2 ~ \translator Staff=down c'
+ }
+ \context Staff = down { \clef F
+ s1
+ }
+ >
+ \paper { }
+}
+
+
+
--- /dev/null
+\header {
+
+texidoc="
+gives
+
+@example
+ | |
+ | |
+ +-- | --+
+ +----+----+
+ |
+ |
+
+instead of the desired
+
+ | |
+ | |
+ | --+
+ +----+----+
+ +--
+ |
+ |
+
+@end example
+"
+
+}
+
+\score {
+ \notes\relative c' {
+ c16 c''8 c16
+
+ % it's very helpful to have this one too,
+ % because a fix is likely to break
+
+ c,, c'' c,, cc
+ }
+ \paper { linewidth = -1 }
+}
+
\ No newline at end of file
--- /dev/null
+\version "1.5.1"
+
+\header {
+ dedication = "dedication"
+ title = "Title"
+ subtitle = "Subtitle"
+ subsubtitle = "Subsubtitle"
+ composer = "Composer (xxxx-yyyy)"
+ opus = "Opus 0"
+ piece = "Piece I"
+ instrument = "Instrument"
+ arranger = "Arranger"
+ poet = "Poet"
+ texttranslator = "Translator"
+ copyright = "public domain"
+ enteredby = "jcn"
+ source = "urtext"
+}
+
+upper = \notes\relative c'' {
+ a b c d
+}
+
+lower = \notes\relative c {
+ a2 c
+}
+
+dynamics = \notes {
+ \outputproperty #(make-type-checker 'dynamic-interface)
+ #'extra-offset = #'(0 . 2.5)
+ s2\fff\> s4
+ \outputproperty #(make-type-checker 'dynamic-interface)
+ #'extra-offset = #'(0 . 2.5)
+ \!s\pp
+}
+
+pedal = \notes {
+ s2\sustainDown s2\sustainUp
+}
+
+\score {
+ \context PianoStaff <
+ \context Staff=upper \upper
+ \context Dynamics=dynamics \dynamics
+ \context Staff=lower <
+ \clef bass
+ \lower
+ >
+ \context Dynamics=pedal \pedal
+ >
+ \paper {
+ \translator {
+ \type "Engraver_group_engraver"
+ \name Dynamics
+ \consists "Output_property_engraver"
+ Generic_property_list = #generic-voice-properties
+ \consists "Property_engraver"
+ MinimumVerticalExtent = #'(-1 . 1)
+
+ pedalSustainStrings = #'("Ped." "*Ped." "*")
+ pedalUnaCordaStrings = #'("una corda" "" "tre corde")
+
+ \consists "Piano_pedal_engraver"
+ \consists "Script_engraver"
+ \consists "Dynamic_engraver"
+ \consists "Text_engraver"
+
+ TextScript \override #'font-relative-size = #1
+ TextScript \override #'font-shape = #'italic
+
+ \consists "Skip_req_swallow_translator"
+
+ \consistsend "Axis_group_engraver"
+ }
+ \translator {
+ \PianoStaffContext
+ \accepts Dynamics
+ VerticalAlignment \override #'forced-distance = #7
+ }
+ }
+ \midi {
+ \translator {
+ \type "Performer_group_performer"
+ \name Dynamics
+ Generic_property_list = #generic-voice-properties
+
+ \consists "Piano_pedal_performer"
+ \consists "Span_dynamic_performer"
+ \consists "Dynamic_performer"
+ }
+ \translator {
+ \PianoStaffContext
+ \accepts Dynamics
+ }
+ }
+}
IMPLEMENT_TYPE_P (Duration, "duration?");
-IMPLEMENT_UNSMOB (Duration, duration);
SCM
Duration::mark_smob (SCM)
}
-IMPLEMENT_UNSMOB (Font_metric, metrics);
+
IMPLEMENT_SMOBS (Font_metric);
IMPLEMENT_DEFAULT_EQUAL_P (Font_metric);
IMPLEMENT_TYPE_P (Font_metric, "font-metric?");
/*
Remove the value associated with KEY, and return it. The result is
- that a next call will yield SCM_UNDEFINED (and not the underlying
+ that a next call will yield SCM_EOL (and not the underlying
`basic' property.
*/
SCM
****************************************************/
-IMPLEMENT_UNSMOB (Grob, grob);
+
IMPLEMENT_SMOBS (Grob);
IMPLEMENT_DEFAULT_EQUAL_P (Grob);
#include "compare.hh"
INSTANTIATE_COMPARE (Duration, Duration::compare);
-Duration*unsmob_duration (SCM);
+DECLARE_UNSMOB(Duration,duration);
// int compare (Array<Duration>*, Array<Duration>*);
#endif // DURATION_HH
Font_metric ();
};
-Font_metric * unsmob_metrics (SCM s);
+DECLARE_UNSMOB(Font_metric, metrics);
#endif /* FONT_METRIC_HH */
DECLARE_SCHEME_CALLBACK (fixup_refpoint, (SCM));
};
-Grob * unsmob_grob (SCM);
+DECLARE_UNSMOB(Grob,grob);
#endif // STAFFELEM_HH
#include "input.hh"
#include "lily-guile.hh"
+#include "smobs.hh"
SCM make_input (Input spot);
-Input *unsmob_input (SCM);
+Input *unsmob_input(SCM);
extern Input dummy_input_global;
#include "smobs.hh"
-#define IMPLEMENT_UNSMOB(CL, name) \
-CL * \
-unsmob_ ## name ( SCM s) \
-{ \
-return CL::unsmob (s); \
-}
-
#define IMPLEMENT_TYPE_P(CL, FUNCNAME)\
void init_type_p_ ## CL ()\
{\
\
return s; \
} \
-CL * \
-CL::unsmob (SCM s) \
-{ \
- if (SCM_NIMP (s) && SCM_CELL_TYPE (s) == smob_tag_) \
- return (CL*) SCM_CELL_WORD_1 (s); \
- else \
- return 0; \
-} \
size_t \
CL::free_smob (SCM ses) \
{ \
DECLARE_SIMPLE_SMOBS (Syllable_group,);
} ;
-Syllable_group * unsmob_voice_entry (SCM);
+DECLARE_UNSMOB(Syllable_group,voice_entry);
#endif // LYRIC_PHRASING_ENGRAVER_HH
};
-Molecule *unsmob_molecule (SCM);
+DECLARE_UNSMOB(Molecule,molecule);
SCM fontify_atom (Font_metric*, SCM atom);
Molecule create_molecule (SCM brew_molecule);
ostream & operator << ( ostream &,Moment const &);
-Moment * unsmob_moment (SCM);
+DECLARE_UNSMOB(Moment,moment);
int compare (Moment const&,Moment const&);
INSTANTIATE_COMPARE (Moment const&, Moment::compare);
DECLARE_SMOBS (Music_output_def,);
};
-Music_output_def* unsmob_music_output_def (SCM);
+DECLARE_UNSMOB(Music_output_def,music_output_def);
#endif // Music_output_DEF_HH
};
-Music * unsmob_music (SCM);
+DECLARE_UNSMOB(Music,music);
#endif // MUSIC_HH
};
-Pitch* unsmob_pitch (SCM);
+DECLARE_UNSMOB(Pitch,pitch);
#include "compare.hh"
INSTANTIATE_COMPARE (Pitch, Pitch::compare);
private:
void run_translator (Music_output_def*);
};
-Score * unsmob_score (SCM);
+DECLARE_UNSMOB(Score,score);
#endif
static int print_smob (SCM s, SCM p, scm_print_state*); \
public: \
static SCM equal_p (SCM a, SCM b);\
- static CL * unsmob (SCM);\
+ static CL * unsmob (SCM s){\
+ if (SCM_NIMP (s) && SCM_CELL_TYPE (s) == smob_tag_) \
+ return (CL*) SCM_CELL_WORD_1 (s); \
+ else \
+ return 0; \
+} \
static SCM smob_p (SCM);\
static void init_smobs (); \
private:
SCM self_scm () const { return self_scm_; } \
private:
+#define DECLARE_UNSMOB(CL,name) \
+inline CL * \
+unsmob_ ## name (SCM s) \
+{ \
+return CL::unsmob (s); \
+}
+
+
#endif /* SMOBS_HH */
};
-Translator_def* unsmob_translator_def (SCM);
+DECLARE_UNSMOB(Translator_def,translator_def);
#endif /* TRANSLATOR_DEF_HH */
void add_translator (Translator*trans_p);
Translator*get_translator_l (String s);
-Translator *unsmob_translator (SCM);
+DECLARE_UNSMOB(Translator,translator);
#endif // TRANSLATOR_HH
IMPLEMENT_TYPE_P (Molecule, "molecule?");
IMPLEMENT_DEFAULT_EQUAL_P (Molecule);
-IMPLEMENT_UNSMOB (Molecule, molecule);
+
#include "warn.hh"
#include "ly-smobs.icc"
-IMPLEMENT_UNSMOB (Moment,moment);
+
IMPLEMENT_SIMPLE_SMOBS (Moment);
IMPLEMENT_TYPE_P (Moment, "moment?");
IMPLEMENT_SMOBS (Music_output_def);
-IMPLEMENT_UNSMOB (Music_output_def,music_output_def);
+
IMPLEMENT_DEFAULT_EQUAL_P (Music_output_def);
SCM
}
IMPLEMENT_TYPE_P (Music, "music?");
-IMPLEMENT_UNSMOB (Music,music);
+
IMPLEMENT_SMOBS (Music);
IMPLEMENT_DEFAULT_EQUAL_P (Music);
IMPLEMENT_TYPE_P (Pitch, "pitch?");
-IMPLEMENT_UNSMOB (Pitch, pitch);
+
SCM
Pitch::mark_smob (SCM)
{
-IMPLEMENT_UNSMOB (Scheme_hash_table,scheme_hash);
+
IMPLEMENT_SMOBS (Scheme_hash_table);
IMPLEMENT_DEFAULT_EQUAL_P (Scheme_hash_table);
IMPLEMENT_SMOBS (Score);
IMPLEMENT_DEFAULT_EQUAL_P (Score);
-IMPLEMENT_UNSMOB (Score, score);
+
SCM
Score::mark_smob (SCM s)
return 1;
}
-IMPLEMENT_UNSMOB (Syllable_group, voice_entry);
+
IMPLEMENT_SIMPLE_SMOBS (Syllable_group);
IMPLEMENT_DEFAULT_EQUAL_P (Syllable_group);
return best_result;
}
-IMPLEMENT_UNSMOB (Translator_def,translator_def);
+
IMPLEMENT_SMOBS (Translator_def);
IMPLEMENT_DEFAULT_EQUAL_P (Translator_def);
return SCM_EOL;
}
-IMPLEMENT_UNSMOB (Translator, translator);
+
IMPLEMENT_SMOBS (Translator);
IMPLEMENT_DEFAULT_EQUAL_P (Translator);
LINE_BELL = 60
scale_steps = [0,2,4,5,7,9,11]
+whole_clocks = 1536
+quart_clocks = 0
+
def split_track (track):
chs = {}
for i in range(16):
class Note:
- def __init__ (self, duration, pitch, velocity):
+ def __init__ (self, clocks, pitch, velocity):
self.velocity = velocity
self.pitch = pitch
- self.duration = duration
+ self.clocks = clocks
- def duration_compare (a, b):
- if a.duration < b.duration:
+ def clocks_compare (a, b):
+ if a.clocks < b.clocks:
return -1
- elif a.duration > b.duration:
+ elif a.clocks > b.clocks:
return 1
else:
return 0
class Time:
def __init__ (self, t, num, den):
- self.duration = t
+ self.skip = t
self.num = num
self.den = den
+ self.clocks = 0
def dump (self):
- return dump_skip (self.duration) + '\\time %d/%d ' % (self.num, self.den)
+ s = ''
+ if self.skip:
+ s = dump_skip (self.skip)
+ s = s + '\n '
+ return s + '\\time %d/%d ' % (self.num, self.den) + '\n '
class Key:
key_sharps = ('c', 'g', 'd', 'a', 'e', 'b', 'fis')
key_flats = ('BUG', 'f', 'bes', 'es', 'as', 'des', 'ges')
def __init__ (self, t, sharps, flats, minor):
- self.duration = t
+ self.skip = t
self.flats = flats
self.sharps = sharps
self.minor = minor
+ self.clocks = 0
def dump (self):
+ s = ''
+ if self.skip:
+ s = dump_skip (self.skip)
+ s = s + '\n '
if self.sharps and self.flats:
s = '\\keysignature %s ' % 'TODO'
elif self.sharps:
- s = '\\notes\\key %s \major' % key_sharps[self.sharps]
+ s = '\\notes\\key %s \major' % self.key_sharps[self.sharps]
elif self.flats:
- s = '\\notes\\key %s \major' % key_flats[self.flats]
- return dump_skip (self.duration) + s
+ s = '\\notes\\key %s \major' % self.key_flats[self.flats]
+ return s + '\n '
class Text:
- def __init__ (self, text):
+ def __init__ (self, t, text):
+ self.skip = t
self.text = text
- self.duration = 0
-
+ self.clocks = 0
+
def dump (self):
- return dump_text (self)
+ s = ''
+ if self.skip:
+ s = dump_skip (self.skip)
+ return s + dump_text (self)
def notes_on_channel (channel):
pitches = {}
(lt, vel) = pitches[e[1][1]]
del pitches[e[1][1]]
- nch.append ((t, Note (t-lt, e[1][1], vel)))
+ nch.append ((lt, Note (t-lt, e[1][1], vel)))
except KeyError:
pass
flats = 256 - accidentals
nch.append ((t, Key (t, sharps, flats, minor)))
elif e[1][1] == midi.TEXT_EVENT:
- nch.append ((t, Text (e[1][2])))
+ nch.append ((t, Text (t, e[1][2])))
else:
sys.stderr.write ("SKIP: %s\n" % `e`)
pass
todo = []
for e in channel:
t = e[0]
- if e[1].__class__ == Note and ((t == start_busy_t and e[1].duration + t == end_busy_t) \
+ if e[1].__class__ == Note and ((t == start_busy_t and e[1].clocks + t == end_busy_t) \
or t >= end_busy_t):
thread.append (e)
start_busy_t = t
- end_busy_t = t + e[1].duration
+ end_busy_t = t + e[1].clocks
elif e[1].__class__ == Time or e[1].__class__ == Key or e[1].__class__ == Text:
thread.append (e)
else:
b = c
return a
-def dump_skip (dt):
- return 's' + dump_duration (dt)
-
-def dump_duration (dur):
- g = gcd (dur, 384)
- s = '4'
- (p,q) = (dur / g, 384 / g)
- if (p == 1 and q == 1) :
- pass
+def dump_skip (clocks):
+ return 's' + dump_duration (clocks) + ' '
+
+def dump_duration (clocks):
+ g = gcd (clocks, whole_clocks)
+ (d, n) = (whole_clocks/ g, clocks / g)
+ if n == 1:
+ s = '%d' % d
+ elif n == 3 and d != 1:
+ s = '%d.' % (d / 2)
else:
- if p <> 1:
- s = s + '*%d'% p
- if q <> 1:
- s = s + '*%d'% q
+ s = '%d*%d' % (d, n)
return s
def dump_note (note):
if scale_steps[i] <> step:
str = str + 'is'
- return ' %s' % str + dump_duration (note.duration)
+ return str + dump_duration (note.clocks) + ' '
def dump (self):
return self.dump ()
lines[-1] = lines[-1] + dump_chord (ch[1])
- last_t = t + ch[1][0].duration
+ last_t = t + ch[1][0].clocks
return string.join (lines, '\n ') + '\n'
def convert_midi (f):
+ global whole_clocks, quart_clocks
+
str = open (f).read ()
midi_dump = midi.parse (str)
+ whole_clocks = midi_dump[0][1]
+ quart_clocks = whole_clocks / 4
tracks = []
for t in midi_dump[1]: