This looks like a nice and compact way. I'll have to compare this to my other solution.
I'm reading out the connected MIDI interfaces upon connection by monitoring the /dev/ folder with [hcs/folder_list] every couple seconds. Whenever a new midi device gets connected I use a [shell] with [aconnect -i( to read out the names and IDs and send them with the midi input number of Pd to an lcd display while connecting it to the Pd MIDI inputs. So whenever I connect a midi device I know where it comes in.
In the next step I will make every of the 4 MIDI Ins in Pd that I'm using assignable to a specific midi controller in order to have them always the same each time I start up or change a MIDI controller. Some controllers need different handling than others.
Unfortunately every manufacturer uses different ways for naming - with or without spaces and/or extra infos. So I'm reading the first two elements of the name. Then I cut off the first character ' and split the name before the second ' which is where the name ends and additional descriptions may start. Since I have currently 11 characters available for displaying I need to extract the full name (possibly with spaces in between) as one symbol and cut it off before it wraps around to the next dislay line.
Ingo
-----Original Message----- From: Pd-list [mailto:pd-list-bounces@lists.iem.at] On Behalf Of IOhannes m zmoelnig Sent: Wednesday, November 13, 2019 11:35 AM To: pd-list@lists.iem.at Subject: Re: [PD] What's the easiest way to cut various symbols to a fixed length?
On 13.11.19 09:36, Ingo wrote:
First of all thank you, Winfried and Tim!
I ended up picking Tim's version with [list fromsymbol], [list split] and [list tosymbol] because it needs less objects. Works perfectly!
i'm late to the party, but my 4-object solution would be:
| [t b s] | | | [list fromsymbol] | +---+ |/ [repack 10] (zexy) | [list tosymbol] |
However, I had to add a [iemlib/mergefilename _] to eliminate blank spaces in some names. In order to change the names to work with [mergefilename] and [ list fromsymbol] I had to convert a few times with [s2l] and [l2s]. The underscores are converted to spaces again right before going to the LCD display.
what are you trying to achieve? remove leading whitespace from lines? or soemthing else?
fgmasdr IOhannes