Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
iljarotar committed Jan 18, 2025
1 parent d356298 commit 45dff4b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 21 deletions.
48 changes: 31 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ Run `synth -h` to see all configuration options.

### Data types

| Synth | | |
| ----------- | ----------------- | -------------------------------------------------- |
| **Field** | **Type** | **Description** |
| vol | Float | main volume in range [0,2] |
| out | String [0..*] | names of all modules whose outputs will be audible |
| time | Float | initial time shift in seconds [0,7200] |
| oscillators | Oscillator [0..*] | all oscillators |
| noises | Noise [0..*] | all noise generators |
| wavetables | Wavetables [0..*] | all wavetables |
| samplers | Sampler[0..*] | all samplers |
| Synth | | |
| ----------- | ---------------- | -------------------------------------------------- |
| **Field** | **Type** | **Description** |
| vol | Float | main volume in range [0,2] |
| out | String[0..*] | names of all modules whose outputs will be audible |
| time | Float | initial time shift in seconds [0,7200] |
| oscillators | Oscillator[0..*] | all oscillators |
| noises | Noise[0..*] | all noise generators |
| wavetables | Wavetables[0..*] | all wavetables |
| samplers | Sampler[0..*] | all samplers |

| Oscillator | | |
| ---------- | -------------- | --------------------------------------------------------------- |
Expand Down Expand Up @@ -97,7 +97,7 @@ Run `synth -h` to see all configuration options.
| amp | Input | amplitude in range [0,2] |
| pan | Input | stereo balance in range [-1,1] |
| freq | Input | periods per second [0,20000] |
| table | Float [0..*] | output values |
| table | Float[0..*] | output values |
| filters | String[0..*] | names of the filters to apply |
| envelope | Envelope | envelope to apply; if omitted, wavetable will constantly sound |

Expand All @@ -114,6 +114,20 @@ Run `synth -h` to see all configuration options.

A sampler periodically samples the output values of the given inputs and outputs their sum.

| Sequence | | |
| --------- | -------------- | ------------------------------------------------------------------------------------------------------------------- |
| **Field** | **Type** | **Description** |
| name | String | should be unique in the scope of the file |
| amp | Input | amplitude in range [0,2] |
| pan | Input | stereo balance in range [-1,1] |
| type | OscillatorType | wave form |
| sequence | String[0..*] | a sequence of notes written in [scientific pitch notation](https://en.wikipedia.org/wiki/Scientific_pitch_notation) |
| randomize | Boolean | if true, the notes of the sequence will be played in random order |
| pitch | Float | standard pitch in hz [400,500] |
| transpose | Input | transposition in semitones [-24,24] |
| filters | String[0..*] | names of the filters to apply |
| envelope | Envelope | envelope to apply; if omitted, first note of sequence will constantly sound |

| Filter | | |
| ----------- | -------- | ---------------------------------------------------------- |
| **Field** | **Type** | **Description** |
Expand All @@ -137,12 +151,12 @@ transitioning at the `low-cutoff` frequency. If both cutoff frequencies are defi
| bpm | Input | triggers per minute [0,600000] |
| time-shift | Float | initial time shift |

| Input | | |
| --------- | ------------- | ----------------------------------------------------------------------- |
| **Field** | **Type** | **Description** |
| val | Float | initial value of the respective parameter |
| mod | String [0..*] | names of modulating modules (oscillators, samplers, wavetables, noises) |
| mod-amp | Float | amplitude of the modulation in range [0,1] |
| Input | | |
| --------- | ------------ | ----------------------------------------------------------------------- |
| **Field** | **Type** | **Description** |
| val | Float | initial value of the respective parameter |
| mod | String[0..*] | names of modulating modules (oscillators, samplers, wavetables, noises) |
| mod-amp | Float | amplitude of the modulation in range [0,1] |

## Example patch file

Expand Down
8 changes: 4 additions & 4 deletions examples/sequence.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ oscillators:

sequences:
- name: s1
amp: {val: 0.03}
type: Sawtooth
amp: {val: 0.2}
type: Sine
sequence: [a_4, c_5, b_4, f_4, d_4]
pan: {}
filters: []
Expand All @@ -39,7 +39,7 @@ sequences:
- name: s2
amp: {val: 0.2}
type: Sine
sequence: [a_3, c_4, b_3, f_3, d_3, e_3]
sequence: [a_3, c_4, b_3, f_3, d_3, e_3, g#_3]
pan: {}
filters: []
pitch: 440
Expand All @@ -58,7 +58,7 @@ sequences:
- name: s3
amp: {val: 0.2}
type: Sine
sequence: [a_2, c_3, b_2, f_2, d_2, e_2, g_2]
sequence: [a_2, c_3, b_2, f_2, d_2, e_2]
pan: {}
filters: []
pitch: 440
Expand Down
2 changes: 2 additions & 0 deletions module/sequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ func (s *Sequence) limitParams() {
s.Pan.ModAmp = utils.Limit(s.Pan.ModAmp, panLimits.min, panLimits.max)
s.Pan.Val = utils.Limit(s.Pan.Val, panLimits.min, panLimits.max)

s.Pitch = utils.Limit(s.Pitch, pitchLimits.min, pitchLimits.max)

s.Transpose.ModAmp = utils.Limit(s.Transpose.ModAmp, transposeLimits.min, transposeLimits.max)
s.Transpose.Val = utils.Limit(s.Transpose.Val, transposeLimits.min, transposeLimits.max)
}

0 comments on commit 45dff4b

Please sign in to comment.