![]() |
![]() |
![]() |
swamigui Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#define SWAMIGUI_PIANO_DEFAULT_WIDTH #define SWAMIGUI_PIANO_DEFAULT_HEIGHT #define SWAMIGUI_PIANO_DEFAULT_LOWER_OCTAVE #define SWAMIGUI_PIANO_DEFAULT_UPPER_OCTAVE SwamiguiPiano; void swamigui_piano_note_on (SwamiguiPiano *piano, int note, int velocity); void swamigui_piano_note_off (SwamiguiPiano *piano, int note, int velocity); int swamigui_piano_pos_to_note (SwamiguiPiano *piano, double x, double y, int *velocity, gboolean *isblack); double swamigui_piano_note_to_pos (SwamiguiPiano *piano, int note, int edge, gboolean realnote, gboolean *isblack);
GObject +----GInitiallyUnowned +----GtkObject +----GnomeCanvasItem +----GnomeCanvasGroup +----SwamiguiPiano
"bg-color" guint : Read / Write "black-key-color" guint : Read / Write "black-key-play-color" guint : Read / Write "expression-control" SwamiControl* : Read "height-pixels" gint : Read / Write "key-count" gint : Read / Write / Construct Only "lower-octave" gint : Read / Write "lower-velocity" gint : Read / Write "midi-channel" gint : Read / Write "midi-control" SwamiControl* : Read "shadow-edge-color" guint : Read / Write "start-octave" gint : Read / Write "upper-octave" gint : Read / Write "upper-velocity" gint : Read / Write "white-key-color" guint : Read / Write "white-key-play-color" guint : Read / Write "width-pixels" gint : Read / Write
#define SWAMIGUI_PIANO_DEFAULT_HEIGHT 48 /* default hight in pixels */
#define SWAMIGUI_PIANO_DEFAULT_LOWER_OCTAVE 3 /* default lower keys octave */
#define SWAMIGUI_PIANO_DEFAULT_UPPER_OCTAVE 4 /* default upper keys octave */
void swamigui_piano_note_on (SwamiguiPiano *piano, int note, int velocity);
Piano note on. Turns on note visually on piano as well as sends an event to SwamiControl objects connected to piano MIDI event control.
|
Piano object |
|
MIDI note number to turn on |
|
MIDI velocity number (-1 to use current keyboard velocity) |
void swamigui_piano_note_off (SwamiguiPiano *piano, int note, int velocity);
Piano note off. Turns off note visually on piano as well as sends an event to it's connected MIDI driver (if any).
|
Piano object |
|
MIDI note number to turn off |
|
MIDI note off velocity |
int swamigui_piano_pos_to_note (SwamiguiPiano *piano, double x, double y, int *velocity, gboolean *isblack);
Get the MIDI note corresponding to a point on the piano. The velocity relates to the vertical axis of the note. Positions towards the tip of the key generate higher velocities.
|
Piano object |
|
X coordinate in canvas world units |
|
Y coordinate in canvas world units |
|
Location to store velocity or NULL
|
|
Location to store a boolean if key is black/white, or NULL
|
Returns : |
The MIDI note number or -1 if not a valid key. |
double swamigui_piano_note_to_pos (SwamiguiPiano *piano, int note, int edge, gboolean realnote, gboolean *isblack);
Find the canvas X coordinate for a given MIDI note.
|
Piano object |
|
MIDI note number to convert to canvas position |
|
Which edge to get position of (-1 = left, 0 = center, 1 = right) |
|
If TRUE then the coordinate is adjusted for the actual drawn key
rather than the active area (equal for all keys), when FALSE is specified.
|
|
Pointer to store a gboolean which is set if key is black, or NULL
|
Returns : |
X canvas coordinate of note for the specified edge .
|
"bg-color"
property"bg-color" guint : Read / Write
Color of border and between white keys.
Default value: 255
"black-key-color"
property"black-key-color" guint : Read / Write
Black key color.
Default value: 255
"black-key-play-color"
property"black-key-play-color" guint : Read / Write
Color of black key play highlight.
Default value: 2843738111
"expression-control"
property"expression-control" SwamiControl* : Read
Piano expression control (vertical mouse axis).
"height-pixels"
property"height-pixels" gint : Read / Write
Height in pixels.
Allowed values: >= 1
Default value: 48
"key-count"
property"key-count" gint : Read / Write / Construct Only
Size of piano in keys.
Allowed values: [1,128]
Default value: 128
"lower-octave"
property"lower-octave" gint : Read / Write
Lower keyboard start octave.
Allowed values: [0,10]
Default value: 3
"lower-velocity"
property"lower-velocity" gint : Read / Write
Lower keyboard velocity.
Allowed values: [0,127]
Default value: 127
"midi-channel"
property"midi-channel" gint : Read / Write
MIDI channel to send events on.
Allowed values: [0,15]
Default value: 0
"shadow-edge-color"
property"shadow-edge-color" guint : Read / Write
Bottom shadow edge color.
Default value: 2155905279
"start-octave"
property"start-octave" gint : Read / Write
Piano start octave (0 = MIDI note 0.
Allowed values: [0,10]
Default value: 0
"upper-octave"
property"upper-octave" gint : Read / Write
Upper keyboard start octave.
Allowed values: [0,10]
Default value: 4
"upper-velocity"
property"upper-velocity" gint : Read / Write
Upper keyboard velocity.
Allowed values: [0,127]
Default value: 127
"white-key-color"
property"white-key-color" guint : Read / Write
White key color.
Default value: 4294967295
"white-key-play-color"
property"white-key-play-color" guint : Read / Write
Color of white key play highlight.
Default value: 2843738111
"width-pixels"
property"width-pixels" gint : Read / Write
Width in pixels.
Allowed values: >= 1
Default value: 640