Updating An sqlite CoreData Backing Store On iOS

Something that has unpleasantly surprised many an iOS developer is that to update the data in an sqlite database that is the backing store for CoreData you need to do more than just make a new release of your app with a new database file included in your bundle. The reason for this is that CoreData can’t use your sqlite database while it is in the bundle, so the database is typically saved to the Documents folder. As far as I know there is no reason you couldn’t put it somewhere else but in most cases it is stored in the Documents folder so that is the assumption we will work with today.

To update your database you will need to replace the old one in the Documents folder with the new one from the bundle. I usually do this in two steps, first deleting the old sqlite file from the Documents folder and then writing the new one in its place.

Of course you don’t want this to happen every time the user starts the app. You really only want to do it once when the user has opened a new version of the app that they have downloaded. To handle that I make use of the bundle version from the Info.plist and good old NSUserDefaults (which I do still use for some things).

Here is the code I use in my AppDelegate’s application:didFinishLaunchingWithOptions: method:

NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    NSString *bundleVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
    if ([userDefaults objectForKey:kVERSION]) {
        NSString *version = [userDefaults objectForKey:kVERSION];
        if (![version isEqualToString:bundleVersion]) {
            [self replaceDatabase];
            [userDefaults setObject:bundleVersion forKey:kVERSION];
        }
    } else {
        [self replaceDatabase];
        [userDefaults setObject:bundleVersion forKey:kVERSION];
    }

The key “kVERSION” is just a # define of @”version”. All I am doing here is getting the userDefaults and the bundleVersion and then checking if there is a bundleVersion saved in userDefaults. If there is I check if it is different from the current bundleVersion of the app. If it is different then I call my replaceDatabase method which we will get to in a minute. Once that has run I make sure to save the new version to userDefaults to eliminate this code running again while the app is still on this current version. If the version was found to be the same then we exit the if statement and are done. No need to update the database because we should already have the latest.

If there was not a previous bundleVersion saved, maybe because you have added this code to a later release of your app, then we do the same thing as above, replace the database and then save the version to userDefaults.

Pretty straightforward stuff. Now lets take a look at the replaceDatabase method:

- (void)replaceDatabase
{
    NSFileManager *fileManager = [NSFileManager defaultManager];

        // remove old sqlite database from documents directory
    NSURL *dbDocumentsURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Data.sqlite"];
    NSString *dbDocumentsPath = [dbDocumentsURL path];
    if ([fileManager fileExistsAtPath:dbDocumentsPath]) {
        NSError *error = nil;
        [fileManager removeItemAtPath:dbDocumentsPath error:&error];
        if (error) {
            DLog(@"Error deleting sqlite database: %@", [error localizedDescription]);
        }
    }

        // move new sqlite database from bundle to documents directory
    NSString *dbBundlePath = [[NSBundle mainBundle] pathForResource:@"Data" ofType:@"sqlite"];
    if (dbBundlePath) {
        NSError *error = nil;
        [fileManager copyItemAtPath:dbBundlePath toPath:dbDocumentsPath error:&error];
        if (error) {
            DLog(@"Error copying sqlite database: %@", [error localizedDescription]);
        }
    }
}

Here we first get a reference to the default fileManager which we will be using. Next we need to get the path to the database file in the documents directory. To do that we first get the URL to the file using Apple’s convenience method applicationDocumentsDirectory which gives us an NSURL for the Documents directory and call the URLByAppendingPathComponent: method on that. I think that the applicationDocumentsDirectory method is included in your AppDelegate by default but I will also post it below for your reference. Once we have the URL for the database we simply pass the ‘path’ message to the URL and that gives us the path. Now we just check if the file is in fact at that location and if it is we remove it.

So that is the first part done. Now to copy the new database into place. To do that we need to get the path to the new database in the bundle. We do this with the NSBundle pathForResource: method. If the path is good we then do a copy of the database in the bundle to the Documents directory path and we are done.

The next time CoreData accesses the persistent store it will find the sqlite database in the same place as always with the same name but with your new data.

Finally, just in case you can’t find it, here is the applicationDocumentsDirectory method which as you can see is not very complex:

- (NSURL *)applicationDocumentsDirectory
{
    return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}

As always hope this is useful info for some of you out there.

Share and Enjoy:
  • printfriendly Updating An sqlite CoreData Backing Store On iOS
  • digg Updating An sqlite CoreData Backing Store On iOS
  • stumbleupon Updating An sqlite CoreData Backing Store On iOS
  • delicious Updating An sqlite CoreData Backing Store On iOS
  • facebook Updating An sqlite CoreData Backing Store On iOS
  • yahoobuzz Updating An sqlite CoreData Backing Store On iOS
  • twitter Updating An sqlite CoreData Backing Store On iOS
  • googlebookmark Updating An sqlite CoreData Backing Store On iOS
  • reddit Updating An sqlite CoreData Backing Store On iOS
Posted in app, code, iOS, iPad, iPhone, Objective-C | Tagged , , , , , , , | Leave a comment

Handy Scripts For Localizing iOS XIB Files

Recently I have been working on more and more iOS projects that require localization. One of the things that I find needs to be done fairly often while implementing localized XIB files is to extract all the strings from your English XIBs. The corollary is equally important which is creating new localized XIB files for all your supported languages from the .strings files that are provided to you by your translator.

Doing this by hand for even one additional language would be tedious if there are more than a couple of XIB files. This is exactly the kind of repetitive task that scripts are perfect for. My scripting language of choice is Ruby so you will need that installed to use these or you should be able to easily adapt these to whatever language you prefer.

Here is my genxibstrings script that I use to generate the .strings files from all my English XIB files. To use it just run it in your en.lproj folder which should contain all your English XIB files.

#!/usr/bin/env ruby

# Script to generate strings for localization from all XIB files in the current directory.

xibs = []

puts "Processing files..."

Dir.glob("*.xib") do |file|
  fname = File.basename(file, '.*')
  success = system "ibtool --generate-strings-file #{fname}.strings #{file}"
  if success == true
    puts "#{file} --> #{fname}.strings"
    xibs.push file
  else
    puts "Warning! String file for #{file} could not be generated."
  end
end

count = xibs.length

puts "Generated Strings For #{count} XIB Files."

Next, here is my stringstoxibs script that creates all the localized XIB files from your .strings files and English XIBs. This script needs to be run in a directory that contains all the localized language folders which have names like en.lproj, fr.lproj, zh-hant.lproj, es.lproj etc. The en.lproj folder must contain all your English XIB files that were used to create your .strings files that you sent off to be translated. All the other .lproj folders must contain the translated .strings files for their language. When this script is done it will have made all the localized XIB files in each .lproj folder and removed all the .strings files which you no longer need.

#!/usr/bin/env ruby

# Script to create localized XIBs from localized strings.

xibs = []

puts "Processing files..."

Dir.glob("**/*.strings") do |file|
  dname = File.dirname(file)
  fname = File.basename(file, '.*')
  if fname != "Localizable"
    success = system "ibtool --strings-file #{file} ./en.lproj/#{fname}.xib --write #{dname}/#{fname}.xib"
    if success == true
      puts "#{file} --> ./#{dname}/#{fname}.xib"
      xibs.push file
      system "rm ./#{dname}/#{fname}.strings"
    else
      puts "Warning! XIB for #{file} could not be generated."
    end
  end
end

count = xibs.length

puts "Generated #{count} XIB Files."

Hope this helps speed up the task of localizing your iOS apps.

Share and Enjoy:
  • printfriendly Handy Scripts For Localizing iOS XIB Files
  • digg Handy Scripts For Localizing iOS XIB Files
  • stumbleupon Handy Scripts For Localizing iOS XIB Files
  • delicious Handy Scripts For Localizing iOS XIB Files
  • facebook Handy Scripts For Localizing iOS XIB Files
  • yahoobuzz Handy Scripts For Localizing iOS XIB Files
  • twitter Handy Scripts For Localizing iOS XIB Files
  • googlebookmark Handy Scripts For Localizing iOS XIB Files
  • reddit Handy Scripts For Localizing iOS XIB Files
Posted in app, code, Interface Builder, iOS, iPad, iPhone, Ruby, script | Tagged , , , , , , , , | Leave a comment

Sequencing Modular Synth Drum Modules From Ableton Live

Below is described a sequencing solution for modular drum modules using Ableton Live, a custom Max4Live device that converts MIDI notes to CC gates, and a MIDI to CV interface that can convert MIDI CC to CV. If you just want to grab the Note2CCGate Max4Live device you can grab on my server here or from maxforlive.com here.

I recently picked picked up three new drum modules from TipTop Audio; the BD808, SD808 and HATS808. These are clones of the kick, snare, open hi hat and closed hi hat of the classic Roland TR808 drum machine. While I do have a modest sequencing setup in my modular synth and would love to expand that, modular synth gear is not cheap and sometimes it is nice to be able to sequence the modular directly from Ableton.

IMG 0731 768x1024 Sequencing Modular Synth Drum Modules From Ableton Live

TipTop Audio 808 drum modules

The drum modules all respond to triggers or gates; basically any quickly rising signal will do. I have a Kenton Modular Solo MIDI-CV converter that gives me one CV and gate, two clocks and four auxiliaries that can be used to convert MIDI CC to control voltage. Having a MIDI to CV interface that can convert CC to CV is crucial for the sequencing solution described below.

IMG 0732 768x1024 Sequencing Modular Synth Drum Modules From Ableton Live

Kenton Modular Solo with Aux outputs connected to drum modules

The first thing I thought to do to control my drums from the computer was to create a MIDI clip in Live and program in some CC triggers using the pencil tool on one of the clip’s CC envelopes. With the Modular Solo’s Aux1 output set up to receive from a particular CC value, and with the Live MIDI clip sending triggers with that same CC value, it was easy to program in some simple drums. The problem with this technique is that using a pencil tool to draw in triggers using a CC envelope is a tedious way to work and it is far more difficult to get the kind of granularity we are used to when programming drums.

Screen Shot 2012 04 09 at 12.11.38 PM 1024x137 Sequencing Modular Synth Drum Modules From Ableton Live

MIDI CC envelope for triggering drums

What I needed was a way to program my drum modules from a MIDI clip’s piano roll as I would typically do with drums when working in the box. To do that I needed to convert MIDI notes to CC triggers. I looked at the existing MIDI devices that come with Live but none of these was up to this task. Next I looked online to see if anyone had made a Max4Live device to do this. If it is out there I can’t find it, so I decided to build one myself.

Here is the patch:

Screen Shot 2012 04 09 at 11.29.24 AM Sequencing Modular Synth Drum Modules From Ableton Live

Note2CCGate Max patch

The patch takes the MIDI note’s velocity, which is received through a midiparse object’s first outlet and an unpack object, and outputs a CC value of 127 if the velocity is more than zero. If the velocity is equal to zero, which is what a MIDI ‘note off’ message sends, then a CC value of zero is output. The CC messages are put together with a pack object and a midiformat object. By turning the CC up to 127 on a ‘note on’ and to zero on a ‘note off’ we have a CC gate that is the same length as the received note. Even though for my purpose I only needed triggers, not gates, it seemed like a more generally useful device if it could output gates from notes. Currently I am only using it to trigger drums but you could use this for all sorts of fun with a modular synth.

The device has two user facing controls. You can set the CC value for the gates to use and there is a MIDI Panic button in case any notes ever get stuck.

Screen Shot 2012 04 09 at 12.17.48 AM Sequencing Modular Synth Drum Modules From Ableton Live

Note 2 CC Gate Max4Live device

Drop this device on a MIDI channel and any notes you program will be converted to a CC value that sustains for the same length as the programmed note.

I hope some of you will find this useful and would love to hear from you if you do.

You can grab the device on my server here or on maxforlive.com here.

Share and Enjoy:
  • printfriendly Sequencing Modular Synth Drum Modules From Ableton Live
  • digg Sequencing Modular Synth Drum Modules From Ableton Live
  • stumbleupon Sequencing Modular Synth Drum Modules From Ableton Live
  • delicious Sequencing Modular Synth Drum Modules From Ableton Live
  • facebook Sequencing Modular Synth Drum Modules From Ableton Live
  • yahoobuzz Sequencing Modular Synth Drum Modules From Ableton Live
  • twitter Sequencing Modular Synth Drum Modules From Ableton Live
  • googlebookmark Sequencing Modular Synth Drum Modules From Ableton Live
  • reddit Sequencing Modular Synth Drum Modules From Ableton Live
Posted in ableton, MaxMSP, MIDI, modular, patching, Synth | Tagged , , , , , , , , , , | 2 Comments

How To Combine Two Images In iOS

A question that has been asked a lot on my iOS Still Image Capture With AVCaptureSession post is how to combine the overlay image that is shown with the image that is being captured by the camera. The more general question is how to combine two images so that is what I will show first and then I will give you my updated captureStillImage method that you can add to the AROverlayImageCapture example project which is available here.

Let’s say we have two images we want to combine; say an image of a person that we want to overlay an image of a funny hat on to. Here are the two UIImages:

UIImage *personImage = [UIImage imageNamed:@"person.jpg"];
UIImage *hatImage = [UIImage imageNamed:@"hat.png];

In this case we want the resultant image to be that same size as the personImage. Let’s get the size that we want for the final image:

CGSize finalSize = [personImage size];

Also get the size of the hat image which is probably much smaller:

CGSize hatSize = [hatImage size];

Now we need to create a graphics context in which we will do our drawing:

UIGraphicsBeginImageContext(finalSize);

The graphics context is kind of like out piece of paper that we will draw to. The first thing we want to draw on it is the photo of the person:

[personImage drawInRect:CGRectMake(0,0,finalSize.width,finalSize.height)];

Now we draw the hat at the position that we want it to be on top of the other image.

[hatImage drawInRect:CGRectMake(HAT_X_POS,HAT_Y_POS,hatSize.width,hatSize.height)];

Next we create the new UIImage with:

UIImage *newImage = [UIGraphicsGetImageFromCurrentImageContext();

Finally we need to clean up and close the context as we no longer need it:

UIGraphicsEndImageContext();

That is all there is to it.

Now for all you people who have asked how to modify the AROverlayImageCapture project to include the overlay image here is a new version of captureStillImage which has now become captureStillImageWithOverlay: which takes a UIImage as an argument.

NOTE: One thing that you will notice that is different from what we did above is that to correctly position the overlay in this particular case we need to apply some scaling. This is due to the fact that the photos taken with the camera are 480x640 whereas the screen is 320x480 so if you don't scale the position and size of your overlay it will not be positioned or sized the way it was on your iPhone screen.

- (void)captureStillImageWithOverlay:(UIImage*)overlay
{
	AVCaptureConnection *videoConnection = nil;
	for (AVCaptureConnection *connection in [[self stillImageOutput] connections]) {
		for (AVCaptureInputPort *port in [connection inputPorts]) {
			if ([[port mediaType] isEqual:AVMediaTypeVideo]) {
				videoConnection = connection;
				break;
			}
		}
		if (videoConnection) {
      break;
    }
	}

	NSLog(@"about to request a capture from: %@", [self stillImageOutput]);
	[[self stillImageOutput] captureStillImageAsynchronouslyFromConnection:videoConnection
                                                       completionHandler:^(CMSampleBufferRef imageSampleBuffer, NSError *error) {
                                                         CFDictionaryRef exifAttachments = CMGetAttachment(imageSampleBuffer, kCGImagePropertyExifDictionary, NULL);
                                                         if (exifAttachments) {
                                                           NSLog(@"attachements: %@", exifAttachments);
                                                         } else {
                                                           NSLog(@"no attachments");
                                                         }
                                                         NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer];
                                                         UIImage *image = [[UIImage alloc] initWithData:imageData];

                                                         CGSize imageSize = [image size];
                                                         CGSize overlaySize = [overlay size];

                                                         UIGraphicsBeginImageContext(imageSize);

                                                         [image drawInRect:CGRectMake(0, 0, imageSize.width, imageSize.height)];

                                                         CGFloat xScaleFactor = imageSize.width / 320;
                                                         CGFloat yScaleFactor = imageSize.height / 480;

                                                         [overlay drawInRect:CGRectMake(30 * xScaleFactor, 100 * yScaleFactor, overlaySize.width * xScaleFactor, overlaySize.height * yScaleFactor)]; // rect used in AROverlayViewController was (30,100,260,200)

                                                         UIImage *combinedImage = UIGraphicsGetImageFromCurrentImageContext();

                                                         [self setStillImage:combinedImage];

                                                         UIGraphicsEndImageContext();

                                                         [image release];
                                                         [[NSNotificationCenter defaultCenter] postNotificationName:kImageCapturedSuccessfully object:nil];
                                                       }];
}

You will also need to declare the method in your CaptureSessionManager header file:

- (void)captureStillImageWithOverlay:(UIImage*)overlay;

Finally you will need to update the scanButtonPressed method in AROverlayViewController.m with:

- (void)scanButtonPressed {
	[[self scanningLabel] setHidden:NO];
        [[self captureManager] captureStillImageWithOverlay:[UIImage imageNamed:@"overlaygraphic.png"]];
}

There you have it folks, how to combine two images in iOS and the particulars to update the AROverlayImageCapture project to include the overlay image in your capture output.

Happy coding!

Share and Enjoy:
  • printfriendly How To Combine Two Images In iOS
  • digg How To Combine Two Images In iOS
  • stumbleupon How To Combine Two Images In iOS
  • delicious How To Combine Two Images In iOS
  • facebook How To Combine Two Images In iOS
  • yahoobuzz How To Combine Two Images In iOS
  • twitter How To Combine Two Images In iOS
  • googlebookmark How To Combine Two Images In iOS
  • reddit How To Combine Two Images In iOS
Posted in app, AR, code, iOS, iPad, iPhone, Objective-C | Tagged , , , , , , | 3 Comments

The UDID Apocalypse and: How I Learned To Cut Back On NSUserDefaults And Love The Keychain

Edit: To be honest, I will still use NSUserDefaults for a lot of things, and you should too, I just liked the Doctor Strangelove reference. icon smile The UDID Apocalypse and: How I Learned To Cut Back On NSUserDefaults And Love The Keychain

By now you have probably heard that Apple is deprecating support for attaining a UDID from an iOS device and furthermore that they will be rejecting any app submissions that use the UDID in any way. The now deprecated way of retrieving the UDID was:

NSString *udid = [[UIDevice currentDevice] identifier];

As we can no longer use this, but will often still have need of a unique identifier Apple has suggested using a CFUUID. To get a unique string identifier you now need to do this:

CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault);
NSString *uuid = (NSString *)CFUUIDCreateString (kCFAllocatorDefault,uuidRef);

This gives you a unique identifier however if you called these methods again you would get a different unique identifier which may be fine if you only ever need to use this identifier once but for many situations this is probably not what you want. Apple suggests using NSUserDefaults to store the UUID after you have made it. You would do that like so:

NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setObject:uuid forKey:@"UUID"];

Then if you need to retrieve the UUID at any point you would call:

NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
NSString *uuid = [userDefaults objectForKey:@"UUID"];

This is an ok solution. I say it is only ok because the problem with NSUserDefaults is that they do not persist if the user removes and reinstalls their application. This could wreak havoc on your app if for example the UUID is used to identify the device to a web service that served data to your app. Your users would find it frustrating to lose their data simply because they had reinstalled your app.

A better solution is to store the UUID in the users keychain.

If you are unfamiliar with the concept it is fairly simple. Each app has its own keychain that can be used to securely store passwords, certificates, keys etc. The keychain can even be shared among several different apps if needed though I will not cover that today.

To make working with the keychain simpler Apple wrote an Objective-C wrapper class called KeychainItemWrapper which you can find here.

To store our UUID in the keychain we first create a KeychainItemWrapper object with:

KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc] initWithIdentifier:@"UUID" accessGroup:nil];

You can use whatever you want for the identifier. As I am only making this item available to this app I set the accessGroup to nil.

Now to save your UUID to the keychain use:

[keychainItem setObject:uuid forKey:(id)kUUID];

In this case I would have defined the constant kUUID with a # define such as:

#define kUUID @"UUID"

To retrieve your UUID you need to make a keychainItemWrapper object and then call objectForKey like this:

KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc] initWithIdentifier:@"UUID" accessGroup:nil];
[keychainItem objectForKey:(id)kUUID]; 

This UUID that is stored in the keychain will now persist if the user removes the app and reinstalls and even if they save an encrypted backup and do a restore. It will not persist if they do a full reset of the device or restore from an unencrypted backup.

One word of warning, the keychain does not work in the iOS simulator.

Share and Enjoy:
  • printfriendly The UDID Apocalypse and: How I Learned To Cut Back On NSUserDefaults And Love The Keychain
  • digg The UDID Apocalypse and: How I Learned To Cut Back On NSUserDefaults And Love The Keychain
  • stumbleupon The UDID Apocalypse and: How I Learned To Cut Back On NSUserDefaults And Love The Keychain
  • delicious The UDID Apocalypse and: How I Learned To Cut Back On NSUserDefaults And Love The Keychain
  • facebook The UDID Apocalypse and: How I Learned To Cut Back On NSUserDefaults And Love The Keychain
  • yahoobuzz The UDID Apocalypse and: How I Learned To Cut Back On NSUserDefaults And Love The Keychain
  • twitter The UDID Apocalypse and: How I Learned To Cut Back On NSUserDefaults And Love The Keychain
  • googlebookmark The UDID Apocalypse and: How I Learned To Cut Back On NSUserDefaults And Love The Keychain
  • reddit The UDID Apocalypse and: How I Learned To Cut Back On NSUserDefaults And Love The Keychain
Posted in app, code, iOS, iPad, iPhone, Objective-C | Tagged , , , , , | 4 Comments

New Studio Track – Gravity Well

gravitywell31 New Studio Track   Gravity Well

Well, it has been a long time coming but this Friday I released my first studio track since 2005. Gravity Well has a bit of a dub techno aesthetic with a half time break beat and some big bass. Hopefully my next release will be out sooner than seven years!


Gravity Well by Jason Job

Share and Enjoy:
  • printfriendly New Studio Track   Gravity Well
  • digg New Studio Track   Gravity Well
  • stumbleupon New Studio Track   Gravity Well
  • delicious New Studio Track   Gravity Well
  • facebook New Studio Track   Gravity Well
  • yahoobuzz New Studio Track   Gravity Well
  • twitter New Studio Track   Gravity Well
  • googlebookmark New Studio Track   Gravity Well
  • reddit New Studio Track   Gravity Well
Posted in sound, track | Tagged , , , , | Leave a comment

Converter – Live Ambient Minimal Techno Synth Jam

This is a live (mostly) analog ambient minimal techno jam I did in my studio using my Yamaha CS-10 for the first time. It also features a Roland HS-60, which is just a Juno 106 with speakers (though I never use them) and a Eurorack modular synth making drones, noise, chirpy blips (via an Intellijel uScale) and a TipTopAudio BD808 providing the kick drum. All other drums were samples played from Ableton. Everything recorded into Live. Reverb provided by Vallhalla Room and Eos. Delay by OhmBoyz.

Also available on SoundCloud:


Converter by Jason Job

Share and Enjoy:
  • printfriendly Converter   Live Ambient Minimal Techno Synth Jam
  • digg Converter   Live Ambient Minimal Techno Synth Jam
  • stumbleupon Converter   Live Ambient Minimal Techno Synth Jam
  • delicious Converter   Live Ambient Minimal Techno Synth Jam
  • facebook Converter   Live Ambient Minimal Techno Synth Jam
  • yahoobuzz Converter   Live Ambient Minimal Techno Synth Jam
  • twitter Converter   Live Ambient Minimal Techno Synth Jam
  • googlebookmark Converter   Live Ambient Minimal Techno Synth Jam
  • reddit Converter   Live Ambient Minimal Techno Synth Jam
Posted in ableton, Eurorack, hardware, instrument, live recording, modular, sound, Synth | Tagged , , , , , , | Leave a comment

How To Convert A 100 Volt Yamaha CS-10 Synthesizer To 120 Volts

IMG 0443 1024x768 How To Convert A 100 Volt Yamaha CS 10 Synthesizer To 120 Volts

Yamaha CS-10

Today I received my new (old) Yamaha CS-10 synthesizer from Japan. I was surprised to find that the plug was a regular two pronged plug that would fit into a regular North American socket. I had assumed that I would need a plug converter as well as a voltage converter to operate the synth but I found a copy of the service manual and discovered that the factory transformer already has a 120 volt tap. Too bas I already ordered a voltage converter…

IMG 0434 1024x768 How To Convert A 100 Volt Yamaha CS 10 Synthesizer To 120 Volts

The inside of the CS-10.

Anyway, I got out my screwdriver, undid all the screws on the side panels, the four screws at the bottom on the back and the two in the corners on the front panel. With that done I gently pulled the side panels open just enough to flip the top panel back. Be careful with the side panels if trying this yourself as there is a connection that did not want to come off near the front of the side panels and it would be easy to force this and damage it. Fortunately it isn’t necessary to take the side panels completely off.

IMG 0433 1024x768 How To Convert A 100 Volt Yamaha CS 10 Synthesizer To 120 Volts

Power to the 100 volt tap. (before)

The transformer is in the back right of the CS-10 and there is plenty of space to access it. The yellow wire coming from the transformer is the 100 V tap and the brown wire is the 120 V tap. All that needs to be done to switch the CS-10 to be used in North America is to cut the power wire going to the 100 V tap and then re-solder it to the 120 V tap.

IMG 0439 1024x768 How To Convert A 100 Volt Yamaha CS 10 Synthesizer To 120 Volts

Power to the 120 volt tap. (after)

That’s it. Couldn’t be easier. Now just put it back together, power it up, and bathe in the analog goodness.

Share and Enjoy:
  • printfriendly How To Convert A 100 Volt Yamaha CS 10 Synthesizer To 120 Volts
  • digg How To Convert A 100 Volt Yamaha CS 10 Synthesizer To 120 Volts
  • stumbleupon How To Convert A 100 Volt Yamaha CS 10 Synthesizer To 120 Volts
  • delicious How To Convert A 100 Volt Yamaha CS 10 Synthesizer To 120 Volts
  • facebook How To Convert A 100 Volt Yamaha CS 10 Synthesizer To 120 Volts
  • yahoobuzz How To Convert A 100 Volt Yamaha CS 10 Synthesizer To 120 Volts
  • twitter How To Convert A 100 Volt Yamaha CS 10 Synthesizer To 120 Volts
  • googlebookmark How To Convert A 100 Volt Yamaha CS 10 Synthesizer To 120 Volts
  • reddit How To Convert A 100 Volt Yamaha CS 10 Synthesizer To 120 Volts
Posted in hack, hardware, make, Synth | Tagged , , | 2 Comments

Ableton Tip: Use Utility To Automate Track Level, Mute And Pan

Often when finalizing a mix I find myself automating volume, pan, and mute settings on an individual track. Though you can do this by editing the Mixer envelopes in the Arrange View there is a downside to doing this. A good example of why this can be problematic can be seen when you automate the Track Volume of a Mixer and then find that you want to adjust the volume of the entire track. At that point you either have to go through and edit your entire automation envelope or you would need to place a Utility device at the end of your device chain for that track and adjust its gain knob. The former is a pain in the butt and the later is kind of a hack because ideally you would like to still be able to use the mute, pan and volume controls of the Mixer.

Screen Shot 2012 02 06 at 12.29.52 PM Ableton Tip: Use Utility To Automate Track Level, Mute And Pan

The Utility device in Ableton Live

The solution to this is to put a Utility device at the end of your device chain for the track and to automate the mute, panorama and gain of the Utility rather than your Mixer. This way you can still adjust the volume, pan and mute settings using your Mixer. This can be really handy to bring the entire level of a track up or down, to mute it completely or to position the entire track in the stereo field.

So now, instead of this:

Screen Shot 2012 02 06 at 12.30.30 PM Ableton Tip: Use Utility To Automate Track Level, Mute And Pan

Level automation with Mixer Track Volume

you now have this:

Screen Shot 2012 02 06 at 4.02.38 PM Ableton Tip: Use Utility To Automate Track Level, Mute And Pan

Level automation with Utility Gain

This tip has saved me a lot of time editing envelopes and has given me more flexibility in adjusting my mixes. I hope you find it useful.

Share and Enjoy:
  • printfriendly Ableton Tip: Use Utility To Automate Track Level, Mute And Pan
  • digg Ableton Tip: Use Utility To Automate Track Level, Mute And Pan
  • stumbleupon Ableton Tip: Use Utility To Automate Track Level, Mute And Pan
  • delicious Ableton Tip: Use Utility To Automate Track Level, Mute And Pan
  • facebook Ableton Tip: Use Utility To Automate Track Level, Mute And Pan
  • yahoobuzz Ableton Tip: Use Utility To Automate Track Level, Mute And Pan
  • twitter Ableton Tip: Use Utility To Automate Track Level, Mute And Pan
  • googlebookmark Ableton Tip: Use Utility To Automate Track Level, Mute And Pan
  • reddit Ableton Tip: Use Utility To Automate Track Level, Mute And Pan
Posted in ableton, mixing, sound | Tagged , , | Leave a comment

Home Studio Room Measurement

untreated bass waterfall Home Studio Room Measurement

Waterfall graph of my room between 20Hz and 350Hz

I finally got around to taking some measurements in my new studio in an effort to eventually treat the acoustics in my room and hopefully improve my mixing environment. I used a Behringer ECM8000 Ultra-Linear Measurement Condenser Microphone and a great piece of freeware called RoomEQWizard which runs on Windows, Mac and Linux. Normally I avoid anything with the Behringer name on it but by all reports this mic is more than up for the job of taking home studio measurements.

untreated room freq response Home Studio Room Measurement

Frequency response graph between 20Hz and 20kHz

Though RoomEQWizard is a free app you do have to register and login to the Home Theatre Shack forums to download it. They have a good forum for RoomEQWizard if you run into trouble taking your measurements or need help analyzing the results. I’ll definitely be leaning on the folks there to help me interpret the measurements I made tonight.

I’d also recommend a simple tutorial which helped me get things done without too much fuss which you can find here. The tutorial also mentions some other software options, though none of the others are free.

As I apply some treatment to my room I will post comparison graphs and hopefully I’ll have some analysis I can share to help interpret this data.

Share and Enjoy:
  • printfriendly Home Studio Room Measurement
  • digg Home Studio Room Measurement
  • stumbleupon Home Studio Room Measurement
  • delicious Home Studio Room Measurement
  • facebook Home Studio Room Measurement
  • yahoobuzz Home Studio Room Measurement
  • twitter Home Studio Room Measurement
  • googlebookmark Home Studio Room Measurement
  • reddit Home Studio Room Measurement
Posted in mixing, sound | Tagged , , , , , | Leave a comment