POV-Ray : Newsgroups : povray.binaries.animations : povray writes its own soundtrack in Csound based on events in SDL. Server Time
1 Nov 2024 05:23:12 EDT (-0400)
  povray writes its own soundtrack in Csound based on events in SDL. (Message 1 to 2 of 2)  
From: Greg M  Johnson
Subject: povray writes its own soundtrack in Csound based on events in SDL.
Date: 15 Feb 2005 23:41:35
Message: <4212ceff@news.povray.org>
// set up 100 frame animation.
// hideous surroudings actually required to get TMPGENc to encode to MPG
//  TMPGENc choked when scene was too boring.




background {rgb 1}
#declare randy=seed(1323);
#declare framespersec=24;

#declare grav1=0.0041251*y;
#declare grav2=0.0041251*y;
#declare grav3=0.0041251*y;

#declare p1=<-1, 1+rand(randy)*1.8,0>;
#declare p2=<0, 1.3+rand(randy)*1,0>;
#declare p3=<1, 1.5+rand(randy)*1.4,0>;

#declare v1=0;
#declare v2=0;
#declare v3=0;

#declare ifyouvewritten=0;

#declare tt=0;
#while(tt<clock*100)

#declare v1=v1+grav1;
#declare v2=v2+grav2;
#declare v3=v3+grav3;

#declare p1=p1-v1;
#declare p2=p2-v2;
#declare p3=p3-v3;

#if(p1.y<0.05)
        #declare time1=tt/framespersec;
        #declare grav1=0;
        #declare v1=0;
        #declare p1=<-1,0.05,0>;
#end

#if(p2.y<0.1)
        #declare time2=tt/framespersec;
        #declare grav2=0;
        #declare v2=0;
        #declare p2=<-0,0.1,0>;
#end

#if(p3.y<0.15)
        #declare time3=tt/framespersec;
        #declare grav3=0;
        #declare v3=0;
        #declare p3=<1,0.15,0>;
#end


#if (tt=99)
        #fopen MyFile2 "c:\Csound\Orc&Sco\povtoot01.sco" write

        #write(MyFile2,"f1   0    4096 10 1      ; sine wave ","\n")

        #write(MyFile2,";ins strt dur  amp(p4)   freq(p5)  attack(p6) 
release(p7)","\n")

        #write(MyFile2,"i3  ",  str(time1,6,4), "    2   ","    10000 
450       0.02           0.99 ","\n")
        #write(MyFile2,"i3  ",  str(time2,6,4), "    2   ","    10000 
300       0.02           0.99 ","\n")
        #write(MyFile2,"i3  ",  str(time3,6,4), "    2   ","    10000 
250       0.02           0.99 ","\n")

        #write(MyFile2,"e")

        #fclose Myfile2
        #declare ifyouvewritten=1;
#end



#declare tt=tt+1;
#end


light_source{<100,10,-50> color rgb 1.2}
light_source{<100,10,-50>  color rgb .2 rotate 100*y}
box {<-500,0,-500>,<500,-0.1,500> pigment {checker rgb 1 rgb 0} 
finish{diffuse 1.3}}

sphere{p1,0.05 pigment{red 1}}
sphere{p2,.10 pigment{green 1}}
sphere{p3,0.15 pigment{blue 1}}


camera{location <0,0.5,-12> look_at 0 angle 20}


Post a reply to this message


Attachments:
Download 'csound03h005sb.mpg' (507 KB)

From: Dennis Miller
Subject: Re: povray writes its own soundtrack in Csound based on events in SDL.
Date: 6 Mar 2005 17:53:24
Message: <422b89e4$1@news.povray.org>
Hey Greg. I'm a big Csound user - can't get your MPG to play. What codec are
you using?
And what sort of sco did you use?
Thanks much.
D.

"Greg M. Johnson" <gregj;-)565### [at] aolcom> wrote in message
news:4212ceff@news.povray.org...
> // set up 100 frame animation.
> // hideous surroudings actually required to get TMPGENc to encode to MPG
> //  TMPGENc choked when scene was too boring.
>
>
>
>
> background {rgb 1}
> #declare randy=seed(1323);
> #declare framespersec=24;
>
> #declare grav1=0.0041251*y;
> #declare grav2=0.0041251*y;
> #declare grav3=0.0041251*y;
>
> #declare p1=<-1, 1+rand(randy)*1.8,0>;
> #declare p2=<0, 1.3+rand(randy)*1,0>;
> #declare p3=<1, 1.5+rand(randy)*1.4,0>;
>
> #declare v1=0;
> #declare v2=0;
> #declare v3=0;
>
> #declare ifyouvewritten=0;
>
> #declare tt=0;
> #while(tt<clock*100)
>
> #declare v1=v1+grav1;
> #declare v2=v2+grav2;
> #declare v3=v3+grav3;
>
> #declare p1=p1-v1;
> #declare p2=p2-v2;
> #declare p3=p3-v3;
>
> #if(p1.y<0.05)
>         #declare time1=tt/framespersec;
>         #declare grav1=0;
>         #declare v1=0;
>         #declare p1=<-1,0.05,0>;
> #end
>
> #if(p2.y<0.1)
>         #declare time2=tt/framespersec;
>         #declare grav2=0;
>         #declare v2=0;
>         #declare p2=<-0,0.1,0>;
> #end
>
> #if(p3.y<0.15)
>         #declare time3=tt/framespersec;
>         #declare grav3=0;
>         #declare v3=0;
>         #declare p3=<1,0.15,0>;
> #end
>
>
> #if (tt=99)
>         #fopen MyFile2 "c:\Csound\Orc&Sco\povtoot01.sco" write
>
>         #write(MyFile2,"f1   0    4096 10 1      ; sine wave ","\n")
>
>         #write(MyFile2,";ins strt dur  amp(p4)   freq(p5)  attack(p6)
> release(p7)","\n")
>
>         #write(MyFile2,"i3  ",  str(time1,6,4), "    2   ","    10000
> 450       0.02           0.99 ","\n")
>         #write(MyFile2,"i3  ",  str(time2,6,4), "    2   ","    10000
> 300       0.02           0.99 ","\n")
>         #write(MyFile2,"i3  ",  str(time3,6,4), "    2   ","    10000
> 250       0.02           0.99 ","\n")
>
>         #write(MyFile2,"e")
>
>         #fclose Myfile2
>         #declare ifyouvewritten=1;
> #end
>
>
>
> #declare tt=tt+1;
> #end
>
>
> light_source{<100,10,-50> color rgb 1.2}
> light_source{<100,10,-50>  color rgb .2 rotate 100*y}
> box {<-500,0,-500>,<500,-0.1,500> pigment {checker rgb 1 rgb 0}
> finish{diffuse 1.3}}
>
> sphere{p1,0.05 pigment{red 1}}
> sphere{p2,.10 pigment{green 1}}
> sphere{p3,0.15 pigment{blue 1}}
>
>
> camera{location <0,0.5,-12> look_at 0 angle 20}
>
>
>
>
>
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.