This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MULTIPLE SIGNAL GENERATOR! | |
__block float *phases = nil; | |
__block float dbVal = 0.0; | |
__block float *dbData; | |
[audioManager setOutputBlock:^(float *data, UInt32 numFrames, UInt32 numChannels) | |
{ | |
float samplingRate = audioManager.samplingRate; | |
NSUInteger activeSignalCount = [tones count]; | |
// Initialize phases |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MULTIPLE SIGNAL GENERATOR! | |
__block float *phases = nil; | |
[audioManager setOutputBlock:^(float *data, UInt32 numFrames, UInt32 numChannels) | |
{ | |
float samplingRate = audioManager.samplingRate; | |
NSUInteger activeSignalCount = [tones count]; | |
// Initialize phases | |
if (phases == nil) { | |
NSLog(@"Initializing float array"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[audioManager setOutputBlock:^(float *data, UInt32 numFrames, UInt32 numChannels) | |
{ | |
// Measure dB | |
float maxAmp = abs(data[0]); | |
for (int i=0; i < numFrames; ++i) | |
{ | |
for (int iChannel = 0; iChannel < numChannels; ++iChannel) | |
{ | |
if (abs(data[i*numChannels + iChannel]) > maxAmp) { | |
maxAmp = abs(data[i*numChannels + iChannel]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - | |
#pragma mark Audio processing graph setup | |
// This method performs all the work needed to set up the audio processing graph: | |
// 1. Instantiate and open an audio processing graph | |
// 2. Obtain the audio unit nodes for the graph | |
// 3. Configure the Multichannel Mixer unit | |
// * specify the number of input buses |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - | |
#pragma mark Audio processing graph setup | |
// This method performs all the work needed to set up the audio processing graph: | |
// 1. Instantiate and open an audio processing graph | |
// 2. Obtain the audio unit nodes for the graph | |
// 3. Configure the Multichannel Mixer unit | |
// * specify the number of input buses | |
// * specify the output sample rate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - | |
#pragma mark Audio processing graph setup | |
// This method performs all the work needed to set up the audio processing graph: | |
// 1. Instantiate and open an audio processing graph | |
// 2. Obtain the audio unit nodes for the graph | |
// 3. Configure the Multichannel Mixer unit | |
// * specify the number of input buses | |
// * specify the output sample rate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Original comments from Apple: | |
File: MixerHostAudio.m | |
Abstract: Audio object: Handles all audio tasks for the application. | |
Version: 1.0 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
removeLastSentence = (text) -> | |
lastSeparator = Math.max( | |
text.lastIndexOf("."), | |
text.lastIndexOf("!"), | |
text.lastIndexOf("?") | |
) | |
revtext = text.split('').reverse().join('') | |
sep = revtext.search(/[A-Z]\s+(\")?[\.\!\?]/) | |
lastTag = text.length-revtext.search(/\/\</) - 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *xmldata_s = [[NSString alloc] initWithContentsOfFile:dataFile encoding:NSUTF8StringEncoding error:nil]; | |
NSData *xmldata = [xmldata_s dataUsingEncoding: NSUTF8StringEncoding]; | |
NSMutableArray *pp = [NSPropertyListSerialization propertyListFromData: xmldata | |
mutabilityOption: NSPropertyListMutableContainers | |
format: NSPropertyListXMLFormat_v1_0 | |
errorDescription: nil]; | |
NSLog(@"Deserialized: %@", pp); | |
[[NSUserDefaults standardUserDefaults] setObject:pp forKey:kPagePoints]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for( int i = 0; i < 4; i++ ) { | |
UIWebView *wview; | |
int wx; | |
if (i < 2) { | |
wx = 12; | |
} else { | |
wx = 512; | |
} | |
wview = [[UIWebView alloc] initWithFrame:CGRectMake(wx, 16, 500, 716)]; |