WAVE EDITOR / RECORDER

Script Tool

The Edison & Slicex Script Tool (Ctrl+T) - Opens a menu containing the list of available scripts. You can write your own scripts using Python that allows you to write code to perform complex DSP on your samples.

Save scripts - as .pyscript files in the FL Studio User data folder ..Documents\Image-Line\FL Studio\Settings\Audio scripts. Files saved here will be visible the next time you use the 'run script' command. Additional units/modules can be regular .py files.

Dialogs - Note that while some of the demo scripts show a dialog, it isn't necessary to use them.

Errors - If a script has an error, a dialog is shown explaining the error with options to 'edit' the script or 'run' it again.

Writing scripts - Examine the contents of the existing scripts, and see the Edison Scripting Reference section below to learn more about writing them and the functions available. The reference can also be found in the script directory in Reference.txt. You can learn more about Python HERE.

Edison Script Reference


Global variables
Editor An instance of Edison's wave editor.
EditorSample An instance of the sample loaded in Edison's wave editor.

 

Global functions
ProgressMsg(Msg,Pos,Total) Shows a progress message in Edison/FL.
ShowMessage(Msg) Shows a message in a dialog box.

 

Wave related classes
# PasteFromTo modes
0: insert
1: replace
2: mix

# NormalizeFormat Mode flags (combine as needed)
NF_NumChannels Normalize the number of channels.
NF_Format Normalize the sample format.
NF_Samplerate Normalize the samplerate.
NF_All Normalize all (combines all flags).

# region
class Region :
property SampleStart The start of this region, in samples.
property SampleEnd The end of this region, in samples. If this is larger than the length of the sample, it's a marker instead of a region.

# sample
class Sample :
def GetSampleAt(Position, Channel) Retrieve the value of a single sample (Position in samples).
def SetSampleAt(Position, Channel, Value) Set the value of a single sample (Position in samples).
def NormalizeFromTo(x1, x2, Vol, OnlyIfAbove = FALSE) Normalize the wave between sample positions x1 and x2 (inclusive).
def AmpFromTo(x1, x2, Vol) Amplify the wave between sample positions x1 and x2 (inclusive).
def SilenceFromTo(x1, x2) Change the sample values between positions x1 and x2 (inclusive) to zero.
def SineFromTo(x1, x2, Freq, Phase, Vol = 1.0) Change the samples between positions x1 and x2 (inclusive) to a sine wave.
def LoadFromClipboard Load a wave from the clipboard into this sample object.
def MsToSamples(Time) Convert a position value from milliseconds to samples.
def NormalizeFormat(Source,Mode = nfAll) Change the format of this sample to be compatible with the format of the source sample. See the mode constants above.
def GetRegion(Index) Retrieve an object for the region at Index (between 0 and RegionCount-1).
def CenterFromTo(x1, x2) Center the wave between the sample positions x1 and x2 (inclusive).
def ReverseFromTo(x1, x2) Reverse the wave between sample positions x1 and x2 (inclusive).
def ReversePolarityFromTo(x1, x2) Reverse polarity of the wave between sample positions x1 and x2 (inclusive).
def SwapChannelsFromTo(x1, x2) Swap the values of the channels of this wave between sample positions x1 and x2 (inclusive), for a stereo wave.
def InsertSilence(x1, x2) Insert a block of zero-valued samples (silence) between sample positions x1 and x2 (inclusive). This doesn't change the existing samples, it only inserts new samples at at position x1.
def NoiseFromTo(x1, x2, Mode = 1, Vol = 1) Change the samples between positions x1 and x2 (inclusive) to random values. Mode is 0 (uniform noise) or 1 (gaussian noise).
def DeleteFromTo(x1, x2, Copy = FALSE) Delete samples from x1 to x2 (inclusive).
def TrimFromTo(x1, x2) Trim samples from 0 to x1 (inclusive) and from x2 to the end of the sample.
def SamplesToMS(Time) Convert a position value from samples to milliseconds.
def LoadFromFile(Filename) Load a filename. This needs to be a complete filename with path. Use ScriptPath to complete it if necessary.
def LoadFromFile_Ask Shows an open dialog and loads the file into the sample if the user clicks OK.
def AddRegion(Name, SampleStart, SampleEnd) Add a new region. Returns the index of the new region (other regions may have been moved to another index).
def DeleteRegion(Index) Delete an existing region at Index.
property Length The length of the wave, in samples.
property NumChans The channel count.
property SampleRate The sample rate, in Hertz.
property RegionCount The amount of regions. Can be zero or more.

# editor
class Editor :
property SelectionStartS Retrieve the start position of the selection in the editor, in samples.
property SelectionEndS Retrieve the end position of the selection in the editor, in samples.

 

Dialog classes and functions
TScriptDialog :
def AddInput(aName,Value) Adds a generic input control.
def AddInputKnob(aName, Value, Min, Max) Adds a knob input control.
def AddInputCombo(aName, ValueList, Value) Adds a combobox input control.
def GetInputValue(aName) Retrieve the current value of the input with the specified name.
def Execute Show the dialog. Returns TRUE if the user pressed OK, FALSE if the dialog was cancelled.

def CreateScriptDialog(Title, Description) Creates a new script dialog.