<< >>
justin = { main feed , music , code , askjf , pubkey };recent comments
search
[ present ... 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 ... past ]
December 9, 2006
mac porting...

In August I began cleaning up REAPER's source code, and began separating the platform-specific code (mostly UI) from the mostly-portable code. Ten days ago, after 3 months of doing that while also adding new features and releasing new Windows versions every few days, I began spending a great deal of time actually writing a bunch of Cocoa code so that we could have it run on OS X.

It has gone very well, expect some preview version around Christmas.

I love it when this stuff goes faster than I had expected. I'm going to detail some of my experiences here.

There's a lot to like about programming on OS X, but there's also plenty of idiocy.

CAUTION-Boring programming discussion follows. These are mostly things that I have sort of, but not completely correctly, working.

For example, if you wish to draw text, there are countless ways to do it, and at least for what I wanted to do (emulate DrawText for our GDI emulation layer), I still haven't found a way that works as I want. The first way I tried was using CGContextShowText, which worked, except the only way I could find to measure the text before, or after drawing it didn't seem to work (using CGContextSetTextDrawingMode with kCGTextClip to modify the clip path, then get the bounding rectangle of that). So without any way to measure the rendered text, I had to find another way. I could use NSAttributedString to draw, but the first problem is that I wanted to supprot drawing to an arbitrary CGContext, which may or may not be the "active" context. Then, suggested to me, was to use Carbon's HIThemeDrawTextBox etc, which isn't really documented at all (other than in the header file and some examples). HIThemeDrawTextBox works, except the font I selected using CGContextSelectFont isn't used. It appears I could use some other API to set the font, but I havent spent that much time on that. Why can't there just a be a simple, working way?! At least win32's DrawText just works (though I hear the internals are a nightmare).

OK I won't go too much more into those sort of things. The good things are some things are just easier. Anytime you want to modify the behavior of something, it's WAY easier, since you can do a simple objective C subclass, rather than having to do the tricky hacks we do in Windows. Porting the customizable keyboard code to OS X took an hour or so. Getting it to work originally on Windows took many times that.

Rendering with Quartz just looks nice, too. The plain Windows GDI calls just look harsh and cruddy in comparison.

Here's an interesting challenge: on Windows, REAPER renders its play cursor (the line that moves constantly with playback) by using XOR drawing. It renders it by flipping all of the bits in the line, then when it needs to erase the cursor (in order to draw it in the new position), it can just XOR again. Win32 makes this available by using DrawFocusRect(). Anyway, on OS X this isn't possible, to my knowledge, because the system handles so much of the drawing process. I didn't want to be responsible for updating any of our track view at 30fps+, so I had to come up with another solution. After some experimentation, I found that you could create a new NSWindow, make it a child of the main window, and move it around as the play cursor. And it works, the system handles redrawing the track view, from its cached rendered version, so it's FAST, probably hardware accelerated, and you can do neat things with the alpha channel of the cursor. The verdict: while you can't do oldschool things like XOR drawing, you can do things sexier.

So to aid porting, I've created a new part of WDL (our general reusable code library, pronounced "whittle"), called SWELL (Small Windows Emulation Layer Library or something). So far it emulates (at an API level), portions of the Windows GDI, menu API, MessageBox, ini file (GetPrivateProfileString etc), and a bit more. Eventually we'll probably BSD license SWELL, too.

One interesting thing in SWELL is a set of macros and small functions that let us paste in menu definitions from a .rc into a C++ source file and have it generate a HMENU for it. Fun use of the C preprocessor, if you ask me.

Anyway, this is all challenging, and as a result, mostly fun.

December 9, 2006
programming style and process


I previously said I was planning on writing an article on coding style etc, and while I haven't gotten around to finishing it, I'll go ahead and discuss some of it.

1) If you program, and you're working on something that you expect to be working on for more than a couple hours, use version control. The benefits are countless. Safety, yes, but also, it gives you the ability to easily see everything you've done (if you're religious about checking your code in often), and even more importantly (to me), it lets you diff and review your changes before checking in. I do this all of the time, to make sure everything I did was everything I wanted, and that I didnt fuck anything up.

2) Don't be afraid to let things get messy. A very common (and valid) sentiment in programming is to avoid "premature optimization", where the programmer spends too much time too early on some part which may or may not even need it, introducing complexity for the sake of possible speed improvements etc. I don't hear people say this much, but I think you should take the same stance on organization. If you're programming software, and you need to add some new function for some task, don't be afraid to just toss it in near where you need it, and see what happens. Don't go creating tons of new files every time you need them. Moving code around for organization later is easy, and if you don't do it too soon, you'll a) stay focused, and b) save time in the event that the code you added wasn't used. Which brings us to the next point:

3) Don't be afraid to toss out code that you've written. Sometimes you have some problem and code a solution for it, and at the end of it, you just don't like it. If you don't like it, and think you could do it better the second time, do it the second time.

4) Going back to point #2, don't obsess from the beginning about reusability. Write code that you need, and once you're using it and see how you actually need to reuse it, then go make it reusable.

5) Finally, evolve your code. Getting something to the point of limping is the hardest part, so you should try to get to it as fast as possible. Once you're there, progress is much faster. It's like waiting for a minute to pass. If you look at a clock with a seconds hand, it goes quick, but if you just stare into space, it takes forever. Get to the point where you can see progress, then enjoy it (and test your work often).

More later, perhaps...

December 9, 2006
oh, and


I added a super simple thing to prevent spam on these comments, and it has worked perfectly. We'll see how long that lasts...



12 Comments


December 5, 2006
Music
brenchr - 1 -- [105:47]
brenchr - 2 -- [20:47]


November 25, 2006
Music
freeform jam with brenjoshshawnjoncraignewt


November 20, 2006
Music
freeform jam with brenchr


November 18, 2006
back

I wish I could say that this whole time was spent on vacation, but unfortunately it wasn't. We did have a fantastic time in England for our friends Jonathan (ha) and Catherine's (ha ha) wedding, but when we got back, after a few days rest, I got hit by a nasty something, so I've been out of commission this past week. I seem to be coming back to normal, finally...

It's been nearly a week (if I get through tomorrow it will be a full week) since I've had coffee. What should I do? I like coffee so much, but I often feel so at its mercy. It also pains me that one of the top coffee establishments in the city moved into our block. I can't live here and not get their delicious nectar! Can I?

A year ago today I started at full speed on REAPER. I had done about 5 hours worth of stuff a couple months before, but decided at this point last year that it was time. Whee. It keeps getting better and better. We'll have to do something special sometime, maybe around Christmas since that was the first public release.

Umm what else? I should update this more. Oh yes my coding guide, well, I may just do a little chapter at a time, cause I wrote a bunch of it and it's all pretty incoherent and wordy, so I better spread it out a lot. Maybe I'll do the first paragraph in a post soon.

11 Comments


November 12, 2006
Music
funwithmidi


November 11, 2006
Music
freeform jam with brennewtshort


November 8, 2006
Music
brenchrnewt - 1 -- [15:00]
brenchrnewt - 2 -- [44:46]
brenchrnewt - 3 -- [7:23]


November 7, 2006
Music
freeform jam with kevin


October 30, 2006
the real vacation

...begins. Hand feeling a lot better, yay.

When I get back, I'll likely finish and post an article on coding style and methodology that someone convinced me to start...



8 Comments


October 29, 2006
Music
chr - 1 -- [28:40]
chr - 2 -- [7:54]


October 21, 2006
Music
freeform jam with bidermanmoogfun


October 19, 2006
RSI or something

time to take a few weeks off. it's been a productive 11 months...

Recordings:

kevin - 1 -- [21:04]
kevin - 2 -- [10:15]

5 Comments


October 16, 2006
Music
freeform jam with shawnjon


October 14, 2006
Music
birthdaypartypoo - 1 -- [12:58]
birthdaypartypoo - 2 -- [28:05]
birthdaypartypoo - 3 -- [54:30]
birthdaypartypoo - 4 -- [32:21]


October 13, 2006
Music
friday the thirteenth


October 11, 2006
Music
brenchr - 1 -- [124:17]
brenchr - 2 -- [4:46]


October 10, 2006
Music
funwithspeed


October 5, 2006
Music
freeform jam with brenchr


October 2, 2006
Music
shitdrumrec


October 1, 2006
Music
craig - 1 -- [2:30]
craig - 2 -- [39:41]
craig - 3 -- [27:39]


September 29, 2006
Music
brenchrdan - 1 -- [38:17]
brenchrdan - 2 -- [31:13]


September 27, 2006
blahhh

HAPPY BIRTHDAY, BRENNAN!!!

Whee too many margaritas... Where to begin...

September 27, 2006
REAPER


Damn, 20 versions since my last post.

Propellerheads finally responded and have since been responsive (though it took them 6 whole months to get there, ick), so ReWire will be in REAPER 1.21, yay! Overall I'm still very excited, and every day this feeling continues and/or grows. Christophe is working on something that will be VERY exciting for a lot of people, and I'm still planning on (though lately slacking on) the mac port.

Something I have to say is that I waited WAY too long to make REAPER support user-skinnable icons. Doing this got a few people making some AWESOME artwork, such as this, and required very little effort on my part (ok well a day of work or so). Note to self: next time just make it easy to switch icons out (on the fly) from the beginning.

September 27, 2006
MUSIC


Here are a couple of songs that David Wiener and I made (using REAPER, mostly), that I dig:

A Little Pop Will Save Us All (for a good time, listen closely to the lyrics)

Love Somebody

Anyway, until next time!



4 Comments


September 21, 2006
Music
freeform jam with kevin


September 20, 2006
Music
brenchr - 1 -- [51:57]
brenchr - 2 -- [79:16]
brenchr - 3 -- [33:47]


September 18, 2006
Music
freeform jam with brenchr


September 17, 2006
Music
brenbidernewtx2 - 1 -- [124:17]
brenbidernewtx2 - 2 -- [7:58]


September 14, 2006
Music
kevin - 1 -- [4:37]
kevin - 2 -- [62:30]


September 13, 2006
Music
freeform jam with newtnewtchr


September 10, 2006
Music
poopieditty


September 9, 2006
Music
newhornless
tromboning alone


September 4, 2006
Music
freeform jam with brenchrjosh


August 30, 2006
Music
freeform jam with brennewt


August 23, 2006
I made a neat web page...

...showing how I've spent the better part of a year.

Yay for evolutionary software development.

Recordings:

freeform jam with chrnewtmayor

12 Comments


August 21, 2006
Music
booga


August 16, 2006
Music
brenchr - 1 -- [22:05]
brenchr - 2 -- [76:51]


August 13, 2006
Music
freeform jam with craigbiderstetc


August 9, 2006
THAT time of the month, again

So apparently I can only manage to update this once a month or so. Phew. REAPER 1.0 beta 0 is out. Yay. Some of the things that I did recently with it made my head hurt, but now it seems to have turned out pretty well. yay.

I'll save dumping the things I've been irritated with here for later, I gotta run now for a day or two.

9 Comments


August 7, 2006
Music
alone
freeform jam with brenchr


August 6, 2006
Music
bider - 1 -- [60:56]
bider - 2 -- [9:41]


August 2, 2006
Music
freeform jam with brenchr


August 1, 2006
Music
freeform jam with brenkev


July 24, 2006
Music
tangoofballs-work


July 19, 2006
Music
brenchrnewt - 1 -- [53:10]
brenchrnewt - 2 -- [43:32]


July 15, 2006
Music
freeform jam with bidercraigstewart


July 14, 2006
Music
freeform jam with brenchr


July 12, 2006
shitballs

So we had an apparent power outage where this box is the other night, and since then shit's been wonky.. either someone is DoSing us, or something about the first reboot in 4 months seems to have made this box lose network connectivity. ugh. Either way, it's completely balls.

So tired of coming in to restart it...

:wq



5 Comments


July 10, 2006
Music
freeform jam with bidernewtchrcole


July 7, 2006
Music
oopssupermonkeyball


July 3, 2006
Music
chrnewt - 1 -- [28:27]
chrnewt - 2 -- [63:51]


July 1, 2006
Music
freeform jam with brennewt


June 26, 2006
Music
brenchr - 1 -- [3:20]
brenchr - 2 -- [85:24]


June 22, 2006
Music
brenchr - 1 -- [74:51]
brenchr - 2 -- [31:34]


June 13, 2006
Music
foolingaround
sadsong


June 12, 2006
Music
freeform jam with brenchrconcertforparents


June 11, 2006
oops

I guess I let a month go by without updating. I've just been having a good time, what with all of the typing.. I'm still excited about REAPER, so shit's good.

I've been writing FX plug-ins for REAPER lately, too.. ReaGate is nearly done, ReaComp is almost working, ReaFir (FFT EQ) is nearly done, and ReaVerb is underway. ReaVerb will be a convolution based reverb, and will offer support for loading of impulses from files, as well as generating impulses from parameters, and combining and modifying any of those impulses.. I'm thinking of it like an AVS for convolution..

We (Christophe and I) decided that our goal for 1.0 release is sometime in August, which shouldn't be too hard to hit-- lots of work, but relatively straightforward. There are a few things that need to be done that I'm not quite sure how they will get done, but I'm confident enough that we'll figure it out...

14 Comments


June 9, 2006
Music
freeform jam with brenchrjonnewtbidermikewen


June 8, 2006
Music
freeform jam with brenchr


June 1, 2006
Music
bditty


May 27, 2006
Music
freeform jam with brenewtchr


May 22, 2006
Music
freeform jam with brenchr
freeform jam with brenchrfrancisjosh


May 15, 2006
Music
freeform jam with brenchr


May 14, 2006
Music
biderman - 1 -- [37:29]
biderman - 2 -- [24:39]


May 13, 2006
Music
brennewtkevcole - 1 -- [11:00]
brennewtkevcole - 2 -- [73:43]
freeform jam with newtonkevin


May 12, 2006
bitching and moaning

Can I just reiterate (really quick before I go to bed) how terrible the DXi and VSTi SDKs are? They make it impossible for people to write solid hosts, and make for tons of lousy plugins that don't handle any host that isn't PERFECT. All they need is better documentation and developer discussion (so developers of hosts can know what plug-ins use to do things, and developers of plug-ins can know what hosts are doing). For example, after one email from the developer of jamstix, I got it working in REAPER. If only the FL Studio devs would mail me (who am I kidding, but I'd love to be proven wrong)...

Since we're still waiting to hear back from Propellerheads on the Rewire SDK, we may just have to do something of our own to add rewire-like functionality. Perhaps we can call it ReaRoute, and perhaps it will work with tons of other software, without them having to do a thing. Mmmmm. Lots of code to write.

It just pisses me off to no end how all of these audio software companies don't care about their users. They care about them, but keeping them just happy enough to get some of their money. Fuck that.

6 Comments


May 4, 2006
Music
freeform jam with chr


May 2, 2006
Music
pointlesspooonyourhands


April 29, 2006
Music
freeform jam with brenbidercraig


April 27, 2006
the two of us are very happy...

...that the rain stopped.

I think I need a few more days of not coding. Must... regenerate.. brain...

11 Comments


April 26, 2006
Music
freeform jam with brenewtbider
cheapodrumditty


April 24, 2006
Music
brenchr - 1 -- [64:10]
brenchr - 2 -- [60:07]
brenchr - 3 -- [25:23]


April 23, 2006
Music
freeform jam with biderkevin
odetomack


April 17, 2006
Music
freeform jam with brenchr
newdoodie


April 12, 2006
and here we are.

...where to begin. Tom got married last weekend. Was one hell of a fun weekend. I was a bit worried it would be too uncomfortable, out among the orange trees, but the weather turned out great, Brennan and Isabelle brought an RV, and we all had a good time (and punched oranges).

Got to fly the little RC heli out there too, which was fun.. so when I got back I finally installed the upgraded symmetrical rotors, new motor and heatsinks, and LiPO battery and voltage alarm. Flew it inside today, though didnt do anything fancy since I'm not that good yet.

April 12, 2006
REAPER news


I heard back from Mackie, with a response that stupified and angered me. They only license documentation for the MCU under NDA to select companies (as in, not us). They don't seem to care about their customers, just their own (less than obvious to me) interests. I can only hope I don't get the same nonsense from Propellerheads, because I think people using REAPER will want Rewire more than full MCU support anyway (REAPER already supports the MCU somewhat, but without doing a lot more research it can't do all the fancy things that the MCU is capable of). Sigh. The pain of trying to enter a market that is very established and saturated. But I'm only mildly deterred. If Propellerheads *does* dick me around, I will do one of two things-- either go to Stockholm and try to convince them with beer (though don't get any ideas, guys), or just do what I've been meaning to for a while, and port JACK to Windows.

April 12, 2006
MacBook Poo


Speaking of Windows, after BootCamp was released, Steve convinced me to get (at a discount at least) a MacBook Pro. So I did. For running OS X it's pretty good, but as a Windows XP laptop it really kinda sucks. There's a few driver issues that need fixing (no backlit keyboard in windows, sound always goes out speakers, using the built in camera causes BSoD, etc), but the big hardware issue is that the Mac keyboard is lacking keys. Specifically: insert and backspace(delete). I did find some good 3rd party utility that does help a lot allows all sorts of remapping, and enabled the mac's FN key. And finally, the thing gets HOT. I guess that's to be expected with 2x 2ghz cores, but still. I got spoiled by my little Sony's 1ghz P-M that runs nice and cool (and granted, slow).

Oh yes, and southpark this week was SO awesome.

Recordings:

notthefirsttimealone

9 Comments


April 5, 2006
Music
freeform jam with robnewton


April 2, 2006
Music
kevinbrennan - 1 -- [29:59]
kevinbrennan - 2 -- [53:47]


March 25, 2006
so ronery

...while the MSO (think LSB/MSB) is out of town. As it has been at least a couple of weeks since an update I suppose I shall give updates.

Umm, lots of work on reaper done, lots more to do. Added pitch shifting/timestretch, using SoundTouch, which makes it very nearly done, on a purely feature-based scale, the main other thing needed being MIDI editing.

I went to LA to meet with one of REAPER's biggest evangelists, where it was used in a relatively well known studio:

(to make music which, while I didn't like, I am secretly hoping for huge commercial success, to give REAPER that extra bit of legitimacy. note: the laptop was just being used as a remote display to a beefy dual opteron on the floor. the reason it is there is that while the speakers in the room were great, the studios, for whatever reasons, like having the computers in places you can't hear the speakers. duh.)

When I added SMP support to REAPER I discovered the the Waves plug-ins (at least version 5) have real issue with running separate instances on multiple processors simultaneously. All of the other plug-ins I've tried work great, but when running with Waves on an SMP system, if two instances end up processing at the same time, BOOM, it crashes. I even narrowed it down to what the code looked like (it was a function that seemed to just convert double to float), and sent them an email asking to see if they had any ideas or if they would fix. That was 10 days ago or so, and they haven't responded. I ended up just detecting "Waves" and doing a critical section around that, as a hack. LAME.

Which brings me to my next bitchpoint. People expect support for software they pay for, yet software people pay thousands of dollars for, they get crappy ass support. WTF?

Spent some time debugging problems relating to some systems (some versions of MSVCRT?) enabling floating point exceptions that are supposed to be off by default. So now I turn a lot of them on when debugging, and off on release builds. Ugh.

Have a request in to Mackie to get the real MCU documentation so I can add full support for it, waiting (though it hasnt been THAT long).

Have a request in to Propellerheads for the Rewire SDK. Been a week or two, still waiting.

anyway, now to go see why SoundTouch has to require MSVCP60.dll, assuming it is STL or something. (update: yep, updated in .931, bla bla bla)



Recordings:

brenbidernewtonmayor - 1 -- [11:55]
brenbidernewtonmayor - 2 -- [113:38]
brenbidernewtonmayor - 3 -- [72:21]

4 Comments


March 21, 2006
Music
freeform jam with brenchr


March 16, 2006
Music
brenchr - 1 -- [6:48]
brenchr - 2 -- [38:21]


March 15, 2006
Music
mandolinditty


March 11, 2006
Music
freeform jam with bidercraig


March 8, 2006
wheeeeeeeeeeeeeeeee

So I managed to hack SMP support into reaper today. Turns out the initial getting-of-it-working was easier than I once feared, since I had a nice track buffering system already built for the send system. Now the tedious part, making everything work as expected, I just know there are going to be tons of very small things off that will make everybody very unhappy at some point or another. I could go off on a rant on how you give people millions of bits, and if only one bit is wrong...

I've been busy as of late, moving my office/workshop to a new place here in SF, but as it settles down I think I'll be getting back into the groove more (though in all honesty I do seem to end up programming way more than is probably good for me).

At this point I'm still excited about reaper, though I am also getting a touch burnt out. We're coming up on 4 months of work! Let's see, aside from fixing tons of crap, the real things left for 1.0 are midi editing and event pitch/stretch. mmmm. How long will it take? Another 3 months? MIDI editing is a problem I've only gotten far enough in thinking about to fear it, since a good MIDI editor is going to be a very extensive bit of design...

Before I go, here's an mp3 that I just rendered, that was me piling on as many effects as possible, to test how great SMP is. What was particularly enjoyable is that I went to render it to disk (which is still single-threaded), and it went at 0.7x realtime. Yay, this makes me REALLY love my Athlon64x2.

Recordings:

freeform jam with brenchr

10 Comments


March 2, 2006
Music
freeform jam with brenchr


February 28, 2006
moving mike

I don't know what I did to deserve it, but somehow I ended up having an awesome group of friends. Thanks guys for everything. And by everything, I mean the handjobs.

7 Comments


[ present ... 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 ... past ]
search : rss : recent comments : Copyright © 2024 Justin Frankel