REAKTOR RIDDLES

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

  1. herw

    herw NI Product Owner

    Messages:
    5,810
    Introduction

    I think you are a user of REAKTOR 6 and you are a noob. You are fascinated by the wonderful REAKTOR blocks library and have created some nice first ensembles! :)
    Yes and now you are excited to do the next step: create your own blocks!
    And you have a look into the structure and you are thinking: what the hell is this?
    Oops, first a nooby and ever a nooby? :oops:
    The next step isn’t to build your own blocks, because those are very special and ambitiously programmed. The next step is to built some ensembles! But where to start?

    So this workshop is made for those who are interested in building own macros, instruments and ensembles, starting from scratch. I think there has to be a motivation, so that’s the idea of REAKTOR RIDDLES.
    I will create from time to time some simple riddles and a simple solution. The solution will follow a few days later with hints and explanation and some extensions. In the meantime you can try it by yourself and discuss eventually presenting ideas of your solution here. It is no competition, who is the best and quickest, so please: advanced programmers have to keep silent :cool: . Afterward they can present their solution or alternatives. Noobies comments are welcome!
    As the files maybe several MB i upload them in the user library and will update it with every new riddle. This is the link:

    http://www.native-instruments.com/en/reaktor-community/reaktor-user-library/entry/show/9205/

    Perhaps you are reading this thread a few months later. So then please don’t read or load the solution at once :D !

    PS: please ignore grammatical and spelling errors; i am a non native speaker.

    ciao herw
     
    Last edited: Dec 10, 2015
    • Like Like x 10
    • Informative Informative x 2
  2. herw

    herw NI Product Owner

    Messages:
    5,810
    Chapter 1: from REAKTOR Blocks to REAKTOR ensemble

    Download from user library (2 mp3-files and riddle_1.ens):
    http://www.native-instruments.com/en/reaktor-community/reaktor-user-library/entry/show/9205/

    I start with a simple (monophonic) REAKTOR Blocks ensemble and your task is to build a 5-voices-polyphonic ensemble using only primary. Next riddles will be mainly in core because it’s the future of REAKTOR!
    Load riddle_1.ens
    riddle_1-1.png

    Although it is very basic, translating into primary isn’t trivial.
    From riddle_1-1.mp3 you hear a basic pulse oscillator which changes the pitch two halftone up periodically.

    Riddle 1: Build an equivalent 5-voices-polyphonic ensemble using only primary!

    listen to riddle_1-2.mp3
    So to help you: have a look into primary library, search and choose following macros:
    MIDI NotePitch and Midi Gate, LFO, ADSR, Pulse
    riddle_1-2.png

    You have to build two macros (basic mathematics) by yourself (pitch modulation of oscillator and amplifier)
    Some more hints:
    • the pulse LFO is unipolar means its range is two halfnotes up [0;2]. In REAKTOR Blocks the modulation is very small (in primary it is easier)
    • Oscilltors A-input should be always 1
    • If you have problems with building, then start with the amplifier macro to get some sound ;)
    • LFO: frequency range [0,10], amplitude range [0,12]
    • ENV: attack/decay/release range [0,80], sustain range [0,1]
    Your solution should look similar to this:
    riddle_1-3.png

    so have fun!
    ciao herw
     
    Last edited: Jan 21, 2016
    • Like Like x 1
  3. arachnaut

    arachnaut NI Product Owner

    Messages:
    4,662
    Good idea, herw!
     
  4. herw

    herw NI Product Owner

    Messages:
    5,810
    [riddle 1] (solution)
    Here it is:
    http://www.native-instruments.com/en/reaktor-community/reaktor-user-library/entry/show/9205/
    When opening the ensemble's structure you see that it is very similar to REAKTOR Blocks:
    riddle_1-4.png
    We see the pulse oscillator with amplitude 1, two macros with LFO and ADSR inside and two macros for pitch modulation and amplifying.
    Perhaps you should a little bit play with the ensemble. It sounds similar to the REAKTOR Blocks ensemble but it is polyphonic!
    • frequency of LFO from 0Hz to 10Hz (frequency set the changes per second)
    • amplitude of LFO: changes the range of the modulation up to 12 means one octave, means the LFO jumps from 0 to amplitude and back
    • change parameter attack, decay, release and sustain and shorten or lengthen the envelope.
    I think it's trivial for you because you have used REAKTOR Blocks.
    [riddle 1] Hints (part 1)
    Some basics: you see that i have changed the background color to gray. You can change it in the properties of the instrument:
    riddle_1-5.png
    There are some other parameters in color scheme, i will talk about it later.
    Have a look to the macro LFO: it has a boundary (solid). Click on it:
    riddle_1-6.png
    You can change the style of the frame; just do it!
    back to instrument's properties: if you click on function you get other properties:
    riddle_1-7.png
    You can change here the number of voices and unison.
    Before you change something have a look to the cpu-usage: although the new polyphonic has 5 voices the cpu-usage is only 1.3% where Blocks needs 4.3%. Astonishing: this shows the power of an instrument instead of using blocks!
    riddle_1-8.png
    Increase the number of voices; on my mac i have with 70 voices only 4.2% - very cool.
    But the Blocks are more intensive programmed; more possibilities, modulating by audio signals etc; so this comparison is not really fair but one reason why REAKTOR Blocks are only monophonic.
     
    Last edited: Dec 10, 2015
    • Like Like x 1
  5. herw

    herw NI Product Owner

    Messages:
    5,810
    [riddle 1] Hints (part 2)
    still basics: ok change the voice number back to 5 and LFO's frequncy to 0. Now set the Max Voices of unison to 5 and jpush only one key. You hear the difference?
    riddle_1-9.png
    REAKTOR uses now 5 voices which are a little bit different in pitch. So you get a full sound. If you hit 5 keys there is no unison. If you set Min Voices to two (or more) REAKTOR uses two voices minimum for one note but you can only hit 2 or 3 keys.
    So if you want unison when hitting 5 keys, you have to set instrument voices to 25 and unison max and min to 5.

    You can change the spread if you want.

    Now open the structure again and the macro ENV (envelope). Inside there is the module ADSR-ENV. Activate visible and you see a nice display of an ADSR-envelope.
    riddle_1-10.png
    You can change the display size (width and heights) as you like. Change the parameters attack, decay, sustain and release.
    In instrument's properties/view you can change display's colors:
    riddle_1-11.png
    very ugly:
    riddle_1-12.png

    ciao herw
     
    Last edited: Dec 10, 2015
    • Like Like x 1
  6. Dexai

    Dexai Member

    Messages:
    61
    Very Good.
    Thanks!
     
  7. herw

    herw NI Product Owner

    Messages:
    5,810
    [riddle 1] Hints (part 3)
    there is one more basic thing:
    riddle_1-13.png
    As the instrument is polyphonic (5 voices) but the ensemble has monophonic outputs you have to use audio-voice-combiners which add all voices to one voice.


     
    Last edited: Dec 10, 2015
  8. fusionid

    fusionid Active Member

    Messages:
    179
    herw,

    thank you so much for your awesome willigness to help and your ensembles.

    thank you!
     
  9. herw

    herw NI Product Owner

    Messages:
    5,810
    [riddle 1] the structure
    first we have a look inside the amplifier:
    riddle_1-14.png
    it's only a multiplier, nothing more, very simple.

    second the pitch modulation.
    pitch means scaling with halftones: 12 halftones are one octave.
    riddle_1-15.png
    On the right side we see an adder.
    As the LFO is a pulse LFO it is very simple to change the range from [-a,+a] (a=amplitude) to [0,+a]. Adding |x| (or abs(x)) changes positive values to double value and negative values to 0. So you have a range [0,2a]. Now multiplying with 0.5 changes it to [0,a].
    Change the waveform of the LFO to see another effect:
    riddle_1-16.png
    If you choose a very low frequency (f.i. 0.3Hz) and triangle waveform the modulation is not as wished - why?
     
    Last edited: Dec 10, 2015
    • Like Like x 1
  10. herw

    herw NI Product Owner

    Messages:
    5,810
    The LFO oscillates between -1 and +1:
    riddle_1-17.png
    Now using the pitch modulation for triangle means that for positive part you get triangle with double amplitude. Then multiplying with 0.5 works fine. But for negative values you add |x| which results 0.
    So the output wave isn't an unipolar triangle:
    riddle_1-18.png


    There is a zero part. So we have to change the pitch modulation (better bipolar → unipolar-macro):

    riddle_1-19.png
    We have to transfer the amplitude of the LFO to the pitch modulation macro. Now we change the range from [-1,+1] to [0,2]. Multiply with 0.5 and it is perfect:
    riddle_1-20.png
    You can use this modulation from bipolar to unipolar for other waveforms too (f.i. sinus, pulse, saw etc.).

    Perhaps you wonder where i get these nice diagrams? I am using GeoGebra which is freeware (no spams) and runs on OSX, windows and Linux. Here is the link: https://www.geogebra.org/download

    I'll add the GeoGebra-file (suffix .ggb) with these nice functions to next upload.

     
    Last edited: Nov 20, 2015
  11. herw

    herw NI Product Owner

    Messages:
    5,810
    [riddle 1] experiments
    Now we will do some experiments (it is important while learning to play with the structure to get some ideas).

    synchronisation of the LFO

    riddle_1-21.png
    What does it mean? When hitting a key (gate On) the LFO restarts from 0 means our unipolar wave starts from 0.5:
    riddle_1-22.png
    As our ensemble is polyphonic it restarts for every voice at another time (synchronisation (change from nonpositve to positve) from gate event). If there is no synchronisation the LFO runs and runs and runs... not depending on any event from outside. This is an important form of musical expression.
    You can hear the difference well when using pulse waveform and a low frequency (0.3Hz); hit several keys one after the other and hold. Using synchronisation is important when a normal oscillator is used as modulator. The sound will be (nice) harsh. We will come back to it in a future riddle.
    I think you wonder about the two order-modules. It's one of the mysterious things of REAKTOR's initialization. I think we will discuss it later. Now use it as black box. Important is to use the second output of the order modules.
    ciao herw
     
    Last edited: Dec 10, 2015
  12. herw

    herw NI Product Owner

    Messages:
    5,810
    studio effects

    This first ensemble is verrrryyyy simple, so i think you have the wish to get more than a dry sound. You can add f.i. monophonic studio effects:
    riddle_1-23.png


    Open the library and insert the instruments Chorus and FbK Delay. Inside of the instruments you see the macro f.i. Chorus which you can copy and insert into your structure. Delete the instrument Chorus. You have to add them after the audio voice combiner because those are monophonic effects; similar for FbK Delay.
    riddle_1-24.png
    Have fun!
     
    Last edited: Nov 20, 2015
  13. Aaron McPherson

    Aaron McPherson Member

    Messages:
    82
    Herwig,
    I've gone through and made the changes you suggest, but I'm still a little unclear why the solution I originally came up with (attached) isn't right. It seems to me to do what the challenge called for, but in a simpler fashion. I understand that the pitch modulation is not unipolar, but I don't understand why you have a separate macro for the amplifier. This initially threw me off for a while, because I was trying to incorporate an amp/mixer module in the structure, and could not get the envelope to connect to the level port. Then I came up with the idea of modulating the amplitude of the oscillator directly. Is there a reason why it is better to multiply the output of the oscillator with the output of the envelope? Why create a macro to contain such a simple structure?
     

    Attached Files:

    • Like Like x 1
  14. herw

    herw NI Product Owner

    Messages:
    5,810
    no - the only reason is, that i want to get a similar structure like the first Blocks-ensemble (riddle 1). I am often using macros to get a better overview. In this case the amplifier macro is really a multiplier inside; the sense of the given macro was to think about how simple it is. It's my style of programming, modular programming and we will use this idea in next riddles. It is fine when you get your own style :)
    Same for modulating oscillator's amplitude not directly via the amplitude-input of the oscillator. It is thinking like moog-modular. I don't like to use this input. I don't mention your solution because i like to get discussion here ;) .
    Your solution is fine too :)
    Have fun to discover other solutions. That's the idea of this workshop.
    ciao herw
     
    Last edited: Nov 21, 2015
  15. herw

    herw NI Product Owner

    Messages:
    5,810
    Last edited: Nov 21, 2015
  16. herw

    herw NI Product Owner

    Messages:
    5,810
    Riddle 2

    Now the same riddle in core!

    Riddle: Build an equivalent 5-voices-polyphonic ensemble using only one corecell and primary only for panel elements!

    still basic? YES still basic! Don't worry about core; i will help you.
    On the next picture you see what you need in primary; i think it's now no problem for you:
    riddle_2-1.png

    The corecell has only event inputs and one audio output (have a look into the properties).
    You have to find all modules in the core library; not simple, but so you learn something about its content.
    riddle_2-2.png


    You see again the two core macros unipolar and amplifier which you have to build by yourself.
    The core macros multiwave LFO, pulse and ADSR seem to be a little bit more complex, but use them like the primary pendants.
    There are some silly inputs (bundles): CR, SR and G. Don't worry about them now, the only thing we need is the Gate from Prim which is hard to find:
    riddle_2-3.png

    The ADSR-inputs attack, decay and release needs time-values so we have to convert those from logarithmic scale to linear sec-scale. There are converters logT2sec you can use. When inserting have a look to the hints. We will discuss it later. For now use those as black boxes.

    Also you have to transform the pitch-values to frequency-values by P2F macro.

    ciao herw
     
    Last edited: Dec 10, 2015
    • Like Like x 2
  17. herw

    herw NI Product Owner

    Messages:
    5,810
    hope to see some user-solutions (screenshots) here :)
     
    Last edited: Nov 23, 2015
  18. Aaron McPherson

    Aaron McPherson Member

    Messages:
    82
    OK, here's my solution. I followed the primary structure built in the first riddle closely. The amplitude seems to have a wider range in this version, but I can generate a semi-tone pitch modulation. First, the core cell:
    R2 AFM Solution v1 Core Cell.PNG


    Next, the unipolar macro:
    R2 AFM Solution v1 unipolar.PNG

    Finally, the amplifier:
    R2 AFM Solution v1 amplifier.PNG
    I'm sure it could be improved, but I'm interested in getting feedback at this point. The ensemble is attached.
     

    Attached Files:

  19. herw

    herw NI Product Owner

    Messages:
    5,810
    [riddle 2] discussion (part 1)
    user's solution R2 AFM Solution v1 download from post #18 .
    first: the solution works as wished and all modules are found.

    Nevertheless there are some some interesting parts we can discuss:
    Have a look to the main structure:
    riddle_2-4.png
    I have added cpu-usage of 6.9%. You can optimize the cpu-usage by changing all inputs to event-inputs. For now nearly all input are audio inputs which means that they are triggered by audio-rate (here 48000Hz). This is not necessary because the values change only when changing midi or knobs. So have a look into the properties of the inputs and change to event (yellow point):
    riddle_2-5.png
    This will reduce the cpu-usage to 2.4%!
    riddle_2-6.png
     
    Last edited: Dec 10, 2015
  20. herw

    herw NI Product Owner

    Messages:
    5,810
    [riddle 2] discussion (part 2)
    user's solution R2 AFM Solution v1 download from post #18 .

    the macro unipolar:
    riddle_2-7.png
    it's nearly the translation of the primary-macro to core-macro; as the core LFO doesn't have an amplitude-input so it is right to change the amplitude after LFO's output by a multiplier.
    riddle_1-15.png
    As discussed in post #10 this works only for pulse-LFO, so it is better for other waveforms to use another macro:
    riddle_2-8.png
    Now you can use other LFO waveforms too.

    Instead of multiplying with 0.5 you can use a divider 2 but in complex ensembles with high cpu-usage you should use a multiplier.
    Interesting is that you cannot change the macro-inputs from event to audio and vice versa. Core doesn't „know” the difference (from primary). So only the corecell's interface has to „translate” from into core-events or from core to primary events.
    Try out other LFO-waveforms and set low and high frequencies.
     
    Last edited: Dec 10, 2015
    • Like Like x 1