pichenettes's blog

Sorry...

No NAMM teaser this year!

Holiday break

All orders placed until December 19th (Monday), 11 PM CET, will be shipped on December 20th (tuesday) morning. After this, we are taking a holiday break, and order processing / shipping will resume on January 2nd.

Enjoy the holidays!

An 8-bit apology

I sincerely apologize for having used the 8-bit term on the Shruthi-1 description and documentation. This is horribly misleading and silly because there is no such thing as the 8-bit synths people are talking about these days.

Let’s try to sort this mess. 8-bit can refer to:

  • The register size of a micro-processor/controller — identifying successive generations of devices and architectures.
  • The generation of home computers and consoles from the early 80s (which were using 8-bit processors), and the visual/musical aesthetics associated with this era.
  • The resolution of samples in a digital audio system (8 bits = waveform quantized into 256 levels).
  • A signal to noise ratio of 48dB (1 bit ~= 6 dB), under some assumptions about the optimality of the quantizer (Bennett’s formula).

Now let us look at some examples of devices which have, to some extent, an 8-bit pedigree:

The sound chips (or lack thereof) inside a NES or an Atari are multi-channel square/pulse wave generators (1 bit), driven at a very high clock frequency (bye bye aliasing!). The PCM channel on the NES can play sounds with a 6-bits resolution. Yet, those are maybe considered the prime example of the 8-bit sound!

The SID is even more special. The three internal accumulators are generating raw waveforms with an 8-bit resolution (again, clocked at super fast rates), but then, they are fed into an on-chip analog filter and VCA. This is indeed much closer to the concept of the “synth voice on chip” chips used on the last generation of analog polysynths. Speaking of voice chips, did you know that the CEM3394, recently put to good use in the Doepfer Dark Energy (deep in the “analog” category) was used, back in the 80s… for generating sound effects in arcade machines!

The Shruthi-1 uses an 8-bit MCU and does the internal waveform generation on 8 bits. This is, however, the first part of the story – generating a pure waveform which is always using the full 256-samples dynamic. After that, the processing is done in the analog domain, where the notion of resolution does not apply. For example, the Shruthi-1 won’t suffer from “Amiga scrunch” (remember 8-bit multichannel software mixing?) when the envelope or VCF attenuates the signal so much that you have only a few bits of dynamics left. To be fair, analog does not have an infinite resolution, since it is plagued by distortion/noise. On the Shruthi, the SMR4 VCF/VCA board has a SNR of 70dB (OTAs are noisy) which would put it on par with a digital system with a 12-bits resolution.

The Meeblip uses an 8-bit MCU, a mix of 14-bits internal processing (there are 2 bits of overhead to allow the resonance to go crazy) and a rather interesting dual 8-bit DAC allowing 16-bit output — though the limiting factor on output resolution seems to be more analog design/board noise than the DAC resolution itself.

The Fairlight used 8-bit sampling and 8-bit processors. Just like many other 8-bit sampling devices including the early Emulators, the Ensoniq Mirage, and the WTPA. What is lo-fi and what is not? I bet the answer is in the mixer, analog dynamic processors, and recording engineers the sampler is interacting with. Zoolook or Who’s Afraid of the Art of Noise? are not known for their low-fi-ness, but this doesn’t mean much about the Fairlight.

What all this shows is that the presence (or not) of an 8-bit element (processor, converter, host controller) in the chain has little to say about the sonic palette of a machine or its low-fi-ness / videogamey-ness. These qualities can be achieved by thinking beyond the presets, and by an adequate choice of recording/mixing/FX equipment, and that’s pretty much it. To makers and engineers: using an 8-bit microcontroller won’t make things magically sound like a NES — understanding band-limited waveform generation or PIT will. Keep that in mind and have great fun programming Oberheim-like brass sounds on your SIDstation, creating hyper-realistic SID emulations on your Access Virus, patching the Snake Pit arcade sounds on your Dark Energy, coding minBLEP and an I2S driver for your Arduino, and patching companders and noise-gates behind your Emulator!

Another C++ nugget for embedded programming

Every once in a while I lose faith when it comes to do embedded programming in C++. Especially when I find out that avr-gcc puts the vtables in RAM rather than in flash (bye bye fancy virtuals in the MIDIpal code).

And a few days after I find some nuggets like this one:

Problem: you have a piece of code performing a complex sequence of operations with a SPI device. It’s no longer “I give ya the address, you gimme the data”, but rather “Hello device? Device? How are you? Are you there? Hello device? Ah you’re there! Hmmm… Could you please give me the value for this address? What? ¿Hablas español?”. It can fail in plenty of different ways, with a plethora of return codes. And you have to make sure that there is no code path that will return without resetting the CS line of the device to high. That’s when you start using “goto” ; and that’s also when you’ll inevitably run into weird bugs because an aborted communication sequence you hadn’t thought about left a chip still listening to what’s happening on a SPI bus.

Solution: use RAII

A generic version of RAII for static singletons could be this:

template<typename T>
class scoped_resource {
 public:
  scoped_resource() {
    T::Begin();
  }
  ~scoped_resource() {
    T::End();
  }
};

My SpiMaster class has Begin() and End() methods to lower and raise the CS line, so the only thing I need to do is to create a scope for my SPI session:

{
  scoped_resource<SpiMaster> spi_session;
  // Every path leaving this scope will automatically pull the CS line to high.
}

Learning SMT soldering

Last month I decided to learn SMT soldering. Here are the three main reasons:

  • Many interesting parts are not available, or are hard to find in DIP (through-hole) packages. This includes ARM microcontrollers, but also cheap and large capacity RAM and flash chips.
  • I like small things, and SMT is a good way of reducing the size of the boards.
  • While there are still many factories out there doing through-hole assembly, the process is quite complicated and require unnecessary human labor. SMT boards, on the other hands, can be populated in seconds by pick and place machines.

But even if you’re not considering having your gizmo manufactured, the first two reasons should be enough to motivate DIYers to learn it!

The first thing I did was to watch online tutorials / videos. A surprisingly high fraction of them focus on using hot plates / ovens – something I wasn’t ready to set up (and the though of storing toxic solder paste in a fridge... no way). So I decided to go the simple way – with a good old soldering iron. On video, it looks so easy!

But, wait, what to solder? Sparkfun sells a simple Simon kit for learning SMT. I was put off by some bad reviews (including inconsistencies in assembly instructions or firmware files) and decided to design something by myself. The goal was to design something which would contain a variety of SMT packages (from nice to tricky), and that would have some use in a musical environment. The folks at the Mutable Instruments forums came up with many interesting suggestions, and I decided to design a small MIDI processing unit, running the classic filters (mergers, channel splitters), but also inspirational and sequencing tools (scale transformation, note delay, arpeggiator). Codename: MIDIpal. The firmware development was fast — since the device requires only MIDI in/out ports, an encoder and a LCD display, I could test everything on a Shruthi-1 digital board!

Meanwhile, I went shopping for equipment.

I decided to skip the Optivisor – I can’t stand 3D movies, I need to close an eye when I use… binoculars, so this thing looked like a Migraine-o-tron. I got a cheap loupe instead to inspect solder points, and relied on my naked eyes for the soldering.

SMT soldering requires the manipulation of very small parts, so it is very convenient to have a set of tweezers matching the different package sizes. I got those, which are ESD safe.

So far I had never used solder wick, and relied on a soldering pump to do rework on through-hole board. But I have seen a few tutorials explaining that solder wick is useful when removing bridges on small pitch packages, so I gave it a shot.

Last bit of equipment: a flux pen.

Add to that all the parts on the MIDIpal BOM... x5, to be on the safe side! One advantage of SMT parts that did not occur to me in the first place was how convenient they are to store.



The PCBs arrived last week, they look so tiny!

I made the jump yesterday evening, and I have successfully assembled two boards! Not the prettiest job out there, but it works!

Some observations:

  • I’m not sure if it is due to my cheap equipment or my lack of practice, but it is not as easy as it looks on video. In particular, my two attempts at drag soldering resulted in a big blob of solder spanning one whole side of the chip.
  • Rework is very easy! I found it much easier to fix my mistakes than on through-hole boards. It took me 5 attempts to get one side of the ATMega correctly done without solder bridges, but solder wick is close to a magical undo button! (If only it could be possible to undo the mess it does around on the PCB...).
  • In addition to the TQFP packages, the most annoying parts to solder are the electrolytic capacitors. I’m not sure if there’s a special trick for them… Besides that 0805 R/C/diodes are a piece of cake and actually equally pleasant to solder than through-hole parts.
  • It’s doable! I’m always amazed when I read about crazy tales of rework some people did on their Shruthi-1 boards, so I consider myself a soldering noob. The fact that I could do it is a good sign that it’s not that hard!

My only regret is not to have bought some good board cleaning solution – if you’re a beginner like me you’ll make some mess!

And what about the MIDIpal itself? It’s cute, and it’s a joy to use! Be prepared to see it as boards/kits/assembled units on the Mutable Instruments shop! Note that there will probably be a hardware revision first to optimize the placement of connectors…

Syndicate content