Programming Show Buddy Active macros

Programming Show Buddy Active macros

Show Buddy Active macros are written in Python language. To be specific, Show Buddy Active runs Python version 3.10.

All the usual Python system libraries, functions and programming constructs are available within a Python macro. You can execute macros from the Macros button on the Show Buddy Active screen.

A macro can modify any on-screen Show Buddy Active attribute, for example fader levels and oscillator settings. Some higher level functions (e.g. iterating though and saving banks & presets) is also available.

However, it is important to realise that macros do not run in realtime, and can not directly manipulate the DMX data being generated.

Think instead of macros as programming shortcuts that let you quickly set up a number of DMX channel settings, or perform some high level maintenance task (like copying a setting between different presets).

Macros are stored in the “Macros” folder of the Show Buddy Active installation folder.

Structure of a macro

A macro is typically a simple block of Python code with no user interaction. Macros cannot prompt for custom information. A macro can only query the Show Buddy Active engine for basic information (typically the currently selected channels) and display a single information dialog once the macro code has completed execution (or if the macro fails for some reason).

Get the selected channels

ns = GetNumSelCh
if ns==0:
   Message("Select some channels first!")

Set all selected channel faders to halfway point

for i in range(ns):
   SetChVal(GetSelCh(i), 128)

Writing macros

Show Buddy Active scans the macros folder every time you click on the “Macros” button. So, there is no need to restart the software every time you modify a macro or create a new one. Simply save your macro file within your editor, then select it from the “Macros” button.

Each macro lives in a single .py file – simply use your favourite text editor to edit the macro files.

You can create any folder structure you like within the main ‘Macros’ folder, and they will appear as submenus in the Show Buddy Active interface.

Do not modify the ‘Macros/System’ or ‘Macros/Python’ folders

Debugging macros

In Show Buddy Active, select the “Advanced > Macro output console” menu option to see the standard Python output terminal. In here, you will see any Python interpreter errors, to assist you in debugging your scripts.

You can also generate your own debug output by using the standard Python ‘print’ keyword in your macros. For example, this simple macro will display the current value of every selected fader in the macro output console window:

n = GetNumSelCh()
for i in range(n):
   chNum = GetSelCh(i)
   print 'Channel %d value = %d' % (chNum, GetChVal(chNum))

Function reference

A full reference list for the various functions available within a macro now follows. Most functions are grouped as get/set pairs, to query or modify a particular attribute. As with all programming languages, the best way to learn is by example. So in addition to this guide, take a look through the standard factory macros to see what is possible.

A note on channel numbers

Many of the following functions require a channel in the range 0-1023 (for 2 universe licenses) or 0-8191 (for 16 unlverse licenses).

The channel is (universe – 1) * 512 + fader – 1.
For example, fader 107 in universe 2 = channel 618

        General functions

        Message(string msg)
        Displays the given message as a dialog window in the Show Buddy Active GUI. Use this to optionally report a problem (e.g. “select an RGB channel first”).

        Effects control

        EnableEffects
        DisableEffects

        Switches the “Effects” tab on or off.

        Channel selection

        integer GetNumSelCh
        Returns the number of currently selected channel faders.

        integer GetSelCh(integer idx)
        Returns the DMX channel offset of a selected channel.

        • idx = 0 to GetNumSelCh return value minus 1

        array GetAllSelCh(False)
        Convenience function to get all selected channels. Example use:

        # Set all selected channels to 150
        for ch in GetAllSelCh(False):
           SetChVal(ch, 150)

        SelectCh(integer ch, integer sel)
        Selects or deselects the fader for the given DMX channel.

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)
        • sel = 0 (deselect the fader) or 1 (select the fader).

        Channel names

        string GetChName(integer ch)
        Returns the name of the given DMX channel. Useful for macros that only work on specific channel types (e.g. “Pan” or “Tilt” channels)

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)

        General channel settings

        integer GetChVal(integer ch)
        SetChVal(integer ch, integer val)

        Sets or gets the fader level for the given DMX channel.

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)
        • val = 0 to 255

        SetChInvert(integer ch, integer val)
        integer GetChInvert(integer ch)

        Modifies or retrieves the ‘Invert’ knob value level for a given DMX channel.

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)
        • val = 0 (invert off) or 1 (invert on)

        Channel masking

        SetChEnabled(integer ch, integer val)
        integer GetChEnabled(integer ch)

        Enables or disables a given DMX channel. This is used to implement the critical “channel masking” feature of Show Buddy Active.

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)
        • val = 0 (channel disabled) or 1 (channel enabled)

        Oscillator settings

        SetOscAmount(integer ch, float val)
        float GetOscAmount(integer ch)

        Sets or gets the amount of oscillation for the given DMX channel.

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)
        • val = 0.0 (no oscillation) to 1.0 (full oscillation). Higher values will “overdrive” the oscillator, making the fader “clip” at 0 and 255. This can be a useful effect.

        SetOscChase(integer ch, float val)
        float GetOscChase(integer ch)

        Sets or gets the oscillator phase for the given channel. By setting a range of channels to a different phase value, you can create complex chases.

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)
        • val = 0.0 to 1.0. A value of 0.5 makes the oscillator run precisely 180 degrees out of phase.

        SetOscSpeed(integer ch, integer val)
        integer GetOscSpeed(integer ch)

        Sets or gets the oscillator speed for the given channel. This is one of a set of fixed tempo-based values.

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)
        • val 0 = 1/16 bar, 1 = 1/8 bar, 2 = 3/16 bar, 3 = 1/4 bar, 4 = 3/8 bar, 5 = 1/2 bar, 6 = 3/4 bar, 7 = 1 bar, 8 = 2 bars, 9 = 3 bars, 10 = 4 bars, 11 = 6 bars, 12 = 8 bars, 13 = 12 bars, 14 = 16 bars, 15 = 24 bars, 16 = 32 bars, 17 = 48 bars, 18 = 64 bars, 19 = 96 bars, 20 = 128 bars

        SetOscShape(integer ch, float val)
        float GetOscShape(integer ch)

        Sets or gets the oscillator shape for the given channel. The effect this has on the waveform depends on the oscillator type selected (see the user manual for more information)

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)
        • val = 0.0 to 1.0

        SetOscType(integer ch, integer val)
        integer GetOscType(integer ch)

        Sets or gets the oscillator waveform for the given channel.

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)
        • val 0 = disable oscillator, 1 = sine, 2 = square, 3 = triangle, 4 = saw up, 5 = saw down

        Sound Tracker settings

        SetStLevel(integer ch, float val)
        float GetStLevel(integer ch)

        Sets or gets the sound tracker level.

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)
        • val = 0.0 to 5.0

        SetStBand(integer ch, integer val)
        integer GetStBand(integer ch)

        Sets or gets the sound tracker EQ band for the given channel.

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)
        • val 0 = sub, 1 = low, 2 = mid, 3 = high

        SetStAttack(integer ch, float timeMs)
        float GetStAttack(integer ch)

        Sets or gets the sound tracker attack time (in ms).

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)
        • timeMs = 0.0 to 10.0

        SetStRelease(integer ch, float val)
        float GetStRelease(integer ch)

        Sets or gets the sound tracker release time (in ms).

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)
        • timeMs = 0.0 to 250.0

        SetStDir(integer ch, integer val)
        integer GetStDir(integer ch)

        Sets or gets the sound tracker direction for the given channel.

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)
        • val 0 = up, 1 = down

        Bank & preset functions

        The following functions are useful for macros which perform global edits (e.g. making a modification across all presets in a bank, or every preset in a show). See the “Global Edits” factory macros for example usage.

        integer GetNumBanks
        Returns the number of banks in the currently loaded show.

        string GetBankName(integer idx)
        Returns the name of the given bank

        • idx = 0 to number of banks in show – 1

        LoadBank(integer idx)
        Loads the given bank (by index number)

        • idx = 0 to number of banks in show – 1

        LoadBank(string s)
        Loads the given bank (by bank name)

        • s = bank name

        integer GetNumPresets
        Returns the number of banks in the currently loaded bank.

        string GetPresetName(integer idx)
        Returns the name of the given preset

        • idx = 0 to number of presets in the current bank – 1

        LoadPreset(integer idx)
        Loads the given preset (by index number)

        • idx = 0 to number of presets in bank – 1

        LoadPreset(string s)
        Loads the given preset (by preset name)

        • s = preset name

        SaveCurrentPreset
        Overwrites the currently loaded preset with the current settings

        Fixture profile functions

        A couple of functions for basic fixture profile handling. See the “Fixture Setup” category of factory macros for example usage.

        RepeatLastFixture
        Takes the most recently loaded fixture profile, and loads another one at the next available free channel

        RemoveFixture(integer ch)
        Unloads any current fixture profile from the specified channel.

        • ch = 0 to 1023 (or 8191 for Show Buddy Active Max)

        How to share or backup your Show Buddy Active data

        How to share or backup your Show Buddy Active data

        You can copy your Show Buddy Active data to other computers (for sharing or backup purposes) using the built-in Backup and Restore features.

        A Show Buddy Active backup is a .sab file. It contains all data required to fully restore complete shows, including banks & presets, fixture definitions, fixture patching, and all images or video files used by your presets.

        Backing up shows

        • Open the Show Buddy Active standalone app.
        • Select File > Backup show data… from the main menu.
        • Enter a text description for the backup file.
        • Click Backup ALL shows… OR highlight the shows you need and click Backup selected…
        • Click Yes to proceed.
        • Choose a name and location for your .sab backup file and click Save.
        • Copy the resulting .sab file to your backup drive or the other computer.

        Restoring from a backup

        • Open the Show Buddy Active standalone app.
        • Select File > Restore from backup… from the main menu.
        • Click Yes to proceed.
        • Locate your .sab file and click Open.
        • Confirm that the description is correct. 
        • Click Restore all shows… OR highlight the shows you need and click Restore selected shows…
        • Click Yes to proceed.

        You can now load and run the restored shows from Show > Manage shows… on the main menu.

        Channel masking – what is it?

        Channel masking – what is it?

        Show Buddy Active Channel Masking lets you specify which DMX channels are controlled by each preset.

        Say you want a preset which only turns up a spotlight dimmer on channel 20, leaving the rest of the rig unchanged.

        • Click Macros > Channel Masks > Disable all channels.
        • All faders grey out, indicating they are not controlled by this preset.
        • Drag the dimmer on channel 20 to the desired level.
        • The channel 20 fader is no longer greyed out, meaning it is controlled by this preset. 
        • Save as a new preset called “Spotlight ON
        • Drag channel 20 to zero, and save as a new preset called “Spotlight OFF“.

        You can now load any full preset to set the entire rig, then load “Spotlight ON” and “Spotlight OFF” to control the spot independently. 

        See “Channel masking” in the user manual (from the Show Buddy Active Help menu) for more details.

        Where have the DMXIS forums gone?

        Where have the DMXIS forums gone?

        We’ve retired the old DMXIS discussion forum. They were no longer sufficiently active to be useful and contained a great deal of outdated and inaccurate information.

        We are now focusing support where it’s most effective. You can email support@db-audioware.com with any questions, and there’s an evolving knowledge base covering common issues.

        This approach lets us respond directly and keep guidance current, so you’ll get accurate, up-to-date advice. Thanks for your understanding.

        Why can I not import fixtures into Show Buddy Active?

        Why can I not import fixtures into Show Buddy Active?

        Problem – you downloaded a fixture from the online library, but when you try to import it into Show Buddy Active (from File > Manage fixtures) you get an error, or the file cannot be selected.

        The Reason

        Fixtures are downloaded as .zip files. and Show Buddy Active can only import these original .zip files.

        If your computer automatically opens the .zip file, you’ll end up with a folder called “DmxLibrary” that contains one or more “.dmx” files. These cannot be imported directly.

        Here’s how to prevent your browser from auto-extracting zip files.

        macOS Users

        On a Mac, Safari and the built-in Archive Utility may automatically unzip downloads.

        Stop Safari from Unzipping Files

        1. Open Safari.
        2. From the menu bar, choose Safari > Settings (or Preferences).
        3. In the General tab, uncheck:
          “Open ‘safe’ files after downloading.”

        Now downloaded zip files will stay zipped.

        Stop Archive Utility from Removing Zip Files

        1. Open FinderApplicationsUtilitiesArchive Utility.
        2. In the top menu, select Archive Utility > Preferences.
        3. Under “After expanding”, choose “Leave archive file.”

        Windows Users

        On Windows, web browsers (Chrome, Edge, Firefox, etc.) normally do not unzip files automatically.

        If your zip files are still being unpacked, it’s usually caused by another program on your computer, such as:

        • A download manager (e.g., Internet Download Manager, Free Download Manager)
        • An archiving tool (e.g., WinRAR, 7-Zip, PeaZip)
        • Antivirus or security software

        What to Do

        • Open the program’s settings and look for options like:
          • “Auto extract archives after download”
          • “Unpack files automatically”
        • Turn those options off.
        • If you’re not sure which program is doing it, try temporarily disabling or uninstalling extra download tools, then test again.

        Manual Workaround

        If you prefer, you can manually copy the fixtures files as follows.

        1. Locate the .dmx files (in the DmxLibrary folder of the downloaded zip file)
        2. Copy the .dmx files into your Show Buddy Active fixture library:
          • Windows : C:/Users/Public/Public Documents//db-audioware/Show Buddy Active/DmxLibrary
          • Mac : /Library/Application Support/db audioware/Show Buddy Active/DmxLibrary

        Show Buddy Active not transmitting Art-Net (macOS Sequoia or newer)

        Show Buddy Active not transmitting Art-Net (macOS Sequoia or newer)

        Problem: You have correctly configured Art-Net settings in Show Buddy Active, but no data is being received by your Art-Net hardware.

        You have successfully used ArtNetMon to confirm that the software is transmitting Art-Net data locally.

        Solution: macOS Sequoia may be blocking your Art-Net data. Go to System Settings > Privacy & Security > Local Network, and make sure ‘Show Buddy Active‘ is enabled.

        How to trigger the performance buttons via MIDI

        How to trigger the performance buttons via MIDI

        By default, the performance buttons on the “Perform” tab can be triggered by notes sent on MIDI channel 14.

        The MIDI note numbers required are displayed on the buttons. For example, here MIDI note 10 on channel 14 would trigger the “Gears” preset, and note 26 would trigger the “Graceful” preset.

        If required, you can change the MIDI channel from the Preferences window:

        Playing long videos in Show Buddy Active

        Playing long videos in Show Buddy Active

        Problem: you want a long video to run continuously for the entire duration of a song. But when you change presets, the video playback stops.

        Explanation: When you load a preset, the Effects tab stops all FX layers currently playing – including your video that was triggered by the earlier preset.

        The solution is to disable the Effects engine in all subsequent presets. Edit every other preset in the song, and disable the Effects engine via the “FX OFF” button:

        Important note:

        This technique has an important limitation. Since the FX engine is effectively tied up performing video playback for the duration of the song, you can no longer use the “Effects” tab to program your lights in the remaining presets. For those presets, you will need program your lights from the “Controls” tab (using faders and oscillators).

        Replacing audio track with a revised mix

        Replacing audio track with a revised mix

        Question : How can I update one of my existing audio tracks with a new mix?

        Answer : Just drag your revised audio file into the ‘Track Library’ panel of the main Show Buddy Setlist window. This will replace the existing file, and retain your exiating light show programming.

        When you drag in a revised audio file, you should see this message:

        Note that your revised file must have the same name and parent folder as the original (“Chill Wave.mp3” and “Demo tracks” in the above example).

        Presets are not loading and Effects tab is not working

        Show Buddy Active : presets not loading and/or Effects tab is not working

        Solution : Open File > Preferences > Audio/MIDI Settings and make sure a valid Input audio device is selected:

        Explanation : Show Buddy Active uses the audio input as an accurate timing source, to manage crossfades and oscillators, and to process incoming MIDI data. If no input is active, then you will experience various issues with switching between presets and running effects within presets.