Tuesday, 25 August 2015

DX7 Voice Banks on the Web

If you've got a Yamaha DX7 you know that it's a nightmare to program, perhaps unless you've got one of these. For the rest of us, there are DX7 voice banks galore that can be googled and downloaded from all over the place. Or, if you can't be bothered, you can go to Bobby Blues' All the Web Patches Collection where apparently he assembled and zipped into a single archive all DX7 voices that he could find on the web.


If you download and unzip the archive, you get about 3000 files in 79 folders, each file containing a sysex-dump of a DX7 voice bank consisting of 32 voices. That's a lot of voices to sift through!

After listening to these voices for a while, you get the impression that they all sound the same. There are many reasons for that. Among the more prominent ones is the fact, that, chiefly, most DX7 sounds fall into one of three categories:
  1. E-Piano
  2. Brassy
  3. Other
Therefore you shouldn't be surprised that many of them sound very similar. But there's also a more mundane possibility: They sound alike because they are the same. In a collection of this size you are bound to find a lot of duplicates.

In order to test that proposition (and to avoid having to check the same voice over and over again), I wrote a small tool to help me identifying duplicate voices in a collection of banks. You can point it at a folder and it will traverse all sub-folders and read all *.syx files that it finds along the way. At the same time it culls all init and null voices. Init voices are those that you get when you initialize a voice slot for editing on a DX7. Zero voices are those that are just a stream of 0s. Most likely they are originating from unused slots in a software librarian.

The voices are then "sanitized", i.e the voice parameter values are clamped to their legal ranges. This is necessary because voice authors sometimes watermark their creations by specifying bigger-than-legal values for certain parameters. Because such values cannot be specified ordinarily, the voice must have been copied (as in "pilfered"). Or so. In any case, the DX7 will simply clamp a value to the legal range (e.g. 0-99 for an operator's output level) when reading such a voice, so we'll do the same. A sanitized voice (118 bytes = 128 minus 10 for the voice name which we ignore) is then interpreted as a binary (118*8=944bit) number and inserted into a sorted list. This way, duplicates flock together and can easily be identified. Note that a "voice" in this sense is simply a certain configuration of (legal) voice parameter values. It is possible that many of these configurations sound exactly the same (e.g. if the parameters of the first two "stacks" of algorithm 5 are swapped). But they are different configurations and hence treated as different voices.

If we do that on Bobby Blues' DX7_AllTheWeb archive we find that there are in total 95936 (non-null, non-init) voices in 2998 banks. Of these nearly 96000 voices, 26761 are distinct, and among them 11937 unique. Thus, on average, a single voice appears 3.5 times, or more precisely (because 11937 of them appear exactly once), the ones that are not unique appear on average 5.7 times. Indeed, some voices appear as many as 92 times across various banks! There are also several duplicate banks, i.e two or more banks that contain exactly the same voices (though not necessarily in the same order). But there is also a sizable number of unique banks, i.e. banks that contain only unique voices.
Screen shot of librarian showing all copies of the voice selected.
Note that the same voice is stored under various names in different banks.
Voices in orange in the left pane are unique (1 copy in the full archive).
Now all that duplication leads naturally to a question: how many of these banks can we delete in order to get the smallest number of banks still containing all voices? Good question! This is an instance of the set cover problem, where you want the smallest number of subsets covering the whole set. You can compute the exact number(s) using a branch-and-bound algorithm, but that is too much of a hassle. You get a good approximation by continuously adding those sets (banks) that contain the largest number of yet uncovered elements (that would be voices in our case), and then deleting those voices in all other banks that contain them. If a bank loses its last voice, it is empty and can be deleted. This algorithm assumes, of course, that we don't rearrange voices (move between banks to fill them up). We only want to eliminate complete banks that we don't need because all the voices therein are already contained in other banks.
Banks in blue are those with more than one copy (selected has five).
Banks in orange are unique (contain only unique voices).
Note that one library contains the same bank under 3 names (Cart4, Ray-1 and Ray-5).
Because unique banks contain only unique voices, we can move them immediately to our final set. Next follow all those non-unique banks that contain one or more unique voices. Because these voices can't be anywhere else we must include these banks trivially, too. For the remainder of the banks the algorithm proceeds as specified above by finding and including those banks that contain the largest number of yet not-included voices, etc. In the end, 1382 banks remain. That's about half the number in the archive, the other half is unnecessary -- coverage-wise.

Still, there are 26761 distinct voices, and if you want to audition them all they should keep you busy for a while. Well, at least you shouldn't expect too many duplicates anymore...

Monday, 24 August 2015

V/Oct Calibration Tool

I'm currently upgrading a few of my first DIY synthesizers by adding MIDI control and perhaps also renovating the front panel. I also want to re-calibrate the tracking of all the oscillators of the first synths I built in order to have a proper volt/octave scale for the MIDI/CV converters to work with. To that end, I built a small V/Oct calibration tool based on an old circuit by Ray Wilson of Music From Outer Space that he mentions in one of his earlier VCO circuits. In contrast to Ray's tool, mine spans a 7 octave range by supplying voltages from 0 to 7 volts.

V/Oct calibration tool. Soon with enclosure.

I started by selecting a couple of resistors from a batch of 50 or so (10k 1% metal film) for equal resistance using a Wheatstone bridge. I managed to find two groups of 3 and 4 resistors that among them produced a midpoint voltage of 0.0mV (when measured using my cheapo DMM), with the two groups being 0.1mV apart. I don't know how that difference translates to resistance, but in any case they all now seem pretty equal to me. :-)

I used these resistors to build a multi-level voltage divider to produce the voltage steps starting with the 7 volts on top of the chain. Incidentally, I get the top 7 volts by simply swapping the 47k and 68k resistors in Ray's circuit (trimmed to precision using a 10k multi-turn trimpot). The calibration tool's power is taken from the synth's power supply. Two LEDs on the front panel show proper connection to both negative and positive supply voltages.

It took a bit more time to build than I anticipated (I did it on perfbord with the component leads providing the connections between parts), but now that it's finished I actually look forward to tediously calibrating all the oscillators.

Friday, 22 May 2015

Mutable-Instruments Shruthi-1

22. May 2015
I've visited the site of Mutable Instruments many times in the last two years or so, and pondered and contemplated buying one of their fine synthesizer kits. But then I paused visiting them for a while, and while I was absent they appear to have stopped offering some of them. You can still download and manufacture on your own their PCB designs, but ready-for-assembly kits are gone. The only synthesizer that they still sell kits for is the Shruthi-1, and nobody knows how long stocks will last. I wonder if you can guess what happened next...

If what you guessed rhymes with "bought a kit" you're on the right track. Indeed, I just received the kit by DHL, and here's what I've got.

Full kit with PCBs, parts and metal enclosure.
Filter board. Pretty little details...
Really nice and solid metal case.
As I have written elsewhere I prefer interesting standalone synthesizers to giant modular racks, and that's why I couldn't resist adding a Shruthi to my growing collection of DIY gear. Building the device shouldn't take too long -- a few hours they say on the web site. That'll give me something to work on while I'm sourcing all the necessary parts for the ASM-2 that I also just bought a PCB for.

25. May 2015
I started stuffing the filter board. I finished the power supply and soldered all resistors. The board pretty much looks like step 10 on the very detailed step-by-step Shruti assembly instructions page. Which is why posting any pictures of my progress seems pretty pointless, come to think of it.

26. May 2015
Done! After having completed the filter board I started stuffing the control board. It has far fewer components and was completed in half the time it took to stuff the filter board. Some care is required, though, because there are parts on both sides of the board, and you need to be careful that they don't interfere with one another, especially with the display. Before mounting the display I made sure the micro controller booted correctly, as suggested in the building instructions, because it'll obscure parts of the micro controller's solder pins and render them inaccessible.

After having soldered the display in place and also the controller elements (buttons, potentiometers and the encoder), I was ready to calibrate the filter to a V/oct scale. I did it "by ear" using my DX7 as a sine wave source. It's not the most accurate way of doing this, but I managed to match the filter's resonance sine wave to that of the DX's to within a fraction of a cycle. That's good enough for me. Mounting the PCB stack into the metal case completed the project.

Building the Shruthi-1 took me about a day, and I'm not the most efficient builder. Anybody more experienced should be able to complete it in a few hours. And what does it sound like? What I've heard so far sounds very cool, especially the built-in arpeggio and sequencer. I'll make a YouTube video to show off the synth but first I'll have to waste some time with it.

Wednesday, 3 December 2014

RAM Cartridge for the Yamaha DX7 Synthesizer (Part V: Success)


This is part five of my report on building a RAM cartridge for the Yamaha DX7 digital synthesizer, and finally I've got some positive news: I've got a prototype that works! Since my last failure report I ordered another prototype batch, this time using seeedstudio's Fusion PCP service, and a 1.2mm thick board. I also ordered on eBay a replacement cartridge socket so I could wire the connector out of the synthesizer and in the future plug the prototype panels in without wearing out the cartridge socket of the DX7.

The layout of the new PCBs is the nearly same as that of the ones manufactured at OSH Park. They're only thinner, i.e. 1.2mm instead of 1.6mm, and this time I even added a pad for the (necessary?) 2.2uF decoupling capacitor. Soldering the handful of components was quick and painless. When I plugged it into the DX7 for the first time (the external connector isn't set up yet), it didn't work. The synthesizer simply didn't recognize the cartridge. To my utter dismay it appears that the PCB is too thin now, as it slipped right into the socket without any force. I could make the DX7 recognize it, however, by pressing it slightly backwards. Still, it didn't work: I consistently got a Write Error. I was quite convinced by then that there was a fundamental problem with my design.

I studied the circuit diagrams again for hours, even wrote a quick'n'dirty disassembler for the DX7's main CPU, the HD63B03X, to disassemble the system ROM and inspect the routines for writing the cartridge. I also started making a connector probe using one of the PCBs with wires soldered to the EEPROM solder pads. This would allow me to signal-trace the various EEPROM bus signals, especially the two chip select lines /CE1 and /CE2 and the write enable line /WE. Because the PCBs are too thin I planned to cover the connector pads with some solder to make them slightly thicker. For good measure I did the same thing with the prototype PCB for a final test to make sure it wasn't a dodgy connection that caused the failure.


I plugged it in, and it went quite nicely into the socket, requiring some but not excessive force. Then I pressed the cartridge voice selector. The display read FORMAT CONFLICT! So I pressed function 8: format cartridge. The display read CARTRIDGE FORM ? I pressed yes. ARE YOU SURE ? Yes. MEMORY PROTECTED. Oh, sure, I forgot. I pressed the cartridge protect selector. MEMORY PROTECT CARTRIDGE ON. I pressed off, then function 8. CARTRIDGE FORM ? Yes. ARE YOU SURE ? Yes. UNDER WRITING ! I stopped breathing. Then, after a few long seconds: FORMATTING END. I took a breath. It worked? I pressed the cartridge voice selector, then voice 1: INIT VOICE. Voice 17: INIT VOICE. It worked?? I saved the internal memory onto the cartridge, and after a few seconds of UNDER WRITING I found all my voices on the cartridge, and they sounded exactly as they're supposed to. I even switched the cartridge to the second bank, ran the same formatting exercise and ended up with a cartridge that had my voices on one bank and init voices on the other. It worked! Success! Oh, sweet success!! How can I ruin it. I need some rest. And another breath.

Monday, 3 November 2014

RAM Cartridge for the Yamaha DX7 Synthesizer (Part IV: Reboot)

This is part four of my report on building a RAM cartridge for the Yamaha DX7 digital synthesizer. It took a while since the last installment, because I've got several hard- and software projects that run in parallel. One is a hardware programmer for the DX7, a bit like this Jellinghaus DX programmer, but with far fewer knobs, but a graphical display instead. Another is a user interface (including graphical display) for a Yamaha XG synthesizer based on a DB50XG daughter board, and the third is a software librarian and editor for the DX7.

Anyway, I completely redesigned the RAM cartridge, this time using a correctly sized edge connector, correct pin assignment, and a through-hole EEPROM.


Furthermore, I tried to stay within the confines of the original cartridge board area. The packing is dense but not too crowded. Soldering the components was quick and painless. The board is suitable for both 64kbits (suitable for 2 DX7 voice banks) and 256kbits (8 banks) EEPROMs. To test the board I use the simpler 64kbit device and a an ordinary sliding switch in the position of the rotary coding switch (top left corner of the board), and only one additional resistor. I didn't include a pad for the 2.2uF polar capacitor, but managed to mount it between 5V and ground by soldering it to the power leg of the EEPROM and the bottom pad of R1 to the left of the memory chip. The finished board looked quite neat and tidy, a far cry from the mess of the previous prototypes. I couldn't wait to test it in my DX7.

Well, make that last one "I couldn't wait to test it in my DX7". It seems the board is too thick. I could possibly force it into the connector, but I don't want to ruin my DX7. The boards do have a solid if not heavy feel. Nonetheless, OSH Park's pricing and spec page states that the boards are 1.6mm thick. They're closer to 1.8mm. When I tested my previous prototypes I thought that even my 1.6mm thick hand crafted adapter was close to the limit regarding the force required to set the board into the socket, but these are just too thick.

This is very unfortunate, because I like the quality, price and ease of use of OSH Park, but for this project I can't use their service. I need to find a different prototyping service that allows specifying thinner boards, perhaps 1.4mm or so.


Tuesday, 7 October 2014

Cheap Home Recording Desk

When I have any spare time, I not only build synthesizers and guitars (more or less artfully) but I also use these devices to make — and hopefully publish someday — my own music. In addition to the DIY gear, I also have a Yamaha MOX6 music production synthesizer, a light version of Steinberg's Cubase DAW that came free with the MOX, a set of studio monitors, and a small Behringer mixing console. All of that constitutes a fairly complete albeit very simple home recording studio. What was missing so far is a desk where I can bring all this to life. Buying a professional desk is, of course, completely out of the question, but on IKEA Hackers you can find desks like this one that may not look like a lot but apparently serve their purpose well.

There's an IKEA store a few kilometers from where I live, so why not go there and look what's on offer? I did, and here's the result of my endeavour: a cheap home recording desk that looks far better that I deserve for my stinginess.

Recording desk, assembled.

It is not the most robust desk, but at least I've got one now. I can always improve stability, for example by adding another shelf console, or a trestle on one side of the desk. In its current state the desk consists of the following standard IKEA items:

Qty.ArticleArticle no.Unit priceSum
1LINNMON table top002.513.43CHF 29.95CHF 29.95
4ADILS table leg702.179.73CHF 5.00CHF 20.00
1EKBY JÄRPEN shelf200.943.47CHF 14.95CHF 14.95
2EKBY TÖRE console502.510.29CHF 7.50CHF 15.00
TotalCHF 79.90

All together a tad below CHF 80. That's EUR 65.87 / USD 83.20 / GBP 51.76. I challenge anyone to beat that!

Recording desk with tentatively placed monitors and keyboard.
Nice!

Friday, 26 September 2014

The Noisy Cricket Guitar Amp

The Les Paul DIY guitar project is nearing completion. Only a few more coats of Tru-Oil, and then assembly, wiring, stringing, tuning and intonation are necessary. Oh, wait...

What I really meant to say is that I want a small guitar amp that I can take anywhere. When googling "simple diy guitar amp" you'll quickly come across the Noisy Cricket Guitar Amp, the latest of a series of LM386-based mini amplifiers like the Ruby amp, Little Gem and Smokey Amp. It is a simple amplifier running off of a 9V supply (wall wart or battery) and consisting of a handful of components around a LM386 audio amplifier chip.

You can find various veroboard designs for a Noisy Cricket on the intertubes, but I chose a small protoboard to build mine. Here's a picture of the component layout. I usually do small layouts in Microsoft PowerPoint. No, I'm fine.

Veroboard panel. Note pinout difference between MPF102 and 2N5951.

I ordered all the components at Futurlec, especially the LM386 that I don't have at hand. It's one of the cheapest supplier, but they ship from Hong Kong which takes at least three weeks. The speaker is a small 10cm Visaton full range speaker (FR 10 HM) from Conrad at less than CHF 15, including shipping.

The build follows closely the guide on DIY Strat with the following exceptions: instead of a separate power switch I'm using a potentiometer with switch for the volume control. I also had to use a 2N5951 JFET instead of the original MPF102, and finally, I'm going for an integrated amp and speaker design.

Noisy Cricket parts

I soldered the board according to the layout above. The picture below shows the result (LM386 not in place yet). Note that the board is not a stripboard. Therefore the connections have to be made by bending and soldering the component leads appropriately. Apart from the two gain connections on pins 1 and 8 of the LM386, no additional wires were necessary to complete the circuit.


The leads that stick out on either side indicate the connection points for the potentiometers, switches, and power as indicated on the layout above.

Panel wiring in progress.

In the meantime I brought my (limited) wood working skills to fruition and built a wooden cabinet for the amplifier. As usual, the corners are nearly but not completely at right angles, but thanks to modern photography it can all be blamed on visual perspective.

Raw amplifier cabinet, sanded and ready for staining.

I then stained the box using a water based mahogany stain, and after it had dried completely, I applied 3 layers of Tru-Oil, giving it a nice vintage look that goes very well with my shoddy wood work.

Stained and oil-finished cabinet, surrounded by a glow of contentment.

I also finished the panel wiring, and the amplifier is now more or less ready for final assembly. The following picture shows the completed panel. From left to right we have volume control with power switch, tone control, grit, gain control, and bass switch. The protoboard is attached to the back of the panel using an aluminium carrier that is held in place by the grit switch. I soldered a 4 pin connector (Vcc, Ground, Input, Output) to the board to allow for easy assembly/disassembly.


The connector plugs into a 4 pin header that is part of the back panel, where the input, headphones, and power jacks are located (see last picture). There's also a 2 pin header there for the actual speaker.

After having fixed a small problem with the protoboard (I had forgotten the connection between pins 3 and 4 of the LM386; see design above), the amp worked! YES!!! It won't fill a concert hall, but as an exercise amp for the living room, it'll do just fine.

The controls have less effect than I expected, something I have to check, but at least I get some sound through the speaker. The connectors have already paid off, because now I can disassemble, check, fix, and then reassemble everything. For now, I have assembled everything and made a few pictures.

Finished guitar amp. I'll look for a speaker grille later.
Back of amp with power, headphones, and input jacks.
This more or less completes the construction of the Noisy Cricket Guitar Amp. I'll check the tone, grit and tone controls to see, if I did everything right, but for now I'm quite satisfied.

I'm aware that you can get a Marshall Micro Amp for around 50 Dollars, but to be honest, building the Noisy Cricket was way more fun than making an online order.