iRTcmix Basics
with special guest-star
Damon Holzborn!
Links
iRTcmix Project Setup
Select menu File -> New -> Project
Select iOS Application in the left column then select Single View Application; click Next
Give your project a Product Name, Company Identifier (com.yourcompany), Device Family (choose iPhone or iPad if you're just starting out), leave all checkboxes unchecked; click Next
Navigate to directory in which you wish to save your project and click Create
Drag RTcmixPlayer.h, RTcmixPlayer.m and libIRTCMIX.a from the Finder into the Project Navigator pane in Xcode (wherever you want them)
check Copy items into destination group's folder
Select your YourProjectName in the Project Navigator (top item in the left column) then select YourProjectName under Targets
Choose the General tab
Click the + in the Linked Frameworks and Libraries section (you may need to scroll down to see this heading)
Select AVFoundation.framework
Still in YourProjectName under Targets
Click the Build Settings tab
Find Other Linker Flags (under the Linking heading, scroll down about 1/3)
add -lstdc++ to the field to the right of Other Linker Flags
The project should now build without errors (but won't do anything...).
Hello Beep
ViewController.h
- add to top:
#import "RTcmixPlayer.h"
- add to @interface:
@property (nonatomic, strong) RTcmixPlayer *rtcmixManager;
ViewController.m
- add to viewDidLoad method
self.rtcmixManager = [RTcmixPlayer sharedManager];
[self.rtcmixManager startAudio];
[self.rtcmixManager parseScoreWithNSString:@"WAVETABLE(0, 3.5, 28000, 9.0, .5)"];
The project should now build and beep.
iRTcmix API
Play Scores
There are three methods for executings scores.
- With a string:
- (void)parseScoreWithNSString:(NSString *)score;
- With a full file path:
- (void)parseScoreWithFilePath:(NSString *)path;
- With name of resource (i.e. file included in project in the default location):
- (void)parseScoreWithResource:(NSString *)resource ofType:(NSString *)type;
- (void)flushAllScores;
Real-time Control
- (void)setInlet:(int)inlet withValue:(Float32)value;
Load Audio Buffers
- With a full file path:
- (int)setSampleBuffer:(NSString *)bufferName withFilePath:(NSString *)path;
- With name of resource (i.e. file included in project in the default location):
- (int)setSampleBuffer:(NSString *)bufferName withResource:(NSString *)resource ofType:(NSString *)type;
Delegate Methods
Process MAXBANG messages:
- (void)maxBang;
Process MAXMESSAGE messages:
- (void)maxMessage:(NSArray *)message;
Process errors and print messages:
- (void)maxError:(NSString *)error;
Receive warnings about audio settings:
- (void)audioSettingWarning:(NSDictionary *)warnings;
Audio Parameter Setup
NSString *avAudioSessionCategory;
NSMutableArray *avAudioSessionCategoryOptions;
double preferredSampleRate;
float preferredBufferSize;
NSInteger preferredNumberOfChannels;
Methods:
startAudio
resetAudioParameters
pauseRTcmix
resumeRTcmix
destroyRTcmix