microtuning converter

Post your Lemur Projects.
Post Reply
Phil999
Regular
Posts:932
Joined:11 Jan 2012 01:53
microtuning converter

Post by Phil999 » 27 Apr 2014 19:56

I'm in the progress of creating a mictotuning converter for monophonic synths.

I would like to send pitchbend data with scripts, but it looks like this is only possible with Custom MIDI.

Is it possible to send pitchbend data with scripts (midiout)?
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro

Macciza
Regular
Posts:1325
Joined:07 Dec 2011 04:57
Location:Sydney, Australia.

Re: microtuning converter

Post by Macciza » 28 Apr 2014 01:22

Yep
Certainly is midi out should be able to send any midi message ...
just use 0xE0 for pitch bend,then the data ...
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]

Phil999
Regular
Posts:932
Joined:11 Jan 2012 01:53

Re: microtuning converter

Post by Phil999 » 28 Apr 2014 13:35

thank you Macizza, that is good news.

According to this table http://www.midi.org/techspecs/midimessages.php the status byte is E0 (for pitchbend channel 1), followed by two data bytes (LSB and MSB). My intention is to control the pitchbend with 12 Knob objects (independently for each key respectively their octaves).

What I had so far is

midiout(target, {0xE0, pitch1.p})

pitch1.p is the first Knob object's floor(x*16838) resulting in a value between 0 and 16838.

That didn't work so well, so I replaced pitch1.p with two values (LSB and MSB), coming from two different knobs. Both values are floor(x*127). This works quite well, although the pitchbend doesn't go to an octave anymore, only to a fifth. And the first knob (LSB) doesn't do nothing.

How can I do the pitchbend message with only one knob, and that it goes to the maximum pitchbend range?
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro

Phil999
Regular
Posts:932
Joined:11 Jan 2012 01:53

Re: microtuning converter

Post by Phil999 » 28 Apr 2014 14:08

correction: the pitchbend range is alright. It was the synthesiser that had the wrong pb range.

The whole thing actually works fairly well. I could set the first data byte to an arbitrary number between 0 and 127, and use a knob for the second data byte. I just wonder about the resolution. If values between 0 and 127 are used for pitchbend, the higher resolution (values between 0 and 16838) probably gets lost. Although I admit I couldn't hear that loss of resolution yet.

A problem is when more than one key is pressed. When one key is held and the next key is repeatedly pressed. Then the pitchbend data goes wrong. So this microtuning converter that converts incoming notes from a physical keyboard to microtonal scales is a bit limited. So far. Maybe there is a solution, but at the moment I'm not so sure.

Actually I want to replicate in Lemur what the software Scala is doing. With Scala and its Relay function, I can play all microtonal scales with a normal keyboard, to monophonic synthesisers.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro

Macciza
Regular
Posts:1325
Joined:07 Dec 2011 04:57
Location:Sydney, Australia.

Re: microtuning converter

Post by Macciza » 28 Apr 2014 15:40

...to monophonic synths..
Thats the giveaway, this pitch bend is channel based so all notes respond . . .
You would need to be sending on separate channels for polytonality . .

The other option would be sending tuning data if the synth will deal with it . ..

And yeah other things like PB range of the sound/synth etc come into it as well . .

Let me have a look and have a think . .
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]

Phil999
Regular
Posts:932
Joined:11 Jan 2012 01:53

Re: microtuning converter

Post by Phil999 » 28 Apr 2014 16:43

I want to send on one MIDI channel, and Scala demonstrates that this is not a problem. Each of the twelve notes (and their octaves) with a quickly changed pitchbend. What I have now functions not too bad, it is just this problem with the held notes and the next note. I'm on the track of a solution, but haven't found a working solution so far. The main idea is to store the last held key number, and after the next key is pressed and released, send the appropriate pitchbend to the last held key. This has proven not to be easy, I tried for more than an hour with different methods. You're right, in general pitchbend is sent to all notes, and I try to prevent that. :)

What I still don't understand is how to tell Lemur "not equal". Comparison operators don't do this, and the logical operator "!" I don't get how it works. I understand that "!" gives a 0 (false) or a 1 (true), but haven't found a way to implement it yet. Maybe the a?b:c conditional statement is better. Yeah it's been an interesting afternoon, but now I'm making a pause.

I intend to play iVCS3 with this converter, and other synths that can be set to monophonic, like Thor (iPad). And of course also hardware.
Attachments
microtuning converter10.jzml
(15.94KiB)Downloaded 115 times
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro

oldgearguy
Regular
Posts:315
Joined:02 Nov 2013 11:19

Re: microtuning converter

Post by oldgearguy » 28 Apr 2014 17:11

Phil999 wrote:What I still don't understand is how to tell Lemur "not equal". Comparison operators don't do this, and the logical operator "!" I don't get how it works. I understand that "!" gives a 0 (false) or a 1 (true), but haven't found a way to implement it yet. Maybe the a?b:c conditional statement is better. Yeah it's been an interesting afternoon, but now I'm making a pause.
!= is the construct for not equal. If that's not working for you, something else is at fault.

if (myNote != 60) {
// do stuff
} else {
// myNote is 60, so I do nothing
}

Phil999
Regular
Posts:932
Joined:11 Jan 2012 01:53

Re: microtuning converter

Post by Phil999 » 28 Apr 2014 17:19

ah, I was putting the ! at the wrong place.

myNote= !60

This may be of good help. Thanks.

I see it's much more difficult if one is not a programmer.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro

Macciza
Regular
Posts:1325
Joined:07 Dec 2011 04:57
Location:Sydney, Australia.

Re: microtuning converter

Post by Macciza » 29 Apr 2014 07:36

Phil
that second fader is working, it will just have very small effect even at very large pitch bend ranges +/-2 oct. - but by then it is noticeable
Pitchbend is 14 bit data ordered LSB,MSB (pretty sure) - and if the device is recognising it then you would want to use it or else set the LSB to 63 (i think) for 7 bit tuning accuracy
Try something like this for a knob named switch - {floor(pitch.x*16383)%127,floor(pitch.x*16383)>>7} in your bend script, or in a Monitor to see the values,

Remember that the amount of eventual actual pitch change is dependent on the settings of the receiving device . . .
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]

Post Reply