frequency values to MIDI values WITH glissando

    Nov 28 2011 | 8:49 pm
    Hi All,
    I've been pulling my hair out trying to find a solution to the problem of converting frequency values to MIDI, while keeping the glissando effect of sliding through the various frequencies - not rounding to the nearest half-step.
    Here is my patch so far:
    I'm wondering if there is a "channel" message (or some equivalent) that could be sent to my [vst~] object in order to allow for glissando. Or maybe there needs to be some kind of scaled value in between the MIDI half-steps at some earlier point in my patch.
    Has anyone out there done this?

    • Nov 28 2011 | 8:59 pm
      as a general principle with midi you'd have to separate the midi pitch into two separate parts-- the integer part, and the fractional part and use the fractional part to perform the pitch bend, while the integer part constitutes the note-on message; don't know if this will apply to your vst object though (I've never used it)
    • Nov 29 2011 | 5:23 am
      MIDI notes can only be played with whole numbers 0-127. Some synths allow you to specify an alternate tuning other than 12-tone equal temperament, but that's not what you're after in this case. As Terry said, you need to calculate the desired pitchbend from the fractional part of the value you obtain from ftom. And to complicate matters, the actual effect of a MIDI pitchbend message depends on the pitchbend range setting of the receiving synthesizer. By default it's almost always ±2 semitones, but you can usually change that on the receiving device. There is a registered parameter number (RPN) for setting the pitchbend range via MIDI, so if the synth understands that message you can set the range you want remotely. The built-in "AU DLS Synth" on Mac understands that message. Here's an example patch that a) lets you set the pitchbend range you want and try it out with a mock keyboard and pitchbend wheel, and b) lets you play any frequency by calculating the correct pitchbend (assuming a default pitchbend range of ±2 semitones). See my next post for something more like what you describe in your example patch.
    • Nov 29 2011 | 5:23 am
    • Nov 29 2011 | 10:41 am
      Christopher, thanks for the great examples with AU DLS Synth.
      I have 2 related questions.
      1. For adjusting pitchbend range are the messages '127 101, 127 100' at end really needed?
      2. Do you know if 'portamento' (cc65) can be used with AU DLS Synth?
    • Nov 29 2011 | 2:47 pm
      1. The RPN will still work without the null messages at the end, but that leaves the RPN active, such that subsequent CC6 messages could theoretically change something later without you intending that.
      2. I don't think the AU DLS Synth recognizes CC65, but I haven't researched it very carefully.
      P.S. In my glissando example, I meant to connect the button to the message 69, too, so one can easily replay the note.