audiokit

Recording midi with Audiokit

a 夏天 提交于 2019-12-10 11:19:43
问题 I want to record midi audio using AudioKit. I managed to do it but when I replay the recorded notes, there are delays and the timing of the notes is not always the good one, especially when I play fast during the recording. Here is how i did it : I have three buttons, one for Do (Midi number 60), one for Re (midi number 62), one for Mi (64). When a button is pushed down i send a noteOn, and I save the time in a 88 table of Floats. When the button is pushed up, I send a noteOff event, and I

AudioKit ios AKSequencer Not Restarting Playback Accurately

孤街浪徒 提交于 2019-12-10 10:47:08
问题 I'm trying to use AudioKit to playback a sound on each beat of a measure(s). Although I've implemented the code from this similar question regarding callbacks via AudioKit, I can't seem to get the sequencer to update changes and playback properly. It will play once accurately, however after rewinding and changing the values it will only use the initial values (or not playback at all). My intent is to create a struct of measures with beat values for each measure, then use MIDI and the callback

Save AKSequencer output to local file

时间秒杀一切 提交于 2019-12-10 10:44:20
问题 I'm having issues while saving a midi using a sequencer to a local file. The audio is being created and saved, but the audio output is completely different as it should be. Here is the code I'm using: var sequencer : AKSequencer? let piano = AKMIDISampler() var offlineRender = AKOfflineRenderNode() do { try piano.loadWav("mixloop") piano >>> offlineRender AudioKit.output = offlineRender sequencer = AKSequencer(filename: "melody") sequencer?.setGlobalMIDIOutput(piano.midiIn) AudioKit.start()

AudioKit: change sound based upon gyro data / swing phone around?

99封情书 提交于 2019-12-08 13:29:14
问题 This is an AudioKit question: I am really new to AudioKit and audio in general. My question is: How could I use AudioKit to create a sound that changes as I move my phone around? I already know how to get the gyro information so lets say I can take the gyro values between 0-10, zero being no movement and 10 being a lot of movement of the phone. I want to translate that into sounds that corresponds to how hard/quickly the phone is being moved. To start just move the sound higher in pitch as

AudioKit 4.6 release: AKMIDICallbackInstrument not calling back

时光总嘲笑我的痴心妄想 提交于 2019-12-08 06:17:23
问题 Really excited by all the additions in 4.6! After reviewing most of the changes, I did not see anything explicitly different in AKMIDICallbackInstrument , however, I cannot get the call back to work anymore. Here is my implementation: var sequencer: AKSequencer = AKSequencer() var callbackTrack: AKMusicTrack = AKMusicTrack() var callbackInst: AKMIDICallbackInstrument = AKMIDICallbackInstrument() --- public func setupSequencerWithBeats(beats: Int, bpm: Double) { print("Num beats: \(beats) |

How to apply filters to previously recorded sound and save modified version using AudioKit?

心已入冬 提交于 2019-12-08 04:26:20
问题 There is a previously recorded sound file containing user's voice. What I need to do is apply some sound filter to change the voice and after that be able to save and play modified version. AudioKit can open file using [[AKFileInput alloc] initWithFilename:file1]; and save with [[AKManager sharedManager] renderToFile:outputFile forDuration:duration]; Any ideas how to apply some effects between these 2 commands? 回答1: In addition to opening the file with AKFileInput, you have to play it back,

AudioKit - Stereo channel flipping from input to output?

你。 提交于 2019-12-08 02:07:45
问题 I'm using AudioKit to create an experimental iOS audio application. Currently, I'm trying to reroute the left channel of my AKStereoInput to the right channel of AudioKit.output, and the right channel of my AKStereoInput to the left channel of the output. I was able to simply pan the signal, but I have a hard time splitting the input signal, swapping the left/right channels, and reconnecting them to the output. Any help is appreciated! 回答1: This is trivial to do at C DSP Level, but I also

Long notes after stop AKSequencer

梦想与她 提交于 2019-12-08 01:04:16
问题 Sometimes I need some long notes to keep playing after the sequencer stops. akSequencer.stop() // Need to put some code to ask the question Is there any way to keep the sound of a long note when AKSequencer stops? 回答1: Instead of connecting your AKMusicTrack's MIDI output directly to your sampler (or oscillator bank or whatever), send it to an AKCallbackInstrument . In the callback function, you can check the status of the sequencer's MIDI messages, and send your the noteOn and noteOff

AKSequencer Count in for one or two bars

a 夏天 提交于 2019-12-07 14:20:05
问题 Need to play 1 or 2 bars for count In before the current sequence start playing. Just to play a click for count in. It would be cool to be able to do something like ... player.sequencer.setTime(MusicTimeStamp(-4)) It set time to 0, doesn't work. What's the way to make a count in with AKSequencer ? 回答1: Edited: Originally I thought you could simply add the count in bars to the end of the existing sequence, then reset to the proper length using a AKCallbackInstrument with an event at beat zero,

AKFFTTap stops working when initialized second time

我们两清 提交于 2019-12-06 11:06:29
This is a continuation of the discussion in here . I'm building a voice recorder app for iOS in Swift, and I have a custom waveform graphic that I feed data to from a AKFFTTap object. I had a problem that the FFT starts generating all zeros after a while. In order to diagnose and solve this, I'm trying to re-initialize all the nodes and taps whenever the user starts recording (assuming that would solve the issue). Previously, AudioKit was initialized and started when the view was loaded, and that's it. So, now I try to re-allocate everything each recording, and it works, except that every re