2 repeated-music.hh -- declare Repeated_music
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #ifndef RepEATED_MUSIC_HH
11 #define RepEATED_MUSIC_HH
19 A repeat, when played has the form of BODY A BODY B BODY C.
21 In this examples, the list {A B C} is put in ALTERNATIVES_P_. BODY
22 is put in REPEAT_BODY_P_. Either the body or the alternative may
25 There are three modes of representing this music:
31 is called "folded". Mostly used for lyrics.
36 is called "semi" folded. This is common notation
40 is called unfolded. Useful for MIDI.
43 If the number of repeats is smaller than the number of alternatives, then
44 the excess alternatives are ignored for all timing purposes.
46 If the number of repeats is bigger than the number of alternatives, then
47 the first alternative is assumed to be repeated.
50 class Repeated_music : public Music
56 /// if FOLD_B_ is false, semifold this.
59 /// how often do we repeat?
62 Music * repeat_body_p_;
63 Music_sequence * alternatives_p_;
65 virtual Musical_pitch to_relative_octave (Musical_pitch);
67 /// The duration of this piece of music
68 virtual Moment length_mom () const;
69 Moment body_length_mom () const;
70 Moment alternatives_length_mom () const;
73 /// Transpose, with the interval central C to #p#
74 virtual void transpose (Musical_pitch p);
76 /// Scale the music in time by #factor#.
77 virtual void compress (Moment factor);
78 VIRTUAL_COPY_CONS(Music);
80 Repeated_music (Music*, int , Music_sequence*);
81 Repeated_music (Repeated_music const&);
84 virtual void do_print() const;
88 #endif /* RepEATED_MUSIC_HH */