Copyright © 2005-2019 MultiMedia Soft

MIDI.SeekToPosition method

Previous pageReturn to chapter overviewNext page

Remarks

 

Obtains the number of Pulses Per Quarter Note (also known as "ticks per beat") inside the loaded MIDI stream.

 

For further details about the use of MIDI protocol see the MIDIMan class section and the How to deal with MIDI protocol tutorial.

 

 

Syntax

 

[Visual Basic]

Public Function SeekToPosition (

nPlayerIndex as Int16,

fPosition as Double,

nPositionUnit as enumMidiPositionUnits,

bPerformDecay as Boolean

) as enumErrorCodes


 

[C#]

public enumErrorCodes SeekToPosition (

Int16 nPlayerIndex,

double fPosition,

enumMidiPositionUnits nPositionUnit,

bool bPerformDecay

);


 

[C++]

public: enumErrorCodes SeekToPosition (

Int16 nPlayerIndex,

double fPosition,

enumMidiPositionUnits nPositionUnit,

bool bPerformDecay

);


 

 

 

Parameter

Description

 

 

nPlayerIndex

Number representing the zero-based index of the involved player

fPosition

Number representing the position to reach; its value depends upon the value of the nPositionUnit parameter below.

nPositionUnit

The unit of measure used for the position value stored inside fPosition parameter above.

Supported values are the following:

Mnemonic constant

Value

Meaning

MIDI_POS_UNIT_TICKS

0

The fPosition parameter is expressed in MIDI ticks

MIDI_POS_UNIT_MS

1

The fPosition parameter is expressed in milliseconds. The position is always referred to the original sound duration, meaning that it won't keep count of eventual tempo and/or playback rate changes and will always move playback to the position on the song as it should be played at its original speed.

MIDI_POS_UNIT_PERCENTAGE

2

The fPosition parameter is expressed in percentage

bPerformDecay

Boolean value that specifies if the sound will decay naturally or will be stopped abruptly when the sound position is changed. This setting overrides an eventual setting performed through the MIDI.DecayModeSet method.

Supported values are the following:

Value

Meaning

false

The sound will be stopped abruptly when the playback position is modified.

true

The sound will decay naturally when the playback position is modified.

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred (see the LastError property for further error details)

enumErrorCodes.NOERROR (0)

The method call was successful.