The location element is used to specify the coordinates of the point at which an object must be rendered.
|
Tag x refers to the horizontal direction and tag y to the vertical one. For example:
(x 40mm)(y 30mm)
means that the vertical location must be 30 millimetres from the top of the page and the horizontal location must be 40 millimetres from the left edge of the page.
The origin of the page (point x=0, y=0) is always at the top left corner of the page, more exactly the intersection point of left and top page margin lines.
The x coordinate increments always to right and y coordinate to bottom. Coordinates can always be negative.
Sometimes it is useful to specify a location not in absolute coordinates but relative to another object position. For example, to put a text above a specific note or a barline.
In these cases tags dx and dy should be used instead of x and y, respectively, where the 'd' means 'displacement'. The displacement is computed normally from parent object position, from its anchor point. This point is normally the lower left corner of its bounding rectangle, that is, the smallest rectangle that will completely enclose the object. In case of notes, the anchor point is the lower left corner of the rectangle enclosing the notehead.
Two type of units:
one tenth of staff interline space. These units are relative, as a score can have staves of different sizes. So 'tenths' units can only be used to specify location points for objects referred to a staff.
When no relative units are possible (for example, to specify page size or page margins) absolute units must be used.
The unit name is always mandatory for absolute units:
if no unit name is specified it will be considered as tenths.