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 Store

Audiobus is the app that makes the rest of your setup better.

[SOLVED] Mozaic: patchstorage: 'downdload all' option?

Hey all,

I notice that if you download multiple patches at once, and drag them into Mozaic, it does a pretty good job of de-duping, and adding new scripts. And the number of scripts keeps growing (awesome!).

Question, though, is there any simple way to 'download all' from patchstorage or a scraper? Today, I'm middle-clicking each patch/script to open a new window, clicking download on each, then closing the window. This is... doable but pretty time-consuming.

Any fast-track tips you'd recommend?

«1

Comments

  • I think you have to install one at a time however once you get them installed you can easily share them all to another device or to back up. It sends a zip of all of them at once.

  • Are you on Windows or Mac? I might not get to it for a day or two, but I can throw together a script that can hit the Patch Storage API. I can have something quicker if you're on Windows because my Python is rusty.

  • What I love is when a "YOU" does the work and shares the results with "YOU ALL". Like when @Spidericemidas makes patch sets or @rs2000 makes NS2 instruments or these PatchStorage ZIP collections get made by (YOU).

    This reminds me of Fred Fish and the Amiga floppies.

  • I’m made up, I did a fun thing to one of the scripts up there, sent it to the original author and he’s going to include it in the next release! Your thread @McD was what encouraged me to give it a go 👍🙏

  • @Liquidmantis said:
    Are you on Windows or Mac? I might not get to it for a day or two, but I can throw together a script that can hit the Patch Storage API. I can have something quicker if you're on Windows because my Python is rusty.

    Ah, fantastic! Yes I'm onWindows conveniently enough. I'd love to learn from the scripting you do against the API. Thank you so much in advance!

  • @Liquidmantis said:
    Are you on Windows or Mac? I might not get to it for a day or two, but I can throw together a script that can hit the Patch Storage API. I can have something quicker if you're on Windows because my Python is rusty.

    Perhaps we could even use the python script with Pythonista or Pyto on IOS :)

  • @Krupa said:
    I’m made up, I did a fun thing to one of the scripts up there, sent it to the original author and he’s going to include it in the next release! Your thread @McD was what encouraged me to give it a go 👍🙏

    It's just typing, right?

    If you can type... you can code something. Just make small changes and
    test. Rinse and repeat. It does help to predict what the typing does and test to see if you're on the right track... if you get lost share the code and someone will point out the flaw.

    It's more fun than sudoku puzzles too and a lot easier.

  • @_ki said:

    @Liquidmantis said:
    Are you on Windows or Mac? I might not get to it for a day or two, but I can throw together a script that can hit the Patch Storage API. I can have something quicker if you're on Windows because my Python is rusty.

    Perhaps we could even use the python script with Pythonista or Pyto on IOS :)

    Does Pythonista have the files support? That sounds like fun. Automating browser tasks with a script. I hope someone takes up this challenge.

    (That's usually enough to get @_ki and others interested... a challenge with users that want the solution.)

  • wimwim
    edited February 2020

    @McD said:

    @_ki said:

    @Liquidmantis said:
    Are you on Windows or Mac? I might not get to it for a day or two, but I can throw together a script that can hit the Patch Storage API. I can have something quicker if you're on Windows because my Python is rusty.

    Perhaps we could even use the python script with Pythonista or Pyto on IOS :)

    Does Pythonista have the files support? That sounds like fun. Automating browser tasks with a script. I hope someone takes up this challenge.

    (That's usually enough to get @_ki and others interested... a challenge with users that want the solution.)

    I don't know about Pythonista, but Pyto does have files support.

    I've had fun with it, even managing to connect to and retrieve data from remote MySQL databases on my iPhone. There are some interesting libraries for MIDI and Audio - even an audio to MIDI library. Fun stuff, but I've never thought of anything practical to do with it. I never was one to think that spending 40 hours coding something that would save me 10 minutes a month is worthwhile.

  • _ki_ki
    edited February 2020

    Pythonista supports file operations, there are zip/unzip routines, http client stuff and a lot more.

    I don‘t know if its enough to download all the *.mozaic and zip the result into a single Mozaic install file.
    I think it would be better to rename them all by replacing the filename with the original scripts name (and adding the current version number if not already present), perhaps a common prefix for all auto-imported files. Perhaps one also needs to escape/exchange some of the characters like & / : so that the result is a valid IOS filename.

    This would guarantee a well ordered preset list, as all imported scripts are be sorted below the users own scripts. Another import all, some month later would then add the scripts with newer versions, so the user can delete the old-ones.
    Or maybe one should try to actively strip all version numbers from script name so that new re-imports would just overwrite old versions without the need for manual house-keeping.
    Since its an automated process, one would always have the latest version of all scripts.

    This ‚import-all‘ zip could be uploaded to the scripts wiki page. And from time to time the users download that full package to update their presets.

    .

    But keep in mind what you wished for, that over 125 scripts - in the order of their script names. A lot of scrolling needed to find something as the preset browser shown only 7 per page and there are no user-folders or no categories to group them into (on patchstorage)
    .

    For the categories, one could also scrape the script wiki page and check in which category it was sorted into and add this the the generated name prefix.

    .

    Currently i have enough other projects running to keep me busy - but i would like to test-run or could provide ideas or code-snippets.

  • Here you go. Just a bit of vi and bash commands.

  • @rs2000 Cool, so its 127 scripts currently :)

  • edited February 2020

    @inakarmacoma said:

    @Liquidmantis said:
    Are you on Windows or Mac? I might not get to it for a day or two, but I can throw together a script that can hit the Patch Storage API. I can have something quicker if you're on Windows because my Python is rusty.

    Ah, fantastic! Yes I'm onWindows conveniently enough. I'd love to learn from the scripting you do against the API. Thank you so much in advance!

    Okay, I started down a rabbit hole of making this a full-on project, which will be a cool multipurpose tool, but it'll probably be the better part of a week for me to wrap it up in my free time. So, I cut myself off and put together a purpose-made script that will only download mozaic patches. It doesn't have any filtering capabilities other than a crude tracker that remembers what patches have already been downloaded. The patches are small enough that I think that's a reasonable implementation of being a courteous API user.

    The script is available here: https://github.com/Liquidmantis/mozaic-dl/blob/master/mozaic-dl.ps1

    I actually ran this on my Mac using Powershell Core, so Windows isn't even required really. If you have any issues let me know. The API is open and doesn't require any authentication so this should just work for you.

    I don't know if you have familiarity with Powershell, so I'll assume you don't:"
    1. save this file somewhere locally, like ~\Documents\mozaic-dl\mozaic-dl.ps1
    2. open a Powershell prompt: Start -> Type "Powershell", right-click on the Powershell app and choose "Run as Administrator"
    3. to run the script you'll have to allow script execution, run set-executionpolicy unrestricted
    3. type cd ~\Documents\mozaic-dl\ (assuming you used the path I suggested above. If not, modify to suit.)
    4. execute the script with .\mozaic-dl.ps1
    5. you might want to set your executionpolicy back set-executionpolicy default If you know it should be something else then use that and not default. :)

    Here's the script in case you have any issues with GitHub. Just copy this and paste it into a file named mozaic-dl.ps1 as mentioned above.

    # outputDir is where the downloaded files will be saved.
    $outputDir = ".\patches"
    
    # stateFile is used to track already downloaded patches to avoid needless repetition.
    $stateFile = "downloadedPatches.txt"
    
    # this endpoint is scheduled to leave alpha on 2020-03-01
    # at that time tne new endpoint is v1
    # $apiEndpoint = "https://patchstorage.com/api/v1"
    $apiEndpoint = "https://patchstorage.com/api/alpha"
    
    # this is the id for the mozaic platform.
    # it's a magic integer for the sake of keeping this script simple,
    # but can be found with this API request or opening the link:
    # irm https://patchstorage.com/api/alpha/platforms?search=mozaic
    $mozaicId = 3341
    
    # The API default value is 10, and has a limit of 100.
    # Anything higher than 100 throws a 400 error.
    $patchesPerRequest = 25
    
    # This is a failsafe to avoid runaway request loops.
    # This may not be needed but belts and suspenders...
    $maxPages = 30
    
    # start at the first page. This will be used to iterate the requests.
    $page = 1
    
    # setup the working files
    if (-not (Test-Path -Path $outputDir)) {
        New-Item -ItemType Directory -Path $outputDir -ErrorAction Stop
    }
    
    if (Test-Path -Path $stateFile -PathType Leaf) {
        $priorDownloads = Get-Content $stateFile
    }
    else {
        New-Item -ItemType File -Path $stateFile -ErrorAction Stop
        $priorDownloads = @()
    }
    
    # initialize the state
    $allPatchesFound = $false
    $patchesFound = @()
    
    while (-not ($allPatchesFound) -and ($page -le $maxPages)) {
        $uri = "{0}/patches/?platforms={1}&per_page={2}&page={3}" -f $apiEndpoint, $mozaicId, $patchesPerRequest, $page
        Write-Output "[Query #$page] Performing API query $uri"
        $req = Invoke-RestMethod -uri $uri -ErrorAction Stop
    
        # append the patches found in the current request
        $patchesFound += $req
    
        # once the query returns fewer results than the patchesPerRequest limit
        if ($req.length -lt $patchesPerRequest) {
            Write-Output "[Query End] Last query returned $($req.length) results, which is less than the page max of $patchesPerRequest"
            $allPatchesFound = $true
        }
    
        # increment the page index
        $page++
    }
    
    foreach ($patch in $patchesFound) {
    
        $patchInfo = Invoke-RestMethod -uri $patch.self
        $uri = $patchInfo.files.url
        $name = $patchInfo.files.filename
        $outFile = "$outputDir\$name"
    
        if ($name -notin $priorDownloads) {
            Write-Output "[$name] downloading from $uri to $outFile"
            Invoke-RestMethod -Uri $uri -OutFile $outFile -ErrorAction Stop
            $name | Out-File -FilePath $stateFile -Append -Force
        }
        else {
            Write-Output "[$name] found in $stateFile as a prior download.  Skipping."
        }
    
    }
    
  • @rs2000 said:
    Here you go. Just a bit of vi and bash commands.

    You da' man! Thanks. I'll test my loading the scripts into Mozaic on my iPad and iPhone.
    How much free storage will I need, I wonder. iPad is short on space and the iPhone is new
    with 300+ GB available.

  • wimwim
    edited February 2020

    @McD said:

    @rs2000 said:
    Here you go. Just a bit of vi and bash commands.

    You da' man! Thanks. I'll test my loading the scripts into Mozaic on my iPad and iPhone.
    How much free storage will I need, I wonder. iPad is short on space and the iPhone is new
    with 300+ GB available.

    You could easily store 500,000,000 of mine. 14 of @_ki 's. His will last you longer though.

  • @McD said:

    @rs2000 said:
    Here you go. Just a bit of vi and bash commands.

    You da' man! Thanks. I'll test my loading the scripts into Mozaic on my iPad and iPhone.
    How much free storage will I need, I wonder. iPad is short on space and the iPhone is new
    with 300+ GB available.

    @wim said:

    @McD said:

    @rs2000 said:
    Here you go. Just a bit of vi and bash commands.

    You da' man! Thanks. I'll test my loading the scripts into Mozaic on my iPad and iPhone.
    How much free storage will I need, I wonder. iPad is short on space and the iPhone is new
    with 300+ GB available.

    You could easily store 500,000,000 of mine. 14 of @_ki 's. His will last you longer though.

    So, cool.

    I downloaded the Zip file @rs2000 has shared and open the zip into "Mozaic" using the Share menu
    and Mozaic now shows all the PatchStorage scripts in a Mozaic Sub-Folder called "scripts".

    It would be great to make some sub-sets Zips for Author(s), Top 20 Likes, Top 20 Downloads, etc.

    Or maybe @rs2000 with share his bash scripts for someone else to do more of the heavy lifting by forking the script for additional search queries.

    Hacking has this wonderful meaning that has nothing to do with breaking into systems... that's cracking.
    Hackers use simple tools to solve interesting problems.

    This was a great Hack for Mozaic users but who wouldn't want interesting 127 Midi FX for $8?
    This deserves it's own thread. This could be big. It might be wise to start with the Top 20 series and
    just have the Whole Enchilada zip at the end. Too much of a good thing just confuses people.

    Then with a larger base we could feed them "@_Ki's Mozaic Toolkit", etc.

  • McDMcD
    edited February 2020

    @McD said:

    @McD said:

    @rs2000 said:
    Here you go. Just a bit of vi and bash commands.

    You da' man! Thanks. I'll test my loading the scripts into Mozaic on my iPad and iPhone.
    How much free storage will I need, I wonder. iPad is short on space and the iPhone is new
    with 300+ GB available.

    @wim said:

    @McD said:

    @rs2000 said:
    Here you go. Just a bit of vi and bash commands.

    You da' man! Thanks. I'll test my loading the scripts into Mozaic on my iPad and iPhone.
    How much free storage will I need, I wonder. iPad is short on space and the iPhone is new
    with 300+ GB available.

    You could easily store 500,000,000 of mine. 14 of @_ki 's. His will last you longer though.

    So, cool.

    I downloaded the Zip file @rs2000 has shared and open the zip into "Mozaic" using the Share menu
    and Mozaic now shows all the PatchStorage scripts in a Mozaic Sub-Folder called "scripts".

    It would be great to make some sub-sets Zips for Author(s), Top 20 Likes, Top 20 Downloads, etc.

    Or maybe @rs2000 with share his bash scripts for someone else to do more of the heavy lifting by forking the script for additional search queries.

    Hacking has this wonderful meaning that has nothing to do with breaking into systems... that's cracking.
    Hackers use simple tools to solve interesting problems.

    This was a great Hack for Mozaic users but who wouldn't want interesting 127 Midi FX for $8?
    This deserves it's own thread. This could be big. It might be wise to start with the Top 20 series and
    just have the Whole Enchilada zip at the end. Too much of a good thing just confuses people.

    Then with a larger base we could feed them "@_Ki's Mozaic Toolkit", etc.

    By the way... Mozaic installed with all the ptchstorage scripts consumes 13.3MB or 0.013GB's of storage.
    The zip download consumes 779KB of storage... or 0.000779GB's of storage.

    Can a zip be uploaded into PatchStorage? I have a script that has an infinite number of potential "Presets" that could be archived and upload as a Zip Folder of "Presets" for AUM or AB3 installations.

    This Zip file of Mozaic scripts on PatchStorage could be really useful for "click and go". Just thinking about the possibilities here... worth looking into.

  • McDMcD
    edited February 2020

    @inakarmacoma said:
    Any fast-track tips you'd recommend?

    Can you update the Title with "Solved"? PLEASE!

  • edited February 2020

    @McD said:

    @inakarmacoma said:
    Any fast-track tips you'd recommend?

    Can you update the Title with "Solved"? PLEASE!

    Update: You'll find the archive on Patchstorage, tagged to be searchable by "collection" and "archive".

    @inakarmacoma I agree with @McD that this is solved for our part.

    A "download all" option is something that you could suggest to the maintainers of patchstorage.com.

  • @rs2000 & @McD Thank you so much for all your time and effort on this; it's fantastic!

  • McDMcD
    edited March 2020

    @rs2000 did the work and then slipped me a clue on his process.

    Using a Mac Terminal window.

    Go to https://patchstorage.com/platform/mozaic/ with a Chrome Browser.

    Save the complete web page after scrolling to the very bottom to list all 130+ scripts in order to make sure the page is loaded completely. Save with images using Chrome, otherwise the html might not catch all links.

    For me the file was saved as "Mozaic _ Platforms _ Patchstorage.htm"

    wget `cat -v  "https" Mozaic\ _\ Platforms\ _\ Patchstorage.htm | grep "mozaic" | grep "content" | sed "s/.*https/https/" | sed "s/ozaic.*/ozaic/"`
    

    everything in the reverse quotes cat -v to oziac is actually processed first.
    1. cat -v ... That part prints out the contents of the downloaded file.
    2. after the pipe | there are 2 matching processes to pull out the lines with links to the scripts from the downloaded file's text.
    3. the a "string edit" sed command to strip off the extra characters down to just the links.

    the wget in front is fed all the links one line at a time and it web-gets every script as described in the links.

    At the time @rs2000 did it there were 127 scripts and later I got 135.

    Then you need to zip up all the scripts to import or are with others.

  • @Liquidmantis said:

    @inakarmacoma said:

    @Liquidmantis said:
    Are you on Windows or Mac? I might not get to it for a day or two, but I can throw together a script that can hit the Patch Storage API. I can have something quicker if you're on Windows because my Python is rusty.

    Ah, fantastic! Yes I'm onWindows conveniently enough. I'd love to learn from the scripting you do against the API. Thank you so much in advance!

    Okay, I started down a rabbit hole of making this a full-on project, which will be a cool multipurpose tool, but it'll probably be the better part of a week for me to wrap it up in my free time. So, I cut myself off and put together a purpose-made script that will only download mozaic patches. It doesn't have any filtering capabilities other than a crude tracker that remembers what patches have already been downloaded. The patches are small enough that I think that's a reasonable implementation of being a courteous API user.

    The script is available here: https://github.com/Liquidmantis/mozaic-dl/blob/master/mozaic-dl.ps1

    I actually ran this on my Mac using Powershell Core, so Windows isn't even required really. If you have any issues let me know. The API is open and doesn't require any authentication so this should just work for you.

    I don't know if you have familiarity with Powershell, so I'll assume you don't:"
    1. save this file somewhere locally, like ~\Documents\mozaic-dl\mozaic-dl.ps1
    2. open a Powershell prompt: Start -> Type "Powershell", right-click on the Powershell app and choose "Run as Administrator"
    3. to run the script you'll have to allow script execution, run set-executionpolicy unrestricted
    3. type cd ~\Documents\mozaic-dl\ (assuming you used the path I suggested above. If not, modify to suit.)
    4. execute the script with .\mozaic-dl.ps1
    5. you might want to set your executionpolicy back set-executionpolicy default If you know it should be something else then use that and not default. :)

    Here's the script in case you have any issues with GitHub. Just copy this and paste it into a file named mozaic-dl.ps1 as mentioned above.

    # outputDir is where the downloaded files will be saved.
    $outputDir = ".\patches"
    
    # stateFile is used to track already downloaded patches to avoid needless repetition.
    $stateFile = "downloadedPatches.txt"
    
    # this endpoint is scheduled to leave alpha on 2020-03-01
    # at that time tne new endpoint is v1
    # $apiEndpoint = "https://patchstorage.com/api/v1"
    $apiEndpoint = "https://patchstorage.com/api/alpha"
    
    # this is the id for the mozaic platform.
    # it's a magic integer for the sake of keeping this script simple,
    # but can be found with this API request or opening the link:
    # irm https://patchstorage.com/api/alpha/platforms?search=mozaic
    $mozaicId = 3341
    
    # The API default value is 10, and has a limit of 100.
    # Anything higher than 100 throws a 400 error.
    $patchesPerRequest = 25
    
    # This is a failsafe to avoid runaway request loops.
    # This may not be needed but belts and suspenders...
    $maxPages = 30
    
    # start at the first page. This will be used to iterate the requests.
    $page = 1
    
    # setup the working files
    if (-not (Test-Path -Path $outputDir)) {
        New-Item -ItemType Directory -Path $outputDir -ErrorAction Stop
    }
    
    if (Test-Path -Path $stateFile -PathType Leaf) {
        $priorDownloads = Get-Content $stateFile
    }
    else {
        New-Item -ItemType File -Path $stateFile -ErrorAction Stop
        $priorDownloads = @()
    }
    
    # initialize the state
    $allPatchesFound = $false
    $patchesFound = @()
    
    while (-not ($allPatchesFound) -and ($page -le $maxPages)) {
        $uri = "{0}/patches/?platforms={1}&per_page={2}&page={3}" -f $apiEndpoint, $mozaicId, $patchesPerRequest, $page
        Write-Output "[Query #$page] Performing API query $uri"
        $req = Invoke-RestMethod -uri $uri -ErrorAction Stop
    
        # append the patches found in the current request
        $patchesFound += $req
    
        # once the query returns fewer results than the patchesPerRequest limit
        if ($req.length -lt $patchesPerRequest) {
            Write-Output "[Query End] Last query returned $($req.length) results, which is less than the page max of $patchesPerRequest"
            $allPatchesFound = $true
        }
    
        # increment the page index
        $page++
    }
    
    foreach ($patch in $patchesFound) {
    
        $patchInfo = Invoke-RestMethod -uri $patch.self
        $uri = $patchInfo.files.url
        $name = $patchInfo.files.filename
        $outFile = "$outputDir\$name"
    
        if ($name -notin $priorDownloads) {
            Write-Output "[$name] downloading from $uri to $outFile"
            Invoke-RestMethod -Uri $uri -OutFile $outFile -ErrorAction Stop
            $name | Out-File -FilePath $stateFile -Append -Force
        }
        else {
            Write-Output "[$name] found in $stateFile as a prior download.  Skipping."
        }
    
    }
    

    Quick update -- I attempted to use the script today using github, but received some odd error messages around reserved ampersands not being wrapped. So I re-tried by copy-pasting the script here to a TXT file, as described, and there was no problem. Worked like a charm. I wonder if the github branch broke somehow?

    Next up, going to see if I can modify the script to grab Drambo patches as well. :)

    I'm wondering what the optimal 'install' approach is here, though. Should one delete Mozaic, for example, re-install fresh, then load in all the presets? Otherwise, I think you end up w/ duplicates?

  • edited April 2020

    Revised from Mozaic to Drambo Patches

    Looks like it works! Nice.

  • Hey all,

    Just thought I'd contribute. Attached are copies of @Liquidmantis original script, each revised for: mozaic (his original), then... drambo, mirack, moog15, and nanostudio.

    Follow the same instructions as above, the only difference being the filename. The only changes I made to the script were:

    • filename to match platform
    • download path for patches to match platform name
    • secret number (queried using above instructions)

    Enjoy!

  • edited April 2020

    @inakarmacoma Nice! I’m glad you found it useful.

    As long as you keep the file tracker text file ($stateFile) you shouldn’t end up with duplicates. I didn’t test it very much, though. Also there’s no checks to see if a patch gets updated with the same name. Right now it’ll just skip it still. It would probably be trivial to include version or date comparison.

  • edited March 2021

    Update:
    I've just collected all the new beautiful contributions into a second "all in one" Volume 2 package:
    https://patchstorage.com/scripts-collection-archive-2-2020-02-21-to-2021-03-25/

    Here's volume 1:
    https://patchstorage.com/scripts-collection-archive-as-of-feb-21-2020/

    Together, both archives contain every Mozaic script uploaded to patchstorage until March 25, 2021.

    Edit: I've attached a "mini" version without descriptions, the pure Mozaic files only, better suited for import into Mozaic.

    Enjoy!

  • Nice, thanks!

  • @rs2000 said:
    Update:
    I've just collected all the new beautiful contributions into a second "all in one" Volume 2 package:
    https://patchstorage.com/scripts-collection-archive-2-2020-02-21-to-2021-03-25/

    Here's volume 1:
    https://patchstorage.com/scripts-collection-archive-as-of-feb-21-2020/

    Together, both archives contain every Mozaic script uploaded to patchstorage until March 25, 2021.

    Enjoy!

    I shamelessly downloaded them :-)

    Many, many thanks!

    How did you accomplish this feat?

  • @rs2000 said:
    Update:
    I've just collected all the new beautiful contributions into a second "all in one" Volume 2 package:
    https://patchstorage.com/scripts-collection-archive-2-2020-02-21-to-2021-03-25/

    Here's volume 1:
    https://patchstorage.com/scripts-collection-archive-as-of-feb-21-2020/

    Together, both archives contain every Mozaic script uploaded to patchstorage until March 25, 2021.

    Enjoy!

    Wow, thank you! What’s the best way to get these into Mozaic?

  • @tja: A few commandline tools (grep, awk, sed, curl)

    @gusgranite: Unpack the zip(s) and share/open the .mozaic files with Mozaic.
    In Mozaic, hit "Load" and the new file should be listed.

Sign In or Register to comment.