#wavetable — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #wavetable, aggregated by home.social.
-
#PPG #WaveComputer 360 Resonant 1 #wavetable.
sound and visualization.
8 table entries spread across 60.Linearly interpolated.
Only half of each waveform stored; other half XORed.
-
Ensoniq SD-1/32 by Sojus Records 🎛️
32-Voice VST Emulation of the Ensoniq SD-1💻 Win/Mac/Linux (VST3)
🎁 FREE https://www.sojusrecords.com/news/ensoniq-sd-1-32-vst-emulation-free#freeplugin #synth #wavetable #opensource #vintage #mame #emulation #sojusrecords
-
As is tradition. I've created a full track with the New Polyend Synth. A fun little multi-timbral monster🎧.
https://www.youtube.com/watch?v=zXHzqCyy-Y0
#polyend #polyendsynth #polyendtracker #tracker #music #synthesizer #synth #electronicmusic #granular #wavetable #synthesis
-
I’m continuing my look into the ESP32 and PWM. This time I’m adding in some analog control to introduce an element of frequency modulation to the synthesis.
- Part 1 – All the theory and research around PWM and the ESP32.
- Part 2 – Generating different waveforms on multiple channels.
- Part 3 – Introducing analog control and frequency modulation.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to microcontrollers, see the Getting Started pages.
Parts list
- ESP32 WROOM Module
- 3x 1kΩ resistor
- 2x 10kΩ potentiometers
- 1x 10uF electrolytic capacitor
- 2x 100nF capacitor
- 1x TRS socket
- Breadboard and jumper wires
The Circuit
This expands on the previous circuit to allow me to feed back the output of one of the PWM channels into an analog input controlling the other.
It also allows the use of two potentiometers to control the frequencies independently.
It’s not very easy to see what is going on with the Fritzing diagram, but there are essentially four circuits in play here.
The first is the PWM filter and audio output stage from parts 1 and 2. This takes the 0-3V3 PWM signal and turns it into a more audio friendly +/- 800mV (ish) signal.
The second is the PWM filter stage but without the voltage divider to reduce the pp voltage and without the coupling capacitor to remove the DC offset. The output of this is therefore a waveform with a 0-3V3 sweep. I’m leaving it like this as I want to be able to use it as a control voltage for an analog input stage, which brings me on to…
The third is a simple potentiometer connected to one of the analog inputs.
The last is another potentiometer input but that can also be modulated by the output of the second PWM signal – the 0-3V3 one.
Now I think I’m ok to connect the output of the PWM stage to the input in the way shown above, but at this stage it might be a good time to remind you I’m not an electronics person and it is best to assume I don’t know what I’m doing. I’m using cheap development boards and effectively throw-away amplification, so am feeling quite free to experiment.
I don’t believe there is any way to connect a high signal source to a low signal sink without going through a resistor to limit current, so I think this is ok for this kind of experiment. Basically I don’t think I’m slowly cooking my ESP32, but don’t take my word for it…
Naturally if this was accepting any kind of input signal from elsewhere some kind of protection circuitry would be required and I’ve given no consideration here to things like impedance. This is me messing around – nothing more, but if you can see something wrong in what I’m saying feel free to let me know in the comments.
ESP32 GPIO Usage:
- GPIO13 – Sine wave output – connected to the audio output.
- GPIO12 – Saw wave output – not used above.
- GPIO14 – Triangle wave output – connected to the analog input for the sine wave.
- GPIO27 – Square wave output – not used above.
- GPIO39 – Analog input to control triangle/square wave frequency.
- GPIO36 – Analog input to control sine/saw wave frequency.
The Code
This is still using four separate PWM outputs but I’ve added in potentiometer control for them in pairs. As described above there is one pot to control the frequency of the sine/saw waves and one for the frequency of the triangle/square waves. But as also already stated, the sine/saw frequency can also be modulated by the triangle wave output.
The key feature to get this working is to use an analog reading as an input to the setFreq() function from before for the individual channels.
My loop, which was previously empty, now looks like this.
#define NUM_ADC_PINS 2
int adc_pins[NUM_ADC_PINS] = {36, 39};
uint16_t adcval[NUM_ADC_PINS];
void loop () {
for (int i=0; i<NUM_ADC_PINS; i++) {
uint16_t algval = analogRead(adc_pins[i]);
if (algval != adcval[i]) {
setPotFreq(i, algval);
}
adcval[i] = algval;
}
}I’ve just added in some mapping via the setPotFreq() function to determine which PWM pins are associated with which potentiometer.
int pot2pwm[NUM_PWM_PINS] = {0,0,1,1};
void setPotFreq (int pot, unsigned freq) {
for (int i=0; i<NUM_PWM_PINS; i++) {
if (pot2pwm[i] == pot) {
setPwmFreq(i, freq);
}
}
}To change which PWM channels map to which pots, just update the pot2pwm[] array of values. To have four pots and each channel independent is just a case of adding the two extra pins to the adc_pins[] array and then updating pot2pwm to be {0,1,2,3}.
I’ve not gone that far as I wasn’t too fussed about adding the extra circuitry required – my solderless breadboard is getting a little crowded as it is.
I’m using the “simple” analogRead() functionality which is fully Arduino compatible, albeit with a higher resolution (12-bits). The ESP32 also has the option for a faster, continuous reading of the ADCs via a “Continuous mode driver”. More details can be found here. I did wonder about experimenting with that at some point. It is interesting to consider if that could sample at a similar frequency to the PWM output, giving the possibility of some kind of audio processing, but that is a set of experiments for another day.
I’ve also seen mention of using the I2S driver with the ADC or DAC, but I must admit I don’t quite understand what is being said there. Another thing added to the “to be read/researched” pile.
But I’ve kept it simple for now and that seems to have done the trick.
Closing Thoughts
As can be seen in the video it is possible to get quite an interesting range of sounds out of this already!
The obvious question in all this is why the external electrical feedback from one wave output to the other? That is the kind of thing that can be relatively simply done in software. Indeed, the Mozzi FM synthesis code I used in ESP32 and Mozzi does exactly that and more!
In truth, I quite liked the idea of having more of a “virtual modular” feel in that the ESP32 can have several functions, in this case control voltage inputs and voltage-to-digitally controlled oscillators, that could be patched together using jumper wires.
I’m not sure where I’m going next, but an obvious next step might be some kind of envelope generation using the DAC outputs to modulate the PWM audio.
I really ought to do some proper thinking about those component values though. The filters are working at the frequencies I’m messing around with at the moment, but I’ve not really done any proper calculations to see what the optimal values ought to be. And it would be useful to include a little protection on the inputs and possibly some buffering on the outputs. At best I’m being rather simplistic and somewhat optimistic in my approach so far.
But this is the point (as I’ve said before) where I really need some kind of audio experimenters PCB, which I’m already sort of chewing over in the background. Watch this space.
Kevin
https://diyelectromusic.wordpress.com/2024/04/03/esp32-and-pwm-part-3/
-
In this second part of my look into the ESP32 and PWM I’ve updated the code to expand to several channels to make a sort of (fixed) simple signal generator.
- Part 1 – All the theory and research around PWM and the ESP32.
- Part 2 – Generating different waveforms on multiple channels.
- Part 3 – Introducing analog control and frequency modulation.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to microcontrollers, see the Getting Started pages.
Parts list
- ESP32 WROOM Module
- 2x 1kΩ resistor
- 1x 10uF electrolytic capacitor
- 1x 100nF capacitor
- 1x TRS socket
- Breadboard and jumper wires
The Circuit
This is using exactly the same circuit as in part 1, but I’m now configuring PWM on the following ESP32 pins for convenience: GPIO 13, 12, 14, 27.
I’ve not done anything special to combine the outputs. For these tests, I’m just moving the wire that connects a PWM pin to the output filter circuit, so I can only have one output at a time.
The Code
I’ve updated the code to maintain 4 accumulators and increment counters and it now supports four different wavetables.
The code is still using a simple, fixed frequency, but I have included an option to provide a set of frequency multipliers to each output if I want to experiment with producing harmonics. The multipliers and wavetables are pre-configured at the start of the code, but could relatively easily be made dynamically configurable in response to GPIO inputs.
#define NUM_PWM_PINS 4
int pwm_pins[NUM_PWM_PINS] = {13, 12, 14, 27};
uint16_t acc[NUM_PWM_PINS];
uint16_t inc[NUM_PWM_PINS];
uint16_t mul[NUM_PWM_PINS] = {1,1,1,1};
uint8_t *pWT[NUM_PWM_PINS] = {sinedata, sawdata, tridata, sqdata};The above configuration sets up each different wave on one of each of the four GPIO PWM output pins. The following configuration would use sine waves on all pins but giving the first four harmonics:
uint16_t mul[NUM_PWM_PINS] = {1,2,3,4};
uint8_t *pWT[NUM_PWM_PINS] = {sinedata, sinedata, sinedata, sinedata};Recall, I’m using a 256 value, 8-bit wavetable and set everything up for a 10MHz timer triggering to give me 32768Hz sample rate, with 8-bit resolution for the PWM, giving me a PWM frequency of just over 313kHz.
I’ve now added (calculated) wavetables for saw, triangle and square wave outputs in addition to the pre-calculated sine table. The new wavetables are calculated as follows:
uint8_t sawdata[NUM_SAMPLES];
uint8_t tridata[NUM_SAMPLES];
uint8_t sqdata[NUM_SAMPLES];
void setupWavetables () {
for (int i=0; i<NUM_SAMPLES; i++) {
sawdata[i] = i;
if (i<NUM_SAMPLES/2) {
tridata[i] = i*2;
sqdata[i] = 255;
} else {
tridata[i] = 255-(i-128)*2;
sqdata[i] = 0;
}
}
}To glue it all together, I’ve updated my ddsOutput routine to take a “channel” number and then in the PWM interrupt routine I just call ddsOutput for all channels.
void ddsUpdate (int ch) {
acc[ch] += inc[ch];
ledcWrite (pwm_pins[ch], pWT[ch][acc[ch] >> 8]);
}
void ARDUINO_ISR_ATTR timerIsr (void) {
for (int i=0; i<NUM_PWM_PINS; i++) {
ddsUpdate(i);
}
}
void setup () {
for (int i=0; i<NUM_PWM_PINS; i++) {
ledcAttach(pwm_pins[i], PWM_FREQUENCY, PWM_RESOLUTION);
}
}The sample code still uses a fixed test base frequency 440Hz tone for now.
Closing Thoughts
I thought this would be a lot more complicated than it was, but I guess all the essential details had been worked out last time.
I’m now wondering if I want to provide some way of mixing the PWM outputs or if that is best done in software. It would be nice to add some IO to control everything, but I think that is probably the stage where it would be worth putting together some kind of ESP32 audio experimenter PCB!
Kevin
https://diyelectromusic.wordpress.com/2024/04/01/esp32-and-pwm-part-2/
-
Just some folks duking it out over the technical and aural merits of the Gravis Ultrasound vs. Creative Labs AWE32 wavetable soundcard platforms back in 1994.
Shots were fired. (...and the audio recorded in 8-bits, but interpolated up to 16-bits on playback, so ... it sounded pretty realistic.)
https://groups.google.com/g/comp.sys.ibm.pc.soundcard.advocacy/c/O56-o5edYek?pli=1
#Usenet #newsgroups #platformwars #soundcards #audio #retrocomputing #vintagecomputing #wavetable #chiptune #MODs #tracker #DOS #PC #gaming #computinghistory #GUS #AWE32 #soundblaster
-
Video of wavetable scanning using this new visualization technique. I love it! The resulting images are so beautiful and I'm finding the visualization really useful. Making me rethink my little synth toy designs
https://www.youtube.com/watch?v=O9iZOytzOHg
code: https://gist.github.com/todbot/d1034a677e62a4b9546ff3652f4b2114
#CircuitPython #wavetable #synthio #pygamer #synthDIY -
I'm working on visualizing wavetables for CircuitPython synth stuff. Can you match the image on the left and right? Pretty cool but wow such a different way to see these waves! (each horizontal line is one waveform from the wavetable) The Pygamer is a great tool for this exploration since it has (albeit, noisy) audio outs in addition to screen + keys
#CircuitPython #wavetable #synthio #pygamer -
Time for another circuitpython synthio trick! This one's a fairly small sketch showing how to use wavetables in your synthio code. Modulating the wavetable position w/ LFO makes for such expressive tones. And we're hearing just 20% of the wavetable!
https://www.youtube.com/watch?v=CrxaB_AVQqM
The code: https://github.com/todbot/circuitpython-synthio-tricks/blob/main/examples/wavetable_midisynth/code.py
The h/w: https://github.com/todbot/qtpy_synth
(running on a QTPy RP2040; there's also a I2S DAC version for Pico)
#CircuitPython #synthio #RaspberryPiPico #rp2040 #synthDIY #wavetable -
I finally got round to put together a simple #rp2040 based MIDI/audio setup to play with some of those brilliant #synthio experiments by @todbot .
In this clip I'm checking out polyphony and a couple of #wavetable sounds using a #Pimoroni Pico Lipo hooked up to their Pico Audio Pack and @adafruit's MIDI FeatherWing (via a dodgy and bodgy DIY adapter).
His code can be found at https://github.com/todbot/qtpy_synth (I think I based my experiment on hwtest7).
-
It's not the most musical, but here's a demo showing the complexity of sound you can get from synthio using two wavetables and simple modulation. Less than two pages of code!
https://www.youtube.com/watch?v=V3454a47xIs
#circuitpython #synthio #synthDIY #rp2040 #qtpy #wavetable #synthesizer -
Oh yeah, wavetables can now be selected on the fly! Also, MIDI! This little CircuitPython QTPy synth is a lot of fun. This demo shows a handful of wavetables being explored, mostly from #Braids and #Plaits Eurorack modules. Left knob selects wavetable, right knob scans through selected wavetable. Now to fix up the messed up UI!
https://www.youtube.com/watch?v=80yjwxscnnA
#CircuitPython #synthDIY #synthio #rp2040 #qtpy #wavetable #synthesizers -
Very excited by this: morphing wavetable synth in CircuitPython! https://www.youtube.com/watch?v=4hgDi6MNfsI It's still rough around the edges, but is sounding _really_ cool. Since it's wavetable-based, swapping wavetables gives the synth an entirely different character. (did you know of this awesome set of wavetables? https://waveeditonline.com/ Just drop these WAVs in the CIRCUITPY drive & get new sounds) All on a little QTPy RP2040! https://github.com/todbot/qtpy_synth
#CircuitPython #synthio #synthdiy #wavetable #rp2040 -
the limited & special priced introduction set:
delivery in sept.
Liquid Sky D-vices #V4CO and #GLITHc
.
V4CO = #badass #8bit #wavetable #oscillator with evil
#subbass #overdrive and #vca
(so much more than just an oscillator)
.
GLITHc = #circuitbending #midi #multiples #micro #sequencer expander for the V4CO
.
the color of the frontplates is identically. i only fkkd up in the collage.
the red knobs are recycled and only available for the limited introduction set.
.
www.liquidskyd-vices.com -
There are 20+ known
#AudioSynthesis types. The most popular being:Combined with #Sampling, #modulating, #Layering, & #FX, these audio engines cover the majority of sound generation from the majority of #Synthesizer #Plugins created.
Unless a #synth provides a special character, there is no point in having more than a couple of synths.
#OpenSource has most everything you need.
Don’t collect synths for #patches, learn the tools you have.