From 961ace637e507b1912a96b7059c5c40375d0d195 Mon Sep 17 00:00:00 2001 From: Robert McGovern Date: Sat, 8 Oct 2022 22:18:29 +0100 Subject: [PATCH] fleshing out a little more, added some thoughts, and a waveform package --- .../project.pbxproj | 31 ++++++++++ .../xcshareddata/swiftpm/Package.resolved | 14 +++++ .../SoundpoolBrowser/Models/Brain.swift | 38 ++++++++++++ .../SoundpoolBrowser/Models/Category.swift | 13 ++++ .../SoundpoolBrowser/Models/Genre.swift | 13 ++++ .../SoundpoolBrowser/Models/Instrument.swift | 10 ++++ notes/file structure.txt | 59 ++++--------------- notes/thoughts.txt | 4 ++ 8 files changed, 136 insertions(+), 46 deletions(-) create mode 100644 SoundpoolBrowser/SoundpoolBrowser.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 SoundpoolBrowser/SoundpoolBrowser/Models/Category.swift diff --git a/SoundpoolBrowser/SoundpoolBrowser.xcodeproj/project.pbxproj b/SoundpoolBrowser/SoundpoolBrowser.xcodeproj/project.pbxproj index 7eb4326..56ca53c 100644 --- a/SoundpoolBrowser/SoundpoolBrowser.xcodeproj/project.pbxproj +++ b/SoundpoolBrowser/SoundpoolBrowser.xcodeproj/project.pbxproj @@ -17,6 +17,8 @@ E2D9A8F228F20DF500519159 /* Scale.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2D9A8F128F20DF500519159 /* Scale.swift */; }; E2D9A8F628F2104C00519159 /* FileScanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2D9A8F528F2104C00519159 /* FileScanner.swift */; }; E2D9A8F828F2118D00519159 /* Brain.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2D9A8F728F2118D00519159 /* Brain.swift */; }; + E2D9A8FA28F21B0B00519159 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2D9A8F928F21B0B00519159 /* Category.swift */; }; + E2D9A8FD28F2207B00519159 /* Waveform in Frameworks */ = {isa = PBXBuildFile; productRef = E2D9A8FC28F2207B00519159 /* Waveform */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -32,6 +34,7 @@ E2D9A8F128F20DF500519159 /* Scale.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Scale.swift; sourceTree = ""; }; E2D9A8F528F2104C00519159 /* FileScanner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileScanner.swift; sourceTree = ""; }; E2D9A8F728F2118D00519159 /* Brain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Brain.swift; sourceTree = ""; }; + E2D9A8F928F21B0B00519159 /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -39,6 +42,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + E2D9A8FD28F2207B00519159 /* Waveform in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -92,6 +96,7 @@ E2D9A8EF28F20D5300519159 /* Instrument.swift */, E2D9A8F128F20DF500519159 /* Scale.swift */, E2D9A8F728F2118D00519159 /* Brain.swift */, + E2D9A8F928F21B0B00519159 /* Category.swift */, ); path = Models; sourceTree = ""; @@ -127,6 +132,9 @@ dependencies = ( ); name = SoundpoolBrowser; + packageProductDependencies = ( + E2D9A8FC28F2207B00519159 /* Waveform */, + ); productName = SoundpoolBrowser; productReference = E2D9A8D728F20AF200519159 /* SoundpoolBrowser.app */; productType = "com.apple.product-type.application"; @@ -155,6 +163,9 @@ Base, ); mainGroup = E2D9A8CE28F20AF200519159; + packageReferences = ( + E2D9A8FB28F2207B00519159 /* XCRemoteSwiftPackageReference "Waveform" */, + ); productRefGroup = E2D9A8D828F20AF200519159 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -186,6 +197,7 @@ E2D9A8F828F2118D00519159 /* Brain.swift in Sources */, E2D9A8DD28F20AF200519159 /* ContentView.swift in Sources */, E2D9A8DB28F20AF200519159 /* SoundpoolBrowserApp.swift in Sources */, + E2D9A8FA28F21B0B00519159 /* Category.swift in Sources */, E2D9A8F628F2104C00519159 /* FileScanner.swift in Sources */, E2D9A8F228F20DF500519159 /* Scale.swift in Sources */, E2D9A8EE28F20D3B00519159 /* HarmonyTable.swift in Sources */, @@ -384,6 +396,25 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + E2D9A8FB28F2207B00519159 /* XCRemoteSwiftPackageReference "Waveform" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/AudioKit/Waveform/"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 1.0.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + E2D9A8FC28F2207B00519159 /* Waveform */ = { + isa = XCSwiftPackageProductDependency; + package = E2D9A8FB28F2207B00519159 /* XCRemoteSwiftPackageReference "Waveform" */; + productName = Waveform; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = E2D9A8CF28F20AF200519159 /* Project object */; } diff --git a/SoundpoolBrowser/SoundpoolBrowser.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/SoundpoolBrowser/SoundpoolBrowser.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..6c2a61b --- /dev/null +++ b/SoundpoolBrowser/SoundpoolBrowser.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,14 @@ +{ + "pins" : [ + { + "identity" : "waveform", + "kind" : "remoteSourceControl", + "location" : "https://github.com/AudioKit/Waveform/", + "state" : { + "revision" : "5b96ddbe28006136a6a334eb7998c91c1da686d6", + "version" : "1.0.1" + } + } + ], + "version" : 2 +} diff --git a/SoundpoolBrowser/SoundpoolBrowser/Models/Brain.swift b/SoundpoolBrowser/SoundpoolBrowser/Models/Brain.swift index b925c47..c67c4f3 100644 --- a/SoundpoolBrowser/SoundpoolBrowser/Models/Brain.swift +++ b/SoundpoolBrowser/SoundpoolBrowser/Models/Brain.swift @@ -7,7 +7,45 @@ import SwiftUI +/* + + First start show dialog for folder location + + Scan for Genres + Scan for Categories in those Genres + Scan for Instruments in the Categories + For each Instrument + strip k_ w_ o_ from start + split into name + sample number + (what regex for that?) + + */ + class Brain: ObservableObject { } +/* + + so for "Soundpool DVD Collection 17", contains folder of ... Genre / Collection / Style? + + 'Breakbeat Vol. 1' 'Chillout Vol. 5' + 'DanceElectro Vol. 9' 'Dubstep Vol. 1' + 'HipHop Vol. 12' 'Jazz Vol. 1' + 'Minimal DeepHouse Vol. 9' 'MovieScore Vol. 8' + 'RockAlternative Vol. 3' 'TechnoTrance Vol. 13' + + [Soundpool DVD Collection 17]$ ls Jazz\ Vol.\ 1/ ... Instrument / Category + + Bass BPM.inf Brass + Drums Guitar Keys + Piano Synth Vocals + + [Soundpool DVD Collection 17]$ ls -la Jazz\ Vol.\ 1/Synth/ ... Instrument / Sample + 'k_Echoes A 1.wav' 'k_Echoes A 2.wav' 'k_Echoes A 3.wav' + 'k_Echoes A 4.wav' 'k_Echoes A 5.wav' 'k_Echoes A 6.wav' + 'k_Glass 1.wav' 'k_Glass 2.wav' 'k_Glass 3.wav' + 'k_Glass 4.wav' 'k_Glass 5.wav' 'k_Glass 6.wav' + + + */ diff --git a/SoundpoolBrowser/SoundpoolBrowser/Models/Category.swift b/SoundpoolBrowser/SoundpoolBrowser/Models/Category.swift new file mode 100644 index 0000000..22402cc --- /dev/null +++ b/SoundpoolBrowser/SoundpoolBrowser/Models/Category.swift @@ -0,0 +1,13 @@ +// +// Category.swift +// SoundpoolBrowser +// +// Created by Robert McGovern on 08/10/2022. +// + +import Foundation + +struct Category { + var name: String + var instruments: [Instrument] +} diff --git a/SoundpoolBrowser/SoundpoolBrowser/Models/Genre.swift b/SoundpoolBrowser/SoundpoolBrowser/Models/Genre.swift index 2b3a34a..de37c14 100644 --- a/SoundpoolBrowser/SoundpoolBrowser/Models/Genre.swift +++ b/SoundpoolBrowser/SoundpoolBrowser/Models/Genre.swift @@ -18,3 +18,16 @@ import Foundation date liked: date date scanned: date */ + +struct Genre { + var name: String + var volumeNumber: Int + var tempo: Int + var scale: Scale + var sampleKey: [Int: Scale] + var liked: Bool + var dateLiked: Date + var dateScanned: Date + + var categories: Category +} diff --git a/SoundpoolBrowser/SoundpoolBrowser/Models/Instrument.swift b/SoundpoolBrowser/SoundpoolBrowser/Models/Instrument.swift index 85fb848..80a4f13 100644 --- a/SoundpoolBrowser/SoundpoolBrowser/Models/Instrument.swift +++ b/SoundpoolBrowser/SoundpoolBrowser/Models/Instrument.swift @@ -16,3 +16,13 @@ import Foundation date liked: date length: number (seconds) */ + +struct Instrument { + var name: String + var number: Int + var scale: Scale + var location: String + var liked: Bool + var dateLiked: Date + var length: Float +} diff --git a/notes/file structure.txt b/notes/file structure.txt index 8ff7987..cb4bbef 100644 --- a/notes/file structure.txt +++ b/notes/file structure.txt @@ -1,4 +1,4 @@ -so for "Soundpool DVD Collection 17", contains folder of ... +so for "Soundpool DVD Collection 17", contains folder of ... Genre / Collection / Style? 'Breakbeat Vol. 1' 'Chillout Vol. 5' 'DanceElectro Vol. 9' 'Dubstep Vol. 1' @@ -6,63 +6,30 @@ so for "Soundpool DVD Collection 17", contains folder of ... 'Minimal DeepHouse Vol. 9' 'MovieScore Vol. 8' 'RockAlternative Vol. 3' 'TechnoTrance Vol. 13' ----- - -[Soundpool DVD Collection 17]$ ls Jazz\ Vol.\ 1/ +[Soundpool DVD Collection 17]$ ls Jazz\ Vol.\ 1/ ... Instrument / Category Bass BPM.inf Brass Drums Guitar Keys Piano Synth Vocals ---- - -[Soundpool DVD Collection 17]$ ls -la Jazz\ Vol.\ 1/Synth/ --rw-r--r-- 1 rob rob 707348 Jul 16 2010 'k_Echoes A 1.wav' --rw-r--r-- 1 rob rob 707390 Jul 16 2010 'k_Echoes A 2.wav' --rw-r--r-- 1 rob rob 707390 Jul 16 2010 'k_Echoes A 3.wav' --rw-r--r-- 1 rob rob 707348 Jul 16 2010 'k_Echoes A 4.wav' --rw-r--r-- 1 rob rob 707390 Jul 16 2010 'k_Echoes A 5.wav' --rw-r--r-- 1 rob rob 707558 Jul 16 2010 'k_Echoes A 6.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Glass 1.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Glass 2.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Glass 3.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Glass 4.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Glass 5.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Glass 6.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Melody B 1.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Melody B 2.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Melody B 3.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Melody B 4.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Melody B 5.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Melody B 6.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Pad A 1.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Pad A 2.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Pad A 3.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Pad A 4.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Pad A 5.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Pad A 6.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Whistle A 1.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Whistle A 2.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Whistle A 3.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Whistle A 4.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Whistle A 5.wav' --rw-r--r-- 1 rob rob 706714 Jul 16 2010 'k_Whistle A 6.wav' +[Soundpool DVD Collection 17]$ ls -la Jazz\ Vol.\ 1/Synth/ ... Instrument / Sample +'k_Echoes A 1.wav' 'k_Echoes A 2.wav' 'k_Echoes A 3.wav' +'k_Echoes A 4.wav' 'k_Echoes A 5.wav' 'k_Echoes A 6.wav' +'k_Glass 1.wav' 'k_Glass 2.wav' 'k_Glass 3.wav' +'k_Glass 4.wav' 'k_Glass 5.wav' 'k_Glass 6.wav' +.... --- Other file examples of files ... --rw-r--r-- 1 rob rob 353914 Jul 16 2010 'o_Tremolo 6.wav' --rw-r--r-- 1 rob rob 1412738 Jul 16 2010 'w_Ballad A 1.wav' +'o_Tremolo 6.wav' 'w_Ballad A 1.wav' 'k_Whistle A 6.wav' -'Umber Horns 1.wav' -'Umber Horns 2.wav' -'Umber Horns 3.wav' -'Umber Horns 4.wav' --rw-rw---- 1 deluge deluge 1059504 Oct 8 18:26 'Umber Horns 5.wav' --rw-rw---- 1 deluge deluge 1059504 Oct 8 18:15 'Umber Horns 6.wav' --rw-rw---- 1 deluge deluge 1059504 Oct 8 18:15 'Umber Horns 7.wav' +--- +'Umber Horns 1.wav' 'Umber Horns 2.wav' 'Umber Horns 3.wav' +'Umber Horns 4.wav' 'Umber Horns 5.wav' 'Umber Horns 6.wav' +'Umber Horns 7.wav' 'Beige Bass 1.wav' 'Gamboge BassA 6.wav' 'Limerick ViolinsA 4.wav' 'Orange Basses 2.wav' 'Orchid Strings 7.wav' 'Viridian Pizz 5.wav' 'Beige Bass 2.wav' 'Gamboge BassA 7.wav' 'Limerick ViolinsA 5.wav' 'Orange Basses 3.wav' 'Orchid Violins 1.wav' 'Viridian Pizz 6.wav' diff --git a/notes/thoughts.txt b/notes/thoughts.txt index 852231d..85deaed 100644 --- a/notes/thoughts.txt +++ b/notes/thoughts.txt @@ -5,3 +5,7 @@ --- +show waveform? https://www.audiokit.io/AudioKitUI/documentation/audiokitui/waveform + +https://www.audiokit.io/Waveform/documentation/waveform +https://github.com/AudioKit/Waveform/