Microtones in Midi out
Hi,
Could anyone give me advice on using microtones whilst sending midi messages out of max. I've been fine with in max, using decimal points and and mtof to control synths patches, i.e. using 60 60.5 61 to get three ascending quarter tones, but I've been trying to send midi out to a VSL instruments player and standard midi messages only seem to recognise semitones, rounded integers only.
I tried using midiformat to convert the decimal part to a pitchbend message, but the pitchbend affects all notes currently playing - so if i send midi note 60 (C) and then midi note 60.5 (C quarter sharp) the first note (C or midi note 60) then also gets raised by quarter tone.
Can anyone think of a better way of doing this?
Many thanks,
Liam
----------begin_max5_patcher----------
{
"boxes" : [ {
"box" : {
"maxclass" : "newobj",
"text" : "+ 2",
"numinlets" : 2,
"patching_rect" : [ 160.53717, 201.0, 32.5, 20.0 ],
"numoutlets" : 1,
"id" : "obj-40",
"fontname" : "Arial",
"outlettype" : [ "int" ],
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "midiout",
"numinlets" : 1,
"patching_rect" : [ 160.53717, 520.0, 49.0, 20.0 ],
"numoutlets" : 0,
"id" : "obj-35",
"fontname" : "Arial",
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pack 0 0",
"numinlets" : 2,
"patching_rect" : [ 160.53717, 399.0, 56.0, 20.0 ],
"numoutlets" : 1,
"id" : "obj-34",
"fontname" : "Arial",
"outlettype" : [ "" ],
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "midiformat",
"numinlets" : 7,
"patching_rect" : [ 160.53717, 471.0, 100.0, 20.0 ],
"numoutlets" : 1,
"id" : "obj-33",
"fontname" : "Arial",
"outlettype" : [ "int" ],
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "bendout",
"numinlets" : 2,
"patching_rect" : [ 307.0, 330.0, 54.0, 20.0 ],
"numoutlets" : 0,
"id" : "obj-30",
"fontname" : "Arial",
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "scale 0 1. 0 32",
"numinlets" : 6,
"patching_rect" : [ 307.0, 241.0, 89.0, 20.0 ],
"numoutlets" : 1,
"id" : "obj-29",
"fontname" : "Arial",
"outlettype" : [ "" ],
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "flonum",
"numinlets" : 1,
"patching_rect" : [ 307.0, 192.809906, 50.0, 20.0 ],
"numoutlets" : 2,
"id" : "obj-28",
"fontname" : "Arial",
"parameter_enable" : 0,
"outlettype" : [ "float", "bang" ],
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "% 1.",
"numinlets" : 2,
"patching_rect" : [ 307.0, 147.0, 35.0, 20.0 ],
"numoutlets" : 1,
"id" : "obj-23",
"fontname" : "Arial",
"outlettype" : [ "int" ],
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "flonum",
"numinlets" : 1,
"patching_rect" : [ 160.53717, 83.884277, 50.0, 20.0 ],
"numoutlets" : 2,
"id" : "obj-27",
"fontname" : "Arial",
"parameter_enable" : 0,
"outlettype" : [ "float", "bang" ],
"fontsize" : 12.0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "makenote 120 1000",
"numinlets" : 3,
"patching_rect" : [ 160.53717, 270.49588, 116.0, 20.0 ],
"numoutlets" : 2,
"id" : "obj-2",
"fontname" : "Arial",
"outlettype" : [ "float", "float" ],
"fontsize" : 12.0
}
}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-40", 0 ],
"destination" : [ "obj-2", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-34", 0 ],
"destination" : [ "obj-33", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-33", 0 ],
"destination" : [ "obj-35", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-29", 0 ],
"destination" : [ "obj-33", 5 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-29", 0 ],
"destination" : [ "obj-30", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-28", 0 ],
"destination" : [ "obj-29", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-27", 0 ],
"destination" : [ "obj-40", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-27", 0 ],
"destination" : [ "obj-23", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-23", 0 ],
"destination" : [ "obj-28", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-2", 0 ],
"destination" : [ "obj-34", 0 ],
"hidden" : 0,
"disabled" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-2", 1 ],
"destination" : [ "obj-34", 1 ],
"hidden" : 0,
"disabled" : 0
}
}
],
"appversion" : {
"major" : 6,
"minor" : 0,
"revision" : 8
}
}
-----------end_max5_patcher-----------
Most handle it by having each note on its own midi channel - this way you can do 16-note poly using PB.
i would not try to use custom tuning via midi with an instrument which does not support custom tuning.
theoretically there are a single note frequency change messages for midi, but if there are really any devices which support it, then thats definitely hardware and not VST plug-ins.
devices which have a custom tuning table option built-in are more common, and even those are only around 50 different instruments or so.
regarding the VSL, you might want to consider to buy their "pro" hardware, when i remeber right, with that option VSL has custom tuning including an editor and scala format file import.
using the pitchbend is an opttion if you need that once but it is not an option for every day use, starting with the problem that the pitchbend range is part of each patch and every patch will have a different setting for it. and the resolution of pitch bend ... well, for electronic experiments with a just scale i would not choose that ... though it might be okay for a violin sampler.
-110
update:
according to werner mohrlok (the inventor of hermode tuning) the VSL actually understands single note tuning midi data. so it is an absolute exception among plug-ins, and looking into the midi specifications should allow you to do what you want.
deffo recommend checking out the CNMAT externals - there's a few ways of doing this in there.
Hi,
Thanks for all the responses. I doubled checked with VSL Instruments and VSL ensemble but still couldn't send anything less than semitones. I'm starting to wonder whether it's Max - I tried linking up a midiformat object to and midiparse object, and a notein receiving signals sent from a noteout in the same patch so I could check exactly what was going out of Max and in both of those cases all decimal points were lost. So maybe Max doesn't use floats in midi messages.
Liam
Hi Liam,
I have no idea for VSL instruments, but if you have the bach libary installed (www.bachproject.net) you can have a look at [bach.ezmidiplay]. It automatically splits incoming data into different channels (with different detuning), depending on you microtonal division.
This is transparent to you. (On the other hand, it expects from bach.roll's or bach.score's playout, but you can of course use it independently.)
Hi Everyone
I'm still stuck on this topic. (when conversting freq to midi plus pitchbend) Can anyone tell me why Liam's patch scale the decimal to a range of 0 - 32. ?? When I use this with a synth set to pitch bend range +1st as instructed, it works on most pitches but deviates on some pitches of my self made scales. Why would this be?
I've tried out Sampler, Simpler, Operator, Colission and a Nord Rack 2x and none are completely correct! thanks
HI Everyone,
I need to convert FREQ to MIDI plus PITCH BEND.....
This topic is still a huge nightmare for me at present. I've been trying a lot of approaches, but I simply can not get the pitches to sound correct. Please look at my version of LIAMCAREY's patch and tell me why this doesnt work. I've tried it on many many different synths now, hardware and software. When I map an app called Microsynth to these same synths with the pitchbend set to +1st as prescribed it works fine. But when I try use it in max it sounds off on some pitches. Could anyone please explain why the decimal is being scaled to 0. 32.???
Hi,
To be honest it's so long ago that I can't quite remember why I made the patch like that - it could've been to do with the specific piece of software I was using. Try this one instead - I've only used it on the built in AU DLS synth on my mac, but it seems to work. This is just a simple mono version I knocked together - let me know if you need a polyphonic version.
Liam
Thanks Liam,
I am not hearing the midi when I select my AU DSL synth option, but when I test your patch it still sounds wrong to my ears when I compare it with the simple cycle audio (to which I'm sending the same frequency in order to test). Instead of the built in synth I'm using a synth in Ableton with pitchbend set to the range of plus one semitone. When I use another software called Microsynth, to test if the problem could be with the synth I'm using, it works perfectly and sounds exactly the same as the cycle object. So I know the issue is with the setting of the pitchbend scaling.
Please see my attachment.
Ok, I've noticed two problems:
First of all the bit where I comment 'midi pitch in float' you are just sending through the frequency. This needs to be the midi number of the note, with decimal points if it's not in standard 12-ET tuning. So if you want 440Hz (A4) you need to enter '69' in this box, if you want 452.89Hz (A4 1/4-sharp) you need to enter 69.5, and so on. The easiest solution to this would be to use the [ftom] object to convert the frequencies of your scale from the [coll] object - unfortunately [ftom] doesn't do floats, so I've always just used the [mtof] object to work out the midinote for each specific frequency.
Secondly, you need to enter note on and off messages into the number box labeled 'velocity', sending your midi note into [makenote] object should do this for you.
Liam
Well spotted Liam!
You are right about the error - actually I omitted most of my patch for simplicity sake. In the current version I am in fact using [ftom] to work out the midi note and then plus the %1 part as the pitch bend.
Unfortunately I've put you on a false track with this error now as the real issue still remains: i.e. the scale object and why the range is 64 to 96 (as opposed to going to 126) and why it still doesn't match the very exact microtonal pitch. I understand 64 is the middle of 128 and if the values 0 to 127 need to represent a 100 cents up or down, it means the range should be from 64 to 127. (perhaps the synth you used has a pitchbend range of +2 thus the reason why you set it to go to 96.
Still, now that I do this I am 95% correct, but if you have a listen to the 5th frequency in my collect object (113.879143) giving A sharp 2 plus pitchbend .879 it sounds flat, slightly but flat for sure. There are a few other notes in the series that also do this. Could it be that the 64 values for a 100 Cents are not fine enough increments to get the accuracy I'm looking for?
Massive thanks for your input - it really helps! I was on the verge of giving up... and now much closer.
PS I mean that pitch sounds sharp, not flat... in comparison to the cycle object. Also on 227.758286Hz the midi obviously sharp.
Has anyone figured out the best way to achieve polyphony with this technique?
you only have one option; different midi channels.