Skip to content

Commit e4f3737

Browse files
committed
Maximilian Examples
1 parent 5bd7f26 commit e4f3737

File tree

10 files changed

+30
-103
lines changed

10 files changed

+30
-103
lines changed

examples/.DS_Store

-4 KB
Binary file not shown.

examples/examples-maximilian/08-Counting3/08-Counting3.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void setup() {//some inits
2323

2424
void play(double *output) {
2525

26-
CurrentCount=myCounter.pphasorBetween(1, 1, 9);//phasor can take three arguments; frequency, start value and end value.
26+
CurrentCount=myCounter.phasorBetween(1, 1, 9);//phasor can take three arguments; frequency, start value and end value.
2727

2828
// here we use a conditional to make something happen at a specific time.
2929

examples/examples-maximilian/11-Mixing/11-Mixing.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Maximilian maximilian(out);
77

88
// Maximilian
99
maxiOsc myOsc,myAutoPanner;//
10-
double myStereoOutput[2];
10+
vector<double> myStereoOutput(2,0);
1111
maxiMix myOutputs;//this is the stereo mixer channel.
1212

1313
void setup() {//some inits

examples/examples-maximilian/14-MonoSynth/14-MonoSynth.ino

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Maximilian maximilian(out);
1010
//These are the synthesiser bits
1111
maxiOsc VCO1,VCO2,LFO1,LFO2;
1212
maxiFilter VCF;
13-
maxiEnv ADSR;
13+
maxiEnv V_ADSR;
1414

1515
//This is a bunch of control signals so that we can hear something
1616
maxiOsc timer;//this is the metronome
@@ -33,10 +33,10 @@ void setup() {//some inits
3333

3434
// setup maximilian
3535

36-
ADSR.setAttack(1000);
37-
ADSR.setDecay(1);
38-
ADSR.setSustain(1);
39-
ADSR.setRelease(1000);
36+
V_ADSR.setAttack(1000);
37+
V_ADSR.setDecay(1);
38+
V_ADSR.setSustain(1);
39+
V_ADSR.setRelease(1000);
4040
}
4141

4242
void play(double *output) {
@@ -47,7 +47,7 @@ void play(double *output) {
4747

4848

4949
if (lastCount!=currentCount) {//if we have a new timer int this sample, play the sound
50-
ADSR.trigger=1;
50+
V_ADSR.trigger=1;
5151

5252
cout << "tick\n";//the clock ticks
5353

@@ -56,18 +56,18 @@ void play(double *output) {
5656

5757
//and this is where we build the synth
5858

59-
ADSRout=ADSR.adsr(1.0,ADSR.trigger);
59+
ADSRout=V_ADSR.adsr(1.0,V_ADSR.trigger);
6060

6161
LFO1out=LFO1.sinebuf(0.2);//this lfo is a sinewave at 0.2 hz
6262

6363
VCO1out=VCO1.pulse(55,0.6);//here's VCO1. it's a pulse wave at 55 hz, with a pulse width of 0.6
6464
VCO2out=VCO2.pulse(110+LFO1out,0.2);//here's VCO2. it's a pulse wave at 110hz with LFO modulation on the frequency, and width of 0.2
6565

6666

67-
VCFout=VCF.lores((VCO1out+VCO2out)*0.5, ADSRout*10000, 10);//now we stick the VCO's into the VCF, using the ADSR as the filter cutoff
67+
VCFout=VCF.lores((VCO1out+VCO2out)*0.5, ADSRout*10000, 10);//now we stick the VCO's into the VCF, using the V_ADSR as the filter cutoff
6868

69-
double finalSound=VCFout*ADSRout;//finally we add the ADSR as an amplitude modulator
70-
ADSR.trigger=0;
69+
double finalSound=VCFout*ADSRout;//finally we add the V_ADSR as an amplitude modulator
70+
V_ADSR.trigger=0;
7171
output[0]=finalSound;
7272
output[1]=finalSound;
7373
}

examples/examples-maximilian/15-PolySynth/15-PolySynth.ino

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Maximilian maximilian(out);
1111
//These are the synthesiser bits
1212
maxiOsc VCO1[6],VCO2[6],LFO1[6],LFO2[6];
1313
maxiFilter VCF[6];
14-
maxiEnv ADSR[6];
14+
maxiEnv V_ADSR[6];
1515

1616
//This is a bunch of control signals so that we can hear something
1717
maxiOsc timer;//this is the metronome
@@ -33,10 +33,10 @@ void setup() {//some inits
3333

3434
// setup maximilian
3535
for (int i=0;i<6;i++) {
36-
ADSR[i].setAttack(0);
37-
ADSR[i].setDecay(200);
38-
ADSR[i].setSustain(0.2);
39-
ADSR[i].setRelease(2000);
36+
V_ADSR[i].setAttack(0);
37+
V_ADSR[i].setDecay(200);
38+
V_ADSR[i].setSustain(0.2);
39+
V_ADSR[i].setRelease(2000);
4040
}
4141
}
4242

@@ -54,7 +54,7 @@ void play(double *output) {
5454
voice=0;
5555
}
5656

57-
ADSR[voice].trigger=1;//trigger the envelope from the start
57+
V_ADSR[voice].trigger=1;//trigger the envelope from the start
5858
pitch[voice]=voice+1;
5959
voice++;
6060

@@ -65,17 +65,17 @@ void play(double *output) {
6565
for (int i=0; i<6; i++) {
6666

6767

68-
ADSRout[i]=ADSR[i].adsr(1.,ADSR[i].trigger);//our ADSR env is passed a constant signal of 1 to generate the transient.
68+
ADSRout[i]=V_ADSR[i].adsr(1.,V_ADSR[i].trigger);//our V_ADSR env is passed a constant signal of 1 to generate the transient.
6969

7070
LFO1out[i]=LFO1[i].sinebuf(0.2);//this lfo is a sinewave at 0.2 hz
7171

7272
VCO1out[i]=VCO1[i].pulse(55*pitch[i],0.6);//here's VCO1. it's a pulse wave at 55 hz, with a pulse width of 0.6
7373
VCO2out[i]=VCO2[i].pulse((110*pitch[i])+LFO1out[i],0.2);//here's VCO2. it's a pulse wave at 110hz with LFO modulation on the frequency, and width of 0.2
7474

7575

76-
VCFout[i]=VCF[i].lores((VCO1out[i]+VCO2out[i])*0.5, 250+((pitch[i]+LFO1out[i])*1000), 10);//now we stick the VCO's into the VCF, using the ADSR as the filter cutoff
76+
VCFout[i]=VCF[i].lores((VCO1out[i]+VCO2out[i])*0.5, 250+((pitch[i]+LFO1out[i])*1000), 10);//now we stick the VCO's into the VCF, using the V_ADSR as the filter cutoff
7777

78-
mix+=VCFout[i]*ADSRout[i]/6;//finally we add the ADSR as an amplitude modulator
78+
mix+=VCFout[i]*ADSRout[i]/6;//finally we add the V_ADSR as an amplitude modulator
7979

8080

8181
}
@@ -86,7 +86,7 @@ void play(double *output) {
8686

8787
// This just sends note-off messages.
8888
for (int i=0; i<6; i++) {
89-
ADSR[i].trigger=0;
89+
V_ADSR[i].trigger=0;
9090
}
9191

9292
}

examples/examples-maximilian/16-Replicant/16-Replicant.ino renamed to examples/examples-maximilian/Unsupported/16-Replicant.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Maximilian maximilian(out);
1212
maxiOsc sound,bass,timer,mod,lead,lead2,leadmod;//here are the synth bits
1313
maxiEnv envelope, leadenvelope;//some envelopes
1414
maxiFilter filter, filter2;//some filters
15-
maxiDelayline delay;//a delay
15+
maxiDelayline delay_value;//a delay_value
1616
convert mtof;//a method for converting midi notes to frequency
1717
double bassout,leadout, delayout;//some variables to hold the data and pass it around
1818
int trigger, trigger2, newnote;//some control variables
@@ -65,7 +65,7 @@ void play(double *output) {//this is where the magic happens. Very slow magic.
6565
bassout=filter2.lores(envelope.adsr(bass.saw(currentPitch*0.5)+sound.pulse(currentPitch*0.5,mod.phasor(1)),1,0.9995, 0.25, 0.9995, 1, trigger),9250,2);//new, simple ADSR.
6666
leadout=filter.lores(leadenvelope.ar(lead2.saw(leadPitch*4)+lead.pulse(leadPitch+(leadmod.sinebuf(1.9)*1.5), 0.6), 0.00005, 0.999975, 50000, trigger2),5900,10);//leadline
6767

68-
delayout=(leadout+(delay.dl(leadout, 14000, 0.8)*0.5))/2;//add some delay
68+
delayout=(leadout+(delay_value.dl(leadout, 14000, 0.8)*0.5))/2;//add some delay_value
6969

7070
if(trigger!=0)trigger=0;//set the trigger to off if you want it to trigger immediately next time.
7171

examples/examples-maximilian/20-FFT/20-FFT.ino renamed to examples/examples-maximilian/Unsupported/20-FFT.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void setup() {
2424
maximilian.begin(cfg);
2525

2626
// setup maximilian
27-
myFFT.setup(1024, 512, 256);
27+
myFFT.setup(512, 512, 256);
2828

2929
}
3030

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
These examples are not working because of the following reasons
3+
4+
- not enough memory available
5+
- files not supported

tests/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/build-examples-log.txt

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +0,0 @@
1-
../examples/examples-basic-api/base-adc-a2dp -> rc=0
2-
../examples/examples-basic-api/base-adc-serial -> rc=0
3-
../examples/examples-basic-api/base-file_mp3-a2dp -> rc=0
4-
../examples/examples-basic-api/base-file_raw-a2dp -> rc=0
5-
../examples/examples-basic-api/base-file_raw-serial -> rc=0
6-
../examples/examples-basic-api/base-i2s-a2dp -> rc=0
7-
../examples/examples-basic-api/base-i2s-serial -> rc=0
8-
../examples/examples-player/player-callback-i2s -> rc=0
9-
../examples/examples-player/player-sd-a2dp -> rc=0
10-
../examples/examples-player/player-sd-analog -> rc=0
11-
../examples/examples-player/player-sd-i2s -> rc=0
12-
../examples/examples-player/player-url-i2s -> rc=0
13-
../examples/examples-player/player-url_icy-i2s -> rc=0
14-
../examples/examples-player/player-url_subclass-i2s -> rc=0
15-
../examples/examples-webserver/streams-effect-webserver_wav -> rc=0
16-
../examples/examples-webserver/streams-flite-webserver_wav -> rc=0
17-
../examples/examples-webserver/streams-generator-webserver_wav -> rc=0
18-
../examples/examples-webserver/streams-i2s-webserver_wav -> rc=0
19-
../examples/examples-webserver/streams-sam-webserver_wav -> rc=0
20-
../examples/examples-webserver/streams-tts-webserver_wav -> rc=0
21-
../examples/examples-stream/streams-adc-serial -> rc=0
22-
../examples/examples-stream/streams-analog-i2s -> rc=0
23-
../examples/examples-stream/streams-analog-serial -> rc=0
24-
../examples/examples-stream/streams-generator-a2dp -> rc=0
25-
../examples/examples-stream/streams-generator-analog -> rc=0
26-
../examples/examples-stream/streams-generator-csv -> rc=0
27-
../examples/examples-stream/streams-generator-i2s -> rc=0
28-
../examples/examples-stream/streams-generator-pwm -> rc=0
29-
../examples/examples-stream/streams-generator-serial -> rc=0
30-
../examples/examples-stream/streams-generator-spdif -> rc=0
31-
../examples/examples-stream/streams-i2s-a2dp -> rc=0
32-
../examples/examples-stream/streams-i2s-csv -> rc=0
33-
../examples/examples-stream/streams-i2s-filter-i2s -> rc=0
34-
../examples/examples-stream/streams-i2s-i2s -> rc=0
35-
../examples/examples-stream/streams-memory_mp3-analog -> rc=0
36-
../examples/examples-stream/streams-memory_mp3-metadata -> rc=0
37-
../examples/examples-stream/streams-memory_mp3-pwm -> rc=0
38-
../examples/examples-stream/streams-memory_raw-i2s -> rc=0
39-
../examples/examples-stream/streams-memory_wav-pwm -> rc=0
40-
../examples/examples-stream/streams-memory_wav-serial -> rc=0
41-
../examples/examples-stream/streams-sd_mp3-i2s -> rc=0
42-
../examples/examples-stream/streams-sd_mp3-metadata -> rc=0
43-
../examples/examples-stream/streams-url_mp3-analog -> rc=0
44-
../examples/examples-stream/streams-url_mp3-i2s -> rc=0
45-
../examples/examples-stream/streams-url_mp3-metadata -> rc=0
46-
../examples/examples-stream/streams-url_mp3-metadata2 -> rc=0
47-
../examples/examples-stream/streams-url_raw-i2s -> rc=0
48-
../examples/examples-stream/streams-url_raw-serial -> rc=0
49-
../examples/examples-stream/streams-url_wav-i2s -> rc=0
50-
../examples/examples-audiokit/basic-a2dp-audiokit -> rc=0
51-
../examples/examples-audiokit/player-sd-audiokit -> rc=0
52-
../examples/examples-audiokit/player-sd_a2dp-audiokit -> rc=0
53-
../examples/examples-audiokit/player-url_icy-audiokit -> rc=0
54-
../examples/examples-audiokit/streams-audiokit-audiokit -> rc=0
55-
../examples/examples-audiokit/streams-audiokit-csv -> rc=0
56-
../examples/examples-audiokit/streams-audiokit-filter-audiokit -> rc=0
57-
../examples/examples-audiokit/streams-audiokit-webserver_aac -> rc=0
58-
../examples/examples-audiokit/streams-audiokit-webserver_wav -> rc=0
59-
../examples/examples-audiokit/streams-flite-audiokit -> rc=0
60-
../examples/examples-audiokit/streams-pins-audiokit -> rc=0
61-
../examples/examples-audiokit/streams-sam-audiokit -> rc=0
62-
../examples/examples-audiokit/streams-synth-a2dp -> rc=0
63-
../examples/examples-audiokit/streams-synth-audiokit -> rc=0
64-
../examples/examples-audiokit/streams-synthbasic1-audiokit -> rc=0
65-
../examples/examples-audiokit/streams-synthbasic2-audiokit -> rc=0
66-
../examples/examples-audiokit/streams-synthbasic3-audiokit -> rc=0
67-
../examples/examples-audiokit/streams-synthstk-audiokit -> rc=0

0 commit comments

Comments
 (0)