A Program I Wrote: Glitch.

( This post originally announced the first DOS commandline version of Glitch. The information has been removed now because it’s very out of date. )

This old commandline version is not available anymore. Please check out the VST version instead.


thats sooper strange man, i really like the verbosity of it, if one took the time to watch every line you could understand exactly what its doing at each loop.
it does seem kinda slow, but i would figure thats because of the amount of stuff its processing.

ive been really interested in programming, and am reading a book on C.
are you using something like FMOD?

i just now found the page for it, ive been looking for something like this for a minute, well mainly tracker source code but this seems adequet for now.
i want to make an ncurses type tracker, cross platform…etc based for live performace, using a console/commandline style input method to be able to quickly input lots of data.

Yeah, after you’ve used it for a while you can definitely “hear” how things will sound before it’s finished, simply by reading the effects that are scrolling up the screen :)

Anyway, no, I’m not using anything like FMOD. I wrote all the code from scratch myself, picking up a few helpful tips from some online documents describing the WAV file structure. All effects and things like that are done manually, byte by byte.

You’ll probably laugh, but Glitch is actually coded in PHP right now, hehe. That’s mainly why it’s so slow. I don’t know that much about C/C++ yet, but I work with PHP all the time when building websites and things like that, so it just made sense to me to start doing it in PHP. It’s a great language for quickly prototyping ideas, I love it. It’s really an extremely versatile language, too, I mean who would think you could make this kinda program in PHP? I just wish they’d finally make a proper PHP to EXE compiler, so that I could create superfast executables from my scripts. There are a few things out there which kinda do that, but none of them are really optimised enough. I am planning to eventually port it to C though (I just need to teach myself first), so it should be a LOT faster when I do that.

Right now I’m using a tool called Priadoblender to package the PHP script into a rough executable format, then I’m using another tool to package the compiled EXE and DLL files into a single, convenient EXE. Pretty damn ghetto, but it works. :D

Now you know my dirty secrets, haha. I wasn’t planning on releasing the program until I’d had the chance to code it properly, but so many of my friends have been nagging me for a copy of it, I just decided to release it as-is. One day I would like to try and create a VST from it. It would be great fun to use it in realtime.


Dude…You opened the floodgates. Congratulations with your program.
Thanks to you, my live set that I’m working on will have some neat twists. These “twists” (ie IDM-like glitches and drills) are things that I love to hear from time to time but never have the patience to learn to program.
I feel that your program will go down in digital music making history. This is my humble opinion, and I will stick to it.

Glad you like it :)

Will your set be recorded and available online anywhere? I would love to check it out.

You bet! I definitely send you the delightful mess I made with your program! Give me a while…but I know i’ll remember to link you up when it’s done,

Is it possible to get an OS X port?

If I eventually learn some C++, sure :P

Unfortunately I really can’t say when that will be. I really just did this for fun, to make some weird sounds to use in my music. It’s hard finding the time to dedicate to learning a new language.

But we’ll see.

If there’s some kind of emulator for Mac which can run simple Win32 apps, you might want to give it a try. It’s not really a very complex program, so it could work.

Well in case C++ might be a too large step…
You can always try XBasic first (open source and available for Win and Linux) and a simple gui-designer to create a front-end. The learning curve is a bit less steep and doesn’t has a lot of complex and complicated things. Also you don’t have to deal with memory pointers etc.

And XBasic is pretty fast because it translates it’s code directly to assembler during compiling.

I do have a pretty good grasp of programming languages in general, at least the theory/structure behind them. I mean, in many ways most languages tend to be quite similar. PHP and C++ especially (at least on the surface) seem to have a lot of structural similarities. I’ve been able to get some very basic programs working in C++, it’s just, as you mentioned, the memory pointers, very strict data typing, etc., which are stumbling points for me. I get to a certain point with something, then I hit a silly brickwall because I simply don’t understand enough about the way a certain thing works. Eventually it will “click” and fall into place, I just haven’t had enough time to dedicate to it yet.

I’ve had experience with Turbo Pascal in the past as well, even a tiny amount of ANSI C, but that was quite a few years ago and the knowledge has long since faded.

I actually stumbled across XBasic quite recently too, though I didn’t check it out yet. I was looking around for a nice suite of tools designed for more graphical based things, something that would let me easily use DirectX for game programming, etc. There is of course the classic Blitz Basic, but it’s getting a bit out of date these days, so I eventually decided on DarkBasic Pro. It’s been pretty fun playing around with it so far, and I’ve made a simple graphic demo with it, but I hadn’t seriously considered porting Glitch to it yet. Even a forgiving language such as PHP has so much more logical structure to it than basic, hehe. It’ll be tough going back to such a, well, basic, way of coding. However… at the end of the day I just want this damn thing to be FAST, heh, so I guess it doesn’t matter how I do it, as long as the end result is some slick machine code :D

Anyway, I haven’t checked out XBasic yet, but I’m gonna download it now and take a look. It certainly looks geared towards creating applications, so it could be very interesting and useful.

I updated the page with a few more examples, including a collection of demos showing how each effect sounds by itself. Just for anyone who’s curious about it but hasn’t had a chance to try it yet.


I highly doubt I’ll post the sourcecode. I don’t mind putting out a version of it that people can use, but the source is private until I decide exactly what I’m gonna be doing with this thing as a project, decide what I wanna do next, etc. It’s possible that I might team up with somebody else to take the program further, but I’m not sure.

As for the compiler, I have no idea. I have DevC++ with mingw32 installed at the moment, just to play around with a few online tutorials and things like that. But as I said earlier, I don’t have much time to dedicate to actually learning C++, so I really can’t make any predictions about the future development of the program.

Well, it’s pretty neat. For sure.

As a VST it would be popular, especially now.

As a PHP app, you could theoretically host this online and let us OS X users process our samples using your server? ;)

That’s actually how I first started developing it - running/testing the scripts on my webserver, it’s just terribly impractical. Uploading/downloading wav files all the time is a total pain in the ass, not to mention the fact that the program itself eats up all the CPU power, causing my websites to become slightly unresponsive, hehe. I don’t want to imagine what it’d be like with several people using it all at once.

So, unfortunately for the moment this basic Windows version is all I can offer.

Wow. Very cool stuff. Wouldnt it be cool cool to have something like this directly build into Renoise? :) hint. hint.


I’m actually looking forward to the day when the .RNS format is public, so I can start making some crazy programs to auto-generate pattern data. Most of the glitch effects could probably be translated into realtime effect commands in Renoise somehow, 09xx, 0Exx, etc… Now THAT would be cool…

Uhh, i think the hint was to send RENOISE the PHP source code.

You know they can port it as a native effect much faster than you can write a VST.

I second that suggestion.


the demo’s sound really cool.

Only one problem:
I’ve downloaded the files. But whem i start glitch.exe the screen appears for a second and dissapears again ???

What is the problem???


Thanks in advance,


haha… I’m a bit slow today. It’s been a looong weekend :)

Taktik, is that what you meant? If it is, and you think that you could use my routines to benefit Renoise somehow, let me know and we’ll talk about it.

I’m not sure exactly how the whole glitch system could be built into a native effect… it’d probably turn out unnecessarily complex. But perhaps at least some of the functions could be used for future effects? I dunno.

Interesting thoughts anyway!

In the readme.txt you will see that it says the program must be ran from within a command shell.

Start > Run > cmd.exe

Then you use it via command line.