📄 audio__if_8h.html
字号:
<td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define AUDIO_TIMBRE </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">t </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> ((<a class="el" href="audio__if_8h.html#a5">audio_note</a>) (AUDIO_SEQ_TIMBRE | (<a class="el" href="csrtypes_8h.html#a4">uint16</a>) audio_tone_##t))</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This command sets the timbre, or waveform, of the notes. There are currently seven timbres defined, and they are:<ul><li>audio_tone_sine Sine Wave</li><li>audio_tone_square Square Wave</li><li>audio_tone_saw Saw-Tooth Wave</li><li>audio_tone_triangle Triangle Wave</li><li>audio_tone_triangle2 Triangle Wave (assymetric)</li><li>audio_tone_clipped_sine Clipped Sine Wave</li><li>audio_tone_plucked Simulates a plucked instrument</li></ul><p>The default is sine. </td> </tr></table><a class="anchor" name="a4" doxytag="audio_if.h::AUDIO_DECAY" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define AUDIO_DECAY </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">d </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> ((<a class="el" href="audio__if_8h.html#a5">audio_note</a>) (AUDIO_SEQ_DECAY | (d)))</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This sets the volume decay rate. As each tone is played, its volume decreases with a variable rate. Low values for this parameter cause notes to decay very quickly, whereas high values cause the notes to continue with an almost constant volume.<p>The parameter to this command is a fixed point number with four bits to the right of the binary point giving the time taken for the note to decay to zero volume relative to the length of the note played. A value of 0x10 (meaning 1.0) will cause each note to reach zero volume just as the next note starts. A value of 0x08 (meaning 0.5) will cause each note to reach zero halfway through its duration giving a staccato feel. A value of 0x20 (meaning 2.0) will cause each note to reach half its initial volume when the next note starts.<p>When using tied notes, note that the decay length is set from the duration of the first note. This means that a decay value of 0x10 (1.0) will cause tied notes to be silent as the volume will have decayed to zero during the first note.<p>The default for the decay is 0x20 (2.0) which allows two notes of the same length to be tied together. </td> </tr></table><hr><h2>Typedef Documentation</h2><a class="anchor" name="a5" doxytag="audio_if.h::audio_note" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> typedef struct this_struct_doesnt_exist* <a class="el" href="audio__if_8h.html#a5">audio_note</a> </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>The 'audio_note' type is defined so that it is possible to store either sixteen bit numbers or pointers. </td> </tr></table><a class="anchor" name="a6" doxytag="audio_if.h::audio_tone_type" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> typedef enum <a class="el" href="audio__if_8h.html#a14">audio_tone_type_enum</a> <a class="el" href="audio__if_8h.html#a6">audio_tone_type</a> </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>The waveform to use for tone generation. Set using the AUDIO_TIMBRE macro. </td> </tr></table><hr><h2>Enumeration Type Documentation</h2><a class="anchor" name="a14" doxytag="audio_if.h::audio_tone_type_enum" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> enum <a class="el" href="audio__if_8h.html#a14">audio_tone_type_enum</a> </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>The waveform to use for tone generation. Set using the AUDIO_TIMBRE macro. <dl compact><dt><b>Enumeration values: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em><a class="anchor" name="a14a7" doxytag="audio_tone_sine" ></a>audio_tone_sine</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a14a8" doxytag="audio_tone_square" ></a>audio_tone_square</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a14a9" doxytag="audio_tone_saw" ></a>audio_tone_saw</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a14a10" doxytag="audio_tone_triangle" ></a>audio_tone_triangle</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a14a11" doxytag="audio_tone_triangle2" ></a>audio_tone_triangle2</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a14a12" doxytag="audio_tone_clipped_sine" ></a>audio_tone_clipped_sine</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a14a13" doxytag="audio_tone_plucked" ></a>audio_tone_plucked</em> </td><td></td></tr></table></dl> </td> </tr></table></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -