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

Pitch Shifters...So, What's Going On There?

Discussion in 'Building With Reaktor' started by Squid79, Jun 22, 2014.

  1. Squid79

    Squid79 NI Product Owner

    Messages:
    29
    I recently uploaded my "Detuner + Chord Maker" Ensembe here: http://www.native-instruments.com/en/community/reaktor-user-library/entry/show/7935/ ...and I was wondering if anyone would like to chip in their two cents in regard to just what the hell is going on inside the factory pitch shifter macros, which I have trimmed down a bit.

    I would like to make this ensemble more CPU economic, and perhaps even build it entirely in Core, but before I can do that, I need to understand the basic principals of pitch shifting in general. I have practically NO DSP skillset, but that's basically just because I don't know where to begin. I tried learning algebraic equations and some other maths, but in order for me to retain the math, I REALLY need to know WHY I would use an equation and WHAT I would use it for, so I need a more hands on approach where I can really USE an equation to get a feel for it's basic application. Otherwise, I don't retain mathematic principles and I end up right back where I started.

    Hmmm, sort of ended up as a DSP thread. But anyway, I've attached the PNG photos in a ZIP file so you can browse through the algorithm without having to open up the ensemble file and fish through the factory pitch shifting macro. I'm not looking for simple solutions or easy answers. I actually want to learn about this stuff, so I'm open to a long-term learning path. Any help is appreciated. THANKS :)
     

    Attached Files:

    Last edited: Jun 22, 2014
  2. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    honestly, you need to just trust that you will need the math. you'll need at least upper high school level algebra to understand even the most basic texts on DSP. a start might be working on something easier, like an oscillator, since there appears to be one (well 3, really, but they use common components) inside the pitch shifter you are asking about.

    here's my favorite document on oscillator design:
    http://courses.cs.washington.edu/courses/cse490s/11au/Readings/Digital_Sound_Generation_1.pdf

    the core pitch shifter uses 3 oscillators - two ramps from 0 to 1, and a triangle oscillator from 0 to 1, with the tops and bottoms cut off, so it ends up being almost a square wave with slopes instead of straight lines for transitions. the ramps are out of phase by half a cycle, and modulate the delay times of a simple two-tap delay - modulating delay time causes pitchshifting in digital devices.

    the triangle oscillator then fades between the two delayed signals. i don't know what exact math they're using but it doesn't look too hard.

    btw you can just embed your pictures into your post, probably get a lot more views that way.
     
  3. Squid79

    Squid79 NI Product Owner

    Messages:
    29
    Thanks Salamander, "just trust that you will need the math" is probably the best advice. I'm looking at the document you shared on oscillator design, feeling very (ahem) uneducated upon reading Section One: !@?xWtF/$^*>O_O

    My greatest fear hath been confirmed. I have to go back to school :(

    Oh yeah, I tried to embed my pictures but there are like 28 of them, so....
     
    Last edited: Jun 23, 2014
  4. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    i just wanted to show you a document full of math that illustrated the sort of stuff you need ;) don't worry, there's a LOT of stuff in that document i don't understand either. but the beautiful thing is you often don't need to understand math to implement it!

    here's a much easier document i wrote on designing simple oscillators:

    http://www.nireaktor.com/reaktor-tutorials/creating-custom-oscillators-in-reaktor-core/

    may i ask what math classes you took in high school?
     
  5. Squid79

    Squid79 NI Product Owner

    Messages:
    29
    I dropped out of school early on and then had to go get my GED. I managed to scrape by with a passing grade with a half-way decent working knowledge of elementary level mathematics. I went to an adult education center for a few years and I got really good at fractions, ratios, and especially geometry which I developed a strong fascination with. So, I excelled at those, but when I sat down to learn high school algebra it was like a punch in the gut. Unfortunately, I've forgotten most of the basic math principles I learned, so now I'm back at an embarrassingly primitive knowledge of mathematics.

    2+2=4 YAAAAY! :D
     
  6. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    ahhh... i was pretty good at math in my younger days but i forget most of it. i was lucky enough to take a class on discrete mathematics, which is very relevant to DSP, before dropping out of college, and before i had any idea what DSP was.

    to be honest, it'll be a tough path from there to learning about pitch-shifting effects - if you want to get into DSP, most of the stuff you'll see will use a lot of algebraic principles. there must be a good site for learning algebra, but i don't know what it is.
     
  7. Squid79

    Squid79 NI Product Owner

    Messages:
    29
    Actually, just last year I was learning algebra from YouTube but I put it down because I was afraid I would bump into problems later on down the road because I would encounter things that are rooted in more basic math principles that are prerequisite to algebra, but the algebra itself doesn't scare me that much...it's everything that comes BEFORE algebra that I'm afraid I'll have to re-learn...which is probably an unavoidable fact. So, do you think I should just learn the algebra and fill in the blanks later on, or start with the more basic things that I forgot like ratios, geometry and THEN move on to algebra?
     
  8. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    just learn algebra, is my opinion - as long as you know basic arithmetic and geometry you should be fine. although i went to a weird high school that had 'integrated math' which means there was no trig, algebra and geometry classes, they were all rolled into one, so my opinion may be warped from that.
     
  9. Boom A Puma

    Boom A Puma NI Product Owner

    Messages:
    85