Skip to content

Commit 2b22b4f

Browse files
committed
Documentation for premake, examples, more on the biquad filters
1 parent 8a8b2da commit 2b22b4f

File tree

7 files changed

+132
-3
lines changed

7 files changed

+132
-3
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,11 @@ build/
1313
*.toc
1414
incoming/
1515
experiments/
16+
doc/*.html
17+
doc/*.tex
18+
doc/*.css
19+
doc/*.pdf
20+
doc/*.mobi
21+
doc/*.epub
22+
bin/audio/
23+
bin/

doc/SoLoud.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@
4343
\include{intro}
4444
\include{legal}
4545
\include{quickstart}
46+
\include{premake}
4647
\include{concepts}
4748
\include{faq}
49+
\include{examples}
4850
\include{basics}
4951
\include{attributes}
5052
\include{faders}

doc/biquadfilter.mmd

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,21 @@ cutoff.
1919
gBQRFilter.setParams(SoLoud::BiquadResonantFilter::LOWPASS, 44100, 500, 2);
2020
// Set the filter as the second filter of the bus
2121
gBus.setFilter(1, &gBQRFilter);
22+
23+
It's also possible to set, fade or oscillate the parameters of a "live" filter
24+
25+
gSoloud.fadeFilterParameter(
26+
gMusicHandle, // Sound handle
27+
0, // First filter
28+
SoLoud::BiquadResonantFilter::FREQUENCY, // What to adjust
29+
2000, // Target value
30+
3); // Time in seconds
31+
32+
Currently, four parameters can be adjusted:
33+
34+
Parameter Description
35+
----------- -------------
36+
SAMPLERATE Filter's samplerate parameter
37+
FREQUENCY Filter's cutoff frequency
38+
RESONANCE Filter's resonance - higher means sharper cutoff
39+
WET Filter's wet signal; 1.0f for fully filtered, 0.0f for original, 0.5f for half and half.

doc/examples.mmd

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Examples
2+
========
3+
4+
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.
5+
6+
simplest
7+
--------
8+
9+
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.
10+
11+
This example also uses SoLoud's cross-platform thread library to sleep while waiting for the sound to end.
12+
13+
multimusic
14+
----------
15+
16+
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:
17+
18+
Key Effect
19+
----- --------
20+
1 Play sound effect at random play speed and pan
21+
2 Fade music 1 in and music 2 out
22+
3 Fade music 2 in and music 1 out
23+
4 Fade music relative play speed way down
24+
5 Fade music relative play speed to normal
25+
26+
piano
27+
-----
28+
29+
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.
30+
31+
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!
32+
33+
mixbusses
34+
---------
35+
36+
The mixbusses example demonstrates the use of mixing busses. You can use "qw", "as" and "zx" keys to adjust volume of different busses.
37+
38+
env
39+
---
40+
41+
The env demo is a non-interactive demo of how SoLoud could be used to play environmental audio.

doc/htmlpre.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
<a href="legal.html">License</a><br>
2323
<a href="downloads.html">Downloads</a><br>
2424
<a href="quickstart.html">Quick Start</a><br>
25+
<a href="premake.html">Premake</a><br>
2526
<a href="concepts.html">Concepts</a><br>
2627
<a href="faq.html">FAQ</a><br>
28+
<a href="examples.html">Examples</a><br>
2729
<br>
2830
<a href="basics.html">Core: Basics</a><br>
2931
<a href="attributes.html">Core: Attributes</a><br>

doc/makedoc.bat

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
@echo off
2-
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
2+
echo ---------------------------------------------------------------------
3+
echo ---------------------------------------------------------------------
4+
echo Generating HTML docs
5+
6+
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
7+
8+
echo ---------------------------------------------------------------------
9+
echo ---------------------------------------------------------------------
10+
echo Generating HTML pages
311

412
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png intro.mmd -o index.html
513
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png legal.mmd -o legal.html
614
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png downloads.mmd -o downloads.html
715
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png quickstart.mmd -o quickstart.html
16+
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png premake.mmd -o premake.html
817
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png concepts.mmd -o concepts.html
918
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png faq.mmd -o faq.html
19+
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png examples.mmd -o examples.html
1020
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png basics.mmd -o basics.html
1121
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png attributes.mmd -o attributes.html
1222
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png faders.mmd -o faders.html
@@ -23,9 +33,22 @@ call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png echofil
2333
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png fftfilter.mmd -o fftfilter.html
2434
call pandoc -B htmlpre.txt -A htmlpost.txt --default-image-extension=png backends.mmd -o backends.html
2535

26-
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
36+
echo ---------------------------------------------------------------------
37+
echo ---------------------------------------------------------------------
38+
echo Generating epub
39+
40+
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
41+
42+
echo ---------------------------------------------------------------------
43+
echo ---------------------------------------------------------------------
44+
echo Generating mobi
45+
2746
kindlegen SoLoud.epub -c2
2847

48+
echo ---------------------------------------------------------------------
49+
echo ---------------------------------------------------------------------
50+
echo Generating latex
51+
2952
call pandoc --listings --default-image-extension=pdf --chapters attributes.mmd -o attributes.tex
3053
call pandoc --listings --default-image-extension=pdf --chapters audiosource.mmd -o audiosource.tex
3154
call pandoc --listings --default-image-extension=pdf --chapters backends.mmd -o backends.tex
@@ -36,18 +59,28 @@ call pandoc --listings --default-image-extension=pdf --chapters coremisc.mmd -o
3659
call pandoc --listings --default-image-extension=pdf --chapters echofilter.mmd -o echofilter.tex
3760
call pandoc --listings --default-image-extension=pdf --chapters faders.mmd -o faders.tex
3861
call pandoc --listings --default-image-extension=pdf --chapters faq.mmd -o faq.tex
62+
call pandoc --listings --default-image-extension=pdf --chapters examples.mmd -o examples.tex
3963
call pandoc --listings --default-image-extension=pdf --chapters fftfilter.mmd -o fftfilter.tex
4064
call pandoc --listings --default-image-extension=pdf --chapters filters.mmd -o filters.tex
4165
call pandoc --listings --default-image-extension=pdf --chapters intro.mmd -o intro.tex
4266
call pandoc --listings --default-image-extension=pdf --chapters legal.mmd -o legal.tex
4367
call pandoc --listings --default-image-extension=pdf --chapters mixbus.mmd -o mixbus.tex
4468
call pandoc --listings --default-image-extension=pdf --chapters newsoundsources.mmd -o newsoundsources.tex
4569
call pandoc --listings --default-image-extension=pdf --chapters quickstart.mmd -o quickstart.tex
70+
call pandoc --listings --default-image-extension=pdf --chapters premake.mmd -o premake.tex
4671
call pandoc --listings --default-image-extension=pdf --chapters speech.mmd -o speech.tex
4772
call pandoc --listings --default-image-extension=pdf --chapters wav.mmd -o wav.tex
4873
call pandoc --listings --default-image-extension=pdf --chapters wavstream.mmd -o wavstream.tex
4974
del *.aux *.toc *.out *.log *.lg *.4ct *.4tc *.idv *.tmp *.xdv *.xref
75+
76+
echo ---------------------------------------------------------------------
77+
echo ---------------------------------------------------------------------
78+
echo Generating pdf
79+
5080
xelatex SoLoud.tex
5181
xelatex SoLoud.tex
52-
echo ---------------
82+
83+
echo ---------------------------------------------------------------------
84+
echo ---------------------------------------------------------------------
85+
echo All done:
5386
echo soloud.pdf soloud.epub soloud.mobi soloud.html + bunch of .html files

doc/premake.mmd

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Premake
2+
=======
3+
4+
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.
5+
6+
Premake can be downloaded from <http://industriousone.com/premake>.
7+
8+
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:
9+
10+
local sdl_root = "/libraries/sdl"
11+
local portmidi_root = "/libraries/portmidi"
12+
local dxsdk_root = "C:/Program Files (x86)/Microsoft ..."
13+
local portaudio_root = "/libraries/portaudio"
14+
local openal_root = "/libraries/openal"
15+
16+
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:
17+
18+
premake4 vs2010
19+
20+
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).
21+
22+
If you wish to use portmidi with the piano example, run premake with an additional parameter:
23+
24+
premake4 --with-portmidi vs2010
25+

0 commit comments

Comments
 (0)