Csound and Unity on Android

Hi, wanted to get back with the results of my testing, (and sorry for the delay)

  1. Overall tuning: Yes, in order to play at correct a=440 pitch on any script in CsoundUnity Android I needed to switch to sr=9600 (or else it plays an octave above). (Agreeing with Bill’s post above) tt appears to be a general artifact of CsoundUnity that the overall pitch/tuning is dependent on the Csound sample rate (on Windows it needs to be 48000), although the ksmps parameter seems to affect the sound quality but not the tuning (I stuck with ksmps=32). To be clear I know Android is not really running at 96000, but perhaps something about the way the sample data is being exchanged with the Unity Update() function is having this effect on tuning and playback.
  1. Intonation: this turned out to be a more narrow issue with the soundfont function sfinstr. It turns out that many (but not all) patches play back out of tune, especially the farther away they get from middle C (midi note 60). Timbres that contain odd harmonics (fifths) are generally unusable. (please note that this did not happen when using direct waveform Csound functions)

Using the widely available soundfont file sf_GMbank.sf2 some of the patches that play very out of tune include

  1. Piano 1 (and most of the pianos)
  2. Nylon Guitar
  3. Fretless Bass
  4. Fantasia String

A few that DO play in tune

  1. EP 1 Layer 2
  2. Organ 1
  3. Pan Flute

Hope this helps, and thanks again for the effort on this