GUIDOLib  1.7.7
A Music Score Rendering Engine
Functions | Variables
Guido Piano Roll Adapter

A C++ interface to the GUIDOPianoRoll API. More...

Functions

virtual ~GUIDOPianoRollAdapter ()
 
PianoRoll * ar2PianoRoll (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 * midi2PianoRoll (PianoRollType type, const std::string &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 destroyPianoRoll (PianoRoll *pr)
 Destroys a guido piano roll and releases all the associated ressources. More...
 
GuidoErrCode setLimits (PianoRoll *pr, LimitParams &limitParams)
 Sets limits to a piano roll (start/end date, lower/higher pitch) More...
 
GuidoErrCode enableKeyboard (PianoRoll *pr, bool enabled)
 Enables keyboard or not (not enabled by default) More...
 
float getKeyboardWidth (PianoRoll *pr, int height)
 Gets the piano roll keyboard width. More...
 
GuidoErrCode enableAutoVoicesColoration (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 setColorToVoice, automatic color will not be applied for this voice. More...
 
GuidoErrCode setRGBColorToVoice (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 setHtmlColorToVoice (PianoRoll *pr, int voiceNum, long color)
 Sets a html color to a voice (first voice is number 1) (black by default) More...
 
GuidoErrCode setColorToVoice (PianoRoll *pr, int voiceNum, const std::string &color)
 Sets a html color to a voice (first voice is number 1) (black by default) More...
 
GuidoErrCode removeColorToVoice (PianoRoll *pr, int voiceNum)
 remove a color to a voice (first voice is number 1) (black by default) More...
 
GuidoErrCode enableMeasureBars (PianoRoll *pr, bool enabled)
 Enables or not measure bars (false by default) More...
 
GuidoErrCode setPitchLinesDisplayMode (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...
 
Time2GraphicMap getMap (PianoRoll *pr, int width, int height)
 Gets the piano roll map. More...
 
GuidoErrCode onDraw (PianoRoll *pr, int width, int height, VGDevice *dev)
 Draw the piano roll on a VGDevice. More...
 
std::string svgExport (PianoRoll *pr, int width, int height)
 svgExport Draw the piano roll on SVG device and return the xml string. More...
 

Variables

class_export GUIDOPianoRollAdapter
 

Detailed Description

A C++ interface to the GUIDOPianoRoll API.

A C++ class to manupilate Piano roll.

Function Documentation

◆ ar2PianoRoll()

PianoRoll* ar2PianoRoll ( 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.

◆ destroyPianoRoll()

GuidoErrCode destroyPianoRoll ( PianoRoll *  pr)

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

Parameters
pra pianoroll previously created with ar2PianoRoll or midi2PianoRoll
Returns
a Guido error code

◆ enableAutoVoicesColoration()

GuidoErrCode enableAutoVoicesColoration ( 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 setColorToVoice, automatic color will not be applied for this voice.

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

◆ enableKeyboard()

GuidoErrCode enableKeyboard ( PianoRoll *  pr,
bool  enabled 
)

Enables keyboard or not (not enabled by default)

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

◆ enableMeasureBars()

GuidoErrCode enableMeasureBars ( PianoRoll *  pr,
bool  enabled 
)

Enables or not measure bars (false by default)

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

◆ getKeyboardWidth()

float getKeyboardWidth ( PianoRoll *  pr,
int  height 
)

Gets the piano roll keyboard width.

Parameters
pra pianoroll previously created with ar2PianoRoll or midi2PianoRoll
heightthe height of the canvas (-1 to set the default height : 512)
Returns
the pianoroll keyboard width

◆ getMap()

Time2GraphicMap getMap ( PianoRoll *  pr,
int  width,
int  height 
)

Gets the piano roll map.

Parameters
pra pianoroll previously created with ar2PianoRoll or midi2PianoRoll
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)
Returns
a Time2GraphicMap instance

◆ midi2PianoRoll()

PianoRoll* midi2PianoRoll ( PianoRollType  type,
const std::string &  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.

◆ onDraw()

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

Draw the piano roll on a VGDevice.

Parameters
pra pianoroll previously created with ar2PianoRoll or midi2PianoRoll
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)

◆ removeColorToVoice()

GuidoErrCode removeColorToVoice ( 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

◆ setColorToVoice()

GuidoErrCode setColorToVoice ( PianoRoll *  pr,
int  voiceNum,
const std::string &  color 
)

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

Parameters
pra pianoroll previously created with ar2PianoRoll or midi2PianoRoll
voiceNumthe voice number (first voice is number 1)
colorthe html color name
Returns
a Guido error code

◆ setHtmlColorToVoice()

GuidoErrCode setHtmlColorToVoice ( 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 ar2PianoRoll or midi2PianoRoll
voiceNumthe voice number (first voice is number 1)
colorthe html color (constants are defined in Colors.h)
Returns
a Guido error code

◆ setLimits()

GuidoErrCode setLimits ( PianoRoll *  pr,
LimitParams limitParams 
)

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

Parameters
pra pianoroll previously created with ar2PianoRoll or midi2PianoRoll
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

◆ setPitchLinesDisplayMode()

GuidoErrCode setPitchLinesDisplayMode ( 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 ar2PianoRoll or midi2PianoRoll
modean int corresponding to the pitch lines display mode
Returns
a Guido error code

◆ setRGBColorToVoice()

GuidoErrCode setRGBColorToVoice ( 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 ar2PianoRoll or midi2PianoRoll
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

◆ svgExport()

std::string svgExport ( PianoRoll *  pr,
int  width,
int  height 
)

svgExport Draw the piano roll on SVG device and return the xml string.

Parameters
pra pianoroll previously created with ar2PianoRoll or midi2PianoRoll
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)
Returns
the xml code of piano roll in svg.

◆ ~GUIDOPianoRollAdapter()

virtual ~GUIDOPianoRollAdapter ( )
virtual

Variable Documentation

◆ GUIDOPianoRollAdapter

class_export GUIDOPianoRollAdapter
Initial value:
GUIDOPianoRollAdapter
class_export GUIDOPianoRollAdapter
Definition: GUIDOPianoRollAdapter.h:30

Guido Project Copyright © 2019 Grame-CNCM