Patch Changes and File structure in sd card


#1

thank you very much Johannes for your help in the code for the serial communication between arduino and axoloti

your example makes good sense even if i have not yet solved the thing but now at least i'm on the right path

but today (sunday) i have first to solve yet another basic problem which i hope i i'm also on the more or less in the good path:

i have made a multi step rotary selector with resistors to choose different patches in axoloti once it will be disconnected from the computer +

i am apparently having some trouble with the file structure...

here is the patch i've made in axoloti

i have uploaded 10 simple sounding patches called p0 to p9 to the sd card and another one called "patch selector". i don't know if axoloti can "play" two different patches at the same time: one would be the "patch selector" the other would be one of the p0/p9
i have captured the what axoloti says when i try to activate the LIVE button…:

does any one see where is my error ?

thankyou all


#2

you cannot run two patches at once.

however, you can specify a 'controller' object in preferences, this will 'embedded' that patch into all patches. so in this case your patch selector patch, would be a controller object.
(usually you name them as an axs file, and it has to be in the object path, i.e. in your objects directory)

if you do a search here on the forums, I've previously described how to setup controller patches.


#3

Patch/load only loads binary patches ".bin" from sdcard.
Axoloti does not "play" two patches simultaneously, loading one patch stops the old patch.
Using a lowpass filter after "gpio/in/analog" will make it load patch #1 before loading patch #2, and at that point the lowpass filter restarts from zero, so will not be able to reach #2.

Creating a "patch bank" (File->New Patch Bank), allows to create a list of patches, upload the list to sdcard ("Upload bank table"), and upload patches to sdcard (one by one, using the "Upload" button). Patches from the patch bank can then be loaded with the "patch/load i" object, referencing the index in the patch bank.

Then you need to add a loading mechanism to your patches, similar to your patch selector patch. To avoid the need to add it explicitly to every patch, I recommend to use a "controller object". This can be a subpatch that gets included in every patch when enabled in preferences. This requires the subpatch to be present in the object library.

To convert the gpio/in/analog reading from a rotary switch with resistors (effectively behaving as a stepped potentiometer) (but not an endless encoder), and trigger patch loading, I think this should work as a controller-object-patch:

Adjust the *c parameter to the number of steps of your switch.


#4

i see, thanks
will the controller object become embedded inside the axoloti or does it stay on the computer?


#5

its embedded in the patch that are compiled (e.g. P0-P9 in your case), so runs on the axoloti.
(nothing can be 'stay' on the computer, as axoloti can be run completely standalone without a computer)


#6

I realized there is a flaw in my controller-object-patch, it will be stuck in a loop loading...


#7

ok… what a hard day for my little fish brain…
i finally got the sub patch made, the control object and the patch bank uploaded to axoloti

the switch does patch changes but not in for all the positions and also only when i click on the Live button does the patch change

in my original patch i watch what values gives the rotary switch at each position but in your example patch i don't know how to get all the position's values.

i quit for today, tomorrow i'll attack the beast again...
thank you very much to both of your for helping me
i see my intuitive approach is not enough to guess every complex solution i need…


#8

so the controller-object-patch doesn't realy allow to be independent from the computer, the position of the switch only changes the subpatch when i click on the LIVE button (which desingages itself imediatelly after)

for the range, the problem seem to be at the two or three steps of the extreme ends of the turn of 10 steps

if i understand your controller patch idea, it sends a + step when the resistor values increases and a - step when it decreases...

in my own previous version i analized the raw number given for each step and i used logic to compare it to a list of numbers and got good switching from each step

as i got some jitter in the input number i placed a k-filter to avoid jitter.

should i do a combination of your system and mine ?
is it possible to change bin files using the same node with file name like the one i used in my patch ? (see my previous screen capture)


#9

ok, I'll just comment on controller objects/patches, as there seems a little misunderstanding here.
(and its not the most obvious thing to be honest :slight_smile: )

so there are a a few of things to understand...
a) Axoloti can only run one patch, these are the '.bin' files
b) the running patch is in memory on the Axoloti core, and can optionally, communicate with the UI via the USB link.
c) other patches can be stored on the SDCard, and are then loaded into memory from the SDCard.
d) the Axoloti UI (on the computer) is only connected to a patch that IT sent to the Axoloti Core (via 'Live') , it cannot connect to any other patch that MAY be running/has been loaded on the Axoloti.
(there are some boring , but good reasons for this ... and may change in mid-term )

so... when you are running a patch, and you want to load another patch ... you need code in your patch to do this. (exclusion is patch banks, which uses program change messages, a new feature)
you could do this by copy n paste, your code into every patch you want to load, or including a sub patch into every patch to do this BUT that becomes tedious after a while, so i added 'controller objects' which allows an axoloti object or subpatch to be included into ever patch you compile, so you don't have to do this manually. *

this helps but still means a couple of things:
- due to (d) above, when you switch patches, the UI will disconnect, and you cannot reconnect it, (doing so would upload your current patch in the UI), but the patch WILL be running on the axoloti core.
- if you change the controller object, you have to recompile and upload the patches to the SDCard, since the 'old version' is embedded in the bin files.
- because controller objects are 'embedded' in patches, they cannot retain any state when you switch patches.

i suspect the above, are the 'causes' of your issues.

ok, this is not perfect, we know..

reconnecting UI

reconnecting the UI is probably the biggest limitation IF you use the computer to controller axoloti (with for some of us is not the case, axoloti standalone feature is a big thing)... unfortunately, this is not a 'quick' thing to implement. so in the 'plans' but not short term

patch switching

this seems a more common use-case, and perhaps could be done a little simper, and perhaps the controller object could be 'cleared up'.
the primary issue is ,as you have demonstrated, there are almost infinite ways someone may want to do this, via midi pgm changes, midi note on, gpio digital or analog.
I'll discussion with @johannes, but a couple of ideas spring to my mind...
- an object, which give access to the patch bank, with simple operations like next, previous, select N.
- consider moving controller objects 'outside' the patch, so they are somehow independent.
the first is relatively easy (I think), the second is not... so might be something to consider after this current release.
- we are considering having a piece of memory, that will be retained, when patches are switched, this will allow for an patches to retain some information. primarily designed for things like volume settings, but would also be useful for patching switching logic.

sorry the above is long, but hopefully it makes the situation clearer...
so it is possible to do what you want, with Axoloti as it is today, but you will have to account for the limitations Ive detailed...these 'drive' how to implement it.

(*) controller object, it should be recognised, this was not just introduced for patch switching, I actually introduced it, to allow for midi controllers (like the Ableton Push) to be added to all my patches, so I could do things like change parameters... patch switching was just one thing, I did with them, in that object.


#10

When you say that patchbanks work with patch change messages it sounds as they do it "out of the box" it's a little unclear, is that correct or do I still need to patch the patch change action?


#11

Switching patches in a patch bank via midi program change still needs a "controller object".
I'm creating some examples now.


#12

ah, sorry my mistake... I thought this was in firmware. apologies for misleading.

it is better its done in a controller object as its more consistent if you want to use other things to activate the patch change.


#13

That's what I thought, just wanted it to be clear


#14

I have added an object "patch/bankindex" to obtain the index of the last loaded patch via "patch/load i"
and a few ready-made "controller objects", for version 1.0.10, you get them via "sync libraries".

  • "controller/select patch with potentiometer": connect a potentiometer to PA7 to select 16 patches
  • "controller/cycle buttons" : use switches S1/S2 to go to the next/previous patch in the patch bank
  • "controller/pgmchange" : use midi program change to load a patch

and a simple patch bank for testing, in axoloti-contrib/patches/jt/patchbank-test

Enter the name of the selected controller object in preferences, open the patch bank in axoloti-contrib/patches/jt/patchbank-test, in the patch bank window, press "Upload bank table", and "Upload" the patches one by one. Still you need a start patch: create a new (blank) patch and select "Upload to sdcard as startup".


How to use patch banks and controller object with s1 and s2 buttons
Patch changing from MIDI Program Change (help)
Rotary Switch for selecting programs
Upload patches problems
SD card and sensel morph
#15

thanks johannes
please excuse my endless confusion
i can't find your examples anywhere…
after hours i found a gitsub with the famous "contribs" files but yours contains only a grainy-table.axp… nothing about patch selecting


#16

They are not in the "contrib" section, they're in the "factory" one


#17

@uleg, first =
File - Sync Libraries
File - Reload Objects (just in case)

Works great!! thanks @johannes. I have now combined midi program change AND switches S1/S2 in a controller object :wink:


#20

I'm very happy to be able to get this to work with your examples. However, for me it seems like the Axoloti initializes 27 slots above where the patches in the Patch Index exist. I find I have to press S2 about 24 times until I get to the patches I uploaded to the Patch Index. Each time it uploads an instance of the startup patch before hitting the patch index. I wonder am I doing something wrong?
Error messages:
"patch load out-of-range 26
patch load out-of-range 25
[...]
patch load out-of-range 2"


#21

I plan to buy a pair of hexadecimal coding wheels such as Cherry coding wheels to control patch changes.

But I'm not sure it will work because of the transitions (break-before-make) that would trigger unwanted load.


#22

current workaround is using a startup patch on sdcard or in flash memory that loads the first patch