Issues using controller/select patch with potentiometer


#1

When I try to use the rotary switch in conjunction with controller/select patch with potentiometer as detailed here: https://sebiik.github.io/community.axoloti.com.backup/t/rotary-switch-for-selecting-programs/4241/10 I have no issues.
When I try to use it with actual patches i want to use in a live situation I cannot get it to work at all.
First I tried loading just the 3 patches I wanted to use:

And disconnect, connect to power, nothing happens...
Reconnect to the application and I get this for infinity:

So... I figure it must be because my patch loader is set to six, but Im only loading 3... so I redo:


Disconnect, power, nothing, reconnect:

So, any advice on how to get this working? This is critical to the way I want to use this device!
Please help!


Rotary Switch for selecting programs
#2

Pretty please?
With sugar on top?


#3

The idea is not to add controller/select to each patch, but rather add it as a controller object in preferences.
Then you need to ensure each patch has been
compiled whilst this is the case - by taking it live.

The reason is each patch in your list (including startup patch) has to have this select code compiled in - as there is no ‘default’ in the firmware for how to change patch ( as there are many potentially different ways users might want to do this - midi, gpio button, gpio rotary)


#5

Im confused still...
I removed the controller/select from my patches, created the controller object (select) in preferences, uploaded a completly blank patch as startup...


Doesnt work :frowning:


#7

this FR_NO_FILE error means it cannot load that patch at startup. (or when you ask it to load)
im a bit confused why you are getting this, if you saved a blank startup file... or is then when you turn the encoder?

I assume you have done this all on the sdcard?

also given the file dates (29 jul) it looks like you did not recompile the other patches (given the start and index are aug 3)

apart from that its unclear to me whats wrong, as im not exactly sure what you have tried
e.g. have you dertermined if the startup patch is loading, is it just if you turn the encoder.
if you load the patch, does the encoder turn load the next patch, or do you get an error?

I just need more details on what you have tried, and what is working, and whats not...
(it could be a bug in your controller/select patch, or a false assumption in it)

btw: your initial 'patch load out-of-range 8' indicates your asking patch 8 to be loaded, but you only have 6, so you need to work out why you are sending it 8.


#8

Gotcha, I thought the patches were recompiled when uploaded as thats what the log indicates...
here is my controller/select patch:

My start patch is just completely blank.
I opened each patch, took it live with the controller object enabled and then saved it... then re-uploaded everything.


disconnected, rebooted from power only.
Assumption is that the blank patch "loads" then the controller sees that is supposed to load the patch associated with position 0 and then loads that instead, as it would with subsequent changes to the state of the switch.
Nothing loads on startup and turning the switch produces no changes.
disconnect from power, reconnect to computer...


select.axs (3.2 KB)
blank.axp (272 Bytes)
glitchBeast_noBank.axp (32.3 KB)
delay_pan_noBank.axp (49.8 KB)
split_delay_noBank.axp (53.2 KB)
I was unable to upload the patchbank as that filetype is not permitted, but here it is:


#9

Heres something strange...
If Im connected to the computer (controller object unchecked in preferences), and I load just the blank patch, I get just nothing... but if I load my select patch, it works and switches fine between the patches... if I put the select object in the blank patch and run it, it switches fine... But if I load the blank patch with the startup object in it it fails and returns the same error when connected to power only...
Just for giggles, since the index was referencing an axp file which it apparently isnt finding I uploaded the 3 patches directly

no change...
When I mount the SD card the blank and select folders are empty...
here is a zip of the contents: https://drive.google.com/file/d/1BywEuLLF3Y9a_ruj7MBo3xce6Fw_G2i_/view?usp=sharing


#10

Controller object needs to be checked in
Preferences before you compile/live

What you need to do is to do something so you can determine
- is the startup patch loading
- what is happening in your select object

( ie You need a debug strategy)

You could use anything eg an oscillator making a sound, or send out midi, or flash the led
Anything so you can determine what’s not working as you expect.

( as it appears to be working with the patcher connected you need to be able to debug without this)


#11

If controller object is checked in preferences, I cant go live with patches, it just does this:

That being said, prior to doing the batch upload I did that with each and then saved it.
I also made sure it was checked when I uploaded the patches.

Yes all of the patches have LED based activity I can see and tell not only that they have loaded, but which patch is loaded.
So if no leds are lit, then the blank loaded, I can change the blank to have a unique lighting scenario, but I believe what is happening is:
everything is working as expected, with the exception of the loading of patches from the SD card
Im assuming that when connected to the computer and it is functioning properly because the files are "resolved locally"
but when it tries to load from the SD Card it fails.

I also noticed this:
when the log is at this point:


fileManager looks like this:

Then this happens:



and when I refresh fileManager it looks like this:

the dates on the directories disappear.


#12

No reason you should not be able to go live with it checked - so that seems like something is not happy in your controller script.

Debug, I meant to add stuff in your controller script to see what it is doing - is it there? Is it responding to gpio? Are the values correct /expected?
... as I highlighted earlier your first post with errors already indicated something not quite right.

(Note: I cannot test this as I don’t have anything connected at present that could do this - hence I can only suggest ways to help you get to the core of the issue)


#13

I fixed that issue, it was set to the wrong channel and not set to 6, I havent had that problem again since.


#14

I ran the patch without the bank index part connected and yes, it is displaying the proper Integer in correspondence to the analog in.
I also added some blinking lights to my "blank" patch and the blank patch never loads, so I assume it checks the switch value, tries to load the corresponding patch and fails, then on reboot returns the file error again as before.


#15

ok, ive created an example which works

you need to make sure you copy gpioctrl.axs (2.5 KB) into axoloti/objects/tb

then setup the preferences as

my controller is a bit simpler than yours, as I use a shift to get 0..4, but you could change to 8 by changing the shift.

I suggest you get my patch working first, which basically just does tones for each patch loaded.
you can also see in the axoloti console the currently loaded patch. (you'll obviously need to change the GPIO selection to match your hardware setup)

once you have that working, you should be able to retrofit to your example

(EDITED: improved gpioctrl, to used existing patch/load i)


#16

Same error...


Also, totally works if connected to computer.


#17

the issue appears to be that the sdcard is 'not ready' when the startup attempts to load the patch (because you are doing within msecs for the board starting)

the simple solution, is to change in gpioctrl the delayedpulse to ~1sec , then reupload the startup patch.

however, that's not clean, as it means all patch changes are delayed by 1sec, (when you next upload them , and they don't need to be.
so what you could do is, leave gpioctrl as is, but copy its contents into your startup patch, change this only to 1sec, and then when you upload the startup patch, remember to disable controller script temporarily, since it doesn't need this.

note: the reason these issue have not been seen before is usually, users do some event (send pgm change) so the changing of patch is not normally happening so quickly (sub second) after the board is powering up.


@johannes this might be worth investigating further for future release,
perhaps loadPatchIndex etc need to be delayed if the sdcard (or its caching) is not ready - unfortunately, I didn't have my SWD cable attached to same board as pots, so couldn't dig much deeper to see whats going on.
(note: its definitely something to do with initialisation time, given if you unplug and plug in quickly, it works, presumably as the sdcard initialises faster? cold vs warm start?)


#18

totally works! THANKS!


#19

I will update the documentation I wrote to reflect the changes...