Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
284 views

Reaktor As Programming Language

The document discusses using the programming environment Reaktor as a programming language. It describes how Reaktor can represent basic programming concepts like data types, variables, constants, operators, inputs and outputs. It then shows how common programming control structures like conditional statements and loops can be implemented in Reaktor using modules and event routing. Specific examples are given to demonstrate an if/else statement and a for loop. Readers are encouraged to experiment further with implementing other programming concepts in Reaktor.

Uploaded by

slavk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
284 views

Reaktor As Programming Language

The document discusses using the programming environment Reaktor as a programming language. It describes how Reaktor can represent basic programming concepts like data types, variables, constants, operators, inputs and outputs. It then shows how common programming control structures like conditional statements and loops can be implemented in Reaktor using modules and event routing. Specific examples are given to demonstrate an if/else statement and a for loop. Readers are encouraged to experiment further with implementing other programming concepts in Reaktor.

Uploaded by

slavk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Reaktor For You Community - Reaktor as programming language 8/2/09 3:56 PM

reaktorforyou
Reaktor For You Community
Native Instruments Reaktor Community

Reaktor as programming language


reaktorforyou May 15th, 20:40

If you've ever faced with any programming language in your life, you would be really surprised, how easy can
Reaktor be turned into any programming language as well. However its core engine is based on C++, Reaktor
can be used to represent other languages as well. But for those who are familiar with C++ know, that it is
father of many languages.

We're going to implement some basic algorithms inside Reaktor. This is not a tutorial, but it is really interesting
way to look at Reaktor from another side. This will be helpful for people, who are new to Reaktor as well,
because I'm going to describe each module I'll use in details.

Basics of Reaktor as programming language

Structure. Reaktor as C++ has its own structure as well - however, instead of codes you're using modules and
wires.

Data types and variables. Unfortunately, Reaktor is limited with two data types - 32-bits signed integers (-
2,147,483,648 to 2,147,483,647) and float numbers. It doesn't have strings and chars types, however you can
theoretically tell Reaktor has boolean type of data, but it uses numbers to represent if it is true or
false. Reaktor core level supports arrays as well.

Constants and operators. This can be considered all math modules, used either on primary level, or on core.

Inputs and outputs. Numeric Readouts and other panel elements are considered to be outputs for operations
with different data types. But Reaktor doesn't support straight input elements, like text box, however it has
different modules, like Knob, Button, List and so on, which can be treated as input.

Control structures of Reaktor

Let's build some control structures in Reaktor.

1) Conditional structure: If and Else. It is one of easiest to implement in Reaktor. I would suggest to use core
cells to implement this one. For example, we have following conditional structure:

if (x > 0)
cout << "x is positive";
else if (x < 0)
cout << "x is negative";
else
http://reaktorforyou.livejournal.com/6801.html Page 1 of 3
Reaktor For You Community - Reaktor as programming language 8/2/09 3:56 PM

else
cout << "x is 0";

As many of you know "cout" is output function, that outputs some statement. Let's try to implement it
in Reaktor. This will look like this:

Where x input is going to be Knob with positive, negative and 0 values, and output will be Multi Text with 1
output text "x is positive", 2 output text "x is negative", 3 output text "x is 0".

Few comments on this one. When using event, you have to use Latch for lower input of Router module,
because otherwise you will get nothing, because there won't be any event with no value on output. Connection
to output through Merge module should be very precise - be careful with this one, because there can be
several events arriving at the same time and it means lower will go through.

2) Iteration structure (loop): For statement. Let's try to implement following structure:

for (int n=10; n>0; n--)


cout << n << ", ";

This can be done using following structure in Reaktor:

(http://pics.livejournal.com/reaktorforyou/pic/0001c2cc/)

This structure will send 10 events with values from 10 to 0. But you will be able to see it only with Event
Watcher or with several Numeric Readouts connected to Distribution module for example, because speed of
Iteration module is very fast and is beyond Control Rate. However, you're able to set its speed in properties. If
you set it very low, you can see all values then. Separator here is needed for Button that will start For loop - it
has off value of -1 and on value of 0, because we want Iteration module to start from 0 and go up with step of
1 to 10. Subtract module after Iteration's output is used to get values down to 0 from 10, while from Iteration it
goes vise versa.

Hope it will help you a little to understand connection between programming languages and Reaktor. If you're
interested in this one, I can continue exploring different aspects of this topic.

I'm looking forward to your questions and comments!

(Anonymous) Nice one, i like it :D

Bert

Iteration Speed (Anonymous) Alex, sorry about the double posts, i type the anti-spam code wrong so i re-post
it again, turns out that the first is already posted..
http://reaktorforyou.livejournal.com/6801.html Page 2 of 3
Reaktor For You Community - Reaktor as programming language 8/2/09 3:56 PM

it again, turns out that the first is already posted..

Anyway, the iteration speed can be reduced by checking "limited speed" on its properties and lower the "iterations
per seconds", so you can easily see the results on the numeric display.

Bert
: reaktorforyou: Bert, thanks for your comments! I deleted your second post. I'm going to correct that in article.
(Anonymous) Nice tutorial! This describes a week of thinking when a load of Reaktor event processing ideas suddenly
made sense to me... it was actually the most exciting week I had with Reaktor, thinking "Ah, this is genuinely and
deeply different to a modular synthesiser..."

Good work.
: reaktorforyou: Thanks for your comments! Yeah, I'm thinking about writing some more tutorials on this
topic.

ADVERTISEMENT Customise

http://reaktorforyou.livejournal.com/6801.html Page 3 of 3

You might also like