Orinj version 3.0.0
Note: This page is not for the users of Orinj, but for developers who want to create digital signal processing effects for Orinj.
|Exampledelay.zip||June 22, 2016||The source code for Example Delay (10 KB).|
This code was developed using the Orinj effect framework. If this code is compiled and placed in a Java JAR file, the resulting JAR file can be copied into the Orinj/orange/effects folder. Upon startup, Orinj will recognize this JAR file and the effect in it (the Example Delay). Orinj will then create a menu item in its menu for the effect and will thus allow users to add the effect to their tracks.
Introduction to the Example Delay
Example Delay is a simple delay effect. It produces one repetition of the signal with some delay and some decay. It does not distinguish between left and right channels, does not implement multiple repetitions, and does not allow delay or decay sweeps.
The code for the Example Delay contains three files:
- Delay.java – this is the implementation of the delay. Most interestingly, this class contains the function apply(), which takes incoming audio buffers with the original signal and computes the outgoing audio buffers with the delayed and decayed signal.
- DelayPanel.java – this is the graphical user interface for the delay. It contains the controls that the user can modify to change the delay effect.
- effect.xml – this XML file describes the effect to Orinj, so that Orinj can actually create and use the effect.
These are the files required for creating effects in Orinj. An effect package (a JAR file) may contain other files as well.
Choice of package name
Both Java classes above are placed in the package recordingblogs.com.ExampleDelay. Using a URL for the package name is a good idea, as it helps in making sure that effect names are not duplicated (e.g., two designers could create two effects with the same name). Avoiding the same names for different effects is especially important for Orinj presets, which are saved with the package name as a prefix.
Compiling Example Delay
The commands to compile this source code are as follows.
path "c:\Program Files\Java\jdk1.7.0_79\bin\"
javac "ExampleDelay\src\recordingblogs\com\ExampleDelay\Delay.java" -d "ExampleDelay\class" -classpath "ExampleDelay\class;Orange\oreffect.jar"
javac "ExampleDelay\src\recordingblogs\com\ExampleDelay\DelayPanel.java" -d "ExampleDelay\class" -classpath "ExampleDelay\class;Orange\oreffect.jar"
copy ExampleDelay\src\effect.xml ExampleDelay\class\effect.xml
jar cf "ExampleDelay\exampledelay.jar" -C "ExampleDelay\class" .
The first line specifies the path to the Java JRE. The next two lines compile the Java source code. Note that this source code uses oreffect.jar, which defines the interfaces that the classes have to implement. The fourth line from the top copies the file effect.xml at the appropriate place. The last line prepares the effect package JAR file.
Orinj Effect framework