TV noise generator

Post Reply
ciktor
Posts: 6
Joined: Wed Jan 06, 2010 6:45 pm
Location: Belgrade, Serbia

TV noise generator

Post by ciktor »

TV noise generator without sound
noise2.GIF
noise2.GIF (20.94 KiB) Viewed 14458 times

Code: Select all

resize_pixi( 0, 320, 200 )
start_timer( 0 )
w = get_window_xsize
h = get_window_ysize

start:
clear( BLACK )
y = -h/2

rand_seed (get_timer( 0 ))
while( y < h/2 )
{
	x = -w/2
	while( x < w/2 )
	{ 
		rnd = rand 
		if rnd%3 = 0 {dot(x,y,#808080)}
		else
		{
			if rnd%2 = 0 { dot(x,y,BLACK) } else {dot(x,y,WHITE)} 
		}
		x=x+1
	}
	y=y+1
}

frame( 0 )
go start
User avatar
Al_Rado
Posts: 239
Joined: Tue Dec 04, 2007 2:33 pm
Location: Krasnodar
Contact:

Re: TV noise generator

Post by Al_Rado »

Interesting effect!
But you can use a simpler version, such as this:
effector (WHITE, 256, 0, -160, -100, 320, 200, 2)

Description:
effector (color,power,type,x,y,xsize,ysize,xadd) - command for using standard graphics effects. color - color of effect. power - power of effect (from 0 o 256). type: 0 - noise; 1 - horizontal blur; 2 - vertical blur. x,y,xsize,ysize - working region. xadd - distance between a points.
ВекторКодПиксельПолигон - ВотЧтоЯЛюблю!
ciktor
Posts: 6
Joined: Wed Jan 06, 2010 6:45 pm
Location: Belgrade, Serbia

Re: TV noise generator

Post by ciktor »

Hi, thank you for pointing that out.
I tried what you wrote and it works like a charm...
(I didn't read the whole documentation)
This is also a proof that I like to over-complicate things : )
Regards,
Viktor
I see light. I hear sound. I feel touch.
User avatar
Al_Rado
Posts: 239
Joined: Tue Dec 04, 2007 2:33 pm
Location: Krasnodar
Contact:

Re: TV noise generator

Post by Al_Rado »

I think this option is more true test )

Code: Select all

resize_pixi( 0, 320, 200 )
start_timer( 0 )
w = get_window_xsize
h = get_window_ysize

start:
clear( BLACK )
effector (WHITE, 256, 0, -w/2, -h/2, w, h, 1)
frame( 100 )
go start
Good luck in mastering Pixilang!
ВекторКодПиксельПолигон - ВотЧтоЯЛюблю!
ciktor
Posts: 6
Joined: Wed Jan 06, 2010 6:45 pm
Location: Belgrade, Serbia

Re: TV noise generator

Post by ciktor »

Exactly...
I tried it with only one line and got static noise image.
I supposed that I should iterate it like you did to gain the same effect...

Thanks once more!
Vik
I see light. I hear sound. I feel touch.
Post Reply