High Resolution Breath Controller

Discussion in 'KONTAKT' started by Clint Goss, Jan 3, 2021.

  1. Clint Goss

    Clint Goss NI Product Owner

    Messages:
    22
    Can Kontakt process high-res (14-bit) Breath Controller input? I think that's MIDI CC#34 - the Breath Controller LSB ...

    I'm working on a Sylphyo and I'm getting granular, step-wise volume changes at low breath pressures, which is sonic ugliness when playing a delicate phrase. Before I try to get the Sylphyo to emit high-res BC output, I'd like to know if there's a way for K6 to process it ...

    Thanks for any info!
     
  2. EvilDragon

    EvilDragon Moderator Moderator

    Messages:
    19,250
  3. Clint Goss

    Clint Goss NI Product Owner

    Messages:
    22
    Might there possibly be a way to do it using a script ... a suggested in this ancient thread:

    https://www.native-instruments.com/forum/threads/going-14-bit.90210/

    Reading in part:

    ... a script to produce the desired result (at least insofar as velocity control of volume level is concerned) by directly controlling each played note's volume using the change_vol() function. This function allows you to make absolute or relative volume changes over a very wide range with a resolution of 1 mdb.
     
  4. Mario DeLaura

    Mario DeLaura NI Product Owner

    Messages:
    129
    I use an Akai EWI-USB and I don't have the problem you mentioned. I have the breath controller set to CC 2. I have CC 34 set for growl in my Sample Modeling Saxophones.
    What settings are you using and what Kontakt presets are you having problems? If I have the same I will try to duplicate your problem.
     
    • Like Like x 1
  5. Clint Goss

    Clint Goss NI Product Owner

    Messages:
    22
    Thank you for any info you could provide on this!

    I recorded a short demo emphasizing low breath pressure. The demo is on the Sylphyo via Link through the Patchman English Horn sample set, using Kontakt and recorded in Cantabile. Here is the waveform:

    LowBreathPressureScreenshot.jpg

    Here are links to WAV and MP3 (Lame -v2) versions of the recording:

    https://ClintGoss.com/mp3/LowBreathPressureDemo.wav

    https://ClintGoss.com/mp3/LowBreathPressureDemo.mp3

    ... The critical areas are in the areas (in seconds) of 1-2, 13-15, and 20-22. I believe that this "jittering" or "stuttering" is due to 7-bit MIDI.
     
  6. stephen23

    stephen23 NI Product Owner

    Messages:
    553
    The secret is very simple: whatever cc you use (it doesn't matter a scrap) use it to automate the volume knob in the amplifier section or the instrument volume slider at the top, not the volume modulation in the amplifier module. The response curves are quite different, the former logarithmic, the latter linear and quite unsuitable for breath controllers, especially in the lower range..You'll find 7-bit control entirely adequate.

    Some highly scripted instruments have controls on the PV called "expression" or "dynamics". If these control volume, they may be linked to volume modulation and therefore unsuitable. Use the instrument volume slider.

    (Looks a nice machine - hadn't come across it. I use a WX5 which you can't get any more.)
     
    • Informative Informative x 1
  7. Clint Goss

    Clint Goss NI Product Owner

    Messages:
    22
    Outstanding stephen23 ! I guess that's why we have community forums ...

    I've played around with it, and I did find that in Kontakt 6.4.2, in addition to your suggestions, I am able to use the Volume modulation in the Amplifier section by using a Flexible Envelope. (I don't know if Flexible Envelope is available in all/earlier versions of Kontakt).

    Using a Flexible Envelope - either using Bezier curves or the Table option - I can then define any curve I like. With a very gentle rising slope from the left (CC2 = 0) end of the range ... I have reduced the stuttering to almost inaudible.

    Thank you!!
     
    Last edited: Jan 3, 2021
  8. Mario DeLaura

    Mario DeLaura NI Product Owner

    Messages:
    129
    I'm glad that you got it working. FWIW I use CC 2 with the volume knob in the amplifier section.
     
  9. EvilDragon

    EvilDragon Moderator Moderator

    Messages:
    19,250
    It is since Kontakt 2...

    Anyways I don't think you really need to use a flex env for this. What you might need is simply adding some lag time to smooth out the CC response when it modulates the volume...
     
  10. stephen23

    stephen23 NI Product Owner

    Messages:
    553
    You mean Modulation Shaper. (An envelope changes sound in time).

    Another advantage of automation is a wider dynamic range (modulation can only reduce volume)

    I should also have mentioned that it's a good idea to examine your MIDI stream with a MIDI monitor to ensure that your pipe is set up properly.

    You might find Matt Patchman's website useful. His forum has a section on your new device.
     
    • Informative Informative x 1
  11. Kubrak

    Kubrak NI Product Owner

    Messages:
    746
    I do not use breath controller, but I guess there also may be setting in breath controller SW/driver. I bet there is something like 'transformation curve'. Using curve like right part of 'U' would do the job. Or upper left quarter of 'O'. Depends what is on x and y graph axis.......

    Simply, as perception of volume intensity is not linear, but logarithmic, so it may be needed to transform values controlling volume accordingly....
     
    • Like Like x 1
  12. Clint Goss

    Clint Goss NI Product Owner

    Messages:
    22
    The Sylphyo has many settings on the instrument, including the breath response curve. The response curves are linear, logarithmic, and "lin-log" (a combination of linear and logarithmic).

    The primary issue I have had is sonic "stutter" or "jitter" at low breath pressures, where the Breath Controller CC#2 values produced by the Sylphyo are in the 0, 1, 2 range. I believe that the integer quantization of the breath controller pressures to a 127 bit range is causing that sonic stutter. I was thinking that 14-bit ("high resolution") MIDI for Breath Controller values might be the answer, but the Sylphyo engineers fear that doubling the amount of Breath Controller data (CC#34 in addition CC#2 for the dense stream of BC directives emitted by the Sylphyo) would degrade performance, especially over their wireless connection.

    Changing curves within Kontakt with flexible envelopes (or other similar means) does seem to be the solution in my (admittedly very specific) case.

    In general, the linear and lin-log settings are far worse than the logarithmic with regard to sonic stutter. But even the the logarithmic setting produces poor results for my style of playing, which often uses a large dynamic range and hangs out on low breath-pressure segments. I believe that a double-log, log-squared, or hyper-logarithmic curve would be an improvement - what I think I am essentially getting by applying a logarithmic envelope in Kontakt to the already logarithmic output of the Sylphyo.
     
  13. EvilDragon

    EvilDragon Moderator Moderator

    Messages:
    19,250
    Did you simply try to use the lag parameter when assigning CC #2 modulator? I think that should fix your jitters quite nicely. No need for flex envs.

    To me it makes no sense to use an envelope to modulate volume when you're already modulating it directly with breath controller.
     
    • Informative Informative x 1
  14. Clint Goss

    Clint Goss NI Product Owner

    Messages:
    22
    Increasing Lag from the default of 20 to about 200 nicely cures the jitter. However, it does seem to have side effects when I use a fast vibrato from the diaphragm ... i.e. vibrato actuated through the breath-controller (which is the typical style on the "real" instruments I play). The vibrato seems to be getting "chopped off" periodically. A Lag value of 100 seems to be OK, but it does still leave some jitter.

    The Sylphyo controller only provides 3 fixed choices of curves, and none of them completely solve the issue.
     
  15. EvilDragon

    EvilDragon Moderator Moderator

    Messages:
    19,250
    So in that case, you can use the linear curve, and remap manually to your heart's content using a multiscript like this:

    Code:
    on init
       set_ui_height(2)
       set_script_title("Remap CC Values")
    
       declare ui_knob $CC (0,127,1)
       declare ui_table %Remap[128] (5,4,127)
       declare ui_switch $Default
       declare ui_switch $Invert
       declare ui_menu $Channel
    
       set_control_par(get_ui_id(%Remap),$CONTROL_PAR_WIDTH,390)
       set_control_par(get_ui_id(%Remap),$CONTROL_PAR_HEIGHT,81)
    
       declare $i
       declare %temp[128]
       declare !port[4]
       !port[0] := "A"
       !port[1] := "B"
       !port[2] := "C"
       !port[3] := "D"
    
       $i := 0
       while ($i < 128)
          if ($i < 64)
             add_menu_item($Channel,"Port: [" & !port[$i / 16] & "] Ch: " & ($i mod 16) + 1,$i)
          end if
          %Remap[$i] := $i
          inc($i)
       end while
    
       $CC := 1
    
       set_knob_defval($CC,1)
    
       make_persistent($CC)
       make_persistent(%Remap)
    
       move_control_px($CC,456,42)
       move_control_px(%Remap,60,2)
       move_control_px($Default,550,42)
       move_control_px($Invert,550,63)
       move_control_px($Channel,456,2)
    
       message("")
    end on
    
    on ui_control ($Default)
       $i := 0
       while ($i < 128)
          %Remap[$i] := $i
          inc($i)
       end while
       wait(150000)
       $Default := 0
    end on
    
    on ui_control ($Invert)
       $i := 0
       while ($i < 128)
          %temp[$i] := %Remap[$i]
          inc($i)
       end while
       $i := 0
       while ($i < 128)
          %Remap[$i] := %temp[127 - $i]
          inc($i)
       end while
       wait(150000)
       $Invert := 0
    end on
    
    on midi_in
       if ($MIDI_CHANNEL = $Channel and $MIDI_COMMAND = $MIDI_COMMAND_CC and $MIDI_BYTE_1 = $CC)
          ignore_midi
          set_midi($MIDI_CHANNEL,$MIDI_COMMAND_CC,$MIDI_BYTE_1,%Remap[$MIDI_BYTE_2])
       end if
    end on
    upload_2021-1-4_17-12-12.png

    With this you can create a completely custom breath controller response. Can even make the lowest values 0, 1, 2 all be 0, which should really cure the jitter.
     
    • Informative Informative x 1
  16. Kubrak

    Kubrak NI Product Owner

    Messages:
    746
    I do not have experience, but mathematicaly it would be better use the response curve that gives best results, in breath controller SW, not the linear. And make small adjustements to it in your script. For example zeroing 0, 1, 2, as you suggested.
    Using that script decreases resolution of breath controller. It would generate less than 127 distinctive levels. It may be OK and way to go. One has to try out.
     
  17. EvilDragon

    EvilDragon Moderator Moderator

    Messages:
    19,250
    It doesn't matter if you remap it on the wind controller or the script, it would rescale in the same way and reduce resolution if it's not a 100% linear response. Either way, if modulator lag is used, you actually get way more than 128 levels because lag works at the engine level, so that is after the MIDI values have been received, so you get floating point resolution for the lag-interpolated values.
     
  18. Kubrak

    Kubrak NI Product Owner

    Messages:
    746
    It may depend on make of wind controller and how the remap is done. And when. Sensor in WC is analog I guess. It may be converted to many levels and those levels converted to 127 levels using linear or any other curve. So using curve does not decrease number of levels. (At least not for decent curves and decent resolution of sensor)
    It would reduce the number of levels used only if curve is used after conversion to 127 levels. Which would be design fault, in my opinion.
     
  19. stephen23

    stephen23 NI Product Owner

    Messages:
    553
    Some people have a genius for making simple things complicated.

    The Sylphyo, like all breath controllers, communicates with Kontakt via a MIDI cc, and can send any value between 0 and 127 to control volume. If the steps in volume that Kontakt produces with each increment in cc value are unpleasantly audible in the lower range, those steps need to be made smaller. In Kontakt. No change or adjustment of the wind controller will help. The wind controller just sends out numbers from 0 to 127.

    This can be achieved in a number of ways.

    1. Try to find a response curve with smaller steps in volume in the lower range. This isn't too hard: the response curve Kontakt uses with the instrument slider and Group volume knob is deciBel- rather than percentage-based and is perfect for the job. I found this out shortly after buying my first wind controller, circa 2004, and haven't had to think about it since. If you need to make the steps still smaller (unlikely) you can reduce the response range in the browser (MIDI automation tab, bottom window).

    1a. If you have to use volume modulation, you can construct a Modulation Shaper which will give you a similar curve to automation. EvilDragon has taught me that this curve can be converted to a text file and edited. Have fun with that.

    2. You can get 14-bit control by using 2 separate cc#s. With MIDI-via-USB and no 32kbps restriction, this should do the job, if your wind controller supports it (my WX5 doesn't).

    3. You can artificially smooth the steps with the Lag facility (or script if you're feeling energetic). I don't recommend this - any lag process will affect the performance of your pipe. My WX5 hyas a dipswitch setting which slightly delays the response so that a note change that requires movement of more than one finger will not produce an extra bum note if the 2 fingers are not absolutely synchronous. This setting significantly affects the agility of the instrument. The whole point of a wind controller is that you play the music in real time, rather than making a montage of sounds.

    vol vs cc.jpg

    This is the audio file of a single note with all the cc values from 127 to 0 automating probably the Group Volume knob. (If you do the same process with Modulation you just get straight lines). If you want to make a suitable Modulation Shaper it should look something like this (only the other way round of course.)
     
    • Informative Informative x 1
  20. Vinark

    Vinark New Member

    Messages:
    18
    I have a yamaha BC3 and VL1m, breath heaven...And When I get jitter on my lowest breath it is because I calibrated the BC3 wrong. Here I set the lowest breath level to be CC2 level around 5, not1 or 0. I will get stutter if set that low. As zero is just off. If I monitor my BC set up this way, my lowest breath will be average of 5 but will go as low as 1 or2 and high as 10. But never zero, that is the trick. Your controller or your control over your breath might be different in supporting maybe even a lower average, but in your softest blowing you should never get a zero, that is miscalibration.