Giter Club home page Giter Club logo

audiokitui's Introduction

AudioKit

Build Status License Platform Reviewed by Hound Twitter Follow

AudioKit is an audio synthesis, processing, and analysis platform for iOS, macOS (including Catalyst), and tvOS.

Installation

Using Xcode, you can add AudioKit and any of the other AudioKit libraries using Collections

  1. Select File -> Add Packages...
  2. Click the + icon on the bottom left of the Collections sidebar on the left.
  3. Choose Add Swift Package Collection from the pop-up menu.
  4. In the Add Package Collection dialog box, enter https://swiftpackageindex.com/AudioKit/collection.json as the URL and click the "Load" button.
  5. It will warn you that the collection is not signed, but it is fine, click "Add Unsigned Collection".
  6. Now you can add any of the AudioKit Swift Packages you need and read about what they do, right from within Xcode.

Documentation

Docs appear on the AudioKit.io Web Site. You can also generate the documentation in Xcode by pulling down the Product menu and choosing "Build Documentation".

Examples

The AudioKit Cookbook contains many recipes for simple uses for AudioKit components.

Getting help

  1. Post your problem to StackOverflow with the #AudioKit hashtag.

  2. Once you are sure the problem is not in your implementation, but in AudioKit itself, you can open a Github Issue.

  3. If you, your team or your company is using AudioKit, please consider sponsoring Aure on Github Sponsors.

audiokitui's People

Contributors

aure avatar bdrelling avatar cameronbroe avatar eljeff avatar emurray2 avatar hoopes avatar ipodishima avatar jamiehunt avatar mahal avatar maksutovic avatar matt54 avatar megastep avatar mlostekk avatar nickculbertson avatar rex4539 avatar rushairer avatar transat avatar wtholliday avatar yliu-hashed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

audiokitui's Issues

Microphone Analysis

Hi there,

First, I wanted to thank you for the work you do on AudioKit, it's great to have a high quality and well maintained framework to work on audio 💯

The issue: I wanted to know if there's a way to achieve this with AudioKit 5: https://audiokit.io/examples/MicrophoneAnalysis/

I've tried:

let audioEngine = AudioKit.AudioEngine()
guard let node = audioEngine.input else { return nil }
try? audioEngine.start()
plot = AudioKitUI.NodeOutputPlot(node)

But it throws Error: Attempt to start engine with no output and doesn't seem to work.

Reading the AudioKit 5 Migration Guide I could get to this point but I really have no idea how to use AmplitudeTap or PitchTap:

let audioEngine = AudioKit.AudioEngine()
guard let node = audioEngine.input else { return nil }
let tracker = AudioKit.AmplitudeTap(node) // probably not correct?
audioEngine.output = tracker // nope
try? audioEngine.start()
plot = AudioKitUI.NodeOutputPlot(node)

Maybe this is not possible yet on AudioKit 5, no worries, but I'd love to know that so I can go with AudioKit 4 instead.

Thank you for your help ❤️

Multi color waveform

How can I do the attached image. Is it possible to have multi colour wave form, showing the highs, mids and low, just like the attached image.

Screen Shot 2022-01-25 at 7 13 35 PM

AudioFileWaveform Crash with small audio files

Thanks for the newly added AudioFileWaveform View.

I get a crash if I add very small audio files: Fatal error: Range requires lowerBound <= upperBound

My very small audio file has only a few samples, which is probably less than the default rmsWindowSize of 256.
So the crash happens in AudioHelpers.createRMSAnalysisArray, Line 86, because numberOfOutputArrays gets negative.

Here is the audio file:
44100 _verySmall.aif.zip

Also,
I can't seem to access the functions in AudioHelpers from my own code - that might be because they are not marked public?
That is also true for the AudioWaveform struct.

Thanks!

Random "Index Out of range" crash in FloatPlot

macOS Version(s) Used to Build

macOS 13 Ventura, macOS 12 Monterey

Xcode Version(s)

Xcode 14

Description

I'm working on an iOS app that uses NodeOutputView
Randomly I get this "Index Out of range" as you can see in the screen shot

Crash Logs, Screenshots or Other Attachments (if applicable)

Screenshot 2022-12-10 alle 19 24 32

Screenshot 2022-12-07 alle 17 41 54

how to add NodeOutputView as a subview. It used to work before

Hi,
The following code used to compile and work a few months earlier (on XCode 12.5). Now, on a new mac (Monterrey and XCode 13.1) I get the following error. Any help. My AudioKit / AudioKitUI versions were set to 'main branch'.
"Cannot convert value of type 'NodeOutputView?' to expected argument type 'UIView'

   var audioMic_liveView2: NodeOutputView!
   audioMic_liveView2 = NodeOutputView(self.conductor_2.tappableNodeA)
    audioMic_liveView.addSubview(audioMic_liveView2)                      <-- shows the above error

VisionOS Support

Description

At the moment, attempting to use a AudioKitUI View, such as NodeOutputView, results in an issue when building:
Screenshot 2024-02-05 at 12 30 07 PM

According the the log, it mentions that views that utilize FloatPlot can not be used for VisionOS since MTKView and MTKViewDelegate do not support Vision OS:
Screenshot 2024-02-05 at 12 31 15 PM

Proposed Solution

Ideally an alternative way to use the FloatPane utility without relying on MTKView

Describe Alternatives You've Considered

N/A

Additional Context

No response

KnobView example, changing color, size, and other properties

I'm quite new to AudioKit and Swift programming in general. It doesn't appear to be possible to change the size, color, and other properties of a KnobView - is this accurate? If not are there any examples of using a KnobView? I didn't see anything in the Cookbook.

Thanks!

NodeOutputView visualization

Would we have possibility in future to customize visualization of NodeOutputView?

There is one project build with AudioKitUI lib but on the older version. I want to have same waveform animation. But looks like with current version I can not do too much.

Error on compilation of SpectrogramFlatView/UIColor+intermediate.swift for macOS

macOS Version(s) Used to Build

macOS 13 Ventura

Xcode Version(s)

Xcode 14

Description

Swift Test of Pull Request #82 failed:
AudioKitUI/AudioKitUI/Sources/AudioKitUI/Visualizations/SpectrogramFlatView/UIColor+intermediate.swift:4:8

error: no such module 'UIKit'
import UIKit

Needs some NSColor alternative to UIColor.

Crash Logs, Screenshots or Other Attachments (if applicable)

https://github.com/AudioKit/AudioKitUI/actions/runs/8328777809/job/22793681000?pr=82

ADSRView is not scalable

Hi. just tried out the ADSRView and it appears to be of a fixed size (440px wide I believe). Am I missing something?

XCode 13 / iOS15 - Build error

Attempting to build for XCode 13 Beta, theres a build error in MIDITrackView - same issue in 4 separate places. Line 106, 175, 190, 207 : cursorTime = .. compiler is unable to debug this line in reasonable time. Equation needs splitting up into smaller parts. I'll happily do this myself if I can contribute? thanks, Luke

Isseu when reset fileURL in MIDITrackView

macOS Version(s) Used to Build

macOS 13 Ventura

Xcode Version(s)

Xcode 14

Description

HI.
Thanks for this wonderful Package..
I am developing MIDI mixing applictions now.
When I clcik import button to fetch midi file, this midi file tracks has been displayed in MIDITrackView.
And then I click this button again to fetch other midi file, MIDITrackView displayes first imported midi file and second file at the same time..
But after then when I do above process again (but this time, I select first midi file), MIDITrackView displays only first midi file tracks as I expected..
What waht the reason??
Thanks for your support.

Crash Logs, Screenshots or Other Attachments (if applicable)

No response

sampler.loadSoundFont not working

macOS Version(s) Used to Build

macOS 13 Ventura

Xcode Version(s)

Xcode 14

Description

public func loadSequencerFile(fileURL: URL) {
        sequencer.loadMIDIFile(fromURL: fileURL)
        if sequencer.allTempoEvents.isNotEmpty {
            lastTempo = sequencer.allTempoEvents[0].1
        } else {
            lastTempo = sequencer.tempo
        }
        sequencer.setGlobalMIDIOutput(sampler.midiIn)
        do {
            try sampler.loadSoundFont("UprightPianoKW-20190703", preset: 0, bank: 0)
        } catch {
        }
    }

I replace the SoundFont with custom .sf2 file, and the url is not nil. But in the demo MIDITrack.swift still play the default beeper sound. How can I load custom .sf2 file?

Crash Logs, Screenshots or Other Attachments (if applicable)

No response

Views lack previews

I couldn't find any useful previews, making it hard to develop in AudioKitUI without using the Cookbook app.

FFTView() backgroundColor variable not working correctly.

macOS Version(s) Used to Build

macOS 13 Ventura

Xcode Version(s)

Xcode 14

Description

Hi, pretty new to all this (using for a uni project) but pretty sure I have identified an error in the FFTView struct.

In FFTView.swift navigate to the body view, and there is an if statement:
if let amplitude = fft.amplitudes[$0]{
In the amplitude bar call in the if function(line 143), I believe it should pass:
backgroundColor: backgroundColor)

It passes it in the else statement so it should be passed in the if statement too, correct?

I would fork and stuff, but this is my first time properly using version control and I don't want to mess with stuff and delete my code before I know what I'm doing, sorry!

Crash Logs, Screenshots or Other Attachments (if applicable)

With original code:
Screenshot 2024-01-19 at 15 02 35

With amended code:
Screenshot 2024-01-19 at 15 01 48

.animation is deprecated in iOS15

I believe .animation now needs to be more specific, by adding a value parameter or by changing it to .withAnimation.

I'm not sure if this is the right way, and I haven't tested it but the following suppresses the warning in FFTView.swift, for example:

struct AmplitudeBar: View {
    var amplitude: Double
    var linearGradient: LinearGradient
    var paddingFraction: CGFloat = 0.2
    var includeCaps: Bool = true
    @State private var offset: CGFloat = 0
    @State private var geoSize: CGFloat = 0

    var body: some View {
        GeometryReader { geometry in
            ZStack(alignment: .bottom) {
                // Colored rectangle in back of ZStack
                Rectangle()
                    .fill(self.linearGradient)

                // Dynamic black mask padded from bottom in relation to the amplitude
                Rectangle()
                    .fill(Color.black)
                    .mask(Rectangle().padding(.bottom, geoSize))
                    .onAppear {
                        withAnimation(.easeOut(duration: 0.15)) { self.geoSize = geometry.size.height * CGFloat(amplitude) }
                    }
//                    .animation(.easeOut(duration: 0.15))

                // White bar with slower animation for floating effect
                if includeCaps {
                    addCap(width: geometry.size.width, height: geometry.size.height)
                }
            }
            .padding(geometry.size.width * paddingFraction / 2)
            .border(Color.black, width: geometry.size.width * paddingFraction / 2)
        }
    }

    // Creates the Cap View - seperate method allows variable definitions inside a GeometryReader
    func addCap(width: CGFloat, height: CGFloat) -> some View {
        let padding = width * paddingFraction / 2
        let capHeight = height * 0.005
        let capDisplacement = height * 0.02
        let capOffset = -height * CGFloat(amplitude) - capDisplacement - padding * 2
        let capMaxOffset = -height + capHeight + padding * 2

        return Rectangle()
            .fill(Color.white)
            .frame(height: capHeight)
            .offset(x: 0.0, y: offset) // prevents offset from pushing cap outside of it's frame
            .onAppear {
                withAnimation(.easeOut(duration: 0.6)) { self.offset = -height > capOffset - capHeight ? capMaxOffset : capOffset }
            }
//            .animation(.easeOut(duration: 0.6))
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.