TEENSY - My first own pitch to midi converter with a Teensy 3.1!

Started by PD FX, February 10, 2015, 02:43:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PD FX

the days have changed, CodeSmart! I've programmed Amigas in assembler for realtime soundfx, and made graphic programs on Acorn and Amiga in the old days. On Acorn I did use inline ARM assembler in basic, that was a cool time, discovering the more hardware oriented programming. Programming modern microconrollers gives exactly that feel: close to the hardware and lightening fast.
Microcontrollers like the one on the Teensy3.1 board are 32-bit, and run at 96megaherz. thats more than 16 times faster as my amiga, and there is no systemload at all....
So nowadays you better skip the assember part: just code it in C. Or take faster chips, or use them parallel, when more speed is required.
The programming environment I work with is Arduino, with the teensyduino addon installed. I simulate processes with Processing, I've build a virtual version of my firmware in it, especially usefull to tackle the fixed point math you have to use, for the small chips dont support floating point FPUs, you have to define your own decimal point and use integer math, to keep things fast.
Arduino is not exactly the most advantaged editor, but for small hobby projects like this, good enough. It has the advantage of being 1 download, then your toolchain is ready! And that is really, really a big advance.
In 2009 I started to program microcontrollers, I ordered a Adafruit "midisense" avr board, and they shared theyr winavr C-code with it! so I installed winavr on a virtual PC on my macbook, that was really a nice process, and  I learned a lot from looking at the Adafruit code. After that I switched to Arduino, for it's the standard, lots of libraries are available, and like said earlier: for smaller projects with 1 programmer Arduino is really sufficient.



Quote from: CodeSmart on February 11, 2015, 03:47:30 PM
I just have to ask you because I'm curious programmer trying to step down from corporate Visual Studio C++ work down to Microchip microcontrollers, is assembler coding required or is your C compiler fast enough for the triggering/waveform attack and immediate frequency detection?

I remember when I once did a VxD driver for 8 channel 12-bit A/D unit board interfacing with the parallel port in the early 90's reading a nibble at a time I could only achieve abt. 2KHz on 8 channels, and I had to do the ISR  in 86 assembler. I guess the PC's at that time corresponds to the cheap thumbnail chips we have today  ;D

Albert

After some more thought: From a sales-standpoint I'd ditch the integrated CV all together and add it as a seperate box. It should be quite straight forward to develop. One (stomp)box with the Hex to Midi-conversion with USB/fast midiout, and a second (stomp)box (or eurorackmodule!) for fast midi to VC. You might be on to a really nice (and sellable) package there given the current popularity of modular hardwaresynthesis. Just a thought.

PD FX

yes, Albert, exactly my thoughts.. I'd just provide the highgspeed raw midi to get the CV box going that third party developers may build: the midi that gives good CV is definetely different from that the midi that is used to drive a softsynth! For CV you dont need to filter the initial fase of the tone: the CV will have simular feel as the direct synths on a Roland, but will be faster actually..
I'd really dig to have a bridge to the DIY enhousiasts, I easily could provide that.

Then we could look at the Axoloti: then people can build their own highspeed direct synths with that, using the midi from my box and the audio ins on it: I've experiment with a "filters steered by midi" setup using CSound on my laptop: the filters in CSound where connected to my guitarsynth, audioin with my normal guitar pickup. The sounds where simular to the direct synhts from Roland, but more dynamic ( because you use the normal inputs of your guitar) and responsive and chords get a special quality. The fun part is that you can use your volume on your guitar to lower your synth volume.
Anyway, we have to support the Axoloti!



Quote from: Albert on February 12, 2015, 01:39:24 AM
After some more thought: From a sales-standpoint I'd ditch the integrated CV all together and add it as a seperate box. It should be quite straight forward to develop. One (stomp)box with the Hex to Midi-conversion with USB/fast midiout, and a second (stomp)box (or eurorackmodule!) for fast midi to VC. You might be on to a really nice (and sellable) package there given the current popularity of modular hardwaresynthesis. Just a thought.

PD FX

development update:
switched to a faster board, a 120mhz Freescale with FPU: the FRDM K22F. had to port everything to pure C++, because the board wants to use Mbed, the online compiler.
Runs quite well, i've just recorded a small example of playing with a thumbpick. i'm workin on a univeral routine that works well with both pick and finger.
I've added 4 pedals, oct up, oct down, hold & mod.

the straight guitar sound here comes from GR55, the synth sound is from a Kontakt 5 synth , hosted in Garageband on my older macbook from 2009.


Second one, played with a normal pick, doing lots of pedal for the Hammond thing..


whippinpost91850

WOW!!! You are one superb player. And your guitar synth project sounds like it's comming along great 8)

PD FX

Thanks, whippin..
Quote from: whippinpost91850 on March 05, 2015, 04:25:19 PM
WOW!!! You are one superb player. And your guitar synth project sounds like it's comming along great 8)

joaobraga

Indeed!

Really great playing and an awesome demo of your synth converter.

I hope you can find a way to bring it to the public.

We are all waiting!

whippinpost91850

You Are Welcome. I'll be following your project to see where it takes you.

jassy

Another finger torture passing with honors  ;D, your project seems to be very mature already, and judging by the videos even looks better than FTP.

Have you latency measurements?

I hope you can sell it and take shape as a more compatible system with all our 13 pin systems (something completely forgotten by the FTP).

Please accept my congratulations and encouragement to continue with the project.

pd: good playing also!

rmbaylin


PD FX

thanks Jassy, and yes: I'm interested in making it a GK compatible device, there are so many beautifull GK-enabled guitars, it would be  a waste to not be able to plug them in. There is nothing wrong with the GK pickup anyway, its just the plug that might be annoying at times. Piezos can give more headaches, because they tend to have much bigger crosstalk between strings.
I can not compare performance with the tripleplay, because I dont have one, I dont think mine is faster in terms of absolute latency, but there are other factors that make a guitarsynth a good guitarsynth. I compare performance with the GR30 every now and then, it's a close finish between them. In the end it is the total feel and performance that decides whether you like it or not. You wont hear a churchorgan player neg about latency, allthough he experiences huge latencies. Our neurons in our head are programmed to have a certain response from our instrument, it is not important to have the absolute best latency, but to have a latency that doesnt disrupt this "expectations" of these "brainpaths". So the churchorganplayer expects the organtone to come a little later, and he is satisfied. The same applies for guitarsynthesis: the focus must lie on "fidelity", that sooths the ear and brain. The absolute latency is limited anyhow to the wavelength of the tone, you need a full cycle of your sinusoid, to determine the frequency. There is no real alternative for that, in terms of pitch to midi circuitry.
I expect the tripleplay to be very good, one day I will do a compare between my stuff and the tripleplay (I've never played a tripleplay and it is too expensive to buy just for the comparison). But I don't expect to be faster, but that really is not the biggest issue. After all the guitarsynths I've bought, and the time I spend tweaking and modding them, I'd rather design the stuff myself to get it working for me in that way, that it should have worked all the time. Don't know how close I can get to that ideal, we'll see.

Quote from: jassy on March 06, 2015, 06:11:36 PM
Another finger torture passing with honors  ;D, your project seems to be very mature already, and judging by the videos even looks better than FTP.

Have you latency measurements?

I hope you can sell it and take shape as a more compatible system with all our 13 pin systems (something completely forgotten by the FTP).

Please accept my congratulations and encouragement to continue with the project.

pd: good playing also!

PD FX

that might take a while. My plan is too build into a working prototype and then search for a producer, since I am definitely not a producer, I'm just the average small guitarplayer/inventor, I need a company to turn it into a product. But thanks, it shows that there might be a market for it ")

Quote from: rmbaylin on March 06, 2015, 08:48:27 PM
I want one!


Sent from my iPad using Tapatalk

jassy

Quote from: Guitarpolson on March 06, 2015, 11:54:27 PM
I'm interested in making it a GK compatible device, there are so many beautifull GK-enabled guitars, it would be  a waste to not be able to plug them in.
Exactly I think the same, i have many 13 pin guitars and its very frustrating not being able to use the FTP will all of my 13pin guitars...

Quote
I can not compare performance with the tripleplay, because I dont have one, I dont think mine is faster in terms of absolute latency, but there are other factors that make a guitarsynth a good guitarsynth. I compare performance with the GR30 every now and then, it's a close finish between them. In the end it is the total feel and performance that decides whether you like it or not. You wont hear a churchorgan player neg about latency, allthough he experiences huge latencies. Our neurons in our head are programmed to have a certain response from our instrument, it is not important to have the absolute best latency, but to have a latency that doesnt disrupt this "expectations" of these "brainpaths". So the churchorganplayer expects the organtone to come a little later, and he is satisfied. The same applies for guitarsynthesis: the focus must lie on "fidelity", that sooths the ear and brain. The absolute latency is limited anyhow to the wavelength of the tone, you need a full cycle of your sinusoid, to determine the frequency. There is no real alternative for that, in terms of pitch to midi circuitry.

Totally agree with you, the important thing is consistency and the musical experience that it provides.
The problem with latency phenomenon is when it produces different delays in the different lower strings, since the brain can assume naturally a constant delay, this happens quite often in many different musical situations, but what is more complicated to assume is a variable delay because in this case the brain can not make a reliable estimate and produces a feeling of inconsistency and uncertainty at least to me.

I am comparing it to the FTP only by what I see in the video, where I see you play very naturally rapid phrases, with legato and very "guitarristic" and the result is very consistent.

One of the things that has most impressed me in your video, is the response in the lower strings. In the Roland systems, of which I have had 2 and even in the FTP, in the low strings is quite normal that some notes are lost when playing rapid phrases and in your video the response seemed very precise and without notes omitted or false triggering.

Anyway latency, although relatively is also important. Here you can see post from people who have meassured the FTP and other systems, so i think would be also interesting to know how your system meassures and how it compares.

PD FX

I've worked hard on my guitar pitch to midi converter: I've developed a good retriggering mechanism, that turned out to be much harder than expected, but I've got it working for both fingerstyle and pick. Reworked pitchtracking stability.
So in this testvideo a lot of rhythm, using a mono synth on my laptop, and 3 pedals: hold, octave up and octave down. Funny effect is the fast 2 string circular sweeps I use here: the mono synth then switches between notes very fast. I will optimize this further, since it is great fun to play sweeps with such an effect.

joaobraga

GAS is coming back... ;)
Guitarpolson, It´s time to find that producer!

PD FX

test with "not even slinky"s 012 strings from ernie ball on my resonator guitar with GK3 and my pitch to midi board and a softsynth on my laptop. Thick strings are good, then they are more stable over a wide dynamic range, that means you can hit them harder, without getting bad tones out of your synth..


PD FX

The main goal of the first stage of my pitch to mid convertor for guitar is to have a good piano: the idea is to forget the guitar for a moment, and push on that hold pedal and dream away. Being able to use that hold pedal is a sign of a good guitarsynth: most synths will destroy the performance with ghost notes and mistriggers, and that is the main reason I started developing myself.

CodeSmart

Fantastic!!! Fast as a shark  :D

Does it need calibration for different guitars and if so, how do you envision that procedure will be handled in your final product?
But I got more gear than I need...and I like it!

PD FX

Quote from: CodeSmart on March 15, 2015, 03:37:41 PM
Fantastic!!! Fast as a shark  :D

Does it need calibration for different guitars and if so, how do you envision that procedure will be handled in your final product?
yes, it is fast enough. I wont compare speeds, but it sure feels right.
All testing and development sofar was without any tweakable knobs: I just compiled the firmware with one gain for all the strings..  the preamp copes with both higher level outputs such as the piezos on my godin LG, and standard GK pickups on my other guitars.
there are 2 possible strategies I forsee for the device:
design 1)-minimalistic: floorbox with  6 gainknobs, 1 overall noisegate/sustain, chromatic/legato/bend mode switch with 4 stomp pedals for hold/mod/octup/octdown.
design 2)-modern: floorbox with formentioned 4 stompedals, all other functions in software. many many extra functions...
Since nearly everybody would connect such a device to a laptop or pad, it seems illogical to have the manual knobs on the device itself: the pad/laptop will be on the right height for manual operation and the floorpedals should be on the ground ofcourse..
So a good sturdy floorpedal you can stomp with confidence on, and a easy interface for tweaking. I'm now prototyping the interface in Puredata.
Sure I'm charmed by having a simplistic standalone device, but it seems a lie to make things too simple, for people that want those extra possiblilities that a gsynth offers, would certainly like to tweak the performance. And there will be computer anyway, so why not use it?
The solution lies in a "dual mode" operation on the laptop: you can use the normal "synth interface" app to adjust settings, or use puredata or the like to change everything on the fly. The synth interface app presumes that the user will use a standard synth like Kontakt, Sampletank etc. It will certainly not be a multiple stringsplithost like on the tripleplay software, but just the interface with knobs to adjust the device. For that kind of advanced splitting stuff I advice GTAK on kontakt, it would be too much work for me make such a thing and personnaly I don't believe in fretsplits, I never use them. Stringsplits I like very much, but you can make them in any softsynth. So that's my personal reason for not wanting to make a vst/au host.
The energy which I wont spoil on making a splithost, I will put into a new concept, and that is the "advanced mode".
All settings on the device will be reachable with simple controller commands and will act in realtime, so you can write stuff in PureData that will interact with the converter in a very new way, my goal is to make the converter part of the computer, so that the possibilities are more unlimited.  How far this goes I will be able to test soon enough.
If my tests, however, suggest that this advanced concept is BS, I will happily embrace the simplistic standalone design principles. The main reason I got this stuff running, is that I've got no idea how things should work, I just make wild ideas and test them. That way i'm not limited to "common sense", and can reach a bit further. This process takes time however, I have to test everything myself, I'm not going to say "that will not work", because that is just an idea that could be wrong.. I know nothing, I try everything, I get the most out of the situation. That's the (non)math behind my work.
That is it for now, I'll keep you posted.
And ofcourse any input and ideas of you people here are welcome: I can not test everything, but sure am interested in getting feedback.

mbenigni


whippinpost91850

Keep it comming. I'm really excited for you and where you will take this. It allready seems pretty amazing 8)

jwest

Any more progress on your converter? Did you go to the faster processor because of the input calculations?

PD FX

Quote from: jwest on November 29, 2015, 05:08:59 PM
Any more progress on your converter? Did you go to the faster processor because of the input calculations?
Thanks for your interest!
I have paused this project, not abandoned. On the MBED board there is a floating point processor, which makes it easier to do filtering: had to use integer-shift arythmetic on the Teensy...
The bottleneck of my system, is exactly the same as with the GR's: when the fundamental frequency of a tone drops out I can skip the tone or start a wrong frequency. The GR30 just skips, the GR55 gives a bad tone. So that level I reached.
I could switch to FFT, to incorporate the harmonics in the equation, but I havent got a fitting processor for that yet, that is something for the future.
Currently I am busy building sound algorhythms for use with Midi Guitar, it will generate "direct synth" sound out of guitar signal and midi data, I hope I can learn to program VST/AU myself, I'm working in Processing (a java ide, sumular to the Arduino/Teensy environment) now in this prototype stage.


PD FX

Quote from:  philjynx on June 05, 2017, 12:11:28 AM
Do you know the teensy 3.6 has floating point?
thank for the notice!
In the meantime I switched to the Embed platform using a 120 megaherz ARM with floating point, but I paused this traject about  a year ago. I am currently working for jamorigin.