Skip to main content

Mike Kreuzer

Mic time

December 4, 2021

With two years of working from home under my belt now, & the firm determination to keep working from home, I decided to up my audio game. To jog my memory in the years to come, & as a point of departure for anyone else considering doing something similar, this is what I got, & why.

My microphone's an Electro Voice RE 20 - I chose that instead of a Shure SM7B, the other probably more popular contender in this space. The RE20's meant to have less proximity effect, that's the change of pitch caused by proximity to a mic, so with the RE20 I won't have to remember my exact position relative to the mic between takes. I also think it looks cooler.

The RE20's a heavier mic, & also probably requires what we used to call a cradle, what everyone seems to call a shock mount now, for me that's the EV309A, still winging its way to me from America. The heavier mic & the shock mount require a sturdier mic arm to hold that weight up. I went with a K&M 23860. I'm not super keen on the internal XLR cable, it can't be easily replaced, but it works (well) for now. That's all added cost though, the RE20's more expensive to start with, & the SM7B doesn't need a shock mount & can have a lighter & cheaper arm.

As a pre-amp/digital interface I chose the MOTU M2, partly because it was meant to work with Linux (and it does), but mostly for its meter. I would have got one with a physical VU meter if I could find one I could afford, that's the look I want. My experience so far, ironically I suppose, is that I look at the display on my computer screen much more often than the one on the box, but maybe that'll change. It's partly a question of where to position the thing on my desk. The RE20 needs a lot of gain, and the MOTU M2 is reasonably clean, the alternative I considered was an Audient ID14 which is meant to be quieter still, but that has no real display at all & isn't meant to work with Linux.

With gain on the MOTU set at around 12 O'Clock (the dials aren't marked with a scale, why would they be) I can start to hear a hiss with the volume set all the way up. That stays pretty constant until you get quite near maximum gain, then it jumps up abruptly, and can be heard at a normal volume. So every bit of gain except that very last part is usable. Using the MOTU M2 by itself with the RE20 means still needing to add around 20dB of amplification in software, for me. If you're a shouter you mightn't need as much but I do. So I added a Cloudlifter to the mix.

The Cloudlifter adds gain, supposedly up to 25dB depending on your power source, I get almost exactly the 20dB I need. Can you hear the difference? Maybe. Theoretically there should be less detail with digital amplification. Is someone half listening on a laptop speaker going to hear that difference? Probably not. For me it means I get a good signal in real time and it's one less step in producing anything I record.

There's a lot of woo woo in the audio equipment world, gold tipped digital cables (that can't possibly change the sound of a digital signal), burning in headphones (which does nothing). A lot of superstitious musicians I suppose. Musicians are the worst. Almost as bad as actors. But there's some lovely looking kit to be had. Nice sounding too.

Tags:

Swift downloaded (Swift for just a bit longer)

December 1, 2021

I've mostly been ignoring Swift this year. This is after following all of the exciting twists and turns of the language intently since that WWDC morning long ago in 2014. But even I heard the news about Swift now having async/await. And I was tempted. Hey, I'm only human.

An example that appeared all over the place went something like the following. (Maybe something like it was shown at WWDDC? I don't know, what with the whole ignoring things that are Swift-like & all.)

func getObject(from url: URL) async throws -> OneParticularStruct {
    let (data, _) = try await URLSession.shared.data(from: url)
    let decoder = JSONDecoder()
    return try decoder.decode(OneParticularStruct.self, from: data)
}

Which is much nicer to my eye than something with a callback, but it has a few problems of its own. It only works for that one particular struct for a start.

You could make it generic pretty easily though. It only really relies on a struct being Decodable. (Swift's nice that way.) So, something like:

func get<T>(object type: T.Type, from url: URL) async throws -> T where T: Decodable {
    let (data, _) = try await URLSession.shared.data(from: url)
    let decoder = JSONDecoder()
    return try decoder.decode(type, from: data)
}

Which is OK, and perfectly workable. But you need to store it somewhere and in versions of Swift where extensions work reasonably quickly (which hasn't always been true), a Swiftier solution might perhaps be to push protocols further. Something like:

protocol DownLoadable: Decodable {
}

extension DownLoadable {
    static func get(from url: URL) async throws -> Self {
        let (data, _) = try await URLSession.shared.data(from: url)
        let decoder = JSONDecoder()
        return try decoder.decode(Self.self, from: data)
    }
}

Now any struct that's DownLoadable also gets to be Decodable, & gets a static method to download & decode it, all for free.

A quick & dirty example I cut out of something was I playing around with earlier might look like:

import Foundation

protocol DownLoadable: Decodable {
}

extension DownLoadable {
    static func get(from url: URL) async throws -> Self {
        let (data, _) = try await URLSession.shared.data(from: url)
        let decoder = JSONDecoder()
        return try decoder.decode(Self.self, from: data)
    }
}

struct CertServerMeta: Decodable {
    var caaIdentities: [String],
    termsOfService: URL,
    website: URL
}

struct CertServer: DownLoadable {
    var keyChange: URL,
      meta: CertServerMeta,
      newAccount: URL,
      newNonce: URL,
      newOrder: URL,
      renewalInfo: URL,
      revokeCert: URL
}

Task.init {
    do {
        if let url = URL(string: "https://acme-staging-v02.api.letsencrypt.org/directory"){
            let data = try await CertServer.get(from: url)
            print(data.newNonce) // eg
	}
    } catch {
        print("Error: \(error).")
    }
}

sleep(5)

Quick & dirty in a few ways, not least being the sleep there at the end so you can paste the code into a console app & it won't finish before you get to see it do anything. (Shakes fist at async sky!)

let data = try await CertServer.get(from: url)

Nice & short to write if you just want to download things. There are a few more lines to add if you want to carry authentication headers with you, that's still a pain in Swift I gather, but this much is a one liner to use now.

Another not insignificant problem's there on line one of the code. Import Foundation. Despite making fun of it (many times), I've been trying to use Swift on Linux. Without Foundation it's been a difficult slog. I'm still in two minds about it. More to say about that adventure in a bit.

Precis, the news that was

November 21, 2021

I set up Precis, a news summary site, and it failed. This is a short retrospective and I suppose memorial.

Precis was meant to be the news without the hype or distraction. It came out each day with a short summary of the day's main stories, with links to earlier coverage of those stories both in Precis and the news sites I sourced them from. Human curated: no algorithms, no firehose.

It was, like all these things, a product aimed at filling a need I felt personally. It was made in imitation of (and with the sincerest form of appreciation for) Brief, which was a news summary app that got shuttered around a month earlier when the team behind it was "acqui-hired" by Twitter.

Maybe basing a business idea of a failed business isn't necessarily that great a recipe for success. I still think it has potential though, in other hands.

Maybe the daily format worked against the aim of avoiding hype. It certainly meant I had little spare time for much of anything else, or to delve at all deeply into any one story. Better resourcing would have helped. But there was a definite drumbeat of repetition of a few major stories over its life that would have suited a longer summary time period. A weekly summary maybe.

Maybe it's better not to generalise, other than to say I didn't do much of anything to promote Precis, even to blog about it here, and that kids is usually the key.

Precis didn't generate much organic/word of mouth growth, so I stopped doing it.

In terms of the tech, Precis was a react-static site, which made it both reasonably small and reasonably fast. If I were to do something similar again I'd probably try astro or whatever was around like it at the time, to maker it even smaller and faster. But a web site, rather than an app, still seems to be the right format for it to me. The tech I think counted in its favour if anything, the problems weren't technical.

Precis ran daily from 5 August to 21 September 2021. Vale Precis.

Previously

Earlier posts...