30. april 2013

Prime Generator Übercharge

About a year ago, I released a prime generator written in C#, which was able to generate 1.000.000 primes in about 45 minutes.

Anyway, myself and a bloke from my class decided to have a programming competition to see who was able to make the most efficient prime generator in a language of our choice.

I initially tried accomplishing this in Java (Don't ever do this - BigInteger is a bitch), which accomplished the task in a mere 15 minutes.

Following this, my competitor decided to turn to C++ to defeat me. And he did. Big time.
His program was able to generate 1.000.000 primes in a mere 20 seconds, defeating me by several miles.

Frustrated by my loss, I also turned to C++, where I made a program, which was able to generate 1.000.000 primes in less than 3 seconds (2.90867, to be exact).

The competition was hereby concluded.

Just for fun, here's a link to the source code of the C++ program:


Mathemusica!


Mathemusica v1.0.2

So, I've begun developing a program which I call Mathemusica. What it does, in a nutshell, is making music out of equations. Yes, you heard me - music from equations.
Using the function value f(x), it assigns a musical note from a chosen scale and well... makes music.
It's taken me roughly a week at current point to develop this.

Here's an image of the GUI to show you what it looks like:



The program is developed in Java and is automatically cross-platform for this reason.
Some time soon I'll release a technical summary of the program, but for now, I'm just releasing it.

If you want a sample of what this program's able to offer, here's a fun function I found while making this:

.mmx: https://dl.dropboxusercontent.com/u/19633784/Mathemusica%20Sample.mmx
.wav: https://dl.dropboxusercontent.com/u/19633784/Mathemusica%20Sample.wav

I also have a YouTube video of the program (although it's synthesized using v1.0.0, it's still valid):




Although I've worked intensely on this for the past week, I haven't made everything myself. Actually I've used two external libraries, namely "exp4j-0.3.01.jar" and "JSyn-beta-16.5.14.jar". Here's a link to the two developer's websites:


And here's a download link, if for any reason you're interested in trying it out:


Download Information
SHA256: 6397bd466a516692b7bd4c579dada4ff430dd751ec3957323722e07a55e69d53
VirusTotal-link: https://www.virustotal.com/en/file/6397bd466a516692b7bd4c579dada4ff430dd751ec3957323722e07a55e69d53/analysis/1367328142/


Download Link

For archive's sake, I've released the previous two versions of the program. They do not support the current .mmx-format, but instead .mm, which is a different file-format, which is deprecated:

I'll keep working on this project for as long as I find it interesting.