Optimising pitch~ for theremin use (Midi Smooth)

Oct 8, 2008 at 11:11pm

Optimising pitch~ for theremin use (Midi Smooth)

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

#40234
Oct 9, 2008 at 12:09am

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. < ~ and >~) 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.

#142200
Oct 9, 2008 at 12:28am

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.

#142201
Oct 9, 2008 at 12:56am

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

#142202
Oct 9, 2008 at 1:15am

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.

#142203
Oct 9, 2008 at 1:32am

#142204
Oct 9, 2008 at 3:46am

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.

#142205
Oct 9, 2008 at 9:05am

Ok, heres my code so far.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 595 321 140 9109513 note:;
#P number 598 365 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 721 286 140 9109513 bend:;
#P comment 608 98 140 9109513 float pitch (insert):;
#P comment 667 128 140 9109513 int pitch:;
#P comment 738 150 140 9109513 store pitch:;
#P flonum 700 358 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 739 334 33 9109513 * 90.;
#P newex 654 218 27 9109513 – 0.;
#P flonum 717 307 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 610 115 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 616 240 27 9109513 gate;
#P newex 617 214 27 9109513 ==;
#P number 741 175 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 696 244 27 9109513 gate;
#P newex 700 208 27 9109513 >;
#P number 670 148 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 730 409 49 9109513 bendout 1;
#P number 721 382 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 587 340 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 575 391 55 9109513 noteout k 1;
#P connect 10 0 1 0;
#P connect 10 0 12 0;
#P connect 10 0 4 0;
#P connect 7 0 8 1;
#P connect 7 0 5 1;
#P connect 4 0 8 0;
#P connect 4 0 12 1;
#P connect 4 0 5 0;
#P connect 4 0 6 1;
#P connect 1 0 0 0;
#P connect 19 0 0 1;
#P connect 8 0 9 0;
#P connect 12 0 9 1;
#P connect 5 0 6 0;
#P connect 13 0 14 0;
#P connect 9 0 11 0;
#P connect 14 0 2 0;
#P connect 2 0 3 0;
#P connect 11 0 13 0;
#P connect 6 0 7 0;
#P window clipboard copycount 21;

#142206
Oct 9, 2008 at 9:24am

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.

#142207
Oct 9, 2008 at 12:30pm

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.

#142208
Oct 9, 2008 at 1:37pm

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

– Pasted Max Patch, click to expand. –
#142209
Oct 9, 2008 at 4:49pm

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

– Pasted Max Patch, click to expand. –


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

#142210
Oct 9, 2008 at 7:50pm

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.

#142211
Oct 9, 2008 at 11:04pm

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

#142212

You must be logged in to reply to this topic.