Copyright © 2005-2019 MultiMedia Soft

MIDI.StreamEventsEnableNotifications method

Previous pageReturn to chapter overviewNext page

Remarks

 

Enables/disables the synchronization of the container application with a specific type of MIDI event detected inside the loaded MIDI stream during playback.

When synchronization is enabled, the component invokes the CallbackForMidiStreamEvents delegate for each specific event enabled for notification.

 

MIDI events can also be enumerated offline, while the MIDI stream is not in playback, through the combination of the MIDI.StreamEventsEnum and MIDI:StreamEventsEnumItemGet methods.

 

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 StreamEventsEnableNotifications (

nPlayerIndex as Int16,

nMidiEvent as enumMidiStreamEvents,

bEnable as Boolean

) as enumErrorCodes


 

[C#]

public enumErrorCodes StreamEventsEnableNotifications (

Int16 nPlayerIndex,

enumMidiStreamEvents nMidiEvent,

bool bEnable

);


 

[C++]

public: enumErrorCodes StreamEventsEnableNotifications (

Int16 nPlayerIndex,

enumMidiStreamEvents nMidiEvent,

bool bEnable

);


 

 

 

Parameter

Description

 

 

nPlayerIndex

Number representing the zero-based index of the involved player

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 CallbackForMidiStreamEvents delegate.

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.

bEnable

Boolean value that specifies if the finding of the given event during playback must be notified through the CallbackForMidiStreamEvents delegate.

Supported values are the following:

Value

Meaning

false

Notification for the given event is not enabled.

true

Notification for the given event is enabled.

 

 

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.