ossia / score

ossia score, an interactive sequencer for the intermedia arts
https://ossia.io
Other
1.45k stars 101 forks source link

Mapper problems #1502

Open escuta opened 5 months ago

escuta commented 5 months ago

Hi,

Two things relating to the Mapper device:

  1. Mapper devices do not seem to work in Score 3.1.11, however do work in Score 3.1.10. Perhaps it's fixed now, but I'm unable to run 3.1.12 on aarch64. Basically, when a Mapper device is added, even the default example, no children are visible in the device manager.
  2. If a Mapper device child is bound to Serial device child, the Mapper device needs to be manually disconnected and reconnected in order for the binding to work.

To reproduce the problem, please install the following on an arduino (note you may need to to change the line "int buttonState = abs(digitalRead(pushButton) - 1);", depending on your button type) :

// digital pin 2 has a pushbutton attached to it. Give it a name:
int pushButton = 2;

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  // make the pushbutton's pin an input:
  pinMode(pushButton, INPUT_PULLUP);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input pin:
  int buttonState = abs(digitalRead(pushButton) - 1);

// or deppending on your button type
 int buttonState = digitalRead(pushButton);

  // print out the state of the button:
  Serial.println(buttonState);
  delay(1);        // delay in between reads for stability
}

Attach a button to pin 2 and to the earth on the Arduino. Next, unzip and load the attached "issue.score" score file into Score 3.1.10 (or 3.1.12?). Expand the devices in the manager. The DigitalReadSerial->buttonState should show "false". If not, change the arduino code as described above and re-upload the code.

Ok. When the button is pressed you'll notice that DigitalReadSerial->buttonState changes to true, as it should, however Mapper->buttonState, which is bound to it, does not. It is necessary to disconnect the Mapper device and reconnect it in order for it to work.

At least that is the case on my machines!

Is there something that can be done code-wise about this? eg. re-connect the Mapper automatically after initialisation somehow?

Thanks

issue.score.zip

escuta commented 5 months ago

Perhaps it's just that the Mapper should be the last device to be initialised on start up (especially important when running without a GUI and no changes can be made manually). Because, for example, if everything is working and decide to make a change to the serial device, I again need to reconnect the Mapper before it will work. Is there any way to specify the execution order of devices in the Device Manager on start up?