libws libws
WSwan hardware library for the Wonderful toolchain
|
Data Structures | |
struct | ws_sound_wave_t |
struct | ws_sound_wavetable_t |
Macros | |
#define | WS_SOUND_UPDATE_HZ_TO_FREQ(hz) |
Convert a frequency in hertz to a channel frequency value, using the nearest approximation. | |
#define | WS_SOUND_WAVE_HZ_TO_FREQ(hz, length) |
Convert a frequency in hertz to a channel frequency value for a wave sample of a given length, using the nearest approximation. | |
#define | WS_SOUND_SWEEP_HZ_TO_FREQ(hz) |
Convert a frequency in hertz to a sweep channel update frequency value, using the nearest approximation. |
Functions | |
void | ws_sound_reset (void) |
Reset the sound system. | |
static void | ws_sound_set_wavetable_address (const void __wf_iram *address) |
Set the base addresses of the sound wavetable. |
#define WS_SOUND_SWEEP_HZ_TO_FREQ | ( | hz | ) |
Convert a frequency in hertz to a sweep channel update frequency value, using the nearest approximation.
Range: 13 .. 375 Hz
#define WS_SOUND_UPDATE_HZ_TO_FREQ | ( | hz | ) |
Convert a frequency in hertz to a channel frequency value, using the nearest approximation.
Range: 1500 .. 3072000 Hz
hz | Playback frequency, in hertz. |
#define WS_SOUND_WAVE_HZ_TO_FREQ | ( | hz, | |
length ) |
Convert a frequency in hertz to a channel frequency value for a wave sample of a given length, using the nearest approximation.
Range:
2-sample wave -> 750 .. 1536000 Hz 4-sample wave -> 375 .. 768000 Hz 8-sample wave -> 188 .. 384000 Hz 16-sample wave -> 94 .. 192000 Hz 32-sample wave -> 47 .. 96000 Hz
hz | Playback frequency, in hertz. |
length | Length, in samples (2, 4, 8, 16, 32). |
void ws_sound_reset | ( | void | ) |
Reset the sound system.
Clears all sound-related I/O ports, except for the wave table address.