#ifndef MISC_HH
#define MISC_HH
+#include "proto.hh"
#include "real.hh"
#include "moment.hh"
+#include "scalar.hh"
Moment wholes(int dur, int dots);
-
+
+Rhythmic_grouping parse_grouping(const Array<Scalar> &a);
double log_2(double x) ;
int intlog2(int d);
inline int
+#include "varray.hh"
+
#include "dimen.hh"
#include "beam.hh"
#include "misc.hh"
int dirs[2];
dirs[0]=0; dirs[1] =0;
for (iter_top(stems,i); i.ok(); i++) {
- i->set_default_dir();
- dirs[(i->dir+1)/2] ++;
+ int d = i->get_default_dir();
+ dirs[(d+1)/2] ++;
}
dir = (dirs[0] > dirs[1]) ? -1 : 1;
for (iter_top(stems,i); i.ok(); i++) {
}
Array<int>
-get_default_grouping(int count)
+get_default_grouping(int count, int one_beat_note)
{
Array<int> s;
if (!(count % 3 )) {
- for (int i=0; i < count/3; i++)
+ for (int i=0; i < count/3; i++) {
s.push(3);
+ s.push(one_beat_note);
+ }
} else if (!(count %2)) {
- for (int i=0; i < count/2; i++)
+ for (int i=0; i < count/2; i++) {
s.push(2);
+ s.push(one_beat_note);
+ }
+
}else {
s.push(2);
- s.concat(get_default_grouping(count-2));
+ s.push(one_beat_note);
+ s.concat(get_default_grouping(count-2, one_beat_note));
}
return s;
}