Audiokit drum synthesis - audiokit

I would like to make drum sounds using audiokit , the obvious thing would be to use samples, the less obvious approach would be to synthesise from base waveforms/white noise e.t.c
Two questions:
1: Has anyone got/come across any tutorials for drum synthesis on audiokit?
2: While Im asking, are there any good articles about the legalities of sound files like drum samples, for example can I generate my own sounds on the like of reason or abelton and use those in an application?

In AudioKit there's an example of synthesizing kicks and snares: https://github.com/AudioKit/AudioKit/blob/2c1049689a473b2743e97a8c0bd63d03ab32c46f/Sources/AudioKit/Nodes/Generators/Physical%20Models/DrumSynths.swift
You may find this interesting as well: https://audiokitpro.com/how-to-make-synth-drums/

Related

What kind of drum sampling options does Audiokit have?

Working in audio kit and I am looking to understand how people have incorporated drums. Obviously, the sampler is an option, but I am wondering if there is a built in option similar to some of the basic synthesis options.
There are a few options. I personally like the AppleSampler/MidiSampler like in the example but instead of using audio files you can create a EXS Sampler instrument in Logic where you can assign notes for different velocities. AppleSampler can also load AUPresets made in GarageBand and SoundFonts (SF2). The DunneAudioKit Sampler is an option if you are working with SFZ files, but I think that might be a work-in-progress in AudioKit 5. Loading WAV files directly into AppleSampler is also a good option if you just want one shot sounds.
I'm assuming you're mostly talking about playback of samples, not recording.
The best built-in option I've seen (other than AppleSampler/MidiSampler) is AudioPlayer, which lets you load in a sample and play it back on demand (from an on-screen pad, etc). MIDIListener can then help you respond to external MIDI events, etc. It works (I have a pretty big branch in my app where I tried it), but not sure it works well.
I wouldn't recommend DunneAudioKit Sampler for drums. There is no one-shot playback (so playing the same note in quick succession will cut off the previous note, even if you mess with the release). If you're trying to build a complex/realistic acoustic drum instrument, you'll also want round-robins so that variations of the same hit can be played, which Dunne also doesn't have. It can load SFZ files, but only a very limited subset of SFZ's opcodes (so again, it's missing things like round robins, mute groups, one-shot, etc).
Having gone down all those roads, I would suggest starting with AppleSampler, and I would build the EXS or aupreset file in Logic or Mainstage rather than trying to build something programmatically.
If your needs are really simple, the examples in AudioKit's recently released drum pad playground is a great place to start, loading single samples into a specific note on AppleSampler.

Access audio buffer of an AVAudioSession

Hope this question makes some sense, I'm completely lost....
In my proto-app I'm recording micro input and saving it, and so far no problems at all.
I now need to access the buffer while I'm recording it in order to pass chunks of data to another class (written in C, not by me) that will do some analysis.
I spent the whole day browsing and reading, and looks like I need use Audio Queues in order to access the buffer.
The problem is that the syntax is C, and I don't understand it at all :)
So my questions are:
1) Is there any other way to achieve what I'm looking for? I don't need in-depth explanation, just some hints and I will browse my way through :) I'm asking because I'm not 100% sure that Audio Queues are the only way to go
2) Any good tutorial or example about Audio Queues? The aurioTouch tutorial by Apple wasn't very useful (again, I don't know C). I could bypass my problems in C by following a good tutorial that a noob like me can understand
Thanks a lot, and for any help you could offer.
Good question.
You can use code written by other people like:
Novocaine - pretty straightforward. (but there are some bugs, at least in older version I used ~ 6 months ago. Something with mono and stereo.)
Momu - quite a good thing in C++ (you need to use .mm extension for you files)
Those will save you time if you want some low level audio programming. Some basic skills in C still required though. Check out this guy. His explanations and enthusiasm are excellent.
With all mentioned above you can be ready in a 1-2 days of work carrying away good skills in C.
EDIT
Basically, everywhere you work with low-level audio you deal with a C array of numbers (represented like float *audioBuffer;) called audio samples. You cycle through it in a loop, do some operations, copy it, send somewhere, analyze.
To copy it you have to allocate space for it. Actual byte size of the buffer can be calculated like this: numberOfSamples*sizeof(type).

XNA | C# : Record and Change the Voice

My aim is code a project which records human sound and changes it (with effects).
e.g : a person will record its sound over microphone (speak for a while) and than the program makes its like a baby sound.
This shall run effectively and fast (while recording the altering operation must run, too)
What is the optimum way to do it ?
Thanks
If you're looking for either XNA or DirectX to do this for you, I'm pretty sure you're going to be out of luck (I don't have much experience with DirectSound; maybe somebody can correct me). What it sounds like you want to do is realtime digital signal processing, which means that you're either going to need to write your own code to manipulate the raw waveform, or find somebody else who's already written the code for you.
If you don't have experience writing this sort of thing, it's probably best to use somebody else's signal processing library, because this sort of thing can quickly get complicated. Since you're developing for the PC, you're in luck; you can use any library you like using P/Invoke. You might try out some of the solutions suggested here and here.
MSDN has some info about the Audio namespace from XNA, and the audio recording introduced in version 4:
Working with Microphones
Recording Audio from a Microphone
Keep in mind that recorded data is returned in PCM format.

wavetables implemented on iOS

I just saw an iPhone app which uses wavetables to generate sounds. I wish to know how it is possible to implement.
I am pretty much sure that core audio have to be used, but any other idea where to go for some other info will be appreciated.
You'll want CoreAudio or AudioUnits for a responsive program (e.g. AudioQueue's latency is a bit high).
You'll want AudioFile APIs (in AudioToolbox) for reading the tables if you save them as a common audio file format (just wave files with a new shape every cycle, which is every N samples).
Beyond that, you'll probably have to write the wavetable engine. I have done that; It's not tough if you know how wavetable synthesis works and are familiar with audio signals. It's one of the most basic synthesis types.
musicdsp.org may have something you can use as a starting point for this.
After huge investigating I have found an open source project regarding this. http://gitorious.org/pdlib/
Audio file I/O: I found a great resource here. This guy created an excellent API for using ExtAudioFileServices.
A must read is Learning Core Audio. Chris Adamson and company have really put together a great resource. Chris's blog can also be found here
Also, sign up for the Core Audio mailing list.
Michael Tyson's blog/ resources are great too A Tasty Pixel.
Hope this helps!
Take a look at this tutorial on how to use the STK: http://arielelkin.github.io/articles/mandolin/
It is an open-source C++ library with cool synths, some with wavetables.

How can I generate musical notes on iOS and play them?

I am creating a musical app which generate some music. I already used MIDI functions on Mac to create a MIDI file with MIDI events (unfortunately, I don't remember names of those functions).
I am looking for a way to create instrumental notes (MIDI's or anything else) programmatically in order to play them. I also would like to have multiple channels playing those notes at the same time.
I already tried 'SoundBankPlayer' but apparently, it can't play multiple instruments at the same time.
Have you got an idea?
This answer might be a bit more work than you intended, but you can use PD on iOS to do this. More precisely, you can use libpd for iOS for the synthesis, and then use any number of community-donated patches for the sound you're looking for.
In iOS 5:
MusicSequence, MusicTrack, MusicPlayer will do what you want.
http://developer.apple.com/library/ios/#documentation/AudioToolbox/Reference/MusicSequence_Reference/Reference/reference.html#//apple_ref/doc/uid/TP40009331
Check out AUSampler AudioUnit for iOS, you'll probably have to delve into Core Audio, which has some learning curve. ;)

Resources