NiCMidi 1.1.0
A MIDI library derived from J.D.Koftinoff jdksmidi
MIDIProcessorTransposer Class Reference

A MIDIProcessor which shifts the pitch of MIDI note and polyphonic pressure messages by a given amount of semitones. More...

#include <processor.h>

Inheritance diagram for MIDIProcessorTransposer:
MIDIProcessor

Public Member Functions

 MIDIProcessorTransposer ()
 The constructor. More...
 
virtual void Reset ()
 Resets to the default status (no transposing on all channels). More...
 
int GetChannelTranspose (int chan) const
 Gets the transposing amount (in semitones) for the given channel. More...
 
void SetChannelTranspose (int chan, int trans)
 Sets the transposing amount. More...
 
void SetAllTranspose (int trans)
 Sets the same transposing amount (in semitones) for all the channels. More...
 
virtual bool Process (MIDITimedMessage *msg)
 The process() method. More...
 
- Public Member Functions inherited from MIDIProcessor
 MIDIProcessor ()
 The constructor. More...
 
virtual ~MIDIProcessor ()
 The destructor. More...
 

Detailed Description

A MIDIProcessor which shifts the pitch of MIDI note and polyphonic pressure messages by a given amount of semitones.

You can set a different amount for each channel, or the same amount for all the channels.

Constructor & Destructor Documentation

◆ MIDIProcessorTransposer()

MIDIProcessorTransposer::MIDIProcessorTransposer ( )

The constructor.

Member Function Documentation

◆ Reset()

virtual void MIDIProcessorTransposer::Reset ( )
virtual

Resets to the default status (no transposing on all channels).

Implements MIDIProcessor.

◆ GetChannelTranspose()

int MIDIProcessorTransposer::GetChannelTranspose ( int  chan) const
inline

Gets the transposing amount (in semitones) for the given channel.

See Numbering conventions

◆ SetChannelTranspose()

void MIDIProcessorTransposer::SetChannelTranspose ( int  chan,
int  trans 
)
inline

Sets the transposing amount.

Parameters
chanthe channel to be transposed. See Numbering conventions
transThe amount of transposing in semitones

◆ SetAllTranspose()

void MIDIProcessorTransposer::SetAllTranspose ( int  trans)

Sets the same transposing amount (in semitones) for all the channels.

◆ Process()

virtual bool MIDIProcessorTransposer::Process ( MIDITimedMessage msg)
virtual

The process() method.

It affects only Note on, Note off and Poly pressure messages, changing their note number according to the transposing amount. If the resulting note number is not in the MIDI range (0 ... 127) the message is left unchanged and the method returns false, otherwise it returns true.

Implements MIDIProcessor.


The documentation for this class was generated from the following file: