Adapt pd files for Zynthian

Still struggling a bit with the pure data option as I do not know exactly how to finetue pd files. Take for instance the attached granular synth. What to do to make it work for Zynthian? If adding the zynconfig files is the way to go. How to address it further?grain.pd (7.6 KB) grain-window.pd (230 Bytes)

main.pd (20.3 KB)

1 Like

Typically, I add ctlin objects to the pd file to allow changes to parameters using midi cc. Then I create a yaml file to expose the midi controllers on the Zynthian. Sorry for the lack of details but I’m away on vacation and don’t have proper resources with me. You can study the pd patches included in the Zynthian to help see how it’s done. You can also search the Zynthian forum to see how to construct the yaml file and other topics related to pure data integration. If needed I can supply a detailed example next week when I return home.

Thanks for your help! I was indeed looking at the Zynthian examples, but not really clear on how to proceed next. It is a nice discovery journey, but some additional guidance would be highly appreciated. I guess I am not the only Zynthianist looking for support on this.

Can anyone else give me a clear worked out example?

I can when I return from vacation in a few days. In the meantime you might try zipping your file and uploading using the preset manager in Zynthian webconf. Most PD patches contain multiple supporting files such as yaml, samples, etc. all zipped into a folder. Name the folder with the same name as you’re main patch and don’t use spaces or special characters in the name.
This thread may help:

I returned from vacation and loaded your patch with it’s supporting files on my Rpi4 Zynthian. The patch runs but causes the zynthian cpu to run above 140% which makes the audio stutter constently with major dropouts. I don’t think a Rpi4 has enough processing power to successfully run the patch. In fact it showed over 60% cpu when running on my windows i7 laptop and occasionally over 80%. You might try to zynthianize a different patch that is less demanding. Most patches I have found on the web are much less demanding and run under 15% cpu load on the zynthian. If you find another patch you like and you have trouble getting it to run on zynthian, I’d be happy to give you a step by step to prepare it.

Thank you!

Still, it would be nice if someone could explain the basics of how to link the Zynthian knobs and encoders to pure data patches.

Here is a simple example to explain how to link the zynthian encoders to a pure data patch. I create the pd file and yaml file on my windows pc.

First I created a pd patch named main. It has 2 sinewave oscillators and a volume control. In the main patch, OSC 1 is controlled with midi cc 18, OSC 2 is controlled with midi cc 19 and the volume is controlled with midi cc 7. The initial midi cc values are set with the loadbang. I used the following initial values: 16 for osc 1, 36 for osc 2 and 20 for Volume. Next I used Notepad++ to create a yaml file named zynconfig.yml. This file has the information to link the zynthian encoders to the puredata patch. The midi_cc numbers and values are the same as used in the patch. The first line of the yaml file is used to point to the pd file to be controlled. The third line is midi_controllers:
Next I define each controller with it’s name, midi_cc number and value. The indent spaces, colons and underscores used are very important. In this example I am only using three controllers, so the zynthian will display all three on the first page (Controllers#1). For patches using more than four controls, I use a space between groups of four controls in the yaml file. This helps me visualize what each controller page will look like on the zynthian. I place the pd and yaml file in a new folder named OSC2. Then I select both files and right click to bring up the popup window.

Then I select Send to Compressed (zipped) folder and name the zip folder 2OSC. Next, I boot my zynthian and go to the zynthian webconf on my pc. Then I select Library, Presets & Soundfonts, PureData-Visual Programming and highlight MY/synths to upload the 2OSC.zip file to the Zynthian.


Here’s the zip file: 2OSC.zip (746 Bytes)

1 Like

Thanks, will try!

When loading your zip file, the encoders do not show on the Zynthian. Rebooting does not help. What is a bit strange is that when switching from one pd file to another, sometimes the encoder settings of the previous one are taken over on the screen.

I deleted the patch on the zip using the webconf and downloaded the zip I posted and loaded it. It works for me. A couple of questions:
How did you upload the zip file?
What is your system build date?

I assembled the Zynthian this month and installed the latest Zynthian os. The zip file was uploaded as per the usual instruction (through zipping). This works perfectly for other files (like SF2 files). I can see the pd file - but it just does not work and controllers do not show. I still must be doing something wrong?

I’m not sure what you mean when you say: “The zip file was uploaded as per the usual instruction (through zipping)”. The file I posted is already zipped and ready for upload using the webconf. Please explain the proceedure you used in detail, step by step. A screenshot of your zynthian system might also be helpful, like this one:

This is the view of the zynthian system.

Your file now opens correctly. I shut off the automatic unzipping by safari - although I guess that unzipping and zipping again should not be a big issue, or is it? Maybe the problem is in the unzipper app?

I’m not sure about the safari unzipper app as I haven’t used my mac for quite a while.

So the file is working now and the controls are showing up on the zynthian?

The example file is very basic. It didn’t require the use of ‘labels:’ in the zynconfig.yml. You can take a look at the zynconfig.yml file used with the grids zynth patch to see how lables are used. zynconfig.yml (1.2 KB)

But how does the link to each of Zynthian’s encoders and knobs work? Let’s say I want a knob to launch an acction in a pure data file or act as a switch?

There are many ways to accomplish this. it would be much easier to answer if you would provide a sample pd patch with the action you want to launch or a switch to activate.