The bedazzler porting spree

After watching lady Ada’s information about the bedazzler I went on a porting spree. But first a little something about “the bedazzler” in case you don’t care to read up on the link. The US Dept. of Homeland Security has spent 1 million dollars on creating a “sea-sick flashlight” that they intend to use as a riot control device. It’s non-lethal and it’s better for the environment then teargas.

Lady Ada’s device is an open source clone of the Dazzler dubbed “the Bedazzler” funny I though, but spending 250 dollars getting your friends and family sick was not really going to happen. But then one night I had the idea to port the bedazzler to an Android device. That was pretty easy since processing.org released a test-beta that could make Android applications, otherwise I’d spend that evening installing Eclipse and swearing. Anyways I made it, and a video of it is is here:

Anyways, It worked in the Android emulator, got me sick so I had to go to bed 🙂 funny, but It does not work on the device, to low frame rate I think. Here’s the source if you are wanting to test it. Please note that you’re probably going to get sick. Here’s a direct link to the applet. Don’t send your friends here!

Then I thought, I want a mobile version, and I do have a blinkM that I have not used for anything yet. the blinkM is a RGB led with a microprocessor. First of I did what every sane person would do. I hooked up the blinkM to an Arduino and ported the code once more to suit the current platform. Here’s the source for that. Somewhat efficient. Here’s a video of it:

I also wanted to create a standalone version, since you can upload code to the blinkM and run it without an Arduino. There I ran into some trouble. The time slots on the blinkM is a divided by 33 milliseconds, so the lowest I can go is 33ms between blinks, and then 66 and then 99. I made the port anyways (that was so simple I didn’t even save the source), but It has no effect on me at all, here’s a video:

Now I’m going to see if I can make a device that does the opposite.

Crush it!, a review

Crush it! is a book written by Gary Vaynerchuk, it’s all about how you should change your life and get rich with the use of social media. you know, like writing a blog, being on Facebook/twitter/myspace etc etc (having fanpages and the such). Some of the thing’s he say are direct opposite of 4 hour workweek (witch i reviewed before). Gary thinks that if you only do a lot of what your passion is, you’ll eventually get rich. Building content is king in his book. It’s a fairly quick read, the book, and it’s full of very macho language “DO IT, DO IT NOW” . I found that rather amusing. Anyways, It got me started making the i_am_larsulrich twitterbot so that was a good thing. The second good thing about it was me getting to know about services that takes your video and uploads them to every videosite there is. Hooray!

It’s an entertaining read, but it does not make you think on how you are living your life, no introspection for me there!

http://crushitbook.com/

Dronesizer pt 2

So I’m like working on my dronesizer, and I’m like not getting so far ahead as I like to, but like, I wanna show it anyways. So I’ve made a little movie:

Basically it is a resistor ladder digital to analog converter, check out the R2R DAC if you want to build one. I added LED’s as well. I’ve also added 6 potentiometers. Just do this 6 times 🙂

It’s as easy as that. Now I need to add more sound options and tighten the void loop() function because it’s dead slow right now.

//audio out variables
float TEMP= 0.0;

#define SINC_LENGTH 32 

float sinC[3][SINC_LENGTH] = {
  {//sinus
    0.59754515,0.69134176,0.7777851,0.8535534,0.9157348,0.96193975,0.9903926,1.0,0.9903927,0.9619398,0.9157348,0.8535534,0.77778506,0.69134164,0.597545,0.49999985,0.40245464,0.30865806,0.22221464,0.14644638,0.08426499,0.03806007,0.009607285,0.0,0.009607464,0.038060457,0.08426553,0.14644706,0.22221544,0.30865896,0.4024556,0.5000008,  }
  ,
  {//saw
    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  }
  ,
  {//tri
    0.03125,0.0625,0.09375,0.125,0.15625,0.1875,0.21875,0.25,0.28125,0.3125,0.34375,0.375,0.40625,0.4375,0.46875,0.5,0.53125,0.5625,0.59375,0.625,0.65625,0.6875,0.71875,0.75,0.78125,0.8125,0.84375,0.875,0.90625,0.9375,0.96875,1.0,  }
};

int incomingByte = 0;	// for incoming serial datar

int pin0val =0;

enum waveFormType {
  SIN, SQUARE,TRI,  };

/*
float vol1=1.0;
 float vol2=1.0;
 float vol3=1.0;
 float vol4=1.0;*/

float globalHz1 =0.001;
float oscCount1=0;

float globalHz2 =0.001;
float oscCount2=0;

float globalHz3 =0.001;
float oscCount3=0;

float LFOHz =0.001;
float lfoCount=0;

int type=0;

void setup()
{

  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
  Serial.begin(9600);

  randomSeed(analogRead(0));

  //Timer2 setup  This is the audio rate timer, fires an interrupt at 15625 Hz sampling rate
  TIMSK2 = 1<<<SINC_LENGTH)
    oscCount1=0;
  oscCount2+=globalHz2;
  if(oscCount2>SINC_LENGTH)
    oscCount2=0;
  oscCount3+=globalHz3;
  if(oscCount3>SINC_LENGTH)
    oscCount3=0;
  lfoCount+=LFOHz;
  if(LFOHz>SINC_LENGTH)
    LFOHz=0;

}

void calculateHz(float in,float detune1, float detune2)
{

  globalHz1 = ((440 * pow(2.0,(in-69.0)/12.0))/1562.50);
  globalHz2 = (440 * pow(2.0,(detune1-69.0)/12.0))/1562.50;
  globalHz3 = (440 * pow(2.0,(detune2-69.0)/12.0))/1562.50;

  /*
  Serial.print("  ");
   Serial.print(globalHz1*100000, DEC);
   Serial.print("  ");
   Serial.print(globalHz2*100000, DEC);
   Serial.print("  ");
   Serial.print(globalHz3*100000, DEC);
   */
}

void loop()
{

  LFOHz = (analogRead(3)/(SINC_LENGTH*10.0));
  type=analogRead(5)/51;// 20 modes
  float note = ((analogRead(0)/1024.0)*100.0);
  calculateHz(note,note-(((analogRead(1)/1024.0)*2.0)-1.0),note-(((analogRead(2)/1024.0)*2.0)-1.0));

  /*
  Serial.println("vol ");

   Serial.print(vol,DEC);

   Serial.println(" LFOHz");
   Serial.print(LFOHz,DEC);

   Serial.print("analog 1: ");
   Serial.print( analogRead(1),DEC);

   Serial.print("___ analog 2: ");
   Serial.print( analogRead(2),DEC);

   Serial.print(" type ");
   Serial.print(type);

   Serial.print(" Note ");
   Serial.print((int)(note) );
   Serial.println(" ");

   */
}

4 hour workweek, a review

Timothy Ferriss is a guy that knows what he wants and he doesn’t mind telling the rest of us how he got it. He does this in his book “The 4-hour workweek”. I read it, I liked the ideas about not being stuck in the hamster wheel, still I find some of the approaches he takes are a bit to much about one-self and not for the greater good of the world. Don’t get me wrong, I’m not a great person that has empathy for everyone. But I do not like the “low-salary countries outsourcing” Timothy is so keen on. Sure I could start a company try to optimize it to spend as little time on it as possible, but moving to a country where it’s cheaper, just so that I can get more luxury isn’t my dream. Whilst the book caters to the needs and wants of many persons I’m disqualified because I don’t really feel like re-locating or traveling that much and I dont approve of the master suppression techniques that is part of his gospel.

Still I’d recommend the read, the book makes you think and forces you to evaluate your standpoint in life. I had to, and I grew a bit as a person.

Hex arduino shield

Yesterday I was chatting on the internets with two gentlemen (I think) herr_prof and k9d-925. Our intention was caught about and Arduino synth with Stylophone input method. That and a hex input methods like this and the Thummer these pages and all those Arduino synth’s that is coming out now made us fuse together an idea of making a hex input device for the Arduino. perhaps as a shield. Yes a shield. As I see it there are three solutions.

1. make a shield with touch plate and a pen. old school Stylophone style. Pro’s Easy to make, easy to build and dead cheap. Cold use many pins. Introvert playing. Only one not at the time.

2. Same as above but with buttons. Removes the con’s of one note at the time, and you could be more expressive. But it’s more expensive.

3. A touch-screen. like on the Nintendo DS or. It’s 9 dollars but you only need 4 lines to it. Or a touch pad from a laptop. Pro’s less pins from the Arduino, still easy to make use. The touch pad is transparent so you could put different layouts behind it. It’s also customizable that way, and you probably cold use all the different synths easier for the Arduino since it’s already uses so few pins (like the critter and guitari piano shield) still, it’s pretty introvert.

So, what to do, a shield with stylophone style? another button-controller, dont think so, that there are a plenty already, just need to place the buttons at new locations.  Perhaps a Nintendo DS touchscreen will come my way. Or a touchpad from some old computer. But I kinda like the see-through and make  your own layout thing 🙂

Voice-drone experiment

So, I was thinking, wouldn’t it be “cool” to create a drone-track with nothing but human voices?  The problem is that I cant hold a tone for very long, and that my singing-voice isn’t all that clean. I however did not hesitate a single second to try making a drone-sing-thing. Imagine how cool it could be if it where done for real!?!