Skip to content

Commit

Permalink
Documentation for premake, examples, more on the biquad filters
Browse files Browse the repository at this point in the history
  • Loading branch information
jarikomppa committed Nov 9, 2013
1 parent 8a8b2da commit 2b22b4f
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ build/
*.toc
incoming/
experiments/
doc/*.html
doc/*.tex
doc/*.css
doc/*.pdf
doc/*.mobi
doc/*.epub
bin/audio/
bin/
2 changes: 2 additions & 0 deletions doc/SoLoud.tex
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@
\include{intro}
\include{legal}
\include{quickstart}
\include{premake}
\include{concepts}
\include{faq}
\include{examples}
\include{basics}
\include{attributes}
\include{faders}
Expand Down
18 changes: 18 additions & 0 deletions doc/biquadfilter.mmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,21 @@ cutoff.
gBQRFilter.setParams(SoLoud::BiquadResonantFilter::LOWPASS, 44100, 500, 2);
// Set the filter as the second filter of the bus
gBus.setFilter(1, &gBQRFilter);

It's also possible to set, fade or oscillate the parameters of a "live" filter

gSoloud.fadeFilterParameter(
gMusicHandle, // Sound handle
0, // First filter
SoLoud::BiquadResonantFilter::FREQUENCY, // What to adjust
2000, // Target value
3); // Time in seconds

Currently, four parameters can be adjusted:

Parameter Description
----------- -------------
SAMPLERATE Filter's samplerate parameter
FREQUENCY Filter's cutoff frequency
RESONANCE Filter's resonance - higher means sharper cutoff
WET Filter's wet signal; 1.0f for fully filtered, 0.0f for original, 0.5f for half and half.
41 changes: 41 additions & 0 deletions doc/examples.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Examples
========

SoLoud package comes with a few simple examples. These can be found under the 'demos' directory. Pre-built binaries for Windows can also be found in the 'bin' directory.

simplest
--------

The simplest example initializes SoLoud with winmm (for windows) or portaudio (otherwise), and uses the speech synthesizer to play some sound. Once the sound has finished, the application cleans up and quits.

This example also uses SoLoud's cross-platform thread library to sleep while waiting for the sound to end.

multimusic
----------

The multimusic example loads two OGG music loops as well as one sound effect. You can use the keyboard keys 1 through 5 for various effects:

Key Effect
----- --------
1 Play sound effect at random play speed and pan
2 Fade music 1 in and music 2 out
3 Fade music 2 in and music 1 out
4 Fade music relative play speed way down
5 Fade music relative play speed to normal

piano
-----

This example is a simple implementation of a playable instrument. The example also includes a simple waveform generator (soloud_basicwave.cpp/h), which can produce square, saw, sine and triangle waves. If compiled to use portmidi, you can also use a midi keyboard to drive the example.

The 1234.. and qwer.. rows of your keyboard can be used to play notes. asdf.. row selects waveform, and zxcv.. row selects filters. Speech synthesizer and on-screen text describes what different keys do. Have fun experimenting!

mixbusses
---------

The mixbusses example demonstrates the use of mixing busses. You can use "qw", "as" and "zx" keys to adjust volume of different busses.

env
---

The env demo is a non-interactive demo of how SoLoud could be used to play environmental audio.
2 changes: 2 additions & 0 deletions doc/htmlpre.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
<a href="legal.html">License</a><br>
<a href="downloads.html">Downloads</a><br>
<a href="quickstart.html">Quick Start</a><br>
<a href="premake.html">Premake</a><br>
<a href="concepts.html">Concepts</a><br>
<a href="faq.html">FAQ</a><br>
<a href="examples.html">Examples</a><br>
<br>
<a href="basics.html">Core: Basics</a><br>
<a href="attributes.html">Core: Attributes</a><br>
Expand Down
39 changes: 36 additions & 3 deletions doc/makedoc.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
@echo off
call pandoc -s --toc --default-image-extension=png -o soloud.html intro.mmd legal.mmd quickstart.mmd concepts.mmd faq.mmd basics.mmd attributes.mmd faders.mmd coremisc.mmd audiosource.mmd wav.mmd wavstream.mmd speech.mmd newsoundsources.mmd mixbus.mmd filters.mmd biquadfilter.mmd echofilter.mmd fftfilter.mmd backends.mmd
echo ---------------------------------------------------------------------
echo ---------------------------------------------------------------------
echo Generating HTML docs

call pandoc -s --toc --default-image-extension=png -o soloud.html intro.mmd legal.mmd quickstart.mmd premake.mmd concepts.mmd faq.mmd examples.mmd basics.mmd attributes.mmd faders.mmd coremisc.mmd audiosource.mmd wav.mmd wavstream.mmd speech.mmd newsoundsources.mmd mixbus.mmd filters.mmd biquadfilter.mmd echofilter.mmd fftfilter.mmd backends.mmd

echo ---------------------------------------------------------------------
echo ---------------------------------------------------------------------
echo Generating HTML pages

call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png intro.mmd -o index.html
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png legal.mmd -o legal.html
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png downloads.mmd -o downloads.html
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png quickstart.mmd -o quickstart.html
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png premake.mmd -o premake.html
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png concepts.mmd -o concepts.html
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png faq.mmd -o faq.html
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png examples.mmd -o examples.html
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png basics.mmd -o basics.html
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png attributes.mmd -o attributes.html
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png faders.mmd -o faders.html
Expand All @@ -23,9 +33,22 @@ call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png echofil
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png fftfilter.mmd -o fftfilter.html
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png backends.mmd -o backends.html

call pandoc -N --toc --epub-cover-image=images/cover.png -t epub3 --default-image-extension=png -S --epub-stylesheet=epub.css --epub-metadata=metadata.xml -o SoLoud.epub title.txt intro.mmd legal.mmd quickstart.mmd concepts.mmd faq.mmd basics.mmd attributes.mmd faders.mmd coremisc.mmd audiosource.mmd wav.mmd wavstream.mmd speech.mmd newsoundsources.mmd mixbus.mmd filters.mmd biquadfilter.mmd echofilter.mmd fftfilter.mmd backends.mmd
echo ---------------------------------------------------------------------
echo ---------------------------------------------------------------------
echo Generating epub

call pandoc -N --toc --epub-cover-image=images/cover.png -t epub3 --default-image-extension=png -S --epub-stylesheet=epub.css --epub-metadata=metadata.xml -o SoLoud.epub title.txt intro.mmd legal.mmd quickstart.mmd premake.mmd concepts.mmd faq.mmd examples.mmd basics.mmd attributes.mmd faders.mmd coremisc.mmd audiosource.mmd wav.mmd wavstream.mmd speech.mmd newsoundsources.mmd mixbus.mmd filters.mmd biquadfilter.mmd echofilter.mmd fftfilter.mmd backends.mmd

echo ---------------------------------------------------------------------
echo ---------------------------------------------------------------------
echo Generating mobi

kindlegen SoLoud.epub -c2

echo ---------------------------------------------------------------------
echo ---------------------------------------------------------------------
echo Generating latex

call pandoc --listings --default-image-extension=pdf --chapters attributes.mmd -o attributes.tex
call pandoc --listings --default-image-extension=pdf --chapters audiosource.mmd -o audiosource.tex
call pandoc --listings --default-image-extension=pdf --chapters backends.mmd -o backends.tex
Expand All @@ -36,18 +59,28 @@ call pandoc --listings --default-image-extension=pdf --chapters coremisc.mmd -o
call pandoc --listings --default-image-extension=pdf --chapters echofilter.mmd -o echofilter.tex
call pandoc --listings --default-image-extension=pdf --chapters faders.mmd -o faders.tex
call pandoc --listings --default-image-extension=pdf --chapters faq.mmd -o faq.tex
call pandoc --listings --default-image-extension=pdf --chapters examples.mmd -o examples.tex
call pandoc --listings --default-image-extension=pdf --chapters fftfilter.mmd -o fftfilter.tex
call pandoc --listings --default-image-extension=pdf --chapters filters.mmd -o filters.tex
call pandoc --listings --default-image-extension=pdf --chapters intro.mmd -o intro.tex
call pandoc --listings --default-image-extension=pdf --chapters legal.mmd -o legal.tex
call pandoc --listings --default-image-extension=pdf --chapters mixbus.mmd -o mixbus.tex
call pandoc --listings --default-image-extension=pdf --chapters newsoundsources.mmd -o newsoundsources.tex
call pandoc --listings --default-image-extension=pdf --chapters quickstart.mmd -o quickstart.tex
call pandoc --listings --default-image-extension=pdf --chapters premake.mmd -o premake.tex
call pandoc --listings --default-image-extension=pdf --chapters speech.mmd -o speech.tex
call pandoc --listings --default-image-extension=pdf --chapters wav.mmd -o wav.tex
call pandoc --listings --default-image-extension=pdf --chapters wavstream.mmd -o wavstream.tex
del *.aux *.toc *.out *.log *.lg *.4ct *.4tc *.idv *.tmp *.xdv *.xref

echo ---------------------------------------------------------------------
echo ---------------------------------------------------------------------
echo Generating pdf

xelatex SoLoud.tex
xelatex SoLoud.tex
echo ---------------

echo ---------------------------------------------------------------------
echo ---------------------------------------------------------------------
echo All done:
echo soloud.pdf soloud.epub soloud.mobi soloud.html + bunch of .html files
25 changes: 25 additions & 0 deletions doc/premake.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Premake
=======

SoLoud comes with a premake4 script. If you want to build SoLoud as static library, instead of including the source files in your project, this can be handy.

Premake can be downloaded from <http://industriousone.com/premake>.

Unfortunately, premake4 cannot magically figure out where your libraries may be installed, so you may have to edit the premake4.lua file. The lines to edit can be found at the very beginning of the file, with the following defaults:

local sdl_root = "/libraries/sdl"
local portmidi_root = "/libraries/portmidi"
local dxsdk_root = "C:/Program Files (x86)/Microsoft ..."
local portaudio_root = "/libraries/portaudio"
local openal_root = "/libraries/openal"

You will most likely want to edit at least the sdl_root variable. After your edits, you can run premake4 to generate makefiles or the IDE project files of your preference, such as:

premake4 vs2010

The current version (4.3) supports codeblocks, codelite, vs2002, vs2003, vs2005, vs2008, vs2010, xcode3 and gnu makefiles (gmake). New version with at least vs2012 support is coming soon (as of this writing).

If you wish to use portmidi with the piano example, run premake with an additional parameter:

premake4 --with-portmidi vs2010

0 comments on commit 2b22b4f

Please sign in to comment.