Pure Data

@alpignolo [vd~] requires a signal input to adjust the delay time. The multiplier object in your example is [* 900], but would need to be [*~ 900] in order to provide the knob ADC signal through to your [vd~ delay] object. That should fix it for you.

1 Like

Or maybe adding a line~ for smoothing the parameter, that should fix both the vd~ problem and any potential problems when changing the delay time :slight_smile:

@kreiff yes, it works, thanks a lot

@shensley for now I haven’t been able to get the petal map to work.
How should I name the controls?
For the pots: Knob1 or Ctrl1 ?
for the buttons?

Took a little longer than I wanted to get back on this, but I’ll get the petal stuff merged this morning.

So doing a very short test (adapting the pod example to the petal), the mappings for the petal do work on the new branch. You have to use “Knob” not control. Generally it will always be the word that matches what’s written on the hardware itself.

Once I fully test all of the controls are working right I’ll get a working example in the repo, and merge it all.

2 Likes

Good. Thanks @shensley
Please let me know when everything is ready in the repo

Alright, petal stuff is up and merged to master.

The Field will be the next addition, along with SDRAM access for large delays, etc. However, I think these will wait until we unify the API in libdaisy for all breakout boards so that both the generated code, and the pd patches can be a bit more generic. I’d also like to get LED access added soon.

The Petal test patch is a fairly simple delay:

Knob 3 controls Dry/Wet
Knob 4 controls Delay time
Knob 5 controls Feedback

PetalTestPdPatch

1 Like

Hi. I’ve tried to run make after cd into the directory the pd2dsy script creates, but this error showed up.

mkdir build
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H750xx -DUSE_HAL_DRIVER -DSTM32H750xx -Ic/ -I../../libdaisy/core/ -I../../libdaisy -I../../libdaisy/src/ -I../../libdaisy/Drivers/CMSIS/Include/ -I../../libdaisy/Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../../libdaisy/Drivers/STM32H7xx_HAL_Driver/Inc/ -I  -O2 -Wall -fdata-sections -ffunction-sections -MMD -MP -MF"build/system_stm32h7xx.d" -Wa,-a,-ad,-alms=build/system_stm32h7xx.lst ../../libdaisy/core/system_stm32h7xx.c -o build/system_stm32h7xx.o
arm-none-eabi-g++  -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H750xx -DUSE_HAL_DRIVER -DSTM32H750xx -Ic/ -I../../libdaisy/core/ -I../../libdaisy -I../../libdaisy/src/ -I../../libdaisy/Drivers/CMSIS/Include/ -I../../libdaisy/Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../../libdaisy/Drivers/STM32H7xx_HAL_Driver/Inc/ -I  -O2 -Wall -fdata-sections -ffunction-sections -MMD -MP -MF"build/passthrough.d" -fno-exceptions -fasm -finline -finline-functions-called-once -fshort-enums -fno-move-loop-invariants -fno-unwind-tables  -Wa,-a,-ad,-alms=build/passthrough.lst passthrough.cpp -o build/passthrough.o
passthrough.cpp:5:10: fatal error: c/Heavy_passthrough.hpp: No such file or directory
    5 | #include "c/Heavy_passthrough.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [build/passthrough.o] Error 1

“passthrough.pd” is the name of the file.

Every time I run make, the same error shows up saying that the hpp file is missing.

What should I do?

Hmm, have you checked to make sure the c/ folder inside the directory has that file it’s complaining about?

Were there any errors during the process of running pd2dsy.py?

Hi,
I have the same error as @KelvinT when I run make :

DelayTEST.cpp:5:10: fatal error: c/Heavy_DelayTEST.hpp: No such file or directory
    5 | #include "c/Heavy_DelayTEST.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [build/DelayTEST.o] Error 1

I also found an error during the process of running pd2dsy.py :

Converting DelayTEST for petal platform
Traceback (most recent call last):
  File "hvcc/hvcc.py", line 23, in <module>
    import interpreters.pd2hv.pd2hv as pd2hv
  File "/Users/ygrd/Documents/DAISY/pd2dsy/hvcc/interpreters/pd2hv/pd2hv.py", line 21, in <module>
    from PdParser import PdParser
  File "/Users/ygrd/Documents/DAISY/pd2dsy/hvcc/interpreters/pd2hv/PdParser.py", line 22, in <module>
    from HeavyObject import HeavyObject
  File "/Users/ygrd/Documents/DAISY/pd2dsy/hvcc/interpreters/pd2hv/HeavyObject.py", line 20, in <module>
    from NotificationEnum import NotificationEnum
  File "/Users/ygrd/Documents/DAISY/pd2dsy/hvcc/interpreters/pd2hv/NotificationEnum.py", line 16, in <module>
    from enum import Enum
ImportError: No module named enum

Thanks for your help.

Looks like you and @KelvinT are having the same issue, and that is that the python packages needed by hvcc are not installed.

To fix this: from the hvcc root directory you can run: pip install -r requirements.txt to install the specific python packages required by hvcc.

I’ll add a note about this in the README. To help others in the future.

When I tried to run pip install -r requirements.txt I got this error

Collecting enum==0.4.4 (from -r hvcc/requirements.txt (line 1))
  Could not fetch URL https://pypi.python.org/simple/enum/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:661) - skipping
  Could not find a version that satisfies the requirement enum==0.4.4 (from -r hvcc/requirements.txt (line 1)) (from versions: )
No matching distribution found for enum==0.4.4 (from -r hvcc/requirements.txt (line 1))

And when I ran python pd2dsy.py --board pod passthrough.pd I got this

Converting passthrough for pod platform
Traceback (most recent call last):
  File "hvcc/hvcc.py", line 23, in <module>
    import interpreters.pd2hv.pd2hv as pd2hv
  File "/Users/kelvintang/Desktop/DaisyExamples/pd2dsy/hvcc/interpreters/pd2hv/pd2hv.py", line 21, in <module>
    from PdParser import PdParser
  File "/Users/kelvintang/Desktop/DaisyExamples/pd2dsy/hvcc/interpreters/pd2hv/PdParser.py", line 22, in <module>
    from HeavyObject import HeavyObject
  File "/Users/kelvintang/Desktop/DaisyExamples/pd2dsy/hvcc/interpreters/pd2hv/HeavyObject.py", line 20, in <module>
    from NotificationEnum import NotificationEnum
  File "/Users/kelvintang/Desktop/DaisyExamples/pd2dsy/hvcc/interpreters/pd2hv/NotificationEnum.py", line 16, in <module>
    from enum import Enum
ImportError: No module named enum

ok well I’ve resolved the SSL: TLSV1_ALERT_PROTOCOL_VERSION alert by following this https://stackoverflow.com/questions/51646558/unable-to-install-python-packages-using-pip-in-ubuntu-linux-insecureplatformwar/54582701#54582701

now when I run python -m pip install -r hvcc/requirements.txt, it worked and it was able to install the necessary python packages for hvcc

I ran python pd2dsy.py --board pod pass_through.pd and it worked.

but then when I cd into the directory the script creates and run sudo make, this is what I got

   arm-none-eabi-g++  -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H750xx -DUSE_HAL_DRIVER -DSTM32H750xx -Ic/ -I../../libdaisy/core/ -I../../libdaisy -I../../libdaisy/src/ -I../../libdaisy/Drivers/CMSIS/Include/ -I../../libdaisy/Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../../libdaisy/Drivers/STM32H7xx_HAL_Driver/Inc/ -I  -O2 -Wall -fdata-sections -ffunction-sections -MMD -MP -MF"build/pass_through.d" -fno-exceptions -fasm -finline -finline-functions-called-once -fshort-enums -fno-move-loop-invariants -fno-unwind-tables  -Wa,-a,-ad,-alms=build/pass_through.lst pass_through.cpp -o build/pass_through.o
In file included from c/HeavyContextInterface.hpp:20,
                 from c/HeavyContext.hpp:20,
                 from c/Heavy_pass_through.hpp:37,
                 from pass_through.cpp:5:
c/HvUtils.h:33:4: warning: #warning Could not detect platform. Assuming Unix-like. [-Wcpp]
   33 |   #warning Could not detect platform. Assuming Unix-like.
      |    ^~~~~~~
pass_through.cpp: In function 'int main()':
pass_through.cpp:40:26: error: invalid conversion from 'void (*)(float**, float**, size_t)' {aka 'void (*)(float**, float**, unsigned int)'} to 'dsy_audio_callback' {aka 'void (*)(float*, float*, unsigned int)'} [-fpermissive]
   40 |     hardware->StartAudio(audiocallback);
      |                          ^~~~~~~~~~~~~
      |                          |
      |                          void (*)(float**, float**, size_t) {aka void (*)(float**, float**, unsigned int)}
In file included from daisy_boards.h:8,
                 from pass_through.cpp:3:
../../libdaisy/src/daisy_pod.h:55:40: note:   initializing argument 1 of 'void daisy::DaisyPod::StartAudio(dsy_audio_callback)'
   55 |     void StartAudio(dsy_audio_callback cb);
      |                     ~~~~~~~~~~~~~~~~~~~^~
make: *** [build/pass_through.o] Error 1

Oh strange, I hadn’t seen that type of error before. Out of curiosity, what version of python are you using (you can check by running python --version)

As for your most recent error, that looks like your libdaisy is out of date. If you had pd2dsy cloned before petal support was added, then you will need to update libdaisy.

I thought that this would happen with git pull since that’s the local commit for the repo, but you can try either git submodule update or running git checkout master ; git pull from inside the libdaisy folder.

I am using Python 2.7.14

I have ran git submodule update and git checkout master ; git pull from inside the libdaisy folder.
I ran python pd2dsy.py --board pod adc2dac.pd and it worked.
when I cd into the directory the script creates and run make, this is what I got.

Unfortunately, I’m still unable to replicate this on my end…

It really looks like something is out of date, because the void (*)(float**, float**, unsigned int) callback is a fairly new addition to the pod API, and previously it was the dsy_audio_callback that its complaining about.

If you look at the file libdaisy/src/daisy_pod.h there should be two StartAudio functions on lines 54 and 59. If yours does not have this something is out of date. You could try to git pull again in pd2dsy, or possibly just reclone the repo from scratch.

Alternatively, a few more things may help me troubleshoot

If you do git show inside of libdaisy, and pd2dsy so that I can recreate it effectively.

Also, if none of the above works, and you wouldn’t mind sending me either your pd file, or just zipping up your whole pd2dsy folder I can try to recreate/fix your issue on my end. (You can send it privately, or upload it somewhere and link it here).

@shensley I saw the names of the Petal board. Could you please tell me which pins correspond to switches 1 to 7?
in the schematics there are:

  • FOOTSWITCH 1 to 4
  • TAC_SWITCH 1 to 3
  • ENC_A and ENC_B

yeah i think i’ll just send the entire pd2dsy zip here. https://we.tl/t-qSi7l4JcC1

Ah, I forgot that the signal names in the schematic weren’t the same. I’ll make a note to fix that up for consistency.

FOOTSWITCH 1-4 are switches 1-4 (physical pins 9, 10, 11, 14)
TAC_SWITCH 1-3 are switches 5-7 (physical pins 32, 33, 8)

The encoder you would wire up the outer bottom legs to A and B, and either of the top legs to the CLICK pin.

The middle pin on the bottom, and the unconnected pin on the top would be connected to GND, and then you’d have all of the switches, and encoder wired up for use.

So, I downloaded your zip file, and a few things seemed off, but I was able to get it to build with only a few changes.

The adc2dac folder was in the root directory, but the Makefile wasn’t updated to point to libdaisy from there. So I moved it to the examples/ folder (alternatively you can change ../../libdaisy to ../libdaisy in the Makefile.

Then, despite your previous error message I got a complaint that you were missing libdaisy (error: cannot find -ldaisy). So I built the library by running make clean; make; from the libdaisy folder.

After that I navigated back to your relocated example at examples/adc2dac, and ran make clean; make one more time. This time with a successful build.

So in summary, if you rebuild libdaisy, and move your adc2dac folder to the examples/ folder you should be able to build it just fine. :smile:

2 Likes