2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1997--2012 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/>.
29 #define is_mus_type(x) internal_is_music_type (ly_symbol2scm (x))
31 class Music : public Prob
35 Music (Music const &m);
36 VIRTUAL_COPY_CONSTRUCTOR (Music, Music);
38 Input *origin () const;
39 void set_spot (Input);
41 bool internal_is_music_type (SCM) const;
43 Stream_event *to_event (Context *) const;
45 DECLARE_SCHEME_CALLBACK (relative_callback, (SCM, SCM));
46 Pitch to_relative_octave (Pitch);
47 Pitch generic_to_relative_octave (Pitch);
48 Moment get_length () const;
49 Moment start_mom () const;
52 /// Transpose, with the interval central C to #p#
53 void transpose (Pitch p);
55 /// Scale the music in time by #factor#.
56 void compress (Moment factor);
58 // Broadcast the event in a context's event-source.
59 void send_to_context (Context *c);
61 DECLARE_SCHEME_CALLBACK (duration_length_callback, (SCM));
64 virtual SCM copy_mutable_properties () const;
65 virtual void type_check_assignment (SCM, SCM) const;
66 virtual void derived_mark () const;
70 friend SCM ly_extended_make_music (SCM, SCM);
73 Music *unsmob_music (SCM);
74 Music *make_music_by_name (SCM sym);
75 SCM ly_music_deep_copy (SCM);
76 SCM ly_camel_case_2_lisp_identifier (SCM name_sym);
78 extern SCM ly_music_p_proc;
80 /* common transposition function for music and event */
81 void transpose_mutable (SCM alist, Pitch delta);