Code Monkey home page Code Monkey logo

esp32_midi_sampler's People

Contributors

marcel-licence avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32_midi_sampler's Issues

Sound distorted when VT100 is enabled

Hi,
I discovered another Problem with the Esp32 Audio Kit V2.2 2957 ES8388 Board. When I
#define VT100_ENABLED
The sound playback is very distorted.
Is this normal ? What do you select in the Arduino Ide 's Tools menu?
I have the following settings there:
Board: "ESP32 Dev Module"
Upload Speed: "921600"
CPU Frequency: "240MHz (Wifi/BT)
Flash Frequency: "80MHz"
Flash Mode: "QIO"
Flash Size: "4MB (32Mb)"
Partition Scheme: "Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)"
Core Debug Level: "Verbose"
PSRAM: "ENABLED"
Arduino Runs On: "Core 1"
Events Run On: "Core 1"
Port: "/dev/cu.usbserial-0001

Is this right?
regards,
paul

contact

could you please contact me , manecolooper at gmail ?
thanks!

Audio Kit V2.2 A247 sounds like garbage

@marcel-licence Not sure how much you can help in this regard, but cannot get this Audio Kit V2.2 A247 to sound like your video. This thing just sounds terrible and no matter trying to switch to input rather than mic, mic stays engaged and has all of these electronic artifacts. Wonder if these new ES8388 is the issue. Not sure what to do here.

ESP32-LyraT Noisy sound and more issues

Hi,
I am trying to use the esp32_midi_sampler with the ESP32-LyraT v4.3 Board at the moment and I get a really noisy sound which is covered by a beep tone in the frequency of the BLINK_LED_PIN.
So I commented out the blink process code which removed the repeating beep tone, but what stays is a steady noise floor and really silent sample playback.
I also realized that there is no Sound at all when i comment out pinMode(BLINK_LED_PIN, OUTPUT)
I outputted the value of the BLINK_LED_PIN and got 19 in the serial monitor.

Can you help me to get it work? I got it working with the drum_sampler_project but the midi_sampler is not working yet.

I cannot find where BLINK_LED_PIN is defined i think it is defined in the ml_synth lib

EDIT: I selected the ESP32 Dev Module board in the Arduino IDE. I am not sure if this is correct.
EDIT2: Sample playback works now, only the noise floor problem stays
best,
paul


EDIT3:

Now I commented out the pinMode(Blink_LED_PIN, OUTPUT) again with the result of a more silent sample playback but without noise floor. I think I have called the Sampler_NoteOn wrongly.

But I wonder why the playback was much louder with Pin 19 set as an output

ESP8388 - No Sound. How to play samples from buttons or custom Sensors ?

EDIT: I think the reason of getting no sound has to to with code from ES8388_Setup() as I get the following output in the serial console on boot:

Connect to ES8388 codec... 0x00: 0x05
[  1071][E][Wire.cpp:313] beginTransmission(): Unfinished Repeated Start transaction! Expected requestFrom, not beginTransmission! Clearing...
0x01: 0x40
[  1084][E][Wire.cpp:313] beginTransmission(): Unfinished Repeated Start transaction! Expected requestFrom, not beginTransmission! Clearing...
[  1087][E][Wire.cpp:313] beginTransmission(): Unfinished Repeated Start transaction! Expected requestFrom, not beginTransmission! Clearing...
[  1099][E][Wire.cpp:313] beginTransmission(): Unfinished Repeated Start transaction! Expected requestFrom, not beginTransmission! Clearing...
AdcCh1!
MixChAMPL!
[  1117][E][Wire.cpp:313] beginTransmission(): Unfinished Repeated Start transaction! Expected requestFrom, not beginTransmission! Clearing...
[  1126][E][Wire.cpp:313] beginTransmission(): Unfinished Repeated Start transaction! Expected requestFrom, not beginTransmission! Clearing...
ES8388 setup finished!
Reg 0x00 = 0x05
[  1149][E][Wire.cpp:313] beginTransmission(): Unfinished Repeated Start transaction! Expected requestFrom, not beginTransmission! Clearing...

...
the last line then  repeats 50 times or so 

Hi, I have a ESP32 Audio Kit V2.2 2957 board with ES8388 Codec and i just want to make it play a sound through the headphone output (later also through speakers) when i push one of the 6 buttons. To do so I implemented basic button reads by adding
//Edit to config.h: #define AUDIO_KIT_BUTTON_DIGITAL instead of #define AUDIO_KIT_BUTTON_ANALOG
Then i implemented it as follows in the esp32_audio_kit_module.h file. I receive the button events up and down, but I cannot really play the samples i uploaded the data folders contents to the psram using the mylittlefs plugin for the arduino ide already.
I tried to get it act like this: https://www.youtube.com/watch?v=r0af0DB1R68

In the end i want to read sensors and playback samples as they reach a treshold...
Edits to z_config.h to implement digital button input :
Change

#ifdef AUDIO_KIT_BUTTON_ANALOG 
to
#if (defined AUDIO_KIT_BUTTON_ANALOG) || (defined AUDIO_KIT_BUTTON_DIGITAL)

Edits to esp32_audio_kit_module.h to implement digital button input :

...
#ifdef AUDIO_KIT_BUTTON_DIGITAL
/*
 * when not modified and R66-R70 are placed on the board
 */

#define PIN_KEY_1                   (36)
#define PIN_KEY_2                   (13)
#define PIN_KEY_3                   (19)
#define PIN_KEY_4                   (23)
#define PIN_KEY_5                   (18)
#define PIN_KEY_6                   (5)
/* My edit */
uint8_t buttonMap[6] = { PIN_KEY_1, PIN_KEY_2, PIN_KEY_3, PIN_KEY_4, PIN_KEY_5, PIN_KEY_6 };
uint8_t buttonStates[sizeof(buttonMap)];
/* End of edit */ 

...


typedef void(*audioKitButtonCb)(uint8_t, uint8_t);
extern audioKitButtonCb audioKitButtonCallback;

...

/*
 * pullup required to enable reading the buttons (buttons will connect them to ground if pressed)
 */
void button_setup()
{
#ifdef AUDIO_KIT_BUTTON_DIGITAL
    // Configure keys on ESP32 Audio Kit board
/* My edit */
    for (uint8_t i = 0; i < sizeof(buttonMap); i++) {
      pinMode(buttonMap[i], INPUT_PULLUP);
    }
/* End of My Edit */
#endif
...
}
...

/*
 * very bad implementation checking the button state
 * there is some work required for a better functionality
 */
void button_loop()
{
#ifdef AUDIO_KIT_BUTTON_DIGITAL
    /* My edit */
    static uint8_t buttonCount = 6;//sizeof(buttonMap);
    static bool state;
    
    for (uint8_t i = 0; i < buttonCount; i++) {
      state = digitalRead(buttonMap[i]);
      if (state != buttonStates[i]) {
        if (state == LOW) {
          Serial.println("Button "); Serial.print(i+1 ); Serial.println(" down");
          if (audioKitButtonCallback != NULL)
          {
              audioKitButtonCallback(i, 1);
          }
        } else {
          Serial.println("Button "); Serial.print(i+1); Serial.println(" up");
          if (audioKitButtonCallback != NULL)
          {
              audioKitButtonCallback(i, 0);
          }
        }
        buttonStates[i] = state;
      }
    }
    /* End of my edit */
#endif
...
}

#endif

ES8388 volume

Just a question regarding the ES8388 driver implementation, do you find that the output volume is significantly lower using the onboard codec vs an external dac like 5102 or 1334a? I'm using your implementation as a base for porting another project to AudioKit hardware and I've tried changing a few settings but it seems all the relevant output / gain levels are set to maximum in your setup() method anyway.

Anyway, thank you for the excellent project!

error: 'uint32_t sync' redeclared as different kind of symbol

Discussed in #57

Originally posted by fabiendostie January 16, 2022
happens in the fm synth this one and another one too... here<s the latest error message i got

Arduino: 1.8.19 (Mac OS X), Board: "ESP32 Dev Module, Enabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, Core 1, Core 1, None"

esp32_midi_sampler:348:17: error: 'uint32_t sync' redeclared as different kind of symbol
 static uint32_t sync = 0;
                 ^~~~
In file included from /Users/lefab/Documents/Arduino/hardware/espressif/esp32/tools/sdk/esp32/include/newlib/platform_include/sys/unistd.h:23,
                 from /Users/lefab/Documents/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/unistd.h:4,
                 from /Users/lefab/Documents/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/pthread.h:25,
                 from /Users/lefab/Documents/Arduino/hardware/espressif/esp32/tools/sdk/esp32/include/newlib/platform_include/pthread.h:21,
                 from /Users/lefab/Documents/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/8.4.0/xtensa-esp32-elf/esp32-psram/no-rtti/bits/gthr-default.h:48,
                 from /Users/lefab/Documents/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/8.4.0/xtensa-esp32-elf/esp32-psram/no-rtti/bits/gthr.h:151,
                 from /Users/lefab/Documents/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/8.4.0/ext/atomicity.h:35,
                 from /Users/lefab/Documents/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/8.4.0/memory:73,
                 from /Users/lefab/Documents/Arduino/hardware/espressif/esp32/libraries/FS/src/FS.h:24,
                 from /Users/lefab/Documents/Arduino/esp32/esp32_midi_sampler/esp32_midi_sampler.ino:108:
/Users/lefab/Documents/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/unistd.h:309:9: note: previous declaration 'void sync()'
 void    sync (void);
         ^~~~
/Users/lefab/Documents/Arduino/esp32/esp32_midi_sampler/esp32_midi_sampler.ino: In function 'void Midi_SyncRecvd()':
/Users/lefab/Documents/Arduino/esp32/esp32_midi_sampler/esp32_midi_sampler.ino:352:10: warning: pointer to a function used in arithmetic [-Wpointer-arith]
     sync += 1;
     ~~~~~^~~~
esp32_midi_sampler:352:13: error: assignment of read-only location 'sync'
     sync += 1;
             ^
/Users/lefab/Documents/Arduino/esp32/esp32_midi_sampler/i2s_interface.ino: At global scope:
/Users/lefab/Documents/Arduino/esp32/esp32_midi_sampler/i2s_interface.ino:318:49: warning: 'I2S_COMM_FORMAT_I2S' is deprecated [-Wdeprecated-declarations]
     .communication_format = (i2s_comm_format_t)(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),
                                                 ^~~~~~~~~~~~~~~~~~~
In file included from /Users/lefab/Documents/Arduino/hardware/espressif/esp32/tools/sdk/esp32/include/driver/include/driver/i2s.h:16,
                 from /Users/lefab/Documents/Arduino/esp32/esp32_midi_sampler/i2s_interface.ino:45:
/Users/lefab/Documents/Arduino/hardware/espressif/esp32/tools/sdk/esp32/include/hal/include/hal/i2s_types.h:95:5: note: declared here
     I2S_COMM_FORMAT_I2S       __attribute__((deprecated)) = 0x01, /*!< I2S communication format I2S, correspond to `I2S_COMM_FORMAT_STAND_I2S`*/
     ^~~~~~~~~~~~~~~~~~~
/Users/lefab/Documents/Arduino/esp32/esp32_midi_sampler/i2s_interface.ino:318:71: warning: 'I2S_COMM_FORMAT_I2S_MSB' is deprecated [-Wdeprecated-declarations]
     .communication_format = (i2s_comm_format_t)(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),
                                                                       ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/lefab/Documents/Arduino/hardware/espressif/esp32/tools/sdk/esp32/include/driver/include/driver/i2s.h:16,
                 from /Users/lefab/Documents/Arduino/esp32/esp32_midi_sampler/i2s_interface.ino:45:
/Users/lefab/Documents/Arduino/hardware/espressif/esp32/tools/sdk/esp32/include/hal/include/hal/i2s_types.h:96:5: note: declared here
     I2S_COMM_FORMAT_I2S_MSB   __attribute__((deprecated)) = 0x01, /*!< I2S format MSB, (I2S_COMM_FORMAT_I2S |I2S_COMM_FORMAT_I2S_MSB) correspond to `I2S_COMM_FORMAT_STAND_I2S`*/
     ^~~~~~~~~~~~~~~~~~~~~~~
Multiple libraries were found for "WiFi.h"
 Used: /Users/lefab/Documents/Arduino/hardware/espressif/esp32/libraries/WiFi
 Not used: /Applications/Arduino.app/Contents/Java/libraries/WiFi
exit status 1
'uint32_t sync' redeclared as different kind of symbol


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
</div>

builtin ADC

Hello @marcel-licence , I played for some time with this great app, but as I don't have an i2s mic, I wanted to record from the analog preamped mic MAX9814, as I saw (https://github.com/MhageGH/esp32_SoundRecorder) that it's possible to use an internal ADC for this purpose. But I failed, cause when I add I2S_MODE_ADC_BUILT_IN to the i2s_config.mode, it stops producing any sound via i2s, and I don't understand what should I change, and is it possible to mix all the flags together (cause in the example it only records, not plays back the sound)?
My skills and understanding of i2s are definitely not enough to solve the quest, so can you, please, look at the code?

Input signal not sampled correctly

It seems that recording from the input generates wrong data.
It looks like that 2 samples are swapped or something different happens.

By comparing a line in recording on the audio kit and the same recording on my pc the recording on the audio kit has unwanted overtones. In addition to that it looks like there are steps in the signal

Same note whatever key is pressed - SD card

First of all - fantastic project !
I bought two of the Audio Kit V2.2 and they arrived today.
Problem is, I only have channel 1 as output from my MIDI'd keyboard.
3 loaded samples play on 3 individual keys all the way up the keyboard.
All I need to do is move channel 1 as the drum type single note channel - and don't know how to.
Would channel 10 be 'more correct' in any case, for a drum samples type playback?

Other issues or ideas for another time would be implementation of the multiplexer sliders/knobs code to work on this project too and to output the VT100 type data to a small screen (ST7735/ST7735S).
I'd like to select samples from the SD card in a similar way as you showed in the video. Could a 'Next' button press of the Audio Kit button 1 be done easily? A simple step through loading of each sample in the /samples directory :)

Edit
Changing the NoteOn and NoteOff sections in midi_interface.ino to ch+1 fixed it LOL
Maybe useful if others have a similar problem.

Build problem after defining OUTPUT_SAW_TEST

  1. I've downloaded main version of ML_SYNTH_TOOLS in my library folder
  2. I've cloned the main version of esp32_midi_sampler
  3. When I build, I have this error:
:/users/ogran/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch5/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\ogran\AppData\Local\Temp\arduino\sketches\58AC02A694316F6CE3697AE952DC57B1\sketch\esp32_midi_sampler.ino.cpp.o:(.literal._Z10audio_taskv[_Z10audio_taskv]+0x24): undefined reference to `Audio_Output(float const*, float const*)'
c:/users/ogran/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch5/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\ogran\AppData\Local\Temp\arduino\sketches\58AC02A694316F6CE3697AE952DC57B1\sketch\esp32_midi_sampler.ino.cpp.o: in function `audio_task()':
E:\rfe\dev\workspace_marcel_licence\esp32_midi_sampler/esp32_midi_sampler.ino:667: undefined reference to `Audio_Output(float const*, float const*)'
collect2.exe: error: ld returned 1 exit status

Using library ML SynthTools at version 1.0.1 in folder: C:\Users\ogran\OneDrive\Documents\Arduino\libraries\ML_SynthTools 
Using library WiFi at version 2.0.0 in folder: C:\Users\ogran\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6\libraries\WiFi 
Using library FS at version 2.0.0 in folder: C:\Users\ogran\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6\libraries\FS 
Using library LittleFS at version 2.0.0 in folder: C:\Users\ogran\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6\libraries\LittleFS 
Using library SD_MMC at version 2.0.0 in folder: C:\Users\ogran\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6\libraries\SD_MMC 
Using library Wire at version 2.0.0 in folder: C:\Users\ogran\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6\libraries\Wire 
Using library Adafruit GFX Library at version 1.11.5 in folder: C:\Users\ogran\OneDrive\Documents\Arduino\libraries\Adafruit_GFX_Library 
Using library Adafruit BusIO at version 1.14.1 in folder: C:\Users\ogran\OneDrive\Documents\Arduino\libraries\Adafruit_BusIO 
Using library SPI at version 2.0.0 in folder: C:\Users\ogran\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6\libraries\SPI 
Using library Adafruit SSD1306 at version 2.5.7 in folder: C:\Users\ogran\OneDrive\Documents\Arduino\libraries\Adafruit_SSD1306 
exit status 1

Compilation error: exit status 1

Probably it's a version problem, but I didn't found the required version of the library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.