The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
My little MIDI library is small, and yet in many ways its more advanced than other offerings despite starting out simple.
It's fast. It's small. It's easy to code against (easier than a lot of stuff I've seen). It has a whole lot of features.
So what's the catch? I feel like I want to dive into other people's code to see what they have that I don't.
So far from the little I've seen the stuff just looks more complicated than it needs to be - with midi "pipelines" and things like that.
I don't see the point in features like that. I like K.I.S.S., but even without that I don't know what someone could accomplish that they couldn't with my lib about as easily.
So I'm proud of myself, but a little worried. I've wrapped all of the Windows MIDI API except for patch caching, and my file editing and querying API is pretty good, but it's all very simple, and small. It was almost too easy to code that actual protocol end of it.
I feel like I'm missing something big.
The only complicated part was interfacing with the MIDI hardware.
you SHOULD be proud of yourself - and it's ok to look at other people's libraries etc for 'inspiration', but at the end of the day, K.I.S.S., agile and delivery to a client matters, not 'gold-plating'. ok, I think this MIDI collection was just for you, but the principle still holds
(you can bet I'm going to be looking at your work more closely, on one of your interfacing issues you solved - I'm an ole dog (also OCD*) but I can learn new tricks)
i imagine you're talking about my p/invoke witchcraft. it was a necessary evil. I don't really like to get more "clever" than I have to. My p/invokes are usually carefully crafted to avoid having to use GCHandle or Marshal but variable length structures are a killer because the .NET marshaller just doesn't know how to handle it no matter what attributes you mark a struct up with.
Consequently, I have a mess of code that basically streams out a series of structs (each variable length) to a given memory location. I hate it. It's at least mitigated somewhat by the fact that the variable length portion is at the end of the struct, so I use the .NET marshaller to marshal that first fixed length portion rather than doing it myself. That way I can just use GCHandle.AddrOfPinnedObject() and copy that to the desired end location, and then follow that by the variable length portion.
heh - own it/be proud of it - maybe you'll look at it some year(s) hence and be able to do 'better' - more elegant, 'clever' - and there's nothing wrong with being clever now and again - it's like when you solve a gnarly issue with a great LINQ/Lambda combination knowing the sweat it took to learn
and 'clever' - never forget that being cleverer than you look is better than looking cleverer than you are (ripped off from 'Q' on 'Die Another Day')
My experience is that a LOT of code is not complicated, but made complicated by incompetent developers.
Just an example, I'm working on a (Win)Form where you can enter, save, edit and lookup product data.
I didn't make it, but I'm maintaining the application now.
The first red flag is that the form has database logic, the second is that it has over 1000 lines of code, a third is that the form has quite a few fields.
There's binding in place, but there are still methods like EmptyAddressData which does stuff like PostalCodeTextBox.Text = "".
All in all, this form is hard to maintain and changing one thing will probably lead to bugs.
If not here then in another part of the application, because naming is illogical, to the part where a name does not reflect what it does, nor what the customer calls it, and the original programmer can't remember what it does either, also changes are the same thing is named differently in another part of the application.
Is it difficult?
Hell no, I used to write such forms by the dozen before breakfast* using some reusable components so that the form code could be less than 100 lines.
Was it made difficult?
Obviously, this "programmer" should've retired long ago
If anything, his programming style prevents you from doing things rather than doing them, despite his line count!
At this point I'm surprised the application works at all.