C# Класс Synthesizer, unity_synthesizer

Наследование: MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
DampSpeed float
OnNotePressed OnNotePressedDelegate
OnNoteReleased OnNoteReleasedDelegate
OnStartedPlaying OnStartedPlayingDelegate
OnStoppedPlaying OnStoppedPlayingDelegate
SoundThreshold float
Threshold double
comboBoxList GUIContent[]
midi Midi,
soundPack MidiSoundPack,

Открытые методы

Метод Описание
CalculateVolume ( int channelIndex ) : void

Calculates the actual volume of the channel based on the volume and expression (both coarse and fine)

SetExpression ( int channelIndex, int expression, bool isFine ) : void

Called by the application to set the expression of a specific channel.

SetInstrument ( int channelIndex, Instrument, instrument ) : void

Called by the application to set the Instrument of a specific channel

SetNote ( int channelIndex, int note, int octave, float velocity, bool on ) : void

Called by the application to set the properties of a specific note & octave.

SetPan ( int channelIndex, int pan, bool isFine ) : void

Called by the application to set the pan of a specific channel.

SetPitchBend ( int channelIndex, int bend ) : void

Called by the application to set the Pitch bend of a specific channel.

SetReverb ( int channelIndex, int reverb ) : void

Called by the application to set the reverb of a specific channel.

SetSustain ( int channelIndex, bool sustain ) : void

Called by the application to set the sustain of a specific channel.

SetVolume ( int channelIndex, int volume, bool isFine ) : void

Called by the applicatiion to set the volume of a specific channel.

StartPlaying ( ) : void

Called by the Synthesizer when the Synthesizer starts playing.

StopPlaying ( ) : void

Called by the Synthesizer when the Synthesizer stops playing.

Защищенные методы

Метод Описание
Mix ( double sample, double threshold ) : double

Mixing formula developed by Camiel. This function makes sure the audio sample stays within the -t/t range.

OnAudioFilterRead ( float data, int channels ) : void

Called by unity when new audio data is requested. This function processes active audio clips, puts them in the correct channel and applies dampening and volume changes to the channel.

OnGUI ( ) : void

Called by Unity when the Component should render the UI.

Приватные методы

Метод Описание
OnEnable ( ) : void

Called by Unity when the Component is enabled. This function initializes the AudioChannels and sets up the UI style.

Описание методов

CalculateVolume() публичный Метод

Calculates the actual volume of the channel based on the volume and expression (both coarse and fine)
public CalculateVolume ( int channelIndex ) : void
channelIndex int The channel to apply the change to. (range: 0-16)
Результат void

Mix() защищенный статический Метод

Mixing formula developed by Camiel. This function makes sure the audio sample stays within the -t/t range.
protected static Mix ( double sample, double threshold ) : double
sample double
threshold double
Результат double

OnAudioFilterRead() защищенный Метод

Called by unity when new audio data is requested. This function processes active audio clips, puts them in the correct channel and applies dampening and volume changes to the channel.
protected OnAudioFilterRead ( float data, int channels ) : void
data float Buffer to write the new audio data to
channels int Number of channels to request data for
Результат void

OnGUI() защищенный Метод

Called by Unity when the Component should render the UI.
protected OnGUI ( ) : void
Результат void

SetExpression() публичный Метод

Called by the application to set the expression of a specific channel.
public SetExpression ( int channelIndex, int expression, bool isFine ) : void
channelIndex int The channel to apply the change to. (range: 0-16)
expression int Expression of the channel
isFine bool Determines if the expression set is the coarse or fine expression.
Результат void

SetInstrument() публичный Метод

Called by the application to set the Instrument of a specific channel
public SetInstrument ( int channelIndex, Instrument, instrument ) : void
channelIndex int The channel to apply the change to. (range: 0-16)
instrument Instrument, Instrument of the channel
Результат void

SetNote() публичный Метод

Called by the application to set the properties of a specific note & octave.
public SetNote ( int channelIndex, int note, int octave, float velocity, bool on ) : void
channelIndex int The channel to apply the change to. (range: 0-16)
note int The note to apply the change to.
octave int The octave to apply the change to.
velocity float The velocity of the key press. (Only applicable when on = true).
on bool Determines wether the note is on or off.
Результат void

SetPan() публичный Метод

Called by the application to set the pan of a specific channel.
public SetPan ( int channelIndex, int pan, bool isFine ) : void
channelIndex int The channel to apply the change to. (range: 0-16)
pan int Pan of the channel
isFine bool Determines if the pan set is the coarse or fine pan.
Результат void

SetPitchBend() публичный Метод

Called by the application to set the Pitch bend of a specific channel.
public SetPitchBend ( int channelIndex, int bend ) : void
channelIndex int The channel to apply the change to. (range: 0-16)
bend int Bend of the channel
Результат void

SetReverb() публичный Метод

Called by the application to set the reverb of a specific channel.
public SetReverb ( int channelIndex, int reverb ) : void
channelIndex int The channel to apply the change to. (range: 0-16)
reverb int Reverb of the channel
Результат void

SetSustain() публичный Метод

Called by the application to set the sustain of a specific channel.
public SetSustain ( int channelIndex, bool sustain ) : void
channelIndex int The channel to apply the change to. (range: 0-16)
sustain bool Sustain of the channel
Результат void

SetVolume() публичный Метод

Called by the applicatiion to set the volume of a specific channel.
public SetVolume ( int channelIndex, int volume, bool isFine ) : void
channelIndex int The channel to apply the change to. (range: 0-16)
volume int Volume of the channel
isFine bool Determines if the volume set is the coarse or fine volume.
Результат void

StartPlaying() публичный Метод

Called by the Synthesizer when the Synthesizer starts playing.
public StartPlaying ( ) : void
Результат void

StopPlaying() публичный Метод

Called by the Synthesizer when the Synthesizer stops playing.
public StopPlaying ( ) : void
Результат void

Описание свойств

DampSpeed публичное статическое свойство

public static float DampSpeed
Результат float

OnNotePressed публичное свойство

public OnNotePressedDelegate OnNotePressed
Результат OnNotePressedDelegate

OnNoteReleased публичное свойство

public OnNoteReleasedDelegate OnNoteReleased
Результат OnNoteReleasedDelegate

OnStartedPlaying публичное свойство

public OnStartedPlayingDelegate OnStartedPlaying
Результат OnStartedPlayingDelegate

OnStoppedPlaying публичное свойство

public OnStoppedPlayingDelegate OnStoppedPlaying
Результат OnStoppedPlayingDelegate

SoundThreshold публичное статическое свойство

public static float SoundThreshold
Результат float

Threshold публичное статическое свойство

public static double Threshold
Результат double

comboBoxList публичное свойство

public GUIContent[] comboBoxList
Результат GUIContent[]

midi публичное свойство

public Midi, midi
Результат Midi,

soundPack публичное свойство

public MidiSoundPack, soundPack
Результат MidiSoundPack,