The video is in Spanish, please activate the English subtitles
Characteristics
- Sample Playback: Support for loading and playing WAV files.
- Polyphony: Play multiple notes simultaneously.
- Volume Control: General volume and Dynamic adjustment of note volume. (Velocity)
- I2S output: Uses the I2S peripheral of the ESP32 and an external DAC (MAX98357). (It could be modified to not use external DAC but it lowers the sound quality a lot)
- Easy to Use: Simple function-based code, non-object-oriented programming.
- Small: The entire library is just one file of less than 15kb and takes up approximately 15% of program storage space. The included samples also take up little space, approximately 700Kb of the almost 4Mb of flash memory.
- Dependencies: LittleFS library, optional MIDI library [https://github.com/FortySevenEffects/arduino_midi_library] (used in the rtMidiIn example)
Features
- initSynth(bck, ws, data): Initializes the synthesizer and configures the pins for I2S communication.
- setMaxNotes(maxNotes): Sets the maximum number of simultaneous notes that can be played. 8 default maximum recommended 16
- setInstrument(num): Loads a specific instrument sample to be played.
- setVolume(vol): Sets the overall synth volume from (0-100)
- setSustainNota(NoteDuration): configures the default time in milliseconds that a note lasts when calling the noteOn function (0-65535) if it is 0 it sounds indefinitely.
- setDelayNota(dFade): Sets the fade time used in noteOff to mute the active note (0-127) 0 immediate 127 maximum duration.
- noteOn(note, velocity, duration): Activates a musical note with the corresponding frequency, volume and duration specified.
- noteOff(note): Turns off a musical note gradually, decreasing its volume for a set amount of time before muting it completely.
- allnotaOff(): Disables all currently active musical notes.
- alterNoteVol(velocity): Adjusts the volume of a note even if it is active.
- alterPitchNote(qty): Adjusts the pitch of a note even if it is active.
- pauseSynth(): Pauses the synthesizer task and frees resources.
- resumeSynth(): Resume the synthesizer task.