Latest 0.8.0
License New BSD
Platforms ios 8.0, requires ARC
Frameworks Foundation, AVFoundation, AudioToolbox

Platform iOS

Swift 2 compatible
CocoaPods compatible
Carthage compatible
License: New BSD

Audio synthesizer & sequencer engine for iOS. It enables you to create a rhythmbox/drum-machine app easily.


  • M tracks & N steps sequencer.(depends on your iOS device spec)
  • gain & pan parameters for each track
  • supports 44100Hz/16bits linearPCM audio data
  • suports over 1000bpm(actually, there is no limit)
  • supports both Swift & Objective-C

How to use

  • import HKLSynthesizer (if you use Objective-C, import AudioEngineIF.h)
  • Instantiate a AudioEngineIF object and use it.
let engine_ = AudioEngineIF()


  • start() starts synthesizer
  • stop() stops running
  • tempo property sets its bpm
  • numSteps property decides the total steps of sequencer
  • sounds property sets the sound file for each track.
  • setStepSequence() sets a note on/off sequence for the specified track.
  • setAmpGain() sets an amp gain for the specified track.
  • setPanPosition() sets a panning position for the specified track.

The class API is as follows:

@protocol AudioEngineIFProtocol;

@interface AudioEngineIF : NSObject

*  bpm
@property (nonatomic, assign) double tempo;

*  number of steps in a track
@property (nonatomic, assign) NSInteger numSteps;

*  Sound files. The number of sounds must be equal to the number of tracks
@property (nonatomic, copy) NSArray<NSString*>* _Nullable sounds;

*  Set sequence for the specified track.
*  The sequence contains NSNumber<bool> values. The size must be equal to numSteps property.
*  @param sequence array of bool values. true means note on.
*  @param trackNo  track number
- (void)setStepSequence:(NSArray<NSNumber *>* _Nonnull)sequence ofTrack:(NSInteger)trackNo;

*  Set amplifier gain(0.0-2.0) for the specified track
*  @param ampGain 0.0(mute)…1.0(original)…2.0(x2.0)
*  @param trackNo track number
- (void)setAmpGain:(double)ampGain ofTrack:(NSInteger)trackNo;

*  Set pan position(-1.0…1.0) for the specified track.
*  @param position -1.0(left)…0.0(center)…1.0(right)
*  @param trackNo  track number
- (void)setPanPosition:(double)position ofTrack:(NSInteger)trackNo;

*  Start a sequencer
- (void)start;

*  Stop a sequencer
- (void)stop;

*  Delegate object conforms to AudioEngineIFProtocol
@property (nonatomic, weak) id<AudioEngineIFProtocol> delegate;

@protocol AudioEngineIFProtocol <NSObject>
*  Tells the delegate that the sequencer has triggered at the step(time)
*  @param engine       the audio engine that the tracks are triggered
*  @param tracks       tracks that the note is ON
*  @param stepNo       step number
*  @param absoluteTime time for triggered
- (void)audioEngine:(AudioEngineIF * _Nonnull)engine didTriggeredTracks:(NSArray<NSNumber *>* _Nonnull) tracks step:(int)stepNo atTime:(uint64_t)absoluteTime;

Screenshot of sample project

The sample shows 4 track & N steps sequencer.



New BSD License


This library uses the sample program of KORG WIST SDK as audio engine.

Latest podspec

    "name": "HKLSynthesizer",
    "version": "0.8.0",
    "summary": "Audio Synthesizer & Sequencer engine for iOS.",
    "description": "HKLSynthesizer is a simple but precise audio synthesizer/sequencer engine for iOS.n**This library uses a sample program contained in KORG WIST SDK.**",
    "homepage": "",
    "screenshots": "",
    "source": {
        "git": "",
        "tag": "v0.8.0"
    "license": "New BSD",
    "authors": "Hirohito Kato",
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "requires_arc": true,
    "frameworks": [
    "module_name": "HKLSynthesizer",
    "source_files": "HKLSynthesizer/**/*.{h,cpp,mm,swift}",
    "public_header_files": [

Pin It on Pinterest

Share This