Category Archives: Software

Fast and Efficient Pitch Detection: Double Trouble

      DSP, Electronics, Infinity, Pitch Detection, Software

This D string was driving my pitch detector nuts. It’s jumping from fundamental to octave and back all over the place. Can’t make up its mind! The effect is like a wacko version of Satch with a whammy pedal gone haywire.

What the hell am I talking about? Last month, I wrote about a fast and efficient software multichannel pitch detection scheme using dual peak-detectors. I needed it to be as efficient as possible, so I can run multiple detectors simultaneously using a small 32 bit microcontroller (MCU). Most of the time, it works really well, except in some cases, like that troublesome D string.

Continue reading

Fast and Efficient Pitch Detection

      DSP, Electronics, Infinity, Pitch Detection, Software

Phase Accurate Synthesizer (blue) Tracking Guitar (yellow)

I needed to implement real-time, multichannel pitch detection in software using a small ARM Cortex-M4 microcontroller (MCU). My all-time favorite is the STM32F4 family from STMicroelectronics. It has DSP and single precision FPU instructions and can reach up to 225 DMIPS/608 CoreMark at up to 180 MHz operating frequency. Not too bad, actually, especially for this class of MCUs, but it can easily get overwhelmed with complex DSP code we normally take for granted in a desktop or laptop machine with multi-cores running in the GHz range.

I’ve been working on this for quite some time now and I am quite pleased with the results. I now have a fast, accurate, low-latency, phase-correct and efficient multichannel pitch detection. I thought I’d like to share. In case you are wondering, no, it is not for note to MIDI conversion, although that is obviously one application.

Continue reading

Virtual Pickups Revisited

      Design, DSP, Effects, Evolution, Filters, Modeling, Nu Series, Open Source, Pickups, Software

A little background: I’ve written a series of articles before about Virtual Pickups and how they are implemented in software (DSP). It’s a three part series: Part 1, Part 2 and Part 3. I wrote about Standing Waves, Nodes, Antinodes and Pickup Position, Comb Filters, some underlying Math and Simulation in DSP code. I also presented what I thought was a minimal interface I really like.

Infinity_GUIIt has taken a while (I can’t believe it has been almost 2 years now!), and now I’m back to writing the software. What has transpired since then? Production of the XR and the Nu took the most of our time and I’m left with very little time to do what we I best: R&D. Now that the Nu is out, it makes sense to go back, pick up and continue where we left off, starting with the GUI.

Continue reading

Infinity Control Panel

      Infinity, Nu Series, Open Source, Pickups, Software

Infinity_GUI

After a few iterations using my favourite graphics tools (Photoshop, Illustrator, iDraw, and Solidworks (for anything 3D)), I think this is the minimal interface I really like. I prefer using 3D CAD software for designing GUI controls even if in the end, you won’t really see the finer details once the images are rendered to a 72dpi screen (see slider at the right). slider-whiteI love solid modeling and Solidworks is simply irresistible, once you get to know the software. There’s also this nice Java app for designing knobs called KnobMan. It’s so nifty! And it’s free. it’s so useful I didn’t hesitate to donate, never mind if it’s written in Java (argh!). I used KnobMan to design and render the sprites needed to animate the knobs.

Controls

  1. Mixer: The usual suspects: level, pan and enable switch for each channel, mix to stereo.
  2. Envelope: The sliders control attack/decay ratio (horizontal axis) and the sustain level (vertical axis). The first two knobs control the attack, decay and sustain rates. The third knob controls frequency scaling. Typically, plucked string instruments have less sustain, the higher the frequency (e.g. for guitars, the low E string sustains longer than the high E string). Frequency scaling controls sustain reduction as you go up in pitch.
  3. Virtual Pickups: Here’s where you control timbre using virtual pickup simulation (see Virtual Pickups Series: Part 1, Part 2, Part 3). The upper sliders control pickup placement and skew. You can have up to three virtual pickups with controls for level, cutoff: low-pass cutoff frequency and resonance (Q). You can choose single or double coil, in-phase or out of phase and pitch tracking. What is pitch tracking? Imagine the pickup moving closer to the bridge as you fret upwards. With pitch tracking on, the same harmonic shape tracks the pitch —the nodes and antinodes follow the pitch. With pitch tracking off, the harmonic shape is fixed.

Future Features

We’ll improve this interface incrementally over time. Additional features I am excited about are:

  • Waveshaping: Distortion/overdrive in steroids. I want this to be envelope controlled. And, since we have independent control of sustain, we do not need to push this too hard to get that silky sustain heavy metal folks love. It’s purpose will be solely for timbre control. It’s all about tone!
  • Waveguide and Karplus-Strong synthesis. I’m a fan of sympathetic resonance. I love innovative (and sometimes weird!) instruments that make use of sympathetically resonating strings such as the Hardanger fiddleHarp guitars, and instruments with a third-bridge. Now, imagine the actual guitar signal driving some synthesised virtual strings. Waveguide and Karplus-Strong synthesis should not be limited to sympathetic resonance. The piano, for example, has two or three strings per note, which gives it its distinct harmonic quality from the complex interaction of the strings.
  • Pitch shifting: Global and independent pitch control for alternate tunings, pitch changes, and even whammy bar effects (e.g. using a ribbon controller). Vance Galloway elaborates: I actually rather like what the VG-99 does whereby the user has control of the “tuning” of the guitar, then can decide to double any string (like a 12 string guitar) with the doubling string at any pitch and volume relative to the original, then also have control of “bend” for each string (enabling a pedal steel type effect by using a controller to ‘bend’ any set of strings by any amount, and then also have a “whammy bar” type bend for all strings. The VG-99 does a good job at this. That said – your system could go far beyond this by allowing much more real time control of tunings, more than one doubled string (4 chorused strings anyone?!).
    And again from Vance: what about a “self tuning” mechanism. That is: a pitch shifter which is intended to correct tuning of the instrument. The old Roland VG-8 had this feature. You out the system into “listen” mode, then play all of the open strings, the system detects how much each string is out of tune and applies a pitch shifter to that string to compensate. I’m not thinking of anything as elaborate as Antares’ board which does real-time intonation correction, but rather just a quick way to correct for a guitar that has gone out of tune.
    Here’s one from David Myka: A virtual TransTrem concept where each string can be pitch bent individually to harmonize through a scale, or descend atonally, or anything. A modified rotary controller with a tensioned bar could be installed in the guitar to control it. Xaled Xaled adds: virtual capo would be a nice feature as well. Obviously per string in advanced mode. Controlling advanced settings can be done using fret control:http://www.autotuneforguitar.com/technology/fret-control.php.
  • Convolution and Impulse Response. You want accurate modeling? Nothing else compares. I’m thinking about the ability to morph between two impulse responses. Imagine smoothly morphing from a classical guitar timbre to a solid body electric.
  • Chris Varnon suggested individual envelope, pickup location or other controls for each pickup. It would add a lot of clutter to the current interface so maybe that would be better for an “advanced mode” tab. Vance Galloway adds: One interesting feature of the Roland VG-88 was its ability to place the virtual pickup on a per-string basis. I found that this really produced some interesting effects – I could “tune” the pickup placement for each song I played, so that each pickup for each string produced just the right timber. Being able to switch or even morph between pickup locations on a per string basis is going to be quite powerful.
  • Mark Galang reminded me of control over partials/harmonics especially when using the sustainer driver. Úlfur Hansson did quite some amazing things with partials/harmonics control using our much loved comb-filters in his electro-magnetic harp. I know how it’s done. It’s just a matter of presenting an intuitive user interface.
  • Yet another idea for “someday” from Vance Galloway: Even though we have a sustainer in this system, I would love to see a polyphonic “hold” effect implemented. Perhaps this is one best suited for the laptop to do, bit it would be neat to have it inside the guitar. Electroharmonix has a monophonic pedal version of this effect and the VG-99 has a polyphonic version, and it’s really quite powerful and useful. Basically it’s a small looping delay with a very smooth crossfade designed to “hold” whatever note is currently playing. It’s an intimate sustain.
    The Roland VG-99 version is near because it’s polyphonic (separate delay/sustain/loop) for each string.What they fall short on is that the user has no control of which strings are intimately sustained and which are not – all strings sustain, or none sustain.Imagine a multichannel/polyphonic version of this where the user could turn on/off the sustain on a per string basis.One could imagine being able to hold some strings and not others. Or, what if Sustain was turned on by the attack of a new note – you could create sustained chords which would be possible to play in real time by doing something like playing an open E on the low E string, then a E at the 7th fret of the A string, then a B at the 9th fret of the D string, then a G# on the 13th fret of the G string, another E at the 17th fret of the B string and a super high E on the 24th fret of the high E string.Each string would automatically enter its “hold” mode when a new note was played on it.
  • David Myka on sustain control: The sustain per sting is an awesome idea and one of the most exciting things about this design. Perhaps the level of sustain could be controlled with small ribbon controllers (one for each string) and they could be induced into sustain when strumming a chord and then sliding up the gain. I wonder if a reset button could also be employed. Something that either tops the sustain immediately or gradually. Just thinking out loud.
  • From Xaled Xaled: Polyphonic MIDI-out would be a great side project.

What else? If you have something in mind, tell me what you think!

 

The Infinity Project

      Design, DSP, Electronics, Hardware, Infinity, Nu Series, Open Source, Pickups, Software

We want to push the limits of what we can do with the electric guitar. The Neo project (starting from the Six pack project) is a stepping stone towards our goal. And from the very start, our goal has always been polyphonic sustain. Polyphonic sustain, plus extensive processing for each string, will give us musicians full control over the dynamics of the guitar. This is my holy grail and as you can see in our previous proof of concept demonstration, we’ve come closer to that goal than ever before.

Presenting the Infinity Polyphonic Sustain system:

Infinitynew

Digital Control

driver

Driver coils with integrated amplifiers.

It takes a lot more than just slapping together six EBows. A very early prototype employed a 6x analog feedback system just like the Ebow. It worked but was rather unwieldy and impractical. The phase at the driver (neck position) lags behind the phase at the pickup (bridge position) and you need some form of phase shifting (using analog filters) to align the phase properly for sustained oscillation. Without phase shifting, you have to use more force than necessary to get the string to oscillate, and that wastes too much power.

All it should take is a little nudge. That’s what I always say. I think current breed of analog sustainers inefficiently use too much power. If you pull at the right moment with just the right amount of force, you can get something to oscillate indefinitely. That’s the essence behind sympathetic resonance. With just a little amount of force, at the right frequency (and phase!), you can make a very sturdy bridge collapse, for example.

We favor a digital approach with a microcontroller (MCU) doing the phase and frequency locking and synthesising a waveform that’s fed back to the driver (more on this later). A digital system vastly simplifies the required electronics. The MCU can do the phase corrections, analyse the envelope of the input and control just the right amount of signal to drive each string to oscillation.

MCU

Acoustic synthesis

A digital system buys us a lot of flexibility. For instance, with a digital system, we can feed any kind of waveform back as long as it is coherent with the input. Recently, we’ve tried square, pulse, triangle and sawtooth. Wave tables would be cool, for example! How about samples of bow noises or wind blow noises? How about the human voice? Guitar or Piano samples? That might be cool. And, needless to say, there are no nasty squeals that plague analog feedback systems. It’s just pure sympathetic resonance!

Synthesized-Feedback

Acoustic synthesis is a powerful concept. It involves the creation of new sounds by controlling the vibrations of actual physical objects, in this case, the strings.

I’m sure most of you are aware that hexaphonic sustain has been done in the past with the Moog guitar (or the more recent Vo96 Acoustic Synthesizer). So what makes this project different? Unlike the Vo96 —a pure acoustic synthesiser, we opt to combine both traditional synthesis and acoustic synthesis.

EnvelopesThe Moog guitar, and the newer Vo-96 system use pure acoustic synthesis and advertises zero post processing. In my opinion, that is not necessary. You do not need an elaborate system for controlling everything, including timbre and dynamics. Just because you can do something, doesn’t mean you should.

Instead of pure acoustic synthesis, we prefer to post-process the polyphonic signal. You can do a lot with post processing on individual strings including control of attack and decay. An advantage of our approach is that it is simpler, requires less power, and does not require special strings! You only need to get the string sustaining, plus introduce some harmonics along the way. There’s so much potential in polyphonic processing that the Vo system shuns. A simpler system should cut the cost down considerably.

For example, we will not perform sustain dampening acoustically like the Moog did (the banjo effect). Instead, we intend to do DSP processing for each string. With post-processing, it’s easy to sculpt an envelope to achieve the muted banjo like effect. DSP processing will give us full control over the dynamics of the guitar (e.g attack, decay, sustain in addition to harmonic control). With these controls, you can have anything from banjo like short-sustain to long piano-like sustain and of course, infinite sustain.

Software

But it should not be limited to dynamics control. We’re also looking at timbre control and the injection of harmonics using various forms of synthesis techniques such as Waveshaping for timbre control (polyphonic fuzz in steroids!) and Kurplus Strong synthesis (e.g. having a number of virtual strings in memory excited by the inputs from the Neo pickup potentially modifying the parameters in real time). You can have drone strings, doubles, triples, etc. There will also be pickup placement simulation (using comb filters and short convolution for applying captured impulse response of other instruments (e.g. acoustic guitars).

The software is hosted in your laptop (or desktop). A software plugin (AU, VST, RTAS, AAX) does the multi-channel post processing and control; sending downstream MIDI data to the MCU inside the guitar for controlling feedback. The in-guitar MCU can also send upstream MIDI to control performance parameters (e.g. volume, pan, pitch-bend, cutoff-frequency, resonance, etc.) using potentiometers and other forms of user-control hardware directly from the guitar.

Further Reading

Spirit C++

      Software

Some of you probably know that I am a C++ programmer. I am a consultant at Ciere Consulting. I am a strong advocate of Open Source since 1998. I am active contributor to the Boost libraries, a peer-reviewed, open collaborative development effort. I am the author of Boost.Spirit, Boost.Fusion and Boost.Phoenix. This is my C++ Now 2013 talk “Joel de Guzman: Inside Spirit X3: Redesigning Boost.Spirit for C++11”.

I know… this hasn’t got anything to do with guitars 🙂 but this is the other side of me anyway…

 

 

 

Open Source Hardware

      Electronics, Hardware, Open Source, Pickups, Six-pack, Software

I am a strong advocate of Open Source. I have authored three Open Source C++ libraries, Boost.Spirit, Boost.Fusion and Boost.Phoenix. These libraries are all peer-reviewed, under the Boost Libraries umbrella, for which I have been active since 2001. So, you give away your time and effort to develop this cool C++ code and let people review your code through the Boost Review Process. Once you pass the review, you maintain your code and provide technical support. And you do it all for free! When I first started going down this path, I’ve been told numerous times that I must be crazy, that instead I should protect myself and not expose my work for everyone else to “steal” and that I am crazy to give it all away for free. Hah! They just don’t get it.

clockIt was in the late 90s when I started writing Open Source Software. Fast forward to 2013, now everyone knows that Open Source works and has become a revolution that eclipses even the mightiest software giant. Now, there’s a new revolution coming our way. Open Source Hardware is here! I knew it was coming, it just took more time to build enough critical mass for the movement to become mainstream. Unlike software, developing a hardware project is a lot more involved. Unlike software projects which require only a PC, a free text editor and a free compiler, with hardware projects, you need lots of equipment. Then you need to buy the parts, design and build your prototype, test the prototype and iterate over the design, ask a PCB manufacturer to produce the PCBs, design the enclosure, find a suitable plastics manufacturer to produce the enclosures, and so on. And in most cases, hardware projects also involve software development as most hardware projects now use MCUs.

I am a DIY guy. I love building stuff. I got into electronics and then computers because first and foremost, I love music and In my early years as a musician, I got inspired by people like Craig Anderton, whose articles  (DIY electronic projects) I read in magazines such as Guitar Player and Electronic Musician, and Brian May who, together with his father, built his own electric guitar which gave the band Queen its own unique sound. This same DIY culture fueled the rise of Open Source Hardware. This is evident in the popularity of DIY sites such as Make, Hackaday, and Instructables.

The electronics projects we will have here, starting from the Six-Pack hexaphonic pickup project, will be entirely Open Source. The designs (schematics, PCB layout, software, bill of materials, CAD drawings and source code) will be freely shared, 100% free, under the Creative Commons Attribution-ShareAlike 4.0 International License.