|
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)
*OCD = Old, Cranky, Dangerous
|
|
|
|
|
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.
It's ugly, but I got it efficient and robust.
Real programmers use butterflies
|
|
|
|
|
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.
* Slight exaggeration.
|
|
|
|
|
You're reminding me of how much I hated bizdev.
Real programmers use butterflies
|
|
|
|
|
Size does not matter...
I'm in love with single responsibility and love small, but effective libraries - I can mix them later if I want to create a code monster...
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
|
|
|
|
|
API footprint does. That's what I mean by size. It directly correlates with learning curve. Sorry i wasn't more clear.
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: I feel like I want to dive into other people's code to see what they have that I don't.
I would try to find open source midi controllers, etc. on github, like the old Nulsoft Winamp and extensions other devs have written for this and winamp.
Other than a hobby project for your personal satisfaction as a developer, I think you are very much reinventing the wheel here. MIDI libraries have been around for a very, very long time. I can't possible understand where yours is much different than the countless midi controllers, etc. on github and the internet in general.
Not trying to be jerky here, just giving my honest thoughts on this.
|
|
|
|
|
I haven't found one I liked in c#
Real programmers use butterflies
|
|
|
|
|
fair enough.
then why don't you research the mostly C/C++ ones out there, and see if there is something that you can "borrow" from and port over to C#...if you are truly interested in seeing what you missed or could do better that another dev has done. Just a thought....
|
|
|
|
|
I'll consider it. What I've seen of the C# stuff isn't great. Wet Dry Midi is cool, but it's a different animal, as it's mostly for high level composition of MIDI scores.
In terms of C#, I'm biased but mine kills it.
using(var dev = MidiDevice.Inputs[0])
{
dev.Open();
Console.Error.WriteLine("Recording started. Press a key to stop.");
dev.StartRecording();
Console.ReadKey();
MidiFile mf = dev.EndRecording();
mf.WriteTo("recorded.mid");
Console.Error.WriteLine("Performance saved to recorded.mid");
}
I just typed that up now. I've never seen it easier to sequence and save score, and despite all that you can get down to the metal with it.
Real programmers use butterflies
|
|
|
|
|
I read your article. You have obviously put a lot of time and effort into this. so congrats.
I do see you have the github link at the top of your article. Awesome. i hope it evolves into something great for you then. I am sure other devs out there that are into MIDI etc. will benefit.
|
|
|
|
|
Thanks. Mostly I like the bit twiddling of the protocol wire format and file format. Interfacing with the windows MIDI drivers is kinda fun but also hell because they only very thinly wrap the drivers to expose them to the application layer. There's no real abstraction from the driver code, is what I'm saying, and the interfaces are C based and haven't been updated since the salad days of Windows 95
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: I feel like I'm missing something big.
I used to think that way, then I realized that most other devs were over-designing, poorly designing, or simply not thinking about the problem and hacking together a solution.
Then I looked back at my own code.
|
|
|
|
|
haha
Real programmers use butterflies
|
|
|
|
|
Ad seen at the top of CP...
What is The Deals Mall? Why does it seem to be shouting at me?
And, most importantly, why is that guy staring at me[^]!?!
|
|
|
|
|
He's trying to read page 17 of "Practical Electronics For Makers", not staring at you.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
You'll never know until you click him.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
ZurdoDev wrote: You'll never know until you click him.
I will never know.
|
|
|
|
|
raddevus wrote: Ad seen at the top of CP...
One word (two?): Pi-Hole.
Bliss.
That's how you do "clean" pages--not by adding extra whitespace everywhere.
Just don't tell Chris.
|
|
|
|
|
I run uBlock, which works just fine - it even tells you how many ads it blocked on a page, so you can decide "greedy b*st*rds" or not. Decent sites get whitelisted. High ad count don't - and probably don't get visited again since they normally care more about ads than content...
CP is whitelisted.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: I run uBlock, which works just fine
The tiny Linux VM I have running Pi-Hole is set as the gateway for the machines on my network and it, in turn, then talks to my router. So, every machine on my LAN, including tablets, phones, my Xbox, etc all benefit from it.
|
|
|
|
|
The sound of a hard drive having issues. chkdsk says there's no errors found, but I know the drive is at least 10 years old. Time to migrate to an SSD.
Can anyone recommend a drive migration tool? This is a laptop, so it will have to be done via USB, since there's no additional drive port onboard.
Keep Calm and Carry On
|
|
|
|
|