CUIA parameters

Hi

The CUIA actions for start and stop audio and MIDI record each expect an argument but then do not seem to use it. What is the purpose of this?

Walt

CUIAs can receive a list of parameteres, but the default is None:

def callable_ui_action(self, cuia, params=None):

Currently, only the “SELECT” receives a parameter:

elif cuia == "SELECT":
	try:
		self.get_current_screen().select(params[0])
	except:
		pass

The rest doesn’t receive any.

The parameters are specially interesting when calling the CUIA API throuh OSC, but we have to extend the API, adding more calls with parameters:

  • load/save snapshot
  • manage layers
  • adjust synth engine parameters
  • etc.

Regards,

Yep! I understand the idea of CUIA passing parameters to function but this question is more about the start / stop record functions which expect a parameter but does not use it. I have worked around this with the keybinding by passing a dummy parameter from CUIA.

AFAIK, the start/stop recording functions doesn’t have parameters:

???

Regards,

Sorry - bad reporting…

CUIA has a condition that there must be a parameter and it must be non zero:

	elif cuia == "START_AUDIO_RECORD":
		if len(params) > 0 and params[0] > 0:
			self.screens['audio_recorder'].start_recording()

Ups!! No idea … i don’t see any reason to not deleting this “if”.

I don’t remember writing this line, although i could be wrong. My brain is too busy in the last months, my friend :wink: Anyway, it was you who implemented this CUIAs, so perhaps you are the writer:

Kind Regards,

:blush: ah yes! It is coming back to me now. This was something to do with ensuring it was only note on messages that started the recording because otherwise the note off (note on with zero velocity) would trigger it again. I will take a closer look because that should be dealt with by the MIDI2CUIA code and the keybinding should connect directly to CUIA.

1 Like

self.callable_ui_action(self.note2cuia[note], [vel]) calls cuia with parameters. I then checked that there was a velocity value greater than 0. I have changed the check in callable_ui_action to pass if there is a velocity of 0 so that there is no requirement to provide parameters, e.g. from key binding. I will check the code when I get access to a zynth (hopefully tonight) and commit the change. After that it would be good if you would consider the keybinding changes.

It would be normal practice to delete branches after merging them but it might be worth leaving them open for a few days in case there are further tweaks although I guess we could simply create the branch again if we need to.