aboutsummaryrefslogtreecommitdiff
path: root/voicing_analyzer.c
diff options
context:
space:
mode:
authorDavide Morelli <morellid@users.sourceforge.net>2006-01-16 00:56:01 +0000
committerDavide Morelli <morellid@users.sourceforge.net>2006-01-16 00:56:01 +0000
commit10a3fd828512907e52f3eabdd7c69b3eaa98757f (patch)
treee65efa6c521f79687cb25fab8bf0559b10759826 /voicing_analyzer.c
parentd1ceaf286dcdd8b1ab51838d66a9df2b8ca4dce1 (diff)
fixed bugs in evaluating indices
svn path=/trunk/externals/frankenstein/; revision=4410
Diffstat (limited to 'voicing_analyzer.c')
-rwxr-xr-xvoicing_analyzer.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/voicing_analyzer.c b/voicing_analyzer.c
index c1ab8e3..703b74f 100755
--- a/voicing_analyzer.c
+++ b/voicing_analyzer.c
@@ -127,7 +127,9 @@ void analyze_it(t_voicing_analyzer *x, float *wideness, float *i_like_parallelis
// now i can compute parallelism
*i_like_parallelism = (float) -1;
*i_like_parallelism += sameDirection;
- *i_like_parallelism += (float) ( ((float)(VOICES*(VOICES-1))) / ((float)parallel8_5) );
+ if (parallel8_5)
+ *i_like_parallelism += (float) ( ((float)parallel8_5) / ((float)(VOICES*(VOICES-1))) );
+
// is voice spacing uniform ?(except for the bass)
// TODO: use notes[]
@@ -145,9 +147,9 @@ void analyze_it(t_voicing_analyzer *x, float *wideness, float *i_like_parallelis
tmp=0;
for (i=0; i<VOICES; i++)
{
- if (DEBUG_VERBOSE)
- post("transitions[%i] = %i",i, transitions[i]);
- res-=abs(transitions[i]);
+ // if (DEBUG_VERBOSE)
+ // post("transitions[%i] = %i",i, transitions[i]);
+ // res-=abs(transitions[i]);
// give an incentive for semitones etc..
if (transitions[i]==0)
res += 5;
@@ -179,7 +181,6 @@ void analyze_it(t_voicing_analyzer *x, float *wideness, float *i_like_parallelis
-
}
typedef struct fitness_list_element_t
@@ -202,8 +203,8 @@ void analyze_voicing(t_voicing_analyzer *x)
// order is important!
outlet_float(x->i_like_parallelism_out, i_like_parallelism);
- outlet_float(x->small_intervals_out, small_intervals);
outlet_float(x->wideness_out, wideness);
+ outlet_float(x->small_intervals_out, small_intervals);
outlet_float(x->center_note_out, center_note);
}