Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
233 commits
Select commit Hold shift + click to select a range
1833e1e
Canvas for a new FixMath paradigm
tomcombriat Nov 12, 2023
bcd202e
Added initial constructors (untested) for FixMath2
tomcombriat Nov 13, 2023
cb2ee4f
Fixed usage of IntegerType
tomcombriat Nov 13, 2023
5f4ad47
BugFix for conversion to/from float. More readable
tomcombriat Nov 14, 2023
69388cd
Multiplication overload of FixMath2
tomcombriat Nov 14, 2023
48f827f
Small optimisation on const
tomcombriat Nov 14, 2023
c3466d1
Fixed multiplication, doc
tomcombriat Nov 14, 2023
7377cdc
Switched to multiply returns compound fix type
tomcombriat Nov 15, 2023
9f2718e
Cleaning
tomcombriat Nov 15, 2023
fdeb17a
Fixed compiler warning
tomcombriat Nov 15, 2023
1f278c3
Added division, untested
tomcombriat Nov 16, 2023
49e857d
Cleared syntax. Added mul for other types
tomcombriat Nov 17, 2023
8681b64
Added reverse multiplication overloading
tomcombriat Nov 17, 2023
9a4d04c
Forgot a template
tomcombriat Nov 17, 2023
6275ada
Added reverse mul to UFixMath2
tomcombriat Nov 18, 2023
da90442
Added shift operators
tomcombriat Nov 18, 2023
bb95183
Implemented main functions for Signed Fix type
tomcombriat Nov 18, 2023
3684b7a
Implemented SFixMath2, and mul between UFix and SFix
tomcombriat Nov 18, 2023
67e227c
Added overloads for add and sub between UFix
tomcombriat Nov 18, 2023
385f033
Added sub/add between SFix
tomcombriat Nov 18, 2023
a74d663
Addition and subtraction between all
tomcombriat Nov 19, 2023
7349ac4
Fix sub (this one is not symetric). Added neg of fixed types
tomcombriat Nov 19, 2023
b6ae357
Small cleanup
tomcombriat Nov 19, 2023
f51bb38
Corrected shifts
tomcombriat Nov 19, 2023
807c69d
Added safe (and optimizing to lower type) shiftsP
tomcombriat Nov 19, 2023
b4e0bee
Documentation
tomcombriat Nov 20, 2023
6f3256e
Corrected wrong algebra for add and sub between UFix and SFix
tomcombriat Nov 25, 2023
659da6a
Changed way of counting bits for UFixMath. Added simplifying macros
tomcombriat Nov 26, 2023
f267ff4
Small fix on conversion from UF to SF. Documentation
tomcombriat Nov 26, 2023
2d12770
Renamming to FixMath
tomcombriat Dec 18, 2023
735da56
Implemented midi functions for UFixMath
tomcombriat Dec 18, 2023
11545dd
Implemented mozzi_midi for FixMath
tomcombriat Dec 19, 2023
3f09ded
Implemented setFreq and phMod for Oscil using FixMath
tomcombriat Dec 19, 2023
0c495eb
Added template for signed FixMath to Oscil setFreq
tomcombriat Dec 19, 2023
862954f
Fixed mozzi_midi.h with FixMath
tomcombriat Dec 24, 2023
9f43c81
Added comparison between FixMath
tomcombriat Dec 24, 2023
47e028c
Merge branch 'devel/midiInHeader' into devel/FixMath2
tomcombriat Dec 24, 2023
434cd2b
Merge branch 'devel/midiInHeader' into devel/FixMath2
tomcombriat Dec 26, 2023
1d6f87b
Add a multi-complation-unit example
tfry-git Jan 3, 2024
30cb150
Start config rework
tfry-git Nov 13, 2023
819c314
Finish "outline" for config options (generic, and AVR, only for now)
tfry-git Nov 13, 2023
3c17865
Start obsoleted files
tfry-git Nov 13, 2023
b1c1e9d
Start moving MozziGuts over the the new config.
tfry-git Nov 13, 2023
f5c9e92
Fix a first round of bugs
tfry-git Nov 13, 2023
5d3a611
Sinewave compiles on AVR with reworked config
tfry-git Nov 14, 2023
dbdfcf1
Fix typos in defines
tfry-git Nov 14, 2023
1264033
Also compiles for ESP32, now, in default config.
tfry-git Nov 14, 2023
a7cdf79
Temporarily bring back mozzi_config.h to allow intermediate testing
tfry-git Nov 14, 2023
9795991
Allow to disable analog read code on AVR
tfry-git Nov 15, 2023
a23ae22
Compiles on ESP8266
tfry-git Nov 15, 2023
4a96033
Document output modes & options for all remaining architectures
tfry-git Nov 15, 2023
2cd4316
STM32duino compiles
tfry-git Nov 16, 2023
a2177f7
STM32 (maple) compiles
tfry-git Nov 17, 2023
de0d961
MBED compiles
tfry-git Nov 17, 2023
503f819
Renesas compiles
tfry-git Nov 17, 2023
3234efa
Compiles on Teensy 3.1/4.0
tfry-git Nov 18, 2023
727a14b
SAMD compiles
tfry-git Nov 18, 2023
6da50a6
RP2040 compiles
tfry-git Nov 18, 2023
13daab6
Start reorganizing port documentation
tfry-git Nov 18, 2023
1c4567f
De-duplicate documentation
tfry-git Nov 19, 2023
7d3d3d1
Add some configuration examples
tfry-git Nov 19, 2023
34478cf
Documentation corrections and clarifcations
tfry-git Nov 19, 2023
40ee79f
Clean up some outdated comments
tfry-git Nov 19, 2023
59f83cd
Fixed RP2040 documentation and I2S, added config option for RP2040
tomcombriat Nov 22, 2023
a39e5dc
Clarification and corrected MOZZI_AUDIO_BITS for external config
tomcombriat Nov 26, 2023
435855d
Fix AudioExternal for giga
tomcombriat Nov 28, 2023
d5976e8
Fix of mozziAnalogRead for Renesas
tomcombriat Nov 29, 2023
222cda9
Fix /* in comment
tfry-git Jan 1, 2024
aa32d00
Fix mixup of PDM and PWM
tfry-git Jan 1, 2024
da0b028
Corrected important type for STM32 (Maple core)
tomcombriat Jan 3, 2024
1b01ad7
Merge branch 'master' into devel/Mozzi2
tfry-git Jan 3, 2024
dc2428f
Start reducing number of compilation units (trivial cases, first)
tfry-git Jan 4, 2024
2fa17a4
Move auto random seeding to hardware specific implementation files
tfry-git Jan 4, 2024
74d2814
Move the remaining bits of mozzi_rand.cpp to other locations
tfry-git Jan 4, 2024
1856897
Restore the plain "int" overloads to rand().
tfry-git Jan 4, 2024
51ae09a
MozziGuts implementation is now included from MozziGuts.h (most impor…
tfry-git Jan 4, 2024
fec5394
Add - yet unused - macros for deprecation
tfry-git Jan 5, 2024
c9fcfd8
Move private headers to "internal", document that.
tfry-git Jan 5, 2024
ee4efe3
Include Mozzi.h/MozziHeadersOnly.h instead of MozziGuts.h, everywhere
tfry-git Jan 5, 2024
832cf3a
Remove TimerZero-utility-lib, which is no longer used since quite som…
tfry-git Jan 5, 2024
5e61065
Bye bye mozzi_config.h, hello inline configuration!
tfry-git Jan 5, 2024
6b4c2c9
Trick doxygen into showing more of the existing documentation.
tfry-git Jan 5, 2024
c04b188
Merge branch 'devel/Mozzi2' into devel/single_compilation_unit
tfry-git Jan 5, 2024
f0bdae2
Bring back the groups that doxygen (1.9?) has dropped
tfry-git Jan 5, 2024
c9d7c2b
Convert external audio examples to in-line config
tfry-git Jan 5, 2024
0eb96c6
Convert HIFI examples to in-line configuration
tfry-git Jan 5, 2024
373daf8
Allow compilation of unsupported HIFI and STEREO examples to pass in …
tfry-git Jan 5, 2024
9d64122
Fix HIFI compilation of STM32duino core
tfry-git Jan 5, 2024
27392d8
Implemented some inverse functions. Not as straight-forward as it seems
tomcombriat Jan 11, 2024
b12d5db
Fix copyright info
tfry-git Jan 14, 2024
353f91a
Fix typo
tfry-git Jan 14, 2024
48f0e8d
Fixed One definition rule for FixMath
tomcombriat Jan 14, 2024
937865d
Made MAX macro safer
tomcombriat Jan 14, 2024
77c6132
Added inverse functions to SFixMath
tomcombriat Jan 14, 2024
6cdc837
Switch onesbit to constexpr
tomcombriat Jan 16, 2024
7252b2a
Changed all inverses to constexpr, gain of 40%
tomcombriat Jan 16, 2024
6847f66
Merge branch 'devel/Mozzi2' into devel/FixMath2
tfry-git Jan 21, 2024
8b9c8dc
Added constexpr as replacements of macros, but not sure it is better
tomcombriat Jan 21, 2024
358a45b
Bugfix in SFixMath::fromRaw
tomcombriat Jan 21, 2024
7cdebee
Moved Vibrato example to FixMath
tomcombriat Jan 21, 2024
267b69b
Moved S/Ubitstobyte to constexpr
tomcombriat Jan 21, 2024
89ddc91
Added a Vibrato example fully using FixMath
tomcombriat Jan 23, 2024
fa0b9e4
Merge branch 'master' into devel/Mozzi2
tfry-git Jan 27, 2024
ab9fbb5
Merge branch 'devel/Mozzi2' into devel/FixMath2
tomcombriat Jan 27, 2024
d3f9702
Fixed merge bug with midi_table
tomcombriat Jan 27, 2024
ca533d2
Fix logic around MOZZI_OUTPUT_EXTERNAL_CUSTOM
tfry-git Jan 28, 2024
9d7ec25
Fix compilation
tfry-git Jan 28, 2024
dc5bf31
Add explanation
tfry-git Jan 28, 2024
aa90380
Added a more general inv member for FixMath, reimplemanted
tomcombriat Jan 29, 2024
cd805d5
Added auto constructors to pure fractionnal and pure integer for U/SFIX
tomcombriat Jan 29, 2024
0f1a313
Starting implementing auto Range promotion for FixMath
tomcombriat Feb 1, 2024
7b4e6a0
Addition between UFix now does not promote when not needed.
tomcombriat Feb 1, 2024
19445af
Autoranging of subtraction with UFixMath
tomcombriat Feb 1, 2024
0204f8c
Added RANGE to mul between UFix
tomcombriat Feb 3, 2024
dcd0057
Fix compilation on ESP32
tfry-git Feb 4, 2024
5e38d90
Add bluetooth output example (only for ESP32, for the time being)
tfry-git Feb 4, 2024
ca96033
UFix correct automatic add
tomcombriat Feb 4, 2024
dae84b7
Converted template type to int8_t for FixMath, corrected safe shifts
tomcombriat Feb 4, 2024
2ac4361
Fixed compilator errors for UFix
tomcombriat Feb 4, 2024
0407b27
Correct add and sub for SFixMath
tomcombriat Feb 4, 2024
c42ce35
Mul, shifts and inv with Range for SFix
tomcombriat Feb 5, 2024
e822946
Added mixed add (S/U) with Range
tomcombriat Feb 5, 2024
ed35b62
Added cross ADD and SUB
tomcombriat Feb 5, 2024
c038c78
Fixed cross MUL, cleanup
tomcombriat Feb 5, 2024
aee4ff2
Cleanup
tomcombriat Feb 5, 2024
19de8a5
Removed unsafe function to std SFixMath (activate with #define
tomcombriat Feb 5, 2024
0fb44fb
Small optimization of UFULLRANGE macro (overflow one step later)
tomcombriat Feb 5, 2024
a99b574
Fixed cross construction of FixMath types
tomcombriat Feb 5, 2024
15aeeb4
Added cross converters for S/UFix
tomcombriat Feb 7, 2024
53841b6
Replaced all macro with constexpr in FixMath
tomcombriat Feb 7, 2024
67e39bf
Fixed conflicting Macros/constexpr for some platforms
tomcombriat Feb 7, 2024
fb2ae79
Documentation - cleanup
tomcombriat Feb 10, 2024
9bfe864
Merge pull request #233 from tomcombriat/FixMathAutoRange
tomcombriat Feb 10, 2024
7c58116
Documentation
tomcombriat Feb 10, 2024
05fec8a
Merge branch 'FixMathAutoRange' into devel/FixMath2
tomcombriat Feb 10, 2024
4f97ef0
Added more const to FixMath, small dox fix and typos
tomcombriat Feb 11, 2024
a882cf2
U/SFixMath -> U/SFix
tomcombriat Feb 11, 2024
e5711b5
Adapted Oscil to FixMath (template for phmod, naming)
tomcombriat Feb 11, 2024
c0bed9a
Adapted mozzi_midi to new FixMath naming
tomcombriat Feb 11, 2024
3df5bf1
Updated examples using FixMath
tomcombriat Feb 11, 2024
aff5819
BugFix with template argument of FixMath
tomcombriat Feb 11, 2024
3ecd0ff
Remove STEREO_HACK
tfry-git Jan 27, 2024
74a4fd1
Compilation fix for ESP8266
tfry-git Jan 27, 2024
9d38f3e
Partial revert to counter flash usage increas
tfry-git Jan 27, 2024
58488e3
Replace some defines with constexpr functions.
tfry-git Jan 27, 2024
911ee49
CONTROL_RATE -> MOZZI_CONTROL_RATE
tfry-git Jan 28, 2024
424e9a1
Enable warnings report (sounds useful)
tfry-git Jan 28, 2024
2e72b35
Add warning, when defining CONTROL_RATE
tfry-git Jan 29, 2024
6fd5290
AUDIO_RATE -> MOZZI_AUDIO_RATE
tfry-git Jan 29, 2024
0f31419
Fix overflow warning
tfry-git Feb 3, 2024
9bbddaf
De-duplicate some info
tfry-git Feb 3, 2024
c403489
Next step in decomissioning plain int return values for updateAudio().
tfry-git Feb 4, 2024
a3cb043
Do not encourage non-power-of-two MOZZI_CONTROL_RATE settings in exam…
tfry-git Feb 8, 2024
7cad50d
Mass remove legacy inclusion of WProgram.h
tfry-git Feb 13, 2024
ae47538
Add teensy 3 auto-build
tfry-git Feb 14, 2024
f3c13b0
Add Teensy 4.1 and Arduino Mega builds
tfry-git Feb 14, 2024
5166c0d
Try again updating checkout action
tfry-git Feb 14, 2024
3784ade
Fix portamento example
tomcombriat Feb 15, 2024
e2bd688
Merge branch 'devel/Mozzi2' into devel/FixMath2
tomcombriat Feb 15, 2024
285795e
Added specializations to Line for U/SFix
tomcombriat Feb 18, 2024
59b1778
Added U/SFix specialization to Smooth.h
tomcombriat Feb 18, 2024
ebca5ab
Added an example of FM synthesis with FixMath
tomcombriat Feb 19, 2024
9e1c4ad
Removed volatile in Line.h
tomcombriat Feb 19, 2024
8d69afc
Made a more specific template in Oscil for FixMath
tomcombriat Feb 24, 2024
5f2f36e
Added Difference_Tone adapted to FixMath
tomcombriat Feb 24, 2024
a90b93d
Removed FixMath from Mozzi's sources
tomcombriat Feb 25, 2024
cab6c30
Added FixMath to gh actions
tomcombriat Feb 25, 2024
c33a1bd
Spaces, not tab in Yaml actions
tomcombriat Feb 25, 2024
b088666
Adapted Detuned_Beats_Wash example
tomcombriat Feb 25, 2024
e5f557c
Merge pull request #238 from sensorium/devel/externalFixMath
tomcombriat Feb 25, 2024
cfe7973
Merge branch 'devel/Mozzi2' into devel/mozziClass_FixMath
tomcombriat Feb 25, 2024
05ef0f1
Added outputs from SFix for MonoOutput and StereoOutput
tomcombriat Feb 26, 2024
dbed60a
Added automatic scaling to DBW example
tomcombriat Feb 26, 2024
672ce21
More specific templates for Oscil and mozzi_midi
tomcombriat Feb 26, 2024
4b483dd
SFix actual number of bits is one extra compared to said size (which
tomcombriat Feb 26, 2024
a52b44e
Adapted AMSynth example to FixMath
tomcombriat Feb 28, 2024
1730643
Adapted Waveshapper_Difference_Tone with FixMath
tomcombriat Feb 28, 2024
5a121db
Waveshapper_difference_tone to Mozzi2.0 standard
tomcombriat Feb 28, 2024
75ad03d
Corrected Line with FixMath
tomcombriat Mar 3, 2024
be74b3b
Changed Line_vs_Smooth example to FixMath
tomcombriat Mar 3, 2024
7b2b1d3
Modified Waveshaper example to FixMath
tomcombriat Mar 3, 2024
8b760a6
Put FM_synth_FixMath to Mozzi2.0
tomcombriat Mar 4, 2024
57f94f4
Modified FMSynth_32k to FixMath
tomcombriat Mar 4, 2024
be0a9b0
Attempt to fix the actions
tomcombriat Mar 4, 2024
f7a40f2
Adapted AMsynth_HIFI to FixMath
tomcombriat Mar 5, 2024
74ef271
Updated Shepard tones to FixMath
tomcombriat Mar 5, 2024
273f2c0
Corrected Line_vs_Smooth example
tomcombriat Mar 10, 2024
e8376db
Changed Detuned beats examples to Mozzi2
tomcombriat Mar 10, 2024
574fb90
Optimization of mtof for non fractionnal FixMath midi values.
tomcombriat Mar 10, 2024
c3f2e54
add note about python 2
sensorium Mar 12, 2024
7cffcba
Switch to LPGL (mockup commit, which would have to be incorpated in a…
tfry-git Mar 25, 2024
f817af6
Mass-adjust licence header in examples
tfry-git Mar 28, 2024
5678b04
Mass-adjust licence/copyright header in source files
tfry-git Mar 28, 2024
3cf33d0
Make mozziAnalogRead() portable (see https://github.com/sensorium/Moz…
tfry-git Mar 24, 2024
fb26588
Add portable getAudioInput(), too.
tfry-git Mar 24, 2024
1073619
Fix compilation
tfry-git Mar 24, 2024
13185b3
Formally return unsigned for analog reads
tfry-git Mar 27, 2024
8944cf6
Adjust examples to scalable analog reads.
tfry-git Mar 27, 2024
8cc36a2
Clarify, and fix accidental comment.
tfry-git Mar 27, 2024
42c7956
Check range of MOZZI_ANALOG_READ_RESOLUTION, and add some further int…
tfry-git Mar 28, 2024
82237fe
Fix more return types
tfry-git Mar 28, 2024
cab1dd5
Merge branch 'devel/licence' into devel/Mozzi2
tfry-git Mar 30, 2024
c2f8ace
Convert one more instance of analog readings to uint16_t
tfry-git Mar 30, 2024
172da01
Fix copy and paste bug
tfry-git Mar 30, 2024
4f00936
Merge branch 'devel/Mozzi2' into devel/mozziClass_FixMath
tomcombriat Apr 3, 2024
3927ec1
Merge pull request #236 from sensorium/devel/mozziClass_FixMath
tomcombriat Apr 3, 2024
a619093
Compile twi_nonblock implementation only if the header is included.
tfry-git Mar 28, 2024
2cf9143
generate docs with doxygen
sensorium Apr 11, 2024
0917ec5
Merge branch 'devel/Mozzi2' of https://github.com/sensorium/Mozzi int…
sensorium Apr 11, 2024
4a95318
Another attempt at doxygenizing. Not quite perfect, either, so far.
tfry-git Apr 12, 2024
33cf1b0
Turn hardware "group" into "pages" in doxygen
tfry-git Apr 12, 2024
cd670ba
Fix links
tfry-git Apr 12, 2024
7830a70
Sync with github pages
tfry-git Apr 12, 2024
7bc4cfb
Sync with github pages
tfry-git Apr 13, 2024
62af5c2
Mark scripts as executable
tfry-git Apr 14, 2024
8b9bab6
Define all used groups
tfry-git Apr 14, 2024
c5eb0fd
Some tweaks to doxygen docs
tfry-git Apr 14, 2024
851639d
Add missing files
tfry-git Apr 14, 2024
c9af67f
Revert moving MidiToFreqPrivate to MozziPrivate. It is not so easy, a…
tfry-git Apr 14, 2024
3c5c6d3
Documentation fixes and additions
tfry-git Apr 27, 2024
3500835
Update doxygen
tfry-git Apr 27, 2024
a5c2639
RP2040 on tune by alterning between the two values of the timer around
tomcombriat May 7, 2024
b6926da
Adapted RP2040 config to PWM audio
tomcombriat May 7, 2024
7cd06ac
Changed PWM on RP2040 to DMA buffered using PWMAudio
tomcombriat May 7, 2024
33f76f4
Fixed compilation warning
tomcombriat May 7, 2024
b89e39f
Ensuring stereo PWM on RP2040 is non-blocking
tomcombriat May 7, 2024
708e064
rp2040: correct external_timed by computing alarm target with more bits
tomcombriat May 9, 2024
fc3e0f9
Cleanup
tomcombriat May 9, 2024
2b0d752
Corrected shifted micro for startMozzi on RP2040
tomcombriat May 10, 2024
18668f6
Fixed CONTROL_RATE
tomcombriat May 13, 2024
348acd3
Merge pull request #256 from sensorium/fix/controlRate
tomcombriat May 15, 2024
df8bf65
Merge pull request #254 from sensorium/devel/RP2040_onTune
tomcombriat May 20, 2024
2f975be
Update version number
tomcombriat May 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 21 additions & 2 deletions .github/workflows/compile_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ jobs:
- fqbn: arduino:avr:uno
platforms: |
- name: arduino:avr
internalid: arduino_avr # This is just some unique id string we assign for use in the artifact name (fqbn does not qualify due to containing colons)
internalid: arduino_uno # This is just some unique id string we assign for use in the artifact name (fqbn does not qualify due to containing colons)
- fqbn: arduino:avr:mega
platforms: |
- name: arduino:avr
internalid: arduino_mega
- fqbn: esp8266:esp8266:huzzah
type: 8266
platforms: |
Expand Down Expand Up @@ -88,10 +92,23 @@ jobs:
platforms: |
- name: arduino:renesas_uno
internalid: arduino_unor4
- fqbn: teensy:avr:teensy36
platforms: |
- name: teensy:avr
source-url: https://www.pjrc.com/teensy/package_teensy_index.json
internalid: teensy36
- fqbn: teensy:avr:teensy41
platforms: |
- name: teensy:avr
source-url: https://www.pjrc.com/teensy/package_teensy_index.json
internalid: teensy41

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Add marker file for github run
run: echo "#define IN_GITHUB_RUNNER 1" > detect_github_runner.h

- name: Compile examples
uses: arduino/compile-sketches@v1
Expand All @@ -109,8 +126,10 @@ jobs:
- name: PinChangeInterrupt
- name: MIDI Library
- name: Arduino_AdvancedAnalog
- name: FixMath
enable-deltas-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
enable-warnings-report: true

- name: Save sketches report as workflow artifact
uses: actions/upload-artifact@v4
Expand Down
32 changes: 14 additions & 18 deletions ADSR.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
/*
* ADSR.h
*
* Copyright 2012 Tim Barrass.
*
* This file is part of Mozzi.
*
* Mozzi is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* Copyright 2012-2024 Tim Barrass and the Mozzi Team
*
* Mozzi is licensed under the GNU Lesser General Public Licence (LGPL) Version 2.1 or later.
*
*/

#ifndef ADSR_H_
#define ADSR_H_

#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <Arduino.h>
#include "Line.h"
#include "mozzi_fixmath.h"

Expand All @@ -27,13 +23,13 @@ The "normal" way to use this would be with update() in updateControl(), where it
and then next() is in updateAudio(), called much more often, where it interpolates between the control values.
This also allows the ADSR updates to be made even more sparsely if desired, eg. every 3rd control update.
@tparam CONTROL_UPDATE_RATE The frequency of control updates.
Ordinarily this will be CONTROL_RATE, but an alternative (amongst others) is
to set this as well as the LERP_RATE parameter to AUDIO_RATE, and call both update() and next() in updateAudio().
Such a use would allow accurate envelopes with finer resolution of the control points than CONTROL_RATE.
Ordinarily this will be MOZZI_CONTROL_RATE, but an alternative (amongst others) is
to set this as well as the LERP_RATE parameter to MOZZI_AUDIO_RATE, and call both update() and next() in updateAudio().
Such a use would allow accurate envelopes with finer resolution of the control points than MOZZI_CONTROL_RATE.
@tparam LERP_RATE Sets how often next() will be called, to interpolate between updates set by CONTROL_UPDATE_RATE.
This will produce the smoothest results if it's set to AUDIO_RATE, but if you need to save processor time and your
This will produce the smoothest results if it's set to MOZZI_AUDIO_RATE, but if you need to save processor time and your
envelope changes slowly or controls something like a filter where there may not be problems with glitchy or clicking transitions,
LERP_RATE could be set to CONTROL_RATE (for instance). Then update() and next() could both be called in updateControl(),
LERP_RATE could be set to MOZZI_CONTROL_RATE (for instance). Then update() and next() could both be called in updateControl(),
greatly reducing the amount of processing required compared to calling next() in updateAudio().
@todo Test whether using the template parameters makes any difference to speed,
and rationalise which units do and don't need them.
Expand Down Expand Up @@ -278,7 +274,7 @@ class ADSR


/** Set the attack time of the ADSR in milliseconds.
The actual time taken will be resolved within the resolution of CONTROL_RATE.
The actual time taken will be resolved within the resolution of MOZZI_CONTROL_RATE.
@param msec the unsigned int attack time in milliseconds.
@note Beware of low values (less than 20 or so, depending on how many steps are being taken),
in case internal step size gets calculated as 0, which would mean nothing happens.
Expand All @@ -291,7 +287,7 @@ class ADSR


/** Set the decay time of the ADSR in milliseconds.
The actual time taken will be resolved within the resolution of CONTROL_RATE.
The actual time taken will be resolved within the resolution of MOZZI_CONTROL_RATE.
@param msec the unsigned int decay time in milliseconds.
@note Beware of low values (less than 20 or so, depending on how many steps are being taken),
in case internal step size gets calculated as 0, which would mean nothing happens.
Expand All @@ -304,7 +300,7 @@ class ADSR


/** Set the sustain time of the ADSR in milliseconds.
The actual time taken will be resolved within the resolution of CONTROL_RATE.
The actual time taken will be resolved within the resolution of MOZZI_CONTROL_RATE.
The sustain phase will finish if the ADSR recieves a noteOff().
@param msec the unsigned int sustain time in milliseconds.
@note Beware of low values (less than 20 or so, depending on how many steps are being taken),
Expand All @@ -319,7 +315,7 @@ class ADSR


/** Set the release time of the ADSR in milliseconds.
The actual time taken will be resolved within the resolution of CONTROL_RATE.
The actual time taken will be resolved within the resolution of MOZZI_CONTROL_RATE.
@param msec the unsigned int release time in milliseconds.
@note Beware of low values (less than 20 or so, depending on how many steps are being taken),
in case internal step size gets calculated as 0, which would mean nothing happens.
Expand All @@ -339,7 +335,7 @@ class ADSR


/** Set the attack, decay and release times of the ADSR in milliseconds.
The actual times will be resolved within the resolution of CONTROL_RATE.
The actual times will be resolved within the resolution of MOZZI_CONTROL_RATE.
@param attack_ms the new attack time in milliseconds.
@param decay_ms the new decay time in milliseconds.
@param sustain_ms the new sustain time in milliseconds.
Expand Down
43 changes: 0 additions & 43 deletions AudioConfigESP.h

This file was deleted.

45 changes: 0 additions & 45 deletions AudioConfigESP32.h

This file was deleted.

37 changes: 0 additions & 37 deletions AudioConfigHiSpeed14bitPwm.h

This file was deleted.

45 changes: 0 additions & 45 deletions AudioConfigMBED.h

This file was deleted.

53 changes: 0 additions & 53 deletions AudioConfigRP2040.h

This file was deleted.

25 changes: 0 additions & 25 deletions AudioConfigRenesas.h

This file was deleted.

Loading