diff --git a/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Contents.json b/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Contents.json index 74722f2..3a4dc55 100644 --- a/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Contents.json +++ b/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "Linear-Spectrogram.png", + "filename" : "Linear Spectrogram.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "Linear-Spectrogram@2x.png", + "filename" : "Linear Spectrogram@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "Linear-Spectrogram@3x.png", + "filename" : "Linear Spectrogram@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear Spectrogram.png b/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear Spectrogram.png new file mode 100644 index 0000000..c03c51f Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear Spectrogram.png differ diff --git a/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear Spectrogram@2x.png b/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear Spectrogram@2x.png new file mode 100644 index 0000000..80d92b3 Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear Spectrogram@2x.png differ diff --git a/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear Spectrogram@3x.png b/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear Spectrogram@3x.png new file mode 100644 index 0000000..4e6d0a8 Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear Spectrogram@3x.png differ diff --git a/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear-Spectrogram.png b/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear-Spectrogram.png deleted file mode 100644 index 911a577..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear-Spectrogram.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear-Spectrogram@2x.png b/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear-Spectrogram@2x.png deleted file mode 100644 index 0a41ddc..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear-Spectrogram@2x.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear-Spectrogram@3x.png b/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear-Spectrogram@3x.png deleted file mode 100644 index 17c0c1c..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Linear Spectrogram.imageset/Linear-Spectrogram@3x.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Contents.json b/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Contents.json index 7ca63e6..83a6a6f 100644 --- a/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Contents.json +++ b/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "Mel-Spectrogram.png", + "filename" : "Mel Spectrogram.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "Mel-Spectrogram@2x.png", + "filename" : "Mel Spectrogram@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "Mel-Spectrogram@3x.png", + "filename" : "Mel Spectrogram@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel Spectrogram.png b/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel Spectrogram.png new file mode 100644 index 0000000..1936f7d Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel Spectrogram.png differ diff --git a/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel Spectrogram@2x.png b/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel Spectrogram@2x.png new file mode 100644 index 0000000..97790f5 Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel Spectrogram@2x.png differ diff --git a/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel Spectrogram@3x.png b/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel Spectrogram@3x.png new file mode 100644 index 0000000..b1247c3 Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel Spectrogram@3x.png differ diff --git a/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel-Spectrogram.png b/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel-Spectrogram.png deleted file mode 100644 index b3e3e2a..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel-Spectrogram.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel-Spectrogram@2x.png b/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel-Spectrogram@2x.png deleted file mode 100644 index d34b8dd..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel-Spectrogram@2x.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel-Spectrogram@3x.png b/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel-Spectrogram@3x.png deleted file mode 100644 index 8011dca..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Mel Spectrogram.imageset/Mel-Spectrogram@3x.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Contents.json b/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Contents.json index 96442b8..a131a14 100644 --- a/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Contents.json +++ b/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "Drum.png", + "filename" : "Mini Drums.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "Drum@2x.png", + "filename" : "Mini Drums@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "Drum@3x.png", + "filename" : "Mini Drums@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Drum.png b/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Drum.png deleted file mode 100644 index 325280c..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Drum.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Drum@2x.png b/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Drum@2x.png deleted file mode 100644 index 59cc706..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Drum@2x.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Drum@3x.png b/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Drum@3x.png deleted file mode 100644 index 02a71d0..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Drum@3x.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Mini Drums.png b/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Mini Drums.png new file mode 100644 index 0000000..053fd1f Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Mini Drums.png differ diff --git a/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Mini Drums@2x.png b/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Mini Drums@2x.png new file mode 100644 index 0000000..061bc61 Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Mini Drums@2x.png differ diff --git a/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Mini Drums@3x.png b/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Mini Drums@3x.png new file mode 100644 index 0000000..24917e5 Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/Mini Drums.imageset/Mini Drums@3x.png differ diff --git a/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/Contents.json b/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/Contents.json index 9da3cfe..280b62c 100644 --- a/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/Contents.json +++ b/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "MiniKeys1.png", + "filename" : "Mini Keyboard.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "MiniKeys1@2x.png", + "filename" : "Mini Keyboard@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "MiniKeys1@3x.png", + "filename" : "Mini Keyboard@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/Mini Keyboard.png b/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/Mini Keyboard.png new file mode 100644 index 0000000..af6896f Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/Mini Keyboard.png differ diff --git a/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/Mini Keyboard@2x.png b/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/Mini Keyboard@2x.png new file mode 100644 index 0000000..211afe7 Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/Mini Keyboard@2x.png differ diff --git a/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/Mini Keyboard@3x.png b/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/Mini Keyboard@3x.png new file mode 100644 index 0000000..e28fe8a Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/Mini Keyboard@3x.png differ diff --git a/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/MiniKeys1.png b/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/MiniKeys1.png deleted file mode 100644 index 62ace36..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/MiniKeys1.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/MiniKeys1@2x.png b/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/MiniKeys1@2x.png deleted file mode 100644 index 034bd47..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/MiniKeys1@2x.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/MiniKeys1@3x.png b/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/MiniKeys1@3x.png deleted file mode 100644 index 66f5538..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Mini Keyboard.imageset/MiniKeys1@3x.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Pitch Finder.imageset/Contents.json b/Miano/Assets.xcassets/Instruments/Pitch Finder.imageset/Contents.json deleted file mode 100644 index 95fcc69..0000000 --- a/Miano/Assets.xcassets/Instruments/Pitch Finder.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "filename" : "Pitch.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "Pitch@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "Pitch@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Miano/Assets.xcassets/Instruments/Pitch Finder.imageset/Pitch.png b/Miano/Assets.xcassets/Instruments/Pitch Finder.imageset/Pitch.png deleted file mode 100644 index 63b0de2..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Pitch Finder.imageset/Pitch.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Pitch Finder.imageset/Pitch@2x.png b/Miano/Assets.xcassets/Instruments/Pitch Finder.imageset/Pitch@2x.png deleted file mode 100644 index acf8af9..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Pitch Finder.imageset/Pitch@2x.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Pitch Finder.imageset/Pitch@3x.png b/Miano/Assets.xcassets/Instruments/Pitch Finder.imageset/Pitch@3x.png deleted file mode 100644 index 423c651..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Pitch Finder.imageset/Pitch@3x.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Vocals.imageset/Contents.json b/Miano/Assets.xcassets/Instruments/Vocals.imageset/Contents.json index 7714be9..16dc18e 100644 --- a/Miano/Assets.xcassets/Instruments/Vocals.imageset/Contents.json +++ b/Miano/Assets.xcassets/Instruments/Vocals.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "Vocal.png", + "filename" : "Vocals.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "Vocal@2x.png", + "filename" : "Vocals@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "Vocal@3x.png", + "filename" : "Vocals@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocal.png b/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocal.png deleted file mode 100644 index 87bffc0..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocal.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocal@2x.png b/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocal@2x.png deleted file mode 100644 index 3393cf2..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocal@2x.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocal@3x.png b/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocal@3x.png deleted file mode 100644 index 7d67fe0..0000000 Binary files a/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocal@3x.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocals.png b/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocals.png new file mode 100644 index 0000000..59a24c6 Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocals.png differ diff --git a/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocals@2x.png b/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocals@2x.png new file mode 100644 index 0000000..84aa021 Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocals@2x.png differ diff --git a/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocals@3x.png b/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocals@3x.png new file mode 100644 index 0000000..7ccbd20 Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/Vocals.imageset/Vocals@3x.png differ diff --git a/Miano/Assets.xcassets/Instruments/White Noise.imageset/Contents.json b/Miano/Assets.xcassets/Instruments/White Noise.imageset/Contents.json index 19daa99..cda2838 100644 --- a/Miano/Assets.xcassets/Instruments/White Noise.imageset/Contents.json +++ b/Miano/Assets.xcassets/Instruments/White Noise.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "Noise.png", + "filename" : "White Noise.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "Noise@2x.png", + "filename" : "White Noise@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "Noise@3x.png", + "filename" : "White Noise@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/Miano/Assets.xcassets/Instruments/White Noise.imageset/Noise.png b/Miano/Assets.xcassets/Instruments/White Noise.imageset/Noise.png deleted file mode 100644 index e534a6a..0000000 Binary files a/Miano/Assets.xcassets/Instruments/White Noise.imageset/Noise.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/White Noise.imageset/Noise@2x.png b/Miano/Assets.xcassets/Instruments/White Noise.imageset/Noise@2x.png deleted file mode 100644 index c4554a5..0000000 Binary files a/Miano/Assets.xcassets/Instruments/White Noise.imageset/Noise@2x.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/White Noise.imageset/Noise@3x.png b/Miano/Assets.xcassets/Instruments/White Noise.imageset/Noise@3x.png deleted file mode 100644 index c9ca497..0000000 Binary files a/Miano/Assets.xcassets/Instruments/White Noise.imageset/Noise@3x.png and /dev/null differ diff --git a/Miano/Assets.xcassets/Instruments/White Noise.imageset/White Noise.png b/Miano/Assets.xcassets/Instruments/White Noise.imageset/White Noise.png new file mode 100644 index 0000000..3bd8163 Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/White Noise.imageset/White Noise.png differ diff --git a/Miano/Assets.xcassets/Instruments/White Noise.imageset/White Noise@2x.png b/Miano/Assets.xcassets/Instruments/White Noise.imageset/White Noise@2x.png new file mode 100644 index 0000000..45a980c Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/White Noise.imageset/White Noise@2x.png differ diff --git a/Miano/Assets.xcassets/Instruments/White Noise.imageset/White Noise@3x.png b/Miano/Assets.xcassets/Instruments/White Noise.imageset/White Noise@3x.png new file mode 100644 index 0000000..f30bce4 Binary files /dev/null and b/Miano/Assets.xcassets/Instruments/White Noise.imageset/White Noise@3x.png differ diff --git a/Miano/Instruments/MiniSpectrogram/MiniSpectrogram.swift b/Miano/Instruments/MiniSpectrogram/MiniSpectrogram.swift index 38878f6..237a8cd 100644 --- a/Miano/Instruments/MiniSpectrogram/MiniSpectrogram.swift +++ b/Miano/Instruments/MiniSpectrogram/MiniSpectrogram.swift @@ -19,7 +19,9 @@ struct MiniSpectrogram: View { var body: some View { SpectrogramView(audioSpectrogram: audioSpectrogram, .mel) .environmentObject(audioSpectrogram) - + .onAppear(perform: { + audioSpectrogram.startRunning() + }) .onChange(of: scenePhase) { phase in if phase == .active { Task(priority: .userInitiated) { @@ -27,6 +29,10 @@ struct MiniSpectrogram: View { } } } + + .onReceive(NotificationCenter.default.publisher(for: NSWindow.willCloseNotification)) { _ in + audioSpectrogram.stopRunning() + } } } diff --git a/Miano/Instruments/MiniSpectrogram/SpectrogramKit/AudioSpectrogram+AVCaptureAudioDataOutputSampleBufferDelegate.swift b/Miano/Instruments/MiniSpectrogram/SpectrogramKit/AudioSpectrogram+AVCaptureAudioDataOutputSampleBufferDelegate.swift index 494e6a6..6321248 100644 --- a/Miano/Instruments/MiniSpectrogram/SpectrogramKit/AudioSpectrogram+AVCaptureAudioDataOutputSampleBufferDelegate.swift +++ b/Miano/Instruments/MiniSpectrogram/SpectrogramKit/AudioSpectrogram+AVCaptureAudioDataOutputSampleBufferDelegate.swift @@ -149,4 +149,13 @@ extension AudioSpectrogram: AVCaptureAudioDataOutputSampleBufferDelegate { } } } + + func stopRunning() { + print("Stop running") + sessionQueue.async { + if AVCaptureDevice.authorizationStatus(for: .audio) == .authorized { + self.captureSession.stopRunning() + } + } + } }