Showing changes from revision #2 to #3:
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.
Automatic tuning is a feature introduced in SoundChannels 1.37 (RISC OS 5.19) to allow several aspects of the 8-bit sound system to automatically adjust itself to the current sound system sample rate and buffer size. The default state is for automatic tuning to be enabled, and while automatic tuning is enabled any attempt to set a manual tuning value will silently fail.
Automatic tuning currently affects the following features of the sound system:
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. The suggested way of checking if automatic tuning is supported is to first call with R1=0, to attempt to read the current automatic tuning state. If R1=0 on exit then it indicates that automatic tuning isn’t understood and you should call Sound_Tuning again in order to restore the previous tuning value (simply pass in R0 = 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.
Starting with SoundChannels 1.39, Service_Sound 11 will be issued when this SWI is used to turn automatic tuning on or off.