Timelessdnb wrote:BMS wrote:Been toying actually in a bit of downtime this morning actually.
With help from a good friend, he wrote, and I tweaked a simple PowerShell script which runs through a folder of .sfs songs and make a text file for each song with the info that comes out of ORIONology in each one.
From there I've been running various regexes on those files to collect the names of samples I'd used in old tunes / vsts and build a master list.
Will run find and move script I have using that list to collate all those samples from across my old backup/archive/sample pool drives into a failsafes folder, or even make a folder for each respective song and 'collect' all the stray samples so I can be sure that I can dump a load of older unwanted samples and stuff that got mixed in but still have my legacy projects open with no missing samples.
I did this before but using a crude way of searching for data across the binaries with regexes, which worked but I'm sure some stuff got missed. I'm going to compare this to see if I get better results.
Once again, Thank you so much Jouni for making/Richard for allowing this tool.
Hi, would there be any chance of getting a copy of the PowerShell script, it would be most appreciated, many thanks
Hi, funnily enough i just came on to post a better script I've been cooking in the last few days cause I thought I'd share the love (which I will in my next post)
but sure, but then it depends what you are expecting it to do?
The original version a friend help me make was simple
provided as is, with no warranties, if you mess up your stuff that's on you etc etc disclaimers
I'd personally work with copies of files and test small first. I literally copied all my sfses to one directory away from my working projects to generate logs for all of them. Don't want to assume anyone level of knowledge so will try to explain the best I can.
First you have to put the orionology.exe into the same folder that you have the sfs/sfs'es in
then run powershell
OLD ---
Make Orion Song File LOGS with orionology.exe v 1.0 --- OLD --- (check next post for update)
- Code: Select all
<#
Title: Make Orion Song File LOGS with orionology.exe v 1.0
Author: Stockwell, with many thanks to D.Weller
Tags: Music, Production, ORION, Powershell
This script changes the working directory to "C:\Source" (as an example) and searches for all .sfs files within that directory. Then orionology.exe is run which reads the contents of each .sfs file. The script then generates a corresponding .LOG file for each .sfs file, using the output of orionology.exe
Requires you to have orionology.exe by Jouni Airaksinen. https://gitlab.com/stardrivestudio/orionology which must be in the same directory as the .sfs files you want to process to be able to read from them.
#>
CD "C:\Source" # Replace C:\Source with your own directory
$allFiles = Get-ChildItem "C:\Source\*.sfs" # Replace C:\Source with your own directory here too, keeping the \*.sfs part intact
Foreach($sfs_file in $allFiles){
$toProcess = $sfs_file.Name
$textName = $sfs_file.BaseName
.\orionology.exe "$($toProcess)" -v 2>"$($textName).LOG" # You can change the verbosity amount here by replacing the -v [flag] with -vv or -vvv
}
Which does a simple change of directory to "C:\Source", retrieves all files with the ".sfs" extension, and for each file, executes the "orionology.exe" program with the file name as an argument. The program's error output* is captured and saved to a log file with the same base name as the input file. *the error output was the only way we could figure out how to get any output into a txt file, but I'm sure its just the same as what you'd get in the console just running orionology [flags] songname.sfs
oh yeah, see the -v [flag] after the last line "$($toProcess)" that flag can be any of these
from the orionology.exe -help
FLAGS:
-h, --help Prints help information
-v Sets the level of verbosity (v=info, vv=debug, vvv=trace)
-V, --version Prints version information
so that line could be changed to
- Code: Select all
.\orionology.exe "$($toProcess)" -v 2> "$($textName).LOG"
.\orionology.exe "$($toProcess)" -vv 2> "$($textName).LOG"
or
.\orionology.exe "$($toProcess)" -vvv 2> "$($textName).LOG"
for the amount of verbosity you need.
Any questions, I'll check back, also will post a more user friendly, reusable version, I've been working on the last few days.
Depending what you need to do with the information in these logs there is various post processing scripts I've been toying with, one of which is a script to make sample lists from orionology logs
Make Sample List Files From Orionology LOGS v 1.5- Code: Select all
<#
Title: Make Sample List Files From Orionology LOGS v1.5
Author: Stockwell
Tags: Music, Production, ORION, Samples, Organisation
Description: This script processes Orionology logs in a root directory and its subfolders and identifies any text in them that looks like a file path. It extracts the filenames from these paths and saves them as a list of filenames in separate text files. The text files are named after the original log files, with "_Sample_List" appended to the filename and a .txt extension for further processing.
Requires you to have made some logs with Orionology by Jouni Airaksinen. https://gitlab.com/stardrivestudio/orionology
#>
function GetSampleListFromOrionologyLogs {
param (
[Parameter(Mandatory = $true)]
[string]$directoryPath
)
Clear-Host
Write-Host "`n`nMake a list of samples from an Orionology Log v1.5`n`n"
$directoryPath = Read-Host "Enter the folder path that contains the orionology .LOG files (will inlcude sub folders)"
while (-Not (Test-Path $directoryPath -PathType Container) -or !(Get-ChildItem -Path $directoryPath -Filter "*.log" -File -Recurse)) {
if (-Not (Test-Path $directoryPath -PathType Container)) {
Write-Host "`n`nThe specified path is not a valid directory."
} else {
Write-Host "`n`nNo log files found in the specified directory and its subdirectories."
}
$directoryPath = Read-Host "`n`nPlease enter a valid folder path that contains the LOG files"
}
$logFiles = Get-ChildItem -Path $directoryPath -Filter "*.log" -File -Recurse
Write-Host "`n`nWorking...`n`n"
foreach ($logFile in $logFiles) {
Write-Host "Processing log file: $($logFile.Name)"
$outputFile = Join-Path -Path $logFile.Directory.FullName -ChildPath ($logFile.BaseName + "_Sample_List.txt")
$content = Get-Content -Path $logFile.FullName | Out-String
$content = $content -replace "\s\r\n", " "
$outputLines = [regex]::Matches($content, ".*[\\/](?!orionology\.exe).*\.[a-zA-Z]{3}") | ForEach-Object {
$line = $_.Value.Trim()
$line -replace "^(.*[\\\/])", ""
}
$outputLines = $outputLines | Select-Object -Unique
$outputLines | Out-File -FilePath $outputFile -Encoding UTF8
Write-Host "Log file processed successfully: $($logFile.Name)"
}
Write-Host "`n`nOperation Successful. Your Sample Lists are located in the same folders as each orionology .LOG file`n"
}
GetSampleListFromOrionologyLogs -directoryPath $directoryPath
Results:
bms-list-samples-orionology-log-results.png
Seems legit, can't guarantee it doesn't miss anything as was using the powergrep app before with a slightly different regex, which is faster than powershell but this allows me to be more flexible. I've also made other scripts where it will grab files from each list and copy the samples into each folder, but I would have to test them again before posting them here, so many considerations such as user input validation, eroors/edge cases, when really I made these things for me.
here we go, bug.. edited to add a line, in the results I had a duplicate line, added in $outputLines = $outputLines | Select-Object -Unique to make sure if you use the same sample twice in the song, then it only lists one (useful later to avoid conflicts when we grab them with another script)
---
Btw - Here's a preview of the file copier script I haven't posted yet, in action.
It reads the contents of the _sample list.txt files and copies the files to the folders where they reside. I've made and used this for personal consumption really. I haven't made it robust enough to post up just yet, but give us a shout if anyone would find it handy and/or confident they wont mess up anything.
As you can see here, the first folder where the sample list is located, under it the Assets/Audio/ folders already exist so it asks you to confirm if you want to overwrite any files in there, one by one atm but might see if I can add a switch to skip all. If assets/audio doesn't exist it just copies all the files automatically as in the second example. (basically I used the same sample list for both folders in this test, but renamed one to "Another Track" instead of "All I wanted", even though the lists were the same, and that is why the samples are the same names in both folders.)
test-folders-same-sample-lists.PNG
and so on.
Bare in mind, I'm
over explaining here to apologise for my lack of programming/scripting skills as I really don't know what I'm doing, and just hacking things together for my own use really, rather than any sort of public consumption. Maybe someone with actual skills is better placed to come up with stuff like this.
You do not have the required permissions to view the files attached to this post.