Category Archives: Programming

Building software.

WbSrch Online Again

A while back I open-sourced the code for the WbSrch search engine.

It’s online now in a much-reduced form at wbsrch.com.

It’s not the full search engine. Far from it. It’s just a tiny database of about 10,000 or so URLs to demo the source code, but it’s possible you’ll actually find what you’re looking for in even that tiny amount of data if your search is sufficiently simple.

It probably won’t get any bigger — that’s about the size I can support “for free”, in that it doesn’t take enough resources on my inexpensive VPS to impact more important things. If you’re curious what the original WbSrch search engine was like, it’s a pretty good demo, at least visually.

DrumPads Now Open Source

Of all the audio apps I wrote for Zeta Centauri, DrumPads was by far the most popular, with more than 300,000 lifetime downloads.

It’s a pretty simple app. It’s a set of 12 virtual drum pads, each of which plays a sample when you tap or click it, or hit the corresponding keyboard key. It also had MIDI support and included a bunch of samples from freewavesamples.com. It let you use arrow icons scroll through to samples to change the kit, which could be a fairly long process. It was notable for me in that it was the first app I had ever written as a with a touch-only interface.

It started as an app for webOS tablets back in 2011. Soon after, webOS was discontinued, abandoned, and set aflame by Leo Apotheker, one of the most incompetent CEOs in modern history. I ported it to Linux and it was in the Ubuntu app store. Then I ported it to Windows and posted it online. And I almost got it ported to OSX. It built, but it never came together well enough to make it past the App Store goons. There was a pretty capable free version and a paid version. The free version was very popular, but the paid version only sold a few dozen copies.

Now that Zeta Centauri is no longer a business, there’s no reason not to release the full version for free.

The source code to DrumPads is now available on GitHub, along with a full version Windows download. Enjoy. 🙂

 

MusicSrch Reboot

Early in 2016 I bought the source code for a music search site from a fella in Slovenia and put it under the umbrella of the WbSrch search engine.

When WbSrch shut down later in 2016, it was left in limbo. It was still running through 2017, but ignored. And sometimes the service crashed and wouldn’t be started back up for a while. Like, sometimes even months.

When I started curating for RCRDList, it became something that I wanted to use again. But it was pretty broken, and I never really got around to learning Ruby. So I spent a long weekend and a few evenings rewriting it in Python and JavaScript.

It doesn’t search all of the same services that it used to, but it searches more of them now, especially more of the mainstream services. There are a few more things I’d like to add, but it already does more than the original version did. I also don’t have to worry about the service crashing because it’s a Python app, and I know how to keep those running consistently.

Try it out at:

https://musicsrch.com

 

SampliTron Now Open Source

SampliTron is one of the most popular Windows apps I’ve written. Although it’s fairly simple, it’s pretty powerful. It’s a virtual sampler that lets you load a .wav file and scale it across the entire keyboard, with that keyboard playable via either the computer keyboard or an external MIDI controller.

Before today it was a commercial app with a demo version, and the full version was $15. Over its lifetime it’s been downloaded more than 40,000 times and has sold a few dozen copies.

As of now, the full version is free, on the zetacentauri website, and the source code is available under the MIT license on GitHub.

Open Source: Sigmatizm, A Virtual Additive Synthesizer

Back in 2012 I wrote the most complex audio application I had ever written. It’s called Sigmatizm, and is a standalone additive synthesizer.

Additive synthesis works by adding together sine waves of different frequencies (harmonics) to create a more complex sound.

This particular application adds up to 128 sine waves together in real-time, while transitioning from one set of harmonics to another and while modifying the sound with an attack-decay-sustain-release (ADSR) envelope.

It also has full MIDI support and can be played with a MIDI controller, or can be used to play an external MIDI synthesizer. It also supports using any sound card or MIDI device attached to the system.

It started life as a Windows app and was also ported to Linux. Originally it was a commercial app available for $9.99 on both Windows and Linux (via the Ubuntu store). It also works on OSX, but building is a bit more involved and not for the faint of heart.

For the official download page, visit Zeta Centauri.

Or, to get the source code, visit GitHub.

There’s still a lot more that I’d like to do with this application. For example:

  • It’s nice as a standalone, but would be more useful as a VST so it could be used with multitracker software and be piped to effects, like delay, reverb, etc.
  • I’d like to be able to have an infinite number of envelope stages, so things could go quiet-loud-quiet-loud, or other evolving sound scenarios.
  • I’d like to add the ability to add noise or other inharmonic sources, since the app is completely harmonic and aliasing is the only source of inharmonic sound.

One thing that I’ve deliberately done in order to make it easier to create crazy sounds is NOT prevent aliasing, which is what happens when a sound goes past the sample rate (which in this case is 44.1KHz). When that happens, waveforms “wrap around” and start going in the other direction. I’d like to make that sort of thing optional (block or don’t block) because it’s undesirable in some situations and desirable in others.

It only has a handful of included patches, but I’d like to include more. If you download it and create some sounds, please consider contributing them back to the project.

Proxima Controller, a Virtual MIDI Controller

Back in 2008 I created an app called Proxima Controller. It’s a virtual MIDI controller that runs on Windows, OSX, and Linux.

I wanted an easy way to control external MIDI hardware (synthesizers, etc.) from my PC and there wasn’t an app that I liked available.

It started out as a Windows-only app. A few years later I ported it to Linux. And last year I ported it to OSX (but didn’t release it via the app store).

It’s been one of my more popular apps, with more than 70,000 downloads. I’m glad people have found it useful. It certainly made it easier for me to test sounds on my rackmount audio equipment without needing to shuffle full-sized MIDI keyboards around.

When I have time I’d also like to add an X-Y controller pad, something that can be used to transmit the same controller messages as the joystick on the Korg Wavestation and the Yamaha SY22/SY35/TG33.

You can get it here.

Trigram Generator for Windows and Linux

A long time ago I wrote a free Windows app called the “ZC Trigram Generator”. It was a simple app to generate plausible-sounding words based on a set of input words.

It had a steady trickle of downloads for around 8 years or so, about 1500 downloads per year.

Two years ago I open-sourced it and posted it on GitHub.

Today I updated it to be a little easier to use by adding a “load text” button to load a text file.

Trigram Generator Screenshot

It works on Linux and Windows 7 or newer (including Windows 10).

It’s available here on GitHub if you’d like to get it.

Guitar Tuner and Bass Tuner for Windows

Guitar Tuner and Bass Tuner are the first desktop Windows apps that I wrote. I don’t recall how long ago, but it was certainly more than a decade.

They’re super-simple apps that let you sound notes to tune your guitar or bass to. They only support standard tuning and use the default MIDI device for sound output, which usually means the “Windows MIDI Mapper”, a built-in sound synthesizer that’s been part of the OS for ages.

For nearly ten years I had them available for download on zecentauri.com, and they had more than 100k downloads in total. Two years ago I open-sourced them, but didn’t really mention it anywhere.

I updated them both today, adding two notes to Guitar Tuner to support 8-string guitars and making improvements to the installers.

Both the source code and the installers are available on GitHub under the MIT license.

Visit Guitar Tuner on GitHub.

Visit Bass Tuner on GitHub.

Java: Overcoming A Technology Prejudice

For a very long time I’ve been anti-Java. It started when I was a PC technician in the late 1990’s. The Java Runtime was always a nuisance to maintain and the apps were terrible memory hogs with bad user interfaces.

My view of Java didn’t improve as I learned and worked in C++ and then later C#. Java seemed a poor, clunky way of doing things and there was no need for it, given the fitness of the C# ecosystem for many of the same “enterprisey” purposes.

When the Android operating system was released things got weird. Why were they using this slow memory-hog language for a mobile phone’s applications when the hardware has such limited memory and processor power? It made no sense.

Soon after that, Oracle bought Sun and became the owner of Java. Oracle is a terrible company that I want nothing to do with. In addition to their hyper-litigous business practices, they also deploy auto-accept crapware with their Windows runtime installer*, which is unconscionable. Needless to say, this did not improve my opinion of Java.

Years later I built a search engine. There are a lot of useful web crawling tools in the Java ecosystem that I didn’t take advantage of. The Python ecosystem has a lot of wonderful web crawling tools and libraries, but not having access to the whole set of what’s available ended up being a hindrance.

The same goes for data science. I know the Python data analysis tools, but there are a lot of things in Java that I haven’t really had access to (particularly the Hadoop ecosystem), so I’ve missed out on some possibilities.

I get that it’s no longer true that Java is clunky and incapable, but it’s hard to let go of a long-held belief. But it’s not a useful belief, so it’s time to let it go the same way I let go of my prejudice against Apple’s OSX a few years ago (although I do sometimes still refer to it as “broken Linux”).

Now that I’ve been focusing more on DevOps, it has become more important to be able to support a wide variety of programs. Writing software is one thing – you can usually focus on only the language(s) used by your project and not suffer for it. When you’re deploying applications from dozens of teams, you need to be able to support (and troubleshoot) anything and everything.

Everything I’ve heard leads me to believe it will be fairly easy to become competent in Java given my experience in C# and C++. I have a copy of Teach Yourself Java in 24 Hours and some spare time, so I’ll find out soon.

* I hope that one day that the FTC will ban installer bundling. That certainly won’t happen with the current shitministration.

SpaceTheremin, a Virtual Theremin

Back in 2007 I wrote an application called SpaceTheremin. It is a simple app that lets you use your mouse to control a virtual theremin by moving it over a beautiful public domain image from the Hubble Telescope to control pitch and volume.

Over the years I also released versions for Linux, webOS, and OSX (via the Apple Store). It’s been downloaded tens of thousands of times and is a fun noise toy.

It’s available on the Zeta Centauri website if you’d like to check it out.

Open Sourced: RoboBlather, a Text to Speech Application for Windows

Back in 2008 I released the first version of a simple text-to-speech program for Windows called RoboBlather. Over the years it has enjoyed some popularity among a small niche of users due primarily to its uncomplicated interface.

Today I finished open-sourcing it under the MIT license. If you’re interested, it’s available here on GitHub.

You don’t have to be a programmer to enjoy it — there’s an installer that lets you use it right away without needing to worry about the programmer-y aspects.

Old Basternae Blog Posts Imported

I ran a blog for about seven years at basternae.org. It was almost entirely about Basternae MUD and the evolution of the ModernMUD codebase, but also included a lot of general programming-related entries. I’ve imported all of the previous posts from that blog for the sake of preserving history, though many of them will no longer be relevant. Even so, there may be information that is helpful for people who want to make use of the ModernMUD code to build their own multi-user dungeon.

Setting Up a Redash Dashboard

This was originally posted on wbsrch.com. It is reproduced here to preserve history.

The more WbSrch evolves, the more it becomes necessary to keep track of a bunch of metrics.

Until now we’ve been using a mix of simple report pages and raw SQL queries. It has worked well enough, but not having a clean way to track things in a single place is a nuisance.

That’s why I was happy to discover the redash.io open source project. It’s a query tool meant to be used for setting up business intelligence dashboards and it works with a wide range of databases.

No stranger to code, I tried to check out the GitHub source and get it running on my local machine. It didn’t quite work out. They have a bootstrap script, and it had some trouble with my particular system setup (it fell over when it came to configuring local database users).

But they also have EC2 AMI images you can launch to get running in AWS. I fired up an Amazon micro instance on the free tier and had the app running in seconds. It only took some minor configuration to get set up with my SSL certificate, and I was ready to go.

Adding a Database Connection to Redash

Connecting my three PostgreSQL databases was easy and the clean interface made it easy to find the query editor. After running a few queries I had the feel for how things worked well enough to save them. It also lets you set a refresh interval on your queries so you can have data refresh daily, hourly, or whatever. Results are cached so you’re not taxing your database gathering totals every page load.

Redash Query Editor

After you have a few queries, you can start adding them to a dashboard as panels. You just select the query name, the visualization type (you get table by default, but can add graphs and charts in the query builder), and the widget size.

This is a dashboard that I built to keep track of the search traffic and index state for the Somali-language version of WbSrch:

Redash Dashboard Example

I created dashboards for each supported language plus an overall meta-dashboard. It was fairly quick, taking about a day to set up 35 dashboards and about 200 queries.

Luckily the interface is pretty good, because once you have the software set up, that’s where the documentation ends. You can figure out most things with experimentation (trial-and-error), but it would be very helpful to have a few getting started tutorials, or at the least an explanation of how the various visualizations work.

A micro EC2 instance may stumble if you have some large queries (selecting an entire table is a bad idea, don’t do it), or a lot of things refreshing, but it kept up pretty well.

Quora Answer: What did Steve Jobs mean by programming ‘teaches you how to think’?

I originally wrote this as an answer to a question on Quora.

It forces you to figure out how to solve a problem in a way that can be explained to a computer.

By doing this you learn to break down a problem into its components, how to define the problem using constraints (you have to figure out what’s going to go in and what’s going to come out of your code), you have to be precise, and you have to have a full understanding of all of the components of the problem and its solution in order to solve the problem.

This define and disassemble approach to problem solving is something that is very applicable to problems across many domains, especially science, engineering, and mathematics.

Quora Answer: What are some ways that programming was better in the past?

I originally wrote this as an answer to a question on Quora.

In the “bad old days” the actual programming work wasn’t much different, just worse. Monitors were smaller and lower-resolution, chairs more uncomfortable, you had to spend a lot more time waiting for the computer to finish what it was doing, hardware was much more expensive, tools were barely capable, there weren’t pre-existing libraries for much of anything, open source wasn’t a thing, and there weren’t good marketplaces for selling what you created.

There was no internet, no StackOverflow, and no communities to go to for help. You did not have a Meetup group in your town where you could talk to other people working with similar technologies.

The one thing that was better in some ways is that fewer of the “interesting” problems had been solved yet, and many of the solutions and applications that were built were created by a single person with an itch to solve a particular problem.

Though sometimes I wish I could go back to a time where Java did not exist yet, programming really was awful in the old times. The same goes for the web. Sometimes it feels like it would be nice to go back to a time before it was hypercommercialized and mainstream – a time before the popup ad existed and before you couldn’t avoid being inundated with inane celebrity gossip on sites like Twitter and Facebook – but no. It was nearly useless back then.

Quora Answer: Which career is more fun, networking or programming?

I originally wrote this as an answer to a question on Quora.

Full question:

“Say networking is a blanket, for IT, systems administration, and network security. We’ll say programming is basically web app development. Can anyone with experience in either of these fields give some pros and cons about what they do and do not like?

I have basic knowledge in web development and none in networking, but I have recently taken a liking to getting involved with network security, and I think I would like systems administration more than programming so I am curious as to your opinions.”

I’ve done both, and still do both.

I almost always prefer building software, but there are almost no days where it’s easy. The big draw for me is that it’s creative work and is a form of artistic expression, more in the way that literature is than painting. I also find that my level of enjoyment is inversely proportional to the number of people involved in the process.

Both paths rely on having a great deal of knowledge. While you can look up specifics, having enough background to understand the specifics takes a lot of  learning and experience. Once you know the material well, networking and system administration are usually easier and less stressful, requiring a lot of thoroughness, attention to detail, and keeping track of things.

Both rely on having a set of tools that you rely heavily on. In software, it’s your IDE, debugging tools, libraries, frameworks. In systems it’s a set of utilities, commands, scanning tools, or even hardware tools.

What I dislike about what you put in the umbrella of “networking” is that if you’re good at it, it can get to be pretty boring. When systems are running well, you’ve earned your pay, but it’s when things are breaking that it gets most interesting. And stressful. And you get the least recognition for your efforts. Though ages ago I was an MCSE and worked with Microsoft products regularly, I’ve grown into being a Linux bigot and can’t stand working with non-open-source systems. Luckily I’m in a position where I don’t have to, but you may not have a say in what things you end up working with.  Same goes for programming, really.

One place where it gets interesting is when you combine the two, and that’s what I refer to as DevOps. It’s system administration AND programming. This involves working with tools that create and configure servers, deploy things, set up security, and perform all sorts of IT administration tasks, but instead of being done by a team of 20 IT staff, they can be done by one person. Things like Chef, Puppet, Vagrant, Salt Stack, Ansible, Fabric, Capistrano, and Nagios are popular and worth exploring.

It’s a lot harder to find a “sane” work environment in programming. Almost nobody who hasn’t done it appreciates how incredibly difficult it can be. Douglas Crockford said that “computer programs are the most complex things Humans make”. Being able to manage an environment like that where people aren’t just cogs in a machine takes a special kind of person, and unspecial managers abound. Lots of little things can add up to make a chaotic and stressful environment. It’s often more “interesting” in product companies, but those are a small part of programming. Most programming is writing “boring business apps”, like order entry systems, sales report generators, accounting tools, and other business-specific pieces. It’s no less challenging, but often less stressful and more stable than building software products. The challenges are just different, and one’s not better than the other. I’m a product person, you may not be.

Before making a decision, I’d recommend exploring the world of DevOps first. Not only is it a growing trend and career path, it’ll give you a taste of the administration side of things and you may fall in love with it. Or you may like every part except for the programming and go full IT.

Quora Answer: Is it rude to change a co-worker’s badly written code?

I originally wrote this as an answer to a question on Quora.

Full question:

“I joined a company as a new grad and currently working with two mid level and one senior designer. It’s a chip design company. One of my co-worker’s code is very badly written and I am pretty sure there are many other good ways to implement the same thing. Badly written code bugs me a lot and I’m tempted to change/improve it. Will it look bad if I go ahead and change his code? Or should I ask his permission beforehand ? I’m not sure what will be a good move as I’m comparatively new in industry. I don’t wanna look arrogant!”

Yes. It’s also rude to write bad code.

The best way to handle that is a code review. It’s not necessary to have anything formal – just spend a few minutes going over the code together so you can point out what had issues and why.

Just changing the code without communication will cause two problems: The original writer is likely to resent it, and the original writer won’t learn anything and will keep doing things the same way. There’s also a risk that you don’t fully understand the intent or scope of the changes and your “fixes” might break something.

Don’t make it adversarial or approach it in a way that puts the other developer on the defensive. That will make them non-receptive to the conversation, and the goal is to improve the code and the developer both now and in the future.

ModernMUD Source Now on Github

As dumb as the name might be, I decided to go with “ModernMUD”.

The source code is available on Github under the BSD license:

https://github.com/Xangis/ModernMUD

There’s a lot more to be done with documentation, but the XML comments are decent enough to make IntelliSense useful. I’ll probably be posting more about invidiual sections of the source, particularly the clients (all four of them!), in the near future.

If you’d like to chip in, or use the code to build your own MUD, you are more than welcome to do so.