GUIDOLib  1.6.8
A Music Score Rendering Engine
Classes | Typedefs | Enumerations | Functions | Variables
Piano-roll API

Classes

struct  LimitParams
 A struct to set a piano roll boundaries in time and in pitch. More...
 

Typedefs

typedef struct LimitParams LimitParams
 A struct to set a piano roll boundaries in time and in pitch. More...
 

Enumerations

enum  PianoRollType { kSimplePianoRoll, kTrajectoryPianoRoll }
 PianoRollType. More...
 

Functions

PianoRoll * GuidoAR2PianoRoll (PianoRollType type, ARHandler arh)
 Creates a new piano roll from AR, corresponding to type : simplePianoRoll -> basic piano roll trajectoryPianoRoll -> every event is graphically linked to the previous one. More...
 
PianoRoll * GuidoMidi2PianoRoll (PianoRollType type, const char *midiFileName)
 Creates a new piano roll from Midi, corresponding to type : simplePianoRoll -> basic piano roll trajectoryPianoRoll -> every event is graphically linked to the previous one. More...
 
GuidoErrCode GuidoDestroyPianoRoll (PianoRoll *pr)
 Destroys a guido piano roll and releases all the associated ressources. More...
 
GuidoErrCode GuidoPianoRollSetLimits (PianoRoll *pr, LimitParams limitParams)
 Sets limits to a piano roll (start/end date, lower/higher pitch) More...
 
GuidoErrCode GuidoPianoRollEnableKeyboard (PianoRoll *pr, bool enabled)
 Enables keyboard or not (not enabled by default) More...
 
GuidoErrCode GuidoPianoRollGetKeyboardWidth (PianoRoll *pr, int height, float &keyboardWidth)
 Gets the piano roll keyboard width. More...
 
GuidoErrCode GuidoPianoRollEnableAutoVoicesColoration (PianoRoll *pr, bool enabled)
 Enables or not the automatic voices coloration (not enabled by default) (not for a midi rendering) // REM: � voir If a color is manually set with GuidoPianoRollSetColorToVoice, automatic color will not be applied for this voice. More...
 
GuidoErrCode GuidoPianoRollSetRGBColorToVoice (PianoRoll *pr, int voiceNum, int r, int g, int b, int a)
 Sets a RGB color to a voice (first voice is number 1) (black by default) More...
 
GuidoErrCode GuidoPianoRollSetHtmlColorToVoice (PianoRoll *pr, int voiceNum, long color)
 Sets a html color to a voice (first voice is number 1) (black by default) More...
 
GuidoErrCode GuidoPianoRollRemoveColorToVoice (PianoRoll *pr, int voiceNum)
 remove a color to a voice (first voice is number 1) (black by default) More...
 
GuidoErrCode GuidoPianoRollEnableMeasureBars (PianoRoll *pr, bool enabled)
 Enables or not measure bars (false by default) More...
 
GuidoErrCode GuidoPianoRollSetPitchLinesDisplayMode (PianoRoll *pr, int mode)
 Sets the pitch lines display mode (automatic by default). Use Pitch lines display mode constants to pick lines which will be be displayed. Example : "kCLine + kGLine" will displayed C and G line. "kNoLine" doesn't display any line. "kAutoLines" adjust line display according to piano roll pitch range (automatic possibilities : no line, C line, C and G line, chromatic scale, diatonic scale);. More...
 
GuidoErrCode GuidoPianoRollGetMap (const PianoRoll *pr, int width, int height, Time2GraphicMap &outmap)
 Gets the piano roll map. More...
 
GuidoErrCode GuidoPianoRollOnDraw (PianoRoll *pr, int width, int height, VGDevice *dev)
 Draw the piano roll on a VGDevice. More...
 

Variables

const int kCLine = 1
 Pitch lines display mode. More...
 
const int kCSharpLine = 1<<1
 
const int kDLine = 1<<2
 
const int kDSharpLine = 1<<3
 
const int kELine = 1<<4
 
const int kFLine = 1<<5
 
const int kFSharpLine = 1<<6
 
const int kGLine = 1<<7
 
const int kGSharpLine = 1<<8
 
const int kALine = 1<<9
 
const int kASharpLine = 1<<10
 
const int kBLine = 1<<11
 
const int kAutoLines = 0
 
const int kNoLine = -1
 

Detailed Description

Typedef Documentation

◆ LimitParams

typedef struct LimitParams LimitParams

A struct to set a piano roll boundaries in time and in pitch.

Enumeration Type Documentation

◆ PianoRollType

PianoRollType.

Enumerator
kSimplePianoRoll 
kTrajectoryPianoRoll 

Function Documentation

◆ GuidoAR2PianoRoll()

PianoRoll* GuidoAR2PianoRoll ( PianoRollType  type,
ARHandler  arh 
)

Creates a new piano roll from AR, corresponding to type : simplePianoRoll -> basic piano roll trajectoryPianoRoll -> every event is graphically linked to the previous one.

Parameters
typethe piano roll type
arhan AR handler
Returns
a guido piano roll.

◆ GuidoDestroyPianoRoll()

GuidoErrCode GuidoDestroyPianoRoll ( PianoRoll *  pr)

Destroys a guido piano roll and releases all the associated ressources.

Parameters
pra pianoroll previously created with GuidoAR2PianoRoll or GuidoMidi2PianoRoll
Returns
a Guido error code

◆ GuidoMidi2PianoRoll()

PianoRoll* GuidoMidi2PianoRoll ( PianoRollType  type,
const char *  midiFileName 
)

Creates a new piano roll from Midi, corresponding to type : simplePianoRoll -> basic piano roll trajectoryPianoRoll -> every event is graphically linked to the previous one.

Parameters
typethe piano roll type
midiFileNamea midi file name
Returns
a guido piano roll.

◆ GuidoPianoRollEnableAutoVoicesColoration()

GuidoErrCode GuidoPianoRollEnableAutoVoicesColoration ( PianoRoll *  pr,
bool  enabled 
)

Enables or not the automatic voices coloration (not enabled by default) (not for a midi rendering) // REM: � voir If a color is manually set with GuidoPianoRollSetColorToVoice, automatic color will not be applied for this voice.

Parameters
pra pianoroll previously created with GuidoAR2PianoRoll
enableda boolean corresponding to the color state
Returns
a Guido error code

◆ GuidoPianoRollEnableKeyboard()

GuidoErrCode GuidoPianoRollEnableKeyboard ( PianoRoll *  pr,
bool  enabled 
)

Enables keyboard or not (not enabled by default)

Parameters
pra pianoroll previously created with GuidoAR2PianoRoll or GuidoMidi2PianoRoll
enableda boolean corresponding to the keyboard draw state
Returns
a Guido error code

◆ GuidoPianoRollEnableMeasureBars()

GuidoErrCode GuidoPianoRollEnableMeasureBars ( PianoRoll *  pr,
bool  enabled 
)

Enables or not measure bars (false by default)

Parameters
pra pianoroll previously created with GuidoAR2PianoRoll or GuidoMidi2PianoRoll
enableda boolean corresponding to the measure bars draw state
Returns
a Guido error code

◆ GuidoPianoRollGetKeyboardWidth()

GuidoErrCode GuidoPianoRollGetKeyboardWidth ( PianoRoll *  pr,
int  height,
float &  keyboardWidth 
)

Gets the piano roll keyboard width.

Parameters
pra pianoroll previously created with GuidoAR2PianoRoll or GuidoMidi2PianoRoll
heightthe height of the canvas (-1 to set the default height : 512)
keyboardWidththe pianoroll keyboard width
Returns
a Guido error code

◆ GuidoPianoRollGetMap()

GuidoErrCode GuidoPianoRollGetMap ( const PianoRoll *  pr,
int  width,
int  height,
Time2GraphicMap outmap 
)

Gets the piano roll map.

Parameters
pra pianoroll previously created with GuidoAR2PianoRoll or GuidoMidi2PianoRoll
widththe width of the piano roll (-1 to set the default width : 1024)
heightthe height of the canvas (-1 to set the default height : 512)
outmapon output: a time to graphic map
Returns
a Guido error code (returns guidoErrBadParameter if keyboard width is higher than width param)

◆ GuidoPianoRollOnDraw()

GuidoErrCode GuidoPianoRollOnDraw ( PianoRoll *  pr,
int  width,
int  height,
VGDevice dev 
)

Draw the piano roll on a VGDevice.

Parameters
pra pianoroll previously created with GuidoAR2PianoRoll or GuidoMidi2PianoRoll
widththe width on which piano roll will be drawn (-1 to set the default width : 1024)
heightthe height on which piano roll will be drawn (-1 to set the default height : 512)
devthe device on which piano will be drawn
Returns
a Guido error code (returns guidoErrBadParameter if keyboard width is higher than width param)

◆ GuidoPianoRollRemoveColorToVoice()

GuidoErrCode GuidoPianoRollRemoveColorToVoice ( PianoRoll *  pr,
int  voiceNum 
)

remove a color to a voice (first voice is number 1) (black by default)

Parameters
pra pianoroll previously created with GuidoAR2PianoRoll or GuidoMidi2PianoRoll
voiceNumthe voice number (first voice is number 1)
Returns
a Guido error code

◆ GuidoPianoRollSetHtmlColorToVoice()

GuidoErrCode GuidoPianoRollSetHtmlColorToVoice ( PianoRoll *  pr,
int  voiceNum,
long  color 
)

Sets a html color to a voice (first voice is number 1) (black by default)

Parameters
pra pianoroll previously created with GuidoAR2PianoRoll or GuidoMidi2PianoRoll
voiceNumthe voice number (first voice is number 1)
colorthe html color (constants are defined in Colors.h)
Returns
a Guido error code

◆ GuidoPianoRollSetLimits()

GuidoErrCode GuidoPianoRollSetLimits ( PianoRoll *  pr,
LimitParams  limitParams 
)

Sets limits to a piano roll (start/end date, lower/higher pitch)

Parameters
pra pianoroll previously created with GuidoAR2PianoRoll or GuidoMidi2PianoRoll
limitParamsthe structure containing limits : start date (GuidoDate) (0/0 to adjust automatically start date to the score's start date) end date (GuidoDate) (0/0 to adjust automatically end date to the score's end date) minimal pitch (midi notation) (-1 to adjust automatically min pitch to the score's minimal pitch) maximal pitch (midi notation) (-1 to adjust automatically max pitch to the score's maximal pitch) Remark : minimal range pitch accepted is 1 octave.
Returns
a Guido error code

◆ GuidoPianoRollSetPitchLinesDisplayMode()

GuidoErrCode GuidoPianoRollSetPitchLinesDisplayMode ( PianoRoll *  pr,
int  mode 
)

Sets the pitch lines display mode (automatic by default). Use Pitch lines display mode constants to pick lines which will be be displayed. Example : "kCLine + kGLine" will displayed C and G line. "kNoLine" doesn't display any line. "kAutoLines" adjust line display according to piano roll pitch range (automatic possibilities : no line, C line, C and G line, chromatic scale, diatonic scale);.

Parameters
pra pianoroll previously created with GuidoAR2PianoRoll or GuidoMidi2PianoRoll
modean int corresponding to the pitch lines display mode
Returns
a Guido error code

◆ GuidoPianoRollSetRGBColorToVoice()

GuidoErrCode GuidoPianoRollSetRGBColorToVoice ( PianoRoll *  pr,
int  voiceNum,
int  r,
int  g,
int  b,
int  a 
)

Sets a RGB color to a voice (first voice is number 1) (black by default)

Parameters
pra pianoroll previously created with GuidoAR2PianoRoll or GuidoMidi2PianoRoll
voiceNumthe voice number (first voice is number 1)
rthe red param of RGB color
gthe green param of RGB color
bthe blue param of RGB color
athe alpha param of RGB color
Returns
a Guido error code

Variable Documentation

◆ kALine

const int kALine = 1<<9

◆ kASharpLine

const int kASharpLine = 1<<10

◆ kAutoLines

const int kAutoLines = 0

◆ kBLine

const int kBLine = 1<<11

◆ kCLine

const int kCLine = 1

Pitch lines display mode.

◆ kCSharpLine

const int kCSharpLine = 1<<1

◆ kDLine

const int kDLine = 1<<2

◆ kDSharpLine

const int kDSharpLine = 1<<3

◆ kELine

const int kELine = 1<<4

◆ kFLine

const int kFLine = 1<<5

◆ kFSharpLine

const int kFSharpLine = 1<<6

◆ kGLine

const int kGLine = 1<<7

◆ kGSharpLine

const int kGSharpLine = 1<<8

◆ kNoLine

const int kNoLine = -1

Guido Project Copyright © 2019 Grame-CNCM