audio_column_ = 0;
}
-Audio_note::Audio_note (Pitch p, Moment m, bool tie_event, int transposing)
+Audio_note::Audio_note (Pitch p, Moment m, bool tie_event, Pitch transposing)
{
pitch_ = p;
length_mom_ = m;
}
Audio_note *p = new Audio_note (*pit, get_event_length (n),
- tie_event, 0);
+ tie_event, Pitch (0, 0, 0));
Audio_element_info info (p, n);
announce_element (info);
notes_.push_back (p);
class Audio_note : public Audio_item
{
public:
- Audio_note (Pitch p, Moment m, bool tie_event, int transposing);
+ Audio_note (Pitch p, Moment m, bool tie_event, Pitch transposition);
void tie_to (Audio_note *);
Pitch pitch_;
Moment length_mom_;
- int transposing_;
+ Pitch transposing_;
+
Audio_note *tied_;
bool tie_event_;
};
Rational tone_pitch () const;
int rounded_semitone_pitch () const;
int rounded_quartertone_pitch () const;
-
+ Pitch negated () const;
string to_string () const;
DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
DECLARE_UNSMOB (Score, score);
-void default_rendering (SCM, SCM, SCM, SCM, SCM, SCM);
SCM ly_render_output (SCM, SCM);
SCM ly_run_translator (SCM, SCM, SCM);
Pitch key_do (0,
scm_to_int (scm_caar (pitchlist)),
- scm_to_int (scm_cdar (pitchlist)));
+ ly_scm2rational (scm_cdar (pitchlist)));
Pitch c_do (0, 0, 0);
c0p = scm_to_int (c0s);
bool is_cancellation = me->internal_has_interface
- (ly_symbol2scm ("key-cancelation-interface"));
+ (ly_symbol2scm ("key-cancellation-interface"));
/*
SCM lists are stacks, so we work from right to left, ending with
int
Midi_note::get_fine_tuning () const
{
- Rational tune = audio_->pitch_.tone_pitch () * Rational (2);
+ Rational tune = (audio_->pitch_.tone_pitch ()
+ + audio_->transposing_.tone_pitch ()) * Rational (2);
tune -= Rational (get_semitone_pitch ());
tune *= 100;
int
Midi_note::get_semitone_pitch () const
{
- return int (rint (double (audio_->pitch_.tone_pitch () * Rational (2, 1))))
- + audio_->transposing_;
+ return int (double ((audio_->pitch_.tone_pitch ()
+ + audio_->transposing_.tone_pitch ()) * Rational (2)));
}
string
{
if (note_evs_.size ())
{
- int transposing = 0;
-
+ Pitch transposing;
SCM prop = get_property ("instrumentTransposition");
if (unsmob_pitch (prop))
- transposing = unsmob_pitch (prop)->rounded_semitone_pitch ();
+ transposing = *unsmob_pitch (prop);
while (note_evs_.size ())
{
}
Audio_note *p = new Audio_note (*pitp, get_event_length (n),
- tie_event, - transposing);
+ tie_event, transposing);
Audio_element_info info (p, n);
announce_element (info);
notes_.push_back (p);
return p.smobbed_copy ();
}
+LY_DEFINE (ly_pitch_negate, "ly:pitch-negate", 1, 0, 0,
+ (SCM p),
+ "Negate @var{p}.")
+{
+ Pitch *pp = unsmob_pitch (p);
+ SCM_ASSERT_TYPE (pp, p, SCM_ARG1, __FUNCTION__, "Pitch");
+ return pp->negated ().smobbed_copy ();
+}
+
LY_DEFINE (ly_pitch_steps, "ly:pitch-steps", 1, 0, 0,
(SCM p),
"Number of steps counted from middle C of the pitch @var{p}.")
Rational FLAT_ALTERATION (-1, 2);
Rational SHARP_ALTERATION (1, 2);
+
+Pitch
+Pitch::negated () const
+{
+ return pitch_interval (*this, Pitch ());
+}
Pitch *quote_pitch = unsmob_pitch (scm_cdar (entry));
/*
- The pitch that sounds like central C
+ The pitch that sounds when written central C is played.
*/
Pitch *me_pitch = unsmob_pitch (get_music ()->get_property ("quoted-transposition"));
if (!me_pitch)
if (me_pitch)
mp = *me_pitch;
- Pitch diff = pitch_interval (qp, mp);
+ Pitch diff = pitch_interval (mp, qp);
SCM props = transpose_mutable (ev->get_property_alist (true), diff);
ev = new Stream_event (ev->get_property ("class"), props);
'quoted-context-id "cue"
'quoted-music-name what
'quoted-voice-direction dir
- 'quoted-transposition (pitch-of-note pitch-note)
+ 'quoted-transposition (ly:pitch-negate (pitch-of-note pitch-note))
'origin location))
(context-spec-music
(make-property-set 'instrumentTransposition
- (ly:pitch-diff (ly:make-pitch 0 0 0) (pitch-of-note pitch-note)))
+ (pitch-of-note pitch-note))
'Staff
))
Function taking a string (instrument name), and returning a (@var{min} . @var{max}) pair of numbers for the loudness range of the instrument.
")
(instrumentTransposition ,ly:pitch? "Defines the transposition of
-the instrument. Its value is the pitch that sounds like middle C. This
-is used to transpose the MIDI output, and @code{\\quote}s.")
+the instrument. Its value is the pitch that sounds when the instrument
+plays written middle C. This is used to transpose the MIDI output,
+and @code{\\quote}s.")
(internalBarNumber ,integer? "Contains the current barnumber. This property is used for internal timekeeping, among others by the @code{Accidental_engraver}.")
'())
(ly:add-interface
- 'key-cancelation-interface
- "A key cancelation"
+ 'key-cancellation-interface
+ "A key cancellation"
'())
(ly:add-interface