Optimising pitch~ for theremin use (Midi Smooth)

jack's icon

Hello there,

I've been using my theremin to trigger midi notes, and send those to a vst. I'm mostly interested in using this with kontakt, but other vsts could be useful as well. Anyway, the results are somewhat unsatisfying so far. Basically its the fact that midi output only allows 127 notes, which is hardly enough information for nice vibrato or anything, all I hear is lots of staggering.

I've tried a few different approaches to solve this, for instance, I truncated the decimal values that pitch~ produces and sent those as a pitch bend (with the maximum bend value being the next note) to try and fill in the missing values. It ended up sounding too wonky. I also tried a few portamento patches on a couple different vsts, but while that smooths it out, it makes the triggers somewhat unresponsive.

I know I could just set up another control surface and use that for modulation/portamento, but that kind of takes the fun out of playing a theremin. So does anyone have some ideas on how to send more detailed midi information, or something of that nature?

p.s., the main goal I'm trying to achieve is to be able play the theremin and trigger some wine glass samples I have for kontakt 3.

p.s.s. while this is for the same purpose its very different question. I was wondering if maybe using a phase vocoder, or some other technique to imprint the original theremins signal onto the vst generated signal could help me get the sound I'm after.

Thats all,
any help would be greatly appreciated.

-Ben

swieser1's icon

Why do you need to convert the theremin tones to midi if all you want to do is trigger samples from it? Maybe I don't understand how you're triggering the wine glass samples. Is it just a simple trigger, like:

When the theremin hits middle C, trigger wine glass sample.

If that's the case, then pitch~ is already giving you all the information you need. Keep all of your processing in the MSP audio world, and use thresholds (i.e. ~) to determine when the theremin has passed a particular note, and then use change~ to generate a bang accordingly.

Converting theremin tones to MIDI pitches seems like a bad idea. A theremin is inherently continuous (with respect to frequency changes), whereas MIDI is inherently non-continuous, like a piano. Unless you have a compelling reason to work in MIDI-land for this project, I'd stay away from it at all costs.

jack's icon

swieser1: the reason for using midi, is the large number of variations I can make to the sound, as opposed to just the original theremin tone. I don't know if the fact that theremin is triggering notes constantly is entirely a bad thing, since it eliminates the need for an envelope follower, as midi note On is always true, unless of course the note changes, then a single note off is sent.

That part isn't the issue though. Its really the fidelity thats troubling me, I mean, I can see that pitch~ clearly is interpreting more data than midi allows me to send. I want the note 50.487 instead of simply just 50.

Oh, and its the continuous quality of the theremin is the reason I'm interested in this project, as I'd like to use samples in a legato/portamento way. Konkakt 3 has a nice built in portamento script that allows me to crossfade samples while bending them and such, so I think its a promising start.

Luke Hall's icon

It sounds like you're trying to recreate your theremin performance with the samples rather than using certain MIDI notes to trigger/process/manipulate the samples in other ways. Or am I misinterpreting what you are trying to achieve?

lh

jack's icon

well.. recreating the performance using samples is the idea, yes, but I was thinking of bending the samples and crossfading between them in such a way as to result in a smooth sound. Instead of it being like a took my finger and ran it down the length of a midi keyboard.

its worth mentioning that the sound I'm after is not wildly different from the theremin sound, so the samples could be fused together with the original signal, that might give the certain smoothness I'm looking for.

I'll try and clarify a little more; see, if I were play a note in vibrato on the theremin, the sound would fluctuate (lets use note 57 for this example) would fluctuate between 57.000 and 57.999, then this would cause the sampler to trigger only one note, and THATS where I'd like to have more detail. Some method involving pitch bend to send this extra data into a sampler seems reasonable, but I'm open to other suggestions.

Luke Hall's icon
jack's icon

Ok, well I don't have the file here, but I could explain it to you. what I have it pretty simple so far. I've only just started working with MaxMSP, and I really only started testing my pitch bend theory.

basically, I take the float pitch data out of pitch~, ignoring the amplitude, as it is set to always on. I send a midiout function with the integer value 80 for the amplitude.

then I have a box where I store the current pitch in integer form, and I subtract the integer from the float to get the decimal value. (like 32.333 becomes 0.333) then I multiply the decimal value by 20 and send it through a bendout.

I tried multiplying it by more than 20, and when I raise the pitch of the theremin it kind of sounded like an engine revving up.

anyway, I also have a few gates here and there, one for if the integer pitch is great or less than the stored value, with the eventual plan to send a noteoff if thats the case. But its not functional yet.

well, thats it.

jack's icon

Ok, heres my code so far.

Max Patch
Copy patch and select New From Clipboard in Max.

jack's icon

I forgot to mention, in my current version, it only works when the pitch is on its way up, the current pitch has to be higher than or equal to the note being stored.

swieser1's icon

Using MIDI pitch bend messages is completely unnecessary if all you're trying to do is detect the pitch of a theremin and trigger samples off of it. If you know the pitch of the sample, you can manipulate it by playing it faster or slower. I still don't understand why you need to go through the intermediate step of converting everything to MIDI.

Luke Hall's icon

I've written a little patch that mimics an audio signal with MIDI note and pitch bend changes. Have a look and see if it can help you. Everything going in to the [cycle~] object is my theremin emulation so you can just hook your [adc~] straight into [pitch~] if you want to use your actual theremin. If you want me to explain what's going on then just ask but you should be able to figure it out if you poke around a bit.

The vibrato sounds smooth when the bend does not cross over to the next MIDI note. Similarly, the portamento sounds better the less notes you pass through although I imagine you can fix these sounds if you apply crossfading, like you mentioned in your earlier post.

Oh and ignore the [lh.keys] abstraction. Its like [notein] but using a laptop keyboard rather than plugging in a MIDI controller keyboard.

lh

Max Patch
Copy patch and select New From Clipboard in Max.

Stefan Tiedje's icon

ben romvari schrieb:
> Basically its the fact that midi output only allows 127 notes, which
> is hardly enough information for nice vibrato or anything, all I hear
> is lots of staggering.

If you are serious about your instrument, its maybe time to ditch Midi
based synths. I don't know of OSC based plug-ins which could maybe get
around that problem, but why not do all in Max. As fiddle~ or pitch~
pull out the whole continuum, it would be a waste to map it to a
keyboard oriented technology...

Building a monophonic synth isn't too hard, and probably needs less time
than figuring out how to trick Kontakt. Samplers aren't a problem
either. You have to think about and design the trigger points of your
sounds but within Max anything is possible...

ben romvari schrieb:
> Ok, heres my code so far.

Here is my way to get the fractional part of a float, I'd use +/-
pitchbend...;-)

Stefan

Max Patch
Copy patch and select New From Clipboard in Max.

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

jack's icon

Thank you for all the replies! Those last to programs should probably get me on my way.

Some of you seem pretty adamant about me using purely max as my sampler. While I find this idea interesting, considering my current skill level in max, and this being my first project (I'm doing this for my own purposes, I'm not a student or anything.) it seems like it would be imprudent for me to take on the task of building a sampler, especially one capable of portamento, several velocity layers, and unique samples depending on pitch. Still, its not totally out of the question, so if anyone has advice about it, I'm all ears.

Luke Hall's icon

I would advise you to do whatever achieves the results you want. If you are more comfortable with kontakt then there's no reason not to use it. I think the point people are trying to express is that the possibilities of using max are almost limitless. I'm not familiar with kontakt but I assume you can achieve everything it is capable of with max and you can add to it and tweak it to your heart's content. If you are just starting out with max then go through the tutorials and examples and have a route through the list, there's no better way of learning than giving it a go. People here will be all to pleased (usually!) to share their knowledge and help you out if you run in to problems. If you do decide to delve a little deeper into max programming I think you will find it rewarding, if a little frustrating at first, good luck.

lh