Skip to content
Frontier9 – Web and Security
  • My Services
  • Admin Guides
  • Hacking Defenses
  • DIY Audio
DIY Audio

Synthesizers and Keyboard DIY

  • August 5, 2021August 6, 2021
  • by Michael

Writing mostly as a log for my own clarity – what i’ve been doing for my electronics hobby lately. Lets start with a bit of a history of electronics for me. This might be a bit of a script for a youtube video I need to make which i’ll link back in here.

I went to university Bachelor of Science and in the Physics department and Computer Science department there were subjects where one did experiments with capacitors and power (former) and digital electronics (the latter).

During and after university I had this interest in guitar playing. So owning a guitar or two the soldering iron came out to fix broken wiring (or mess it up and put switches in backwards). I opened one of my amps that fell into disrepair. A mosfet Marshall and offered it to my friend that if he got it repaired he could cover price of repair and if it was cheap give me the difference. Basically i gave it to him for free and he got it fixed because the repair was substantial. He liked it. So there the seed of “wanting to know repair” was born.

I built tons of “whiteboxes” as I moved into the employed world or for my musician friends as they grew out of being children. Whitebox = generic PC – motherboard, RAM, DISK, cards = probably for cheaper than some pre-build branded offering. So I met headers, plugs, power supplies (you have to match that). One computer sucked until we gave it a stronger power supply. These computers could run audio engineering and recording software, effects plugins. During those days we bought cheapish digital effects processors and ran cables in/out for live shows or recording. That started to get switched out for emulated effects. We had drum machines and those started to vanish for synth and sampler plugins. There was a golden age of synth and drum machine that died off.

Boss DR-5 Dr Rhythm Section Drum Machine - Evolution Music
I had this Boss Dr Rythm “Section” I got in USA and gave to my drummer brother who was learning musical composition. He loved that thing and made a ton of music on it. I’m not sure if it was this or a previous version but this looks right.

Then I formed some bands and one hired me into their trio. They had keyboards/samplers and I just had the job of the guitar so … I didn’t miss much with this. Mostly I did it on the computer.

Flash back a few years earlier I had worked contract and had to deliver it to the USA. I wrote a fully functional sequencer and synth manager for an OP3 chip. That is an FM-synthesis chip that is found on old sound cards like Sound Blaster and used for video game sound or some other basic music gear. That is from the intel 386 – intel 486 days. I wrote in C++ and assembler and I used a mac with a sequencer to compose. Then I converted the midi files into a form to run soundtracks. This was meant to be a module in video game development but my time there ended. I didn’t want to get a green card so I returned to Australia. Green cards and US citizen status are not really undertaken lightly. I’d already spent years in the USA as a child and seen a lot of the country.

Anyway, I have this history with electronics but it was kind of forced upon me by circumstance. On the other hand, I have an appreciation and soft spot for instruments.

I’ve bought midi keyboards over and over because I was moving around and needed to create but then would just give them away. Drum pads – and I have a Tenori On that I bought as a collectable because it just felt right. I bought that when I was working in France in the IT and spiritual/meditation world [it was culty]. Then I had a lot of spare time to experiment and I started to think of making my own thing – but the skills were not there.

Yamaha Tenori-On
Tenori on – first edition was metal has speakers and cute sounds. Made by Yamaha – definitely, performance-oriented. LEDs flash ad various brightnesses in an animated way. Its a grid sequencer.

The Tenori On has 16 x 16 grid but it feels limiting because it doesn’t chain together series of patterns so easily. You have to manually organize them and switch them.

These last couple of years I’ve started making digital (Arduino development and experimental boards) as well as analogue amplifiers and mp3 players. Various lighting and pre-amplifiers and a headphone amp and so on. I have to update the headphone amp because I built a second prototype which is still in use – the first one didn’t work out. Recently I repaired headphones damaged by these half working headphone amp circuits which was a good feeling to do – not hard other than to find the drivers and dismantle/assemble.

So I felt like I had done enough analogue only projects – I started back towards the digital world but wanted to bring things together. First I made this toy computer … that I had hacked and messed with into a kind of platform for experimenting. Inside it has a speaker that can also switch into headphone amplifier mode (so that’s 3 headphone amps now). It has an ESP32 that listens (samples) the audio from that amp – it has an SD card mp3 player it controls and then it does analysis and lights up a digitally controlled meter and enables colour.

A Big Step forward

All this is in the name of modules and things to build into other projects. Put meters in my amplifiers put headphone amps in parallel with other things.

Finally, I had a little platform to put the breadboard upon and keep it organized. There I started building more ideas. Previously the breadboards were always in the way when I was doing something else – now it has its rightful place and can stay together while I do other things.

Pro Kid computer toy was gutted and has a microprocessor, SD audio player, amp and speaker and headphone amp output. Audio is analysed by samples, math and converted into a colourful meter. There are also 2 PSU in Prokid – 5v and 9-0-9 for the audio parts.

Putting things into old cases of toys was the vision of buying them – but they sat around for over a year waiting for my aspiration and skill to close in. Making things strong enough to last while you toss and flop them trying to make them fit in some random box … they often break a wire or otherwise need constant on the fly repairs. So the pro-kid was the casing of one project – and it can be leveraged by others in future as a sound test input. Right now its not exactly accessible. In the picture above – on the white plastic breadboard is a working synthesizer with a USB host but to play notes on it I needed to build something else.

The Lil’lion Midi controller – 8 pots multiplexed and a hacked keyboard that is its own USB device. I doesn’t have black keys but those are linked into the fun buttons. Its a great little test device though and it’s not even fully soldered together so a solderless breadboard holds it’s main parts together. I ran out of pins on the little Arduino Pro Micro development board in this so I made 4 pins “multiplex” into 8 knobs (potentiometers) to manage synthesizer parameters.

I like to take ideas and merge them and I wanted a makeshift real keyboard that was playable. I found a toy keyboard – it was only about $5 and, while it can make sound it’s absolutely unusable and atrocious. That didn’t bother me – because it has a usable keyboard, albeit “toy” child-sized that I could hack into and integrate to locally control a copy of the synth. I wanted a proper stand-alone toy. Later I hope to put a speaker and mini amp inside it and see a child play with it (or an adult).

So I set to figuring out how to wire the columns and rows approach they use to having many keys. I figured out enough to make all the keys work using 7 columns x 6 rows (42 possible keys). When a button is pressed it can be noticed as a coordinate by which row and column are being tested when the switch is noticed. You have limits on how many wires you can link to your computer (This one is an ESP32) – I wanted to keep them free. So I got another chip called a GPIO expander – pins on these microcontrollers are called general-purpose input-output. For about $2 I could add 16 more pins. This was becoming my greatest challenge yet in terms of running out of pins.

The software is about 30% me but the modules for MIDI and synth come from Marcel Licence – see his GitHub where he has quite a few other cool things I hope to implement too. He doesn’t walk you through – you really have to want it – but you can communicate with him. He also has YouTube where you can see and envy his creations. Seems very prolific and talented to me. Envy or inspired to make it – a more positive result. If you just want a synth you can easily buy one but for me like Richard Feynman said “what I cannot create, I do not understand” .. which is to say that these man-made things can be understood. For me, nature is more mysterious.

The toy merely has printed images of eq and a screen – but nothing real. So in the spirit of “i have the power to create:

Some small technical information – this CPU is called an ESP32 – its meant to be like a wifi chip but it has obviously got many other possibilities and some rather potent computing power. 2 cores. It costs only a few dollars as a “development board” with a USB. You can load your own programs into it to read and write voltage to the pins – that way you can interface to the real world. The synthesizer creates wave forms which are transformed into a good sound using a DAC (digital to anologue) converter which is another small chip. So this has a few different parts. It has a little screen because I want to replace everything fake with something real bringing the childs fantasy into reality. I guess I’m the adult child.

To be continued – this is getting too long. I’ll present the more finished version of this little keyboard and the headphone amplifier in another post.

DIY Audio

Headphone Amplifier

  • April 23, 2021April 23, 2021
  • by Michael

This is an extension of a post I put on DIYaudio.com forum so I could collect thoughts and responses as I implemented a design for a headphone amplifier. Then I can paste some images as I go along … and in turn link back to this wordpress and put images into that article. Its part of the cycle of engineering where you build it but then refine or seek to understand, do better in future.

Why build a headphone amp – mostly just to play with one since I haven’t had anything like that in a long time and I never DIY built one. I’ve done various opamp and amp based things this is several things in one.

What follows is from the forum

Its funny how my foot keeps getting in each image of a DIY project – my footprint lol

“I’m creating this thread for someone who, like me, may have built this

Hi-Fi Headphone Amplifier

Which is actually supplied not by the good guy who runs that excellent DIY electronic audio site.

So – i’ve built about 6 amps and this was my first headphone amp. First I just built the smallest power supply that fit the needs.
They list it as needing 500ma transformer 15-0-15, but I used a 300ma and just built a small simple 7815 +7915 regulator tiny thing. Then tapped into the pre-regulator for the 22+ 22- volts lines. However, since it’s such a ****-weak transformer I end up with about 19v DC stable.

Its supposed to be a Class A … which I never made yet, I made a few ClassAB and bridged sub type things LM3886 TDA2030 LM386 and so. LM386 with a push pull booster. This was my first class A as far as I understand.

Initially, because I’m lazy i was made to pay for not putting stabilizing caps on the un-regulated supply when I started testing the complete thing. So what happened was that a comedy of errors and bugs caused me to burn out one pair of BD139 BD140. When that happened the voltage really dropped as they went low resistance internally. It also burned up one driver (i was only running one side testing one channel) of my headphones.

I believe that I just had too much gain and because I didn’t have caps it went into oscillation hell and killed itself. I don’t have a working oscilliscope yet – i used a toy thing but that broke. So I just used my multimeter to decide I killed the power transistors.
So … i ended up removing the arbitrary 20k resistors I put for feedback/gain on the first stage NE5532 (i didn’t have NE5534 so I just used a single NE5532). So that’s my first question – is a single NE5534 important – much better?

The gain on this is super important in this design from what I can tell .. so I put 2 pots so I could “adjust on test” as it said (which threw me, first time I saw that). I ended up having 0 resistance on the feedback gain (output to inverted input) so that when I replaced the power transistor push pull stage with new parts it would be more stable. I put 47uF and 100nf from the +22 to ground and the -22 to ground rather than just crossing + to –
I’m thinking maybe I should also put a bigger cap across the input between + and – unregulated input.

The opamp parts always seemed to work fine because I did, from experience, put bypass caps and resistors to their power rails. One each rail of each op amp chip. I know that you just have to do something to stabilize them or they can die quite easily (or at least NE5532 can).
Anyway – it works with all those extra caps – I did 8 caps to run the power for the 4 BD1xx transistors. I didn’t put a “base resistor” for stability because it’s not in the design and I didn’t want to mess with the biasing. I do think that it would be better to put resistors (or even zobel) between the final output and the biasing network that feeds the base of the power transistors. I haven’t tried that.

This amp is split power so it doesn’t call for an output capacitor – it just goes directly out to the headphones with 10 ohm resistors to split to two outputs. I put a switch with a zobel network of just resistor cap to ground so I can turn it off/on. I did this figuring that maybe it will reduce chance of heating up the driver if something goes wrong again and it oscillates. After I damaged my headphones I tested with transformer (600/600) between headphones and amp (that I use for isolating various things from amps when testing or just generally) After that seemed like the amp was running ok it obviously sounds way better to run headphones direct from the amp … with a signal from a phone headphone jack out … line out through transformers it seems to make little difference. With headphones it makes an enormous difference – losing tones of power and clarity. Makes sense … but I’m not an expert.

So – my zobel network is a bit odd – its 100 ohm 6.8nF. Not 10 ohm 100nf like most people use … why? Well it just doesn’t make a lot of sense to me that a headphone amp would need the same as 4-8 ohm speakers need.
I also read this High speed amplifiers for audio
It suggests interconnect zobel can make sense and even pushes for even lower values.
So why is that relevant – to my mind the op-amp output is part of what goes direct to the headphones. Its mixed with the power stage … probably to supply the lowest voltage on for whatever is lost in crossover wave gap.
The biasing network makes it such that 0.7v +/- is already present at the base so you shouldn’t get much to trigger the amplification of the + and – swing of AC signal – ie negligible crossover distortion but what might be present is replaced with the op-amp signal of the pre-amp or maybe its a driver. Its an active volume (bandaxall) op-amp design what has a voltage follower into a final amp supposedly giving a gain of 10. This would be why putting too much gain is a big mistake.

So my idea was that the zobel network is also dealing with the opamp driver signal and not just the output push pull stage so decided to use something oriented at reducing high frequency distortion (reactance related). I am happy for people to tell me why I’m wrong and if it makes sense or not to experiment with zobel network values.

I also saw a zobel network calculation for 68 ohm resistance + 1nf (ceramic cap) suggested. That would sort of match a 68 ohm resistor between the biasing diode and the base of the push pull amp so I think that kind of zobel network would be something that goes between the opamp driver and the input to the push pull part of the headphone amp. I think anything to reduce distortion on high frequencies is going to be a good thing. I don’t know that I can perceive high frequency distortion but later if I use high impedance headphones (that I don’t own now) maybe it would start to matter as the amp has to work harder.

I really just built this because sometimes music or video sources of sound from the PC are weak and I craved having an active but clean way to boost my headphone signal.

What I can say is that the bass is quite similar to the unamplified signal but it sounds more full and dynamic. What you seem to have from just the PC sound card is an adequate but hollow (compressed) reproduction but the amp seems to expand (decompress) in some cases the dynamics again. That would indicate that the compression is a function of not being strong enough to drive the headphones (even low impedence 30 to 40 ohm headphones) so it can make the tones but not reproduce the dynamic envelope of the notes as recorded. Other than this the DAC from the PC sound card is not bad sounding for an “on motherboard” one. I think DACs matter and of course I want to do a dac project can fit that with this amp. I am capable of digital electronics projects – so maybe I’ll try that some day. Or I’ll just buy some DAC chips and integrate them into another amp and have a USB to headphone amp thing.

So other oddities – the first gain stage if you use 0 resistance from out to inverted pin you get a hiss. When you add some resistance (and thus gain) the hiss goes away. So this is why it says “adjust on test” – you need some but not much gain before it goes out to the active volume control.

My active volume runs a bunch of tiny hookup wires to a stereo pot – so there is extra wire distance so I could run the volume to a different part of the case. If I designed another I’d put the stereo pot on the circuit board.”

DIY Audio

DIY Audio

  • April 7, 2021April 7, 2021
  • by Michael

I put time into build IOT and testing network things – and it took me down that pathway of electronics and general abilities. So it lead me to DIY audio – amplifiers, pre-amps etc.

Since I went down that track it became a bit of a passion and now I want to share some images I made for a forum. So I’m loading them up here. This is a work in progress and having these images helps me link to them.

This amp, so far has 3 TDA2030 chip amps … 2 work as a bridged unit with a sub woofer filter. I can fade in extra bottom end as you would – that is via a speaker box I made with a 40 watt speaker. Much of this is recycled wood or speakers and the electronics are all kind of hand made proto-type boards with a lot of point to point wiring.

This is a side view

Front left is the pre-amp with bass and treble, balance and volume … there is a mono-mixer and master volume but its a bit off the edge of the photo. That mid right side block of metal is the mono-top/mid box amp. I will replace it with a dual amp for stereo later. For now it sounds very nice in mono and who cares because its on the wall and i’m not sitting in a place where stereo really matters or works.

Its modular –

I started by bolting a transformer 15 – 0 – 15 for negative and positive rail power. Thats in the back corner with an EPS sticker on it. Then to the left it gets filtered with a fill wave rectifier and 2 10000 uF filter caps – one per voltage rail ( negative 15 to 0 and 0 to 15 positve). That produces about 20 peak voltage of DC which will sag to about 18 under load. That goes into a positive and negative voltage regulator that can be varied. In the top-left side. Out of that comes fairly clean power for the 2 amps and the pre-amp that all require twin power rails. The sub is about 40watts and the top/mid amp is about 20 watts. The transformer should supply about 90VAC if you measure it at +/- 15v thats 30v by 3 amps. The voltage regulator has some very small bypass transistors to beef up the current to 3 amps if needed.

There are LEDs that pulse with the current draw due to some resistors that create a voltage drop before the voltage regulators. That voltage drop triggers the transistors to activate and open up like a switch for more current.

Sites and Thoughts

  • Synthesizers and Keyboard DIY August 5, 2021
  • Headphone Amplifier April 23, 2021
  • DIY Audio April 7, 2021
  • Docker on the RPi May 8, 2020
  • Learn admin on an RPi? Part2 – Reverse Proxy May 4, 2020

Someone actually commented

  • Michael on An Awesome work environment improvement – setting the lights for success
  • Michael on An Awesome work environment improvement – setting the lights for success
  • Michael on An Awesome work environment improvement – setting the lights for success
  • anthony on An Awesome work environment improvement – setting the lights for success
  • Johno on So, you want a mail server

Previous Posts by Months

  • August 2021
  • April 2021
  • May 2020
  • April 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019

Categories

  • Admin Guides
  • DIY Audio
  • Hacking Defenses
  • Health and Wellbeing
  • Increase Earnings
  • Uncategorized

Wordpressy bits

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Good staff are difficult to find

Contact me
Theme by Colorlib Powered by WordPress
  • My Services
  • Admin Guides
  • Hacking Defenses
  • DIY Audio