From e4fcde32271506df910f71ad65204cf876b1ab86 Mon Sep 17 00:00:00 2001 From: nucular Date: Sat, 5 Mar 2016 21:03:04 +0100 Subject: [PATCH] Split up other stuff into sections --- config.ld | 1 + doc/api/sfxr.html | 830 ++++++++++++++++++++++++---------------------- doc/index.html | 830 ++++++++++++++++++++++++---------------------- sfxr.lua | 25 +- 4 files changed, 885 insertions(+), 801 deletions(-) diff --git a/config.ld b/config.ld index 9916742..9e08d3f 100644 --- a/config.ld +++ b/config.ld @@ -2,6 +2,7 @@ project = "sfxr.lua" description = "A port of the sfxr sound effect synthesizer to Lua" title = "sfxr.lua Documentation" format = "markdown" +not_luadoc = true style = "!pale" kind_names = {topic = "Topics", module = "API"} dir = "./doc" diff --git a/doc/api/sfxr.html b/doc/api/sfxr.html index 0d75658..e9cb9d4 100644 --- a/doc/api/sfxr.html +++ b/doc/api/sfxr.html @@ -42,6 +42,8 @@
  • Parameters.lowpass
  • Parameters.highpass
  • Parameters.volume
  • +
  • Randomization
  • +
  • SavingLoading
  • @@ -127,63 +129,6 @@ sfxr.Sound:generateSoundData ([rate=44100[, depth=0[, sounddata]]]) Synthesize the sound to a LÖVE SoundData instance. - - sfxr.Sound:randomize ([seed]) - Randomize all sound parameters - - - sfxr.Sound:mutate ([by=1][, seed], whether) - Mutate all sound parameters - - - sfxr.Sound:randomPickup ([seed]) - Randomize all sound parameters to generate an item pick up sound - - - sfxr.Sound:randomLaser ([seed]) - Randomize all sound parameters to generate a laser sound - - - sfxr.Sound:randomExplosion ([seed]) - Randomize all sound parameters to generate an explosion sound - - - sfxr.Sound:randomPowerup ([seed]) - Randomize all sound parameters to generate a power up sound - - - sfxr.Sound:randomHit ([seed]) - Randomize all sound parameters to generate a hit sound - - - sfxr.Sound:randomJump ([seed]) - Randomize all sound parameters to generate a jump sound - - - sfxr.Sound:randomBlip ([seed]) - Randomize all sound parameters to generate a blip sound - - - sfxr.Sound:exportWAV (f[, rate=44100[, depth=0]]) - Generate and export the audio data to a PCM WAVE file. - - - sfxr.Sound:save (f[, minify=true]) - Save the sound parameters to a file as a Lua table - - - sfxr.Sound:load (f) - Load the sound parameters from a file containing a Lua table - - - sfxr.Sound:saveBinary (f) - Save the sound parameters to a file in the sfxr binary format (version 102) - - - sfxr.Sound:loadBinary (f) - Load the sound parameters from a file in the sfxr binary format - (version 100-102) -

    Parameters

    @@ -192,6 +137,10 @@ + + + +
    The sound volume and gain all samples are multiplied with
    self.supersamplingNumber of supersampling passes to perform (default 8)
    self.repeatspeed Repeat speed: Times to repeat the frequency slide over the course of the envelope @@ -414,6 +363,69 @@ Decay_Sustain_Release_.28ADSR.29_envelope">ASD envelope that controls the so Additional gain (default 0.5)
    +

    Randomization

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    sfxr.Sound:randomize ([seed])Randomize all sound parameters
    sfxr.Sound:mutate ([amount=1][, seed], changefreq)Mutate all sound parameters
    sfxr.Sound:randomPickup ([seed])Randomize all sound parameters to generate a "pick up" sound
    sfxr.Sound:randomLaser ([seed])Randomize all sound parameters to generate a laser sound
    sfxr.Sound:randomExplosion ([seed])Randomize all sound parameters to generate an explosion sound
    sfxr.Sound:randomPowerup ([seed])Randomize all sound parameters to generate a "power up" sound
    sfxr.Sound:randomHit ([seed])Randomize all sound parameters to generate a hit sound
    sfxr.Sound:randomJump ([seed])Randomize all sound parameters to generate a jump sound
    sfxr.Sound:randomBlip ([seed])Randomize all sound parameters to generate a "blip" sound
    +

    SavingLoading

    + + + + + + + + + + + + + + + + + + + + + +
    sfxr.Sound:exportWAV (f[, rate=44100[, depth=0]])Generate and export the audio data to a PCM WAVE file.
    sfxr.Sound:save (f[, minify=true])Save the sound parameters to a file as a Lua table
    sfxr.Sound:load (f)Load the sound parameters from a file containing a Lua table
    sfxr.Sound:saveBinary (f)Save the sound parameters to a file in the sfxr binary format (version 102)
    sfxr.Sound:loadBinary (f)Load the sound parameters from a file in the sfxr binary format + (version 100-102)


    @@ -599,7 +611,7 @@ Decay_Sustain_Release_.28ADSR.29_envelope">ASD envelope that controls the so
    Set all parameters to their default values. Does not affect - ??? and volume. + supersampling and volume. Called by the initializer. @@ -819,345 +831,6 @@ Decay_Sustain_Release_.28ADSR.29_envelope">ASD envelope that controls the so -
    -
    - - sfxr.Sound:randomize ([seed]) -
    -
    - Randomize all sound parameters - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:mutate ([by=1][, seed], whether) -
    -
    - Mutate all sound parameters - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:randomPickup ([seed]) -
    -
    - Randomize all sound parameters to generate an item pick up sound - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:randomLaser ([seed]) -
    -
    - Randomize all sound parameters to generate a laser sound - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:randomExplosion ([seed]) -
    -
    - Randomize all sound parameters to generate an explosion sound - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:randomPowerup ([seed]) -
    -
    - Randomize all sound parameters to generate a power up sound - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:randomHit ([seed]) -
    -
    - Randomize all sound parameters to generate a hit sound - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:randomJump ([seed]) -
    -
    - Randomize all sound parameters to generate a jump sound - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:randomBlip ([seed]) -
    -
    - Randomize all sound parameters to generate a blip sound - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:exportWAV (f[, rate=44100[, depth=0]]) -
    -
    - Generate and export the audio data to a PCM WAVE file. - - -

    Parameters:

    - - - -

    Raises:

    - "invalid sampling rate: x", "invalid bit depth: x" - - - -
    -
    - - sfxr.Sound:save (f[, minify=true]) -
    -
    - Save the sound parameters to a file as a Lua table - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:load (f) -
    -
    - Load the sound parameters from a file containing a Lua table - - -

    Parameters:

    - - - -

    Raises:

    - "incompatible version: x.x.x" - - - -
    -
    - - sfxr.Sound:saveBinary (f) -
    -
    - Save the sound parameters to a file in the sfxr binary format (version 102) - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:loadBinary (f) -
    -
    - Load the sound parameters from a file in the sfxr binary format - (version 100-102) - - -

    Parameters:

    - - - -

    Raises:

    - "incompatible version: x", "unexpected file length" - - -

    Parameters

    @@ -1176,6 +849,20 @@ Decay_Sustain_Release_.28ADSR.29_envelope">ASD envelope that controls the so + +
    + + self.supersampling +
    +
    + Number of supersampling passes to perform (default 8) + + + + + + +
    @@ -1747,6 +1434,353 @@ Decay_Sustain_Release_.28ADSR.29_envelope">ASD envelope that controls the so + + +

    Randomization

    + +
    +
    + + sfxr.Sound:randomize ([seed]) +
    +
    + Randomize all sound parameters + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:mutate ([amount=1][, seed], changefreq) +
    +
    + Mutate all sound parameters + + +

    Parameters:

    +
      +
    • amount + number + by how much to mutate the parameters + (default 1) +
    • +
    • seed + number + a random seed + (optional) +
    • +
    • changefreq + bool + whether to change the frequency parameters +
    • +
    + + + + + +
    +
    + + sfxr.Sound:randomPickup ([seed]) +
    +
    + Randomize all sound parameters to generate a "pick up" sound + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:randomLaser ([seed]) +
    +
    + Randomize all sound parameters to generate a laser sound + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:randomExplosion ([seed]) +
    +
    + Randomize all sound parameters to generate an explosion sound + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:randomPowerup ([seed]) +
    +
    + Randomize all sound parameters to generate a "power up" sound + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:randomHit ([seed]) +
    +
    + Randomize all sound parameters to generate a hit sound + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:randomJump ([seed]) +
    +
    + Randomize all sound parameters to generate a jump sound + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:randomBlip ([seed]) +
    +
    + Randomize all sound parameters to generate a "blip" sound + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    +

    SavingLoading

    + +
    +
    + + sfxr.Sound:exportWAV (f[, rate=44100[, depth=0]]) +
    +
    + Generate and export the audio data to a PCM WAVE file. + + +

    Parameters:

    +
      +
    • f + string, file or love.filesystem.File + a path or file in wb-mode + (passed files will not be closed) +
    • +
    • rate + SAMPLERATE + the sampling rate + (default 44100) +
    • +
    • depth + BITDEPTH + the bit depth + (default 0) +
    • +
    + + +

    Raises:

    + "invalid sampling rate: x", "invalid bit depth: x" + + + +
    +
    + + sfxr.Sound:save (f[, minify=true]) +
    +
    + Save the sound parameters to a file as a Lua table + + +

    Parameters:

    +
      +
    • f + string, file or love.filesystem.File + a path or file in w-mode + (passed files will not be closed) +
    • +
    • minify + bool + whether to minify the output or not + (default true) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:load (f) +
    +
    + Load the sound parameters from a file containing a Lua table + + +

    Parameters:

    +
      +
    • f + string, file or love.filesystem.File + a path or file in r-mode + (passed files will not be closed) +
    • +
    + + +

    Raises:

    + "incompatible version: x.x.x" + + + +
    +
    + + sfxr.Sound:saveBinary (f) +
    +
    + Save the sound parameters to a file in the sfxr binary format (version 102) + + +

    Parameters:

    +
      +
    • f + string, file or love.filesystem.File + a path or file in wb-mode + (passed files will not be closed) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:loadBinary (f) +
    +
    + Load the sound parameters from a file in the sfxr binary format + (version 100-102) + + +

    Parameters:

    +
      +
    • f + string, file or love.filesystem.File + a path or file in rb-mode + (passed files will not be closed) +
    • +
    + + +

    Raises:

    + "incompatible version: x", "unexpected file length" + + +
    @@ -1755,7 +1789,7 @@ Decay_Sustain_Release_.28ADSR.29_envelope">ASD envelope that controls the so
    generated by LDoc 1.4.3 -Last updated 2016-03-05 20:46:41 +Last updated 2016-03-05 21:02:39
    diff --git a/doc/index.html b/doc/index.html index 37ae11a..dc216fb 100644 --- a/doc/index.html +++ b/doc/index.html @@ -42,6 +42,8 @@
  • Parameters.lowpass
  • Parameters.highpass
  • Parameters.volume
  • +
  • Randomization
  • +
  • SavingLoading
  • @@ -127,63 +129,6 @@ sfxr.Sound:generateSoundData ([rate=44100[, depth=0[, sounddata]]]) Synthesize the sound to a LÖVE SoundData instance. - - sfxr.Sound:randomize ([seed]) - Randomize all sound parameters - - - sfxr.Sound:mutate ([by=1][, seed], whether) - Mutate all sound parameters - - - sfxr.Sound:randomPickup ([seed]) - Randomize all sound parameters to generate an item pick up sound - - - sfxr.Sound:randomLaser ([seed]) - Randomize all sound parameters to generate a laser sound - - - sfxr.Sound:randomExplosion ([seed]) - Randomize all sound parameters to generate an explosion sound - - - sfxr.Sound:randomPowerup ([seed]) - Randomize all sound parameters to generate a power up sound - - - sfxr.Sound:randomHit ([seed]) - Randomize all sound parameters to generate a hit sound - - - sfxr.Sound:randomJump ([seed]) - Randomize all sound parameters to generate a jump sound - - - sfxr.Sound:randomBlip ([seed]) - Randomize all sound parameters to generate a blip sound - - - sfxr.Sound:exportWAV (f[, rate=44100[, depth=0]]) - Generate and export the audio data to a PCM WAVE file. - - - sfxr.Sound:save (f[, minify=true]) - Save the sound parameters to a file as a Lua table - - - sfxr.Sound:load (f) - Load the sound parameters from a file containing a Lua table - - - sfxr.Sound:saveBinary (f) - Save the sound parameters to a file in the sfxr binary format (version 102) - - - sfxr.Sound:loadBinary (f) - Load the sound parameters from a file in the sfxr binary format - (version 100-102) -

    Parameters

    @@ -192,6 +137,10 @@ + + + +
    The sound volume and gain all samples are multiplied with
    self.supersamplingNumber of supersampling passes to perform (default 8)
    self.repeatspeed Repeat speed: Times to repeat the frequency slide over the course of the envelope @@ -414,6 +363,69 @@ Decay_Sustain_Release_.28ADSR.29_envelope">ASD envelope that controls the so Additional gain (default 0.5)
    +

    Randomization

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    sfxr.Sound:randomize ([seed])Randomize all sound parameters
    sfxr.Sound:mutate ([amount=1][, seed], changefreq)Mutate all sound parameters
    sfxr.Sound:randomPickup ([seed])Randomize all sound parameters to generate a "pick up" sound
    sfxr.Sound:randomLaser ([seed])Randomize all sound parameters to generate a laser sound
    sfxr.Sound:randomExplosion ([seed])Randomize all sound parameters to generate an explosion sound
    sfxr.Sound:randomPowerup ([seed])Randomize all sound parameters to generate a "power up" sound
    sfxr.Sound:randomHit ([seed])Randomize all sound parameters to generate a hit sound
    sfxr.Sound:randomJump ([seed])Randomize all sound parameters to generate a jump sound
    sfxr.Sound:randomBlip ([seed])Randomize all sound parameters to generate a "blip" sound
    +

    SavingLoading

    + + + + + + + + + + + + + + + + + + + + + +
    sfxr.Sound:exportWAV (f[, rate=44100[, depth=0]])Generate and export the audio data to a PCM WAVE file.
    sfxr.Sound:save (f[, minify=true])Save the sound parameters to a file as a Lua table
    sfxr.Sound:load (f)Load the sound parameters from a file containing a Lua table
    sfxr.Sound:saveBinary (f)Save the sound parameters to a file in the sfxr binary format (version 102)
    sfxr.Sound:loadBinary (f)Load the sound parameters from a file in the sfxr binary format + (version 100-102)


    @@ -599,7 +611,7 @@ Decay_Sustain_Release_.28ADSR.29_envelope">ASD envelope that controls the so
    Set all parameters to their default values. Does not affect - ??? and volume. + supersampling and volume. Called by the initializer. @@ -819,345 +831,6 @@ Decay_Sustain_Release_.28ADSR.29_envelope">ASD envelope that controls the so -
    -
    - - sfxr.Sound:randomize ([seed]) -
    -
    - Randomize all sound parameters - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:mutate ([by=1][, seed], whether) -
    -
    - Mutate all sound parameters - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:randomPickup ([seed]) -
    -
    - Randomize all sound parameters to generate an item pick up sound - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:randomLaser ([seed]) -
    -
    - Randomize all sound parameters to generate a laser sound - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:randomExplosion ([seed]) -
    -
    - Randomize all sound parameters to generate an explosion sound - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:randomPowerup ([seed]) -
    -
    - Randomize all sound parameters to generate a power up sound - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:randomHit ([seed]) -
    -
    - Randomize all sound parameters to generate a hit sound - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:randomJump ([seed]) -
    -
    - Randomize all sound parameters to generate a jump sound - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:randomBlip ([seed]) -
    -
    - Randomize all sound parameters to generate a blip sound - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:exportWAV (f[, rate=44100[, depth=0]]) -
    -
    - Generate and export the audio data to a PCM WAVE file. - - -

    Parameters:

    - - - -

    Raises:

    - "invalid sampling rate: x", "invalid bit depth: x" - - - -
    -
    - - sfxr.Sound:save (f[, minify=true]) -
    -
    - Save the sound parameters to a file as a Lua table - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:load (f) -
    -
    - Load the sound parameters from a file containing a Lua table - - -

    Parameters:

    - - - -

    Raises:

    - "incompatible version: x.x.x" - - - -
    -
    - - sfxr.Sound:saveBinary (f) -
    -
    - Save the sound parameters to a file in the sfxr binary format (version 102) - - -

    Parameters:

    - - - - - - -
    -
    - - sfxr.Sound:loadBinary (f) -
    -
    - Load the sound parameters from a file in the sfxr binary format - (version 100-102) - - -

    Parameters:

    - - - -

    Raises:

    - "incompatible version: x", "unexpected file length" - - -

    Parameters

    @@ -1176,6 +849,20 @@ Decay_Sustain_Release_.28ADSR.29_envelope">ASD envelope that controls the so + +
    + + self.supersampling +
    +
    + Number of supersampling passes to perform (default 8) + + + + + + +
    @@ -1747,6 +1434,353 @@ Decay_Sustain_Release_.28ADSR.29_envelope">ASD envelope that controls the so + + +

    Randomization

    + +
    +
    + + sfxr.Sound:randomize ([seed]) +
    +
    + Randomize all sound parameters + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:mutate ([amount=1][, seed], changefreq) +
    +
    + Mutate all sound parameters + + +

    Parameters:

    +
      +
    • amount + number + by how much to mutate the parameters + (default 1) +
    • +
    • seed + number + a random seed + (optional) +
    • +
    • changefreq + bool + whether to change the frequency parameters +
    • +
    + + + + + +
    +
    + + sfxr.Sound:randomPickup ([seed]) +
    +
    + Randomize all sound parameters to generate a "pick up" sound + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:randomLaser ([seed]) +
    +
    + Randomize all sound parameters to generate a laser sound + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:randomExplosion ([seed]) +
    +
    + Randomize all sound parameters to generate an explosion sound + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:randomPowerup ([seed]) +
    +
    + Randomize all sound parameters to generate a "power up" sound + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:randomHit ([seed]) +
    +
    + Randomize all sound parameters to generate a hit sound + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:randomJump ([seed]) +
    +
    + Randomize all sound parameters to generate a jump sound + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:randomBlip ([seed]) +
    +
    + Randomize all sound parameters to generate a "blip" sound + + +

    Parameters:

    +
      +
    • seed + number + a random seed + (optional) +
    • +
    + + + + + +
    +
    +

    SavingLoading

    + +
    +
    + + sfxr.Sound:exportWAV (f[, rate=44100[, depth=0]]) +
    +
    + Generate and export the audio data to a PCM WAVE file. + + +

    Parameters:

    +
      +
    • f + string, file or love.filesystem.File + a path or file in wb-mode + (passed files will not be closed) +
    • +
    • rate + SAMPLERATE + the sampling rate + (default 44100) +
    • +
    • depth + BITDEPTH + the bit depth + (default 0) +
    • +
    + + +

    Raises:

    + "invalid sampling rate: x", "invalid bit depth: x" + + + +
    +
    + + sfxr.Sound:save (f[, minify=true]) +
    +
    + Save the sound parameters to a file as a Lua table + + +

    Parameters:

    +
      +
    • f + string, file or love.filesystem.File + a path or file in w-mode + (passed files will not be closed) +
    • +
    • minify + bool + whether to minify the output or not + (default true) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:load (f) +
    +
    + Load the sound parameters from a file containing a Lua table + + +

    Parameters:

    +
      +
    • f + string, file or love.filesystem.File + a path or file in r-mode + (passed files will not be closed) +
    • +
    + + +

    Raises:

    + "incompatible version: x.x.x" + + + +
    +
    + + sfxr.Sound:saveBinary (f) +
    +
    + Save the sound parameters to a file in the sfxr binary format (version 102) + + +

    Parameters:

    +
      +
    • f + string, file or love.filesystem.File + a path or file in wb-mode + (passed files will not be closed) +
    • +
    + + + + + +
    +
    + + sfxr.Sound:loadBinary (f) +
    +
    + Load the sound parameters from a file in the sfxr binary format + (version 100-102) + + +

    Parameters:

    +
      +
    • f + string, file or love.filesystem.File + a path or file in rb-mode + (passed files will not be closed) +
    • +
    + + +

    Raises:

    + "incompatible version: x", "unexpected file length" + + +
    @@ -1755,7 +1789,7 @@ Decay_Sustain_Release_.28ADSR.29_envelope">ASD envelope that controls the so
    generated by LDoc 1.4.3 -Last updated 2016-03-05 20:46:41 +Last updated 2016-03-05 21:02:39
    diff --git a/sfxr.lua b/sfxr.lua index 63c5200..5172cbf 100644 --- a/sfxr.lua +++ b/sfxr.lua @@ -295,6 +295,7 @@ function sfxr.Sound:__init() self.highpass = {} -- These are not affected by resetParameters() + --- Number of supersampling passes to perform (*default* 8) -- @within Parameters self.supersampling = 8 @@ -879,6 +880,7 @@ function sfxr.Sound:generateSoundData(rate, depth, sounddata) end --- Randomize all sound parameters +-- @within Randomization -- @tparam[opt] number seed a random seed function sfxr.Sound:randomize(seed) if seed then setseed(seed) end @@ -941,9 +943,10 @@ function sfxr.Sound:randomize(seed) end --- Mutate all sound parameters --- @tparam[opt=1] amount by how much to mutate the parameters +-- @within Randomization +-- @tparam[opt=1] number amount by how much to mutate the parameters -- @tparam[opt] number seed a random seed --- @tparam[changefreq=true] bool whether to change the frequency parameters +-- @tparam[changefreq=true] bool changefreq whether to change the frequency parameters function sfxr.Sound:mutate(amount, seed, changefreq) if seed then setseed(seed) end local amount = (amount or 1) @@ -986,7 +989,8 @@ function sfxr.Sound:mutate(amount, seed, changefreq) self:sanitizeParameters() end ---- Randomize all sound parameters to generate an item pick up sound +--- Randomize all sound parameters to generate a "pick up" sound +-- @within Randomization -- @tparam[opt] number seed a random seed function sfxr.Sound:randomPickup(seed) if seed then setseed(seed) end @@ -1004,6 +1008,7 @@ function sfxr.Sound:randomPickup(seed) end --- Randomize all sound parameters to generate a laser sound +-- @within Randomization -- @tparam[opt] number seed a random seed function sfxr.Sound:randomLaser(seed) if seed then setseed(seed) end @@ -1050,6 +1055,7 @@ function sfxr.Sound:randomLaser(seed) end --- Randomize all sound parameters to generate an explosion sound +-- @within Randomization -- @tparam[opt] number seed a random seed function sfxr.Sound:randomExplosion(seed) if seed then setseed(seed) end @@ -1091,7 +1097,8 @@ function sfxr.Sound:randomExplosion(seed) end end ---- Randomize all sound parameters to generate a power up sound +--- Randomize all sound parameters to generate a "power up" sound +-- @within Randomization -- @tparam[opt] number seed a random seed function sfxr.Sound:randomPowerup(seed) if seed then setseed(seed) end @@ -1120,6 +1127,7 @@ function sfxr.Sound:randomPowerup(seed) end --- Randomize all sound parameters to generate a hit sound +-- @within Randomization -- @tparam[opt] number seed a random seed function sfxr.Sound:randomHit(seed) if seed then setseed(seed) end @@ -1144,6 +1152,7 @@ function sfxr.Sound:randomHit(seed) end --- Randomize all sound parameters to generate a jump sound +-- @within Randomization -- @tparam[opt] number seed a random seed function sfxr.Sound:randomJump(seed) if seed then setseed(seed) end @@ -1166,7 +1175,8 @@ function sfxr.Sound:randomJump(seed) end end ---- Randomize all sound parameters to generate a blip sound +--- Randomize all sound parameters to generate a "blip" sound +-- @within Randomization -- @tparam[opt] number seed a random seed function sfxr.Sound:randomBlip(seed) if seed then setseed(seed) end @@ -1185,6 +1195,7 @@ function sfxr.Sound:randomBlip(seed) end --- Generate and export the audio data to a PCM WAVE file. +-- @within SavingLoading -- @tparam ?string|file|love.filesystem.File f a path or file in `wb`-mode -- (passed files will not be closed) -- @tparam[opt=44100] SAMPLERATE rate the sampling rate @@ -1293,6 +1304,7 @@ function sfxr.Sound:exportWAV(f, rate, depth) end --- Save the sound parameters to a file as a Lua table +-- @within SavingLoading -- @tparam ?string|file|love.filesystem.File f a path or file in `w`-mode -- (passed files will not be closed) -- @tparam[opt=true] bool minify whether to minify the output or not @@ -1351,6 +1363,7 @@ function sfxr.Sound:save(f, minify) end --- Load the sound parameters from a file containing a Lua table +-- @within SavingLoading -- @tparam ?string|file|love.filesystem.File f a path or file in `r`-mode -- (passed files will not be closed) -- @raise "incompatible version: x.x.x" @@ -1382,6 +1395,7 @@ function sfxr.Sound:load(f) end --- Save the sound parameters to a file in the sfxr binary format (version 102) +-- @within SavingLoading -- @tparam ?string|file|love.filesystem.File f a path or file in `wb`-mode -- (passed files will not be closed) function sfxr.Sound:saveBinary(f) @@ -1440,6 +1454,7 @@ end --- Load the sound parameters from a file in the sfxr binary format -- (version 100-102) +-- @within SavingLoading -- @tparam ?string|file|love.filesystem.File f a path or file in `rb`-mode -- (passed files will not be closed) -- @raise "incompatible version: x", "unexpected file length"