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 237<br />

"\t- Length must be equal to the number <strong>of</strong> defined holes.\n");<br />

fprintf(stderr, "\t- e.g. \"XXOOOOOOXOOOOXOOO\"\n\n");<br />

return -1;<br />

}<br />

/* retrieve data structures from XML file */<br />

if(!parseXMLFile(xml_filename, &instrument)) {<br />

fprintf(stderr,<br />

"Impedance error: Impedance failed to parse XML file.\n");<br />

return -1;<br />

}<br />

/* set the air properties (speed <strong>of</strong> sound, density) for each<br />

segment */<br />

setAirProperties(instrument, temp, temp, 0, humid, X_CO2);<br />

/* set fingering from holestring <strong>and</strong> validate */<br />

if(!setFingering(instrument, holestring)) {<br />

fprintf(stderr, "Impedance error: \"%s\" ", holestring);<br />

fprintf(stderr,<br />

"is an invalid fingering for the given woodwind definition.\n");<br />

return -1;<br />

}<br />

/* for each frequency in spectrum range... */<br />

for(f = flo; f maxargc))<br />

return 0;<br />

/* Set default options */<br />

*holestring = NULL;<br />

*temp = TEMP;<br />

*humid = HUMID;<br />

*flo = FLO;<br />

*fhi = FHI;<br />

*fres = FRES;<br />

*entryratio = ENTRYRATIO;

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

Saved successfully!

Ooh no, something went wrong!