Tentacle-box, mobile musicstation with beatsynched lights.

kabinett

Since I don’t get enough gigs, or any at all, I though I’d make a sound-system so I could go wherever and play a little show. So I decided to build a sound system that was moderately movable and would work of the grid.

Features:
So a featureset that I though was the least I could work with was this: It should be able to work without being connected to an outlet. It should have lights and it shouldn’t be to heavy to move around. Ateast not by a small wagon. And it should be loud. Not Mötorhead loud but loud enough. It should also be cheap enough so that I would not cry if it got trashed or stolen after a few gigs/parties.

2009-07-11 17.18.41

Materials:
So what do I need to get this together? some sort of battery, and a way to charge it. Luckily there are these car-starters charger thingys that you should use as help of your car battery dies. I bought one of those. Then a car-stereo I found. One that takes memory cards and USB-sticks and has a line in on the front. To control the lights I needed an Arduino, a few LED’s for the lights (I bought 200) and some sort of measuring the beat so that the lights could be synced to the tempo of the songs. I thought I could use a piezo and do the Arduino knock example, but later experimentation showed that I had to settle for a button-based solution.

2009-07-11 12.58.43

The build:
A box takes time to build, and woodworking is not my passion. So I went and gotten a box. It used to house a philips radio, way back when you did not have any TV’s. There was mirrors and everything in that box. but the back was just paper so I had to reinforce it. I mounted the speakers there and also the LED’s. I arranged the LED’s in groups to enhance the amount of light. Half of them are blue and half are white. The LED obscuring part did not work as I thought it should, But the results was OK anyways. As for the tentacle-painting. I don’t know. I like tentacles, not in a Hentai/Manga way, but just the cartoonish style of them.

The Arduino code:
The code is pretty basic. It multiplexes the led’s so that I did not have to add a shift registers. It also reads a button so that I can sync the lights by tapping. the code is pretty self-explanatory.

//tempo variables
byte tempo=120;  /* bmp of our sequence */
long rememberMillis=0;
long timeChange=250; /*a variable for calculating how long we are going to wait*/

//The light's stuff
int ledColWhteAndBlueRing[8] = {
 6,9,3,5,2,4,10,8 }; //these are the blue led's in order. Why no pin7? why not in order? Lazy at the wrong time I guess
int ledColSmall[8] = {
 3,2,9,6,4,8,10,5 };

// tap button
#define tapButton 14
byte tapButtonState;
byte lastTapButtonState = LOW;
long tapOldTime =0;
long lastDebounceTime = 0;  // the last time the output pin was toggled
long debounceDelay = 50;    // the debounce time; increase if the output flickers
boolean justPressed = false;

byte currentLamp=0;
#define lampChange 100
int lampCounter=0;

float ix=0.0;
float ib=0.0;
float is=0.0;

float ixSpeed=1.0/4.0;
float ibSpeed=1.0/4.0;
float iySpeed=1.0/4.0;

int lampFrame[3][8]=
{
 {    1,0,1,0,1,0,1,0      }
 ,
 {    0,1,0,1,0,1,0,1      }
 ,
 {    0,0,0,0,0,0,0,0      }
};

void setup()
{

 pinMode(11, OUTPUT);
 pinMode(12, OUTPUT);
 pinMode(13, OUTPUT);

 digitalWrite(11,HIGH);
 digitalWrite(12,HIGH);
 digitalWrite(13,HIGH); 

 pinMode(tapButton,INPUT);
 /*starting the builtin pullup-resistor!*/
 digitalWrite(tapButton,HIGH);

 for (int i=0; i<8;i++)
 pinMode(ledColWhteAndBlueRing[i], OUTPUT);

 /*calculating the timeChange variable. milliseconds divided by
 tempo and 16th note, or something like that. I dont remember*/
 timeChange=((60000/tempo)/8);

 rememberMillis = millis();

}

void workSmall()
{
 digitalWrite(11,LOW); 

 for (int i=0; i<8;i++)
 if(lampFrame[2][i]==1)
 digitalWrite(ledColSmall[i], HIGH);   // set the LED on
 else
 digitalWrite(ledColSmall[i], LOW);   // set the LED on
 delay(1);

 digitalWrite(11,HIGH); 

}

void workWhite()
{
 digitalWrite(13,LOW); //White

 for (int i=0; i<8;i++)
 if(lampFrame[1][i]==1)
 digitalWrite(ledColWhteAndBlueRing[i], HIGH);   // set the LED on
 else
 digitalWrite(ledColWhteAndBlueRing[i], LOW);   // set the LED on
 delay(1);
 digitalWrite(13,HIGH); //White
}

void workBlue()
{
 digitalWrite(12,LOW); //Blue

 for (int i=0; i<8;i++)
 if(lampFrame[0][i]==1)
 digitalWrite(ledColWhteAndBlueRing[i], HIGH);   // set the LED on
 else
 digitalWrite(ledColWhteAndBlueRing[i], LOW);   // set the LED on
 delay(1);
 digitalWrite(12,HIGH); //Blue
}

void moveLamps1()
{
 for (int i=0; i<8;i++)
 {
 lampFrame[0][i]=0;
 lampFrame[1][i]=0;
 lampFrame[2][i]=0;
 }
 lampFrame[0][int(ix)]=1;
 lampFrame[1][int(ib)]=1;
 lampFrame[2][int(is)]=1;

 ix+=(ixSpeed);
 if (ix>8)
 ix=0;

 ib+=(ibSpeed);
 if (ib>8)
 ib=0;

 is+=(iySpeed);
 if (is>8)
 is=0;
}

void moveLamps2()
{

 for (int i=0; i<8;i++)
 {
 if (int(ix)==1)
 lampFrame[0][i]=0;
 else
 lampFrame[0][i]=1;

 if (int(is)==1)
 lampFrame[1][i]=0;
 else
 lampFrame[1][i]=1;

 if (int(ib)==1)
 lampFrame[2][i]=0;
 else
 lampFrame[2][i]=1;
 }

 ix+=(ixSpeed);
 if (ix>2)
 ix=0;

 is+=(iySpeed);
 if (is>2)
 is=0;

 ib+=(ibSpeed);
 if (ib>2)
 ib=0;
}

void moveLamps3()
{
 for (int i=0; i<8;i++)
 {
 lampFrame[0][i]=0;
 lampFrame[1][i]=0;
 lampFrame[2][i]=0;
 }

 lampFrame[0][int(ix)]=1;
 lampFrame[1][int(ib)]=1;
 lampFrame[2][int(is)]=1;

 ix-=(ixSpeed);
 if ((int)(ix)<0)
 ix=7;

 ib-=(ibSpeed);
 if ((int)(ib)<0)
 ib=7;

 is-=(iySpeed);
 if ((int)(is)<0)
 is=7;
}

void checkButtons()
{
 int reading = digitalRead(tapButton);
 if (reading != lastTapButtonState)
 {
 lastDebounceTime = millis();
 }
 if ((millis() - lastDebounceTime) > debounceDelay)
 {
 tapButtonState = reading;
 if(tapButtonState==true && justPressed==false)
 {
 //this is the most basic tempo calculation I could think of
 justPressed=true;
 timeChange= (millis()-tapOldTime)/8;
 tapOldTime=millis();
 }
 else if (tapButtonState == false)
 {
 justPressed=false;
 }
 }
 lastTapButtonState = reading;
}

void randomizelampSpeed()
{
 ix=(rand()%4)+2;
 is=(rand()%4)+2;
 ib=(rand()%4)+2;
 ixSpeed=1.0/((rand()%6)+2);
 ibSpeed=1.0/((rand()%6)+2);
 iySpeed=1.0/((rand()%6)+2);
}
/*our main baby */

void loop()
{

 workSmall();
 workWhite();
 workBlue();

 if( (millis()-rememberMillis) > (timeChange)) //this is one
 {
 rememberMillis=millis();

 switch(currentLamp)
 {
 case 0:
 moveLamps2();
 break;
 case 1:
 moveLamps1();
 break;
 case 2:
 moveLamps3();
 break;
 default:
 break;
 }
 lampCounter++;
 if (lampCounter >= lampChange)
 {
 currentLamp = rand()%3;
 lampCounter =0;
 randomizelampSpeed();
 }
 }
 checkButtons();
}

Binaural beats and Atari Punk Console followup

Long-time reader of this blog may remember me having an idea of creating a binaural beat generator based on 2 APC. real all about it here http://www.larsby.com/johan/?p=67.

Well so, I made it. I was going to make a few APC’s anyway so I might as well test the idea.  I used http://www.electro-music.com/forum/phpbb-files/thumbs/t_apc555_129.gif so I could try and make a stripboard.

So yeah, the pot’s have a little bit of a glitch in them, kinda ruins the experience, and that is why I had to edit the video so hard.

Listen to it in headphones and tell me you don’t get dizzy.

Here’s a zipped wav-file in case youtube doesn’t do stereo properly. binauralbeatAPC.wav

If you want to make one yourself do 2 of the above APC, connect the pot’s to stereo versions of it. On of the cables between the pot’s add a new 10k pot between. Also if you don’t connect the batteries at the exact same time you will get strange phase’s. Very nice!

Is it broken?

While I was documenting that sticker I’m making for the macbook I’ve ordered I accidentally dropped my camera 10cm. It landed on the lens. The lens got pushed in and looked totally broken. While trying to fix it it suddenly looked like this:

broken

I managed to get it together again, and it’s working. I’m able to take photos with it, but it does not want to retract again.

I dont have any warranty left on it, it’s over 2 years, atleast. Sure I have an insurance but if I excercise that one, I will have to pay more for the insurance later on.

A new camera needs to be bought, I’ll look around, see what I can find. probably it will be the same series. Unless anyone have a tip?

What I’m looking for is:

  • Fast to start.
  • Good quality images
  • Battery that are either interchangable or lasts forever.
  • Takes SD-Cards
  • Works well during poor lightning.

The one I broke was a Fujifilm Finepix F40FD

Another crochet pouch

I’m having some kind of flu, makes my bodily functions work in mysterious ways. Still you would think that since I’m feeling sick all the time I would loose some wight (geekbeach ftw!) but sadly no. I hardly move. To get my mind of off feeling sick I’ve crocheted some more things. Some of them are going to be gifts so I wont show them. This little cellphonepouch I made for my wife I can post a picture of though. I’ve gotten better on keeping it straight, and I’ve even tried to add a little flare on this one. It’s an L if you’re wondering.

2009-10-27 11.28.15

Now I’m gonna make pot-holders for EVERYONE for Christmas.

The Android market-schmarket

This is going to be a rant about stuff that I don’t like with the Android market.  Dont read it if you are a fan boy.

I have a google g1 phone from htc. I have had it now for a year or so. At first it was ok, then the small annoyances became really really annoying. Then the OS was updated to cupcace. That made the usagbility a lot better. Then more annoyances with small things. Like the market.

Why is the market so ugly? even the newest version is ugly.
Why wont I find the same programs on my G1 as my colleague with a HTC Hero when we do the same search. We stood next to each other. Did the search at the same time. In the same country, with the same courier.
Why is the search so god damn lame? I thought Google was a search engine company. Example: If I want to install jjComics. I will not find it if I search for “comic,” but if i search for “comics” I will find it. Thats stupid.
For every Android application you find, there are ten iPhone versions of that program, and 6 of them are better or have functionality that is crucial for the usability of the genre of program.
I live in Sweden, and the market have still not the option of buying software here. Why not? it’s been long enough. And there is no information available on when it’s going open here either.
As for developing for the Android. I made a blog once on my endevours when creating a simple program on both iPhone, J2ME and iPhone.  Developing is ok but not awesome.  But even if I cant buy stuff from the market I thought that I could at least sell stuff. but NO, you have to have a valid US address. Why, doesn’t Google want me to make programs for their phone OS?

And the fanboys? seriously, why are you so apeshit about android? it’s flawed and immature. Instead of repeating the mantra “it’s going to be awesome soon” at any critique try and help making it better.

Geekbeach, what is it and how do I make one?

It’s a competition me and a few friends/colleagues have been working on to loose weight. You see, we are all in the IT business and consequently we are pale, slightly overweight men. We all have previously made halfheartedly attempts at losing weight on our own. Since that did not work we decided to make things more interesting. Alas, getting fitter can be a competition.

So we did just that in 2007; decided on a prize, made the rules, took measurements and started logging and blogging. It went awesome, I won by loosing 10kg :). But since then a few years have passed and the lost weight have been regained so a new GeekBeach was due. This time, the affair quickly grew to a pretty large number of participants. We even had to turn people down. That is why I am writing this guide to what to think of  when having a go at the GeekBeach method yourselves, which you should.

Clear rules: It’s important to have rules that everybody understands and agrees on.
Personal progress = win: During the first GeekBeach the winner was the person with the greatest percentage of weight loss, added to the percentage lost in waist circumference. That means that the one who lost most weight and got to buy new trousers the most won. It also means that you compete against your own body, not to some ideal that everybody wants to reach. Well you understand percentages I hope.  In the 2010 edition, the winner will be the one with the best combination of percent body fat lost and muscle mass gained. At the start we all went to a gym where they have an expensive fat-measuring apparatus. I was a little horrified to know that 26.6% of my body is fat.
A long time span:  If you want the new slender you and your newly acquired good habits to stick, you need to make this event last a few months. I think 4-6 months is the time span you should try to aim for. A semi-goal/measurement or as we call it the “sprint”-price is made 1 or 2 months in to the competition. The winner gets a small price.
Price money:  We decided to put down 500sek each. That is enough to buy a nice suit for the winner.
Price money:  Collect the price money at sign up. The bastards who chickened out/lost at Geekbeach2007 haven’t payed the winner yet.
Proximity: It’s good to meet the people you are in this with on at least a weekly basis.
Blog: This is probably one of the most important parts. You generate a buzz around your GeekBeach competition, and friends and loved ones can follow you. Another important thing is to make it a multi-user blog, with a page per participant. Have a look at the one I’m participating in to get an idea. Don’t worry if you don’t know Swedish, you’ll get the idea.
Preferred weight losing methods
: This is one of the beauties with GeekBeach, there are is no set diet or training regimen. Use whatever rocks your boat.  From GI to daily workouts to Tantric yoga to method x.
Statistics: Be sure to post updates on your progress. This will bring motivation to all invested in the competition.

Geekbeach is like fight club without the fist fights and the charismatic schizophrenic leader.

Crochet

2009 Oct 20 64 2009 Oct 20 155

In Sweden we have “slöjd” in school. That is both woodworks/metalworks and also stuff with textiles. The reasoning is that every one when finished shall be able to do some basic woodwork and sew back a loose button. I was more interested in the usage of powertools and saw’s but we were all forced to do at least a few semesters of textile-work.

I have, I think, learned both to sew,knit,crochet and other things along those lines. but that was 20 years ago. So this Sunday when I wanted to make a pouch for my dingoo I though I should learn to crochet. I’ve already mastered the art of knitting scarfs and cap’s.

So I went and bouth a crochet needle, and started watching instructions on instructables, howto and youtube. This Sunday it went crap. As you can see on this image it did not become so pretty. And it’s the third one I tried. But in all fairness, I was watching TV, riding my exercise bike and crocheting at the same time.

2009 Oct 20 150

Yesterday, after a good nights sleep and a fruitful day of work, I came home and gave it a try again. Behold, I was successful to the extreme. Not only did I not make it look extremely ugly, and uneven. I even managed to make a baseplate and then round-crochet until I had a pouch for my dingoo.

When I was proud over the base-plate, my wife told me I was pretty gay. Mohahahaha. Tonight I’ll make her something.

Music I did ages ago: The Ost

About fourhundred years ago, when I was still living in Lund with a girlfriend instead of a wife. I used a music program called Buzz. I made loads and loads and loads of songs in it. Everything really was in my fingers in that program. It’s a long time abandoned from me though. I thought I should try and make a few songs that fitted together in a way bigger then that you could just hear that they where made by me. That was the birth of “The Ost”. You see, there are many Swedish puns available to that name. And I really cant remember if I made the album just so that I could use those puns excessively or the other way around.

I made a few songs, removed the ones that did not make the cut. I made album art and I did one t-shirt with the logo on. I also sent the CD to ten or fifteen labels. Using the pun excessively in the English companion-letter that I sent with. You see ost in Swedish is cheese. And record and slice is the same word. You are intelligent ppl, you already figured out a lot of those puns by now.

I received exactly zero replies on that CD I sent to the record labels. This where for the most non-Swedish companies. But anyways. I listen to the songs from time to time and I still like them so they are good to me.

here they are:

A - The Ost
E - The Ost
G - The Ost
H - The Ost

A gift for my sister

GRATTIS LOTTA!

AA_ii

One of my kid sisters has her birthday-party today, and I wanted her to have a blast of nostalgia. When we where kids parties used to have at least one of these cactus of candy. So me and the kids made one for her.

Ingredients: A pot, a cucumber, wasabi nuts, toothpicks (wooden), gel-raspberries and poky sticks, plastic foil.

Cut the cucumber and isolate the cut so that id don’t get the nuts wet…… The rest is pretty obvious.

Hope she likes it, and thank you wordpress for letting me make this post in advance and setting a timer on it so that it doesn’t ruin the surprise.


AA_i

Friday night, glitchnoisefight

I’m sitting here, home with the kids sleeping. After riding my exercise bike for a while I decided I should make some sort of song. A little laid back glitch thingy I though. but it became a little more noisy then I though it would. And not very melodic.

I’m off to bed soon, and it’s probably a mistake publishing this song before it have had a little time settle. I mean, a good rule of thumb is not to play a song to anyone until you’ve slept on it.

Tomorrow I’m going to make a present for my kid sister.

Glitchnoise-experimentation1