Orinj version 7.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||July 3, 2022||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/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 com.recordingblogs.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.
javac "ExampleDelay\src\com\recordingblogs\exampledelay\Delay.java" -d "ExampleDelay\class" -classpath "ExampleDelay\class;orinj\oreffect.jar"
javac "ExampleDelay\src\com\recordingblogs\exampledelay\DelayPanel.java" -d "ExampleDelay\class" -classpath "ExampleDelay\class;orinj\oreffect.jar"
copy ExampleDelay\src\effect.xml ExampleDelay\class\effect.xml
jar cf "ExampleDelay\exampledelay.jar" -C "ExampleDelay\class" .
The first 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 third 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
Add new comment