C# Class LitDev.LDMusic

Datei anzeigen Open project: litdev1/LitDev

Public Methods

Method Description
EndNote ( Primitive value ) : void

Stop a note being played.

InstrumentName ( Primitive instrument ) : Primitive

Get an instrument name from its number.

PlayMusic ( Primitive notes ) : void

Plays musical notes.

PlayMusic2 ( Primitive notes, Primitive instrument, Primitive velocity, Primitive volume, Primitive pan, Primitive channel ) : void

Plays musical notes with specified instrument and MDI channel. Also set volume, pan (balance) and velocity (key hit speed).

PlayNote ( Primitive octave, Primitive note, Primitive channel ) : Primitive

Play an individual note (allows multi-channel instruments).

Reset ( ) : void

Reset (stop all music on all channels).

Private Methods

Method Description
ChangeInstrument ( int number, int channel ) : void
ChangePan ( int number, int channel ) : void
ChangeVolume ( int number, int channel ) : void
EnsureDeviceInit ( ) : void
PlayNote ( int number, int channel ) : void
PlayNote ( int octave, string note, int length, int channel ) : void
PlayNotes ( string song, int channel ) : void
ResetDefaults ( ) : void
ResetDevice ( ) : void
StopNote ( int number, int channel ) : void
midiOutClose ( IntPtr midiOutt ) : int
midiOutOpen ( IntPtr &midiOut, uint uDeviceID, IntPtr dwCallback, IntPtr dwCallbackInstance, uint dwFlags ) : int
midiOutReset ( IntPtr midiOutt ) : int
midiOutSetVolume ( IntPtr midiOut, uint dwVolume ) : int
midiOutShortMsg ( IntPtr midiOut, uint dwMsg ) : int

Method Details

EndNote() public static method

Stop a note being played.
public static EndNote ( Primitive value ) : void
value Primitive The note to stop (this is the value returned by PlayNote when the note was started).
return void

InstrumentName() public static method

Get an instrument name from its number.
public static InstrumentName ( Primitive instrument ) : Primitive
instrument Primitive The instrument number.
return Primitive

PlayMusic() public static method

Plays musical notes.
public static PlayMusic ( Primitive notes ) : void
notes Primitive /// A set of musical notes to play. The format is a subset of the Music Markup Language supported by QBasic. ///
return void

PlayMusic2() public static method

Plays musical notes with specified instrument and MDI channel. Also set volume, pan (balance) and velocity (key hit speed).
public static PlayMusic2 ( Primitive notes, Primitive instrument, Primitive velocity, Primitive volume, Primitive pan, Primitive channel ) : void
notes Primitive /// A set of musical notes to play. The format is a subset of the Music Markup Language supported by QBasic. ///
instrument Primitive The instrument number.
velocity Primitive The key velocity (1 to 128, default 100).
volume Primitive Volume (0 to 100, default 50).
pan Primitive Pan left (-100) or right (100) (default 0).
channel Primitive The MIDI channel (1 to 16).
return void

PlayNote() public static method

Play an individual note (allows multi-channel instruments).
public static PlayNote ( Primitive octave, Primitive note, Primitive channel ) : Primitive
octave Primitive The octave (0 to 8).
note Primitive The note ("A","F#","B-" etc).
channel Primitive The MIDI channel (1 to 16).
return Primitive

Reset() public static method

Reset (stop all music on all channels).
public static Reset ( ) : void
return void