Color Organ for Vixen 2.x

MartinMueller2003

Supporting Member
Hi All

I have created a Color Organ add-in for Vixen 2.x. Yes I know Vixen 3 is here but I am still using vixen 2.5 and did not want to risk using 3.x until it was more stable. This add-in is using the core functionality found in the Spectrum.dll created by the Vixen team. All source code can be found in ColorOrganSource.zip

Color Organ for Vixen 2.x

Introduction

This add-in provides color organ functionality to Vixen 2.x. The add-in is a derivative of the Frequency Analyzer found in the Spectrum dll.

Features:


31 frequencies
No Channel limits
Adjustable trigger limits per Color Organ band
Configurable bindings between output channels and frequencies.

Definitions


Color OrganA device that converts variations in audio levels into variations in light intensity.
Frequency BandA slice of the audio spectrum that is treated as a single entity. The color Organ has broken the audio frequency spectrum into 31 bands (The same bands as those used in the Frequency analyzer plugin).
ChannelA Vixen sequence channel.
Color Organ BandA mapping between a set of frequency bands and a set of Vixen channels.
Audio LevelThe instantaneous energy level of a given frequency band. Audio levels are expressed as a number between 0 (zero) and 1 (one).
Peak LevelThis is the highest audio level detected in all of the sequence time slots for all of the frequency bands assigned to a color organ band.
Average LevelThis is the average audio level detected for all of the sequence time slots in all of the frequency bands assigned to a color organ band.

Installation


Unzip the dll file from the ColorOrgan.zip file attached to this post. Copy it to the vixen AddIns directory.

History

AuthorDateVersionChanges
mmuellerAug-22-20131.0Initial release
mmuellerAug-28-20131.1Fixed delete Color Organ Band after New.

  • Work around for 1.2: Leave color organ add-in and return. then delete.
Added 'Copy' color organ band function.
Added 'Auto Build' Color Organ Band function.
Modified the auto level setting points.

Color Organ Band


A color Organ Band is used to bind a set of audio frequencies to a set of channels and control the levels at which the audio levels are converted into light intensity. Before you can set the light intensities for your sequence, you will need to create one or more color organ bands. Each color organ band has the ability to be bound to one or more frequency bands and one or more Vixen channels.

  • Frequency band selection is free form. A given frequency can be a member of multiple Color Organ Bands. If multiple frequencies are assigned to a color organ band then the highest level of all of the frequencies will be used to calculate the light intensity in each sequence time period.
  • Vixen Channel selection is free form. A given Vixen channel can be a member of multiple Color Organ Bands. If a channel is a member of multiple bands, the highest (brightest) output values from all of the Color Organ Bands will be used as the value for a given time period in a sequence. If there are any existing intensity levels programmed in the sequence then the higher of the color organ / existing value will be used. It is recommended that the vixen sequence channel data be cleared prior to using the color organ.
  • Light intensity is calculated separately for each sequence time period. For each time period the intensity setting will be the highest value as calculated by:
    • Existing sequence value.
    • Examination of all of the frequency bands assigned to the color organ band, using the highest level found:
      • If a frequency band level does not meet a configured minimum level then the frequency contribution will be zero (off).
      • If a frequency band level exceeds a configured level then the frequency contribution will be set to full on (100% intensity).
      • Frequency band levels between the minimum and maximum configured levels will 'pro-rated' between 0% and 100% intensity.
The color organ band definition provides four ways to set the configured minimum and maximum levels used to control light intensity:

  • 'Set Levels' button. This sets the limits to:
    • Minimum = Average level * 0.001
    • Maximum = Average Level + 1/2 the difference between Peak and average levels.
  • Click the Peak Level displayed on the color organ configuration screen.
    • Minimum = Average level * 0.001
    • Maximum = Peak Level * 0.900
  • Click the Average Level displayed on the color organ configuration screen.
  • Minimum = Average level * 0.001
  • Maximum = Average Level
  • Manually enter the values.

How to:


Create a color organ band


  1. Start Vixen Sequence editor.
  2. Click Add-Ins
  3. Select "Color Organ". This will cause the Color Organ plug in to analyze the audio file and read in the previous configuration.
  4. Click "Add New". This will create a new color organ band and will open the color organ band configuration screen.
  5. Set the name you want to give this color organ band.
  6. Select the frequencies that will provide input to the color organ band.
  7. Select the Vixen channels that will receive the output data.
  8. Set the minimum / maximum output level trigger points
  9. Close the window.

Edit a Color Organ Band



  1. Start Vixen Sequence editor.
  2. Click Add-Ins
  3. Select "Color Organ". This will cause the Color Organ plug in to analyze the audio file and read in the previous configuration.
  4. Click "Edit" or double click the name of the color organ band you want to modify. This will open the color organ band configuration screen.
  5. Set the name you want to give this color organ band.
  6. Select the frequencies that will provide input to the color organ band.
  7. Select the Vixen channels that will receive the output data.
  8. Set the minimum / maximum output level trigger points
  9. Close the window.

Delete a Color Organ band



  1. Start Vixen Sequence editor.
  2. Click Add-Ins
  3. Select "Color Organ". This will cause the Color Organ plug in to analyze the audio file and read in the previous configuration.
  4. Single click the color organ band you wish to delete.
  5. Press the delete button

Create / Change the channel data in a sequence



  1. Start Vixen Sequence editor.
  2. Clear the data in the channels that will be written by the color organ.
  3. Click Add-Ins
  4. Select "Color Organ". This will cause the Color Organ plug in to analyze the audio file and read in the previous configuration.
  5. Make changes to the color organ band definitions.
  6. Press the "Set Chans" button. It will look like nothing happened. This operation is extremely fast. NOTE: If you are looking at the sequence data behind the menu, you will not see any changes on your screen.
  7. Exit the color organ add-in. It is at this point that the configuration is saved and the Vixen editor updates the sequence information on your screen.

Copy A Color Organ Band


It is possible to use an existing color organ band as a starting point for a new band.

  1. Open Color Organ
  2. Single click / Highlight an existing Band
  3. Click the 'Copy' button
  4. Edit band window will pop up with the newly created band.

Auto Create a set of Color Organ Bands


It is possible to automatically create a set of color organ bands. The Auto Build button uses the Start Channel and numb bands fields on the Color Organ page to control the creation of Color Organ bands.

  • Start Channel defines the first output channel to be assigned to the newly created band.
  • Number of bands controls the number of the frequency bands assigned to the color organ band. For example selecting to create 5 bands will assign 6 frequencies to each band with one frequency getting 7 frequencies for a total of 31 frequency bands.
  • The output channels will be renamed to "CO: BandName".

  1. Start he Color Organ add in.
  2. Enter the start channel number and the number of desired Color Organ bands
  3. Press Auto Build
  4. Adjust bands as desired
 

Attachments

  • ColorOrgan1.2.ForVixen.2.x.source.zip
    188.2 KB · Views: 83
  • ColorOrgan1.2.ForVixen.2.x.zip
    103.2 KB · Views: 279
Last edited:
Color Organ for Vixen 2.x​

Introduction

This add-in provides color organ functionality to Vixen 2.x. The add-in is a derivative of the Frequency Analyzer found in the Spectrum dll.

Features:

31 frequencies
No Channel limits
Adjustable trigger limits per Color Organ band
Configurable bindings between output channels and frequencies.​

Definitions

Color OrganA device that converts variations in audio levels into variations in light intensity.
Frequency BandA slice of the audio spectrum that is treated as a single entity. The color Organ has broken the audio frequency spectrum into 31 bands (The same bands as those used in the Frequency analyzer plugin).
ChannelA Vixen sequence channel.
Color OrganBand A mapping between a set of frequency bands and a set of Vixen channels.
Audio LevelThe instantaneous energy level of a given frequency band. Audio levels are expressed as a number between 0 (zero) and 1 (one).
Peak LevelThis is the highest audio level detected in all of the sequence time slots for all of the frequency bands assigned to a color organ band.
Average LevelThis is the average audio level detected for all of the sequence time slots in all of the frequency bands assigned to a color organ band.


Installation

Unzip the dll file from the ColorOrgan.zip file attached to this post. Copy the version appropriate for your version of Vixen to the Vixen Add-Ins directory.

Color Organ Band

A color Organ Band is used to bind a set of audio frequencies to a set of channels and control the levels at which the audio levels are converted into light intensity. Before you can set the light intensities for your sequence, you will need to create one or more color organ bands. Each color organ band has the ability to be bound to one or more frequency bands and one or more Vixen channels.


  • Frequency band selection is free form. A given frequency can be a member of multiple Color Organ Bands. If multiple frequencies are assigned to a color organ band then the highest level of all of the frequencies will be used to calculate the light intensity in each sequence time period.
  • Vixen Channel selection is free form. A given Vixen channel can be a member of multiple Color Organ Bands. If a channel is a member of multiple bands, the highest (brightest) output values from all of the Color Organ Bands will be used as the value for a given time period in a sequence. If there are any existing intensity levels programmed in the sequence then the higher of the color organ / existing value will be used. It is recommended that the Vixen sequence channel data be cleared prior to using the color organ.
  • Light intensity is calculated separately for each sequence time period. For each time period the intensity setting will be the highest value as calculated by:

  • Existing sequence value.
  • Examination of all of the frequency bands assigned to the color organ band, using the highest level found:

  • If a frequency band level does not meet a configured minimum level then the frequency contribution will be zero (off).
  • If a frequency band level exceeds a configured level then the frequency contribution will be set to full on (100% intensity).
  • Frequency band levels between the minimum and maximum configured levels will 'pro-rated' between 0% and 100% intensity.

  • The color organ band definition provides four ways to set the configured minimum and maximum levels used to control light intensity:

  • 'Set Levels' button. This sets the limits to:

  • Minimum = Average level * 0.001
  • Maximum = Average Level + 1/2 the difference between Peak and average levels.

  • Click the Peak Level displayed on the color organ configuration screen.

  • o Minimum = Average level * 0.001
  • o Maximum = Peak Level * 0.900

  • Click the Average Level displayed on the color organ configuration screen.

  • o Minimum = Average level * 0.001
  • o Maximum = Average Level

  • Manually enter the values.

How to:

Create a color organ band

  1. Start Vixen Sequence editor.
  2. Click Add-Ins
  3. Select "Color Organ". This will cause the Color Organ plug in to analyze the audio file and read in the previous configuration.
  4. Click "Add New". This will create a new color organ band and will open the color organ band configuration screen.
  5. Set the name you want to give this color organ band.
  6. Select the frequencies that will provide input to the color organ band.
  7. Select the Vixen channels that will receive the output data.
  8. Set the minimum / maximum output level trigger points
  9. Close the window.


Edit a Color Organ Band

  1. Start Vixen Sequence editor.
  2. Click Add-Ins
  3. Select "Color Organ". This will cause the Color Organ plug in to analyze the audio file and read in the previous configuration.
  4. Click "Edit" or double click the name of the color organ band you want to modify. This will open the color organ band configuration screen.
  5. Set the name you want to give this color organ band.
  6. Select the frequencies that will provide input to the color organ band.
  7. Select the Vixen channels that will receive the output data.
  8. Set the minimum / maximum output level trigger points
  9. Close the window.


Delete a Color Organ band

  1. Start Vixen Sequence editor.
  2. Click Add-Ins
  3. Select "Color Organ". This will cause the Color Organ plug in to analyze the audio file and read in the previous configuration.
  4. Single click the color organ band you wish to delete.
  5. Press the delete button


Create / Change the channel data in a sequence

  1. Start Vixen Sequence editor.
  2. Clear the data in the channels that will be written by the color organ.
  3. Click Add-Ins
  4. Select "Color Organ". This will cause the Color Organ plug in to analyze the audio file and read in the previous configuration.
  5. Make changes to the color organ band definitions.
  6. Press the "Set Chans" button. It will look like nothing happened. This operation is extremely fast. NOTE: If you are looking at the sequence data behind the menu, you will not see any changes on your screen.
  7. Exit the color organ add-in. It is at this point that the configuration is saved and the Vixen editor updates the sequence information on your screen.
 
Last edited:
Martin,

Thanks for all the hard work designing something new but could you put what this does in "dummie" terms for us common folk :freak: I am using 2.1 still this year and not sure I understand what this does but might want to try to use it if it would help. Thanks again.
 
Back in the 60's I built a 5 channel color organ. One unresolved issue with that analog version was that you could not know the peak level for each filter in advance for a given song. This caused some channels to hardly turn a light on, even though there was energy content. Now I could envision pre-setting each filter's peak of a given song to represent 100% illumination, and thus overcome my analog version's problem.

I am interested in this development for an automated version that doesn't need hours of manual sequencing. Each song will be pre-processed so that each filter's peak can be identified in a song and then adjusted to give maximum light intensity of the found peak, assuming that it exceeds the pre-determined minimum value per filter.
 
This implmentation provides the avg and peak level for each channel. It also allows you to set the zero and 100% ilumination points so you can taylor the response range. you can also mix and match the contributing frequency buckets. I also had a color organ I used in clubs and incorporated a lot of my wish list in this implementation.

Martin
 
Let me just say this is better than I was originally able to imagine when you first described your Add-in. Just ran through a quick demo of this with a test song and while I first ran through it with groupings of 3 frequencies to 5 channels per bucket(only one exception was 1.0k on it's own), then ran the "set chans" it looked great using your auto "set levels" button. But then I really got in there and set my own levels and it started to take on levels I would have set on my own if I had spent hours on it.

I have two things on my wish list for this incredible plugin:

1. The first is if there was a copy "color bands" button so when your setting up you have all the last selections from your previous bucket list in front of you.

2. The second would be for this to run in vixen 3.

Wow, what a great tool this is and it can make perfect beat track too.
 
Martin,

Thanks for all the hard work designing something new but could you put what this does in "dummie" terms for us common folk :freak: I am using 2.1 still this year and not sure I understand what this does but might want to try to use it if it would help. Thanks again.

This latest version has a DLL for 2.1. This winter I will be moving to 3.x and will create a color organ for that version.

What is a color organ: A color organ takes an audio input signal, splits it into some number of frequency buckets (most had 3 some had 5 buckets) and then varies a lighting output proportional to the audio level in the frequency bucket. This gives you changes in light intensity that are directly correlated to sound intensity.

What does this color organ do? It takes the Vixen sequence audio track, breaks it into 31 buckets, allows you to choose a set of buckets (up to all 31) and vary the intensity of a set of configured (chosen by you) Vixen channels based on the audio level of the chosen buckets. It also lets you set the minimum audio leel before which the channels are turned on and the audio level at which the channels will be set to full on. The audio level and brightness levels are calculated for each Vixen sequence period.

I hope this helps

Martin
 
Are there any details about the spectrum dll? Like the order of the filters? Does it use a FFT, FHT, or some other algorithm,?
 
FFT.

Order (center frequency) of the filters for spectrum.dll and ColorOrgan.dll are the same:

/// <summary>
/// Frequencies of interest
/// </summary>
int[] m_frequencyArray = new int[]
{
20, 25, 31, 40, 50, 63, 80, 100, 125, 160, 200, 250, 315,
400, 500, 630, 800, 1000, 1250, 1600, 2000, 2500, 3150,
4000, 5000, 6300, 8000, 10000, 12500, 16000, 20000
};




You will see all of the frequency band parameters in the frequencyBand.cs file.

Variables of interest are:
private static double FREQUENCY_BANDWIDTH_MULTIPLIER = Math.Pow(2.0, 0.16666666666666666);
private static int SPECTRUMSIZE = 512;
private static float BAND_WIDTH = (float)(22050 / FrequencyBand.SPECTRUMSIZE);
And are used this way:
m_centerFrequency = ((centerFrequency < 1000) ? centerFrequency.ToString() : string.Format("{0:F1}k", (float)centerFrequency / 1000f));
m_lowFrequency = (int)((double)centerFrequency / FrequencyBand.FREQUENCY_BANDWIDTH_MULTIPLIER);
m_highFrequency = (int)((double)centerFrequency * FrequencyBand.FREQUENCY_BANDWIDTH_MULTIPLIER);
m_fmodLowFrequencyIndex = (int)Math.Floor((double)((float)m_lowFrequency / FrequencyBand.BAND_WIDTH));
m_fmodHighFrequencyIndex = Math.Min((int)Math.Ceiling((double)((float)m_highFrequency / FrequencyBand.BAND_WIDTH)), FrequencyBand.SPECTRUMSIZE);



The frequency analyzer is set up and run in ColorOrgan.cs using these calls:

FMOD_ERRCHECK(FMOD.Factory.System_Create(ref m_FMOD_system));
m_FMOD_system.setOutput(FMOD.OUTPUTTYPE.NOSOUND_NRT);

FMOD_ERRCHECK(m_FMOD_system.init(32, FMOD.INITFLAG.STREAM_FROM_UPDATE, IntPtr.Zero));
m_FMOD_system.createStream(Path.Combine(Paths.AudioPath, m_sequence.Audio.FileName), (FMOD.MODE)72u, ref m_FMOD_sound);

// How much music is there (in ms)
m_FMOD_sound.getLength(ref endPosition, FMOD.TIMEUNIT.MS);

and finally repeated calls to this code:

/// <summary>
/// Run through each of the frequency bands and record the data
/// for the current pont in time in the audio track
/// </summary>
private void GetSpectrumData(uint period)
{
// int num = 0;
// int num2 = 0;
int sampleRate = 0;
int numOutputChannels = 0;
int maxInputChannels = 0;
int numBits = 0;
FMOD.SOUND_FORMAT sOUND_FORMAT = FMOD.SOUND_FORMAT.NONE;
FMOD.DSP_RESAMPLER dSP_RESAMPLER = FMOD.DSP_RESAMPLER.LINEAR;

m_FMOD_system.getSoftwareFormat(ref sampleRate /* num2 */,
ref sOUND_FORMAT,
ref numOutputChannels /* num */,
ref maxInputChannels /* num2 */,
ref dSP_RESAMPLER,
ref numBits /* num2 */);

// for each of the output channels
for (int currentChannel = 0; currentChannel < numOutputChannels; currentChannel++)
{
// get the spectrum data for this channel
m_FMOD_system.getSpectrum(m_FMOD_spectrum, 512, currentChannel, FMOD.DSP_FFT_WINDOW.TRIANGLE);

// update each frequency band for this period
foreach (var currentFrequencyBand in m_mapOfFrequencyBands)
{
// this is a magic number that I have not yet tracked down.
float currentLevel = 0f;
for (int j = currentFrequencyBand.Value.FmodLowFrequency; j < currentFrequencyBand.Value.FmodHighFrequency; j++)
{
// find the highest value available to this band
currentLevel = Math.Max(currentLevel, m_FMOD_spectrum[j]);
}
currentFrequencyBand.Value.add(period, currentLevel);
} // end process each frequency band
} // end process each channel
} // GetSpectrumData

and the subsystem doing all of the real work is a copy of the FMOD library which is included int he source files zip.
 
Hi Everyone

I just downloaded COLOR ORGAN for vixen 2.1, put the DLL file in the add on folder. Opened up vixen and yes it is there, opened up a sequence and started COLOR ORGAN and it starts to transcribe the audio.When it is just about done I get a "ADD IN ERROR - METHOD NOT FOUND: UINT64 VIXEN. CHANNEL GET-ID0;" Not sure what this mean and I was wondering if anyone has any ideas of similar problems.

Thank you in advance
LIGHTAHOLIC
Steve
 
It would also be great if you could implement color organ with sound intensity displayed as HSV (then RGB) values. This would work well with RGB leds where you can set the sound intensity per frequency with a corresponding HUE value (0 to 240 degrees, RED to BLUE with Saturation and Value in constant maximum value). The HSV values would then be converted into RGB values which would be assigned to any three channels corresponding to an RGB LED. I hope you understood my thoughts and thanks for this plugin!
 
Last edited:
Does anyone have a video of a sequence made with the color organ? I'm very curious about the look of completed sequences with this.
 
It would also be great if you could implement color organ with sound intensity displayed as HSV (then RGB) values. This would work well with RGB leds where you can set the sound intensity per frequency with a corresponding HUE value (0 to 360 degrees, with Saturation and Vibrance in constant maximum value). The HSV values would then be converted into RGB values which would be assigned to any three channels corresponding to an RGB LED. I hope you understood my thoughts and thanks for this plugin!

When I designed the Color Organ, I had not yet decided to use pixels and had almost no idea what it really ment to work with pixels. Now that I have some in my system, I can see that Vixen 2.1 and 2.5 are just not a good platform for managing pixels. I will use your suggestions when I port the Color Organ to Vixen 3 next spring.

Martin
 
Anyway, you can map the sound intensity per frequency to any of the HSV values while maintaining the two other on constant values (max values). Hue as variable would produce a color wheel representation of sound intensity. Saturation as variable would produce white as the minimum and the fixed hue value as maximum. Value (vibrance?) as variable would produce black as minimum value and the fixed hue value as maximum.
 
Love the plugin!
You have solved a big problem for me.
I had set my vixen and lynx controllers aside and have been using 3 cana kit r185's for the past several years to do lights to music.
I found your plug in and have been experimenting with it.
It allows me to control the light levels with greater accuracy.

I'm experimenting using 3 frequency bands ( 20 - 200, 200 - 2.0K, 2.0K - 20K) and creating 3 sets of color bands for each frequency band (one starting at 50%, the next at 70% and the last at 90% of peak).

The net effect is that more channels will come on and get brighter for each frequency band as the music gets louder.
The neighbors have really like it with the old fashioned light organs, I'm anxious to try this out for next years display with your plug in.

Question though, is there an easy way to copy the light organ settings from one sequence to another?
It gets a little difficult having to create the light organ for each new song and would be easier if I could attach it to a vixen profile

thanks

PS I'm using Vixen 2.1.4
 
Last edited:
You can copy the light organ settings section of the sequence xml file into a newly created sequence. However, I generally tend to take my previous sequence, copy it to a new file (with a new name), open the new file in V2, delete all of the sequence info, assign the new audio and start sequencing.
 
Back
Top