diff --git a/README.md b/README.md index c60c51d..415b595 100644 --- a/README.md +++ b/README.md @@ -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 | | | | ---------- | -------------- | --------------------------------------------------------------- | @@ -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 | @@ -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** | @@ -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 diff --git a/examples/sequence.yaml b/examples/sequence.yaml index 1972052..047e4b4 100644 --- a/examples/sequence.yaml +++ b/examples/sequence.yaml @@ -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: [] @@ -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 @@ -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 diff --git a/module/sequence.go b/module/sequence.go index 1050fca..a5e90a2 100644 --- a/module/sequence.go +++ b/module/sequence.go @@ -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) }