Sync between editor and process

Mimas editor

This is the first tangible result concerning the graphical interface after the switch to Lua and Qt. The development in the new environment is a joy and things advance at a fast pace.

In this new context, writing tests by mocking parts of the system is really easy with Lua and greatly simplifies test driven development (especially for graphical elements). Difficult conceptual issues such as the relation between model and views remain but testing/fixing is just “command+R” away.

lk.Process sync

We have managed to make sync between lk.Process and editor.Process work. This implies many tools working together such as mdns (Zeroconf network discovery), zmq (zmq networking library), msgpack (binary serialization), mimas (Qt bindings), yaml (text serialization) and editor (Mimas application objects).

In the example below, the process has been automatically discovered on the network, patch information fetched and the process is drawn in the editor.ProcessView .

process view

Patch creation

Another big advance highlighted by this example is that patch definition works (with automatic loading of required lua code). Here is the “simple.yml” file with external “add” and “store” classes. We could have serialized these in the patch by using “script” instead of “class”.

add:
  class: add
  hue: 0.9
  x: 70
  y: 95
  links:
    sum: store/in/value
  params:
    val1: 0
    val2: 5

store:
  class: store
  hue: 0.2
  bug: 0.7
  x: 90
  y: 155

The “add.lua” file contains this:

inlet('val1', 'First value [number].')
inlet('val2', 'Second value [number].')
sum = outlet('sum', 'Sends sum of first and second values [number].')

val1 = val1 or 0
val2 = val2 or 0

function inlet.val1(v)
  val1 = v
  sum(val1 + val2)
end

function inlet.val2(v)
  val2 = v
  sum(val1 + val2)
end

The “store.lua” file is like this:

inlet('value', 'Stores the value')

function inlet.value(v)
  value = v
end
Gaspard Bucher

comments

  1. leave a comment