Browsing Posts in Miscellaneous

In Improving Your Audio: Hardware Edition, I focused on the importance of good audio hardware. No amount of post-processing is going to turn poor raw audio into a listenable podcast/webcast/screencast. It would be like trying to print a high resolution image from a grainy scan. Sure you can interpolate pixels to clean up the graininess, but you’re not going to make detail magically appear that wasn’t in the original scan. The same is true with audio. You can clean up bad audio by removing pops and hisses, but you’re not going to make good sound magically appear from poor quality raw audio.

Pop FilterOne inexpensive piece of equipment that will save you a lot of retakes and clean-up is the pop filter. A pop filter is a thin screen of fabric that sits between you and your microphone and will set you back about $20. The pop filter is the black circle on the gooseneck in the image on right. (Image used with permission under Creative Common Attribution 2.0.) A pop filter prevents “p” and “t” sounds from making “popping” sounds in your audio. Without a pop filter, you end up with audio like this:

I’ve recorded the same phrase at the same distance from the microphone, but now with a pop filter between me and the mic:

The popping is caused by the rapid burst of air overloading the input capacity of the microphone, which results in clipping. You can see it if we look at the waveform of the raw audio.

Audio Clipping Due to Popping

Notice how the audio in the top recording is clipped where the microphone is overloaded. (+/- 1.0 is 100% input in Audacity.)

Most headset microphones like the LifeChat LX-3000 have a wind shield, which performs the same function as a pop filter. A wind shield is a fancy term for that piece of foam on the actual microphone. The main disadvantage of a wind shield over a pop filter is that wind shields “colour” the audio more. A good pop filter is acoustically neutral, which means that your audio sounds the same with and without the pop filter – it only eliminates the popping from “p” and “t” sounds. Also remember to attach your pop filter to your mic stand or boom and not directly to the microphone otherwise the microphone will pick up vibrations from the pop filter.

The moral of the story… If you’re going to spend money on good audio gear, don’t forget to buy a pop filter. The $20 it costs you will more than pay for itself in better audio quality and time saved in fewer edits and retakes.

Until next time, happy ‘casting!

Over the years, I’ve done a lot of audio work between podcasts, screencasts, and webcasts. So I know a thing or two about computer audio. I don’t claim to be an expert like my friends Carl Franklin or Richard Campbell, but I’ve done enough to be able to offer some helpful tips. We’re going to start with the hardware.

The quality of your computer audio can only be as good as the raw captured product. Use a bad microphone and no amount of software cleanup is going to magically produce good audio. You might be wondering how much difference the hardware can make? I’ve recorded the same audio track using four (4) different microphones on the same computer. (I didn’t record them simultaneously as multi-track recording is notoriously difficult, but I did say the same phrase into each microphone on after the other.) Let’s start with the LifeChat ZX-6000.

LifeChat ZX-6000

My voice sounds like I’m on a telephone. The sound is hollow and lacks depth. If we plot a frequency analysis using Audacity, we can easily see the problems.

LifeChat ZX-6000 Frequency Spectrum

OK, maybe not easily if you’re not familiar with audio. Let me explain some basic ideas and then you should be able to see the problems.

Normal human hearing discerns frequencies between 20 Hz and 20 kHz. The standard tuning note for musicians is the 440 Hz, which is an A above middle C on the piano. The lowest note on the piano (A0) is 27.5 Hz and the highest note (C8) is 4186 Hz. (I’m using the example of a piano since many people, even non-musicians, have at least played with a piano at one time or another.) Lower frequencies correspond to lower notes and higher frequencies to higher notes. The frequencies mentioned are the fundamental frequencies. When you play an A4 on the piano (or any other instrument including the human voice), the major frequency is 440 Hz, but there are many harmonics or overtones that occur. These harmonics give a colour and depth to the sound. This is one of the reasons why different instruments sound vastly different when playing the same note – the harmonics produced by each instrument are quite different. This is how we perceive different ranges of audio frequencies. (Taken from Wikipedia Audio Frequency.)

Frequency (Hz) Octave Description
16 to 32 1st The human threshold of feeling, and the lowest pedal notes of a pipe organ.
32 to 512 2nd to 5th Rhythm frequencies, where the lower and upper bass notes lie.
512 to 2048 6th to 7th Defines human speech intelligibility, gives a horn-like or tinny quality to sound.
2048 to 8192 8th to 9th Gives presence to speech, where labial and fricative sounds lie.
8192 to 16384 10th Brilliance, the sounds of bells and the ringing of cymbals. In speech, the sound of the letter "S" (8000-11000 Hz)

Note how 2048 to 8192 Hz gives a presence to speech, whereas 8192 to 16384 give a brilliance. Without these frequencies present, speech will sound hollow.

With this in mind, let’s take another look at the frequency spectrum from the LifeChat ZX-6000. We see virtually no frequencies above 4000 Hz, which is making my voice sound hollow. Old analog telephones transmitted 200 Hz to 3000 Hz, which is why it sounds like I’m talking on an old phone. You’ll also note that the lower frequencies (below 400 Hz) are attenuated (e.g. not as pronounced), which is why the sound is lacking some of the bass timbre of my voice.

Let’s try a different microphone and see how it performs… Next up the LifeChat LX-3000.

LifeChat LX-3000

The audio quality is vastly improved. Let’s take a look at the frequency spectrum.

LifeChat LX-3000 Frequency Spectrum

You can visibly see the difference. We have frequency response all the way up to 20 kHz with the majority of the response in the lower frequencies, which is expected due to the timbre of my voice. The lower frequencies are also not as attenuated. The quality of the sound is much warmer and vibrant with the LX-3000 than the ZX-6000.

As our last point of comparison, let’s listen to a semi-pro microphone – the one I use for my recording work – the audio-technica AT2020.

audio-technica AT2020

The differences are subtler this time, but still noticeable. The audio has more depth and presence than with the LX-3000. Let’s take a look at the frequency spectrum.

audio-technica AT2020 Frequency Spectrum

Notice the better bass response below 400 Hz giving a truer rendering of my low voice. We also have better harmonics in the 10 to 20 kHz range, providing a more life-like sound. We can also take a look at the frequency response of the microphone, which can be found on the manufacturer’s website here.

audio-technica AT2020 Frequency Response

Note the flat response curve across the entire range of frequencies. This means that the microphone records all frequencies with equal efficiency, which results in little distortion of the raw sound. For comparison, I would expect the response curve for the ZX-6000 to drop to virtually zero above 4 kHz and show attenuation below 400 Hz. You want a flat response curve for your microphone as it will not colour or distort the recorded audio.

I should note that both the LifeChat LX-3000 and ZX-6000 have hardware noise cancellation. (Noise cancellation will remove an annoying background hum originating from fans, pumps, and other sources of low background noise. It can’t do anything to clean up dogs barking, children screaming, or other sudden noises that disrupt your recording sessions.) Applying software noise cancellation on either of these microphones has little additional benefit. The audio-technica AT2020 does not have hardware noise cancellation and benefits from applying software noise cancellation. Assuming you are working in a quiet environment the audio quality of the AT2020 without noise cancellation is still better than the LX-3000 and far superior with noise cancellation. Software noise cancellation usually involves little more than selecting a checkbox in programs like TechSmith Camtasia Studio or similar recording packages. You can perform noise removal using Audacity too, though it’s a bit more work as you have to manually select a quiet region with just the background noise that you want to subtract.

The LX-3000 is a great microphone for conference calls and gaming. It is a good, though not great, microphone for recording podcasts/screencasts/webcasts. It is inexpensive ($30 to $50), easy to use, and can be bought at most computer stores. If you’re just getting started, this is a good microphone to buy.

If you’re looking to take your audio to the next level, the audio-technica AT2020 is a great semi-pro microphone that you can pick up at reasonable cost. You’ll have to go to an audio specialty store as you won’t find these in your regular computer stores. I purchased mine at Long & McQuade, which is a chain of well-respected Canadian musical instrument stores. Now what is a reasonable cost? You’ll need more than just a microphone. You’ll also need a pre-amp to power the microphone as semi-pro and pro microphones don’t have high enough output to jack directly into your computer microphone port. You’ll need a pop filter (which prevents “p” and “t” sounds from making “popping” sounds in your audio), a mic stand, an XLR cable for mic to preamp, and a 1/4” to 1/4” male cable for preamp to computer (or 1/4” to 1/8” male if you are using a normal mic-in on your computer).

Component Price*
audio-technica AT2020 $120
ART TubeMP Tube Mic Preamp $49
Pop Filter $20
Mic Stand $20
2 Cables (XLR & 1/4”-1/4”) $20
Total $229

* Prices are in Canadian dollars.

You can get the same microphone (AT2020) with a USB option, but at a higher cost of $170, which is basically the cost of the preamp and cables. The TubeMP preamp has an actual vacuum tube that gives a warmth to the sound that is hard to achieve otherwise. Given the similar costs, I would personally err on the side of using a tube preamp over USB.

You might want to invest in a decent sound card, such as a Creative Labs X-Fi Platinum or similar card, which has better audio recording qualities than the audio-in that comes on your motherboard. It’s hard to find the X-Fi cards anymore. So you’ll have to look around to find a good quality audio card, but expect to spend $100 to $200 on the audio card alone. Remember your audio is going to be no better than the weakest link in the chain.

Is $229 of the audio-technica AT2020 worth the improved audio over the $30 to $50 LifeChat LX-3000? That’s up to you to decide.

As many of you know, I am an independent consultant and use my own laptop when possible. I’ve got all my tools set up the way I like them and everything else that I need to be productive. Given that I work for multiple clients, I can’t join my laptop to any particular client’s domain. First is the hassle factor, especially when switching between different clients within a week. Each domain join requires a domain admin to authorize the join by typing in his/her credentials when prompted on my laptop. Second I don’t want a client’s Group Policy being applied to my laptop. Third – and more importantly – is the non-disclosure agreements that I sign with clients. If I join my laptop to a domain, the domain admins have full rights to my machine and hence data from other clients. So domain joining just isn’t an option.

In most cases, not being joined to a client’s domain doesn’t make one iota of difference. You need to access a network share or printer, browser to it and you will be prompted for domain credentials. The fact that you’re using different domain credentials to access the resource from those that you logged in with doesn’t matter one bit. If you want to expedite the process and not wait for an authentication time-out, you can utilize NET USE from the command line to tell Windows which credentials you want to use when accessing certain computers. You can even make them persistent or roll the whole thing into a batch script that you can execute whenever at a particular client.

net use \\server /user:domain\username /persistent:yes

Unfortunately this doesn’t work in all cases. One of my longstanding development pet peeves has been certain tools – I’m looking at you SQL Server Management Studio and SQL Query Analyzer – that don’t allow you to specify alternate domain credentials for authentication. For example, SQL Server Management Studio allows you to log into a SQL Server instance using Windows Authentication or SQL Server Authentication. If the SQL instance requires Windows Authentication – the recommended configuration – SQL Server Management Studio uses your logged in credentials. This works well if your computer is part of the domain, but fails horribly if not. It doesn’t let you specify alternate credentials or even prompt you for alternate credentials if the log-in fails.

I’ve tried seemingly everything. NET USE doesn’t help here because NET USE is specifically for network shares.

net use \\sql-server-name /user:domain\username # DOES NOT WORK – Only provides the domain credentials when accessing shares

RUNAS also fails – either the SHIFT right-click variety or command line – as it tries to run the command locally as the domain user, who is unknown by your computer because you’re not part of the domain.

runas /user:domain\username “C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe”

 image

For years (yes, years) I have resorted to using Remote Desktop to log into a domain computer so that I could run SQL Server Management Studio, used a domain-joined virtual machine, or begged co-workers to run commands for me. Now I feel foolish because I stumbled upon a solution that has been built into Windows for years. It is a simple command line switch for the RUNAS command that I never noticed: /netonly. (Note that the /netonly flag is not accessible via the SHIFT right-click menu, only via the command line.)

runas /netonly /user:domain\username “C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe”

image

Success! And SQL Server Management Studio running using /netonly domain credentials. The command is run as my local user, but uses the supplied domain credentials only when accessing the network.

image

image

I can access remote SQL Servers using Windows Authentication without problem now! (You’ll have to take my word for it or try it yourself as it would be impolite for me to show screenshots of me accessing a client’s SQL Server.) Hopefully this makes some other consultant’s life a little bit easier.

My blog has been quiet these last few months. With the economic downturn and various friends’ contracts being terminated, I am busy making hay while the sun shines. I have clients with paying work and so I’m staying busy while the work remains available. I’ll have lots of time for blogging when I’m between contracts. That said, one of my New Years resolutions is to “Never stop sugarcoating the facts without notice”. (Brought to you by the Resolution Randomizer.)

image

Seriously, one of my major New Years resolutions is to blog and screencast more. That means more Becoming a Jedi episodes, a series of posts on psake and using PowerShell as a build tool, as well as some other ideas that are in-the-works. Other things that I’m currently excited about, and you’ll likely find posts about in the coming months, include MEF, ASP.NET MVC, jQuery, multi-step refactorings, Prism/WPF, and convention-over-configuration (in both ORM and IoC) to create maintainable applications.

So stay tuned. More content is on its way.

I was going sysprep a base image of Windows Server 2008 this morning and followed my own instructions on sysprepping Windows. I went to the installation DVD and couldn’t find sysprep. A quick google later and a bit of poking around revealed that sysprep is now installed by default on Windwos Server 2008. You can find it at:

c:\Windows\System32\sysprep\sysprep.exe

The experience is also streamlined considerably. Simply run sysprep.exe above and you are presented with:

 image

Check the “Generalize” checkbox (regenerates system SID), change the Shutdown Options to “Shutdown”, and click OK. The system will go through the sysprep process and shut itself down. You can now create cloned servers to your heart’s content simply by creating linked servers and booting the clone as originally documented here.

UPDATE: Benjamin Chau noticed that SIDs weren’t being regenerated. Turns out that you need to check the Generalize checkbox to make that happen.

image A Reading from the Book of Armaments, Chapter 2, Verses 9 to 21 (Wikipedia | YouTube):

…And Saint Attila raised the hand grenade up on high, saying, “O Lord, bless this Thy hand grenade that with it Thou mayest blow Thine enemies to tiny bits, in Thy mercy.” And the Lord did grin and the people did feast upon the lambs and sloths and carp and anchovies and orangutans and breakfast cereals, and fruit bats and large chu… [At this point, the friar is urged by Brother Maynard to "skip a bit, brother"]… And the Lord spake, saying, “First shalt thou take out the Holy Pin, then shalt thou count to three, no more, no less. Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. Five is right out. Once the number three, being the third number, be reached, then lobbest thou thy Holy Hand Grenade of Antioch towards thy foe, who being naughty in my sight, shall snuff it.”  — Monty Python

And this shall be my third year as a MVP. I received the official email from Microsoft this morning notifying me that I have been re-awarded. Congratulations to everyone else who was awarded or re-awarded today! A special call-out to some very deserving first-time MVPs… Ben Scheirman, Jessica Moss, and Derik Whittaker. I look forward to another fun-filled year of mischief, mayhem, and software development!

Alright, alright. I give in. I’m finally twittering along with the rest of the planet. You can find me here:

http://twitter.com/JamesKovacs

You can expect witty banter, scintillating insights, and breathtaking news bites… 140 characters at a time.

If you’re looking for a good Twitter client and you’re running Windows, I would recommend Witty, a free WPF-based Twitter client. Very pretty, very functional, and very non-intrusive. Highly recommended. There is even a ClickOnce installer.

image A big thank you to everyone who completed the ORM with NHibernate survey. The results have provided me with a lot of food for thought with respect to organizing future courses. Some answers were expected while others were surprising. Rather than bore you with the details, let me get to what you really want to know… Who won the JetBrains ReSharper license? Using an advanced combination of digital and analog randomization technologies (e.g. I printed out the list and pulled one out of a hat), the winner is Brett Baggott of Nashville, TN. Congratulations, Brett. In the words of Obi-Wan Kenobi, “Use it wisely…”

In other news… The Castle Project PMC has selected its winner for The Great NHibernate/Castle Giveaway. Drum roll please… The winner is Markus Zywitza of Aarbergen, Germany. Markus has received Visual Studio Team Suite with MSDN Premium. Asked why he was chosen, he humbly suggested many other project contributors more deserving than himself, but added this explanation.

My involvement of Castle began some 18 month ago as a user. My main involvement with Castle is documentation and small enhancements and bug fixes. Writing docs is a structured approach to learning for me, and I am willing to share what I create through learning. I guess that was the reason for the PMC to select me, as the documentation has been neglected lately.

– Markus

The NHibernate team is still debating the most deserving recipient. (I’ll remind them again in another week or two…) Fabio Maulo – the current project lead – has received his subscription after a bit of work on my part. (I unilaterally decided that the third should go to Fabio, as I mentioned in the original announcement.) I would like to offer a huge thanks to an unexpected person. First let me give you a bit of background. I sent Fabio his license activation code, but it didn’t work as the code turned out to be valid only in Canada/USA. (Fabio lives in Buenos Aires, Argentina.) I contacted MANY people at Microsoft to see what could be done. No one could solve the problem of getting Fabio a license key. As a last resort, I emailed S. Somasegar, Senior VP of DevDiv, himself asking for his assistance to solve the problem. That was on a Thursday. I didn’t expect an answer. The guy is a senior VP and I’m a lowly MVP. Plus I was giving the license to the project lead of NHibernate and DevDiv was in the midst of finalizing Entity Framework v1. (I didn’t expect that to have any bearing, but you never know. Conspiracy theorists eat up this type of stuff.) On Monday – just two business days later – I received a personal email from Soma himself informing me that he was getting the issue resolved and apologizing for the confusion around the licenses! Sure enough, James Rice and Manuel Hernandez contacted me and Fabio. They got the license sorted out in short order. So a huge thanks to Soma for his responsiveness and his support of the .NET community.

Earlier this week, I received three (3) complimentary copies of Visual Studio 2008 Team Suite with a MSDN Premium Subscription from S. Somasegar, Corporate Vice President of DevDiv at Microsoft. This very generous gift, worth $10,939 USD per copy, was a thank you to developer MVPs for their work in making Visual Studio 2008 a success. I am free to distribute the three copies as I see fit. There are no strings attached for me or the recipient (other than import rules related to your country, of course).

The first copy goes to Fabio Maulo, the recently-appointed leader of the NHibernate project. Fabio has been tirelessly porting features from Hibernate to NHibernate. Due to his hard work, the soon-to-be-released* NHibernate 2.0 has feature-parity with Java’s Hibernate 3.2.5. He is now working on porting Hibernate 3.2.6** features to NHibernate 2.1 (the current trunk). When not porting features, he is answering NHibernate-related questions on the NHibernate developers and nhusers mailing lists. Thank you for all your hard work, Fabio.

The other two (2) copies are part of the The Great NHibernate/Castle Giveaway. This is a big thank you from me to the vibrant communities around both the NHibernate and Castle projects. If you’re not familiar with either project, you owe it to yourself to check them out. Each project receives one copy to award to whomever they feel has made (or makes) significant contributions to their project. I humbly suggest that they encourage developers to get involved and contribute to the project with the award going to the developer with the most significant contribution over the next few months. The exact rules will be determined by the core team of each project. If you’re interested in contributing to either project, you can find information here:

NHibernate – Getting Started with the NHibernate Source Code

Castle Project – Get involved

* NHibernate 2.0 Alpha1 is available now. The general availability (GA) release should happen in the next few months.

** Hibernate 3.2.6 is the current production version of Hibernate.

JBAcademyI’d like to thank the Academy… No, I haven’t won best-supporting actor for my portrayal of a mild-mannered .NET developer in some smash blockbuster. (At least not yet.) I’ve been accepted as a member of the JetBrains Academy. What is it all about? The Academy’s mission statement says it best:

The JetBrains Development Academy fosters a community of experts and evangelists to champion best development practices and promote software innovation worldwide. The Academy serves as a connection point for developers who strive to adopt top methodologies and use JetBrains products to help them achieve that goal.

You can find my Academy profile here. (No, I didn’t write it, though I am flattered.) The profile fits with the general tone of the Academy, as can be seen by reading the profiles of my good friends, Donald Belcham and JP Boodhoo. I wish I could be “as mellow, smooth, and intoxicating as [Donald's] favorite single malt scotch”.