Pure Data / Pd

Plate of Shrimp

Active member
Guitar direct to Pd on a computer:
Essentially yes, just an audio interface. Crank up Pure Data and look in Preferences to select your interface from the audio inputs. Many current interfaces have guitar inputs that have a JFET buffer or something similar so signal is pretty good if you plug in directly, my Audient EVO 4 has that. Otherwise you can treat your signal a little before going into a line input. I've heard that just putting a pedal on the way of a non-guitar-specialized input is enough (recalling something about wanting buffered bypass?) and that works for me. I hope people here have pedals (ha ha how very droll).

Remember that you can learn to use Pure Data without guitar signal too (heresy!). You can synthesize sine waves or input audio samples.

Docker for Pd/Terrarium:
A fine idea for the Pd-to-binary (.pd -> .bin) part. It would be an alternative to the GitHub template. An approach would be to put an image on Docker Hub that you could pull into Docker Desktop and start up as a container looking at a folder on your computer for a .pd to arrive. You save your patch there, and the container then converts it to a .bin. This could be simpler than setting up the things the GitHub template needs, as long as getting a grip on using Docker doesn't make the whole affair less simple again.

A wackier idea would be to put up a website where anybody could drag-drop a .pd file and get a .bin back. It's not really wacky because IIRC the Heavy compiler had a website like that once. Putting the two things together, that website would probably in fact be a Docker container, but not one you run locally.

For any of the above, additionally getting the process to push the .bin directly to the Terrarium for you would be even more sauce.
 

Plate of Shrimp

Active member
Gotta say that i still run into problems wiring knobs. Now focused on finding how general this problem is and the fundamental cause.
 

Plate of Shrimp

Active member
Most if not all issues with knobs were merely PEBCAK - knob objects are just that, objects and not messages. Resolved.

Updated `terrarium-puredaisy` template patch to have Knob 1 twiddle tremolo frequency.
That said, i am liking a Docker/webapp approach to these tools more and more.
 

Dali

Well-known member
Most if not all issues with knobs were merely PEBCAK - knob objects are just that, objects and not messages. Resolved.
Great!

That said, i am liking a Docker/webapp approach to these tools more and more.

The smaller the barrier, the more people can be involved. But I'm just throwing ideas. I'm not advanced enough to work on the thing. At least a newbie like me got a "fresh eye" on stuff advanced people take for granted. So I could at least help on documentation. :)
 

Plate of Shrimp

Active member
Spun off a patch that plays a chord for you using the knobs for note volumes.


If you just want the binary immediately, see the Releases:

 

justin23000

Member
Soo ... i wonder if there are some testers about.

Here is the template repo I mentioned:

A test would be to clone this repo and follow the README steps to build the stand-in patch that's already there. Before you stab at it, take note of what the README says about supported/tested operating systems.
If you try it, lemme know.
Ahoy! First off, thanks a million for putting so much work into this! I think PD is definitely the way to go for me getting started on Daisy. You have really made this an inviting segue into the digital world. I've had a few things work so far (flashing premade .BINs) and I know the next step will be generating my own...

Please forgive my vast and absolute ignorance, anything Git or code related is brand new to me; I've been trying the I feel like I'm so close, but it seems something's not quite clicking:

Here's what I get when attempting the one time bootstrap:

Code:
$ make bootstrap
git submodule init
git submodule update
cd pd2dsy && git submodule init
cd pd2dsy && git submodule update       
cd pd2dsy/hvcc && pip3 install .
/usr/bin/sh: pip3: command not found
make: *** [Makefile:14: bootstrap] Error 127

seems mostly good until the end? I know I read something about 'pip3', or at least I thought I did, but can't find it now... If there's something hinky there, that's probably the reason for subsequent errors? When I try to run 'make' here's what I get...

Code:
$ make
rm -r build patch.bin
rm: cannot remove 'build': No such file or directory
rm: cannot remove 'patch.bin': No such file or directory
make: [Makefile:4: patch.bin] Error 1 (ignored)
python3 pd2dsy/pd2dsy.py --hvcc_cmd hvcc --board petal --out_dir C:/Users/justi/PureData-to-Terrarium/build patch.pd
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
make: *** [Makefile:5: patch.bin] Error 9009

I know there's probably myriad things I need to learn, but if you could nudge me in the direction of my next step please??
 

justin23000

Member
@justin23000 it looks like you haven't installed python & pip on your computer
Thank you! I had Python installed but hadn't selected 'add to Path' initially. Reinstalled it and have pip now!! Thanks!! Looks like the bootstrap was successful...

Can I ask one more infantile question? Hopefully I won't need too much hand holding after this!

Here's what I get when trying to run make:

Code:
$ make
rm -r build patch.bin
rm: cannot remove 'patch.bin': No such file or directory
make: [Makefile:4: patch.bin] Error 1 (ignored)
python3 pd2dsy/pd2dsy.py --hvcc_cmd hvcc --board petal --out_dir C:/Users/justi/PureData-to-Terrarium/build patch.pd
process_begin: CreateProcess(NULL, python3 pd2dsy/pd2dsy.py --hvcc_cmd hvcc --board petal --out_dir C:/Users/justi/PureData-to-Terrarium/build patch.pd, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:5: patch.bin] Error 2

Looks like the top half is just to remove previous .BINs? Which should be fine if it doesn't find any?

I'm confused at 'The system cannot find the file specified'. It seems like everything needed is there in the folder? I'm sure it's another dumb oversight on my part... What am I missing now?
 

Plate of Shrimp

Active member
> Which should be fine if it doesn't find any?
Correct. That's benign.

Congratulations, you are trying to use Windows, which I have not tested. But it needs to be! Good.

This here

CreateProcess(NULL

We need to check if NULL is appropriate here. My gut guesses it should be "python3".
If the paths here looks valid to you then I don't suspect them to be the file Make is complaining about.
 

fig

Well-known member
Hi,

Is your command line in the correct order?

python3 pd2dsy/pd2dsy.py --hvcc_cmd hvcc --board petal --out_dir C:/Users/justi/PureData-to-Terrarium/build patch.pd
Usage: pd2dsy.py [-h] [-b BOARD] [-p SEARCH_PATHS] [-c HVCC_CMD] pd_input


Edit: Aha! Take out pd2dsy/ from your path.
 
Last edited:

justin23000

Member
Hi,

Is your command line in the correct order?

python3 pd2dsy/pd2dsy.py --hvcc_cmd hvcc --board petal --out_dir C:/Users/justi/PureData-to-Terrarium/build patch.pd
Usage: pd2dsy.py [-h] [-b BOARD] [-p SEARCH_PATHS] [-c HVCC_CMD] pd_input


Edit: Aha! Take out pd2dsy/ from your path.
>Take out pd2dsy/ from your path.
This means remove this path in the Makefile? I tried that, but with the same result... Can I remove it from the path another way? ...after searching, I'm thinking that this means to remove pd2dsy/ as an environment variable? I picked around a bit but couldn't quite figure that out...


I'm making little tweaks to the makefile and testing it, mostly with the same return... I just tried removing the '3' in Python 3, and got a different result. Didn't generate a .BIN, but it looks like it was trying harder? It looks like Heavy was actually kicking in?

Code:
$ make
rm -r build patch.bin
rm: cannot remove 'build': No such file or directory
rm: cannot remove 'patch.bin': No such file or directory
make: [Makefile:4: patch.bin] Error 1 (ignored)
python pd2dsy\pd2dsy.py --hvcc_cmd hvcc --board petal --out_dir C:/Users/justi/terrarium-puredaisy/build patch.pd
['C:\\Users\\justi\\terrarium-puredaisy\\pd2dsy', 'C:\\Users\\justi\\AppData\\Local\\Programs\\Python\\Python310\\python310.zip', 'C:\\Users\\justi\\AppData\\Local\\Programs\\Python\\Python310\\DLLs', 'C:\\Users\\justi\\AppData\\Local\\Programs\\Python\\Python310\\lib', 'C:\\Users\\justi\\AppData\\Local\\Programs\\Python\\Python310', 'C:\\Users\\justi\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages']   
Converting patch for petal platform
Executing hvcc C:\Users\justi\terrarium-puredaisy\patch.pd  -o C:/Users/justi/terrarium-puredaisy/build -n patch -g c
Traceback (most recent call last):
  File "C:\Users\justi\terrarium-puredaisy\pd2dsy\pd2dsy.py", line 190, in <module>
    main()
  File "C:\Users\justi\terrarium-puredaisy\pd2dsy\pd2dsy.py", line 166, in main
    process = subprocess.run(shlex.split(command))
  File "C:\Users\justi\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 501, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Users\justi\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 966, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\justi\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1435, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
make: *** [Makefile:5: patch.bin] Error 1
 

fig

Well-known member
I just pulled it from Git and ran that python command from the command-line in a Win10 vm. Then I removed the prefix directory on the first argument pd2dsy/ and ran again. It did not generate that "404" error but did throw another down the pipe.

pd2dsy.py: error: unrecognized arguments: --out_dir patch.pd (obviously I didn't specify an out patch). ;)
 

Plate of Shrimp

Active member
Looking at what's necessary to get all the code to work in Windows native, it's better to use WSL under Windows 10.
You can get it using PowerShell (Administrator):

wsl --install

then consult the README again for the steps. Microsoft has documentation on how to get started with WSL.

Or maybe i'm confused and you _are_ in WSL already? Because some of these messages would come from a Linux shell.
Are you using MINGW perhaps?
 
Last edited:

Plate of Shrimp

Active member
Did the prerequisites actually get built? See the 'bootstrap' rule in the Makefile.
Remember not to forget to run `make bootstrap` and look to see if it looks like it worked...

ps. I was saying before that I liked the idea of putting this on a website. Now I even more like making this a function inside Purr Data. Like the Max gen~ solution does it.
 
Last edited:

justin23000

Member
But you might be getting close...
I _am_ concerned, though, whether the prerequisites actually got built; see the 'bootstrap' rule in the Makefile.
Remember not to forget to run `make bootstrap` and look to see if it looks like it worked...
I was just about to say something about that... I probably should have put this earlier, but if it's helpful to have all the details to work out any Windows kinks, here's some more: the make bootstrap got me this...

Code:
$ make bootstrap
git submodule init
git submodule update
cd pd2dsy && git submodule init
cd pd2dsy && git submodule update       
cd pd2dsy/hvcc && pip3 install .
Processing c:\users\justi\terrarium-puredaisy\pd2dsy\hvcc
  DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
   pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.   
Requirement already satisfied: Jinja2==2.11.3 in c:\users\justi\appdata\local\programs\python\python310\lib\site-packages (from hvcc==0.1.2) (2.11.3)
Requirement already satisfied: importlib_resources==5.1.2 in c:\users\justi\appdata\local\programs\python\python310\lib\site-packages (from hvcc==0.1.2) (5.1.2)
Requirement already satisfied: MarkupSafe>=0.23 in c:\users\justi\appdata\local\programs\python\python310\lib\site-packages (from Jinja2==2.11.3->hvcc==0.1.2) (2.0.1)
    Found existing installation: hvcc 0.1.2
    Uninstalling hvcc-0.1.2:
      Successfully uninstalled hvcc-0.1.2
    Running setup.py install for hvcc ... done
Successfully installed hvcc-0.1.2
WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via the 'C:\Users\justi\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.
make -C pd2dsy/libdaisy
make[1]: Entering directory 'C:/Users/justi/terrarium-puredaisy/pd2dsy/libdaisy'make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory 'C:/Users/justi/terrarium-puredaisy/pd2dsy/libdaisy'

Even though I'm a bottomless bucket of asinine questions, I wanted to be optimistic and assume this part worked...
 

justin23000

Member
Or maybe i'm confused and you _are_ in WSL already? Because some of these messages would come from a Linux shell.
Are you using MINGW perhaps?
I think I am using MINGW? I tried to go through all the steps that were in the 'setting up the C++ environment' video that ES posted on youtube... part of that was setting Git Bash as the default terminal in VS code, so that's where I've been working...

The terminal that I'm working with in VS Code is looking like this:

Code:
justi@Justin-Daley MINGW64 ~/terrarium-puredaisy (main)
$
 

Plate of Shrimp

Active member
Oh, I see. Yes, you are using MINGW64. So there's a chance this will work.

We need 2 things: hvcc and libdaisy.
The hvcc installation looks ok.
The libdaisy build _could_ be ok. if you have a file
pd2dsy/libdaisy/build/libdaisy.a
then you have libdaisy.
 

justin23000

Member
Oh, I see. Yes, you are using MINGW64. So there's a chance this will work.

We need 2 things: hvcc and libdaisy.
The hvcc installation looks ok.
The libdaisy build _could_ be ok. if you have a file

then you have libdaisy.
Looks like I've got libdaisy, the libdaisy.a file is there...



I did just go down a WSL/Ubuntu rabbit hole for a little bit, but I probably need to do a bit more research before I jump into this with Ubuntu...
 

Plate of Shrimp

Active member
Ok next step.
We don't know where the command `hvcc` went. pd2dsy needs it.
Try
$ which hvcc
If that says nothing, then look next to the location of python, which you can find with
$ which python3
When you do find it, change the `--hvcc-cmd` option in the Makefile to point to the full path to it.
 

fig

Well-known member
Is Python 3 okay to use then? The README says;

Test that you have python installed, and that its the proper version. It should be python 2, not python 3. Test this by running: `python --version`
 
Top