+++ /dev/null
-
-\score {\notes {
- c2.
- c1
- \grace { [c32 d] }
- c4
-
-
-}}
+++ /dev/null
-
-[bes:16 e e e]
+++ /dev/null
-
-\score { \context Staff \notes { c1 \nobreak c1 }}
+++ /dev/null
-\score{
- <
- \context Staff \notes\relative c'{
- c4 d e f
- \repeat semi 3 { g a b c }
- \alternative { { c b a g } { f e d c } } c c c c
-% \alternative { { c b a g } { f e d c } { c d e f } }
- g g g g
- \repeat semi 2 { c c c c }
- \repeat semi 2 { c c c c }
- g g g g
- }
- >
-}
+++ /dev/null
-%K1
-rh = {\property Thread.noteHeadStyle = ""}
-lh = {\property Thread.noteHeadStyle = "diamond"}
-\score {
-\notes {
-\context Staff = staffOne <
-\property Staff.numberOfStaffLines = "11"
-%\property Staff.timeSignatureStyle = "C"
-\keysignature bes;
-\time 4/4;
-\clef alto;
-\context ThreadedVoice = vOne <
-\context Thread=tOne{
-\stemup \slurup
-%1
-\rh [d''16 e'' f'' g''][a'' a' cis'' a'] d''4. e''8|
-%2
-[f''16 d'' g'' e''][a'' f'' e'' d''][cis''8 a''] a''4^\prall~
-%3
-[a''16 g'' f'' e''][d'' c'' bes' a'][bes'8 \lh g''] g''4^\prall~
-%4
-[g''16 f'' e'' d''][c'' bes' a' g'][a'8 \rh f''] f''4^\prall~
-%5
-[f''16 e'' d'' c''][bes' a' g' f'][g'8 \lh e''] e''4^\prall~
-%6
-[e''16 d'' cis'' b'][a' g' f' \rh e'] [f' d' g' e'][a' f' e' d']|
-%7
-[cis'16 a d' b][e' cis' f' d'][g' e' a' f'][b' g' cis'' a']|
-%8
-[d''16 b' e'' cis''][f'' d'' g'' e''] a''4 g''^\prall|
-%9
-\lh a''4 g''^\prall \rh a'' g''^\prall|
-%10
-[f''16 d'' g'' e''][a'' f'' e'' d''] [cis'' a' d'' b'][e'' g' f' e']|
-%11
-[f'16 d' g' e'][a' f' e' d'][cis' a d' b][e' cis' f' d']|
-%12
-[g'16 g' f' e'][f'8 g'16^\prall f'32 g'][a'16 e' f' d'][e' cis' \lh f'8]|
-%13
-[e'8 d'] cis'16 s8. s2 \bar "||";
-%14
-\rh [a'16 b' cis'' d''][e'' cis'' f'' d''] e''4. a'8|
-%15
-[b'16 g' cis'' a'][d'' b' e'' cis''][fis'' d'' g'' e''][a'' c'' bes' a']|
-%16
-[bes'16 g' c'' a'][d'' bes' a' g'][fis' d' g' e'][a' c' bes a]|
-%17
-\lh [bes16 g c' a][d' bes e' c'][f' d' g' e'][a' f' bes' g']|
-%18
-\rh c''4 bes'^\prall \lh c'' bes'^\prall|
-%19
-\rh [c''8 f''][bes' e''][a'16 f' c'' a'][f'' c'' a'' f'']|
-%20
-[e''16 g'' c'' e''][g' c'' bes' a'] \lh [bes' g' d'' bes'][g'' d'' bes'' g'']|
-%21
-[f''16 a'' d'' f''][a' d'' c'' b'] \rh [c'' a' e'' c''][a'' e'' c''' a'']|
-%22
-[gis''16 b'' e'' gis''][b' d'' cis'' b'][cis''8 a''] a''4^\prall^"\\textflat"~
-%23
-[a''16 g'' f'' e''][d'' c'' \lh bes' a'] [bes'8 \rh g''] g''4^\prall~
-%24
-[g''16 f'' e'' d''][c'' bes' \lh a' g'][a'8 \rh f''] f''4^\prall~
-%25
-[f''16 e'' d'' c''][bes' a' \lh g' f'][g'8 \rh e''] e''4^\prall~
-%26
-[e''16 d'' cis'' b'][a' g' f' e'] [f' d' g' e'][a' f' bes' g']|
-%27
-\lh [f'16 d' g' e'][a' f' bes' g'] \rh [f' d' g' e'][a' f' bes' g']|
-%28
-[a'8 d''][g' cis''] \lh [a' f''][g' e'']|
-%29
-\rh [a'8 d''][g' e''][f'16 d' g'16 e'][a' f' b' g']|
-%30
-[cis''16 a' d'' e''][f'' d'' e'' cis''][d'' a' bes' g'][a' f' \lh bes'8]|
-%31
-[a'8 g'] f'16 s8. s2 \bar "|.";
-}
-\context Thread=tTwo{
-s1*9|
-%10
-d''16 s4.. a'16 s4..|
-%11
-d'16 s2...|
-s1*3|
-%15
-s2 d''16 s4..|
-%16
-g'16 s4.. d'16 s4..|
-s1*2|
-%19
-s8 \rh a'' s g'' s2|
-s1*8
-%28
-s8 f'' s e'' s d'' s cis''|
-%29
-s8 f'' s cis''
-}>
-\context ThreadedVoice = vTwo <
-\context Thread=tThree{
-\stemdown \slurdown
-%1
-\lh s2 [d'16 e' f' g'][a' a cis' a]|
-%2
-[d'8 e' f' g'][a' a' a' a']|
-%3
-[a'8 a' a' f'][g \rh bes' bes' bes']|
-%4
-[g'8 g' g' e'][f \lh a' f' a']|
-%5
-[d'8 f' d' d'][e \rh g' g' g']|
-%6
-[e'8 e' e' a] [d' \lh e f g]|
-%7
-a8 s [cis' d'][e' f'][g' a']|
-%8
-[b'8 cis''][d'' e''][f''16 d'' bes' g'][e'' cis'' a' cis'']|
-%9
-\rh [f''16 d'' bes' g'][e'' cis'' a' cis''] \lh [f'' d'' bes' g'][e'' cis'' a' cis'']|
-%10
-[d'8 e' f' g'][a b cis' a]|
-%11
-[d8 e f g][a b][cis' d']|
-%12
-[e16 e' d' cis'][d'8 bes] \stemup a,4 \stemdown s8 \rh [d'16 b]|
-%13
-[cis'16 a b gis][a16 e cis e] \lh \stemup a,4^\prall^"\\textnatural" r^\fermata|
-%14
-\stemdown s2 [a16 b cis' d'][e' cis' f' d']|
-%15
-[g'8 a'][b' cis''][d' e' fis' d']|
-%16
-[g8 a bes c'][d e fis d]|
-%17
-\rh [g8 a][bes c'][d' e'][f' g']|
-%18
-\lh [a'16 f' d' bes][g' e' c' e'] \rh [a' f' d' bes][g' e' c' e']|
-%19
-\lh [a'16 f' d' bes][g' e' c' e'][f'8 f f f,]|
-%20
-[c8 c' c' fis'] \rh [g' g g g,]|
-%21
-[d8 d' d' gis'] \lh [a' a a a,]|
-%22
-[e8 e, e, e,][a, a' a' a']|
-%23
-[f,8 a' a' f'][\rh g, \lh bes' bes' bes']|
-%24
-[e,8 e' g' e'][\rh f, \lh a' a' a']|
-%25
-[d,8 f' f' d'][\rh e, \lh g' g' g']|
-%26
-[a,8 a e' a] [d' e'][f' g']|
-%27
-[d'8 e'][f' g'] \rh [d' e'][f' g']|
-%28
-\lh [f'16 d' bes g][e' cis' a cis'] \rh [f' d' bes g][e' cis' a cis']|
-%29
-\lh [f'16 d' bes g][e' cis' a cis'][d8 e][f g]|
-%30
-[a8 g a a,] \stemup d4 \stemdown s8 \rh [g'16 e']|
-%31
-[f'16 d' e' cis'][d'16 a f a] \lh \stemup d4^\prall r4^\fermata|
-}
-\context Thread=tFour{
-s1*2|
-%3
-\lh f'8 f' f' s4 \rh g'8 g' g'|
-%4
-e'8 e' e' s4 \lh f'8 a' f'|
-%5
-f'8 d' f' s4 \rh e'8 e' e'|
-%6
-a8 a a s d s4.|
-s1*16|
-%23
-\lh s8 f' f' s4 g'8 g' g'|
-%24
-s8 g' e' s4 f'8 f' f'|
-%25
-s8 d' d' s4 e'8 e' e'|
-%26
-s8 e' a s s2|
-s1*2|
-%29
-s2 d'8
-}>
-\context ThreadedVoice = vThree <
-\context Thread=tFive{
-\stemdown \slurdown
-s1*25|
-%26
-\stemup s2 \rh d''4 s|
-%27
-\lh d''4 s \rh d''4
-}>
->}
-\paper{barsize=50.0; indent=0.0;
-\translator {\VoiceContext beamAuto=0; \remove Auto_beam_engraver;}
-\translator {\StaffContext \consists Bar_number_engraver;}
- \translator {\VoiceContext \remove Tuplet_engraver;}
-}}
+++ /dev/null
-\score{
- \context Staff \notes\relative c'{
- % compare this to 'semi' with numbered voltas:
- % 1-3: alternative 1
- % 4: alternative 2
- \repeat unfold 4 { g a b c }
- \alternative {
- { c c c c }
- { d d d d }
- }
- }
-}
+++ /dev/null
-\score{
- \context Staff \notes\relative c'{
- \repeat unfold 4 { g a b c }%\alternative {c1 d e f}
- }
-}
+++ /dev/null
-\version "1.0.21";
-
-\score{
- \notes \relative c {
- c d c f c g c b, c g, c f, c c'' c
-% run with find-quarts should suggest:
-% c d c f c g' c, b c g c f, c' c'' c,,
- }
-}
-
+++ /dev/null
-/*
- rhythmic-grouping.hh -- part of GNU LilyPond
-
- (c) 1996--1999 Han-Wen Nienhuys
-*/
-
-#ifndef RHYTHMIC_GROUPING_HH
-#define RHYTHMIC_GROUPING_HH
-
-#include "minterval.hh"
-#include "parray.hh"
-
-/** data structure which represents rhythmic units this is a tree. It groupes notes according to rules
-
- TODO Documentation. Unhairing
- */
-struct Rhythmic_grouping {
- Link_array<Rhythmic_grouping> children;
- MInterval *interval_;
-
-
- Array<MInterval> intervals();
- MInterval interval() const;
- Moment length_mom () const;
- void intersect (MInterval);
-
- void operator=(Rhythmic_grouping const&);
- Rhythmic_grouping (Rhythmic_grouping const&);
- Rhythmic_grouping (MInterval, int n=1);
- Rhythmic_grouping();
- Rhythmic_grouping (Link_array<Rhythmic_grouping>);
- ~Rhythmic_grouping();
-
- void add_child (Moment start, Moment len);
- bool child_fit_b (Moment start);
- void split (Rhythmic_grouping r);
- void split (Array<MInterval>);
- void split (int n);
-
- void print() const;
- void OK() const;
-
- Array<int> generate_beams (Array<int>, int&);
-
- /** multiply self to span #i#.
- In implementation, this isn't really const, but conceptually it is.
- */
- void extend (MInterval i) const;
- void translate (Moment);
-private:
- void init();
- void junk();
- void copy (Rhythmic_grouping const&);
-};
-
-
-Rhythmic_grouping parse_grouping (Array<int> beat_i_arr, Array<Moment> elt_length_arr);
-
-
-#endif // RHYTHMIC_GROUPING_HH
+++ /dev/null
-/*
- rhythmic-grouping.cc -- implement Rhythmic_grouping
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "debug.hh"
-#include "rhythmic-grouping.hh"
-#include "interval.hh"
-
-void
-Rhythmic_grouping::init()
-{
- interval_ = 0;
- children.clear();
-}
-
-void
-Rhythmic_grouping::OK() const
-{
-#ifndef NDEBUG
- assert (bool (children.size()) != bool (interval_));
-
- for (int i= 0; i < children.size(); i++)
- {
- children[i]->OK();
- if (i>0)
- assert (children[i-1]->interval()[RIGHT] ==
- children[i]->interval()[LEFT]);
- }
-#endif
-}
-
-Moment
-Rhythmic_grouping::length_mom () const
-{
- return interval().length ();
-}
-
-MInterval
-Rhythmic_grouping::interval() const
-{
- if (interval_)
- return *interval_;
- else
- return
- MInterval (children[0]->interval()[LEFT],
- children.top()->interval ()[RIGHT]);
-}
-
-void
-Rhythmic_grouping::split (Rhythmic_grouping r)
-{
- if (interval_)
- return ;
-
- r.intersect (interval());
- split (r.intervals());
-
- for (int i= 0; i < children.size(); i++)
- {
- if (!children[i]->interval_)
- {
- Rhythmic_grouping here (r);
- children[i]->split (here);
- }
- }
-}
-
-
-Array<MInterval>
-Rhythmic_grouping::intervals()
-{
- Array<MInterval> r;
- if (interval_ || children.size() == 1)
- {
- MInterval i (interval());
- MInterval r1(i), r2(i);
- r1[RIGHT] = r2[LEFT] = i.center();
- r.push (r1); r.push (r2);
- }
- else
- {
- for (int i=0; i < children.size(); i++)
- r.push (children[i]->interval());
- }
- return r;
-}
-
-void
-Rhythmic_grouping::intersect (MInterval t)
-{
- if (interval_)
- {
- interval_->intersect (t);
- return;
- }
-
- for (int i=0; i < children.size(); i++)
- {
- MInterval inter = intersection (t, children[i]->interval());
- if (inter.empty_b() || inter.length () <= Moment (0))
- {
- delete children[i];
- children[i] =0;
- }
- else
- {
- children[i]->intersect (t);
- }
- }
- for (int i=0; i < children.size();)
- {
- if (!children[i])
- children.del (i);
- else
- i++;
- }
-
-}
-
-/**
- Put our children in branches of #this#.
- The min and max time intervals coincide with elements of #splitpoints#
-
- I really should be documenting what is happening here, but I find
- that difficult, since I don't really understand what's going on here.
-
- */
-void
-Rhythmic_grouping::split (Array<MInterval> splitpoints)
-{
- //check on splitpoints..
- int j = 0, i = 0, starti = 0, startj = 0;
-
- Link_array<Rhythmic_grouping> ch;
- while (1)
- {
- if (i >= children.size() || j >= splitpoints.size ())
- break;
-
- assert (
- children[starti]->interval()[LEFT]== splitpoints[startj][LEFT]);
- if (children[i]->interval()[RIGHT] < splitpoints[j][RIGHT])
- {
- i ++;
- }
- else if (children[i]->interval()[RIGHT] > splitpoints[j][RIGHT])
- {
- j ++;
- }
- else
- {
-
- if (i == starti)
- {
- ch.push (children[i]);
- }
- else
- {
- Link_array<Rhythmic_grouping> slice = children.slice (starti, i+1);
- Rhythmic_grouping *newchild=new Rhythmic_grouping (slice);
-
- ch.push (newchild);
- }
- i ++;
- j++;
- starti = i;
- startj = j;
-
-
- }
- }
- if (ch.size() != 1)
- children = ch;
-}
-
-
-Rhythmic_grouping::Rhythmic_grouping (MInterval t, int n)
-{
- init();
- if (n == 1 || !n)
- {
- interval_ = new MInterval (t);
- return;
- }
- Moment dt = t.length ()/Moment (n);
- MInterval basic = MInterval (t[LEFT], t[LEFT]+dt);
- for (int i= 0; i < n; i++)
- children.push (new Rhythmic_grouping (dt*Moment (i) + basic));
-}
-
-
-Rhythmic_grouping::Rhythmic_grouping (Link_array<Rhythmic_grouping> r)
- :children (r)
-{
- interval_ =0;
-}
-
-Rhythmic_grouping::~Rhythmic_grouping()
-{
- junk();
-}
-
-void
-Rhythmic_grouping::copy (Rhythmic_grouping const&s)
-{
- interval_ = (s.interval_)? new MInterval (*s.interval_) : 0;
- for (int i=0; i < s.children.size(); i++)
- children.push (new Rhythmic_grouping (*s.children[i]));
-}
-
-void
-Rhythmic_grouping::operator=(Rhythmic_grouping const &s)
-{
- junk();
- copy (s);
-}
-
-Rhythmic_grouping::Rhythmic_grouping (Rhythmic_grouping const&s)
-{
- init();
- copy (s);
-}
-
-void
-Rhythmic_grouping::junk()
-{
- delete interval_;
- junk_pointer_array (children);
- init();
-}
-
-void
-Rhythmic_grouping::print() const
-{
-#ifndef NPRINT
- DOUT << "{ \n";
- if (interval_)
- DOUT <<" Interval "<< interval_->str();
- for (int i=0; i < children.size(); i++)
- {
- children[i]->print();
- }
- DOUT << "}\n";
-#endif
-}
-
-bool
-Rhythmic_grouping::child_fit_b (Moment start)
-{
- if (children.size())
- return (children.top()->interval ()[RIGHT]== start);
-
- return true;
-}
-
-void
-Rhythmic_grouping::add_child (Moment start, Moment len)
-{
- Moment stop = start+len;
- assert (child_fit_b (start));
- children.push (new Rhythmic_grouping (MInterval (start, stop)));
-}
-
-Rhythmic_grouping::Rhythmic_grouping()
-{
- interval_ =0;
-}
-
-int
-min_elt (Array<int> v)
-{
- int i = 1000; // ugh
- for (int j = 0 ; j < v.size(); j++)
- i = i <? v[j];
- return i;
-}
-
-Array<int>
-Rhythmic_grouping::generate_beams (Array<int> flags, int &flagidx)
-{
- assert (!interval_) ;
-
- Array< Array<int> > children_beams;
- for (int i=0; i < children.size(); i++)
- {
- Array<int> child_beams;
- if (children[i]->interval_)
- {
- int f = flags[flagidx++];
- child_beams.push (f);
- }
- else
- {
- child_beams = children[i]->
- generate_beams (flags, flagidx);
- }
- children_beams.push (child_beams);
- }
- Array<int> beams;
- int lastm, m, nextm;
- for (int i=0; i < children_beams.size(); i++)
- {
- bool add_left = (i >0);
- bool add_right = (i < children_beams.size() -1);
-
- if (!i)
- m = min_elt (children_beams[i]);
- if (add_right)
- nextm = min_elt (children_beams[i+1]);
-
- if (children_beams[i].size() == 1)
- {
- if (add_right)
- beams.push (m);
- if (add_left)
- beams.push (m);
- }
- else
- {
- if (add_left)
- beams.push (lastm <? m);
- beams.concat (children_beams[i]);
- if (add_right)
- beams.push (m <? nextm);
- }
- lastm = m;
- m = nextm;
- }
- assert (!(beams.size()%2));
- return beams;
-}
-
-void
-Rhythmic_grouping::translate (Moment m)
-{
- if (interval_)
- *interval_ += m;
- else
- for (int i=0; i < children.size(); i++)
- children[i]->translate (m);
-}
-
-void
-Rhythmic_grouping::extend (MInterval m) const
-{
- assert (m[LEFT] >= interval()[LEFT]);
- while (m[RIGHT] >interval()[RIGHT])
- {
- Link_array<Rhythmic_grouping> a (children);
- for (int i=0; i < a.size(); i++)
- {
- a[i] =new Rhythmic_grouping (*children[i]);
- a[i]->translate (children.top()->interval ()[RIGHT]);
- }
- ((Rhythmic_grouping*)this)->children.concat (a);
- }
- assert (m[RIGHT] <= interval()[RIGHT]);
- OK();
-}
-
-Rhythmic_grouping
-parse_grouping (Array<int> beat_i_arr, Array<Moment> elt_length_arr)
-{
- Moment here =0;
- assert (beat_i_arr.size() == elt_length_arr.size ());
-
- Link_array<Rhythmic_grouping> children;
- for (int i=0; i < beat_i_arr.size(); i++)
- {
- Moment last = here;
- here += elt_length_arr[i] * Moment (beat_i_arr[i]);
- children.push (
- new Rhythmic_grouping (MInterval (last, here),
- beat_i_arr[i]));
- }
- return Rhythmic_grouping (children);
-}
-