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

Trying to select values from Core arrays via a Primary list - help please?

Discussion in 'REAKTOR' started by Robert Kramer, Mar 19, 2017.

  1. Robert Kramer

    Robert Kramer New Member

    Messages:
    3
    Hi all,

    I'm working on a simple, mostly-Core oscillator at the moment. It basically uses 8 sine oscillators as partial generators - what I have set up is an array (core) reading from a list of three possible values for the different partials, with values derived from a mathematical series (integer, primes, and fibonacci).

    It seems the internal structure of each partial engine is working fine - the problem is that the value from the Primary list, higher up in the structure, is only sending to the first partial, and not the rest.

    Any ideas? I'll happily answer questions and post the ensemble for help - I just need to make a clean copy first.

    Thanks!
     
  2. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    sounds like you didn't set the number of items in the array to me
     
  3. Robert Kramer

    Robert Kramer New Member

    Messages:
    3
    Hey! Thanks for the speedy reply SA - I've got the arrays set up with the lengths and values defined (it's only three possible values for each).

    Attached is the oscillator in a testing environment - you'll probably recognize all the coding, because it's 99% taken from your online tutorials. ;)

    As of now the problem seems to be isolated to the 3rd partial engine - it doesn't appear to be receiving any information from the algorithm list, while the other partial engines are working properly, as far as I can tell. Switching algorithms works - it's just not feeding to the 3rd sine generator.

    I'm a complete newbie so please let me know any and all suggestions you have - and thank you for your incredibly helpful tutorials!
     

    Attached Files:

  4. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    2nd and 3rd oscillators sound different to me, and seem to be sending different values, at least to some oscillators?

    as for the 3rd partial engine - if you mean the 3rd sine wave, all three engines send a value of 3, so i'm not sure how the expected behavior is different from the actual behavior. (IE the array has 3 values, and they are all equal to 3, so of course the value doesn't change!)
     
    Last edited: Mar 19, 2017
  5. Catman Dude

    Catman Dude NI Product Owner

    Messages:
    761
    The 3rd partial engine isn't plugged properly into the adder in Partial Summing macro.
     
  6. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    catman dude, my mild derailment of this thread is worth it to me to mention: i'd forgot to tell you, your take on that slipshod frequency detector i made was very clever, i never heard of any frequency detection being averaged over a time window like that. and when i was working on some even-hairier-than-its-predecessor transient detection protocol last week, your macro was holding down one corner of that dubiously-justifiable-yet-compellingly-effective trifecta.

    between that and your powers of 2 bit shift quantizer. i really get a kick out of your way with coming up with novel ways to cleverly improve something. i'll take all of that you got
     
    • Like Like x 1
  7. Catman Dude

    Catman Dude NI Product Owner

    Messages:
    761
    Thanks, Andrew.
    But now I am worried for you. ;)
    I had to hunt for my solution to that problem to remember what the 'window' was. Oh yeah, use the number of samples between positive crossings to calculate the frequency. I'm glad it's working for you!
    (Colin says it's overkill however. Most of the time I just choose the dumbest bunniest solution that occurs to me.)

    And I didn't think your pitch detector was slipshod. I just didn't know what the Timer module was doing exactly, which is a problem I have in general with all the magical Primary modules that do great stuff but don't tell you how. :rolleyes:

    About my pitch quant block, you may have seen the thread almost 2 years ago between Thala Estra and me about the bugs I encountered in various methods of doing proper pitch quantization, while checking out Thala's mods of the Kodiak Shift Sequencer? The Digilog version wouldn't pass through an F though it was part of the selection, converted it instead to F#. It has a crazy formula that works most of the time, but not all the time. That was blowing my mind.

    The bit-shifting solution is one I had used a thousand times in some algorithmic software I wrote using objective-c back about a decade ago. It is all about pitch and rhythmic transformations of MIDI data in MIDI files. I had tons of pitch transforms that required knowing the Pitch Class content of any given set of notes, and bits were the most compact way to do that.

    I really want to develop some of that stuff in Reaktor, but the stumbling block is usually the GUI. I love that so many people are good with images and make pretty-looking blocks and other things. It just takes me a long time.

    I always like reading your posts: your thought processes and what you've learned about DSP are so interesting to me. They seem deep to me but are expressed so casually, as if everybody knows what you know. No. Way.
    I still have a long way to go, but I love working in Reaktor, apart from the tedium that sets in with all the things you have to repeat. I want a command that does: 'Repeat what I just did wherever relevant. Please?'
     
  8. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    i can certainly appreciate its possible i could say something that went over someone's head, but only because im very familiar with having that happen to me. i know at least sometimes im full of crap and just saying things, which is something i've been learning to avoid but can still happen. really, i always feel like i'm playing catch up with everyone else, so its very hard to imagine knowing things other people don't, and something that really brought this to a head for me was when vadim said something i disagreed with (imagine telling a guy like that "im pretty sure that's not quite right" i did, but its not a comfortable feeling). i had no idea if i was pointing out something he never noticed or something so obvious and irrelevant as to not merit pointing out, it might have been a bit of both, but i wasn't exactly wrong either.

    so i think if im being fully honest and fair with myself, if i do understand some things in a way a lot of other might not (almost impossible to imagine what they might be) its probably a bit like when a person with a handicap finds some way to compensate that allows them to live a mostly normal life instead of being debilitated. colB loves to yammer on about how the language of DSP is mathematics, and as much as i'd love to be able to correct him on something once, its unfortunately not wrong (maybe incomplete). but for me mathematics is the handicap and my way of compensating is with concepts, and i've taken a lot of care in conceptualizing and visualizing hopefully integrating these understandings. it won't help much with finding filter coefficients but i suppose its entirely possible flexing that muscle could be helpful for a kind of big picture thinking

    that's why i wanted to make a point of not forgetting to tell you how awesome i thought some of your solutions are. i love unconventional tricks like that, and the way you apply them makes me jealous because they are unconventional yet deliberate and well reasoned. especially the frequency detector once i had a look at it. i don't want to slam colB because his tendency to shoot things down is always well intentioned and a vital ecosystem role, but i learned pretty early on, while great for pointing out flaws, he's a pretty lousy gauge for whether an idea has potential or not. instantaneous frequency detection has its uses but if the input crackles or sputters now you're reading 22050, and measuring frequency as how many times something happened over some length of time—which is what frequency is—instead of something that just happens once, it seems almost silly not to do it your way.

    i'll bring it home while also explaining the transient thing that made me sound like i had a screw loose: i was bandpass filtering fft signals and i noticed transients were emphasized and isolated at certain settings. upon further inspection the critical factor was extremely low cutoff, over several frames and since fft amplitudes cant be negative and must be clipped at 0, this long cycle was pushing entire frames into 'silence'. for whatever reason, this seemed effective, but since cutoff frequency was a factor, it seemed to drift in time slowly with the frequency of the transients, or the rhythm track i was detecting. well, dang it. maybe if there was some way to adjust the cutoff to be more consonant with the frequency of the rhythm.... except that wont work because transients come at odd times and keeping the 'tuning' of the cutoff stable with the kind of naïve frequency detection like the one i posted and inspired your method would jump all over the place in a situation like that and result in a bloodbath ... dang it!

    you might see the general direction this could be heading. your detector came into the picture at this point. it was a real fudge, not an exact thing, but the measurement over time to give a kind of average and just enough correction. i don't know whether to think of it more like resetting the phase of an oscillator... as in the cutoff frequency and the rhythm frequency were slowly drifting over time and this was 'resetting' it , or if it really was applying some corrective tuning, which seems possible because it seemed to respond when a drum fill or increase in transient frequency required it. anyway i can say with certainty that's not the first time that would have come in handy

    now we're really crashing this poor guys thread. welp- not sure where else we would get a chance to say this stuff so self forgiveness it is. i definitely get the GUI thing. i teamed up with brent one time to avoid the issue, though he seems to have burnt out possibly? i think its not too hard to get set up with some generic stuff to make it a lot easier. just enough to make it look like you care
     
    Last edited: Apr 28, 2021
  9. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    sorry, just read this again, and concerning that frequency detector, it absolutely is slipshod and it is also absolutely not mine! its just the known way of doing it that i threw together 2 seconds for that guy. not to be defensive or anything but the thought of that being my idea in the first place is like a poo sandwich, my pride in having a nuanced and complex set of ideas on the topic of frequency detection can not let that pass uncorrected

    also it seems the thread is resolved which i hadn't noticed so it seems my worries this conversation was interrupting anything was without any basis
     
    Last edited: Apr 28, 2021
  10. Catman Dude

    Catman Dude NI Product Owner

    Messages:
    761
    It does seem kind of like a 'frequency follower' more than a 'frequency detection' method. But having 'followed', it does have to reset and start counting all over again each time, like phase sync. So there's a blippy-delay aspect, and then I can see why you called it a 'window'! Bingo!

    Oh the math. Ouch. I love to read Laureano's posts too, and once upon a time I could actually do the calculus thing he so easily pulls out of his pocket. I love to read from VA Filter Design every few months. Do I make any progress? Hard to say. I have the dream that some day it'll all just slot right into place in my head and I'll follow all the equations and how xy begets yz and down the equation-generations. But then i wake up again and it's still math!
     
  11. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    sorry, i was unclear about the phase thing and got you confused. you know how two things slightly out of tune will slowly drift or beat? and how that beating or drifting could be thought of as a wave? well the rhythm being detected, and the bandpass that's filtering that signal's fft with very low cutoff, are around the same frequency, but they slooooowly drift out of sync. and that drift out of sync would be the 'phase' needing reset in this scenario, because we want to keep them in time or 'phase'

    your frequency follower (working like a bpm follower, timing the transients) is sending adjustments to the cutoff and those adjustments are what is resetting the 'phase'. the adjustments are so frequent that drift can never really get out the gate. and if it did work this way it would not be as intended, but it would still be working

    anyway it doesn't matter i wanted to see if i could make that make sense

    yeah it took me a good minute to look inside your structure and figure out what the heck was even going on. it was very well built though, made it pretty apparent that you had pretty solid understanding of core building. im not sure what it would look like if i tried to build that, but definitely nothing that clean and simple

    laureano is so good at that stuff its hard not to feel like an idiot in the back of your head even during a normal conversation. he expressed wishing experimenting with stuff like i do came easier for him, and when i said i was jealous of all the stuff he'd learned he downplayed being very good. give me a break. its cool we get along pretty well, being polar opposites in a way. generally in DSP land super competent people like him are typically a bit serious like they learned ate a piece of their personality, self-taught guys like me are on the outskirts alienating everyone with outrageous claims, so a situation where you could even see if there was some synergistic benefit in kicking ideas back and forth seems fairly uncommon. lately he builds things and i ask questions about that lol.

    so when you read 'the book' can you kind of follow along? or is it basically japanese like it is for me? i hate being confused. i can try to start working through something, but there are just ambiguities at every step, instantly hung up and i don't even know how to go about figuring out. i did ace algebra the last time i took it without turning in a single piece of homework, but i figure reaktor can do math pretty well if you hook the wires up right.