Audiobus: Use your music apps together.
What is Audiobus? — Audiobus is an award-winning music app for iPhone and iPad which lets you use your other music apps together. Chain effects on your favourite synth, run the output of apps or Audio Units into an app like GarageBand or Loopy, or select a different audio interface output for each app. Route MIDI between apps — drive a synth from a MIDI sequencer, or add an arpeggiator to your MIDI keyboard — or sync with your external MIDI gear. And control your entire setup from a MIDI controller.
Download on the App StoreAudiobus is the app that makes the rest of your setup better.
Algorithm question ... reducing a list of folders to top-most parents
The user and all related content has been deleted.
Comments
Can't you just split on the slash, then sort on the first field, removing duplicates?
Or use perl; split on the slash, then use each first field as the key to add "1" to a hash. That'll remove the duplicates.
How about not even bother to split lines, just use Awk (or Perl), test if there's a slash '/' in text of line, print line only if there's no slash? (Whoops, that doesn't work if not all entries have have top level directories included. . . )
What is the performance requirement, exactly? It's fun to get a nicely crafted sed/awk script, but you seem to already have a bash solution that works, and which I expect is plenty fast. Have you tested and found it lacking with what you consider long lists? ("Thousands and thousands of lines" doesn't sound particularly large by computer standards.)
I scratched my head over it for some time but the coffee didn't kick in sufficiently to solve it.
I thought it would be entertaining to see what chatGPT would come up with. I wasn't wrong. 😂
I entertained myself for almost an hour showing it how the results the command lines it happily and confidently spewed out were wrong and seeing the various creative ways it could solve the problem incorrectly. Good fun! But no answer for you unfortunately.
Ha. Yes, of course. But I expect there's also a fairly easy way to convert the Awk approach to a bash script. Might be twice as slow, but would be of little concern. There's also little reason to spend time optimizing an algorithm unless there's an actual need for it. . . Unless you just want to have fun, which is valid reason, too. But it's ALWAYS good to know when you're doing it just for fun, and when there's an actual need.