Little bit different this script in that it is a bit more reusable, it does almost the same as the first script I posted in the last post.
This time you have to have Orionology in "C:\Program Files\Orionology" and the script will make a copy of it and put it in the folder you enter when prompted "Enter the directory of your .sfs file/s you want to make .LOG\s of?" then afterwards it will delete the orionology.exe when finished, leaving the one in \Program Files\ untouched.
in case you want to run it again in future
I wrapped the script in a function so that you run the script again in the powershell session by calling
MakeOrionSongFileLogs
and it will ask you again to enter the directory with the sfs files in
I didn't make it recurse (though possible*) through lots of subfolders so it only gets the sfs in the folder you specify and that's where it makes the logs, I personally just made a copy of every sfs file on my drive and put it into one folder and ran this on them creating all the logs files and manually deleted the sfs'es making sure my originals were still in place and untouched.
--- OLD --- Make Orion Song File LOGS with orionology.exe v 2.0 -- OLD (see bottom of post for updated version) ---
- Code: Select all
<#
Title: Make Orion Song File LOGS with orionology.exe v 2.0
Author: Stockwell
Tags: Music, Production, ORION, Powershell
Description: This script generates multiple .log files by copying the orionology.exe into a specified folder that contains ORION .sfs files. It reads the .sfs files and produces corresponding log files based on their contents. Once the process is complete, the script removes the orionology.exe from the designated folder.
Requires orionology.exe by Jouni Airaksinen https://gitlab.com/stardrivestudio/orionology to be present in "C:\Program Files\Orionology\" for script to run.
Note: flags are set to maximum verbosity -vvv in this version
#>
function MakeOrionSongFileLogs {
Clear-Host
Write-Host "`nMake Orion Song File LOGS with orionology.exe v 2.0`n`n"
$targetPath = Read-Host "Enter the directory of your .sfs file/s you want to make .LOG/s of"
$orionologyPath = "C:\Program Files\Orionology"
Set-Location $targetPath
Copy-Item -Path "$orionologyPath\orionology.exe" -Destination $targetPath
$allFiles = Get-ChildItem "*.sfs"
foreach ($sfs_file in $allFiles) {
$toProcess = $sfs_file.Name
$textName = $sfs_file.BaseName
.\orionology.exe "$toProcess" -vvv 2> "$textName.LOG"
}
Remove-Item -Path "$targetPath\orionology.exe"
Write-Host "`norionology.exe sucessfully deleted from `"$targetPath`"`n"
Write-Host "Process Complete, your .LOG file/s are located in `"$targetPath`"`n"
}
MakeOrionSongFileLogs
This outputs the same thing as the first script I posted, but it's a little more reusable. You then can run the 2nd, "Make a list of samples..." script on the previous page to do that once you have the .log files. I'll follow at some point with a sample mover script and update it all in one post with less explanations if anyone is interested. which will basically be
1. automate making the logs with orionology
2. make sample lists automatically from the logs
3. use sample lists to create subfolders automatically containing the samples in the lists
Any questions, bugs or ideas then I'll see if I can set up a thread notification.
*edit, I made a 3rd version that looks through all the subfolders of a top level folder you specify and also checks it is a valid path, as I;ve started realising there's a lot more you need to think about when posting a script for others to use. I didn't delete the older versions but I've marked them as OLD so I didn't just delete them or change something if anyone has already read these posts, but I've been using this version instead.
NEW Make Orionology ORION Song File LOGS 3.0 (searches subfolders and checks user input if a valid folder is given)
- Code: Select all
<#
Title: Make Orionology ORION Song File LOGS 3.1
Author: Stockwell
Tags: Music, Production, ORION, Powershell, orionology
Description: This script generates .LOG files by copying the orionology.exe into each subfolder that contains a ORION .sfs file. It reads the .sfs files and produces corresponding log files based on their contents, it also makes the log files last modified date the same as the .sfs files last modified date.
Requires orionology.exe by Jouni Airaksinen https://gitlab.com/stardrivestudio/orionology to be present in "C:\Program Files\Orionology\" for script to run.
Note: flags are set to maximum verbosity -vvv in this version
#>
function Validate-FolderPath {
param(
[string]$path
)
if (-not (Test-Path -Path $path -PathType Container)) {
Write-Host "`nInvalid folder path: `"$path`". Please provide a valid folder path.`n" -ForegroundColor Red
return $false
}
$sfsFiles = Get-ChildItem -Path $path -Filter "*.sfs" -Recurse
if ($sfsFiles.Count -eq 0) {
Write-Host "`nNo .sfs files found in the specified folder or its subfolders.`n" -ForegroundColor Yellow
return $false
}
return $true
}
function MakeOrionSongFileLogs {
param(
[string]$rootFolderPath
)
Clear-Host
Write-Host "`nMake Orion Song File LOGS with orionology.exe v 3.1`n`n"
$rootFolderPath = Read-Host "Enter the root folder path that contains subfolders with .sfs files in"
$orionologyPath = "C:\Program Files\Orionology"
$orionologyExePath = Join-Path $orionologyPath "orionology.exe"
while (-not (Validate-FolderPath -path $rootFolderPath)) {
$rootFolderPath = Read-Host "Enter the root folder path that contains subfolders with .sfs files in"
}
$sfsFiles = Get-ChildItem -Path $rootFolderPath -Filter "*.sfs" -Recurse
foreach ($sfsFile in $sfsFiles) {
$folderPath = $sfsFile.Directory.FullName
Copy-Item -Path $orionologyExePath -Destination $folderPath -Force
$toProcess = $sfsFile.Name
$textName = $sfsFile.BaseName + ".LOG"
Set-Location $folderPath
.\orionology.exe "$toProcess" -vvv 2> $textName
$lastModified = $sfsFile.LastWriteTime
$logFile = Get-Item $textName
$logFile.LastWriteTime = $lastModified
$logFile.CreationTime = $lastModified
# Remove orionology.exe from the current folder
Remove-Item -Path (Join-Path $folderPath "orionology.exe") -Force
Write-Host "`norionology.exe successfully deleted from `"$folderPath`"`n"
}
Write-Host "Process Complete. Your .LOG file/s are located in `"$rootFolderPath`"`n"
}
MakeOrionSongFileLogs -rootFolderPath $rootFolderPath
learning as i go really