RMidiControllerCustomCommands Class Reference

#include <mmf/common/midistandardcustomcommands.h>

Link against: midistandardcustomcommands.lib

class RMidiControllerCustomCommands : public RMMFCustomCommandsBase

Inherits from

Public Member Functions
RMidiControllerCustomCommands(RMMFController &)
IMPORT_C TIntCancelReceiveEvents()
IMPORT_C TIntChannelVolume(TInt, TReal32 &)
IMPORT_C TIntChannelsSupported(TInt &)
IMPORT_C TIntClose()
IMPORT_C TIntCustomBankLoaded(TInt, TBool &)
IMPORT_C TIntDurationMicroBeats(TInt64 &)
IMPORT_C TIntGetBalance(TInt &)
IMPORT_C TIntGetBankId(TBool, TInt, TInt &)
IMPORT_C TIntGetInstrument(TInt, TInt &, TInt &)
IMPORT_C TIntGetInstrumentId(TInt, TBool, TInt, TInt &)
IMPORT_C TIntGetRepeats(TInt &)
IMPORT_C HBufC *InstrumentNameL(TInt, TBool, TInt)
IMPORT_C TIntIsChannelMute(TInt, TBool &)
IMPORT_C TIntIsTrackMute(TInt, TBool &)
IMPORT_C TIntLoadCustomBank(const TDesC &, TInt &)
IMPORT_C TIntLoadCustomBankData(const TDesC8 &, TInt &)
IMPORT_C TIntLoadCustomInstrument(const TDesC &, TInt, TInt, TInt, TInt)
IMPORT_C TIntLoadCustomInstrumentData(const TDesC8 &, TInt, TInt, TInt, TInt)
IMPORT_C TIntMaxChannelVolume(TReal32 &)
IMPORT_C TIntMaxPlaybackRate(TInt &)
IMPORT_C TIntMaxPolyphony(TInt &)
IMPORT_C TIntMaxVolume(TInt &)
IMPORT_C TIntMimeType(TDes8 &)
IMPORT_C TIntMinPlaybackRate(TInt &)
IMPORT_C TIntNoteOff(TInt, TInt, TInt)
IMPORT_C TIntNoteOn(TInt, TInt, TInt)
IMPORT_C TIntNumTracks(TInt &)
IMPORT_C TIntNumberOfBanks(TBool, TInt &)
IMPORT_C TIntNumberOfInstruments(TInt, TBool, TInt &)
IMPORT_C HBufC *PercussionKeyNameL(TInt, TInt, TBool, TInt)
IMPORT_C TIntPitchTranspositionCents(TInt &)
IMPORT_C TIntPlayNote(TInt, TInt, const TTimeIntervalMicroSeconds &, TInt, TInt)
IMPORT_C TIntPlayNote(TInt, TInt, const TTimeIntervalMicroSeconds &, const TTimeIntervalMicroSeconds &, TInt, TInt)
IMPORT_C TIntPlaybackRate(TInt &)
IMPORT_C TIntPolyphony(TInt &)
IMPORT_C TIntPositionMicroBeats(TInt64 &)
IMPORT_C voidReceiveEvents(TPckgBuf< TInt > &, TRequestStatus &)
IMPORT_C TIntRetrieveEvent(TDes8 &)
IMPORT_C TIntSendMessage(const TDesC8 &, TInt &)
IMPORT_C TIntSendMessage(const TDesC8 &, const TTimeIntervalMicroSeconds &, TInt &)
IMPORT_C TIntSendMipMessage(const RArray< TMipMessageEntry > &)
IMPORT_C TIntSetBalance(TInt)
IMPORT_C TIntSetBank(TBool)
IMPORT_C TIntSetChannelMute(TInt, TBool)
IMPORT_C TIntSetChannelVolume(TInt, TReal32)
IMPORT_C TIntSetInstrument(TInt, TInt, TInt)
IMPORT_C TIntSetMaxPolyphony(TInt)
IMPORT_C TIntSetPitchTransposition(TInt, TInt &)
IMPORT_C TIntSetPlaybackRate(TInt)
IMPORT_C TIntSetPositionMicroBeats(TInt64)
IMPORT_C TIntSetRepeats(TInt, const TTimeIntervalMicroSeconds &)
IMPORT_C TIntSetStopTime(const TTimeIntervalMicroSeconds &)
IMPORT_C TIntSetSyncUpdateCallbackInterval(const TTimeIntervalMicroSeconds &, TInt64)
IMPORT_C TIntSetTempo(TInt)
IMPORT_C TIntSetTrackMute(TInt, TBool)
IMPORT_C TIntSetVolume(TInt)
IMPORT_C TIntSetVolumeRamp(const TTimeIntervalMicroSeconds &)
IMPORT_C TIntStop(const TTimeIntervalMicroSeconds &)
IMPORT_C TIntStopNotes(TInt)
IMPORT_C TIntStopTime(TTimeIntervalMicroSeconds &)
IMPORT_C TIntTempoMicroBeatsPerMinute(TInt &)
IMPORT_C TIntUnloadAllCustomBanks()
IMPORT_C TIntUnloadCustomBank(TInt)
IMPORT_C TIntUnloadCustomInstrument(TInt, TInt)
IMPORT_C TIntVolume(TInt &)
Inherited Attributes
RMMFCustomCommandsBase::iController
RMMFCustomCommandsBase::iDestinationPckg
Inherited Functions
RMMFCustomCommandsBase::RMMFCustomCommandsBase(RMMFController &,TUid)

Detailed Description

Client class to access functionality specific to a MIDI controller. The class uses the custom command function of the controller plugin, and removes the necessity for the client to formulate the custom commands.

Constructor & Destructor Documentation

RMidiControllerCustomCommands ( RMMFController & )

IMPORT_CRMidiControllerCustomCommands(RMMFController &aController)

Constructor.

ParameterDescription
aControllerThe client side controller object to be used by this custom command interface.

Member Function Documentation

CancelReceiveEvents ( )

IMPORT_C TIntCancelReceiveEvents()

Stop receiving events from the MIDI controller.

Returns: One of the system-wide error codes.

ChannelVolume ( TInt, TReal32 & )

IMPORT_C TIntChannelVolume(TIntaChannel,
TReal32 &aChannelVol
)const

Get the current volume setting of a logical channel.

ParameterDescription
aChannelLogical channel to query. 0 <= aChannel <= 15.
aChannelVolVolume currently set on the specified channel in decibels.

Returns: One of the system-wide error codes.

ChannelsSupported ( TInt & )

IMPORT_C TIntChannelsSupported(TInt &aChannels)const

Get the maximum number of logical channels supported by the MIDI engine.

ParameterDescription
aChannelsThe maximum number of logical channels that the MIDI engine supports, 0 <= aChannels <=15.

Returns: One of the system-wide error codes.

Close ( )

IMPORT_C TIntClose()

Closes any currently open resources, such as files, descriptors or URLs in use. Does nothing if there is nothing currently open.

Returns: One of the system-wide error codes.

CustomBankLoaded ( TInt, TBool & )

IMPORT_C TIntCustomBankLoaded(TIntaBankId,
TBool &aBankLoaded
)const

Query if a bank has been loaded to the memory.

ParameterDescription
aBankIdIdentifier of the custom sound bank to check if it's in memory or not.
aBankLoadedETrue if the specified bank is in memory, EFalse otherwise.

Returns: One of the system-wide error codes.

DurationMicroBeats ( TInt64 & )

IMPORT_C TIntDurationMicroBeats(TInt64 &aDuration)const

Gets the length of the currently open MIDI resource in micro-beats.

ParameterDescription
aDurationDuration in microbeats (beats * 1000000).

Returns: One of the system-wide error codes.

GetBalance ( TInt & )

IMPORT_C TIntGetBalance(TInt &aBalance)const

Get the current stereo balance value.

ParameterDescription
aBalanceBalance value ranging from KMMFBalanceMaxLeft to KMMFBalanceMaxRight.

Returns: One of the system-wide error codes.

GetBankId ( TBool, TInt, TInt & )

IMPORT_C TIntGetBankId(TBoolaCustom,
TIntaBankIndex,
TInt &aBankId
)const

Gets the identifier of a sound bank. Bank identifier (aka bank number) is a 14-bit value consisting of MIDI bank MSB and LSB values.

ParameterDescription
aCustomSpecifies whether to reference a custom or standard sound bank.
aBankIndexIndex of sound bank where 0 <= aBankIndex < NumberOfBanks().
aBankIdIdentifier of the specified bank occupying, at most, 14 bits.

Returns: One of the system-wide error codes.

GetInstrument ( TInt, TInt &, TInt & )

IMPORT_C TIntGetInstrument(TIntaChannel,
TInt &aInstrumentId,
TInt &aBankId
)

Gets the instrument assigned to a specified channel.

ParameterDescription
aChannelLogical channel, 0 <= aChannel <= 15.
aInstrumentIdIdentifier of the instrument assigned to aChannel. 0 <= aInstrumentId <= 127.
aBankIdIdentifier of the bank that the instrument belongs to, occupying no more than 14 bits.

Returns: One of the system-wide error codes.

GetInstrumentId ( TInt, TBool, TInt, TInt & )

IMPORT_C TIntGetInstrumentId(TIntaBankId,
TBoolaCustom,
TIntaInstrumentIndex,
TInt &aInstrumentId
)const

Gets the identifier of an instrument.

ParameterDescription
aBankIdIdentifier of the sound bank to reference, occupying no more than 14 bits.
aCustomSpecifies whether to reference a custom or standard sound bank.
aInstrumentIndexIndex of the instrument to reference where 0 <= aInstrumentIndex < NumberOfInstruments().
aInstrumentIdIdentifier of specified instrument. This may differ from the index since the index simply enumerates the instruments, whereas identifiers may not be contiguous, especially where certain instruments correspond to General MIDI-defined instruments but not all instruments are present. Instrument identifiers are between 0 and 127 inclusive.

Returns: One of the system-wide error codes.

GetRepeats ( TInt & )

IMPORT_C TIntGetRepeats(TInt &aNumRepeats)const

Gets the number of times the current opened resources has to be repeated.

ParameterDescription
aNumRepeatsThe number of times the current opened resources has to be repeated.

Returns: One of the system-wide error codes.

InstrumentNameL ( TInt, TBool, TInt )

IMPORT_C HBufC *InstrumentNameL(TIntaBankId,
TBoolaCustom,
TIntaInstrumentId
)const

Gets the name of the given instrument.

ParameterDescription
aBankIdIdentifier of the bank that the instrument belongs to, occupying no more than 14 bits.
aCustomSpecifies whether to reference a custom or standard sound bank.
aInstrumentIdIdentifier of the instrument under scrutiny. 0 <= aInstrumentId <= 127.

Returns: Buffer containing the name of the specified instrument. If it has no name then an empty descriptor is returned.

IsChannelMute ( TInt, TBool & )

IMPORT_C TIntIsChannelMute(TIntaChannel,
TBool &aChannelMute
)const

Gets the muting status of a specific channel.

ParameterDescription
aChannelThe channel to query.
aChannelMuteThe mute status of the channel.

Returns: One of the system-wide error codes.

IsTrackMute ( TInt, TBool & )

IMPORT_C TIntIsTrackMute(TIntaTrack,
TBool &aTrackMute
)const

Gets the muting status of a specific track.

ParameterDescription
aTrackThe track to query.
aTrackMuteThe mute status of the track.

Returns: One of the system-wide error codes.

LoadCustomBank ( const TDesC &, TInt & )

IMPORT_C TIntLoadCustomBank(const TDesC &aFileName,
TInt &aBankId
)

Loads one or more custom sound banks from a file into memory for use. If several banks are loaded with consequent LoadCustomBanks() function calls, the banks are combined if the bank sets have conflicting bank numbers.

ParameterDescription
aFileNameName of the file containing the custom sound bank.
aBankIdIdentifier of the custom sound bank loaded, occupying no more than 14 bits.

Returns: One of the system-wide error codes.

LoadCustomBankData ( const TDesC8 &, TInt & )

IMPORT_C TIntLoadCustomBankData(const TDesC8 &aBankData,
TInt &aBankId
)

Loads one or more custom sound banks from a descriptor into memory for use. If several banks are loaded with consequent LoadCustomBanks() function calls, the banks are combined if the bank sets have conflicting bank numbers.

ParameterDescription
aBankDataDescriptor containing the custom sound bank.
aBankIdIdentifier of the custom sound bank loaded, occupying no more than 14 bits.

Returns: One of the system-wide error codes.

LoadCustomInstrument ( const TDesC &, TInt, TInt, TInt, TInt )

IMPORT_C TIntLoadCustomInstrument(const TDesC &aFileName,
TIntaFileBankId,
TIntaFileInstrumentId,
TIntaMemoryBankId,
TIntaMemoryInstrumentId
)

Loads an individual instrument from file into custom sound bank memory for use. The bank and instrument id given in the file can be mapped into different bank and instrument id in memory.

ParameterDescription
aFileNameName of the file containing the instrument.
aFileBankIdIdentifier of the bank in the file from which to load the instrument, occupying no more than 14 bits.
aFileInstrumentIdIdentifier of the instrument to load. 0 <= aInstrumentId <= 127.
aMemoryBankIdIdentifier of the custom bank in memory to load the instrument into, occupying no more than 14 bits.
aMemoryInstrumentIdIdentifier of the instrument in memory to load the new instrument into. 0 <= aInstrumentId <= 127.

Returns: One of the system-wide error codes.

LoadCustomInstrumentData ( const TDesC8 &, TInt, TInt, TInt, TInt )

IMPORT_C TIntLoadCustomInstrumentData(const TDesC8 &aInstrumentData,
TIntaBankDataId,
TIntaInstrumentDataId,
TIntaMemoryBankId,
TIntaMemoryInstrumentId
)

Loads an individual instrument from descriptor into custom sound bank memory for use. The bank and instrument id given in the descriptor can be mapped into different bank and instrument id in memory.

ParameterDescription
aInstrumentDataDescriptor containing the instrument.
aBankDataIdIdentifier of the bank in the descriptor from which to load the instrument, occupying no more than 14 bits.
aInstrumentDataIdIdentifier of the instrument to load. 0 <= aInstrumentId <= 127.
aMemoryBankIdIdentifier of the custom bank in memory to load the instrument into, occupying no more than 14 bits.
aMemoryInstrumentIdIdentifier of the instrument in memory to load the new instrument into. 0 <= aInstrumentId <= 127.

Returns: One of the system-wide error codes.

MaxChannelVolume ( TReal32 & )

IMPORT_C TIntMaxChannelVolume(TReal32 &aMaxVol)const

Gets the Maximum volume setting that may be applied to a logical channel.

ParameterDescription
aMaxVolMaximum volume setting. Minimum value is -infinity dB, which is the smallest possible value that TReal32 supports.

Returns: One of the system-wide error codes.

MaxPlaybackRate ( TInt & )

IMPORT_C TIntMaxPlaybackRate(TInt &aMaxRate)const

Gets the maximum playback rate in milli-percentage from the MIDI engine.

See also: SetPlaybackRate() for milli-percentage details.

ParameterDescription
aMaxRatePlayback rate supported by MIDI player.

Returns: One of the system-wide error codes.

MaxPolyphony ( TInt & )

IMPORT_C TIntMaxPolyphony(TInt &aNumNotes)const

Gets the current maximum number of notes the engine can handle This can be greater than the value returned by RMidiControllerCustomCommands::Polyphony

ParameterDescription
aNumNotesThe maximum number of notes the engine can handle

Returns: One of the system-wide error codes.

MaxVolume ( TInt & )

IMPORT_C TIntMaxVolume(TInt &aMaxVolume)const

Maximum volume setting that may be applied overall.

ParameterDescription
aMaxVolumeMaximum volume setting. Minimum value is always zero which is silent.

Returns: One of the system-wide error codes.

MimeType ( TDes8 & )

IMPORT_C TIntMimeType(TDes8 &aMimeType)const

Gets the MIME type of the MIDI resource currently open.

ParameterDescription
aMimeTypeDescriptor containing the MIDI mime type.

Returns: One of the system-wide error codes.

MinPlaybackRate ( TInt & )

IMPORT_C TIntMinPlaybackRate(TInt &aMinRate)const

Gets the minimum playback rate in milli-percentage from the MIDI engine.

See also: SetPlaybackRate() for milli-percentage details.

ParameterDescription
aMinRateMinimum playback rate supported by MIDI player.

Returns: One of the system-wide error codes.

NoteOff ( TInt, TInt, TInt )

IMPORT_C TIntNoteOff(TIntaChannel,
TIntaNote,
TIntaVelocity
)

Synchronous function to terminate playback of a note. If no corresponding note is found then no error is raised.

ParameterDescription
aChannelLogical channel on which the note is playing. 0 <= aChannel <= 15.
aNoteNote to terminate. 0 <= aNote <= 127.
aVelocityVelocity with which to stop the note. 0 <= aVelocity <= 127. There is no standard behaviour corresponding with note off velocity.

Returns: One of the system-wide error codes.

NoteOn ( TInt, TInt, TInt )

IMPORT_C TIntNoteOn(TIntaChannel,
TIntaNote,
TIntaVelocity
)

Synchronous function to commence playback of a note. Multiple calls to this function will be accommodated as far as the MIDI engine can manage.

ParameterDescription
aChannelLogical channel to play note on. 0 <= aChannel <= 15.
aNoteNote to play. 0 <= aNote <= 127.
aVelocityVelocity with which to start the note. The legal integer range is 0 <= aVelocity <= 127, but the value zero actually causes the message to be interpreted as a Note Off message instead of a Note On.

Returns: One of the system-wide error codes.

NumTracks ( TInt & )

IMPORT_C TIntNumTracks(TInt &aTracks)const

Gets the number of tracks present in the currently open MIDI resource.

ParameterDescription
aTracksNumber of tracks.

Returns: One of the system-wide error codes.

NumberOfBanks ( TBool, TInt & )

IMPORT_C TIntNumberOfBanks(TBoolaCustom,
TInt &aNumBanks
)const

Gets the number of standard or custom sound banks currently available.

ParameterDescription
aCustomSpecifies whether to reference a custom or standard sound bank.
aNumBanksNumber of custom or standard sound banks available.

Returns: One of the system-wide error codes.

NumberOfInstruments ( TInt, TBool, TInt & )

IMPORT_C TIntNumberOfInstruments(TIntaBankId,
TBoolaCustom,
TInt &aNumInstruments
)const

Gets the number of instruments available in a given sound bank.

ParameterDescription
aBankIdIdentifier of sound bank to reference, occupying no more than 14 bits.
aCustomSpecifies whether to reference a custom or standard sound bank.
aNumInstrumentsCount of the number of instruments available for the specified sound bank.

Returns: One of the system-wide error codes.

PercussionKeyNameL ( TInt, TInt, TBool, TInt )

IMPORT_C HBufC *PercussionKeyNameL(TIntaNote,
TIntaBankId,
TBoolaCustom,
TIntaInstrumentId
)const

Gets the name of a particular percussion key corresponding to a given note.

ParameterDescription
aNoteNote to query. 0 <= aNote <= 127.
aBankIdIdentifier of the bank that the instrument belongs to, occupying no more than 14 bits. The bank ID is a concatenation of MIDI bank MSB and LSB values.
aCustomSpecifies whether to reference a custom or standard sound bank.
aInstrumentIdIdentifier of an instrument.

Returns: Descriptor containing the name of the percussion key. If the key does not have a name then an empty descriptor is returned.

PitchTranspositionCents ( TInt & )

IMPORT_C TIntPitchTranspositionCents(TInt &aPitch)const

Gets the pitch shift in use for the currently open MIDI resource.

ParameterDescription
aPitchShift in cents, i.e. semitones * 100. One octave equals 1200 cents.

Returns: One of the system-wide error codes.

PlayNote ( TInt, TInt, const TTimeIntervalMicroSeconds &, TInt, TInt )

IMPORT_C TIntPlayNote(TIntaChannel,
TIntaNote,
const TTimeIntervalMicroSeconds &aDuration,
TIntaNoteOnVelocity,
TIntaNoteOffVelocity
)

Synchronous function to play a single note. Multiple calls to this function will be accommodated as far as the MIDI engine can manage. The same functionality could be implemented using the SendMessage function.

ParameterDescription
aChannelLogical channel to play note on. 0 <= aChannel <= 15.
aNoteNote to play. 0 <= aNote <= 127
aDurationLength of time to play note for.
aNoteOnVelocityVelocity with which to start the note. 0 <= aNoteOnVelocity <= 127.
aNoteOffVelocityVelocity with which to stop the note. 0 <= aNoteOffVelocity <= 127.

Returns: One of the system-wide error codes.

PlayNote ( TInt, TInt, const TTimeIntervalMicroSeconds &, const TTimeIntervalMicroSeconds &, TInt, TInt )

IMPORT_C TIntPlayNote(TIntaChannel,
TIntaNote,
const TTimeIntervalMicroSeconds &aStartTime,
const TTimeIntervalMicroSeconds &aDuration,
TIntaNoteOnVelocity,
TIntaNoteOffVelocity
)

Synchronous function to play a single note at a specified time. Multiple calls to this function will be accommodated as far as the MIDI engine can manage. The same functionality could be implemented using the SendMessage function.

ParameterDescription
aChannelLogical channel to play note on. 0 <= aChannel <= 15.
aNoteNote to play. 0 <= aNote <= 127
aStartTimeSpecifies the time at which to start playing the note, relative to the MIDI resource playing time or the time elapsed since Play() was called if no resource is present.
aDurationLength of time to play note for.
aNoteOnVelocityVelocity with which to start the note. 0 <= aNoteOnVelocity <= 127.
aNoteOffVelocityVelocity with which to stop the note. 0 <= aNoteOffVelocity <= 127.

Returns: One of the system-wide error codes.

PlaybackRate ( TInt & )

IMPORT_C TIntPlaybackRate(TInt &aPlayBackRate)const

Gets the current playback rate factor of the currently open MIDI resource. The playback rate is independent from tempo, i.e., it can be used to give an overall speed factor for playback.

ParameterDescription
aPlayBackRateCurrent playback rate in percent times 1000, i.e., 100000 means original playback speed, 200000 means double speed, and 50000 means half speed playback.

Returns: One of the system-wide error codes.

Polyphony ( TInt & )

IMPORT_C TIntPolyphony(TInt &aNumNotes)const

Gets the polyphony of the MIDI engine.

ParameterDescription
aNumNotesThe number of currently active voices.

Returns: One of the system-wide error codes.

PositionMicroBeats ( TInt64 & )

IMPORT_C TIntPositionMicroBeats(TInt64 &aMicroBeats)const

Gets the current metrical position of the MIDI resource being played.

ParameterDescription
aMicroBeats(BPM*1000000) relative to the start of the resource.

Returns: One of the system-wide error codes.

ReceiveEvents ( TPckgBuf< TInt > &, TRequestStatus & )

IMPORT_C voidReceiveEvents(TPckgBuf< TInt > &aEventSize,
TRequestStatus &aStatus
)

Start receiving events from the controller. This can only be called once the controller is open.

ParameterDescription
aEventSizeThe size of the MIDI event object.
aStatusStatus flag belonging to an active object that will have it's RunL() called when this request complete.

RetrieveEvent ( TDes8 & )

IMPORT_C TIntRetrieveEvent(TDes8 &aMidiEventPckg)

Get the MIDI event from the MIDI controller.

ParameterDescription
aMidiEventPckgMIDI event.

Returns: One of the system-wide error codes.

SendMessage ( const TDesC8 &, TInt & )

IMPORT_C TIntSendMessage(const TDesC8 &aMidiMessage,
TInt &aBytes
)

Sends a single MIDI message to the MIDI engine.

ParameterDescription
aMidiMessageDescriptor containing the MIDI message data. If there are several MIDI messages in the buffer, only the first one is processed.
aBytesNumber of bytes of the message buffer actually processed.

Returns: One of the system-wide error codes.

SendMessage ( const TDesC8 &, const TTimeIntervalMicroSeconds &, TInt & )

IMPORT_C TIntSendMessage(const TDesC8 &aMidiMessage,
const TTimeIntervalMicroSeconds &aTime,
TInt &aBytes
)

Sends a single MIDI message, with time stamp, to the MIDI engine.

ParameterDescription
aMidiMessageDescriptor containing the MIDI message data. If there are several MIDI messages in the buffer, only the first one is processed.
aTimeThe time at which to execute the message, relative to the MIDI resource playing time or the time elapsed since Play() was called if no resource is present.
aBytesNumber of bytes of the message buffer actually processed.

Returns: One of the system-wide error codes.

SendMipMessage ( const RArray< TMipMessageEntry > & )

IMPORT_C TIntSendMipMessage(const RArray< TMipMessageEntry > &aEntry)

Sends a mip message to the MIDI engine. This is a convenience function, because the same functionality could be achieved with the SendMessage() function.

ParameterDescription
aEntryArray of logical {channel, MIP} value pairs to send, highest priority first.

Returns: One of the system-wide error codes.

SetBalance ( TInt )

IMPORT_C TIntSetBalance(TIntaBalance)

Set the current stereo balance value.

ParameterDescription
aBalanceBalance value to set. Defaults to KMMFBalanceCenter to restore equal left-right balance.

Returns: One of the system-wide error codes.

SetBank ( TBool )

IMPORT_C TIntSetBank(TBoolaCustom)

Tell the MIDI engine to use a custom bank or a standard bank.

ParameterDescription
aCustomIf Etrue the custom bank in memory is used otherwise the standard bank is used leaving the custom bank in memory.

Returns: One of the system-wide error codes.

SetChannelMute ( TInt, TBool )

IMPORT_C TIntSetChannelMute(TIntaChannel,
TBoolaMuted
)

Set the muting state of a channel without changing its volume setting. When unmuted the channel goes back to its previous volume setting.

ParameterDescription
aChannelLogical channel to set the mute state of. 0 <= aChannel <= 15.
aMutedETrue to mute the channel, EFalse to unmute it.

Returns: One of the system-wide error codes.

SetChannelVolume ( TInt, TReal32 )

IMPORT_C TIntSetChannelVolume(TIntaChannel,
TReal32aVolume
)

Set the volume of a channel.

ParameterDescription
aChannelLogical channel to set the volume on. 0 <= aChannel <= 15.
aVolumeThe channel volume can be set within a range. The minimum channel volume is -infinity dB, which is the smallest possible value that TReal32 supports while the maximum channel volume is set via MaxVolumeL() which represents the volume level in dB corresponding to the MIDI Channel Volume controller.

Returns: One of the system-wide error codes.

SetInstrument ( TInt, TInt, TInt )

IMPORT_C TIntSetInstrument(TIntaChannel,
TIntaBankId,
TIntaInstrumentId
)

Sets a logical channel to use the given instrument.

ParameterDescription
aChannelLogical channel to set the instrument for. 0 <= aChannel <= 15.
aBankIdIdentifier of the bank that the instrument belongs to, occupying no more than 14 bits. The bank ID is a concatenation of MIDI bank MSB and LSB values.
aInstrumentIdIdentifier of the instrument under scrutiny. 0 <= aInstrumentId <= 127.

Returns: One of the system-wide error codes.

SetMaxPolyphony ( TInt )

IMPORT_C TIntSetMaxPolyphony(TIntaMaxNotes)

Set the max polyphony the engine can handle.

ParameterDescription
aMaxNotesMax polyphony level, 1 <= Polyphony() <= aMaxNotes.

Returns: One of the system-wide error codes.

SetPitchTransposition ( TInt, TInt & )

IMPORT_C TIntSetPitchTransposition(TIntaCents,
TInt &aCentsApplied
)

Sets the pitch shift to apply to the currently open MIDI resource. May be called during playback.

ParameterDescription
aCentsPitch shift in cents, i.e. semitones * 100. One octave equals 1200 cents.
aCentsAppliedActual pitch shift applied - may differ from the requested value due to limitations of the MIDI engine.

Returns: One of the system-wide error codes.

SetPlaybackRate ( TInt )

IMPORT_C TIntSetPlaybackRate(TIntaPlayBackRate)

Sets the playback rate for the playback of the current MIDI resource. The playback rate is independent from tempo, i.e., it can be used to give an overall speed factor for playback. May be called whether playback is in progress or not.

ParameterDescription
aPlayBackRatePlayback rate in percent times 1000, i.e., 100000 means original playback speed, 200000 means double speed, and 50000 means half speed playback.

Returns: One of the system-wide error codes.

SetPositionMicroBeats ( TInt64 )

IMPORT_C TIntSetPositionMicroBeats(TInt64aMicroBeats)const

Change the position of the currently playing MIDI resource to the given position. May be called whenever a MIDI resource is open.

ParameterDescription
aMicroBeatsMetrical position to move to. Clamped to (0, DurationMicroBeats()).

Returns: One of the system-wide error codes.

SetRepeats ( TInt, const TTimeIntervalMicroSeconds & )

IMPORT_C TIntSetRepeats(TIntaRepeatNumberOfTimes,
const TTimeIntervalMicroSeconds &aTrailingSilence
)

Set the number of times to repeat the current MIDI resource. After Stop() has been called, repeat number of times and the trailing silence are reset.

ParameterDescription
aRepeatNumberOfTimesNumber of times to repeat the resource during playback. This includes the first playing.
aTrailingSilenceTime in microseconds to pause between repeats.

Returns: One of the system-wide error codes.

SetStopTime ( const TTimeIntervalMicroSeconds & )

IMPORT_C TIntSetStopTime(const TTimeIntervalMicroSeconds &aStopTime)const

Sets the stop time to use for the currently open MIDI resource

ParameterDescription
aStopTimeTime at which playback will stop, relative to the start of the resource. Clamped to 0 and the duration of the resource.

Returns: One of the system-wide error codes.

SetSyncUpdateCallbackInterval ( const TTimeIntervalMicroSeconds &, TInt64 )

IMPORT_C TIntSetSyncUpdateCallbackInterval(const TTimeIntervalMicroSeconds &aMicroSeconds,
TInt64aMicroBeats = 0
)

Sets the frequency at which MMIDIClientUtilityObserver::MmcuoSyncUpdateL() is called to allow other components to synchronise with playback of this MIDI resource.

ParameterDescription
aMicroSecondsTemporal interval to callback at. Used in preference to aMicroBeats if both are set.
aMicroBeatsMetrical interval to callback at. Set both parameters to zero to cancel.

Returns: One of the system-wide error codes.

SetTempo ( TInt )

IMPORT_C TIntSetTempo(TIntaMicroBeatsPerMinute)

Sets the tempo at which the current MIDI resource should be played. May be called whether playback is in progress or not. The tempo is independent from the playback rate, i.e., the resulting playback speed will be affected by both.

ParameterDescription
aMicroBeatsPerMinuteTempo in microbeats per minute (BPM*1000000) to set.

Returns: One of the system-wide error codes.

SetTrackMute ( TInt, TBool )

IMPORT_C TIntSetTrackMute(TIntaTrack,
TBoolaMuted
)const

Mutes or unmutes a particular track.

ParameterDescription
aTrackIndex of the track to mute - 0 <= aTrack < NumTracksL().
aMutedETrue to mute the track, EFalse to unmute it.

Returns: One of the system-wide error codes.

SetVolume ( TInt )

IMPORT_C TIntSetVolume(TIntaVolume)

Set the overall volume of the MIDI client. This setting scales all channel volumes respectively so the actual volume that a channel is played at is (overall volume * channel volume / max volume).

ParameterDescription
aVolumeOverall volume setting to use.

Returns: One of the system-wide error codes.

SetVolumeRamp ( const TTimeIntervalMicroSeconds & )

IMPORT_C TIntSetVolumeRamp(const TTimeIntervalMicroSeconds &aRampDuration)

Length of time over which the volume is faded up from zero to the current setting when playback is started.

ParameterDescription
aRampDurationDuration of the ramping period.

Returns: One of the system-wide error codes.

Stop ( const TTimeIntervalMicroSeconds & )

IMPORT_C TIntStop(const TTimeIntervalMicroSeconds &aFadeOutDuration)

Stops playback of a resource but does not change the current position or release any resources. Pauses the internal timer if no resource is open.

ParameterDescription
aFadeOutDurationLength of time over which the volume is faded out from the current setting to zero.

Returns: One of the system-wide error codes.

StopNotes ( TInt )

IMPORT_C TIntStopNotes(TIntaChannel)

Stops the playback of all notes on the given channel, by means of an All Notes Off MIDI message.

ParameterDescription
aChannelLogical channel to stop notes on. 0 <= aChannel <= 15.

Returns: One of the system-wide error codes.

StopTime ( TTimeIntervalMicroSeconds & )

IMPORT_C TIntStopTime(TTimeIntervalMicroSeconds &aStopTime)const

Get the stop time currently set for the MIDI resource.

ParameterDescription
aStopTimeTime at which playback will stop, relative to the start of the resource.

Returns: One of the system-wide error codes.

TempoMicroBeatsPerMinute ( TInt & )

IMPORT_C TIntTempoMicroBeatsPerMinute(TInt &aMicroBeatsPerMinute)const

Gets the current tempo of the currently open MIDI resource. The tempo is independent from the playback rate, i.e., the resulting playback speed will be affected by both.

ParameterDescription
aMicroBeatsPerMinuteTempo at the current position of the currently open resource in microbeats per minute, i.e. BPM * 1000000. Filled in by the controller framework.

Returns: One of the system-wide error codes.

UnloadAllCustomBanks ( )

IMPORT_C TIntUnloadAllCustomBanks()

Removes all custom sound banks from memory.

Returns: One of the system-wide error codes.

UnloadCustomBank ( TInt )

IMPORT_C TIntUnloadCustomBank(TIntaBankId)

Removes a custom sound bank from memory. Only valid for sound banks previously loaded from file. Once unloaded the custom sound bank is no longer available for use.

ParameterDescription
aBankIdIdentifier of the custom sound bank to unload,occupying no more than 14 bits.

Returns: One of the system-wide error codes.

UnloadCustomInstrument ( TInt, TInt )

IMPORT_C TIntUnloadCustomInstrument(TIntaCustomBankId,
TIntaInstrumentId
)

Removes an instrument from custom sound bank memory. Only valid for instruments previously loaded from file. Once unloaded the instrument is no longer available for use.

ParameterDescription
aCustomBankIdIdentifier of the custom sound bank containing the instrument to unload, occupying no more than 14 bits.
aInstrumentIdIdentifier of the instrument to unload. 0 <= aInstrumentId <= 127.

Returns: One of the system-wide error codes.

Volume ( TInt & )

IMPORT_C TIntVolume(TInt &aVolume)const

Gets the overall volume of the MIDI client.

ParameterDescription
aVolumeThe current overall volume setting.

Returns: One of the system-wide error codes.