How to read out the patchname from sd/patch


#1

As I now own an OLED display ,I want to read out the patchname from sd card/live patch automatically.


#2

Can you describe more exactly what you want to do?


#3

go to every patch and add a display object + a text writting your desired patch name. then re-upload to sdcard et voilá.
That's the easy way afaik...


#4

There is an Object for the bankindex, and i want an object that spits out the patchname. is it possible?


#5

i don't think it is that easy. you would have to write an object that reads the parent directory name, since that is the name of the patch, right? what is wrong with the solution @servandisco posted?


#6

It would be conveniant, everytime i change the Patchname, the oled would be updated.
I looked into Bank index object

i = GetIndexOfCurrentPatch();

Is this an call to the API ? might be a firmware thing.


#7

yes, it is call to a function in the firmware, i looked at the relevant file and there is no equivalent for the patchname.


#8

hm there is a getcwd command in chibios as well.


#9

i will give this a try tomorrow. i have no axoloti with an sdcard here, so cannot try atm.


#10

ok, i think it is done. check my community folder under patch/name... it has a string outlet that you can connect to an OLED object. please test, but it works here!


#11

Thank you! it is working fine.

for(int i = 3; i < 16; i++) {
p_name[i-3] = p_name[i];
}
is this for shorting the names longer than 16 letters?


#12

no, that is to get rid of the "0:/" in front of the name.

essentially the getcwd gives you the current working directory as path. and since patches on axoloti are saved in a folder with their name on the sdcard we can simply cut the first three letters from the path to get the patchname.


#13

Hey is there any way to read all the patchnames in an entire patchbank?

I want to be able to scroll through different patches and preview their names before loading them.