Package guidoengine
Class guidopianorollbase
- java.lang.Object
-
- guidoengine.guidopianorollbase
-
- Direct Known Subclasses:
guidopianoroll
public class guidopianorollbase extends java.lang.Object
A class to create and manipulate piano roll.
-
-
Field Summary
Fields Modifier and Type Field Description static int
kALine
static int
kASharpLine
static int
kAutoLines
static int
kBLine
static int
kCLine
line pitchstatic int
kCSharpLine
static int
kDLine
static int
kDSharpLine
static int
kELine
static int
kFLine
static int
kFSharpLine
static int
kGLine
static int
kGSharpLine
static int
kNoLine
static int
kSimplePianoRoll
Piano roll typestatic int
kTrajectoryPianoRoll
-
Constructor Summary
Constructors Constructor Description guidopianorollbase()
Create an empty piano rollguidopianorollbase(long arHandler)
Create a piano roll and add a arHandler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
AR2PianoRoll(int type)
Create a piano roll from the Abstract representation.int
DestroyPianoRoll()
Destroy a piano roll created with AR2PianoRoll or Midi2PianoRollint
EnableAutoVoicesColoration(boolean enabled)
Enables or not the automatic voices coloration (not enabled by default) (not for a midi rendering).int
EnableKeyboard(boolean enabled)
Enables keyboard or not (not enabled by default)int
EnableMeasureBars(boolean enabled)
Enables or not measure bars (false by default)float
GetKeyboardWidth(int height)
Gets the piano roll keyboard widthint
GetMap(int width, int height, guidoscoremap scoremap)
Gets the piano roll mapprotected static void
Init()
Internal jni initialization method.void
Midi2PianoRoll(int type, java.lang.String midiFileName)
Create a piano roll from a midi file.void
setARHandler(long arRef)
Set a new ArHandler.int
SetHtmlColorToVoice(int voiceNum, long color)
Sets a html color to a voice (first voice is number 1) (black by default)int
SetLimits(limitparams limitParams)
Sets limits to a piano roll (start/end date, lower/higher pitch)int
SetPitchLinesDisplayMode(int mode)
Sets the pitch lines display mode (automatic by default).int
SetRGBColorToVoice(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)
-
-
-
Field Detail
-
kCLine
public static final int kCLine
line pitch- See Also:
- Constant Field Values
-
kCSharpLine
public static final int kCSharpLine
- See Also:
- Constant Field Values
-
kDLine
public static final int kDLine
- See Also:
- Constant Field Values
-
kDSharpLine
public static final int kDSharpLine
- See Also:
- Constant Field Values
-
kELine
public static final int kELine
- See Also:
- Constant Field Values
-
kFLine
public static final int kFLine
- See Also:
- Constant Field Values
-
kFSharpLine
public static final int kFSharpLine
- See Also:
- Constant Field Values
-
kGLine
public static final int kGLine
- See Also:
- Constant Field Values
-
kGSharpLine
public static final int kGSharpLine
- See Also:
- Constant Field Values
-
kALine
public static final int kALine
- See Also:
- Constant Field Values
-
kASharpLine
public static final int kASharpLine
- See Also:
- Constant Field Values
-
kBLine
public static final int kBLine
- See Also:
- Constant Field Values
-
kAutoLines
public static final int kAutoLines
- See Also:
- Constant Field Values
-
kNoLine
public static final int kNoLine
- See Also:
- Constant Field Values
-
kSimplePianoRoll
public static final int kSimplePianoRoll
Piano roll type- See Also:
- Constant Field Values
-
kTrajectoryPianoRoll
public static final int kTrajectoryPianoRoll
- See Also:
- Constant Field Values
-
-
Method Detail
-
setARHandler
public void setARHandler(long arRef)
Set a new ArHandler.- Parameters:
arRef
- a reference to a Guido AR representation
-
AR2PianoRoll
public final void AR2PianoRoll(int type)
Create a piano roll from the Abstract representation. The piano roll may be deleted with destroyPianoRoll. A piano Roll instance is created and have to be deleted with DestroyPianoRoll();- Parameters:
type
- the type of piano roll (kSimplePianoRoll or kTrajectoryPianoRoll)
-
Midi2PianoRoll
public final void Midi2PianoRoll(int type, java.lang.String midiFileName)
Create a piano roll from a midi file. The piano roll may be deleted with destroyPianoRoll.- Parameters:
type
- the type of piano roll (kSimplePianoRoll or kTrajectoryPianoRoll)midiFileName
- the midi file
-
DestroyPianoRoll
public final int DestroyPianoRoll()
Destroy a piano roll created with AR2PianoRoll or Midi2PianoRoll- Returns:
- a Guido error code.
-
SetLimits
public final int SetLimits(limitparams limitParams)
Sets limits to a piano roll (start/end date, lower/higher pitch)- Parameters:
limitParams
- an object contaning the limits.- Returns:
- a Guido error code
-
EnableKeyboard
public final int EnableKeyboard(boolean enabled)
Enables keyboard or not (not enabled by default)- Parameters:
enabled
- a boolean corresponding to the keyboard draw state- Returns:
- a Guido error code
-
GetKeyboardWidth
public final float GetKeyboardWidth(int height)
Gets the piano roll keyboard width- Parameters:
height
- the height of the canvas (-1 to set the default height : 512)- Returns:
- the keyBoardWith or -1 if error
-
EnableAutoVoicesColoration
public final int EnableAutoVoicesColoration(boolean enabled)
Enables or not the automatic voices coloration (not enabled by default) (not for a midi rendering). If a color is manually set with GuidoPianoRollSetColorToVoice, automatic color will not be applied for this voice.- Parameters:
enabled
- a boolean corresponding to the color state- Returns:
- a Guido error code
-
SetRGBColorToVoice
public final int SetRGBColorToVoice(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:
voiceNum
- the voice number (first voice is number 1)r
- the red param of RGB colorg
- the green param of RGB colorb
- the blue param of RGB colora
- the alpha param of RGB color- Returns:
- a Guido error code
-
SetHtmlColorToVoice
public final int SetHtmlColorToVoice(int voiceNum, long color)
Sets a html color to a voice (first voice is number 1) (black by default)- Parameters:
voiceNum
- the voice number (first voice is number 1)color
- an html color- Returns:
- a Guido error code
-
EnableMeasureBars
public final int EnableMeasureBars(boolean enabled)
Enables or not measure bars (false by default)- Parameters:
enabled
- a boolean corresponding to the measure bars draw state- Returns:
- a Guido error code
-
SetPitchLinesDisplayMode
public final int SetPitchLinesDisplayMode(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:
mode
- an int corresponding to the pitch lines display mode- Returns:
- a Guido error code
-
GetMap
public final int GetMap(int width, int height, guidoscoremap scoremap)
Gets the piano roll map- Parameters:
width
- the width of the piano roll (-1 to set the default width : 1024)height
- the height of the canvas (-1 to set the default height : 512)scoremap
- on output, contains the pianoroll map.- Returns:
- a Guido error code
-
Init
protected static void Init()
Internal jni initialization method. Automatically called at package init.
-
-