You can compare Tables in REAKTOR to computer memory where a program can store and read its data from. Like in any programming language, the order of accessing the data is substantial for an intended result.
In this short tutorial we will use two Event Table modules to build a copy/paste function. Let's assume that this structure is part of an ensemble which serves for storing gate data for a step sequencer. Therefore we use the following Event Table settings in the module properties:
- Value range: 0-1 (according to the standard Gate value range in REAKTOR).
- Table X Size: 16 (for 16 steps in a step sequencer)
- Table Y Size: 64 (for 64 possible patterns)
- After having entered the values for the Event Table settings, make a copy of the module and name it "Copy Buffer". For the copied Event Table we change the Table Y Size to 1, since we only need to store one Pattern per copy operation.
- Insert a Button module and name it "Copy". In its properties set the button to Trigger mode. This means that only the ON Value in the properties is sent when you press this button and release it (meaning that the mouse release will not generate any event).
- Since Event Tables are 0-based, the first value for the read and write position must be 0. Therefore the "Copy" button is connected to a Value module. It would also be possible to let the "Copy" button send 0 directly when it is triggered, but usually you would also trigger other elements within the ensemble at the same time, so we decided to connect it to a Value module instead.
- Insert an Iteration module. This module works similar to a "for" loop in many programming languages. In this case it will add 1 with every loop in order to count up the reading position for the RX input of the Gate table. This is done by connecting a constant with the value 1 at the Inc input of the Iteration module . The N input determines how many times the loop is passed.
- Connect the output of the Iteration module to an Order module. This will define the order in which the inputs of the first Event Table module are triggered for copying the data to the second Event Table.
- Now connect the inserted modules and add required Constant modules as shown in the following screenshot:
Note: The Lamp on the right side is set to Always Active in its properties and serves for activating the whole structure only.
If you now clean up the panel, draw some values into your Gate table (make sure that you are in Draw mode which can be selected with a right click on the table image on the panel) and press the Copy button, you will see how the data is copied to the Copy Buffer table.
- Copy and paste the whole left part of the structure (except for the two Event Tables and the Lamp) and change the name of the pasted "Copy" button to "Paste".
- Connect the inserted modules to the tables in a similar way as above, but this time the data is copied from the Copy Buffer table to the Gate table via the "Paste" button.
- Finally we need a Pattern Knob in order to select the desired pattern for the copy and paste operations. Since we have defined 64 possible patterns at the beginning of this tutorial, the Value range of the Knob is 1-64 and its Stepsize 1. Connect the Pattern Knob to the RY, WY and YO inputs of the Gate Event Table.
The final structure should now look like this:
After some clean up and hiding the Copy Buffer Event Table, the finalized panel should look similar to this:
This Copy/Paste ensemble can be downloaded below.
Important Note: If you copy and paste a lot of data at the same time or use the Iteration module a lot with higher numbers at the N input, you might experience CPU spikes which can lead to dropouts and other problems in REAKTOR or your host program. These CPU spikes are usually displayed by a red horizontal line above the REAKTOR CPU display. In such cases you can try to enable the Limited speed option in the properties of the Iteration module and define there how many Iterations per second are generated.