10.04.2013 Views

in Snippets - LilyPond

in Snippets - LilyPond

in Snippets - LilyPond

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Contexts and engravers 371<br />

#(def<strong>in</strong>e-class ()<br />

(ambitus-group #:accessor ambitus-group)<br />

(ambitus-l<strong>in</strong>e #:accessor ambitus-l<strong>in</strong>e)<br />

(ambitus-up-note #:getter ambitus-up-note<br />

#:<strong>in</strong>it-form (make ))<br />

(ambitus-down-note #:getter ambitus-down-note<br />

#:<strong>in</strong>it-form (make ))<br />

(start-c0 #:accessor ambitus-start-c0<br />

#:<strong>in</strong>it-value #f)<br />

(start-key-sig #:accessor ambitus-start-key-sig<br />

#:<strong>in</strong>it-value '()))<br />

%%% Accessor for the lower and upper note data of an ambitus<br />

#(def<strong>in</strong>e-method (ambitus-note (ambitus ) direction)<br />

"If @var{direction} is @code{UP}, then return the upper ambitus note<br />

of @var{ambitus}, otherwise return the lower ambitus note."<br />

(if (= direction UP)<br />

(ambitus-up-note ambitus)<br />

(ambitus-down-note ambitus)))<br />

%%% The class holds the grobs that are specific to ambitus<br />

%%% (lower and upper) notes:<br />

%%% - head: an AmbitusNoteHead grob;<br />

%%% - accidental: an AmbitusAccidental grob, to be possibly pr<strong>in</strong>ted next<br />

%%% to the ambitus note head.<br />

%%% Moreover:<br />

%%% - pitch is the absolute pitch of the note<br />

%%% - cause is the note event that causes this ambitus note, i.e. the lower<br />

%%% or upper note of the considered music sequence.<br />

#(def<strong>in</strong>e-class ()<br />

(head #:accessor ambitus-note-head<br />

#:<strong>in</strong>it-value #f)<br />

(accidental #:accessor ambitus-note-accidental<br />

#:<strong>in</strong>it-value #f)<br />

(cause #:accessor ambitus-note-cause<br />

#:<strong>in</strong>it-value #f)<br />

(pitch #:accessor ambitus-note-pitch<br />

#:<strong>in</strong>it-value #f))<br />

%%%<br />

%%% Ambitus engrav<strong>in</strong>g logics<br />

%%%<br />

%%% Rewrite of the code from @file{lily/ambitus-engraver.cc}.<br />

#(def<strong>in</strong>e (make-ambitus translator)<br />

"Build an ambitus object: <strong>in</strong>itialize all the grobs and their relations.<br />

The Ambitus grob conta<strong>in</strong> all other grobs:<br />

Ambitus<br />

|- AmbitusL<strong>in</strong>e

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!