Was laying out the #kicad #schematic for #muvco and it started to seem too pedestrian.
Went back and realized I had been using the #pcm5102 wrong and it does indeed do exactly what I originally wanted.
Now making a waveform generator instead of using the dds #ad9833. Much more flexible in shape and can be semi-polysynth ("chordal #synth"?) #synthdiy
Can now generate a perfect 5th in 260us! In mostly-unoptimized #micropython! Just dyads still--need to generalize to larger chords + diff shapes.
#kicad #schematic #muvco #pcm5102 #ad9833 #synth #synthdiy #micropython
@cedargrove Just glancing over how you organized this I finally understand why I've had problems with the #ad9833. I've been thinking of the process as "I give a command and you obey" while it is actually "I put you in a state and you react".
That said, I'm still not sure I can do audio rate FM synthesis unless I came up with a completely different concept for input.
Oh. Among other problems, I just realized this will never work in the setup I have now.
I'm reading the FM input via #micropython. That inner loop is reading at no more than few hundred Hz, so I can't modulate with more than a couple hundred Hz. Just proved this by turning the modulation freq until I heard it aliasing. 350Hz
I'm controlling the #ad9833 via #spi, so there's no good #analog way to do the FM.
I already have the jack and knob wired in, tho. What else can I use it for?
#micropython #ad9833 #spi #analog #synthdiy
Aha, no, I see. You can't just add 180 anything in a sinusoid and end up at the same amplitude. Just think of the two peaks as a simple example.
A click-less through-zero would need to start counting the phase accumulator backwards. Which the #ad9833 doesn't do.
I think this needs a low-pass filter with a very, very high cutoff frequency.
#ad9833 #electronics #synthdiy
Ugh, there's a problem with the through-zero linear fm "just flip the phase 180" idea for #muvco.
#AD9833 works with a phase accumulator. Meaning it just counts up in a ramp at a rate given by the freq. Then it adds the phase register.
When I flip to the other phase register, it's a discontinuous jump = an audio pop.
Can't count backwards. Don't know where I am in the phase (I think) so I can't just add 180 to that (the #math way)
Maybe just a low-pass #filter to drop the pop?
#muvco #ad9833 #math #Filter #synthdiy
Got the code to control the #ad9833 phase registers written in about 15 minutes.
That was 3 hours ago.
I can flip registers back and forth. But I can't seem to set the value. Or it has no effect. I *always* get a phase shift of ~pi/2 instead of pi, no matter what values I put into the phase registers.
grrrrrr
I threw an FM knob on the #muvco just b/c I thought I oughtta. Getting to that part now, it looks like I'd prefer linear FM with "through-zero"
Conceptually, that's really simple to add purely in software with the #esp32 + #ad9833 b/c it has two phase registers. Init them to 0 and 180 and flip when the frequency sign toggles.
Hopefully takes just an hour or two today. Then I could hook the VCO into existing VCF/VCA #eurorack modules and retry Bach a little more musically.
#muvco #esp32 #ad9833 #eurorack
@julien On the #midi->cv I'm using using the #mcp4728. I plan on making a dedicated midicv #eurorack module maybe as my next project, but I had this available for testing.
On the #VCO itself, it's the #ad9833 which is sort of secondarily a #DAC and primarily a digital synthesis chip.
I'm starting to have a neat idea about maybe a clever software + hardware way of doing polysynth myself pretty simply and cheaply. I have to experiment with it, tho.
#midi #mcp4728 #eurorack #vco #ad9833 #dac
@matt_trentini @dave @fuzzySynths I definitely walked in with a plan to bitbang. Reading about #micropython interrupts disabused me.
I'm not sure what RMT is. I looked at an #I2S device but it kind of sucked. The #ad9833 is #SPI and works beautifully but has predetermined waveforms.
I wondered about storing wfs in an #eeprom but it needs more thought. Still need to output a phase ramp at a high rate. #esp32->DDS ramp->eeprom->DAC?
#micropython #i2s #ad9833 #spi #eeprom #esp32
@dave @fuzzySynths I was thinking about the same thing for getting #midi going. The problem is, I already used the wifi pins for adc, so I need another idea. midi keyboard?
Thanks for "DDS ladder" that fills in some blanks for me. I guess you are creating a DAC from scratch? I'm using the #ad9833 largely because #micropython was too slow for realtime audio.
I did the zeners and opamps already because I'm terrified a real #eurorack module will explode me otherwise.
#midi #ad9833 #micropython #eurorack
Fixed ramping on #synthdiy #microcontroller #micropython (#python) #muvco by eliminating high-pass input on CV. Had a mess on the front end and now have a theoretically correct and practically simple setup
Now to fix #ad9833 output--still a mess of ideas. One problem is it outputs <1V for sine and triangle but 5V for square. Fortunately you can't really clip a square, so I can slam everything to 12V and then scale down
One opamp to scale and bias, another to reinvert and unslam...?
#synthdiy #microcontroller #micropython #python #muvco #ad9833
Progress on the #microcontroller #micropython #synthdiy VCO. It makes sounds.
The octave control spans 6 octaves here and the tuning 2 octs. Other inputs do nothing yet--input needs scaling first.
Speaking of scaling, output of these aren't normalized to each other. <1V vs 3V3. How would I do that from a single output, #analog #electronics?
Except maybe I should really turn the sine to square anyway so I can PWM it (#ad9833 doesn't do pwm). Then normalization is free.
#microcontroller #micropython #synthdiy #analog #electronics #ad9833
I was just about to post about how the #ad9833 was really kicking my ass, but then I Tried One More Thing.
The datasheet is kind of confusing and the examples I found online don't seem to work. (Could look at them again knowing how it should actually work and see what I/they missed.)
I got my A4! Now to turn the example code into a working prototype.
#ad9833 #esp32 #micropython #electronics #synthdiy
Good news: I got the #ad9833 to produce a sine wave.
Bad news: I was aiming for A4 and got A(-7).
Getting closer, tho....
#ad9833 #synthdiy #music #electronics