Package guidoengine

Class guidopianorollbase

  • Direct Known Subclasses:
    guidopianoroll

    public class guidopianorollbase
    extends java.lang.Object
    A class to create and manipulate piano roll.
    • Constructor Detail

      • guidopianorollbase

        public guidopianorollbase()
        Create an empty piano roll
      • guidopianorollbase

        public guidopianorollbase​(long arHandler)
        Create a piano roll and add a arHandler. The ar handler is not freed be this class.
        Parameters:
        arHandler - a Guido AR identifier
    • 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 color
        g - the green param of RGB color
        b - the blue param of RGB color
        a - 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.