Categories
Projects

Ad Lib Sampler

I have been working on a project for a while (2-3 weeks) and it’s finally ready for public consumption (finally). So I’m in this improv group that I am sure I’ve mentioned before. Anyway, we wanted to incorporate music and sound into our shows, but not everyone knows how to play an instrument and we didn’t want people solely devoted to music. I pontificated on the matter for a while and decided to try to make a sampler-type thing. I wanted to program it myself because any program I could find wouldn’t let me customize it exactly as we needed it. I ended up using a program/language called Pd. It’s a graphical language that is geared specifically for audio. I also had a MIDI controller kicking around so I used that for input. This is what it looks like all labeled and stuff.

Here is the breakdown of what it does:

Pink keys are sound effects. Hit the key and it plays and left the key and it stops it immediately.

Orange keys are background sounds. Hit the key and it plays that sound and when you lift it will fade out. It will also loop the effect if it hits the end of the file.

Green keys are emotional music. If you hit the key it will play a randomly selected song in that emotion. Let go it will fade out. It will also loop the track if it hits the end.

Here is what some of the program looks like and I will release the source when I know I have all the bugs out of it (I don’t know of any that exist, but we will see)

The whole thing was a bear to figure out because I had to learn Pd first and the logic is much different from traditional programming languages which is what I knew. I also ran into problems with sample rates which caused the songs to play at double speed. The fix for that was converting every file to the same type of wave with the same sample rates. Anyway here is a video of it in action and it should be in use this Friday at our show which will be online at our website sometime next week.

Categories
Projects Video Games

Virtual Boy Power Mod

This is one that has been in the hopper for QUITE a while. I am so glad to have it done now. The Virtual Boy is long considered to be Nintendo’s big flop. I don’t know why I love it so much. The games aren’t great (save Wario land), it is only displays red, even playing it is pretty uncomfortable. Despite all it’s flaws I love the li’l guy. Here is where my project comes in. The virtual boy is powered by 6 AAs out-of-the-box. There is an AC adpater you can buy, but it’s rare-ish and expensive. I decided, hey I am a dude who knows things, I’ll just add my own AC adapter. That is what I did.

I found that it needed to give it 9V DC. I went to my local Radio Shack to purchase the jack and plug and got a universal AC adapter that could output 9V.

Inside the Controller

Where I need to solder to. VCC (+) and GND (-)

The jack

Soldered up and testing

It works!

Not a lot of room, but trying to fit it into place

Cutting away some plastic for the jack

All sealed up and looking good

The finished product, Virtual Boy looking proud

Categories
Nonsense Projects School

On Random ISBNs or How Not To Do a Stats Project

books

This semester I am taking a course called Probability and Statistics for Engineers and Scientists which is actually pretty cool. I’ve yet to take a class in stats so this stuff is mostly new to me. It’s a powerful form of Math and probably one of the most relatable and useful in “real life.” This post isn’t about stats as a class though it’s about stats as a project.

We were assigned a project in which we had to come up with a way to find the average date of all the books published in our library. You couldn’t brute force it either by checking every book and recording the copyright date. You had to come up with a method to take a random sample of data (how many to sample was also part of the project) and then using that, do calculations on the data. Here was my plan:

The library has all its books cataloged online.

All books (in the catalog) have ISBNs.

Randomly generate ISBN numbers and have it auto-search, parse, and record book dates.

Viola! Tons of randomly selected years from books.

In theory this is great! It is impartial and once setup can be repeated as many times as needed with minimal effort on my part. Before I get into why it’s the worst plan, let me show you how I accomplished randomly generating ISBNs because it’s not straightforward at all.

Let me preface this by saying I now know way more about ISBNs than I ever wanted to. I will give you the abridged version as not to bore you to tears. (Although the thought of any of my writing bringing you, the audience, to tears is tempting)

Here is a breakdown of a ISBN13 number (13 being the number of digits)

9781999186135 <—Random ISBN

so the first 3 digits

978

This apparently refers to a fictitious place called “Bookland” where all books come from, no joke. It’s called the “country code.” It can also be the industry, in this case book publishing.

The next number, 1, denotes language. English is either 0 or 1.

The numbers that follow are weird because it’s not like 3 numbers are the publisher code, it varies a lot, but suffice it to say the next numbers are publisher and title numbers.

The last digit, 5, is a checksum value. It basically makes sure the number is valid, by performing a checksum calculation.

Without getting into too much detail, they are very strict values and do not just vary from 0-9 for 13 digits and this made my MATLAB script go from 10-15 lines to about 100 lines. I worked for about 3 hours researching and creating the script and it works! The problem, and I feel really stupid for having missed it, is that having that many combinations of numbers, even if they are within guidelines produces a ton of possibilities. This means that almost every value I generated, while being valid within the confines of the standard, did not produce a number that was assigned to a real book.

Using only books in English there is a whopping 199,920,000 different combinations to be made. The chances of me hitting on a real book, especially in a small university library are slim to none. Needless to say, I didn’t end up using this method. Even the best laid plans can go awry. On the plus side I have all this useless information on ISBNs now; come on Cash Cab.

*Edit*

I feel like the dumbest. I did my math wrong and there is actually more combinations than I had previously stated. It’s not 22,952,230 different combinations, it’s 199,920,000 and this has been reflected above. I should really be better at math.