2 releases

0.1.1 Aug 21, 2024
0.1.0 Aug 17, 2024

#914 in Audio


Used in shizen

MIT/Apache

15KB
271 lines

SHIZEN [WIP, unreleased, experimental]

Shizen is a project that aims to create a simple and easy way to create VST plugins. The goal is to make it easy to create VST plugins without having to navigate through the complexities

Comparison

Here is a simple example of how to create a VST that swaps the left and right channels of a stereo audio using SHIZEN, with a comparison to JUCE

JUCE Implementation

class SwapPlugin : public AudioProcessor {
public:
    SwapPlugin() : AudioProcessor() {}

    void processBlock(
        AudioBuffer<float>& buffer,
        MidiBuffer& midiMessages
    ) override {
        const int numChannels = buffer.getNumChannels();
        const int numSamples = buffer.getNumSamples();

        // Only swap channels if we have two channels (stereo)
        if (numChannels != 2) return;

        for (int i = 0; i < numSamples; i++) {
            const float leftSample = buffer.getSample(0, sample);
            const float rightSample = buffer.getSample(1, sample);

            buffer.setSample(0, sample, rightSample);
            buffer.setSample(1, sample, leftSample);
        }
    }
};

SHIZEN Implementation

#[shizen::plugin]
pub fn SwapPlugin(audio_buffer: StereoBuffer) -> StereoBuffer {
    audio_buffer.iter().map(|[l, r]| [r, l]).collect()
}

The beauty in the SHIZEN implementation is that we inject the stereo buffer directly into the function, without having to worry about handling the number of channels or the length of the buffer. SHIZEN makes it so that you can apply this swap effect to only stereo audio

Contributing

If you're interested in contributing to this project, feel free to reach out to me. I'm always looking for help and feedback

Currently, the project is in a very early stage, so there's a lot of work to be done. If you're interested in helping out, here are some things that need to be done:

  • Interop with VST3 SDK
  • ...

What is This?

This project stemmed from my friend JUKE YOU giving me the idea of a VST plugin that would achieve a certain effect that is otherwise a hassle to create manually. I thought it was a great idea and decided to make it a reality

Unfortunately, the industry standard for making VSTs, JUCE, is in C++ (the devil's tongue). So, I decided to make my own framework that would make it easier to create VSTs. Obviously, nothing against JUCE, most of what I'm doing is inspired by their work and choices. I just wanted to make something that was more in line with my preferences

Dependencies

~2–2.9MB
~60K SLoC