Interpretation_context_handle null_;
Interpretation_context_handle shared_;
+ void kill_mmrest (Translator_group*);
void chords_together ();
void solo1 ();
void solo2 ();
}
+void
+New_pc_iterator::kill_mmrest (Translator_group * tg)
+{
+ static Music * mmrest;
+ if (!mmrest)
+ {
+ mmrest = make_music_by_name (ly_symbol2scm ("MultiMeasureRestEvent"));
+ mmrest->set_mus_property ("duration", SCM_EOL);
+ }
+
+ tg->try_music (mmrest);
+}
+
void
New_pc_iterator::solo1 ()
{
second_iter_->substitute_outlet (two_.report_to (), null_.report_to ());
second_iter_->substitute_outlet (shared_.report_to (), null_.report_to ());
+ kill_mmrest (two_.report_to ());
+ kill_mmrest (shared_.report_to ());
if (playing_state_ != SOLO1)
{
second_iter_->substitute_outlet (two_.report_to (), null_.report_to ());
second_iter_->substitute_outlet (shared_.report_to (), null_.report_to ());
+ kill_mmrest (two_.report_to ());
+ kill_mmrest (shared_.report_to ());
if (playing_state_ != UNISONO
&& newstate == UNISONO)
first_iter_->substitute_outlet (one_.report_to (), null_.report_to ());
first_iter_->substitute_outlet (shared_.report_to (), null_.report_to ());
-
+ kill_mmrest (one_.report_to ());
+ kill_mmrest (shared_.report_to ());
+
if (playing_state_ != SOLO2)
{
static Music* event;
the first and last (quarter) note bothe get one tremolo flag.
*/
- int evuested_type = gh_scm2int (tremolo_ev_->get_mus_property ("tremolo-type"));
+ int requested_type = gh_scm2int (tremolo_ev_->get_mus_property ("tremolo-type"));
SCM f = get_property ("tremoloFlags");
- if (!evuested_type)
+ if (!requested_type)
if (gh_number_p (f))
- evuested_type = gh_scm2int (f);
+ requested_type = gh_scm2int (f);
else
- evuested_type = 8;
+ requested_type = 8;
else
- daddy_trans_->set_property ("tremoloFlags", gh_int2scm (evuested_type));
+ daddy_trans_->set_property ("tremoloFlags", gh_int2scm (requested_type));
- int tremolo_flags = intlog2 (evuested_type) - 2
+ int tremolo_flags = intlog2 (requested_type) - 2
- (duration_log > 2 ? duration_log - 2 : 0);
if (tremolo_flags <= 0)
{
(define-class <Voice-state> ()
(event-list #:init-value '() #:accessor events #:init-keyword #:events)
(when-moment #:accessor when #:init-keyword #:when)
- (split-idx #:accessor split-idx)
+ (split-index #:accessor split-index)
(vector-index)
(state-vector)
+
+
+ ;;;
+ ; spanner-state is an alist
+ ; of (SYMBOL . RESULT-INDEX), which indicates where
+ ; said spanner was started.
(spanner-state #:init-value '() #:accessor span-state)
)
+(define-method (write (x <Voice-state> ) file)
+ (display (when x) file)
+ (display " evs = " file)
+ (display (events x) file)
+ (display " active = " file)
+ (display (span-state x) file)
+ (display "\n" file)
+ )
(define-method (note-events (vs <Voice-state>))
(define (f? x)
(synced #:init-keyword #:synced #:init-value #f #:getter synced?)
)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
(define-method (previous-voice-state (vs <Voice-state>))
(let* ((i (slot-ref vs 'vector-index))
(v (slot-ref vs 'state-vector))
'())
))
-(define-method (write (x <Voice-state> ) file)
- (display (when x) file)
- (display " evs = " file)
- (display (events x) file)
- (display " active = " file)
- (display (span-state x) file)
- (display "\n" file)
- )
(define-method (write (x <Split-state> ) f)
(display (when x) f)
) #f))
)
(if s1
- (set! (split-idx s1) ss-idx))
+ (set! (split-index s1) ss-idx))
(if s2
- (set! (split-idx s2) ss-idx))
+ (set! (split-index s2) ss-idx))
(if min
(helper (1+ ss-idx)
(if (and (symbol? key) (ly:dir? sp))
(if (= sp STOP)
(assoc-remove! active key)
- (acons key index active))
+ (acons key
+ (split-index (vector-ref voice-state-vec index))
+ active))
active)
))
;; todo: use fold or somesuch.
(run-analyzers
- (list analyse-span-event
- ;; note: tie-start comes after tie-end.
- analyse-tie-end analyse-tie-start analyse-absdyn-end)
+ (list
+ analyse-absdyn-end
+ analyse-span-event
+
+ ;; note: tie-start/span comes after tie-end/absdyn.
+ analyse-tie-end analyse-tie-start)
active evs)
(define (copy-one-state key-idx)
(let*
((idx (cdr key-idx))
- (start-vs (vector-ref state-vec idx))
- (prev-ss (vector-ref result (split-idx start-vs)))
+ (prev-ss (vector-ref result idx))
(prev (configuration prev-ss))
)
(if (symbol? prev)
(define (previous-config vs)
(let* ((pvs (previous-voice-state vs))
- (spi (if pvs (split-idx pvs) #f))
+ (spi (if pvs (split-index pvs) #f))
(prev-split (if spi (vector-ref result spi) #f))
)
((now-state (vector-ref result ri))
(vs1 (car (voice-states now-state)))
(vs2 (cdr (voice-states now-state)))
-
- (notes1 (note-events vs1))
- (notes2 (note-events vs2))
+ (notes1 (if vs1 (note-events vs1) '()))
+ (notes2 (if vs2 (note-events vs2) '()))
(n1 (length notes1))
(n2 (length notes2))
)