Showing changes from revision #0 to #1:
Added | Removed | Changed
Entry | |
---|---|
R0 | 0 => Read current tuning value |
1-&7FFF => Set tuning value | |
&4f545541 (“AUTO”) => control automatic tuning | |
R1 | Automatic tuning option (if R0=“AUTO”): |
0 => Read auto tuning state | |
1 => Disable auto tuning | |
2 => Enable auto tuning |
Exit | |
---|---|
– | If R0 <> “AUTO” on entry: |
R0 | Previous tuning value (1-&7fff) |
– | If R0 = “AUTO” on entry: |
R0 | New auto tuning state (1=off, 2=on) |
R1 | Previous auto tuning state (1=off, 2=on) |
The purpose of this call is to allow alter the tuning of the 8-bit sound system, or to enable/disable automatic tuning.
Tuning values take the form &offf where ‘o’ is the octave and ‘fff’ is the fraction of the octave.
If automatic tuning is enabled, the tuning value is adjusted automatically to match the current sound system sample rate. Any attempt to set a manual tuning value will be ignored.
If an attempt is made to use automatic tuning on a version of the SoundChannels module which does not support the option, the parameter &4f545541 will be interpreted as a tuning value, causing the tuning to be set to &5541. By looking at the return values in R0 and R1 code should detect that the attempt has failed and take action to restore the tuning to an appropriate value. Because ‘1’ and ‘2’ are valid tuning values, the suggested way of checking if automatic tuning is supported is to first call with R1=0, so that you can check if R1 has been changed by the call instead of checking R0.
Even if the version of SoundChannels in use supports automatic tuning, it is possible that the feature will be unavailable, due to lack of support for the sound config changing service call. In this case any attempt to enable automatic tuning will fail, with R0 being 0 on exit.