0% found this document useful (0 votes)
80 views3 pages

Edison Script Reference

This document provides an overview of classes and functions available for scripting in the Edison audio editor. It includes global variables and functions, common Delphi/Windows functions, classes for working with waves/samples, regions and the editor, and classes/functions for creating dialogs. The classes allow getting/setting sample data, adding effects, normalizing formats, and retrieving selection information, while the dialog functions enable building GUI prompts.

Uploaded by

Ofmyrh Ongobo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views3 pages

Edison Script Reference

This document provides an overview of classes and functions available for scripting in the Edison audio editor. It includes global variables and functions, common Delphi/Windows functions, classes for working with waves/samples, regions and the editor, and classes/functions for creating dialogs. The classes allow getting/setting sample data, adding effects, normalizing formats, and retrieving selection information, while the dialog functions enable building GUI prompts.

Uploaded by

Ofmyrh Ongobo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

Edison Script Reference

=======================

1. Global variables
-------------------
CRLF string acts as a line feed for showing multiline
messages
Editor TEditor
EditorSample TSample
ScriptPath string

2. Global functions
-------------------
ProgressMsg procedure ProgressMsg(const Msg:String;Pos,Total:Integer);
ShowMessage procedure ShowMessage(const s: string);

3. Delphi/Windows functions
---------------------------
Dec procedure dec_(var Value, Decrement: integer);
Decreases an integer value
FloatToStr function FloatToStr(Value: extended): string; Converts a
floating point value to a string
Inc procedure inc_(var Value, Increment: integer); Increases an
integer value
IntToStr function IntToStr(Value: integer): string;
Converts an integer value to a string
Round function Round(Value: double): integer; Rounds a floating
point value to an integer
TimeGetTime function timeGetTime: integer; stdcall; Returns the
time in ms since Windows was started (can be used to time parts of scripts)

4. 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
TRegion = class
constructor Create;
procedure Copy(Source: TRegion);
property SampleStart: integer;
property SampleEnd: integer;
property Name: string;
property Info: string;
property Time: single;
property KeyNum: integer;
end;

// sample
TSample = class
constructor Create;
function GetSampleAt(Position, Channel: integer): single;
procedure SetSampleAt(Position, Channel: integer; Value: single);
procedure CenterFromTo(x1, x2: integer);
function NormalizeFromTo(x1, x2: integer; Vol: single; OnlyIfAbove: boolean =
FALSE): single;
procedure AmpFromTo(x1, x2: integer; Vol: single);
procedure ReverseFromTo(x1, x2: integer);
procedure ReversePolarityFromTo(x1, x2: integer);
procedure SwapChannelsFromTo(x1, x2: integer);
procedure InsertSilence(x1, x2: integer);
procedure SilenceFromTo(x1, x2: integer);
procedure NoiseFromTo(x1, x2: integer; Mode: integer = 1; Vol: single = 1);
procedure SineFromTo(x1, x2: integer; Freq, Phase: double; Vol: single = 1);
procedure PasteFromTo(aSample: TSample; var x1, x2: integer; Mode: integer =
0);
procedure LoadFromClipboard;
procedure DeleteFromTo(x1, x2: integer; Copy: boolean = FALSE);
procedure TrimFromTo(x1, x2: integer);
function MsToSamples(Time: double): double;
function SamplesToMS(Time: double): double;
procedure LoadFromFile(const Filename: string); // loads a full filename (use
ScriptPath to complete it)
procedure LoadFromFile_Ask; // shows open dialog
procedure NormalizeFormat(Source: TSample; Mode: integer = nfAll);
function GetRegion(Index: integer): TRegion;
function AddRegion(const SetName: string; SampleStart: integer; SampleEnd:
integer = MaxInt): integer;
procedure DeleteRegion(Index: integer);
property Length: integer;
property NumChans: integer;
property Samplerate: integer;
property RegionCount: integer;
end;

// editor
TEditor = class
function GetSelectionS(var x1, x2: integer): boolean;
function GetSelectionMS(var x1, x2: double): boolean;
property Sample: TSample;
end;

5. Dialog classes and functions


-------------------------------
TInput = class
property DefaultValue: single;
property Value: single;
property ValueAsInt: integer;
property Min: single;
property Max: single;
end;

TScriptDialog = class
constructor Create;
function AddInput(const aName: string; Value: single): TInput;
function AddInputKnob(const aName: string; Value, Min, Max: single): TInput;
function AddInputCombo(const aName, ValueList: string; Value: integer): TInput;
function GetInput(const aName: string): TInput;
function GetInputValue(const aName: string): single;
function GetInputValueAsInt(const aName: string): integer;
function Execute: boolean;
end;

function CreateScriptDialog(const Title, Description: string): TScriptDialog;

You might also like