We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Ascii Video example modification
Page Index Toggle Pages: 1
Ascii Video example modification (Read 552 times)
Ascii Video example modification
Jun 3rd, 2007, 5:23pm
 
Hello all! Well, I'm new on processing and I'm trying to experiment and learn it while modifying examples. But, I'm now in front of a problem that I can't solve . I'm trying to modify the example "Ascii video" in the "video-library folder". In this example, the code allows to interpret video in ascii text.
SO, I just try to modify this code to use sentences or words rather than letters.

I think the code to modify is this :

static final String vals =
 " .`-_':,;^=+/\"|)\\<>)iv%xclrs{*}I?!][1taeo7zjLu" +
 "nT#JCwfy325Fp6mqSghVd4EgXPGZbYkOA&8U$@KHDBWNMR0Q";

I don't know what is the signification of "static final String vals". I try to modify in "static final text" or "static final words" but it doesn't work...

So I try to modify this part of the code :

 // current characters for each position in the video
 chars = new char[count];

But it doesn't work either...

Perhaps the solution is to use "if()" and set that when a letter is use, the program must use the following one (I don't know if it's very clear...).

Example :

The program writes a "A" so, after the "A", it must writes "B" because we have :

static final String vals =
 "AB";

But I don't know anything about this "if()". I want to write this:

if(static final String vals == A){
static final String vals ++;
}

Or something like this, but I know it's wrong...
So, if someone could help me and show me how to modify this example, it will be fantastic !

Thanks !
Re: Ascii Video example modification
Reply #1 - Jun 4th, 2007, 5:41pm
 
I find something, there il a part of the code which is a problem :

 values = new char[256];
 float multiplier = 256.0 / (float) vals.length();
 for (int i = 0; i < 256; i++) {
   int which = values[i] = vals.charAt((int) (i / multiplier));
 }

I think the parameters of the "charAt()" "randomize" the displaying of letters. But I can't modify it...
Page Index Toggle Pages: 1