Module seamstress

zig->lua and lua->zig interface

Info:

  • Author: ryleelyman

Functions

reset_lvm () resets seamstress.
osc_register (path, types) registers a new OSC handler.
osc_send (address, path, args) sends OSC to specified address.
grid_set_led (md, x, y, val) sets grid led.
grid_all_led (md, val) sets all grid leds.
grid_rows (md) reports number of rows of grid device.
grid_cols (md) reports number of columns of grid device.
grid_set_rotation (md, rotation) sets grid rotation.
grid_tilt_enable (md, sensor) enable tilt data.
grid_tilt_disable (md, sensor) disable tilt data.
arc_set_led (md, ring, led, val) sets arc led.
arc_all_led (md, val) sets all arc leds.
monome_refresh (md) send dirty quads to monome device.
monome_intensity (md, level) sets maximum led brightness.
screen_refresh () refreshes the screen.
screen_move (x, y) moves the current location on the screen.
screen_move_rel (x, y) moves the current location on the screen relative to the current location.
screen_pixel (x, y) draws a single pixel.
screen_pixel_rel () draws a single pixel at the current location.
screen_line (bx, by) draws a line.
screen_line_rel (bx, by) draws a line relative to the current location.
screen_curve (x1, y1, x2, y2, x3, y3) draws a curve (cubic Bézier spline).
screen_rect (w, h) draws a rectangle.
screen_rect_fill (w, h) draws a filled rectangle.
screen_text (words) draws text to the screen, left-aligned.
screen_text_center (words) draws text to the screen, center-aligned.
screen_text_right (words) draws text to the screen, right-aligned.
screen_arc (radius, theta_1, theta_2) draws a circle arc to the screen.
screen_circle (radius) draws a circle to the screen.
screen_circle_fill (radius) draws a filled-in circle to the screen.
screen_triangle (ax, ay, bx, by, cx, cy) draws a filled-in triangle.
screen_quad (ax, ay, bx, by, cx, cy, dx, dy) draws a filled-in quad.
screen_new_texture (width, height) creates and returns a new texture users should use screen.new_texture instead
screen_new_texture_from_file (filename) creates and returns a new texture from image file users should use screen.new_texture instead
screen_texture_dimensions (texture) returns the texture's dimensions
screen_render_texture (texture, x, y, zoom) renders texture at given coordinates users should use screen.Texture.render instead
screen_render_texture_extended (texture, x, y, zoom, theta, flip_h, flip_v) renders texture at given coordinates with rotation and flip users should use screen.Texture.render_extended instead
screen_color (r, g, b, a) sets screen color.
screen_clear () clears the screen.
screen_set () sets which screen to draw to.
screen_show () unhides the params window
screen_get_text_size () returns the size in pixels of the given text.
screen_set_size (width, height, zoom) sets the size of the current window.
screen_set_fullscreen (is_fullscreen) sets the fullscreen state of the current window.
screen_set_position (x, y) sets the position of the current window.
metro_start (idx, seconds, count, stage) starts a new metro.
metro_stop (idx) stops a metro.
metro_set_time (idx, seconds) set repetition time for a metro.
midi_write (dev, bytes) outputs midi data to device.
clock_schedule_sleep () schedules coroutine for sleep.
clock_schedule_sync () schedules coroutine for sync.
clock_get_tempo () returns current tempo.
clock_get_beats () returns current beat since the clock was last reset.
clock_internal_set_tempo (bpm) sets internal clock tempo.
clock_link_set_tempo (bpm) sets link clock tempo.
clock_link_set_quantum (quantum) sets clock link quantum users should use the clock param instead
clock_set_source (source) sets clock source.
clock_internal_start () starts internal clock.
clock_link_start () starts link transport users should use clock.link.start() instead
clock_link_start () stops link transport users should use clock.link.stop() instead
clock_internal_stop () stops internal clock.
clock_cancel (idx) cancels coroutine.
get_time () gets (fractional) time in seconds.
quit_lvm () quits seamstress

Fields

vertices draws arbitrary vertex-defined geometry.


Functions

reset_lvm ()
resets seamstress.
osc_register (path, types)
registers a new OSC handler. users should use osc.register instead

Parameters:

  • path a string representing an OSC path /like/this
  • types (optional) a string representing the arg types that the function expects

See also:

osc_send (address, path, args)
sends OSC to specified address. users should use osc.send instead.

Parameters:

  • address a table of the form {host, port}, both strings
  • path a string representing an OSC path /like/this
  • args an array whose data will be passed to OSC as arguments

See also:

Usage:

    osc.send({"localhost", "7777"}, "/send/stuff", {"a", 0, 0.5, nil, true})
grid_set_led (md, x, y, val)
sets grid led. users should use grid:led instead.

Parameters:

  • md opaque pointer to monome device
  • x x-coordinate for led (1-indexed)
  • y y-coordinate for led (1-indexed)
  • val brightness for led (0-15)

See also:

grid_all_led (md, val)
sets all grid leds. users should use grid:all instead.

Parameters:

  • md opaque pointer to monome device
  • val brightness for led (0-15)

See also:

grid_rows (md)
reports number of rows of grid device.

Parameters:

  • md opaque pointer to monome device

Returns:

    number of rows
grid_cols (md)
reports number of columns of grid device.

Parameters:

  • md opaque pointer to monome device

Returns:

    number of columns
grid_set_rotation (md, rotation)
sets grid rotation. users should use grid:rotation instead

Parameters:

  • md opaque pointer to monome device
  • rotation value to rotate

See also:

grid_tilt_enable (md, sensor)
enable tilt data. users should use grid:tilt instead

Parameters:

  • md opaque pointer to monome device
  • sensor tilt sensor to enable

See also:

grid_tilt_disable (md, sensor)
disable tilt data. users should use grid:tilt instead

Parameters:

  • md opaque pointer to monome device
  • sensor tilt sensor to disable

See also:

arc_set_led (md, ring, led, val)
sets arc led. users should use arc:led instead

Parameters:

  • md opaque pointer to monome device
  • ring arc ring (1-based)
  • led arc led (1-based)
  • val led brightness (0-15)

See also:

arc_all_led (md, val)
sets all arc leds. users should use arc:all instead

Parameters:

  • md opaque pointser to monome device
  • val led brightness (0-15)

See also:

monome_refresh (md)
send dirty quads to monome device. users should use grid:refresh or arc:refresh instead

Parameters:

  • md opaque pointer to monome device

See also:

monome_intensity (md, level)
sets maximum led brightness. users should use grid:intensity or arc:intensity instead

Parameters:

  • md opaque pointer to monome device
  • level maximum brightness level

See also:

screen_refresh ()
refreshes the screen. users should use screen.redraw instead

See also:

screen_move (x, y)
moves the current location on the screen. users should use screen.move instead

Parameters:

  • x x-coordinate (1-based)
  • y y-coordinate (1-based)

See also:

screen_move_rel (x, y)
moves the current location on the screen relative to the current location. users should use screen.move_rel instead

Parameters:

  • x relative x-coordinate
  • y relative y-coordinate

See also:

screen_pixel (x, y)
draws a single pixel. users should use screen.pixel instead

Parameters:

  • x x-coordinate (1-based)
  • y y-coordinate (1-based)

See also:

screen_pixel_rel ()
draws a single pixel at the current location. users should use screen.pixel_rel instead

See also:

screen_line (bx, by)
draws a line. users should use screen.line instead

Parameters:

  • bx terminal x-coordinate (1-based)
  • by terminal y-coordinate (1-based)

See also:

screen_line_rel (bx, by)
draws a line relative to the current location. users should use screen.line_rel instead

Parameters:

  • bx terminal relative x-coordinate
  • by terminal relative y-coordinate

See also:

screen_curve (x1, y1, x2, y2, x3, y3)
draws a curve (cubic Bézier spline). users should use screen.curve instead

Parameters:

  • x1 1rst handle x
  • y1 1rst handle y
  • x2 2nd handle x
  • y2 2nd handle y
  • x3 3rd destination x
  • y3 3rd destination y

See also:

screen_rect (w, h)
draws a rectangle. users should use screen.rect instead

Parameters:

  • w width in pixels
  • h height in pixels

See also:

screen_rect_fill (w, h)
draws a filled rectangle. users should use screen.rect instead

Parameters:

  • w width in pixels
  • h height in pixels

See also:

screen_text (words)
draws text to the screen, left-aligned. users should use screen.text instead

Parameters:

  • words text to draw to the screen

See also:

screen_text_center (words)
draws text to the screen, center-aligned. users should use screen.text_center instead

Parameters:

  • words text to draw to the screen

See also:

screen_text_right (words)
draws text to the screen, right-aligned. users should use screen.text_right instead

Parameters:

  • words text to draw to the screen

See also:

screen_arc (radius, theta_1, theta_2)
draws a circle arc to the screen. users should use screen.arc instead

Parameters:

  • radius radius of the circle in pixels
  • theta_1 angle to start at (0-2*pi)
  • theta_2 angle to finish at (0-2*pi)

See also:

screen_circle (radius)
draws a circle to the screen. users should use screen.circle instead

Parameters:

  • radius radius of the circle in pixels

See also:

screen_circle_fill (radius)
draws a filled-in circle to the screen. users should use screen.circle_fill instead

Parameters:

  • radius radius of the circle in pixels

See also:

screen_triangle (ax, ay, bx, by, cx, cy)
draws a filled-in triangle. users should use screen.triangle instead

Parameters:

  • ax x-coordinate
  • ay y-coordinate
  • bx x-coordinate
  • by y-coordinate
  • cx x-coordinate
  • cy y-coordinate

See also:

screen_quad (ax, ay, bx, by, cx, cy, dx, dy)
draws a filled-in quad. users should use screen.quad instead

Parameters:

  • ax x-coordinate
  • ay y-coordinate
  • bx x-coordinate
  • by y-coordinate
  • cx x-coordinate
  • cy y-coordinate
  • dx x-coordinate
  • dy y-coordinate

See also:

screen_new_texture (width, height)
creates and returns a new texture users should use screen.new_texture instead

Parameters:

  • width width in pixels
  • height height in pixels

Returns:

    texture number representing texture or nil

See also:

screen_new_texture_from_file (filename)
creates and returns a new texture from image file users should use screen.new_texture instead

Parameters:

  • filename path to file

Returns:

    texture number representing the texture or nil

See also:

screen_texture_dimensions (texture)
returns the texture's dimensions

Parameters:

  • texture opaque pointer to texture

Returns:

  1. width width in pixels or nil
  2. height height in pixels or nil
screen_render_texture (texture, x, y, zoom)
renders texture at given coordinates users should use screen.Texture.render instead

Parameters:

  • texture opaque pointer to texture
  • x x-coordinate
  • y y-coordinate
  • zoom scale to draw at
screen_render_texture_extended (texture, x, y, zoom, theta, flip_h, flip_v)
renders texture at given coordinates with rotation and flip users should use screen.Texture.render_extended instead

Parameters:

  • texture opaque pointer to texture
  • x x-coordinate
  • y y-coordinate
  • zoom scale to draw at
  • theta angle in radians
  • flip_h flip horizontally if true
  • flip_v flip vertically if true
screen_color (r, g, b, a)
sets screen color. users should use screen.color instead

Parameters:

  • r red value (0-255)
  • g green value (0-255)
  • b blue value (0-255)
  • a alpha value (0-255), defaults to 255

See also:

screen_clear ()
clears the screen. users should use screen.clear instead

See also:

screen_set ()
sets which screen to draw to.
screen_show ()
unhides the params window
screen_get_text_size ()
returns the size in pixels of the given text. users should use screen.get_text_size instead

See also:

screen_set_size (width, height, zoom)
sets the size of the current window. users should use screen.set_size instead

Parameters:

  • width width in pixels
  • height height in pixels
  • zoom zoom factor

See also:

screen_set_fullscreen (is_fullscreen)
sets the fullscreen state of the current window. users should use screen.set_fullscreen instead

Parameters:

  • is_fullscreen boolean

See also:

screen_set_position (x, y)
sets the position of the current window. users should use screen.set_position instead

Parameters:

  • x x-position of upper-left corner
  • y y-position of upper-left corner

See also:

metro_start (idx, seconds, count, stage)
starts a new metro. users should use metro:start instead

Parameters:

  • idx metro id (1-36)
  • seconds float time at which to repeat
  • count stage at which to stop
  • stage stage at which to start

See also:

metro_stop (idx)
stops a metro. users should use metro:stop instead

Parameters:

  • idx metro id (1-36)

See also:

metro_set_time (idx, seconds)
set repetition time for a metro. users can use the time field on a metro instead.

Parameters:

  • idx metro id (1-36)
  • seconds new period (float)
midi_write (dev, bytes)
outputs midi data to device. users should use midi:send instead

Parameters:

  • dev opaque pointer to midi device
  • bytes table of small integers to write

See also:

clock_schedule_sleep ()
schedules coroutine for sleep. users should use clock.sleep instead

See also:

clock_schedule_sync ()
schedules coroutine for sync. users should use clock.sync instead

See also:

clock_get_tempo ()
returns current tempo. users should use clock.get_tempo instead

Returns:

    bpm

See also:

clock_get_beats ()
returns current beat since the clock was last reset. users should use clock.get_beats instead

Returns:

    beats

See also:

clock_internal_set_tempo (bpm)
sets internal clock tempo. users should use the clock param instead

Parameters:

  • bpm
clock_link_set_tempo (bpm)
sets link clock tempo. users should use the clock param instead

Parameters:

  • bpm
clock_link_set_quantum (quantum)
sets clock link quantum users should use the clock param instead

Parameters:

  • quantum (in beats)
clock_set_source (source)
sets clock source. users should use the clock source param instead

Parameters:

  • source
clock_internal_start ()
starts internal clock. users should use the clock param instead
clock_link_start ()
starts link transport users should use clock.link.start() instead
clock_link_start ()
stops link transport users should use clock.link.stop() instead
clock_internal_stop ()
stops internal clock. users should use the clock param instead
clock_cancel (idx)
cancels coroutine. users should use clock.cancel instead

Parameters:

  • idx id of coroutine to cancel

See also:

get_time ()
gets (fractional) time in seconds.
quit_lvm ()
quits seamstress

Fields

vertices
draws arbitrary vertex-defined geometry. users should use screen.geometry instead.
  • vertices a list of lists {pos, col, tex_coord}, where pos = {x, y} is a list of pixel coordinates, where col = {r, g, b, a} is a list of color data, and tex_coord = {x, y} (which is optional), is a list of texture coordinates
  • indices (optional) a list of indices into the vertices list
  • texture (optional) a texture to draw from
generated by LDoc 1.5.0 Last updated 2024-01-13 13:12:10