Dramagotchi – The Tamagotchi with an attitude.

For this class assignment, Alon asked us to make a button.

It was an intriguing task because in the description, Alon wrote that the button could be triggered by anything – touch, motion, sound, etc. I think what amazed me is my fixed thought about a button being a tangible thing. Whether physical or digital. But it doesn’t have to be – a button is even me asking Alexa to wake me up the next morning!

Which is what got me thinking – wouldn’t it be great to have my voice triggering the animation?

There’s a project I hope to work on at some point, which is basically a virtual pet for adults (physical) – Dramagotchi, a Tamagotchi with an attitude.

I used one of the evolved versions of the original Tamagotchi for visual appeal and wanted to test what the simplest animation would be like on it.

I also felt that with each assignment I need to set personal goals for myself so while the first one had me playing with after effects at all, the second is me also delving in illustrator to make my own character.

It works like this –

Dramagotchi with eyeball size changing, trying to hypnotize me.

Voice = “Dramagotchi! Are you trying to hypnotize me?”

Dramagotchi starts rolling its eyes.

Voice = “Fine! I’m just going to ignore you then”

Dramagotchi goes back to hypnotizing me.

To break things up, these are the separate gifs :

I totally imagine a voice saying “aaaaiiii duuuunnn knoooo, yoooo telll meee” for the rolling eyes one.

Since I am conducting the documentation again, I needed to take a screen recording of my p5 sketch playing but the editor is down currently – (This bit of the documentation will change as soon as it’s up and running). Because my project uses the p5.speech library and microphone access, I cannot run it locally with all the files downloaded.
However, for now what I can do is this –

var myRec = new p5.SpeechRec();
var imgu;
var drama;
var isDrama = false;


function triggerSpeechRec() {
  setInterval(initiateSpeechRec, 2000);
}

function initiateSpeechRec() {
  // start engine
  try {
    myRec.start();
  } catch (err) {
    // real error handling is for wimps
  }
}

function showResult() {

  var result = myRec.resultString;
  var resultWords = split(result, " ");
	for(var i=0; i<resultWords.length; i++) {
  	if(resultWords[i] == "hypnotize") {
    	console.log("Arey wah! Kya baat hai.");
      isDrama = true;
    } else if(resultWords[i] == "ignore") {
			isDrama = false;
		}
  }
}

// function preload() {
//   img = loadImage('DramagotchiBlinking.gif');
//   drama = createImage("DramagotchiBlinking.gif")
// }

function setup() {
  // create canvas
// createCanvas(720, 400);
//  image(img, 50, 100);
//   drama.position(50, 100);
  //image(drama, 0, 0);



  createCanvas(600,600);
  imgu = loadGif('DramagotchiBlinking.gif');
  drama = loadGif('DramagotchiRolling.gif');
  if (imgu.loaded()) {
    image(imgu, 0, 0);
  }
}


  // write text:

  // init speech recognition
  // this package has its own event loop
  myRec.onResult = showResult;
  myRec.start();
  triggerSpeechRec();


function draw() {
 if (!isDrama) {
 	 image(imgu, 0, 0);
 } else {
   image(drama, 0, 0);
 }
 //  image(drama,0, 0);
}

Leave a Reply

Your email address will not be published. Required fields are marked *