Skip to content

Commit 043d545

Browse files
committed
Using more cross-platform compatible types in AudioDelay examples
Using more cross-platform compatible types in AudioDelay example Removed char in AudioDelay examples for better compatibility
1 parent a311fa3 commit 043d545

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

examples/09.Delays/AudioDelay/AudioDelay.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ void updateControl(){
4747
}
4848

4949
AudioOutput updateAudio(){
50-
char asig = aDel.next(aTriangle.next(), del_samps);
50+
int8_t asig = aDel.next(aTriangle.next(), del_samps);
5151
return MonoOutput::from8Bit(asig);
5252
}

examples/09.Delays/AudioDelayFeedback/AudioDelayFeedback.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void updateControl(){
5858

5959

6060
AudioOutput updateAudio(){
61-
char asig = aTriangle.next(); // get this so it can be used twice without calling next() again
61+
int8_t asig = aTriangle.next(); // get this so it can be used twice without calling next() again
6262
//return asig/8 + aDel.next(asig, (uint16_t) del_samps); // mix some straight signal with the delayed signal
6363
//return aDel.next(aTriangle.next(), (uint16_t) del_samps); // instead of the previous 2 lines for only the delayed signal
6464
return MonoOutput::fromAlmostNBit(9, (asig >> 3) + aDel.next(asig, deltime)); // mix some straight signal with the delayed signal

examples/09.Delays/AudioDelayFeedbackAllpass/AudioDelayFeedbackAllpass.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void updateControl(){
6262
// set random delay parameters
6363
float del_cells = (float)rand(65535u)/256;
6464
aDel.setDelayTimeCells(del_cells); // Allpass interpolation for fractional delay time
65-
char fb = rand(-50,50);
65+
int8_t fb = rand(-50,50);
6666
aDel.setFeedbackLevel(fb);
6767
kDelay.start(duration+500);
6868
}

examples/09.Delays/AudioDelayFeedbackX2/AudioDelayFeedbackX2.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ void updateControl(){
6464

6565

6666
AudioOutput updateAudio(){
67-
char asig1 = aTriangle1.next(); // get this so it can be used twice without calling next() again
68-
int aflange1 = (asig1>>3) + aDel1.next(asig1, del_samps1); // mix some straignt signal with the delayed signal
67+
int8_t asig1 = aTriangle1.next(); // get this so it can be used twice without calling next() again
68+
int16_t aflange1 = (asig1>>3) + aDel1.next(asig1, del_samps1); // mix some straignt signal with the delayed signal
6969

70-
char asig2 = aTriangle2.next(); // get this so it can be used twice without calling next() again
71-
int aflange2 = (asig2>>3) + aDel2.next(asig2, del_samps2); // mix some straignt signal with the delayed signal
70+
int8_t asig2 = aTriangle2.next(); // get this so it can be used twice without calling next() again
71+
int16_t aflange2 = (asig2>>3) + aDel2.next(asig2, del_samps2); // mix some straignt signal with the delayed signal
7272
return MonoOutput::fromAlmostNBit(10, aflange1 + aflange2).clip();
7373
}
7474

examples/09.Delays/AudioDelayFeedback_HIFI/AudioDelayFeedback_HIFI.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void updateControl(){
8383

8484

8585
AudioOutput updateAudio(){
86-
char asig = aTriangle.next(); // get this so it can be used twice without calling next() again
86+
int8_t asig = aTriangle.next(); // get this so it can be used twice without calling next() again
8787
//return asig/8 + aDel.next(asig, del_samps); // mix some straight signal with the delayed signal
8888
//return aDel.next(aTriangle.next(), del_samps); // instead of the previous 2 lines for only the delayed signal
8989
return MonoOutput::fromAlmostNBit(13, asig + (aDel.next(asig, del_samps_fractional)<<4)); // mix some straight signal with the delayed signal

0 commit comments

Comments
 (0)