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. |