home.social

#synthio — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #synthio, aggregated by home.social.

  1. My plan for the day is to see if I can turn these components into something that makes noise, following @todbot's CircuitPython synthio tutorials

    github.com/todbot/CircuitPytho

    #CircuitPython #synthio #ESP32C3 #weeknotes

  2. My plan for the day is to see if I can turn these components into something that makes noise, following @todbot's CircuitPython synthio tutorials

    github.com/todbot/CircuitPytho

    #CircuitPython #synthio #ESP32C3 #weeknotes

  3. My plan for the day is to see if I can turn these components into something that makes noise, following @todbot's CircuitPython synthio tutorials

    github.com/todbot/CircuitPytho

    #CircuitPython #synthio #ESP32C3 #weeknotes

  4. My plan for the day is to see if I can turn these components into something that makes noise, following @todbot's CircuitPython synthio tutorials

    github.com/todbot/CircuitPytho

    #CircuitPython #synthio #ESP32C3 #weeknotes

  5. My plan for the day is to see if I can turn these components into something that makes noise, following @todbot's CircuitPython synthio tutorials

    github.com/todbot/CircuitPytho

    #CircuitPython #synthio #ESP32C3 #weeknotes

  6. Pico Touch Board Audio

    I wanted to go back to my Pico Touch Board PCB Design and see if there was a way to make it more stand-alone. The original design was to make it a MIDI controller, but that isn’t the only option.

    https://makertube.net/w/tADSyrPrUdR1mx7yKRXZTC

    Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

    These are the key Arduino tutorials for the main concepts used in this project:

    If you are new to microcontrollers, see the Getting Started pages.

    Parts list

    • Pico Touch Board PCB – built
    • Resistors: 1x 220Ω, 1x 1K
    • Capacitor: 1x 100nF ceramic, 1x 22uF electrolytic
    • Breadboard and jumper wires

    The Circuit

    Most of the GPIO are linked out to the touch pads, but the three analog inputs are still available. They are added on to the header on the right hand side of the board at the top, so we can use one of these as an audio output.

    Initially, I thought of connecting it to an 8Ω speaker. If I was using an Arduino then I’d use a 220Ω resistor in series to limit the current to less than 20mA. But as I’m using a Pico, the maximum current has to be a lot less. I seem to recall it is a little complicated, and there are some options, but I have a figure of around 4mA that I tend to work to. It is also running at 3.3V, which means that it would need an in series resistor of 3.3 / 0.004 = 825Ω. This would work, but the speaker will be really quiet!

    So I ditched that idea (there is a software reason too, but I’ll talk about that in a moment) and went straight to a PWM output with a low-pass filter to try to give me some vaguely useful as a line-out signal.

    I’ve not done the calculations, but instead went a bit “hand-wavy”, combing a 1K and 220Ω resistor to drop the voltage, along with a 100nF capacitor. I’ve also added a 22uF capacitor to remove the DC bias.

    That seems to give me something useful, but as you can see from the trace below of a square wave PWM output, there is a lot of room for improvement!

    Update

    Ok, so going back and doing this semi-properly as per my notes from Arduino PWM Output Filter Circuit, I can see that the 1K and 220Ω resistors can be treated as a 180Ω equivalent (take them as two in parallel) for the filter circuit, which means a cut-off of around 8kHz which ought to be pretty good….

    But reducing a 3V3 signal to around 20% leaves for quite a low level of audio – around 660mV peak to peak. It would probably be better to aim for a reduction of around a half.

    Using a 1K and 500Ω resistor would be an equivalent resistance of 333Ω, so putting that into a low pass filter calculator gives a cut-off frequency of around 5kHz for a 100nF capacitor.

    Weirdly the only thing that really seems to improve things is to raise that capacitor value to 1uF. My calculation would suggest a cut-off frequency of around 480Hz which is pretty small for an audio signal. But it seems to work.

    The PWM frequency I was seeing was coming in at around 120kHz so should be plenty high enough to get filtered out. In the Circuitpython code, it is apparently chosen to support the number of bits required at the base clock frequency whilst being inaudible. For the RP2040 running at 125MHz, and with the chosen 10 bit resolution (more here) this is:

    • 125,000,000 / 1024 = 122,070 Hz

    A 5kHz (or even 8kHz) cut-off I thought ought to be fine, but Davide Bucci on Mastodon explained for me:

    “120kHz is 25 times 4.7kHz, that is about 1.4 decades and with a first-order filter you have a tad less than 30dB of attenuation, that is not a lot. A signal at 3.3V peak to peak at 120kHz becomes about 100 mV on the output after the filter.”

    So switching to 1uF, as Davide explains: “if you put 1µF, you are indeed filtering a decade lower, therefore you gain 20dB in the attenuation and the 100mV become 10mV, much less noticeable.”

    The alternative is to repeat the 1K+100nF stage and add a second order filter which also seems to work pretty well.

    The final circuit that works fine for me at present, will be on of the following.

    The first is less components but assumes that the frequencies won’t go much about ~1KHz or so. That is ok for my current setup but would limit the audio range a fair bit.

    This is the output of the two-stage filter. It is so much better!

    The Code

    I wanted to stick with Circuitpython, so my initial thought was to use simpleio.tone() to generate a tone based on a frequency from an IO pin. However, this has the problem that the code is blocking whilst the tone is playing which isn’t very useful.

    Instead I went straight to synthio. It turns out that using synthio was actually a lot easier than the “simple” simpleio…

    Here is the basic code to generate an ASR-shaped square wave on a PWM audio output on GPIO 28 based on the touch pads as input.

    import board
    import touchio
    import synthio
    import audiopwmio
    from adafruit_debouncer import Debouncer, Button

    audio = audiopwmio.PWMAudioOut(board.GP28)
    synth = synthio.Synthesizer(sample_rate=22050)
    audio.play(synth)
    synth.envelope = synthio.Envelope(attack_time=0.1, release_time=0.6, sustain_level=1.0)

    touchpins = [
    board.GP2, board.GP3, board.GP4, board.GP5,
    board.GP6, board.GP7, board.GP8, board.GP9,
    board.GP10, board.GP11, board.GP12, board.GP13,
    board.GP14, board.GP15, board.GP16, board.GP17,
    board.GP18, board.GP19, board.GP20, board.GP21, board.GP22
    ]

    THRESHOLD = 1000
    touchpads = []
    for pin in touchpins:
    t = touchio.TouchIn(pin)
    t.threshold = t.raw_value + THRESHOLD
    touchpads.append(Button(t, value_when_pressed=True))

    while True:
    for i in range (len(touchpads)):
    t = touchpads[i]
    t.update()

    if t.rose:
    synth.press(60+i)

    if t.fell:
    synth.release(60+i)

    I did experiment with overclocking the Pico to give double the PWM frequency, using

    microcontroller.cpu.frequency = 250_000_000

    But although this did double the PWM frequency to around 244kHz, it didn’t seem to make much difference for the filtered signal.

    Battery Power

    One last thing I wanted to explore was if it was possible to power the touchboard with batteries. I left in a number of power options, so for this one I’m using the 5V/GND pin header. I’ve included a couple of capacitors for smoothing, and need to add the 1N5817 diode as shown below.

    This requires the following additional components:

    • 1x 1N5817 Schottky diode.
    • 1x 100nF ceramic capacitor.
    • 1x 47uF electrolytic capacitor.
    • Jumper wires.
    • 3 or 4 battery box.

    The 5V/GND header pins connect to the Raspberry Pi Pico’s VSYS pin via the Schottky diode. The 1N5817 has a typical voltage drop of 0.45V, so combined with the Raspberry Pi’s accepted input voltage of 1.8V to 5.5V this means that ideally two or three AA batteries (at 1.5V each) would work. Four 1.2V rechargeables might be an option too.

    It might be possible to get away with four 1.5V AAs, but that would give an input voltage of just over 5.5V, so I think that is probably pushing things too far. It might be a good use for some spent AAs though that are no longer reading a full 1.5V…

    One of the downsides of battery power is that the touch works best when your fingers are at the same GND potential as the board. It works best if the GND pin of the (unpopulated) barrel jack is touched when using the board.

    Closing Thoughts

    With hindsight it would have been useful to have included a simple PWM output stage on the original board, but it is relatively straight forward to add one.

    It might even be worth me making an add-on board that will connect to the header pins of the power and analog pins containing the simple passive filter components.

    What is pretty impressive though, is how easy it is to use synthio with Circuitpython.

    Kevin

    #circuitpython #pwm #raspberryPiPico #synthio #touch

  7. My Raspberry Pi Pico 2-based Dub siren now has a simple synth engine in addition to a sample engine, so its sounds now range from classic siren sounds to air horns and vocal snippets.

    In this short video I show off the synth engine: 🎹🔈🎶

    v.basspistol.org/w/qmjJ3TY8Q8m

    thx again 2 @todbot

    And if you haven't seen it yet check out this video for yesterday's exploration of the sample engine: 📯🔈🎶

    v.basspistol.org/w/pS4PrN9Wjo5

    #CircuitPython #AudioElectronics #SynthDIY #RP2350 #synths #SynthIO #BonkWave

  8. The new audio effects libraries in CircuitPython are super fun. Here's a quick "taster" showing off some of them, part of my impending "Synthio Tutorial". Thanks Mark & Cooper for making them!
    youtube.com/watch?v=nyv7XlQ1d00
    #CircuitPython #synthio #audioeffects #synthdiy

  9. The new audio effects libraries in CircuitPython are super fun. Here's a quick "taster" showing off some of them, part of my impending "Synthio Tutorial". Thanks Mark & Cooper for making them!
    youtube.com/watch?v=nyv7XlQ1d00
    #CircuitPython #synthio #audioeffects #synthdiy

  10. The new audio effects libraries in CircuitPython are super fun. Here's a quick "taster" showing off some of them, part of my impending "Synthio Tutorial". Thanks Mark & Cooper for making them!
    youtube.com/watch?v=nyv7XlQ1d00
    #CircuitPython #synthio #audioeffects #synthdiy

  11. The new audio effects libraries in CircuitPython are super fun. Here's a quick "taster" showing off some of them, part of my impending "Synthio Tutorial". Thanks Mark & Cooper for making them!
    youtube.com/watch?v=nyv7XlQ1d00
    #CircuitPython #synthio #audioeffects #synthdiy

  12. The new audio effects libraries in CircuitPython are super fun. Here's a quick "taster" showing off some of them, part of my impending "Synthio Tutorial". Thanks Mark & Cooper for making them!
    youtube.com/watch?v=nyv7XlQ1d00
    #CircuitPython #synthio #audioeffects #synthdiy

  13. The “picotouch_drumcard” boards showed up today! I put some software on it too. A few gotchas in my design but I can make it work. Now on to sample playback, since this is labelled a drum machine after all
    #CircuitPythonDay2024 #CircuitPython #raspberrypipico #synthio

  14. I made a little 3d-printable case for my “qtpy_synth” test board to help me play with CircuitPython synthio (and Arduino Mozzi). It works pretty well, I like it better than the standoffs I originally started with. And now can have some cool matching 3d-printed knobs! printables.com/model/757087-ca
    more about qtpy_synth: github.com/todbot/qtpy_synth
    #CircuitPython #synthio #rp2040 #qtpy #synthDIY

  15. @synthdiy How easy would it be to make a #synth using #synthio and #micropython (instead of actual CircuitPython!) on #esp32

    I feel my #adhd Hobby Merry-Go-Round lurching to the next stop...

  16. A little demo of a project I've been working: I made synthesizers for every attendee of our Sketching in Hardware conference! It was a lot of fun "infecting" people with little musical noise toys. It's called "picotouch_synth" and it's an evolution of the CircuitPython synthio on Raspberry Pi Pico stuff I've been doing for a while now
    youtube.com/watch?v=0FgqWdkIjW
    more details: github.com/todbot/picotouch_sy
    #CircuitPython #synthio #raspberrypipico #rp2040 #synthDIY

  17. Great use of #SynthIO on #CircuitPython in this @adafruit guitar synth project by @ecken, @videopixil and @blitzcitydiy 🎸 🔈 🎶 🤘

    Check out the fun video on their learn guide at learn.adafruit.com/guitar-synt

  18. 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
    youtube.com/watch?v=O9iZOytzOH
    code: gist.github.com/todbot/d1034a6
    #CircuitPython #wavetable #synthio #pygamer #synthDIY

  19. 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

  20. The CircuitPython synthio panel was a lot of fun! Thank you @prcutler for organizing & hosting. Thanks to panel members John Park for the Intro to Synthesis at the start of the panel, @kattni for {musical/educator/synth}-using observations, @stylus for synthio deep knowledge, and to @adafruit for making it all happen! Here's a recording of the livestream: youtube.com/watch?v=SC4hUUfxVB
    #circuitpython #synthio #synthdiy #synthesizer

  21. More synthio fun! I took an existing CircuitPython algorithmic melody generator (bouncing balls on an 8x8 LED grid) and added a few lines of synthio. I also made it so it plays randomly in a scale (mixolydian) Thanks again for synthio @stylus!
    youtube.com/watch?v=x4vIhXtOra
    code: gist.github.com/todbot/1ecc3ba
    #CircuitPython #synthio #synthDIY #esp32 #esp32s2

  22. 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!
    youtube.com/watch?v=CrxaB_AVQq
    The code: github.com/todbot/circuitpytho
    The h/w: 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

  23. I finally got round to put together a simple based MIDI/audio setup to play with some of those brilliant experiments by @todbot .

    In this clip I'm checking out polyphony and a couple of sounds using a 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 github.com/todbot/qtpy_synth (I think I based my experiment on hwtest7).

  24. 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!
    youtube.com/watch?v=V3454a47xI
    #circuitpython #synthio #synthDIY #rp2040 #qtpy #wavetable #synthesizer

  25. 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!
    youtube.com/watch?v=80yjwxscnn
    #CircuitPython #synthDIY #synthio #rp2040 #qtpy #wavetable #synthesizers

  26. Very excited by this: morphing wavetable synth in CircuitPython! youtube.com/watch?v=4hgDi6MNfs 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? waveeditonline.com/ Just drop these WAVs in the CIRCUITPY drive & get new sounds) All on a little QTPy RP2040! github.com/todbot/qtpy_synth
    #CircuitPython #synthio #synthdiy #wavetable #rp2040

  27. Trying out some synth interface ideas in CircuitPython using one of my "picostepsynth" (aka "picostepknobs") proto PCBs and synthio.
    I really want to use pots, but I also want the pots to do multiple things. So figuring out a "knob pickup" algorithm that works intuitively is challenging. I'm getting close tho.
    youtube.com/watch?v=2Ca5fP6Zp_
    #RaspberryPiPico #CircuitPython #SynthDIY #synthio #rp2040

  28. How about a complete battery-powered MIDI monosynth in CircuitPython synthio? Three oscillator w/ 2-pole resonant low-pass filter. Great for basslines! Both USB & Serial MIDI. Responds to MIDI velocity & CCs to adjust loudness, filter, vibrato, and release time.
    youtube.com/watch?v=S1-TDjxE3Q
    #CircuitPython #SynthDIY #MIDI #synthio

  29. 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!
    youtube.com/watch?v=80yjwxscnn
    #CircuitPython #synthDIY #synthio #rp2040 #qtpy #wavetable #synthesizers

  30. 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!
    youtube.com/watch?v=80yjwxscnn
    #CircuitPython #synthDIY #synthio #rp2040 #qtpy #wavetable #synthesizers

  31. 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!
    youtube.com/watch?v=80yjwxscnn
    #CircuitPython #synthDIY #synthio #rp2040 #qtpy #wavetable #synthesizers

  32. 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!
    youtube.com/watch?v=80yjwxscnn
    #CircuitPython #synthDIY #synthio #rp2040 #qtpy #wavetable #synthesizers