11.07.2014 Views

Flute acoustics: measurement, modelling and design - School of ...

Flute acoustics: measurement, modelling and design - School of ...

Flute acoustics: measurement, modelling and design - School of ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

APPENDIX B. PROGRAM LISTINGS 208<br />

printf("\n");<br />

}<br />

return;<br />

}<br />

int analyseNote(Minimum m, int applypitchcorrection,<br />

int displayharmonicity, int output) {<br />

/* determine if Minimum is playable */<br />

if(!playable(m))<br />

return 0;<br />

/* determine playability <strong>and</strong> strength levels <strong>of</strong> playable Minimum */<br />

double playability = playabilityLevel(m);<br />

double strength = strengthLevel(m);<br />

/* pitch correct Minimum if desired */<br />

if(applypitchcorrection)<br />

pitchCorrection(m);<br />

/* evaluate musical note from frequency (do not round) */<br />

m->note = note(m->f, 0);<br />

if(m->note == NULL)<br />

return 0;<br />

else {<br />

if(output) {<br />

/* output notes */<br />

if(displayharmonicity)<br />

printf("%.1f\t%.1f\t%.1f\t%d\t%.1f\t%.0f\t%.1f",<br />

playability, strength, m->f, m->note->cents,<br />

m->Z, m->numharm, m->meanharmZ);<br />

else<br />

printf("%.1f\t%.1f\t%.1f\t%d\t%.1f",<br />

playability, strength, m->f, m->note->cents, m->Z);<br />

}<br />

return 1;<br />

}<br />

}<br />

int playable(Minimum m) {<br />

/* implement C5.0 decision tree */<br />

if(m->Z R_min_dZ) || (m->R_min_dZ Z R_min_df) || (m->R_min_df

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

Saved successfully!

Ooh no, something went wrong!