Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: AverageAnalogIn PinDetect RotaryEncoder Sequence SequencerDisplay mbed-rtos mbed st7567LCD BaseMachineComon
Fork of BaseMachine_Sequencer by
Diff: main.cpp
- Revision:
- 13:b0f988a239df
- Parent:
- 12:c248781608af
- Child:
- 14:c173e03ee3ad
--- a/main.cpp Sat Jul 16 08:20:45 2016 +0000
+++ b/main.cpp Fri Jul 29 09:44:27 2016 +0000
@@ -10,16 +10,16 @@
#define SEQUENCE_N (16)
#define SPI_RATE (8000000)
-const int samplingPeriod = 1; // ms
+const int samplingPeriod = 2; // ms
const int bpm = 120;
const int envelopeLength = (60 * 1000 / (bpm * 4)) / samplingPeriod;
-AnalogIn levelIn(A0);
-AnalogIn durationIn(A1);
-AnalogIn decayIn(A2);
-AnalogIn sustainIn(A3);
-AnalogIn cutoffIn(PC_0);
-AnalogIn resonanceIn(PC_2);
+//AnalogIn levelIn(A0);
+AnalogIn durationIn(A2);
+AnalogIn decayIn(A1);
+AnalogIn sustainIn(A0);
+AnalogIn cutoffIn(A3);
+AnalogIn resonanceIn(A4);
SPI spiMaster(SPI_MOSI, SPI_MISO, SPI_SCK);
@@ -79,7 +79,8 @@
Thread::wait(500);
sequenceSender.setWaveShape(SpiSequenceSender::WAVESHAPE_SQUARE);
*/
- envelope.setLevel(levelIn * 4095);
+ //envelope.setLevel(levelIn * 4095);
+ envelope.setLevel(4095);
envelope.setDuration(durationIn * envelopeLength);
envelope.setDecay(decayIn * envelopeLength);
envelope.setSustain(sustainIn * 4095);
@@ -87,6 +88,7 @@
filterController.setCutoff(cutoffIn * 255);
filterController.setResonance(resonanceIn * 255);
+ /*
printf("%d\t%d\t%d\t%d\t%d\t%d\r\n",
filterController.getCutoff(),
filterController.getResonance(),
@@ -95,5 +97,6 @@
envelope.getDecay(),
envelope.getSustain()
);
+ */
}
}
