NEW: Control-device manager + controller device "drivers"

You must subscribe for receiving the right signals. As we still don’t have signals for these events, i will add them and tell you how to proceed.

3 Likes

Great! Thank you very much! :smiling_face::clap::clap:

Done! You have to register the next signal/subsignals pairs:

zynsigman.S_GUI, zynsigman.SS_GUI_SHOW_SCREEN => screen
zynsigman.S_STATE_MAN, self.state_manager.SS_AUDIO_PLAYER_STATE => state
zynsigman.S_STATE_MAN, self.state_manager.SS_MIDI_PLAYER_STATE => state
zynsigman.S_STATE_MAN, self.state_manager.SS_MIDI_RECORDER_STATE => state
zynsigman.S_AUDIO_RECORDER, self.state_manager.audio_recorder.SS_AUDIO_RECORDER_STATE => state

The name after the “=>” is the parameter(s) name(s) for the callback function

You need to import zynsigman and other stuff in the driver’s code, like this:

from zyngine.zynthian_signal_manager import zynsigman

The syntax is for registering a signal is:

zynsigman.register(zynsigman.S_GUI, zynsigman.SS_GUI_SHOW_SCREEN, self)

and for unregistering:

zynsigman.unregister(signal_num,  subsignal_num, cb_func)

For instance:

def init(self):
  super().init()
  zynsigman.register(zynsigman.S_GUI, zynsigman.SS_GUI_SHOW_SCREEN, self.cb_gui_show_screen)

def end(self):
  zynsigman.unregister(zynsigman.S_GUI, zynsigman.SS_GUI_SHOW_SCREEN, self.cb_gui_show_screen)
  super().end()

def cb_gui_show_screen(self, screen):
  pass

Good coding!

3 Likes

@jofemodo and I implemented the signals for these events at the same time, independantly. I have left @jofemodo’s signal names and merged my changes which also include signals for audio player and for multitrack recorder chain armed.

I have also added a driver for the “riband Bluetooth” wearable MIDI controller that I have built. It allows pretty much full control of Zynthian with pad control and indication and zctrl control (the four rotary encoders on the zynthian). If I can free up enough space on my phone I will record some video of it in action. The code is in chain manager branch.

6 Likes

Can we call it the “Blue Riband”?

3 Likes

Totally awesome! And very fast! Thank you very much @jofemodo and @riban! :partying_face::clap:

1 Like

5 Likes

Everything works fine, except SS_AUDIO_PLAYER_STATE, which seems to be defined only :sweat_smile: I can register a callback, but never gets called. Audio recorder and midi player/recorder signals works flawlessly! :slightly_smiling_face: :clap: :clap:

Ups! It seems something was deleted by error. Update and test again :wink:

Regards,

2 Likes

Perfect! Thanks again! :slight_smile:

UPDATE: @jofemodo Sorry for being so noisy… :woozy_face: but I have another issue. When I press play, and then let the audio finish by itself, I do not receive the awaited “audio player False”… should I? I don’t want to stress you, just to know if is already implemented :smiley:

Yes, you are right. The previous fix was flawed. The signal must come from the player transport, not the state manager request for start / stop. It is now fixed. You must register for zynthian_engine_audioplayer.SS_AUDIO_PLAYER_STATE with an event handler with parameters (handle, state).

  • state is the play state (0: stopped, 1: playing)
  • handle is the unique id of the player which can be retrieved from the processor object

I will also look at the other signals to ensure they are coming from the MIDI / Audio player / recorder…

[Edit] I added a signal for when MIDI player stops playback at end of track. I have not done so for MIDI recorder because the only way this happens (currently) is that we run out of disk space which is not handled well so should be reviewed separately.

2 Likes

Great! Audio works perfectly! :slight_smile: Regarding MIDI, I have a problem when playing (I receive “playing” and almost immediately “stopped”), but I think it may be a problem with my MIDI recording.

Thanks again for your amazing work! :clap:

UPDATE: Just one more thing… (you’re gonna kill me! :pray:) In pattern editor, neither record nor play status are sent…

Another update: I have the “device” mode ready! It replicates the Zynthian interface with some caveats. I’ll explain how to use it in the upcoming wiki :wink:

Now, to zynpad-land! :star_struck:

Pretty sure that this is a dream too far, but there are some python scripts knocking about for Launchpads that give different contextual interfaces. So you can switch between ‘scale’ mode and ‘mixer’ mode or ‘drum sequence’ mode…

https://motscousus.com/stuff/2011-07_Novation_Launchpad_Ableton_Live_Scripts/

Any such plans on the zynth ?

1 Like

In many ways the new device driver mechanism is similar to this. It is a way to provide customised interface between hardware and the Zynthian. What is currently missing is the ability to select from the available scripts / profiles. That is planned. It would also be beneficial for users to be able to easily install and share these scripts / profiles / device drivers. I would suggest we maintain the Python language for these scripts.

Keep dreaming and we will play the sandman.

2 Likes

exit light, enter light!

Hi Zynthianers!

I’m proud to say that the driver for the Akai APC Key 25 mk2 is ready! :slightly_smiling_face: :clap: :clap: It has 2 different modes: one which controls Zynmixer/Zynpad, and other to control the UI. With the PAD matrix you will see the available sequences (with different LED brightness whether they are empty or not) and its playing status. You can start a sequence, live record it (also showing the pattern editor), or clear its contents. And of course, everything in RGB color!

I need to create the PR, and also the documentation for those who want to check it out. Stay tuned! :wink:

Cheers!

4 Likes

You’ve prompted me to drag out my akai mpk mini which had a non working keyboard, and with a little ribbon cable realignment it now works!

It will be interesting to compare the functionality with your driver.

1 Like

I also have an Akai MPK mini, there is a working driver already? If not, I might give it a try… :slightly_smiling_face:

To be honest I hadn’t even looked, flushed as I was at returning it from the dead. It predates the Motor 61 as the zynthian controller of choice in various households.

JOFE’s picture shows the MPK mini with the dispaly which appears to be a rather cleverer device all round. Also I don’t run MAC or PC so am rather limited by lack of config software.