New plugin GuitarMidi-LV2

GuitarMidi-lv2 deploys a filterbank of elliptic filter with sharp bands followed by monophonic pitch estimators. I’m working on analysing the amplitudes of each partial/fundamental and applying physical assumptions based the vibrating string model to count how many strings are vibrating

7 Likes

Its rather 15-20ms. I’m writing an analysis app to verify. Sorry

4 Likes

Still not bad, and nearly twice as fast as Roland.

The Axon and Tripleplay have an average latency of 13 ms at note 40 (low E) and tails at 15-17ms. But both are fed by hexaphonic pickups. Só yours is performing remarkably well.

The elliptic filter approach is quite smart and very appropriate. Can’t wait to try it out!!

More than happy to assist with testing.

6 Likes

Thanks

Funny enough I’ve tested Butterworth filters in a dev branch and they seem to perform better.

3 Likes

Well, they are “smoother” so to speak. I employ Butterworth (in hardware) to eliminate mechanical noise from piezo pickups. At one point Roland did away with subsonic filtering (starting with the VG99) and piezo users were in trouble, until RMC came to our help.

Elliptic filters can be made a lot “sharper”, so it seemed a better idea for your device. I’m curious to see what you find out.

(I’m no specialist by the way. Just an overly curious person.)

5 Likes

Well while the elliptic filters have favourable features in the frequency domain, they have bad characteristics in the time domain. Above all non linear phase response according to the literature. This means different attack times at different frequencies. The fundamental freqs of the lower strings have higher latency than the higher strings. I’ll back this up with diagrams once my analysis app is ready

5 Likes

This is cool, I’ll check it out later this week. For a project related to my BSc, I built my own monophonic pitch detector using McLeod’s PDA and used it in a sine wave synth plugin.

2 Likes

Cool. Is the code online ( github, gitlab…) ?
Would like to check it out.
Is it this article http://riogrande.cs.tcu.edu/1516Ribbit/resources/A_Smarter_Way_to_Find_Pitch.pdf ?

Seems interesting. GuitarMidi-LV2 does deploy monophonic pitch detectors, currently the Schmitt trigger from aubio. Those 4 periods for reliable estimation at low freqs. If McLeod’s is better we could work together on implementing that in guitarmidi

2 Likes

I have it on my own server but you should be able to clone it with git clone git://kallinen.xyz/gtr2sin.lv2 (no web frontend atm).

Besides a c-toolchain and meson you should only need fftw and lv2 to compile it.

I have not written proper documentation for it since I made it more as an experiment. Also I have not yet had the time to refactor the code so it’s all in one C source file, so do ask if you don’t understand something :slight_smile: .

There’s also some octave files included, that roughly show how the code works.

Sounds good to me, I was planning on testing something similar to your method of splitting the signal myself.

That’s the article, but I think his thesis “Fast, Accurate Pitch Detection Tools for Music Analysis” explains better how the algorithm works and what tradeoffs it makes.

5 Likes

I’ll take a look. Thanks

How well does this work for frequencies at around 82 hz ? Speedwise

It needs a whole period to detect a note. For 82hz at 48kHz that means roughly 48kHz / 82Hz = 585 samples = 12ms. I use a window size of 1024 samples with 75% overlap.

For the amplitude detection there’s no latency. I implemented it using a compressor design in reverse, i.e. very low threshold, infinite ratio and gain controls the sine wave amplitude.

I think I should mention that I’m doing no MIDI conversion at all.

2 Likes

Just a quick update: Im a bit delayed in my plans because I decided to take a scientific approach to dealing with the Problem . Currently guitarmidi triggers notes in all harmonics of a string. I wrote an analysis app with juce audio to dig into this.
It gave me insights and ideas on how to solve the problem

11 Likes

I remember a company making a “Subsonic Filter” for the Roland GR-55 that was helping with tracking. (Search for RMC OPT-01 in Google)

I think it was essencially a bunch resistors atuned to specific frequencies.

Maybe it is possible to make a software version to help with your project.

3 Likes

@Simon,

The OPT-01 by RMC – similar to the Filter/Buffer by Wayne Joness (discontinued) and the GKFX-1 by Primova Sound – employs Butterworth filters to remove mechanical noise from piezo pickups. RMC developed that filter specifically because Roland dropped subsonic filtering with the VG-99 and piezo guitar users were having a tough time. The same happened with GR-55.

I use one such hardware filter for that very purpose, though are different frequencies than those used by RMC and Wayne Joness.

In my understanding, this can only be of use to this plugin inasmuch as lower frequency signals are coming through, but if I understand right the problem @jimsondrift is facing relates to unwanted triggers at specific frequencies/harmonics.

(Please correct me if I’m wrong.)

3 Likes

Although I wish I did, I have absolutely no knowledge on the mathematics and/or algorythms involved in such projects. I was simply mentioning something I saw a few years back in case it helped a bit.

Being ignorant in this science, it is easy to think that if a tuner can show you the value of the string you are tuning, it should be easy enough to make a device (or in this case a plugin) to send a MIDI note for specific frequencies. But, if it was that easy, there would be already hundreds of devices and plugins to do just that.

Using my bass as a MIDI controller has been a dream of mine for a long time now. In this quest, I have tried the Soonus B2M. The tracking was terrible. Then, I got a GR-55 (set in Bass Mode). and it was ok for pads but not very good for fast notes. There where misfire of harmonic notes (this is why I investigated the OPT-01 at the time). More recently, I looked into Jam Origin MIDI Bass. That is promising but requires to carry a computer.

Since higher frequencies seem easier to track, I even tried to use an Pitch Shifter to translate my bass notes one octave higher before sending to MIDI converter but this does not help as much as I thought because the Pitch Shifter itself does not always track properly.

So, especially with bass, I know that converting notes to MIDI is not an easy task. Many have tried and failed. If not latency issues, harmonics that fires a MIDI note when you don’t want it or even fires a note in a different octave etc …

I really wish with all my heart that our friend jimsondrift finds a way to make this work… :slight_smile:

7 Likes

Although I am myself a guitarist, I believe that for bass players the best solution is to play everything one octave up.
The difficulty of identifying the frequency is intrinsic to the lower ranges, as you need to listen to a minimum part of the wave and, at lower frequencies, this wait is just too big.

Pitching up one octave in software before doing the pitch tracking does not seem to do the trick, as the information is still taking the same time to get into the DSP. There is no magic :slight_smile:

That would leave me to “speak to the DSP at a faster route” which in this case, is to play an octave higher so that the DSP can identify the frequencies in due time.

Once the frequency is determined, scaling an octave down is no problem, be it for MIDI or for the CV synths.

But again, I ain´t a bass player :wink:

5 Likes

No sweat, Simon. I just wanted to point out from a technical standpoint that subsonic filtering is very helpful for pitch-to-midi conversion but it’s not the problem Gerald is facing.

Sadly, as @gianfranco points out, pitch-to-midi conversion requires a certain amount of cycles to be completed and, the lowest the frequency, the longer it takes. It’s dictated by physics.

The creator of the Axon (and also Shadow and Tripleplay) found that by analysing an early transient that is generated when a string is plucked – it travels the string in both directions, it was possible to guess the note coming faster than analysing the two full cycles of a vibrating string. But it was a guess and required a number of comparable values from a table to confirm the note. It is the same principle for both the Axon and Tripleplay, only the latter is a lot more precise with the guess because the processor is 1000 times more powerful than the ones available in the mid 90s (those used in the Axon).

Tripleplay is not faster than the Axon, only more accurate in the guessing process.

Now, the biggest issue is not purely analysing pitch: is the MIDI conversion, because a midi note follows a specification that requires some data with a certain number of parameters. The more precise the data is, the better a synth/software can respond. However, a vibrating string from a wooden instrument is everything but a precise note (no matter how fine tuned the instrument is), and to turn that into useable midi data is a nightmare. Pitch-to-voltage is much more manageable. It is almost a consensus among guitar synth users who have played Roland GR instruments (or the Synclavier guitar) that it is the most playable and responsive of all. (G33 basses still sell for a lot of money.)

The most usable solution for bass players (that makes economic sense), incredibly enough, is either the GR-55 or an Axon, because Fishman did a disastrous of the tripleplay and it cannot be fully adapted for bass. The Axon was discontinued in 2008.

On a miuch higher price tier there are independent makers – such as Industrial Radio from Australia – who build midi instruments with their own technology, in most cases a fret scanner. It uses the frets as switches so that the midi note is defined the moment the string is pressed, faster and more precisely than analysing pitch.

More recently, even companies and individuals who invested a lot in pitch-to-midi (including the creator of the Axon and Tripleplay) switched to building pitch-to-voltage devices. Electro-Harmonix offers a wide selection of these. Then Source Audio, Pandamidi, etc. It falls short of your (and mine) goal of controlling midi synths from our stringed instruments, but out of the box they are much easier to use than any P2M device, no matter how good.

4 Likes

Guitarmidi uses (elliptic or butterworth, still experimenting) filters for singleing out specific freqs. That works so well, I consider that solved. The problem is that string on the guitar swing not only with the fundamental freq (A with 110 hz) but also with higher harmonics at 3/2, 4/2, 5/2 the fundamental. These overtones are shaped by the whole guitar and make up for its distinctive sound character. Guitarmidi must figure out which frequencies belong to the harmonic spectrum of one swinging string, and which to another. Got some ideas to solve this.

3 Likes

That company is run by Steve Chick who designed the original Peavey MIDI Bass in the 80s, with that same wired fret idea. Still a super fast way to do pitch detection!

3 Likes