How to build a plugin for Zynthian

Hi all I built this chorus plugin using JUCE

It has no “parameters” . I believe the current zynthian software does not handle “parameters” very well so I nuked them. No sliders its just the best chorus plugin you ever heard with no dry signal intended to be used as a send.
How would I build this and run it on Zynthian ?
Is there a guide ?
Can this be done without anyone’s “help”. Would love to be able to build stuff and target the box myself which was the point of it for me .
Let me know if there is a guide somewhere .
Best Sean

1 Like

Perhaps this will guide you:
https://wiki.zynthian.org/index.php/Adding_LV2_plugins
particularly section 2 Installing a plugin from its source code using the CLI (Command Line Interface)

If not, Google AI produced this guide from your topic title:

To build a plugin for Zynthian, you’ll need to understand the Zynthian architecture, primarily its use of the LV2 (Linux Audio Plugin) standard, and then write code that interacts with the Zynthian framework to provide your desired functionality, whether it’s a new sound generator, effect, MIDI controller integration, or a custom user interface element.
Key Steps:

  1. Understand the Basics:

• LV2 Plugins: Zynthian primarily uses LV2 plugins for audio processing. You’ll need to familiarize yourself with the LV2 specifications and how to develop plugins that adhere to this standard.
• Zynthian API: Zynthian provides a set of APIs that allow your plugin to interact with the system, including accessing audio streams, MIDI data, and controlling the user interface.
• Development Environment: You’ll need a suitable development environment with a C++ compiler and the necessary libraries to build LV2 plugins, which are typically done on a Linux system.

  1. Project Setup:

• Create a Plugin Folder: In the Zynthian plugin directory, create a new folder for your plugin project.
• Basic Structure: Inside the folder, create the necessary files:
• manifest.ttl: This file describes your plugin metadata (name, author, description, etc.) using the LV2 Turtle language.
• plugin.cpp: The main source code file containing your plugin’s logic.
• plugin.h: Header file for function declarations.

  1. Code Development:

• Plugin Class: Create a class that inherits from the LV2 standard plugin base class.
• Audio Processing: Implement the core audio processing logic within the run function of your plugin class. This is where you’ll handle audio input, apply your desired effects or sound generation, and output the processed audio.
• Control Ports: If your plugin needs user-adjustable parameters, define control ports in your manifest.ttl and implement the logic to read and respond to control changes within your plugin code.

  1. UI Integration (Optional):

• Custom Widgets: If you want a custom user interface for your plugin, you can create custom widgets using Zynthian’s UI framework and link them to your plugin’s control ports.
• WebConf Integration: You can also integrate your plugin settings into the Zynthian WebConf interface for easy access.

  1. Building and Deployment:

• Compile: Use a build system (like CMake) to compile your plugin code into a shared library that can be loaded by Zynthian.
• Placement: Place the compiled plugin library in the appropriate Zynthian plugin directory.
• Restart Zynthian: After placing your plugin, restart the Zynthian system to load the new plugin.

Important Considerations:

• Documentation: Refer to the Zynthian documentation and community forums for detailed information about the API and development guidelines.
• Testing: Thoroughly test your plugin with different audio scenarios to ensure it functions as expected.
• Community Contribution: If you develop a useful plugin, consider sharing it with the Zynthian community to benefit other users.

Generative AI is experimental.

Vangelis (testing) branch of zynthian now supports parameter controls in LV2 plugins. This should expose those lovely JUCE-based plugin parameters.

3 Likes

oh that’s very cool @riban

Thanks are you a human or a bot ??
Have you done this ?
Does it matter what linux version you build the LV2 plugin on ?
I would think using make and a C++ compiler on the Zynthian itself would be the most sensible route here no ?

Build the plugin on zynthian. This is the simplest way to ensure it works properly. It is important that the build is done on 64-bit arm, otherwise it won’t run on zynthian. You need to enable LV2 support and ideally disable all other plugin options to reduce build time and chance of failure due to unmet dependencies. I dowloaded the source but there are no build instructions and I didn’t have time to investigate further.

Only @tunagenes can tell us whether he is a bot… and would we believe him?

thanks I will give it a go !

Yes I am.

Yes, several times.

3 Likes

Thanks. Is there a version of JUCE that works with the latest zynthian OS ? I wonder if a makefile and a juce distro including all the juce modules can maintained somewhere. Perhaps the different plugin types requires too much work to maintain something.

The current stable version of juce works with zynthian. I have compiled many plugins that have juce as a git submodule so that checking out recursively provides juce. Have a look at other juce based plugins.

1 Like

I built a new repo with all the JUCE sources in it .

I don’t have my Zynthian with me.
I have been trying to build it on an UBUNTU VM on my mackbook pro .
I installed these dependencies first

Still stuck getting it to build using UBUNTU .
Folks suggesting CMAKE lists .
I have a bit more experience with make I used it for a couple of years in a coding job.

1 Like

yepeeeh,

that dispenses me from trying to implement a DPF version of open303 for zynthian - what I actually just started… I should have read the forum news first.

Kudos to (??) @riban, @jofemodo (??)

Regards

I spent a bit of time over on the JUCE forum
I have created a CMAKE build script in the readme

It works on my Ubuntu virtual machine.
When I get back to my Zynthian after travelling I can give it a try.

1 Like