<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Stefan Popp</title>
	<atom:link href="http://www.stefanpopp.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stefanpopp.de</link>
	<description>Software developer</description>
	<lastBuildDate>Mon, 30 Jan 2012 20:21:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>UITableViewController background image with UINavigationController</title>
		<link>http://www.stefanpopp.de/2011/uitableviewcontroller-background-image/</link>
		<comments>http://www.stefanpopp.de/2011/uitableviewcontroller-background-image/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 10:56:21 +0000</pubDate>
		<dc:creator>Stefan Popp</dc:creator>
				<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://www.stefanpopp.de/?p=417</guid>
		<description><![CDATA[The title is not complete but i have to keep him tight for Google My case My problem was that i have detail views for my UITableViewCells and without a UINavigationController you cant push them or get back to the table. While i have a tabbar navigation in my app i have to initialize a<a href="http://www.stefanpopp.de/2011/uitableviewcontroller-background-image/">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<p>The title is not complete but i have to keep him tight for Google <img src='http://www.stefanpopp.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h2>My case</h2>
<p>My problem was that i have detail views for my UITableViewCells and without a UINavigationController you cant push them or get back to the table. While i have a tabbar navigation in my app i have to initialize a UINavigationController programmatically and set the UITableViewController as the root controller.</p>
<p>But this is a problem if you want to set a background image which is static behind the table. You cant set a background image behind a UITableViewController in the Interface builder so you have to add them programmatically too. This challenge is a bit wired, cause if you try to add them on the current view controller it will fail.</p>
<p>What you gonna have to do is to get the navigation controller which is the parent view controller. You should prefer to add the subview before the table view is shown to the user. To save some performance, check if a UIImageView is already present so that you dont need to  load and push the same image again.</p>
<p><a href="http://www.stefanpopp.de/wp-content/uploads/2011/11/UITableViewController-background.png"><img class="aligncenter size-medium wp-image-426" title="UITableViewController background" src="http://www.stefanpopp.de/wp-content/uploads/2011/11/UITableViewController-background-200x300.png" alt="" width="200" height="300" /></a></p>
<h2>The magic</h2>
<pre class="brush: objc; title: ; notranslate">
- (void)viewDidAppear:(BOOL)animated
{
    NSArray *subViews = [self.parentViewController.view subviews];
    if ([[[[subViews objectAtIndex:0] subviews] objectAtIndex:0] class] != @&quot;UIImageView&quot;) {
        UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@&quot;Apple_background&quot;]];
        backgroundImageView.frame = [[UIScreen mainScreen] applicationFrame];
        [[subViews objectAtIndex:0] addSubview:backgroundImageView];
        [[subViews objectAtIndex:0] sendSubviewToBack:backgroundImageView];
    }
    [super viewDidAppear:animated];
}
</pre>
<p>At first we load the subviews array of the parent view, which is our navigation controller. If the UIImageView is not already present we load our image with our application frame rect.<br />
This prevents that we add the view to a area where content could be already present (e.g. top status bar, or navigation bars). After we modified our image we add the subview to the navigation controller and send them to the back. This is pretty easy but before you can see anything, you have to make your table transparent. You do this by check the opuaqe flag in the interface builder for your UITableView. Sometimes the table cells dont get transparent, in this case just click again on the table view and set the background color to default. Do it again if the color is already on default. Its a bug in XCode 4.2. <a href="http://www.stefanpopp.de/wp-content/uploads/2011/11/opaque-background-color.png"><img class="aligncenter size-medium wp-image-421" title="opaque background color" src="http://www.stefanpopp.de/wp-content/uploads/2011/11/opaque-background-color-300x149.png" alt="" width="300" height="149" /></a></p>
<p>For a better ui navigation your UINavigationController should hide his navigation bar. This saves some space but dont forget to show the navigation bar if you push your detail view!<br />
I prefer the viewWillAppear function within the detail view controller. If the user goes back to the table view the same function in the UITableViewController should hide the bar again.</p>
<p>To display the navigation bar.</p>
<pre class="brush: objc; title: ; notranslate">
// MyDetailViewController.m
- (void)viewWillAppear:(BOOL)animated
{
    [self.navigationController setNavigationBarHidden:YES];
    [super viewWillAppear:animated];
}
</pre>
<p>To hide the navigation bar.</p>
<pre class="brush: objc; title: ; notranslate">
// MyBackgroundTableViewController.m
- (void)viewWillAppear:(BOOL)animated
{
    [self.navigationController setNavigationBarHidden:YES];
    [super viewWillAppear:animated];
}
</pre>
<h2>Download</h2>
<p>You can download my example project on GitHub: <a href="https://github.com/fuxx/tabNavBackground">https://github.com/fuxx/tabNavBackground</a></p>
<p>Hopefully this is useful for someone else =)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stefanpopp.de/2011/uitableviewcontroller-background-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Capture iPhone microphone</title>
		<link>http://www.stefanpopp.de/2011/capture-iphone-microphone/</link>
		<comments>http://www.stefanpopp.de/2011/capture-iphone-microphone/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 23:09:22 +0000</pubDate>
		<dc:creator>Stefan Popp</dc:creator>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[audio stream]]></category>
		<category><![CDATA[core audio]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iphone sdk]]></category>

		<guid isPermaLink="false">http://www.stefanpopp.de/?p=394</guid>
		<description><![CDATA[Processing input as stream Before you start, you should already have some knowledge about basics in Objective-C and C. Sometimes you need more than just a basic recording of external sounds. In my case i need the direct input stream from the iPhone microphone or headset. There are many cases to process the stream on-the-fly<a href="http://www.stefanpopp.de/2011/capture-iphone-microphone/">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<h1>Processing input as stream</h1>
<p>Before you start, you should already have some knowledge about basics in Objective-C and C. Sometimes you need more than just a basic recording of external sounds. In my case i need the direct input stream from the iPhone microphone or headset.</p>
<p>There are many cases to process the stream on-the-fly for things like echoes or fancy delayed sounds on the input signal. You can make funny voices or the next Shazam. Its up to you and here is the first step for get a callback on the stream.</p>
<p>It is pretty hard to find informations about common techniques for processing the audio stream in iOS. This example and <a href="https://github.com/fuxx/MicInput" target="_blank">sample project which is available on GitHub</a>, is just a start. In my example i give you a basic overview about things you have to make. This example covers a basic gain to boost the audio input. Since iOS 5 you dont need to write your on gain function cause the api got now a direct control about the level.</p>
<h1>Project Setup</h1>
<p>Just start with a empty or window based project. You will need only one class to manage your signals at all. In my example project my view controller holds a AudioProcessor object. It includes all functionalities like start and stoping and configure the AU.</p>
<p>In our case we got a file name AudioProcessor.h</p>
<pre class="brush: objc; title: ; notranslate">
//
//  AudioProcessor.h
//
//  Created by Stefan Popp on 21.09.11.
//  Copyright 2011 www.stefanpopp.de . All rights reserved.
//

#import
#import

// return max value for given values
#define max(a, b) (((a) &gt; (b)) ? (a) : (b))
// return min value for given values
#define min(a, b) (((a) &lt; (b)) ? (a) : (b))

#define kOutputBus 0
#define kInputBus 1

// our default sample rate
#define SAMPLE_RATE 44100.00
</pre>
<p>We use the Audio Toolbox which is part of the <a href="http://developer.apple.com/library/mac/#documentation/MusicAudio/Reference/CAAudioTooboxRef/_index.html" target="_blank">Audio Toolbox Framework</a>. The kOutputBus and kInputBus defines later the microphone and default output speaker.<br />
The sample rate is 44khz.</p>
<pre class="brush: objc; title: ; notranslate">
@interface AudioProcessor : NSObject
{
    // Audio unit
    AudioComponentInstance audioUnit;

    // Audio buffers
    AudioBuffer audioBuffer;

    // gain
    float gain;
}

@property (readonly) AudioBuffer audioBuffer;
@property (readonly) AudioComponentInstance audioUnit;
@property (nonatomic) float gain;
</pre>
<p>Our class needs a audio component, a input buffer and for our DSP (digital signal processing) section a variable which holds the current gain multiplicator.</p>
<pre class="brush: objc; title: ; notranslate">
-(AudioProcessor*)init;

-(void)initializeAudio;
-(void)processBuffer: (AudioBufferList*) audioBufferList;

// control object
-(void)start;
-(void)stop;

// gain
-(void)setGain:(float)gainValue;
-(float)getGain;

// error managment
-(void)hasError:(int)statusCode:(char*)file:(int)line;
</pre>
<h2>Record callback</h2>
<p>Beside the initializers i implemented a simple error check method and start and stop functions for the AU.<br />
The implementation is lot more complex and i commented a lot on it. If you dont really know what it is, consult the apple documentation even if its not best document on this topic.</p>
<pre class="brush: objc; title: ; notranslate">

#import &quot;AudioProcessor.h&quot;

#pragma mark Recording callback

static OSStatus recordingCallback(void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList *ioData) {

    // the data gets rendered here
    AudioBuffer buffer;

    // a variable where we check the status
    OSStatus status;

    /**
    This is the reference to the object who owns the callback.
    */
    AudioProcessor *audioProcessor = (AudioProcessor*) inRefCon;

    /**
    on this point we define the number of channels, which is mono
    for the iphone. the number of frames is usally 512 or 1024.
    */
    buffer.mDataByteSize = inNumberFrames * 2; // sample size
    buffer.mNumberChannels = 1; // one channel
    buffer.mData = malloc( inNumberFrames * 2 ); // buffer size

    // we put our buffer into a bufferlist array for rendering
    AudioBufferList bufferList;
    bufferList.mNumberBuffers = 1;
    bufferList.mBuffers[0] = buffer;

    // render input and check for error
    status = AudioUnitRender([audioProcessor audioUnit], ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames,     &amp;bufferList);
    [audioProcessor hasError:status:__FILE__:__LINE__];

    // process the bufferlist in the audio processor
    [audioProcessor processBuffer:&amp;bufferList];

    // clean up the buffer
    free(bufferList.mBuffers[0].mData);

    return noErr;
}
</pre>
<h2>Playback callback</h2>
<p>The recording callback is called every time when new packets are available. The stream has to be rendered by the audio unit for further processing in the process buffer function of the audio processor object. At the end the buffer has to be freed to avoid memory leaks.</p>
<pre class="brush: objc; title: ; notranslate">
#pragma mark Playback callback

static OSStatus playbackCallback(void *inRefCon,
								 AudioUnitRenderActionFlags *ioActionFlags,
								 const AudioTimeStamp *inTimeStamp,
								 UInt32 inBusNumber,
								 UInt32 inNumberFrames,
								 AudioBufferList *ioData) {

    /**
     This is the reference to the object who owns the callback.
     */
    AudioProcessor *audioProcessor = (AudioProcessor*) inRefCon;

    // iterate over incoming stream an copy to output stream
	for (int i=0; i &lt; ioData-&gt;mNumberBuffers; i++) {
		AudioBuffer buffer = ioData-&gt;mBuffers[i];

                // find minimum size
		UInt32 size = min(buffer.mDataByteSize, [audioProcessor audioBuffer].mDataByteSize);

                // copy buffer to audio buffer which gets played after function return
		memcpy(buffer.mData, [audioProcessor audioBuffer].mData, size);

                // set data size
		buffer.mDataByteSize = size;
    }
    return noErr;
}
</pre>
<p>The playback function is just important if you want to loop back the signal you have processed. This is pretty useful on debugging your processed buffers.</p>
<pre class="brush: objc; title: ; notranslate">
#pragma mark objective-c class

@implementation AudioProcessor
@synthesize audioUnit, audioBuffer, gain;

-(AudioProcessor*)init
{
    self = [super init];
    if (self) {
        gain = 0;
        [self initializeAudio];
    }
    return self;
}
</pre>
<h2>Audio component description</h2>
<p>I dont think that this part needs a lot of explantation. The part below is well commented. If you have any questions take a look into the CoreAudio documentation =). The code below is a description about the input and output processing. We define the channel properties like the input format. The audio unit is defined by our description and gets initialized at the bottom.</p>
<pre class="brush: objc; title: ; notranslate">
-(void)initializeAudio
{
        OSStatus status;

	// We define the audio component
	AudioComponentDescription desc;
	desc.componentType = kAudioUnitType_Output; // we want to ouput
	desc.componentSubType = kAudioUnitSubType_RemoteIO; // we want in and ouput
	desc.componentFlags = 0; // must be zero
	desc.componentFlagsMask = 0; // must be zero
	desc.componentManufacturer = kAudioUnitManufacturer_Apple; // select provider

	// find the AU component by description
	AudioComponent inputComponent = AudioComponentFindNext(NULL, &amp;desc);

	// create audio unit by component
	status = AudioComponentInstanceNew(inputComponent, &amp;audioUnit);

	[self hasError:status:__FILE__:__LINE__];

        // define that we want record io on the input bus
        UInt32 flag = 1;
	status = AudioUnitSetProperty(audioUnit,
								  kAudioOutputUnitProperty_EnableIO, // use io
								  kAudioUnitScope_Input, // scope to input
								  kInputBus, // select input bus (1)
								  &amp;flag, // set flag
								  sizeof(flag));
	[self hasError:status:__FILE__:__LINE__];

	// define that we want play on io on the output bus
	status = AudioUnitSetProperty(audioUnit,
								  kAudioOutputUnitProperty_EnableIO, // use io
								  kAudioUnitScope_Output, // scope to output
								  kOutputBus, // select output bus (0)
								  &amp;flag, // set flag
								  sizeof(flag));
	[self hasError:status:__FILE__:__LINE__];

	/*
         We need to specifie our format on which we want to work.
         We use Linear PCM cause its uncompressed and we work on raw data.
         for more informations check.

         We want 16 bits, 2 bytes per packet/frames at 44khz
        */
	AudioStreamBasicDescription audioFormat;
	audioFormat.mSampleRate			= SAMPLE_RATE;
	audioFormat.mFormatID			= kAudioFormatLinearPCM;
	audioFormat.mFormatFlags		= kAudioFormatFlagIsPacked | kAudioFormatFlagIsSignedInteger;
	audioFormat.mFramesPerPacket	= 1;
	audioFormat.mChannelsPerFrame	= 1;
	audioFormat.mBitsPerChannel		= 16;
	audioFormat.mBytesPerPacket		= 2;
	audioFormat.mBytesPerFrame		= 2;

	// set the format on the output stream
	status = AudioUnitSetProperty(audioUnit,
								  kAudioUnitProperty_StreamFormat,
								  kAudioUnitScope_Output,
								  kInputBus,
								  &amp;audioFormat,
								  sizeof(audioFormat));

	[self hasError:status:__FILE__:__LINE__];

        // set the format on the input stream
	status = AudioUnitSetProperty(audioUnit,
								  kAudioUnitProperty_StreamFormat,
								  kAudioUnitScope_Input,
								  kOutputBus,
								  &amp;audioFormat,
								  sizeof(audioFormat));
	[self hasError:status:__FILE__:__LINE__];

        /**
        We need to define a callback structure which holds
        a pointer to the recordingCallback and a reference to
        the audio processor object
        */
	AURenderCallbackStruct callbackStruct;

        // set recording callback
	callbackStruct.inputProc = recordingCallback; // recordingCallback pointer
	callbackStruct.inputProcRefCon = self;

        // set input callback to recording callback on the input bus
	status = AudioUnitSetProperty(audioUnit,
                                  kAudioOutputUnitProperty_SetInputCallback,
								  kAudioUnitScope_Global,
								  kInputBus,
								  &amp;callbackStruct,
								  sizeof(callbackStruct));

        [self hasError:status:__FILE__:__LINE__];

        /*
         We do the same on the output stream to hear what is coming
         from the input stream
         */
	callbackStruct.inputProc = playbackCallback;
	callbackStruct.inputProcRefCon = self;

        // set playbackCallback as callback on our renderer for the output bus
	status = AudioUnitSetProperty(audioUnit,
								  kAudioUnitProperty_SetRenderCallback,
								  kAudioUnitScope_Global,
								  kOutputBus,
								  &amp;callbackStruct,
								  sizeof(callbackStruct));
	[self hasError:status:__FILE__:__LINE__];

        // reset flag to 0
	flag = 0;

        /*
         we need to tell the audio unit to allocate the render buffer,
         that we can directly write into it.
         */
	status = AudioUnitSetProperty(audioUnit,
								  kAudioUnitProperty_ShouldAllocateBuffer,
								  kAudioUnitScope_Output,
								  kInputBus,
								  &amp;flag,
								  sizeof(flag));

        /*
         we set the number of channels to mono and allocate our block size to
         1024 bytes.
        */
	audioBuffer.mNumberChannels = 1;
	audioBuffer.mDataByteSize = 512 * 2;
	audioBuffer.mData = malloc( 512 * 2 );

	// Initialize the Audio Unit and cross fingers =)
	status = AudioUnitInitialize(audioUnit);
	[self hasError:status:__FILE__:__LINE__];

       NSLog(@&quot;Started&quot;);

}
</pre>
<h2>AudioUnit control</h2>
<p>I need some control about the AU so i added a start and stop function to the class.</p>
<pre class="brush: objc; title: ; notranslate">
#pragma mark controll stream

-(void)start;
{
    // start the audio unit. You should hear something, hopefully <img src='http://www.stefanpopp.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
    OSStatus status = AudioOutputUnitStart(audioUnit);
    [self hasError:status:__FILE__:__LINE__];
}
-(void)stop;
{
    // stop the audio unit
    OSStatus status = AudioOutputUnitStop(audioUnit);
    [self hasError:status:__FILE__:__LINE__];
}
</pre>
<p>This is just to set the gain from outside.</p>
<pre class="brush: objc; title: ; notranslate">
-(void)setGain:(float)gainValue
{
    gain = gainValue;
}

-(float)getGain
{
    return gain;
}
</pre>
<h2>Audio stream manipulation</h2>
<p>Iam not the fan of splitting function code in a blogpost so here is the audio buffer processor commented in the code. Hopefully not in that bad english like in this post <img src='http://www.stefanpopp.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre class="brush: objc; title: ; notranslate">
#pragma mark processing

-(void)processBuffer: (AudioBufferList*) audioBufferList
{
    AudioBuffer sourceBuffer = audioBufferList-&gt;mBuffers[0];

    // we check here if the input data byte size has changed
    if (audioBuffer.mDataByteSize != sourceBuffer.mDataByteSize) {
        // clear old buffer
        free(audioBuffer.mData);
        // assing new byte size and allocate them on mData
        audioBuffer.mDataByteSize = sourceBuffer.mDataByteSize;
        audioBuffer.mData = malloc(sourceBuffer.mDataByteSize);
     }

    /**
     Here we modify the raw data buffer now.
     In my example this is a simple input volume gain.
     iOS 5 has this on board now, but as example quite good.
     */
    SInt16 *editBuffer = audioBufferList-&gt;mBuffers[0].mData;

    // loop over every packet
    for (int nb = 0; nb &lt; (audioBufferList-&gt;mBuffers[0].mDataByteSize / 2); nb++) {

        // we check if the gain has been modified to save resoures
        if (gain != 0) {
            // we need more accuracy in our calculation so we calculate with doubles
            double gainSample = ((double)editBuffer[nb]) / 32767.0;

            /*
            at this point we multiply with our gain factor
            we dont make a addition to prevent generation of sound where no sound is.

             no noise
             0*10=0

             noise if zero
             0+10=10
            */
            gainSample *= gain;

            /**
             our signal range cant be higher or lesser -1.0/1.0
             we prevent that the signal got outside our range
             */
            gainSample = (gainSample &lt; -1.0) ? -1.0 : (gainSample &gt; 1.0) ? 1.0 : gainSample;

            /*
             This thing here is a little helper to shape our incoming wave.
             The sound gets pretty warm and better and the noise is reduced a lot.
             Feel free to outcomment this line and here again.

             You can see here what happens here http://silentmatt.com/javascript-function-plotter/
             Copy this to the command line and hit enter: plot y=(1.5*x)-0.5*x*x*x
             */

            gainSample = (1.5 * gainSample) - 0.5 * gainSample * gainSample * gainSample;

            // multiply the new signal back to short
            gainSample = gainSample * 32767.0;

            // write calculate sample back to the buffer
            editBuffer[nb] = (SInt16)gainSample;
        }
    }

    // copy incoming audio data to the audio buffer
    memcpy(audioBuffer.mData, audioBufferList-&gt;mBuffers[0].mData, audioBufferList-&gt;mBuffers[0].mDataByteSize);
}
</pre>
<p>My little error handler which does not really handle errors, but this is not really important for this example.</p>
<pre class="brush: objc; title: ; notranslate">
#pragma mark Error handling

-(void)hasError:(int)statusCode:(char*)file:(int)line
{
	if (statusCode) {
		printf(&quot;Error Code responded %d in file %s on line %d\n&quot;, statusCode, file, line);
        exit(-1);
	}
}
@end
</pre>
<h2>Conclusion</h2>
<p>Its pretty easy to get a callback and define a simple audio component. The hard part is to find the right tool for the things you wanna do. While research for this post i have seen a lot of ways to manipulate audio streams, but this is in my opinion easiest and most controllable  way.</p>
<p>You can read more about this topic on the following sites. MusicDSP is my personal favorite if you need professional ways of coding effects or getting methods for counting beats per minute. Its the best knowledge base for audio DSP i know.</p>
<p><strong><a href="http://developer.apple.com/library/mac/#documentation/MusicAudio/Conceptual/CoreAudioOverview/Introduction/Introduction.html" target="_blank">CoreAudio documentation</a></strong><br />
<strong><a href="http://www.musicdsp.org/archive.php?classid=0" target="_blank">MusicDSP.org</a></strong><br />
<strong><a href="http://developer.apple.com/library/ios/#DOCUMENTATION/Audio/Conceptual/AudioSessionProgrammingGuide/Introduction/Introduction.html" target="_blank">Apple Audio Session Programming Guide<br />
</a></strong></p>
<h2>Project source code</h2>
<p>You can download the project source code here on GitHub<br />
<a href="https://github.com/fuxx/MicInput" target="_blank">https://github.com/fuxx/MicInput</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stefanpopp.de/2011/capture-iphone-microphone/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Inside the music project</title>
		<link>http://www.stefanpopp.de/2011/inside-the-music-project/</link>
		<comments>http://www.stefanpopp.de/2011/inside-the-music-project/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 07:00:14 +0000</pubDate>
		<dc:creator>Stefan Popp</dc:creator>
				<category><![CDATA[Music project]]></category>
		<category><![CDATA[music project cabine]]></category>

		<guid isPermaLink="false">http://www.stefanpopp.de/?p=380</guid>
		<description><![CDATA[Rock is not just rock As some of you may noticed i do not code all the time in my spare time. With André Wösten and Tobias Rath i finally got a small team to make some incredible music. Well, we think it is incredible. In this post i want to show you some of<a href="http://www.stefanpopp.de/2011/inside-the-music-project/">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<h1>Rock is not just rock</h1>
<p>As some of you may noticed i do not code all the time in my spare time. With André Wösten and Tobias Rath i finally got a small team to make some incredible music. Well, we think it is incredible.</p>
<p>In this post i want to show you some of our parts we use in our amateur studio which has been split to us three due my movement to Ebersberg from Munich. Some of the equipment is just for nothing, like our JL Cooper MCS-3800  which we primarily use for the record, play and start button. Thousands of dollars wasted? Gnah, just a hand full of euros. Anyway, waste of money.</p>
<p style="text-align: center;"><img class="aligncenter" style="display: block; border-style: initial; border-color: initial; border-width: 0px;" title="studio-overview.jpg" src="http://www.stefanpopp.de/wp-content/uploads/2011/10/studio-overview.jpg" alt="Studio overview" width="420" height="316" border="0" /></p>
<h2>Building up!</h2>
<p>In munich, where we made the most of our tracks we had  a room with awesome acoustic and the neighbors never got angry by the volume. The vocal cabin has been builded in 2010 by Andre Wöstén and me. We tried to build the cabin as cheapest as possible. With 350€ it should be. 98% are  wood and the rest is the acoustic isolation &#8220;<a href="http://www.isover.de/Home/Produktwelt/Produkte/Akustic/Akustic-SSP-2/Akustic-SSP-2.aspx">Isover SSP II</a>&#8220;.</p>
<p style="text-align: center;"><img class="aligncenter" style="display: block; border-style: initial; border-color: initial; border-width: 0px;" title="kabinenbau.jpg" src="http://www.stefanpopp.de/wp-content/uploads/2011/10/kabinenbau.jpg" alt="Kabinenbau" width="270" height="360" border="0" /></p>
<p>The microphone we use is a AKG whatever, which is enough for us. It has a pretty awesome spectrum and for myself i think its more then enough for a amateur music project like this.</p>
<p style="text-align: center;"><img class="aligncenter" style="display: block; border-style: initial; border-color: initial; border-width: 0px;" title="mic-raw.jpg" src="http://www.stefanpopp.de/wp-content/uploads/2011/10/mic-raw.jpg" alt="Mic raw" width="268" height="360" border="0" /></p>
<p style="text-align: center;"><img class="aligncenter" style="display: block; border-style: initial; border-color: initial; border-width: 0px;" title="mic.jpg" src="http://www.stefanpopp.de/wp-content/uploads/2011/10/mic.jpg" alt="Mic" width="360" height="271" border="0" /></p>
<h2>Is not all about hardware!</h2>
<p>At the beginning of the project i used my &#8220;BC Rich Platinum Warlock&#8221; guitar which was quite pretty awesome until i got my custom Lag guitar. I don&#8217;t have a photo of the new one but sometime i will upload one for you. The studio itself had a room size of nearly 15qm which was quite big, but not big enough for 3 people in front of the studio mac.</p>
<p style="text-align: center;"><img class="aligncenter" style="display: block; border-style: initial; border-color: initial; border-width: 0px;" title="studio-overview.jpg" src="http://www.stefanpopp.de/wp-content/uploads/2011/10/studio-overview1.jpg" alt="Studio overview" width="420" height="316" border="0" /></p>
<p>While we use a mac for production we decided to use <a href="http://www.apple.com/logicstudio/">Logic</a>. A awesome DAW and every VST or RTAS we got, is still working with Logic. It is pretty awesome. In the middle of 2010 i bought the <a href="http://www.toontrack.com/products.asp?item=30">Superior Drummer</a> from Toontrack which is the most awesome sample drum kit i know. You can hear it in our current tracks on the <a href="http://www.stefanpopp.de/my-music/">music</a> page.</p>
<p>As preamp we have a Art Tube MP Project  from Thomann which you can buy <a href="http://www.thomann.de/de/art_tube_mp_project_series.htm">here</a>.</p>
<p style="text-align: center;"><img class="aligncenter" style="display: block; border-style: initial; border-color: initial; border-width: 0px;" title="Art tube.png" src="http://www.stefanpopp.de/wp-content/uploads/2011/10/Art-tube.png" alt="Art Tube" width="360" height="221" border="0" /></p>
<h2>Sounds is not just sound</h2>
<p>The monitors are from André and he spend a brand new set of Fostex MK II active monitors which are so awesome linear. Mixing is so easy now and you know that you have enough bass, if there is just a bit bass. They are so linear that bass is no matter cause you simply don&#8217;t here bass which is for me the best sound to mix.</p>
<p style="text-align: center;"><img class="aligncenter" style="display: block; border-style: initial; border-color: initial; border-width: 0px;" title="fostx.jpg" src="http://www.stefanpopp.de/wp-content/uploads/2011/10/fostx.jpg" alt="Fostx" width="360" height="271" border="0" /></p>
<p>For myself i can say that i have tons of fun in creating music with my crowd and without. Hopefully some people can enjoy our music on this planet. We are not intended to create main stream music, but sometimes we are feel pretty alone while we get no feedback. I am sure that will change sometimes if we work harder and better to get a little crowd of audiophile people.</p>
<h4><a href="http://www.stefanpopp.de/my-music/">Enjoy the music!</a></h4>
]]></content:encoded>
			<wfw:commentRss>http://www.stefanpopp.de/2011/inside-the-music-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>core25k</title>
		<link>http://www.stefanpopp.de/2011/core25k/</link>
		<comments>http://www.stefanpopp.de/2011/core25k/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 19:15:58 +0000</pubDate>
		<dc:creator>Stefan Popp</dc:creator>
				<category><![CDATA[Demoscene]]></category>

		<guid isPermaLink="false">http://www.stefanpopp.de/?p=247</guid>
		<description><![CDATA[Winner of 64KB at Evoke 2011 The demo is not what you expect in 2011 but we have shown our love. We released the demo at my first party ever and we shocked a lot of people by putting a cracktro from a known warez scene group into the competition. Technical details The project folder<a href="http://www.stefanpopp.de/2011/core25k/">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<h1>Winner of 64KB at Evoke 2011</h1>
<p>The demo is not what you expect in 2011 but we have shown our love. We released the demo at my first party ever and we shocked a lot of people by putting a <a title="cracktro" href="http://en.wikipedia.org/wiki/Crack_intro" target="_blank">cracktro</a> from a known warez scene group into the competition.</p>
<p><iframe src="http://www.youtube-nocookie.com/embed/b_OYQk5m3M8" frameborder="0" width="420" height="315"></iframe></p>
<h2>Technical details</h2>
<p>The project folder has a total size of 9.3MB with sources and libraries. It runs on Windows, Linux and Mac OS X. A port to other platforms is possible if SSE2 and MMX is supported. For music playback we use <a href="http://www.fmod.org/index.php/download">minifmod</a> which we extended and optimized a lot with low/high pass filters. We extended <a href="http://milkytracker.org/">Milkytracker</a> so that our artist (Strobflux) could easily compose his tracks, without the need of special software. We also added some effects like reverb. The library will soon be released by us for your projects!</p>
<p style="text-align: center;"><a href="http://www.stefanpopp.de/wp-content/uploads/2011/10/milky-synth.png" target="_blank"><img class="aligncenter size-medium wp-image-302" title="Milkytracker mod" src="http://www.stefanpopp.de/wp-content/uploads/2011/10/milky-synth-300x248.png" alt="" width="300" height="248" /></a></p>
<p>Within the demo we use FFT calculations for manipulating objects and scenes. This is best shown at the end of the demo where cubes of black and white lines appear. The effect is triggered by the amount of bass in the lower bands.</p>
<p>The demo has a size of 59KB compressed under Windows which has been done with a lot of compiler, linker and packaging tweaks. For packaging we used <a href="http://www.farbrausch.de/~fg/kkrunchy/" target="_blank">kkrunchy</a>. We tried to get the demo under 64KB on OS X as-well, but we are still fighting this challenge. At the moment it is around 68KB. We are using iPakk for the compression on OS X.</p>
<p>We at Titan have the source for iPakk, and are trying to further optimize the linker overhead. Maybe we&#8217;ll implement another algorithm.</p>
<p>The drawing is done with a pixel buffer where we calculate every pixel. For every system we wrote a own drawing mechanism to get as closes to the system as possible.</p>
<ul>
<li><strong>Windows: DirectDraw</strong></li>
<li><strong>Linux: XVideo</strong></li>
<li><strong>OS X: OpenGL (GLUT) with CoreGraphics</strong></li>
</ul>
<p>The sounds as described above is using XM with minifmod. We added support for OS X be extending the output interface with OpenAL.</p>
<p>For PNG packing we used pngout, a perfect png compressor. Our images has been converted to 8 bit. They were then converted to char arrays to avoid having files outside the .exe or the need of a packager within the intro.</p>
<p>We used time based scenes to synchronize the scenes and the music.</p>
<p><a href="http://www.stefanpopp.de/wp-content/uploads/2011/10/Bildschirmfoto-2011-10-19-um-15.22.33.png" target="_blank"><img class="size-full wp-image-265 alignleft" title="Structure horror" src="http://www.stefanpopp.de/wp-content/uploads/2011/10/Bildschirmfoto-2011-10-19-um-15.22.33.png" alt="" width="40" height="150" /></a>As you can see on the image to the left, we made a horror show within our project.</p>
<p>Most of the code is in header files. Dont get us wrong, we now how to structure projects well, but sometimes you just code and code and code. There is a lot of work within this project and some stuff messed us up a lot.</p>
<p>At least the prod matters and the size and we are proud that we have made a release with love and attention to the things you see <img src='http://www.stefanpopp.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Maybe, if the cracktro is not longer in use we will release the source code so that you can study it in the future.</p>
<p>We tried a lot to get our binary smaller on Mac OS X. Its not that hard to find information on Windows for that. If you are trying to make a 64k under OS X feel free to use our optimization line. For us this works best =)</p>
<pre>CCFLAGS = -fasm-blocks -s -arch i386 -msse -msse2 -mmmx -m32 -D__MACOSX__ -Wall -fmessage-length=0 -mdynamic-no-pic -fno-common -ffunction-sections -fdata-sections -c -fno-exceptions -Os ;
C++FLAGS = -fasm-blocks -s -arch i386 -msse -msse2 -mmmx -m32 -D__MACOSX__ -fno-exceptions -march=i686 -mdynamic-no-pic -fno-common -ffunction-sections -fdata-sections -c -fno-exceptions -Os -I/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ImageIO.framework/Headers ;
Linker LIBS -x -disable-inlining -strip-all -arch i386 -mno-long-calls -gc-sections -framework GLUT -framework OpenGL -framework OpenAL -framework Foundation -framework ApplicationServices ;
Linker flags = -Wl,-x,-exported_symbol,_main ;</pre>
<p><em><strong>You can download the production on <a href="http://www.pouet.net/prod.php?which=57510" target="_blank">pouet.net</a>.<br />
</strong></em>If you want to know more about this, feel free to contact me or visit us on Efnet in #titandemo</p>
<p><strong>Credits and probs fly out the dev-team</strong><br />
Code: neoman, isha (me!)<br />
Music: Strobeflux<br />
GFX: Alien, moqui and malodix</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stefanpopp.de/2011/core25k/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
