Copyright © 2001-2019 MultiMedia Soft

MIDI.StreamEventValueGet method

Previous pageReturn to chapter overviewNext page

Remarks

 

Obtains the current value of a specific MIDI event inside the loaded MIDI stream. The current value of a MIDI event can be modified through the MIDI.StreamEventApply method.

Obtaining the current value for a MIDI_EVENT_NOTE is not supported because more notes could be applied at the same time: for this purpose you could enumerate notes through the MIDI StreamEventsEnum or MIDI StreamEventsEnumFromRange methods and obtain respective values through the MIDI.StreamEventsEnumItemGet method.

 

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

nPlayer as Integer,

nMidiEvent as enumMidiStreamEvents,

nOptionalKeyNoteValue as Integer

nMidiChannel as Integer,

nCurrValue as Long

) as enumErrorCodes


 

[C++]

short control.MIDI.StreamEventValueGet (

short nPlayer,

short nMidiEvent,

short nOptionalKeyNoteValue,

short nMidiChannel,

long *nCurrValue

);


\

Parameter

Description

 

 

nPlayer

Number representing the zero-based index of the involved player

nMidiEvent

The type of MIDI event for which we need to get the current value.

Supported events are the following:

Mnemonic constant

Value

Meaning

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.

nOptionalKeyNoteValue

The number representing the key/note number from 0 to 127 where 60 means middle C  This parameter is optional and is ignored for MIDI events different from the following:

Mnemonic constant

Value

Meaning

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_SCALETUNING

63

Sets the tuning of a note in every octave.

nMidiChannel

The MIDI channel on which the event is applied.

nCurrValue

Reference that, on return from the method call, will contain the current value of the MIDI event.

 

 

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