REAKTOR RIDDLES

Discussion in 'REAKTOR' started by herw, Nov 10, 2015.

  1. herw

    herw NI Product Owner

    Messages:
    5,819
    I have uploaded a new Version 8.4 of REAKTOR RIDDLES.
    I have added a solution for riddle 8.3. I am not sure whether i had planned to show other solutions in November 2016. Have to read my own document after two months. Perhaps i will add the others later and update the document.
    For now i have added only a new riddle (8.4). It is the last riddle for use of partials framework for now.
    Chapter 9 will be about arrays in core (finally).
    So let me add some comments and questions to 8.4 in next post here.
     
    • Like Like x 1
  2. herw

    herw NI Product Owner

    Messages:
    5,819
    open the ensemble riddle_8_4.ens
    some comments.

    First an overview:
    chapter_8_50_small.png
    We are talking here only about the macro signal processing/ADSR.
    Open it and we see the macros for our goom.
    chapter_8_51_small.png
    On primary level we monitor the Bus {b}.
    Have a look to panel:
    chapter_8_52_small.png
    At initialization {b} sends the messages {-1} and {-2}, the initialization of the primary- and core-containers. See comments in macro init ensemble.
    The numbering of primary containers starts here with 1 (in opposite to our last ensemble 8_3. There will be a non seen container 0 (system) which sends f.i. midi data. So ADSR is container #1 and so on.
    Scrolling to right it sends the initialization values of the ADSR 1 panel. First message [1,2,0,9] means:
    1: number of container
    2: 2 datas
    0: panel element 0 (attack)
    9: value

    First task: compare the following messages with panel elements!
    [1,2,1,8], ...
     
    Last edited: Mar 2, 2017
  3. herw

    herw NI Product Owner

    Messages:
    5,819
    Now let's have a look into core:
    Open the breadcrumb ADSR 1
    chapter_8_53_small.png
    You see that the incoming messages are observed by the ACEW (inputs 3-6).
    Open breadcrump {e} panel|Panel.
    chapter_8_54_small.png
    Scroll core debugger to entry 1. The constants c# (number of container) and o# (number of first output, not important here) are initialized.
    The first message is [1,2,0,9]. The core debugger shows how it works.
    The macro {e} panel is empty. So you get only 0 at initialization for <>attack, <>delay ....
    Scroll the core debugger to the end and change f.i. attack. There are similar messages.
    chapter_8_55_small.png
    Now your job:

    Riddle 8.4
    Fill that macro {e} panel that you get only the values for <>attack, <>decay etc. at the inputs 7-11.
    Try to get different solutions and choose a simple one.
     
  4. Quietschboy

    Quietschboy Forum Member

    Messages:
    235
    I´m very happy to see you back, Herwig! :)
     
  5. Aaron McPherson

    Aaron McPherson Member

    Messages:
    82
    It looks to me like the [1,2,1,8] message should be referencing the Decay panel element, which is set at one. After this, we have [1,2,2,0.44], which corresponds to the sustain panel element, which is set at 0.44. Sustain is third in the order of panel elements, so it gets a value of 2 in the third place. Next is [1,2,3,1], which should correspond to Release, and indeed Release is set to 1. Finally, we come to Bend, which has a value of 0, and sure enough, the next message is [1,2,4,0]. After that, the initialization messages recur, and so do the panel element messages. I'm not sure what is causing the messages to repeat like this.
     
  6. herw

    herw NI Product Owner

    Messages:
    5,819
    That's right.
    Input 3-6 is only for debugging the incoming messages.
    Top ACEW shows the sent messages, Bottom ACEW the incoming messages in core.
    1.png
    Your task is to decipher the messages so that you get only the values <>attack, <>decay, ... at macro's outputs. We are preparing to use them for the shown ADSR-macro and the following LFO, OSC etc.. It shows how the raw receive gate works and a simple task to get a quick start to our next chapter.
    Remember we are using only one wire to send messages from primary to core!
    ciao herw
     
    Last edited: Mar 2, 2017
  7. Aaron McPherson

    Aaron McPherson Member

    Messages:
    82
    OK, I think I've got one solution:
    AFMSolution1.PNG
    First, here are the values I gave to the ADSR knobs:
    AFMSolution1c.PNG
    Then, here is the results in the ACEW. I had to split it up in order to get everything to fit:
    AFMSolution1a.png
    AFMSolution1b.png
    It seems to me that adjustment of the knobs is sending a single message with the right value to each of the ports. Is this correct?
     
  8. herw

    herw NI Product Owner

    Messages:
    5,819
    your solution is fine. :)
    Perhaps you can use a second router from partials framework. As the index id filters the messages to ADSR by the raw-receive-gate macro we don't need here inputs id and # again. Now we can use this macro in all the other macros lfo, osc, filter etc..

    chapter_8_56_small.png
    The first router differentiate between [] (here index of the panel elements <>attack, <>decay ...) and its value $.
    The second router uses the panel-element-index to route the values $ to the right output.
    So finally we finished this chapter about messages.
    Next days i need to prepare chapter 9 about finishing our project goom. Our Thread is about arrays.
    If you want to read something about it, have a look into core manual pages 79-85.
     
    • Like Like x 1
  9. herw

    herw NI Product Owner

    Messages:
    5,819
    Chapter 9
    9.1 Before we start
    9.1.1 First ideas
    After solving all problems with panel elements now is time to think about signal processing especially with goom.
    Goom will be a monophonic synthesizer. Monophonic because i want to show a solution with only one core cell. So i can add effects too.
    It is no problem to realize a polyphonic synth but you have to build a monophonic part for the effects.
    solution for a polyphonic synthesizer:
    chapter_9_1_small.png
    So before i can design new riddles i want to show how to start a project. It is my way to start, perhaps you like it.

    When i start i am thinking in blocks, better say black boxes. So there are only boxes with inputs and outputs and a short description mainly a name like LFO, ADSR, OSC etc..
    From Hardware we need midi messages like pitch, gate and modulation wheels. I want to use normed scales so i have to transform pitch from [0,120] to [0,1]. To get universal use of modulations we set the modulation range [-1,+1]. REAKTOR BLOCKS use the same norm.

    I specify the modules:

    9.1.2 MIDI
    a simple module with three inputs pitch, gate and pitchbend from primary, and four outputs pitch, (Gate-)on, (Gate-)off, pitchbend. As these are isolated events, it would be very tricky to use them in an audio stream (i am using a solution in RUHR) but is not useful here because it is very complex. So the outputs will be normal events and distributed by a bundle midi and a distributor, means as global variables:
    chapter_9_2_small.png
    The macro Prim Midi is a macro which scales P and PB to range [0,1].
    chapter_9_3_small.png
    Normally i wouldn't think about it now and would think about next modules but as a small finger exercise:

    riddle 9.1: Fill the macro scaling.
     
    Last edited: Mar 11, 2017
  10. herw

    herw NI Product Owner

    Messages:
    5,819
    9.1.3 LFO
    The LFO should have two synchronous outputs mainly with different waves, so ...
    input 0 from MIDI gate to reset wave.
    output waves

    9.1.4 ADSR
    input from MIDI gate
    output 0 envelope

    9.1.5 SCA (Signal Controlled Amplifier) 2 Versions
    input 0 modulation
    (input 1 modulation)
    input 2 source
    (input 3 source)
    output 0 (mixed) signal
     
    Last edited: Jul 25, 2017
  11. Aaron McPherson

    Aaron McPherson Member

    Messages:
    82
    Here's my solution:
    Riddle_9_1.PNG
    Looking at the MIDI macros, I see that pitch has a range of 0-127, and that pitchbend has a range of -2 to +2. To scale them to (0,1), I divide pitch by 127, and for pitchbend add 2 and divide by 4. So if pitchbend is -2, 2-2 is 0. If pitchbend is 2, then 2+2 is 4, and divide by 4 gives 1.
     
  12. herw

    herw NI Product Owner

    Messages:
    5,819
    Better is to norm [0,120] to [0,1] so changing an octave is only adding 0.1 or subtracting 0.1. Although there are the values 121 to 127 not inside of [0,1] it is no problem to use them!
    Same for pitchbend: divide by 120! Because you want to add pitchbend modulation to pitch values. Important is only the same scale!
    Scaling means: if you want to modulate the pitch of an oscillator by a LFO and want to change one quint f.i. you have to choose a pulse wave with a range of 8/12 = 0.6666667.
    The advantage is that you haven't to think about the scale of the sources (midipitch, pitchbend, LFO, envelope, oscillator etc.) you have only to change the range at the input sum.
    Another example: pitchbend
    You are right that the normal range of midi pitchbend is [-2,+2]. If you want to have a range of two octaves you multiply with 6.
    Same for our normed range [-2/120|, +2/120]=[-0.01666667,+0.01666667]
     
    Last edited: Mar 12, 2017
  13. herw

    herw NI Product Owner

    Messages:
    5,819
    9.1.6 SCO (signal controlled oscillators)
    There will be three oscillators, two of them with two modulation inputs (LFO and ADSR) and one wave output. The third is more complex with up to four modulation inputs: LFO, ADSR and SCO1 and SCO2, means frequency modulation is possible. So there will be a ratio.
    9.1.7 SCF (signal controlled filter)
    a standard ladder filter with input and output
    9.1.8 mixer for mixing the oscillators.
    9.1.9 chorus
    9.1.10 delay
    9.1.11 reverb

    9.2 main structure
    So we have to add the number of outputs rawly: i would say 30 (!) will be enough.
    It's time to create black boxes means the main structure of core:
    chapter_9_4_small.png
    9.3 The core array
    It is the main control center. It controls the outputs.
    LFO1-3 have two outputs, LFO 4, ADSR, SCA, SCO and SCF one. Mixer, chorus, delay and reverb one.
    So in sum we get 24 outputs, i define the array to size=30.
    chapter_9_5_small.png
     
    Last edited: Jul 25, 2017
    • Like Like x 1
  14. herw

    herw NI Product Owner

    Messages:
    5,819
    So now still preparing with black boxes.
    First i have to get an impression about the complete Ensemble. I have some interesting things in mind but it shouldn't be too complex. So this is a compromise and at the end of the chapter you will be able to expand and change it easily.
    Here is an impression:
    chapter_9_6_small.png
    download : Reaktor Riddle 9.1 and open in folder chapter 9 the ensemble Reaktor Riddles 9_1.ens.
    Important is now to test the concept of the array. AND it is important that the concept is so flexible that we can do changes very quickly. But it has to run NOW.
    Let's first play with LFO 1. It's output is directly connected to container OUT and the meter. I show you later the connection.
    When opening the ensemble you see the meter rises slowly and jumps down quickly. You hear the click of the jump. It is a saw wave. The frequency is very low at 0.5Hz. So increase the frequency f to 50Hz and you will hear it. The meter display jumps at frequencies greater 25Hz which is the display refreshing frequency. So our ears are the control instruments.
    Set frequency again to 0.5Hz and change the wave.
    wave=0 is saw up, wave=1 saw down, wave=2 pulse, wave=3 triangle, wave=4 sinus and wave=5 random.
    Choose pulse wave and change the pulse width. Compare with f=50Hz.
    While changing the pulse width you hear an effect like phasing (low change) or chorus (quick change).
    You will recognize for sinus that you will hear nothing. That's because laptop speakers are not able to send such low frequencies. You hear from the other waves only the overtones.
    Now set the button bip/uni from bipolar to unipolar. Now the meter shows a range of [0,1].
    change to bipolar again with wave 0 (saw up). Activate the button reset and use a midi keyboard or computer keyboard to get a gate signal. The wave starts from -1 when pressing a key. This is an important feature.
    So you know all about our LFO now.

    Breadcrumb signal processing shows an overview of the ensemble:
    chapter_9_7_small.png
    Primary and core structure are identical. In primary there is only one connection, our eventbus {b}. In core we add the OBC-connection of the array.

    So first thing of test (and you will be the tester!) is writing to and reading from the array.
    A LFO is the best thing, because it produces an audio stream which you can see on meter (for frequencies of 0 to ca. 10Hz) and hear for frequencies of ca. 50 Hz. You can test different waves.
    You see that there are five LFOs. So we can test several outputs. Although the panel of this synth is impressing, it is simple in structure.
    Next post we will go inside the LFO.
     
    Last edited: Mar 22, 2017
  15. herw

    herw NI Product Owner

    Messages:
    5,819
    Every container (LFO, ADSR, SCA etc.) will have several inputs and only one output for now. So it is simple for us to find the number of the outputs:
    LFO 1 sends to out 0, ADSR 1 to out 1 and so on; so SCO 1 sends to output 3. The trick is to create the number of output automatically, so you don't have to remember the output number but you can use the wire debugging. Better would be to remember nothing, but that's not trivial.

    So let's have a look inside of LFO 1 first (bread crumb LFO 1):
    chapter_9_8_small.png
    The yellow box is a structure which we know from our ADSR-example. It's the interface from panel elements to core, so nothing new.
    The pink box has standard core macros: a LFO and random with a clock generator. I have added a macro for bipolar and unipolar waves (turquoise box).
    Interesting are here the green boxes. We look into left top macro:
    chapter_9_9_small.png
    It's a simple initialization. We increase the number of c# (address of container) and the number of outputs +o# of this container. Here it is always +o#=1 but in more complex ensembles you will be able to add more outputs. So the bus {b} transfers the infos to the next container.
    At the output the container has its address c# and the address of it's output o#.
    We use the address o# for the array. o# is the index; as it is the first outputs, the index is o#=0.
    chapter_9_10_small.png
    very simple
    Now how can we read it?
    Open the container OUT (bread crumb OUT):
    chapter_9_11_small.png
    When you read from an array you need a trigger. As we use audio signals best is SR.C (sample rate clock). That's all!
    As every container out is connected to the OBC you can read other audio sources by setting the index. As our connections to other inputs are static you have to find the numbers o# of wished outputs
    I have copied the LFO 1. So ...
    Exercise 9.2
    Connect each LFO 2, LFO 3, LFO 4 or LFO 5 to the readout. You have to find the right addresses.
     
    Last edited: Jun 26, 2017
    • Informative Informative x 1
  16. Aaron McPherson

    Aaron McPherson Member

    Messages:
    82
    I'm not sure if I understand what you are asking for, but I can get LFO2 to output to the meter by changing the 0 input (index) for the Read [] macro to a 4. This makes sense, because it is the fifth container in the series, and each module has 1 output, so counting up from 0 you get (0,1,2,3,4). Using the same logic, LFO3, the ninth container in the series, should have o# = 8, and testing this it works (you have to change the wave from 4 (sine) to 0 (saw up), or you don't hear anything). LFO4 should have o# = 13, and LFO 5 should have o# = 16. Testing each of these values (and switching the wave to 0), I can get the same results as with index 0.
    After I did the counting, I realized that there is an easier way to get the index #/o#: just go into each LFO container, and use wire debugging to see what number is being read to the array.
     
  17. herw

    herw NI Product Owner

    Messages:
    5,819
    yes, that was the sense of this simple riddle. If you like, you can add a knob and a router to container OUT to get different sources - only a finger exercise
     
    Last edited: Mar 23, 2017
  18. Matt Berry

    Matt Berry New Member

    Messages:
    2
    Hey! Quick question

    I am still using Reaktor 5 and I am currently building a compressor - however I have come across a hurdle.

    I need to be able to use a thing called a 'AF2dB' converter. However when I CTRL-F and search for it all I can find is one called 'dB2AF' which is of course the wrong way round. is AF2dB only a feature that can be used on Reaktor 6? if so am I able to build it myself using a core macro?

    Thanks

    Matt
     
  19. Paule

    Paule NI Product Owner

    Messages:
    1,975
    The ‘db2AF’ decibel to Amplitude Factor is needed in Flatblaster 2.02 limiter. It converts a control signal from dB scale to linear gain. E.g. 0 (dB) -> 1.0, -6 (dB) -> 0.5 etc. I didn't found ‘AF2db’ in Reaktor 6.
    upload_2017-5-16_23-14-34.png
    search fields: no match
     
  20. herw

    herw NI Product Owner

    Messages:
    5,819
    You can use in core the logarithmic function: change the base to 1.122
    AF2dB.jpg