Skip to content

Overview

Effects are layer extensions for Audectra, which can be added to project states via the layers tab. They can be combined with each other through various opacity and blending settings to create stunning visualizations. Some effects expose their own settings, which can be used to further customize them or to bind some of their properties to music features.

Effect Path

All effect extensions are generally stored in the following directory.

    %ProgramData%\Audectra\Extensions\Effects\

which usually gets translated to

    C:\ProgramData\Audectra\Extensions\Effects\

Audectra recursively searches the above path for effects (*.cs source files), which then get compiled and analyzed. On success, they will be available for your Audectra projects. Check the status of your effect extensions in the Extension Settings.

Info

Compiled effect extensions are saved as assembly files (*.dll) right beside their corresponding source files (*.cs), such that Audectra merely needs to check and (re-)compile new or changed source files at startup.

Basic Effect

If you want to create your own effect extension, then the Audectra/v0/SimpleColor.cs effect might be the best starting point.

using System;

using SkiaSharp;
using Audectra.Extensions.Sdk.V1;

/* Your effects need to be in this namesapce. */
namespace Audectra.Extensions.Effects
{
    [EffectExtension("Simple Color", "Audectra", "1.3.0")]
    class SimpleColor : EffectExtensionBase
    {
        private IEffectApi _api;
        private SKColor _color;
        private IRender _render;

        /*  Enumeration for each value you want to be configurable in the layer settings. */
        private enum SettingId
        {
            /*  ValueId for the configurable color. */
            ColorValue = 0,
        }

        /*  This constructor will be called when a layer of your effect is being created. */
        public SimpleColor(IEffectApi effectApi, int width, int height) : base(width, height)
        {
            /*  Save the effect api in your class, you will need it. */
            _api = effectApi;

            /*  Set the default color. */
            _color = new SKColor(0, 128, 128);

            /*  Create a render for your effect using the effect api. */
            _render = _api.CreateRender();
        }

        /*  In this method you will be able to render your effect. It will be called for 
            each frame of your project, assuming this layer is enabled. */
        public override IRender Render(float dt)
        {
            /*  Map every pixel in the render to the configured color */
            using (var canvas = _render.CreateCanvas())
                canvas.Clear(_color);

            return _render;
        }

        /*  To allow the user to configure your effect to their likings, you will need 
            to specify what exactly is configureable. In this method you will specify
            what controls you request from Audectra for the layer settings side panel
            of your effect. This method generally only gets called once per layer. */
        public override void GenerateSettings(ISettingsBuilder settingsBuilder)
        {
            settingsBuilder.PageBegin();

            /*  Add a color group to the layer settings of this effect, such that
                the user is able to choose or bind a color. */
            settingsBuilder.AddColorGroup(_color, (uint) SettingId.ColorValue);

            settingsBuilder.PageEnd();
        }

        /*  Every time a configuration option you've secified above has changed, either
            due user interaction in the layer settings or due a feature binding, this 
            method will be called, to inform you on which of your values has changed. */
        public override void OnSettingChanged(uint settingId, SettingValue value)
        {
            /*  The color value has been changed either by the user or a binding. Use the 
                effect api to convert the value to a color. */
            if ((SettingId)settingId == SettingId.ColorValue)
                _color = value;
        }
    }
}

Layer Settings

This feature allows effect designers to create settings for their effects, allowing end-users to further customize effects or bind specific setting values to music features.

Read More

Layer Requirements

This is a very powerful feature, which allows effect designers to specify the requirements for their effects, under which they perform the best.

Read More

Particle System

Utilize this powerful and flexible particle system in your effects to create stunning dynamic visualizations.

Read More

Extension SDK

If you need more information about the bridge between Audectra and your effects, the extension SDK, take a look at the SDK documentation.

Read More

SkiaSharp

You can utilize SkiaSharp, which is a very powerful 2D rendering environment, in your effects.

Read more:

Questions?

If you have further questions, feel free to ask them in the forums.