mirror of
https://github.com/pschatzmann/arduino-audio-tools.git
synced 2024-09-21 02:17:31 +00:00
README.md
This commit is contained in:
parent
497279e70f
commit
f9bcc00a0f
@ -17,7 +17,7 @@ This functionality provides the glue which makes different audio processing comp
|
||||
|
||||
We also provide [plenty of examples](https://github.com/pschatzmann/arduino-audio-tools/wiki/Examples) that demonstrate how to implement the different scenarios. The __design philosophy__ is based on the Arduino conventions: we use the ```begin()``` and ```end()``` methods to start and stop the processing and we propagate the __use of Streams__.
|
||||
|
||||
We all know the [Arduino Streams](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_stream.html): We usually use them to write out print messages and sometimes we use them to read the output from Serial devices. The same thing applies to “Audio Streams”: You can read audio data from [“Audio Sources” and you write them to “Audio Sinks”](https://github.com/pschatzmann/arduino-audio-tools/wiki/Audio-Sources-and-Sinks).
|
||||
We all know the [Arduino Streams](https://www.arduino.cc/reference/en/language/functions/communication/stream): We usually use them to write out print messages and sometimes we use them to read the output from Serial devices. The same thing applies to “Audio Streams”: You can read audio data from [“Audio Sources” and you write them to “Audio Sinks”](https://github.com/pschatzmann/arduino-audio-tools/wiki/Audio-Sources-and-Sinks).
|
||||
|
||||
|
||||
### Example
|
||||
|
@ -13,16 +13,15 @@ CsvStream<int16_t> csv(Serial, 1);
|
||||
//FilteredStream<int16_t, int16_t> filter(i2s, 1);
|
||||
ResampleStream resample(csv); // replace with i2s
|
||||
StreamCopy copier(resample, toneG8, 2048); // copies sound to out
|
||||
float from_tone = N_G8;
|
||||
float step_size = 0.0;
|
||||
int idx_max = 100;
|
||||
int idx = idx_max;
|
||||
MusicalNotes notes;
|
||||
uint32_t timeout = 0;
|
||||
|
||||
void changeNote() {
|
||||
const float from_tone = N_G8;
|
||||
// e.g. 6271.93f / 16.35f * 4.0 = 0.01042741229
|
||||
step_size = notes.frequency(idx) / from_tone * 4.0f;
|
||||
float step_size = notes.frequency(idx) / from_tone * 4.0f;
|
||||
Serial.print("playing note: ");
|
||||
Serial.print(notes.noteAt(idx));
|
||||
Serial.print(" / step: ");
|
||||
|
Loading…
Reference in New Issue
Block a user