Skip to content

Commit

Permalink
docs overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
charlieroberts committed Feb 16, 2016
1 parent cbd58b6 commit 9ce11e2
Show file tree
Hide file tree
Showing 32 changed files with 880 additions and 42 deletions.
7 changes: 6 additions & 1 deletion docs/documentation.js
Expand Up @@ -16,6 +16,7 @@ list = [
'audio/triangle',
'audio/square',
'audio/sampler',
'audio/soundfont',
'audio/pwm',
'audio/noise',
'audio/saw',
Expand Down Expand Up @@ -71,7 +72,11 @@ list = [
'interface/keyboard',
'interface/accelerometer',
'interface/orientation',
'interface/patchbay',
'interface/patchbay',

'sequencing/arp',
'sequencing/pattern',
'sequencing/seq'

]

Expand Down
26 changes: 26 additions & 0 deletions docs/input/audio/bus.md
@@ -0,0 +1,26 @@
#Bus

A audio bus for routing FX, or controlling amplitude and panning.

```
drums = EDrums('x*ox*xo')
bus1 = Bus().fx.add( Schizo() )
bus1.pan = 1
bus2 = Bus().fx.add( Delay({ bitDepth:3 }) )
bus2.pan.seq( [-1,0,1], 1 )
drums.send( bus1, .5 )
drums.send( bus2, .5 )
```

## Properties

* _amp_ : Float. Default range: { .0, 1 }. Default value: 1. Gain on the bus signal.
* _pan_ : Float range: { -1, 1 }. Default: 0. Position of the bus in the stereo spectrum.
* _fx_ : Array. You can `add` or `remove` fx from the bus using this array.

## Methods

None worth mentioning.
6 changes: 4 additions & 2 deletions docs/input/audio/drums.md
Expand Up @@ -12,7 +12,7 @@ Drums objects are basically hybrid sequencers / unit generators; this means that

There are a few different drum kits that come with Gibber (with hopefully more to follow). The kits are electronic (the default), original and beatbox. The example below shows how to load a different than the default electronic one.

Finally, note that each individual sound is actually an instance of the Gibber Sampler object. This means you can add effects to the individual sounds in addition to the kit as a whole.
Finally, note that each individual sound is actually an instance of the Gibber [Sampler][sampler] object. This means you can add effects to the individual sounds in addition to the kit as a whole.

Example:
```
Expand Down Expand Up @@ -44,4 +44,6 @@ c = Drums({
* _note_( Float:frequency, Float:amp(optional) ) : This method tells the drum kit to play a single note.
* _play_( Array:frequencies, Array:durations ) : This method accepts arrays of frequencies and durations as arguments to create and start a sequencer targeting the oscillator.
* _stop_() : This method stops the sequencer that is built into the oscillator if it has been started.
* _kill_() : Disconnect the Drums from whatever bus it is connected to.
* _kill_() : Disconnect the Drums from whatever bus it is connected to.

[sampler]: javascript:Gibber.Environment.Docs.openFile('audio','sampler')
47 changes: 47 additions & 0 deletions docs/input/audio/edrums.md
@@ -0,0 +1,47 @@
#EDrums

A synthesized drum kit, carefully designed to simulate a Roland TR-808 drum machine, with an attached sequencer for quick beat construction. The first
argument to the constructor allows you to easily define beats using the following syntax:

* x : kick drum hit
* o : snare drum hit
* \* : close hihat
* \- : open hihat
* . : rest

EDrums are basically hybrid sequencers / unit generators; this means that you can call most unit generator methods,
( such as drums.fx.add() ) as well as some sequencer methods ( such as xox.stop() and xox.start() ). By default, the constructor
assumes that you want each note in your sequence to have a duration equal to one divided by the number of notes you specify. For example, if you
specify a four-note sequence the XOX sequencer will assume you want each note to be a quarter note in duration. You can also specify a duration
explicitly as a second parameter to the constructor.

Unlike the Drums object, each sound in the XOX object is a synthesis unit generator. The parameters for each ugen are different. Basically the XOX
consists of a Bus object that the individual synthesizers are attached to, and a sequencer to control them.

Example:
```
a = EDrums( 'xoxo' ) // each note is a quarter note in duration
a.fx.add( Delay( 1/64) )
a.snare.snappy = 1.5
b = EDrums( '***-', 1/8 ) // each note is an eighth note
b.hat.fx.add( Distortion() )
b.kick.decay = 1
b.seq.note = 'xoxx**-o'
```

## Properties
* _amp_ : Float. default range { 0, 1 }. default value: 1.
* _pan_: Float. Default range { -1, 1 }. Default value: 0. The position in the stereo spectrum of the Synth output.
* _kick_: Ugen. The kick drum unit generator.
* _snare_: Ugen. The snare drum unit generator.
* _hat_: Ugen. The hihat unit generator.
* _seq_: Sequencer. The built-in Seq object.

## Methods

* _note_( Float:frequency, Float:amp(optional) ) : This method tells the drum kit to play a single note.
* _play_( Array:frequencies, Array:durations ) : This method accepts arrays of frequencies and durations as arguments to create and start a sequencer targeting the oscillator.
* _stop_() : This method stops the sequencer that is built into the oscillator if it has been started.
* _kill_() : Disconnect the Drums from whatever bus it is connected to.
173 changes: 173 additions & 0 deletions docs/input/audio/soundfont.md
@@ -0,0 +1,173 @@
#SoundFont

Sampled-based instruments that follow the SoundFont 2 specification. The samples for SoundFonts are loaded whenever they are first instantiated and then cached for other instances. E.g. the first time you run `a = SoundFont('piano')` all the acoustic piano samples will be downloaded; if `b = SoundFont('piano')` is subsequently run the samples will not have to be loaded again as the cached data will be used.

At the end of this reference is a list of General MIDI sounds for valid instruments that the SoundFont object supports. In addition, Gibber comes with shorthand for several soundbanks:

acoustic_grand_piano = piano
electric_guitar_clean = guitar
acoustic_bass = bass
rock_organ = organ
synth_brass_1 = brass
synth_strings_1 = strings
choir_aahs = choir

Example:
```
a = SoundFont( 'piano' )
a.note.seq( [0,1,2,3],1/8 )
b = SoundFont( 'kalimba' )
b.note.seq( [14,15,16,17], 1/2 )
```

## Properties

* _amp_ : Float. Default range: { 0, 1 }. Default value: 1.

* _loudness_ : Float. Determines the amplitude of individual notes, while `amp` affects all output. For example:
```
a = SoundFont('piano')
.note.seq( Rndi(0,14), 1/8 )
.loudness.seq( Rndf() )
```
In the above example, each note will be played at a different loudness. The value of `loudness` represents a scalar with a linear output curve that the note output is multiplied by.

* _pan_ : Float. Default range { -1, 1 }. Default value: 0. The position in the stereo spectrum for output.

## Methods

* _note_( Float:pitch, Float:loudness ): Begin playback at the position determined by the start property at a rate determine by the pitch argument and at a provided loudness.

* _kill_() : Disconnect the oscillator from whatever bus it is connected to.

## Complete Sound List

accordion
acoustic_bass
acoustic_grand_piano
acoustic_guitar_nylon
acoustic_guitar_steel
agogo
alto_sax
applause
bagpipe
banjo
baritone_sax
bassoon
bird_tweet
blown_bottle
brass_section
breath_noise
bright_acoustic_piano
celesta
cello
choir_aahs
church_organ
clarinet
clavinet
contrabass
distortion_guitar
drawbar_organ
dulcimer
electric_bass_finger
electric_bass_pick
electric_grand_piano
electric_guitar_clean
electric_guitar_jazz
electric_guitar_muted
electric_piano_1
electric_piano_2
english_horn
fiddle
flute
french_horn
fretless_bass
fx_1_rain
fx_2_soundtrack
fx_3_crystal
fx_4_atmosphere
fx_5_brightness
fx_6_goblins
fx_7_echoes
fx_8_scifi
glockenspiel
guitar_fret_noise
guitar_harmonics
gunshot
harmonica
harpsichord
helicopter
honkytonk_piano
kalimba
koto
lead_1_square
lead_2_sawtooth
lead_3_calliope
lead_4_chiff
lead_5_charang
lead_6_voice
lead_7_fifths
lead_8_bass__lead
marimba
melodic_tom
music_box
muted_trumpet
oboe
ocarina
orchestra_hit
orchestral_harp
overdriven_guitar
pad_1_new_age
pad_2_warm
pad_3_polysynth
pad_4_choir
pad_5_bowed
pad_6_metallic
pad_7_halo
pad_8_sweep
pan_flute
percussive_organ
piccolo
pizzicato_strings
recorder
reed_organ
reverse_cymbal
rock_organ
seashore
shakuhachi
shamisen
shanai
sitar
slap_bass_1
slap_bass_2
soprano_sax
steel_drums
string_ensemble_1
string_ensemble_2
synth_bass_1
synth_bass_2
synth_brass_1
synth_brass_2
synth_choir
synth_drum
synth_strings_1
synth_strings_2
taiko_drum
tango_accordion
telephone_ring
tenor_sax
timpani
tinkle_bell
tremolo_strings
trombone
trumpet
tuba
tubular_bells
vibraphone
viola
violin
voice_oohs
whistle
woodblock
xylophone
16 changes: 16 additions & 0 deletions docs/input/math/abs.md
@@ -0,0 +1,16 @@
#Abs

Take the absolute value of a unit generator's output (or a number) on a per-sample basis.

In the example below, note that the frequency only travels above the default pitch of the sine oscillator (440 Hz).
```
sine = Sine()
mod = Sine( .5, 50 )._ // disconnect!
sine.frequency = Add( 440, Abs( mod ) )
```

## Properties

* _0_ : Float or Ugen. The first operand passed to the constructor.
18 changes: 18 additions & 0 deletions docs/input/math/add.md
@@ -0,0 +1,18 @@
#Add

A simple unit generator to add multiple values together on a per-sample basis, primarily for use in modulation. `Add` has a constructor that accepts two values.

Example:
```
drums = EDrums('x*o*x*o-')
mod = Sine( 12, .5 )._
add = Add( .5, mod )
drums.amp = add
```

## Properties

* _0_ : Float or Ugen. The first operand passed to the constructor.
* _1_ : Float or Ugen. The second operand passed to the constructor.
24 changes: 24 additions & 0 deletions docs/input/math/clamp.md
@@ -0,0 +1,24 @@
#Clamp

Clamp the output of a ugen to a range of values.

In the example below, the `clamp` ugen acts as a half-wave rectifier.
```
sine = Sine()
mod = Sine( .5, 250 )._ // disconnect!
clamp = Clamp( mod, 0, mod.amp )
sine.frequency = Add( 440, clamp )
```

## Properties

* _input_ : Ugen. The signal that will be clamped.
* _min_ : Float or Ugen. Define the minimum boundary for clamping.
* _max_ : Float or Ugen. Define the maximum boundary for clamping.

Note that math ugens do not automatically connect to the master graph as they are
typically used for modulation. You have to explicitly call `clamp.connect()` if you
want to connect the output directly to a bus.
8 changes: 8 additions & 0 deletions docs/input/math/div.md
@@ -0,0 +1,8 @@
#Div

A simple unit generator to divide a pair of values on a per-sample basis, primarily for use in modulation. `Div` has a constructor that accepts two values.

## Properties

* _0_ : Float or Ugen. The first operand passed to the constructor.
* _1_ : Float or Ugen. The second operand passed to the constructor.
8 changes: 8 additions & 0 deletions docs/input/math/mod.md
@@ -0,0 +1,8 @@
#Mod

A simple unit generator that calculates the modulus of a pair of values on a per-sample basis. `Mod` has a constructor that accepts two values.

## Properties

* _0_ : Float or Ugen. The first operand passed to the constructor.
* _1_ : Float or Ugen. The second operand passed to the constructor.
20 changes: 20 additions & 0 deletions docs/input/math/mul.md
@@ -0,0 +1,20 @@
#Mul

A simple unit generator to multiple multiple values together on a per-sample basis, primarily for use in modulation. `Mul` has a constructor that accepts two values.

Simple ring modulation:
```
sine = Sine()
sine.frequency.seq( Rndi(220,880), 1/4 )
mod = Sine( 220, 1 )._
mul = Mul( sine, mod )
mul.connect()
```

## Properties

* _0_ : Float or Ugen. The first operand passed to the constructor.
* _1_ : Float or Ugen. The second operand passed to the constructor.

0 comments on commit 9ce11e2

Please sign in to comment.