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

octave range expander/attenuator

Discussion in 'Building With Reaktor' started by JAMCPH, Dec 5, 2016.

  1. JAMCPH

    JAMCPH Member

    Messages:
    48
    Hi.

    In a synth patch, i want to be able to expand the normal 12 tone octave or to diminish it.
    Lets say i play c1 and then c2. By turning i knob i should be able to i should be able to adjust, so it would be C1 and then "a little more" than C2. It should also go the other way. C1 and a little less than C2.
    Makes sense?

    I know i can take the pitch of the keyboard and multiply or divide to do what i want (increase/decrease octave range). The problem is that i will be adding or subtracting from the main pitch by doing so, so i constantly have to turn a master pitch up or down when i want to adjust the expander/attentuator/octave range thing.

    Think of it as a compressor/expander, with built in auto makeup gain;)
     
  2. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    FWIW, that wasn't entirely clear to me.
    i kinda thought i was following you, then you started talking about how it was like a compressor?
     
  3. colB

    colB NI Product Owner

    Messages:
    3,969
    That was my first impression - I think I know what he means though - like a compressor but for pitch instead of amplitude... kind of a weird way to put it but...

    The difficulty though is the idea that it should have 'auto make-up gain'... I think the desire is that when you start playing a phase, the first note is correctly pitched, and octaves either side are progressively scaled, then if you start another phrase elsewhere, that also starts at correct pitch.

    That sounds great in theory, but in practice, not so easy when the details are considered - it couldn't work like a compressor, because we are quite happy to listen to small modulations in amplitude, or for a change in amplitude to follow some - possibly non-linear - curve. Pitch on the other hand works differently from a perceptual point of view, so an approach that works well for a compressor is likely to just sound like a big old mess when applied to pitch. I think as a concept for a device to 'play' it would always involve serious compromises...

    Even if it worked 'properly' I'm not sure that there is much value in it other than as an academic experiment... but what do I know - I didn't rate the bytebeat concept when I first read about it - until I heard it !
    -------
    Simplest approach would be to forget the compressor analogy. Have a timer control. As you play, if there is a gap longer than the set time, the centre pitch resets on the next note played... Should be pretty easy to build a sketchy version as proof of concept.
     
    • Like Like x 1
  4. JAMCPH

    JAMCPH Member

    Messages:
    48
    Sorry if i didnt make myself clear:)

    To put it in 1v/oct terms. (old Control voltage).
    Normally, pressing a keyboard at a certain place would make it spit out 1volt. An octave above that: 2 volts, etc.
    What i am trying to do is scale the keyboard to 1.5v/oct and 0.5v/oct, and everywhere in between. The Xv/oct should be controlled by a knob
    That way i would be narrowing and widening the octave range. Basically i'm trying to make a built in bad octave tracking of an oscillator. And i want to be able to adjust it to perfect tracking and less than perfect tracking:)

    That can be achieved by multiplying or dividing the signal coming from the keyboard/midi in to the oscillators. BUT by doing that, i would be offsetting the whole thing frequency wise. If i play a A=440hz and adjust the octave tracking, the A would either be 500hz or 300hz depending on which way i turn the knob. I want it to stay at 440hz. But now that i put it like this, I cant really think of a logical way to do it.

    But thanks for reading this anyway:) Hope you understand what i'm trying to do. And maybe you have a solution.
     
  5. colB

    colB NI Product Owner

    Messages:
    3,969
    exponentials and/or logarithms.
    One nice simple way would be to use your idea of scaling the pitch, but use differences.
    Say you want your 'correct' not to be A440, and you want to scale by 1.5v/oct...

    incoming pitch is Pi, A440 pitch is Pa...

    Pdelta = Pi-Pa.
    ScaledPdelta = Pdelta * 1.5
    Ffactor = dp2FF(ScaledPdelta)
    F = 440 * Ffactor
    Where dp2FF is the core macro 'delta pitch to frequency factor'.

    In Reaktor, something like this (untested)
    pitch scaler.PNG

    You could use a timer to allow the basePitch to be reset to the first note after inactivity, or allow it to be set manually with a knob, or drift randomly :)
     
  6. Contrast

    Contrast NI Product Owner

    Messages:
    347
    A partially related aside, which maybe you're already aware of, is that when tooling around with octave stretching it's fun to build sounds additively and squish or stretch the harmonics by the same scaling factor as the octave. Of course you can build something like this relatively easily in Reaktor (even just with ~10 parallel sines if you don't want to hassle with sine bank etc). It reduces the dissonance greatly since you don't have massive beating between harmonics anymore (though still sounds a bit odd/off, I guess because of generally moving the fundamentals further away from being simple ratios of each other - but really rather listenable). But if the dissonance or just weird modular tracking stuff is what you're looking for then maybe not!
     
  7. colB

    colB NI Product Owner

    Messages:
    3,969
    Ok, I threw together a test of the above example (attached) - it works as expected.
    There are two controls:
    baseP sets the base note - this note will always be in tune.
    scale sets the tuning adjustment... in the centre '1' (double click) everything will be in tune. With settings less then 1, notes lower than baseP will be progressively more sharp, and notes higher progressively more flat. Settings greater than 1 will do the opposite, notes lower will be progressively more flat, and notes higher more sharp.

    With subtle settings, this really does give a kind of dodgy 'bad tracking' analog tuning feel.... kinda.

    Might be worth experimenting with random variation, different ways to dynamically set the baseP etc.
    If it turns out to be useful, it would be a simple enough job to turn it into a Block.
    bad tracking sim.PNG

    EDIT: version 2 with working polyphony added - gives better idea of beating effects due to bad tuning

    Any questions, fire away.

    Colin
     

    Attached Files:

    Last edited: Dec 7, 2016
  8. JAMCPH

    JAMCPH Member

    Messages:
    48
    You da man! Thanks:)
     
  9. colB

    colB NI Product Owner

    Messages:
    3,969
    No problem :)

    As usual with these things, the first attempt is unnecessarily complex, here's a simplified version... also updates while tweaking scale and/or base note...
    bad tracking sim 2.PNG

    As you can see it really is as simple as just scaling the pitch - you just have to normalise it by removing the base offset first then adding it back in after!
     

    Attached Files:

  10. JAMCPH

    JAMCPH Member

    Messages:
    48
    Is there any way you cold save this a reaktor 5 file? Pretty peleease;)
     
  11. colB

    colB NI Product Owner

    Messages:
    3,969
    No, it is not possible to save an R6 ensemble as an R5 file.

    It is a very simple structure though - the envelope and oscillator are just there so the example generates sound. The only crucial parts are the:
    - * + and P2F modules and the various inputs - which are all self explanatory - very simple to recreate yourself in R5 - probably quicker than logging in and downloading an example...
    Just build it yourself!
     
  12. JAMCPH

    JAMCPH Member

    Messages:
    48