Giter Site home page Giter Site logo

copych / acidbox Goto Github PK

View Code? Open in Web Editor NEW
63.0 5.0 8.0 33.92 MB

ESP32 synth: all-in-one acid combo TB303 + TB303 + drum machine + fx chain, cd-quality, no lag

License: MIT License

C++ 99.90% HTML 0.10%
audio dsp acid arduino 303 808 esp32 synthesizer tb303 tr808

acidbox's Introduction

AcidBox

ESP32 headless acid combo of tb303 + tb303 + tr808 like synths. Filter cutoff, reso, env mod, accent, wavefolder, overdrive within each 303, per-instrument tunings, hi-pass/lo-pass filter and bitcrusher in drums, send to reverb, delay and master compression. All MIDI driven. 44100, 16bit stereo I2S output to the external DAC or 8bit to the built-in DAC. No indication. Uses both cores of ESP32. Cheap ~$10. Consult with midi_config.h to find out and to set up MIDI continous control messages.

It can be a JukeBox

If you compile with #define JUKEBOX option in config.h, this becomes a stand-alone ACID-JUKE-BOX. You just listen. A modified version of http://tips.ibawizard.net/acid-banger/, initially taken from https://github.com/vitling/acid-banger included, there's no AI, but randomizing pattern algorithms.

YouTube Video

Video

MP3 Sound samples

demo4.mp3 fully automated breaks and fills.

demo5.mp3 7 minutes of random fully automated acid.

To build the thing

Ideally, you need an ESP32 or ESP32S3 with at least 4MB PSRAM (for example, ESP32 WROVER module). Also an external DAC, like PCM5102 is highly preferrable.

ATTENTION! PSRAM handling requires up-to-date Arduino ESP32 core. Of what I have tested, versions 2.0.6 up to current 2.0.14 are working with both ESP32 and ESP32S3, while 2.0.0 is not working

In ArduinoIDE (I've used v.1.8.20) select:

  • board: ESP32 Dev Module (or ESP32S3 Dev Module if you use S3)
  • partition scheme: No OTA (1MB APP/ 3MB SPIFFS)
  • PSRAM: enabled (or the type of your PSRAM)

Also you will need to upload drum samples to the ESP32 flash (LittleFS). To do so follow the instructions: https://github.com/lorol/LITTLEFS#arduino-esp32-littlefs-filesystem-upload-tool

If you don't upload samples, the app will use the default drum kit from the samples.h

Dependencies

What if you only have WROOM module (no PSRAM)

You can still compile and run the app, with NO_PSRAM option (line 11 in config.h). Note, that in this case you will get NO REVERB and just ONE SMALL DRUM KIT.

In ArduinoIDE (I used v.1.8.20) select:

  • board: ESP32 Dev Module
  • partition scheme: No OTA (1MB APP/ 3MB SPIFFS)
  • PSRAM: disabled

Also you will need to upload drum samples to the ESP32 flash (LittleFS). To do so follow the instructions: https://github.com/lorol/LITTLEFS#arduino-esp32-littlefs-filesystem-upload-tool

What if you don't have an external DAC module (PCM5102)

You can still compile and run the app, with USE_INTERNAL_DAC option (line 10 in config.h). BUT you should understand that sound output is 8-bit. You just get it form GPIO25 and GPIO26. Probably you can improve it a bit playing with the multipliers in i2s_output() method in general.ino file.

In ArduinoIDE (I used v.1.8.20) select:

  • board: ESP32 Dev Module
  • partition scheme: No OTA (1MB APP/ 3MB SPIFFS)

Also you will need to upload drum samples to the ESP32 flash (LittleFS). To do so follow the instructions: https://github.com/lorol/LITTLEFS#arduino-esp32-littlefs-filesystem-upload-tool

MIDI Control

For the time being the following list of MIDI continious controllers is available:

#define CC_303_PORTATIME    5   // affects gliding time
#define CC_303_VOLUME       7   // mix volume
#define CC_303_PORTAMENTO   65  // gliding on/off
#define CC_303_PAN          10  // pano
#define CC_303_WAVEFORM     70  // Blend between square and saw
#define CC_303_RESO         71
#define CC_303_CUTOFF       74
#define CC_303_ATTACK       73
#define CC_303_DECAY        72
#define CC_303_ENVMOD_LVL   75
#define CC_303_ACCENT_LVL   76
#define CC_303_REVERB_SEND  91
#define CC_303_DELAY_SEND   92
#define CC_303_DISTORTION   94
#define CC_303_OVERDRIVE    95

// 808 Drums MIDI CC
#define CC_808_VOLUME       7
#define CC_808_PAN          10
#define CC_808_RESO         71
#define CC_808_CUTOFF       74  // Note that this filter's behaviour differs from the 303's, 64-127 means HP-, and 0-63 LP-filtering. 'Untouched' is at ~64.  
#define CC_808_REVERB_SEND  91
#define CC_808_DELAY_SEND   92
#define CC_808_DISTORTION   94  // BitCrusher
#define CC_808_BD_TONE      21  // Bass Drum tone control
#define CC_808_BD_DECAY     23  // Bass Drum envelope decay
#define CC_808_BD_LEVEL     24  // Bass Drum mix level
#define CC_808_SD_TONE      25  // Snare Drum tone control
#define CC_808_SD_SNAP      26  // Snare Drum envelope decay
#define CC_808_SD_LEVEL     29  // Snare Drum mix level
#define CC_808_CH_TUNE      61  // Closed Hat tone control
#define CC_808_CH_LEVEL     63  // Closed Hat mix level
#define CC_808_OH_TUNE      80  // Open Hat tone control
#define CC_808_OH_DECAY     81  // Open Hat envelope decay
#define CC_808_OH_LEVEL     82  // Open Hat mix level

// Global 
#define CC_ANY_COMPRESSOR   93
#define CC_ANY_DELAY_TIME   84  // delay time
#define CC_ANY_DELAY_FB     85  // delay feedback level
#define CC_ANY_DELAY_LVL    86  // delay mix level
#define CC_ANY_REVERB_TIME  87  // rebverb time
#define CC_ANY_REVERB_LVL   88  // reverb mix level
#define CC_ANY_RESET_CCS    121
#define CC_ANY_NOTES_OFF    123
#define CC_ANY_SOUND_OFF    120

Functional diagram

("Acid Banger" JukeBox actually calls midi functions as an external app would do)

Schematics and PCB

@streetuff has made such a great PCB and schematics! https://github.com/streetuff/AcidBox-PCB Schematics and PCB

Thanks go to

ESP32 proto

ESP32s3 proto

acidbox's People

Contributors

copych avatar streetuff 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

Watchers

 avatar  avatar  avatar  avatar  avatar

acidbox's Issues

Acid Banger jarring volume jumps

Firstly, excellent work on this project! I've just got it wired up and have been listening to the endless acid banger in the background.

One thing I noticed is that now and then, there's a quick surge in volume - akin to somebody accidentally nudging a mixer slider and then rapidly reducing it again. Is this deliberate?

alias

Hi Copych, I'm very curious about how synthvoice deals with alias. In a previous uploaded version there was two variables referring to saw and square bleps, but none code was using them. I've disabled the lowpass filter in order to analyze the spectrum of the 303 oscillator and alias was present.
Modifying some of Marcel License's synth code I've come up with a very begginer solution, which is to generate multiple wavetables that are already band limited, and to point to them accordingly to the desired pitch. That system works but its very inefficient, so I was wondering what about blips, bleps and so on.

Any help is well received, cheers!
Nicolas,.

backtrace on BPi Leaf S3 board

backtrace_acidbox.txt
My settings differ only by PSRAM size (8 MB), partitioning is according to the project guide. Other settings are taken from here
https://github.com/BPI-STEAM/BPI-Leaf-S3-Doc/tree/main/Example/Arduino
OS: Fedora 37 Latest, IDE: Arduino 1.8.19
Board : BPi Leaf S3 (ESP32S3 Dev Module), connection pinout - according to the code, pins 5,6,7.
DAC: PCM5102

Tried on 2 identical boards - got the same result. Looks like this is not PSRAM issue. Also, there are a lot of settings for S3 board that are not described in README, I used default ones or recommended by manufacturer.

Sketch upload and files upload cause no issues, i tried to disable debug - no difference. Struggling to decode stack trace, but it's not easy on latest OS, python2.7 and dependencies are outdated. Any further directions will be appreciated

That uses a moog filter emulation?

Thanks for posting those files! I've been looking for a nice intro to PCM style programming on an MCU.

That is a moog filter emulation or a diode ladder?

do_midi_stop() error

Hi, after trying to compile this error occurs. All I've done was to comment line 6 (#define JUKEBOX)
image

Incorrect POT_PINS for ESP32 S3?

config.h defines POT_PINS for the ESP32 S3 as follows:

#if defined(CONFIG_IDF_TARGET_ESP32S3)
#define I2S_BCLK_PIN    5       // I2S BIT CLOCK pin (BCL BCK CLK)
#define I2S_WCLK_PIN    7       // I2S WORD CLOCK pin (WCK WCL LCK)
#define I2S_DOUT_PIN    6       // to I2S DATA IN pin (DIN D DAT)
const uint8_t POT_PINS[POT_NUM] = {40, 41, 42};

However, on my board at least, these pins don't support ADC. Are these correct?

image

Stuttering after AcidBanger has been running for a while

After running the acid banger for maybe an hour, there's stuttering noticeable. Pressing the RST button seems to fix it.

Here's a video which hopefully demonstrates. It's most noticeable in the fills. I've just plugged the DAC's output into my PC so will record a more useful sample when it next happens.

This is with an ESP32 S3 with 8Mb of PRAM. No debugging is enabled.

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.