home.social

#lubuildsamonosynth — Public Fediverse posts

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

fetched live
  1. So as long as the parts aren't here, I'll switch my focus to the MIDI part of the project.

    A couple of years back, when I made my first steps with the STM32, I wrote a little demo in C that reads and decodes MIDI Note-On/Off commands and outputs the result over UART. It should be relatively straightforward to port that to Assembly.

    #LuBuildsAMonosynth

  2. Another option could be to directly use the op amp as an active high pass filter. That way I maaaybe can get away with not using a charge pump and the filter might also be a bit steeper than the passive one. Definitely worth a try, but I'll order the charge pump ICs anyway, just to be sure (+ they might come in handy one day).

    #LuBuildsAMonosynth

  3. Went to the library today and peeked into several electronics books. Found an especially interesting one about the practical application of analog electronics, with lots of audio-related circuits.

    Regarding my particular problem, it looks like an op amp configured as a buffer amplifier might be the best option. To provide negative supply voltage, I'll also need a charge pump. Both are available as inexpensive ICs, so I'll order a few of those and continue once they're here.

    #LuBuildsAMonosynth

  4. Now I *could* just go and order one of those 5€ combined DAC/line-out modules and that would save me a lot of headaches. But that just doesn't feel right at this point: I already have a DAC on the microcontroller, it generates a signal and the DC offset is filtered out nicely. If it wasn't for the impedance, I could feed this right into line-out. I feel like I'm very close to having working audio, and I'm not yet ready to admit defeat and buy a module off-the-shelf 😅.

    #LuBuildsAMonosynth

  5. Spent the last few hours trying to figure out how on earth to turn this high-impedance signal into a low-impedance source for line-level audio. I *think* I probably need a buffer amplifier, so I tried to put one together with a BC549. But no luck, the signal looked nothing like it was supposed to be. Looks like I have some more reading to do. The material I've found is quite hard to understand for me as a software guy though.

    #LuBuildsAMonosynth

  6. I'm also glad that the signal's shape now looks a lot more like the original. When I saw the first oscilloscope image, I was worried that my choice of component values might have introduced some noticeable distortion or things like that.

    #LuBuildsAMonosynth

  7. After a lot of reading, calculating and head-scratching, I still couldn't figure out why I had such a voltage drop on my high-pass filter. And then it hit me: What if I'm just measuring it wrong? So I double-checked the probes and would you look at that: The circuit worked as designed all along! I guess I just attached the probe wrongly and/or my old cheap used equipment is starting to show signs of failure.

    #LuBuildsAMonosynth

  8. Okay, the DC offset is now almost gone. But I'm a bit surprised by the large voltage drop (from 3,3Vpp to 61,2mVpp). I have to read up a bit on why that's the case (perhaps the resistor also acts as a voltage divider here?). It's probably very obvious, but it's been a while since I last worked with electronics.

    #LuBuildsAMonosynth

  9. Okay, the DC offset is now almost gone. But I'm a bit surprised by the large voltage drop (from 3,3Vpp to 61,2mVpp). I have to read up a bit on why that's the case (perhaps the resistor also acts as a voltage divider here?). It's probably very obvious, but it's been a while since I last worked with electronics.

    #LuBuildsAMonosynth

  10. 300 resistors later... 😒

    I ended up measuring every single one of them because the color coding was very hard to read. Eventually I went with picking up one end of each resistor with a crocodile clamp, holding the other end against the ground terminal and then dropping it directly in the right compartment.

    There's not much time until I need to leave for my next appointment. But I'll at least wire things up and attach the oscilloscope real quick.

    #LuBuildsAMonosynth

  11. 300 resistors later... 😒

    I ended up measuring every single one of them because the color coding was very hard to read. Eventually I went with picking up one end of each resistor with a crocodile clamp, holding the other end against the ground terminal and then dropping it directly in the right compartment.

    There's not much time until I need to leave for my next appointment. But I'll at least wire things up and attach the oscilloscope real quick.

    #LuBuildsAMonosynth

  12. The bad news: One of my multimeters has practically dissolved (rubber surfaces and the thing is now 16 years old).
    The good news: The batteries in the other one haven't leaked, even though they're four and a half years overdue.

    #LuBuildsAMonosynth

  13. The bad news: One of my multimeters has practically dissolved (rubber surfaces and the thing is now 16 years old).
    The good news: The batteries in the other one haven't leaked, even though they're four and a half years overdue.

    #LuBuildsAMonosynth

  14. Well shit... 🫠 This will take a while...

    (More proof that clumsiness and a small apartment don't go particularly well together...)

    #LuBuildsAMonosynth

  15. Well shit... 🫠 This will take a while...

    (More proof that clumsiness and a small apartment don't go particularly well together...)

    #LuBuildsAMonosynth

  16. Okay, I think I'll go with 47nF and 82kOhm since I'm aiming for a cutoff frequency of around 40Hz.

    #LuBuildsAMonosynth

  17. Okay, I think I'll go with 47nF and 82kOhm since I'm aiming for a cutoff frequency of around 40Hz.

    #LuBuildsAMonosynth

  18. The goal of today's #LuBuildsAMonosynth session will be to get rid of the DC offset in the output signal (troet.cafe/@lu_leipzig/1167109).

    Now that I have an assortment of condensators and resistors, I can build a high-pass RC filter and hopefully remove the offset with that.

    First step will be to build a quick spreadsheet to see which component values I should choose.

  19. The goal of today's #LuBuildsAMonosynth session will be to get rid of the DC offset in the output signal (troet.cafe/@lu_leipzig/1167109).

    Now that I have an assortment of condensators and resistors, I can build a high-pass RC filter and hopefully remove the offset with that.

    First step will be to build a quick spreadsheet to see which component values I should choose.

  20. Done 😎 That means I can finally continue with #LuBuildsAMonosynth... on sunday 😄 Because until then I'm busy with the family trip and also hanging election posters in Sachsen-Anhalt.

  21. Components have arrived! I have half an hour to sort as many of them into boxes as I can, until I need to leave for a family visit. #LuBuildsAMonosynth

  22. Now that the exam period is over, I can also finally continue with #LuBuildsAMonosynth. Got around to ordering some capacitors now. When I grew up, there still was a store where you could just walk in and buy components¹. These days, I have to order components online, so when I do, I tend to stock up instead of just buying what I need. But that takes a bit of research, for which I just couldn't find the time in the past couple of weeks.

    ¹ And that was in a small city of ~60.000 inhabitants!

  23. The problem is: A couple of years ago, I got rid of my old electronics components when moving to Leipzig. And that means that I don't have any capacitors at the moment.

    So I'll spend the next couple of days planning ahead a bit on which components I might need and then I'll make an order at $some_electronics_shop.

    And this concludes this weekend's monosynth adventures.

    #LuBuildsAMonosynth

  24. The problem is: A couple of years ago, I got rid of my old electronics components when moving to Leipzig. And that means that I don't have any capacitors at the moment.

    So I'll spend the next couple of days planning ahead a bit on which components I might need and then I'll make an order at $some_electronics_shop.

    And this concludes this weekend's monosynth adventures.

    #LuBuildsAMonosynth

  25. Sat down this evening to research line level audio and to generate a quick test pattern on the DAC, and I'm pleased to see that it worked on the first try 😃!

    Now I need a way to get rid of the DC offset. I'm thinking about a simple high-pass RC filter (hopefully it won't affect the sound too much though).

    And I need to add a series resistor so that I don't immediately exceed the pin's current limits when connecting a speaker, plus a potentiometer for volume control.

    #LuBuildsAMonosynth

  26. Sat down this evening to research line level audio and to generate a quick test pattern on the DAC, and I'm pleased to see that it worked on the first try 😃!

    Now I need a way to get rid of the DC offset. I'm thinking about a simple high-pass RC filter (hopefully it won't affect the sound too much though).

    And I need to add a series resistor so that I don't immediately exceed the pin's current limits when connecting a speaker, plus a potentiometer for volume control.

    #LuBuildsAMonosynth

  27. Found the culprit - I used the wrong address offset for NVIC_ISER1, leading to the interrupt never actually being enabled. I also forgot to reset the interrupt flag in my handler, which gave me the opposite problem: it made the interrupt fire way too often (once the input actually fired 🙃).

    Now it works and I went from a blinky LED to.... a blinky LED 😄. But one that is now driven by a timer! I should be able to easily extend this into driving the DAC with a timer now.

    #LuBuildsAMonosynth

  28. Found the culprit - I used the wrong address offset for NVIC_ISER1, leading to the interrupt never actually being enabled. I also forgot to reset the interrupt flag in my handler, which gave me the opposite problem: it made the interrupt fire way too often (once the input actually fired 🙃).

    Now it works and I went from a blinky LED to.... a blinky LED 😄. But one that is now driven by a timer! I should be able to easily extend this into driving the DAC with a timer now.

    #LuBuildsAMonosynth

  29. That timer interrupt just won't fire. I tried pretty much everything: The timer itself is running and seems to auto-reset at roughly the correct interval (verified the counter register in GDB), the interrupt is enabled in the timer control register and in the NVIC and the handler is placed in the interrupt table at the correct location (otherwise my fallback handler would have fired). But still, no luck.

    I'll get some sleep now and try again tomorrow.

    #LuBuildsAMonosynth

  30. That timer interrupt just won't fire. I tried pretty much everything: The timer itself is running and seems to auto-reset at roughly the correct interval (verified the counter register in GDB), the interrupt is enabled in the timer control register and in the NVIC and the handler is placed in the interrupt table at the correct location (otherwise my fallback handler would have fired). But still, no luck.

    I'll get some sleep now and try again tomorrow.

    #LuBuildsAMonosynth

  31. oh, it was easier than I thought. just had to hold down the reset button while connecting the debugger. :-)

    #LuBuildsAMonosynth

  32. oh, it was easier than I thought. just had to hold down the reset button while connecting the debugger. :-)

    #LuBuildsAMonosynth

  33. welp, managed to lock myself out of the STM32 🫠...

    Probably has something to do with my program entering sleep mode inhibiting the programmer/debugger to connect.

    I'll try and find a fix today, but probably it will have to wait until tomorrow.

    #LuBuildsAMonosynth

  34. welp, managed to lock myself out of the STM32 🫠...

    Probably has something to do with my program entering sleep mode inhibiting the programmer/debugger to connect.

    I'll try and find a fix today, but probably it will have to wait until tomorrow.

    #LuBuildsAMonosynth

  35. Got sidetracked a bit, but sat down again in the evening to read the docs on the DAC and timer. Spent waaay too much time figuring out what clock the Nucleo board actually uses too 🙃. But I think I now have a clear-enough picture of how things work to be able to proceed. So the next steps are modifying my blinky LED program to use a proper timer and then setting up the DAC with the timer at ~44100Hz to output a simple sawtooth wave.

    #LuBuildsAMonosynth

  36. Got sidetracked a bit, but sat down again in the evening to read the docs on the DAC and timer. Spent waaay too much time figuring out what clock the Nucleo board actually uses too 🙃. But I think I now have a clear-enough picture of how things work to be able to proceed. So the next steps are modifying my blinky LED program to use a proper timer and then setting up the DAC with the timer at ~44100Hz to output a simple sawtooth wave.

    #LuBuildsAMonosynth

  37. Before writing any code, I wanted to see if a 12bit DAC would even theoretically be enough to produce decent-sounding audio. So I went ahead and made a little experiment by exporting raw audio data as signed 16bit samples from Audacity and filtering that with a quick-and-dirty C program that ANDs all samples with 0xFFFC. The result sounds indistinguishable to the original, at least to my ears, so I'll go right ahead with testing the built-in DAC next.

    #LuBuildsAMonosynth

  38. Before writing any code, I wanted to see if a 12bit DAC would even theoretically be enough to produce decent-sounding audio. So I went ahead and made a little experiment by exporting raw audio data as signed 16bit samples from Audacity and filtering that with a quick-and-dirty C program that ANDs all samples with 0xFFFC. The result sounds indistinguishable to the original, at least to my ears, so I'll go right ahead with testing the built-in DAC next.

    #LuBuildsAMonosynth

  39. Built and installed Vim Classic now. Got Editorconfig and Wayland clipboard integration to work again after a bit of head-scratching and installing two plugins from source.

    I usually don't install software from outside the Debian repos, so not too sure how I feel about this yet.

    #LuBuildsAMonosynth

  40. Built and installed Vim Classic now. Got Editorconfig and Wayland clipboard integration to work again after a bit of head-scratching and installing two plugins from source.

    I usually don't install software from outside the Debian repos, so not too sure how I feel about this yet.

    #LuBuildsAMonosynth

  41. And since #VimClassic was released a couple of days ago, I'll use this as an opportunity to install and test-drive that as well.

    #LuBuildsAMonosynth

  42. And since #VimClassic was released a couple of days ago, I'll use this as an opportunity to install and test-drive that as well.

    #LuBuildsAMonosynth

  43. Alright, after weeks of being too busy to do anything, it's finally time again for some #LuBuildsAMonosynth today!

    My goal for today is to test the DACs built into the STM32F446 if they're suitable for producing at least passable audio and to maybe experiment a bit with generating different waveforms, depending on how much time is left.

  44. Alright, after weeks of being too busy to do anything, it's finally time again for some #LuBuildsAMonosynth today!

    My goal for today is to test the DACs built into the STM32F446 if they're suitable for producing at least passable audio and to maybe experiment a bit with generating different waveforms, depending on how much time is left.

  45. Another weekend packed full of household and university tasks (including everybody's favorite: doing taxes) so, sadly, again no #LuBuildsAMonosynth this week 😢.

  46. ...and that concludes today's electronics tinkering. Next time, I want to take a look at generating a signal using the controller's built-in DAC and see if it's any good for audio output.

    I don't know yet when I will have time to spare for this the next time, but this was a ton of fun so I'll keep going when I get the chance 🙂.

    #LuBuildsAMonosynth

  47. Main motivation for this project is that I wanted a creative side project to get my mind off uni and everyday stress.

    First I thought about building a virtual synth, but with the Linux stack quickly ensloppifying, that was quickly ruled out. I'm sick of getting the rug pulled from under my feet by some maintainer dude deciding to jump on the AI bandwagon. So I wanted something as independent as possible. And I think it doesn't get any more independent than a µC + Assembly.

    #LuBuildsAMonosynth

  48. Since I'm switching to English for this side project, here's a little recap of what is planned so far:

    - a virtual analog monosynth
    - on an STM32F446 (that's a Cortex-M4)
    - programmed in Assembly, to maximize control and minimize dependencies (plus: for fun and additional challenge)
    - controlled by an externally connected MIDI keyboard
    - later: own case with dedicated controls (but still external keyboard)

    There's no time plan for this project, I'm doing this as a hobby.

    #LuBuildsAMonosynth

  49. RE: troet.cafe/@lu_leipzig/1164941

    Okay, ich mach das jetzt einfach! Zumindest einmal langsam in die Richtung losstiefeln und schauen was passiert. 😃

    Und den Projektfortschritt möchte ich auch in Form von Toots festhalten. Allerdings auf Englisch, weil technisches Thema.

    Erwartet keine rasanten Fortschritte, oder dass das Projekt jemals fertig wird, denn Hobby bleibt Hobby.

    Ich werde alle Beiträge unter den Hashtag #LuBuildsAMonosynth packen, zum finden, folgen oder filtern, je nachdem 🙂