1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Formant Osc-like effect on audio source

Discussion in 'REAKTOR' started by carloskleiber, Mar 17, 2009.

Thread Status:
Not open for further replies.
  1. carloskleiber

    carloskleiber Forum Member

    Messages:
    537
    Hello,
    I have been playing around with Gabriel Mulzer's Wellengeber,
    http://www.native-instruments.com/index.php?id=userlibrary&type=0&ulbr=1&plview=detail&patchid=3813

    I love especially the formant osc mode, where the pitch knob basically sweeps through the existing harmonics of the sound.
    I do not exactly understand how this works, just that it is kind of a frequency shifter, which takes the formant (peak frequency in spectral domain?) of the sound in consideration.
    I wonder how this could be adapted to build an effect for a simple audio source. I have searched for "formant" in the UL, and the effects that I found sound very muffled, slightly modifying the sound's "vowel type", at the best. What I'd like is an effect that emphacises certain frequencies of the sound, without denaturing the rest of it. And the possibility to "sweep" through those highlighted frequencies.
    Did I miss something in the UL? And if I want to build, where should I start? Does it necesserely need an fft tool to identify the audio source's formant?
    Thank you for all suggestions,
    carloskleiber
     
  2. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    Hi. What happens there I think is called Formant Pitch Shift. You could start by learning what the core cell structure of 1form module. It will be necessary. First, where are several inputs. "F" input is used for current Note Pitch, while "fF" is used to shift frequency. I'm not sure what is i input, but v are voices. This is very hard to understand at first glance, you have to study it carefully. Also, try to look for "Formant Pitch Shift" in internet and "Formant Frequency" maybe.. I would also suggest you to start with building basic saw wave in core and try to play with pitch shift there..
     
  3. carloskleiber

    carloskleiber Forum Member

    Messages:
    537
    Hey, Alex, thank you for taking interest in this..
    I have pretty much followed the same logic as you did, meaning looking for the place to hook up an external source instead of the internal one. I think the problem starts much before the core cell. If you look at what the wellengeber does, it generates waveforms adding a certain amount of harmonics? partials? to the fundamental frequency. (It is nice to see by the way how you get saw and square waveforms adding specific amount of odd and even harmonics to a sine wave). So I assume the 55 additional harmonics you can draw correspond to how it works in music, octave, 12th, 2octaves, and so on.. This is why even the complicated waveforms sound nice, less "digital" than if you draw a waveform by hand.
    Anyway, the i and v values that are computed determine the waveform, (although I do not understand why i counts from 1861 to 2049, which corresponds to 188 values, not really related to 56). v gives the 188 corresponding values. And the pitch comes from the MIDI keyboard.
    So I guess the idea is to take a "spectral picture" of the same precision, 56 or 188 "parts", of the incoming audio sound, and unfortunately this seems to be needed constantly in real time... The good thing is the pitch is probably integrated in this. Which all means: back to fft? :eek:
     
  4. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    Hm, very interesting.. Well, if I wouldn't so busy with that antialiasing problem, I would try to dig deeper. I would probably start with some simple saw oscillator made in core and try to play with phase there adding more and more complicated structures.. Then I would add any of tables and would try to draw line there and implement it in phase.. But that's me.
     
  5. carloskleiber

    carloskleiber Forum Member

    Messages:
    537
    No worries, this is a long term project, I do not expect to be done too soon. But I see it as a good impulse to start with dsp type effects that fft and probably other techniques let you do, in opposition to traditional effects that apply the same treatment to any sound source. In case of the wellengeber one clearly sees what the core cell needs to be fed with, and the fft core macros, if I understand right, well, this is what they do, they transform time domain into spectral domain, so they should be able to be set to match those properties.

    Another thought that I had and that would highly simplify, well, not mine, but the computer's job (I am still on a 4+ year old powerbook): what if the pitch detection and the spectral picture taking process were unlinked? I want to use this effect on a simple monophonic instrument (a clarinet, to be precise), which does not sound so extremely different two different days on the same pitch. So an idea would be to create a spectral picture map the same way one builds a sample map: if we are really picky, it would mean one picture for every minor third, and two versions, high and low dynamics, for each. And so pitch and gain detection would be done in real time, but the applied effect would use an older spectral picture instead of the realtime sound. And since an effect like this does not need to be used 100% wet - rather 20-50% - it would still sound quite natural.
    Not too sure if I am right about all this, and if my explanation makes sense:confused: i hope it does...
     
  6. ehdyn

    ehdyn NI Product Owner

    Messages:
    547
  7. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    A bit off-topic - I was tryint to implement a simple pitch detection method - but it didn't work. I started with basic saw wave and checked when it reaches 0. Then there is event went through to Timer if it is which has Frequency output. I always get 400 although.. I must be missing something I guess..
     
  8. carloskleiber

    carloskleiber Forum Member

    Messages:
    537
    No, as a matter of fact I haven't... looks very exciting, thanks for pointing out.. I'll need to wait until Monday to try it out with my real setup though..
    ---
    Not off topic at all... one pitch detector that seems to work for me is Bertrand Antolin's VoiceKeys, he had different versions and it was not clear which was the last one, it seems like he made some order in his uploads, right now there is only one:

    http://www.nativeinstruments.de/index.php?id=userlibrary&type=0&ulbr=1&plview=detail&patchid=8066

    ...so I guess there might be a way to use something like this, and even find a shortcut and use rawer info than the ultimate MIDI pitch value...
     
  9. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    It works for me as well, but I still would like to figure out why my scheme doesn't work. I know that probably phase never reaches value 0 as integer (that means 0.0000001 or something like that), but when I round this value I also don't get it equal to 0. I'm not sure what do I need to do. Probably start a new thread about it?
     
  10. BertAnt

    BertAnt NI Product Owner

    Messages:
    414
    Sorry for the inconvenience, the last one v1.4, i'm currently still working for v1.5..

    I suspect the 400 hz freq is coming from global event rate, the timer takes every event into calculations..
     
  11. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    Yes, I've figured it out recently, thanks. I'm trying other method now.
    ---
    Here is my problem (I don't know what modules should I use): say I have sawtooth wave with some pitch and amplitude of 100. I round this value using Modulo by dividing with 1 and get range from -100..100. Each time value is 0 I want to send ONE event with value of 1 and I want use some counter to count those 1 values, so I could then count frequency of sawtooth wave. The problem is there are always more than one event and its obvious, because Modulo works each time value fires its input. Are there any other simple way to make this structure work? Also, I tried to compare oscillator itself with 0, but I know it doesn't get integer values..
     
  12. PeterW

    PeterW NI Product Owner

    Messages:
    182
    I have been working on a pitch to midi macro, not finished yet, and have used the following method fairly successfully so far...

    Feed the input signal into an "A to E Trig" module. The signal goes into the Trig input and a constant of 1 into the A input. Take the E output and feed it into a "Timer" module. Use an "event smoother" on the timer's F output then onto a "Log F to P" module to convert to Pitch. Follow the "F to P" module with a home made "Float to integer" macro and you get a P value event for each zero crossing of the input signal.

    The "float to integer" macro will need more than a "modulo" module. Compare the Mod output with say 0.4999 and add the > output back in with the Div output, this should make sure that the input frequency is converted to the nearest correct P value.

    There is some jitter on the P output so it will have to go thorough some sort of majority decision macro, I'm still working on that bit.

    EDIT:- The jitter was being caused by the Float2Int macro- Fixed.
     
  13. PeterW

    PeterW NI Product Owner

    Messages:
    182
    Like this...
     

    Attached Files:

  14. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    Nice one, works for me! ;) I will study it more precisely.
     
  15. BertAnt

    BertAnt NI Product Owner

    Messages:
    414
    StepFilter doesn't work ? Well, i think the simplest way is A/E trig module, you get a nice one-time only event (like having a built-in stepfilter) with value defined at the audio input every time the signal phase changes from - to +, while the module also convert the audio to event on the fly..

    Isn't it easier with just using Quantize module (which automatically map the float to the nearest integer instead of modulo that just simply remove the rest from integer division) ? Or maybe i'm missing something here..
     
  16. PeterW

    PeterW NI Product Owner

    Messages:
    182
    Yes that is an ideal solution. I forgot about the Quantize module. Thanks.

    As you say the modulo module cannot convert float to interger on its own, I had to follow it with a compare. Your method is much more elegant.
     
  17. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    No, StepFilter doesn't work and it seems like I'm getting each time two events with two values - 0 and 1 and that doesn't depend on speed of oscillator.

    But I've sold this problem using A/E Trig module as you've said. Now I need to make right counter for frequency.

    Here is the structure that works for me (see picture attached).
     

    Attached Files:

  18. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    Now the problem is how to detect frequency.. Any ideas are welcome!
     
  19. PeterW

    PeterW NI Product Owner

    Messages:
    182
    ?...
     

    Attached Files:

  20. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    Sorry, I was doing it with Modulo eventually. I dismissed the right use of A/E module. Instead I've sent output of Modulo to it. Thanks for your contribution!
     
Thread Status:
Not open for further replies.