h6. [[SoundChannels]] h6(. » [[SoundChannels SWI Calls|SWI Calls]] h6((. » Sound_Volume h2. Sound_Volume h5. (SWI &40180) |_<^{width:4em}. Entry | | |/2<^. R0 |<^. New volume (1-127) | |<^. Or 0 to read current volume | |_<^{width:4em}. Exit | | |<^. R0 |<^. Previous volume (1-127) | h4. Use This SWI is used to read or set the master volume of the 8 bit sound system. h4. Notes Volume is specified using a logarithmic scale, with 127 representing a 1x multiplier. For every 16 you subtract from the base volume of 127, the linear output will be halved. I.e.: table(bordered). |_<^. Volume |_<^. Multiplier | | 127 | 1 | | 127-16 | 1/2 | | 127-32 | 1/4 | | 127-48 | 1/8 | | 127-64 | 1/16 | | 127-80 | 1/32 | | 127-96 | 1/64 | | 127-112 | 1/128 | The setting made here or via [[*Volume]] influences the return values of SWIs [[Sound_SoundLog]] and [[Sound_LogScale]], and it also controls the contents of the linear-to-log and log amplification tables that are available at offsets +8 and +12 of the sound channel handler block (available via [[Sound_Configure]]). Well-behaved voice generators should make use of one of the above interfaces to determine the volume scale they should use when they generate their output. h4. See also * [[*Volume]] * [[Sound_SoundLog]] * [[Sound_LogScale]] * [[Sound system volume controls]]