Can tables be used in subpatches in polyphonic mode?


#1

Hi - I'm away from the axoloti core right now so figured I would ask on the forum if anyone has had any experience with using table based subpatches in polyphonic mode?
Will try it out later tonight to figure out why mine was crashing (looked like table properties weren't being instanced).


About tables: help a noob
#2

finally took a quick look and got the same errors in subpatch poly mode with the 24_wavetable.axp . Will investigate if there is a work around.

Start compiling patch
"RM"
rm -f C:\Users\alex\DOCUME~1\axoloti/build/xpatch.o C:\Users\alex\DOCUME~1\axoloti/build/xpatch.elf C:\Users\alex\DOCUME~1\axoloti/build/xpatch.bin C:\Users\alex\DOCUME~1\axoloti/build/xpatch.d C:\Users\alex\DOCUME~1\axoloti/build/xpatch.map C:\Users\alex\DOCUME~1\axoloti/build/xpatch.lst
"APP"
arm-none-eabi-g++ -nostdlib -fno-exceptions -fno-rtti -mcpu=cortex-m4 -O3 -fomit-frame-pointer -falign-functions=16 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -Wunused-parameter -DCORTEX_USE_FPU=TRUE -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb -DTHUMB -std=c++11 -DARM_MATH_CM4 -D__FPU_PRESENT -H -IC:\PROGRA~2\Axoloti\app/CMSIS/Include -IC:\PROGRA~2\Axoloti\app/chibios/os/ports/common/ARMCMx/CMSIS/include -IC:\PROGRA~2\Axoloti\app/chibios/os/ports/common/ARMCMx -IC:\PROGRA~2\Axoloti\app/chibios/os/ports/GCC/ARMCMx -IC:\PROGRA~2\Axoloti\app/chibios/os/ports/GCC/ARMCMx/STM32F4xx -IC:\PROGRA~2\Axoloti\app/chibios/os/kernel/include -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/include -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32F4xx -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32 -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32/GPIOv2 -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32/I2Cv1 -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32/OTGv1 -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32/RTCv2 -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32/SPIv1 -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32/TIMv1 -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32/USARTv1 -IC:\PROGRA~2\Axoloti\app/chibios/boards/ST_STM32F4_DISCOVERY -IC:\PROGRA~2\Axoloti\app/chibios/ext/fatfs/src -IC:\PROGRA~2\Axoloti\app\firmware -Winvalid-pch -MD -MP --include C:\Users\alex\DOCUME~1\axoloti/build/xpatch.h -c C:\Users\alex\DOCUME~1\axoloti/build/xpatch.cpp -o C:\Users\alex\DOCUME~1\axoloti/build/xpatch.o 
! C:\Users\alex\DOCUME~1\axoloti/build/xpatch.h.gch
C:\Users\alex\DOCUME~1\axoloti/build/xpatch.cpp: In member function 'void rootc::instance24__wavetable__poly__1::voice::instanceno__interpolation::dsp(const int32_t*, int32_t (&)[16])':
C:\Users\alex\DOCUME~1\axoloti/build/xpatch.cpp:602:44: error: 'class rootc::instance24__wavetable__poly__1' has no member named 'instancetab_i'
    outlet_o[buffer_index]= parent->common->instancetab_i.array[__USAT(inlet_a[buffer_index],27)>>(27-parent->common->instancetab_i.LENGTHPOW)]<<parent->common->instancetab_i.GAIN;
                                            ^
C:\Users\alex\DOCUME~1\axoloti/build/xpatch.cpp:602:118: error: 'class rootc::instance24__wavetable__poly__1' has no member named 'instancetab_i'
    outlet_o[buffer_index]= parent->common->instancetab_i.array[__USAT(inlet_a[buffer_index],27)>>(27-parent->common->instancetab_i.LENGTHPOW)]<<parent->common->instancetab_i.GAIN;
                                                                                                                      ^
C:\Users\alex\DOCUME~1\axoloti/build/xpatch.cpp:602:161: error: 'class rootc::instance24__wavetable__poly__1' has no member named 'instancetab_i'
    outlet_o[buffer_index]= parent->common->instancetab_i.array[__USAT(inlet_a[buffer_index],27)>>(27-parent->common->instancetab_i.LENGTHPOW)]<<parent->common->instancetab_i.GAIN;
                                                                                                                                                                 ^
C:\Users\alex\DOCUME~1\axoloti/build/xpatch.cpp: In member function 'void rootc::instance24__wavetable__poly__1::voice::instancelinear__interpolation::dsp(const int32_t*, int32_t (&)[16])':
C:\Users\alex\DOCUME~1\axoloti/build/xpatch.cpp:638:43: error: 'class rootc::instance24__wavetable__poly__1' has no member named 'instancetab_i'
     int index = asat>>(27-parent->common->instancetab_i.LENGTHPOW);
                                           ^
C:\Users\alex\DOCUME~1\axoloti/build/xpatch.cpp:639:33: error: 'class rootc::instance24__wavetable__poly__1' has no member named 'instancetab_i'
    int32_t y1 = parent->common->instancetab_i.array[index]<<parent->common->instancetab_i.GAIN;
                                 ^
C:\Users\alex\DOCUME~1\axoloti/build/xpatch.cpp:639:77: error: 'class rootc::instance24__wavetable__poly__1' has no member named 'instancetab_i'
    int32_t y1 = parent->common->instancetab_i.array[index]<<parent->common->instancetab_i.GAIN;
                                                                             ^
C:\Users\alex\DOCUME~1\axoloti/build/xpatch.cpp:640:33: error: 'class rootc::instance24__wavetable__poly__1' has no member named 'instancetab_i'
    int32_t y2 = parent->common->instancetab_i.array[(index+1)&parent->common->instancetab_i.LENGTHMASK]<<parent->common->instancetab_i.GAIN;
                                 ^
C:\Users\alex\DOCUME~1\axoloti/build/xpatch.cpp:640:79: error: 'class rootc::instance24__wavetable__poly__1' has no member named 'instancetab_i'
    int32_t y2 = parent->common->instancetab_i.array[(index+1)&parent->common->instancetab_i.LENGTHMASK]<<parent->common->instancetab_i.GAIN;
                                                                               ^
C:\Users\alex\DOCUME~1\axoloti/build/xpatch.cpp:640:122: error: 'class rootc::instance24__wavetable__poly__1' has no member named 'instancetab_i'
    int32_t y2 = parent->common->instancetab_i.array[(index+1)&parent->common->instancetab_i.LENGTHMASK]<<parent->common->instancetab_i.GAIN;
                                                                                                                          ^
C:\Users\alex\DOCUME~1\axoloti/build/xpatch.cpp:641:51: error: 'class rootc::instance24__wavetable__poly__1' has no member named 'instancetab_i'
    int frac = (asat - (index<<(27-parent->common->instancetab_i.LENGTHPOW)))<<(parent->common->instancetab_i.LENGTHPOW+3);
                                                   ^
C:\Users\alex\DOCUME~1\axoloti/build/xpatch.cpp:641:96: error: 'class rootc::instance24__wavetable__poly__1' has no member named 'instancetab_i'
    int frac = (asat - (index<<(27-parent->common->instancetab_i.LENGTHPOW)))<<(parent->common->instancetab_i.LENGTHPOW+3);
                                                                                                ^
make: *** [C:\Users\alex\DOCUME~1\axoloti/build/xpatch.bin] Error 1
Done compiling patch
Start uploading patch
bin path: C:\Users\alex\Documents\axoloti\build\xpatch.bin
FileNotFoundException
Disconnect request
Done uploading patch
Start starting patch
Done starting patch
Start locking
Done locking

#3

yeah I can reproduce and there is no workaround.
Ive raised an issue here : https://github.com/axoloti/axoloti/issues/236

it is also an issue with delay/read

essentially, because the table is an attribute (in the read object), part of the code generation expects the table to be common to all voices, but the table is actually allocated per voice (correctly, I think).


#4

i wonder if taking the table out of the subpatch could solve this somehow.


#5

what are you trying to use the table for exactly?

since 1.0.3 subpatches can reference tables in the parent, which may work for what you want...
assuming of course you don't want to use different tables for different voices.
(which you could hack you voices number in the subpatch, but its not pretty!)


#6

oh... my firmware is 1.0.0.1

im just using one table inside a subpatch to try to get a polysynth going. nothing too clever.


#7

but what do you use the table for? what data are you storing in it?

if its something like a waveform, then its better to store it in the parent patch anyway, since you don't need to store a copy per voice.

(easy enough to upgrade the software to 1.0.3, it just replaces what you have, and if a firmware update is required it will prompt you)


#8

yeah its a sample from the sdcard, I am not sure i know how to patch everything correctly while storing tables outside of the subpatch but i will try. Had this idea earlier but it didn't seem possible with my design.

**BTW -- updated the firmware after installing 1.0.3 but upon connection it still says -

Firmware version: 1.0.0.1, crc=0xFB45859B, entrypoint=0x20011000

maybe this is meant to be or its some text error


#9

Woohoo!!!! My test with the 24_wavetable_poly works!

but not sure why, when editing object instance and saving the edits, the main subpatch object is no longer updated with all the correct additions (outlets, inlets). i end up having to close the patch and reload it. hmm.

getting this error in the log:

Unresolved attribute 24_wavetable_poly_1:poly
Unresolved attribute 24_wavetable_poly_1:mididevice
Unresolved attribute 24_wavetable_poly_1:midiport

must be some issue when editing old patches or something.
**yeah its all good with another patch. no worries.


#10

ah bummer.. my objects don't work correctly in polyphonic.
Will have to debug.

I simply get a disconnect crash smile

*in mono it works though


#11

Hmm even with the default tablet/read interp i get a crash when going live with my patch. In mono it works fine - I have to push a button to load the .wav file into the table. In poly, it just flies off after going live.

Control transfer failed: -9
Ping: WaitSync Timeout, disconnecting now
Disconnect request

Perhaps I have to use an init script for the table alloc object?

*what.. looks like my wavetable experiment stopped working also..

***OK so it looks like it crashes when it receives any midi note data to change the phasor pitch. Any ideas?


Wave table crash
#12

Aha. I understand now blush


#13

But polyphony still doesn't work for me.


#14

You need to provide examples , otherwise it's impossible to understand what your issues might be...
(Even better are small cut down examples which isolate the issue)


#15

Let me know if this patch works.

I just hard crashed after sending midi data to it

FIRMWARE = .
"RM"
rm -f C:\Users\alex\DOCUME~1\axoloti/build/xp<a class="attachment" href="/uploads/default/original/1X/9b154363f35d357d3c17e24e849f0eb5946658e2.axs">24_wavetable_poly.axs</a> (4.7 KB) <a class="attachment" href="/uploads/default/original/1X/0e5f9858b3ac28d30a9f613179d5f64114bb5848.axp">24_wavetable_poly.axp</a> (2.0 KB) atch.o C:\Users\alex\DOCUME~1\axoloti/build/xpatch.elf C:\Users\alex\DOCUME~1\axoloti/build/xpatch.bin C:\Users\alex\DOCUME~1\axoloti/build/xpatch.d C:\Users\alex\DOCUME~1\axoloti/build/xpatch.map C:\Users\alex\DOCUME~1\axoloti/build/xpatch.lst
"APP"
arm-none-eabi-g++ -nostdlib -fno-exceptions -fno-rtti -mcpu=cortex-m4 -O3 -fomit-frame-pointer -falign-functions=16 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -Wunused-parameter -DCORTEX_USE_FPU=TRUE -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb -DTHUMB -std=c++11 -DARM_MATH_CM4 -D__FPU_PRESENT -H -IC:\PROGRA~2\Axoloti\app/CMSIS/Include -IC:\PROGRA~2\Axoloti\app/chibios/os/ports/common/ARMCMx/CMSIS/include -IC:\PROGRA~2\Axoloti\app/chibios/os/ports/common/ARMCMx -IC:\PROGRA~2\Axoloti\app/chibios/os/ports/GCC/ARMCMx -IC:\PROGRA~2\Axoloti\app/chibios/os/ports/GCC/ARMCMx/STM32F4xx -IC:\PROGRA~2\Axoloti\app/chibios/os/kernel/include -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/include -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32F4xx -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32 -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32/GPIOv2 -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32/I2Cv1 -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32/OTGv1 -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32/RTCv2 -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32/SPIv1 -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32/TIMv1 -IC:\PROGRA~2\Axoloti\app/chibios/os/hal/platforms/STM32/USARTv1 -IC:\PROGRA~2\Axoloti\app/chibios/boards/ST_STM32F4_DISCOVERY -IC:\PROGRA~2\Axoloti\app/chibios/ext/fatfs/src -I. -Winvalid-pch -MD -MP --include C:\Users\alex\DOCUME~1\axoloti/build/xpatch.h -c C:\Users\alex\DOCUME~1\axoloti/build/xpatch.cpp -o C:\Users\alex\DOCUME~1\axoloti/build/xpatch.o 
! C:\Users\alex\DOCUME~1\axoloti/build/xpatch.h.gch
LINK
arm-none-eabi-gcc -nostartfiles -Tramlink.ld -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb  -mno-thumb-interwork C:\Users\alex\DOCUME~1\axoloti/build/xpatch.o -Wl,-Map=C:\Users\alex\DOCUME~1\axoloti/build/xpatch.map,--cref,--just-symbols=./build/axoloti.elf -o C:\Users\alex\DOCUME~1\axoloti/build/xpatch.elf
BIN
arm-none-eabi-objcopy -O binary C:\Users\alex\DOCUME~1\axoloti/build/xpatch.elf C:\Users\alex\DOCUME~1\axoloti/build/xpatch.bin
Done compiling patch
Start uploading patch
bin path: C:\Users\alex\Documents\axoloti\build\xpatch.bin
block uploaded @ 0x20011000 length 7892
Done uploading patch
Start starting patch
Done starting patch
Start locking
Done locking
Ping: WaitSync Timeout, disconnecting now
Disconnect request
USB device found
Control transfer failed: -7
Control transfer failed: -7
Control transfer failed: -7
connected
Cannot validate authenticity, no signature present.
Disconnect request
Control transfer failed: -1
USB device found
Control transfer failed: -7
Control transfer failed: -7
Control transfer failed: -7
connected
Cannot validate authenticity, no signature present.
Ping: WaitSync Timeout, disconnecting now
Disconnect request
Control transfer failed: -7
Ping: WaitSync Timeout, disconnecting now
Control transfer failed: -7
Control transfer failed: -7
Control transfer failed: -7
Control transfer failed: -7
USB device found
Control transfer failed: -7
Control transfer failed: -7
Control transfer failed: -7
connected
Cannot validate authenticity, no signature present.
Control transfer failed: -7
Control transfer failed: -7
Control transfer failed: -1
Ping: WaitSync Timeout, disconnecting now
Disconnect request
Control transfer failed: -7
Ping: WaitSync Timeout, disconnecting now
Control transfer failed: -7
Control transfer failed: -7
Control transfer failed: -7
Control transfer failed: -7
Control transfer failed: -7
Control transfer failed: -7
USB device found
connected
Cannot validate authenticity, no signature present.
Disconnect request
Control transfer failed: -1
USB device found
connected
Cannot validate authenticity, no signature present.
Ping: WaitSync Timeout, disconnecting now
Disconnect request
Control transfer failed: -7
Ping: WaitSync Timeout, disconnecting now
Control transfer failed: -7
Control transfer failed: -9
Control transfer failed: -1
Control transfer failed: -1
USB device found
connected
Cannot validate authenticity, no signature present.
Control transfer failed: -1
Control transfer failed: -1
Disconnect request
Firmware version: 1.0.0.1, crc=0xFB45859B, entrypoint=0x20011000
Firmware version: 1.0.0.1, crc=0xFB45859B, entrypoint=0x20011000
Firmware version: 1.0.0.1, crc=0xFB45859B, entrypoint=0x20011000

24_wavetable_poly.axp (2.0 KB) 24_wavetable_poly.axs (4.7 KB)


#16

ok the problem was not the tables, it something to do with the phasor... (don't have time to check now)
if you replace with a saw it works fine. I've attached a working copy of what I think you were trying to do...

a couple of things that you might find useful for the future...

  • see how I use a patch/patcher object, this can later be saved as an AXS, but means its easy for throwing around the forum. (behaves identically to a sub-patcher... just use edit and then remember to always press 'update' after changes).
    (please use these, its MUCH quicker/easier for me to test others patches.... as I can now load directly from discourse if its just an axp, I cant do this if its got an AXS... easier for me = more likely i look at it for you smile )

  • when debugging a patch, keep removing stuff until it stops crashing... I tracked this down easily, since i just removed the table/reads and it still crashed, so obviously was not the tables.... once i got it down to just the phasor it was obviously the phasor that was 'at fault'

wtpoly.axp (8.6 KB)


#17

nice. will try now. i kept thinking its tables since i had the issue when putting tables inside a subpatch and getting compile errors when in poly mode. And this thing was crashing only in poly mode.

anyway thanks again. will try some more.


#18

scrape that, its not phasor, Ive now found the cause of the issue smile

its actually 'keyb mod' (i replaced with keyb) , and its because it can act as a modulation source, which we know has issues with poly patches , this is logged in

so just replace with keyb and you will be fine!


#19

oh OK.. i was already starting to have a brain meltdown trying to see why your patch was working and mine kept crashing.


#20

oh man..The keyboard mod object even says it is "MONOPHONIC"

**hmm although keyb says that also. nevermind