波形编辑器/记录器

脚本工具

EdisonSlicex 脚本工具 (Ctrl+T) - 打开一个包含可用脚本列表的菜单。 您可以使用 BasicPascalJavascript 编写自己的脚本,它们将通过 paxCompiler 编译并在您从菜单中选择脚本时运行。 paxCompiler 是真正的 Pascal 编译器,可用于编写代码以对样本执行复杂的 DSP。

保存脚本 - 将脚本作为 .pas 文件保存在 FL Studio 安装目录中的 …\Plugins\Fruity\Effects\Edison\Data\Scripts 下。 下次使用“运行脚本”命令时,将显示此处保存的文件。

对话框 - 请注意,尽管一些演示脚本显示了一个对话框,但并不需要使用它们。

错误 - 如果一个脚本有错误,则会显示一个对话框,说明该错误,并提供“编辑”脚本或再次“运行”脚本的选项。

编写脚本 - 检查现有脚本的内容,并阅读脚本目录中的 Reference.txt 文件来详细了解如何编写脚本以及可用函数。 您可以在此处详细了解 Pascal。

Edison 脚本参考


全局变量
CRLF string - 用作换行符,以显示多行消息
Editor TEditor
EditorSample TSample
ScriptPath string

 

全局函数
ProgressMsg procedure ProgressMsg(const Msg:String;Pos,Total:Integer);
ShowMessage procedure ShowMessage(const s: string);

 

Delphi/Windows 函数
Dec procedure dec(var Value, Decrement: integer);
FloatToStr function FloatToStr(Value: extended): string;
Inc procedure inc(var Value, Increment: integer);
IntToStr function IntToStr(Value: integer): string;
Round function Round(Value: double): integer;
TimeGetTime function timeGetTime: integer; stdcall;

 

波形相关的类
// 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;

 

对话框类和函数
TInput = class
property DefaultValue: 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;