Copyright © 2001-2019 MultiMedia Soft

MIDI.StreamEventsEnumFromRange method

Previous pageReturn to chapter overviewNext page

Remarks

 

Enumerates a specific type of MIDI event detected inside the given portion of the loaded MIDI stream. After completing the enumeration, information about each of the detected MIDI events can be obtained through the MIDI.StreamEventsEnumItemGet method.

 

The list of detected MIDI events stays available in memory until a new enumeration is performed through a new call to this same method or through the MIDI.StreamEventsEnum method so a new enumeration always discards the previous list.

 

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

 

 

Syntax

 

[Visual Basic]

control.MIDI.StreamEventsEnumFromRange (

nPlayer as Integer,

nTrack as Integer,

nMidiEvent as enumMidiStreamEvents,

fStartPosition as Double,

fEndPosition as Double,

nPositionUnit as enumMidiPositionUnits,

nCount as Long

) as enumErrorCodes


 

[C++]

short control.MIDI.StreamEventsEnumFromRange (

short nPlayer,

short nTrack,

short nMidiEvent,

double fStartPosition,

double fEndPosition,

short nPositionUnit,

long *nCount

);


\

Parameter

Description

 

 

nPlayer

Number representing the zero-based index of the involved player

nTrack

Number representing the zero-based index of the MIDI track to scan for events detection. The total number of available MIDI tracks can be obtained through the MIDI:TrackCountGet method.

nMidiEvent

The type of MIDI event.

Supported values are the following:

Mnemonic constant

Value

Meaning

MIDI_EVENT_ALL

0

All types of MIDI events.

MIDI_EVENT_NOTE

1

Presses or releases a key note.

MIDI_EVENT_PROGRAM

2

Modifies a preset or instrument.

MIDI_EVENT_CHANPRES

3

Modifies the channel pressure.

MIDI_EVENT_PITCH

4

Modifies the pitch wheel position.

MIDI_EVENT_PITCHRANGE

5

Modifies the pitch wheel range (MIDI RPN 0).

MIDI_EVENT_DRUMS

6

Switches between melody channels and the rhythm (drums) channel.

MIDI_EVENT_FINETUNE

7

Sets the fine tuning (MIDI RPN 1).

MIDI_EVENT_COARSETUNE

8

Sets the coarse tuning (MIDI RPN 2).

MIDI_EVENT_MASTERVOL

9

Sets the master volume.

MIDI_EVENT_BANK

10

Selects the bank to use (MIDI controller 0).

MIDI_EVENT_MODULATION

11

Sets the modulation (MIDI controller 1).

MIDI_EVENT_VOLUME

12

Sets the volume (MIDI controller 7).

MIDI_EVENT_PAN

13

Sets the pan position (MIDI controller 10).

MIDI_EVENT_EXPRESSION

14

Sets the expression level (MIDI controller 11).

MIDI_EVENT_SUSTAIN

15

Sets the sustain pedal or switch (MIDI controller 64).

MIDI_EVENT_SOUNDOFF

16

Stops all sounds (MIDI controller 120).

MIDI_EVENT_RESET

17

Reset controllers to their default values (MIDI controller 121).

MIDI_EVENT_NOTESOFF

18

Releases all key notes (MIDI controller 123).

MIDI_EVENT_PORTAMENTO

19

Sets the portamento switch (MIDI controller 65).

MIDI_EVENT_PORTATIME

20

Sets the portamento time (MIDI controller 5).

MIDI_EVENT_PORTANOTE

21

Sets the portamento start key (MIDI controller 84).

MIDI_EVENT_MODE

22

Switches between poly and mono modes (MIDI controllers 126 and 127).

MIDI_EVENT_REVERB

23

Sets the reverb level (MIDI controller 91).

MIDI_EVENT_CHORUS

24

Sets the chorus level (MIDI controller 93).

MIDI_EVENT_CUTOFF

25

Sets the cutoff of the low-pass filter (MIDI controller 74, NRPN 120h).

MIDI_EVENT_RESONANCE

26

Sets the resonance of the low-pass filter (MIDI controller 71, NRPN 121h).

MIDI_EVENT_RELEASE

27

Sets the release time (MIDI controller 72, NRPN 166h).

MIDI_EVENT_ATTACK

28

Sets the attack time (MIDI controller 73, NRPN 163h).

MIDI_EVENT_REVERB_TIME

32

Sets the reverb time.

MIDI_EVENT_REVERB_DELAY

33

Sets the reverb delay.

MIDI_EVENT_REVERB_LOCUTOFF

34

Sets the cutoff of the reverb low-pass filter.

MIDI_EVENT_REVERB_HIGCUTOFF

35

Sets the cutoff of the reverb high-pass filter.

MIDI_EVENT_REVERB_LEVEL

36

Sets the reverb level.

MIDI_EVENT_CHORUS_DELAY

37

Sets the chorus delay.

MIDI_EVENT_CHORUS_DEPTH

38

Sets the chorus depth.

MIDI_EVENT_CHORUS_RATE

39

Sets the chorus rate.

MIDI_EVENT_CHORUS_FEEDBACK

40

Sets the level of the chorus feedback..

MIDI_EVENT_CHORUS_LEVEL

41

Sets the chorus level.

MIDI_EVENT_CHORUS_REVERB

42

Sets the chorus reverb level.

MIDI_EVENT_DRUM_FINETUNE

50

Sets the fine tuning of a drum key (MIDI NRPN 19knh).

MIDI_EVENT_DRUM_COARSETUNE

51

Sets the coarse tuning of a drum key (MIDI NRPN 18knh).

MIDI_EVENT_DRUM_PAN

52

Sets the pan position of a drum key (MIDI NRPN 1Cknh).

MIDI_EVENT_DRUM_REVERB

53

Sets the reverb level of a drum key (MIDI NRPN 1Dknh).

MIDI_EVENT_DRUM_CHORUS

54

Sets the chorus level of a drum key (MIDI NRPN 1Eknh).

MIDI_EVENT_DRUM_CUTOFF

55

Sets the cutoff of the low-pass filter of a drum key (MIDI NRPN 14knh).

MIDI_EVENT_DRUM_RESONANCE

56

Sets the resonance of the low-pass filter of a drum key (MIDI NRPN 15knh).

MIDI_EVENT_DRUM_LEVEL

57

Sets the level of a drum key (MIDI NRPN 1Aknh).

MIDI_EVENT_SOFT

60

Sets the soft pedal or switch (MIDI controller 67).

MIDI_EVENT_SYSTEM

61

Sets the system mode, resetting everything to the system's defaults.

MIDI_EVENT_TEMPO

62

Sets the tempo (MIDI meta event 81).

MIDI_EVENT_SCALETUNING

63

Sets the tuning of a note in every octave.

MIDI_EVENT_CONTROL

64

Unhandled controller. This has no effect on the MIDI stream, but can be useful for custom processing purposes with the MidiStreamEventNotification event.

MIDI_EVENT_CHANPRES_VIBRATO

65

Sets the maximum effect of channel pressure on vibrato depth.

MIDI_EVENT_CHANPRES_PITCH

66

Sets the maximum effect of channel pressure on pitch.

MIDI_EVENT_CHANPRES_FILTER

67

Sets the maximum effect of channel pressure on filter cutoff.

MIDI_EVENT_CHANPRES_VOLUME

68

Sets the maximum effect of channel pressure on volume.

MIDI_EVENT_MODRANGE

69

Sets the modulation/vibrato depth range (MIDI RPN 5).

MIDI_EVENT_BANK_LSB

70

Selects the bank LSB to use (MIDI controller 32).

MIDI_EVENT_MIX_VOLUME_LEVEL

Hex 10000

Sets the volume level at mixing time, meaning that the level will not be affected by eventual MIDI_EVENT_VOLUME events inside a MIDI file.

MIDI_EVENT_TRANSPOSE

Hex 10001

Transposes all notes.

MIDI_EVENT_SYSTEMEX

Hex 10002

Sets the system mode, resetting everything to the system's defaults including MIDI channels allocated through the MIDI.ChannelsSet method.

fStartPosition

Number specifying the start point of the range in the unit specified by the nPositionUnit parameter below.

fEndPosition

Number specifying the end point of the range in the unit specified by the nPositionUnit parameter below.

nPositionUnit

The unit used to specify the fStartPosition and fEndPosition parameters 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.

MIDI_POS_UNIT_PERCENTAGE

2

The fPosition parameter is expressed in percentage

nCount

Reference that, on return from the method call, will contain the number of events of the given type detected inside the loaded MIDI stream.

 

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred, check the LastError property value in order to get the error code

enumErrorCodes.ERR_NOERROR (0)

The method call was successful