2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
28 #define is_mus_type(x) internal_is_music_type (ly_symbol2scm (x))
30 class Music : public Prob
34 Music (Music const &m);
35 VIRTUAL_COPY_CONSTRUCTOR (Music, Music);
37 Input *origin () const;
38 void set_spot (Input);
40 bool internal_is_music_type (SCM) const;
42 Stream_event *to_event () const;
44 DECLARE_SCHEME_CALLBACK (relative_callback, (SCM, SCM));
45 Pitch to_relative_octave (Pitch);
46 Pitch generic_to_relative_octave (Pitch);
47 Moment get_length () const;
48 Moment start_mom () const;
50 static Music *unsmob (SCM m) {
51 return dynamic_cast <Music *> (Prob::unsmob (m));
53 static bool is_smob (SCM m) {
54 return Prob::is_smob (m) && unsmob (m);
57 /// Transpose, with the interval central C to #p#
58 void transpose (Pitch p);
60 /// Scale the music in time by #factor#.
61 void compress (Moment factor);
63 // Broadcast the event in a context's event-source.
64 void send_to_context (Context *c);
66 DECLARE_SCHEME_CALLBACK (duration_length_callback, (SCM));
69 virtual SCM copy_mutable_properties () const;
70 virtual void type_check_assignment (SCM, SCM) const;
71 virtual void derived_mark () const;
75 friend SCM ly_extended_make_music (SCM, SCM);
78 Music *make_music_by_name (SCM sym);
79 SCM ly_music_deep_copy (SCM);
80 SCM ly_camel_case_2_lisp_identifier (SCM name_sym);
82 extern SCM ly_music_p_proc;
84 /* common transposition function for music and event */
85 void transpose_mutable (SCM alist, Pitch delta);