Since people are redoing PCM scripts...
Posted: Thu Dec 04, 2008 9:04 pm
I have a request.
If you can somehow replicate the constant lap rate .imp file into a flash tease you will be a god among men. What this file does is adjusts its metronome so that eventually you will edge after 15 seconds of stroking. Over and over.
I'm trying to get PCM to work so i can play with it again, but pcm is such a pain in the ass.
There is also the Lap squeeze files found at http://groups.yahoo.com/group/pcm3dev/files/ that I believe utilize this engine in a pretty awesome tease. I've had even less success getting that working in the past.
So thats my request. I'm gonna go back to trying to get PCM to work.
p.s. heres the .imp file
script constant_lap_rate;
/*
* This produces a standard slideshow from a directory of images,
* with a metronome accompaniment and a 'Lap' button.
*
* The trick is that the script adjusts the 'lap break' and the
* metronome rate as to try to keep a constant lap every 15 seconds.
*/
int lapButton;
float ssDelay = 10.0;
int lapCount = 0;
string path = "c:\\pics\\";
int minLap = 5;
int maxLap = 15;
float minRate = 30.0;
float maxRate = 240.0;
void main() is
lapButton = createButton("Lap");
// Warmup
metroStart();
slideshow(60.0,10.0,1:00);
slideshow(90.0,10.0,1:00);
slideshow(120.0,10.0,1:00);
if lapCount < 3 then slideshow(150.0,10.0,1:00); end;
if lapCount < 3 then slideshow(180.0,10.0,1:00); end;
if lapCount < 3 then slideshow(210.0,10.0,1:00); end;
if lapCount < 3 then slideshow(240.0,10.0,1:00); end;
metroStop();
setText("Now that you're warmed up, lets start.");
setDelay(10);
wait(_TIMER);
metroStart();
int numLaps = randomInt(50,120); // # laps to do
while lapCount < numLaps do
int baseRate = randomInt(40,150);
setText("Let's switch it up a bit ...");
setDelay(5);
wait(_TIMER);
rateGame(baseRate,15,0:15,5:00);
end;
metroStop();
setText("Finished");
end;
void slideshow(float beat, float lapDelay, interval duration) is
int event = _TIMER;
string image;
metroRate(beat);
datetime startTime = now();
while now() < (startTime + duration) do
setDelay(ssDelay);
image = setRandomImage(path);
setText(image);
event = wait(_TIMER+lapButton);
if event == lapButton then
metroStop();
setText("STOP! Hands off.");
lap(lapDelay);
metroStart();
end;
end;
end;
/*
* The rate game
*/
void rateGame(float initialBeat, float lapDelay, interval lapTarget, interval duration) is
int event = _TIMER;
float rate = initialBeat;
showSpeed(rate);
metroRate(rate);
datetime startTime = now();
datetime lapTime = now();
while now() < (startTime + duration) do
setDelay(ssDelay);
setRandomImage(path);
event = wait(_TIMER+lapButton);
if event == lapButton then
metroStop();
datetime thisLap = now();
interval thisTime = now() - lapTime;
/* Adjust the lap delay */
if thisTime > lapTarget then
lapDelay = lapDelay * 0.8;
rate = rate * 1.1;
else
lapDelay = lapDelay * 1.2;
rate = rate * 0.9;
end;
/* Keep the parameters within sensible bounds */
if lapDelay < minLap then lapDelay = minLap; end;
if lapDelay > maxLap then lapDelay = maxLap; end;
if rate < minRate then rate = minRate; end;
if rate > maxRate then rate = maxRate; end;
setText("Last lap time "&thisTime);
lap(lapDelay);
showSpeed(rate);
metroRate(rate);
metroStart();
lapTime = now();
end;
end;
end;
void showSpeed(int rate) is
setText("Wanking at "&rate&" beats per minute");
end;
string setRandomImage(string path) is
string image = randomImage(path);
println(image);
setImage(image);
return image;
end;
void lap(float lapDelay) is
lapCount = lapCount + 1;
setDelay(lapDelay-3);
wait(_TIMER);
setDelay(1);
setText("3..."); wait(_TIMER);
setText("2..."); wait(_TIMER);
setText("1..."); wait(_TIMER);
end;
If you can somehow replicate the constant lap rate .imp file into a flash tease you will be a god among men. What this file does is adjusts its metronome so that eventually you will edge after 15 seconds of stroking. Over and over.
I'm trying to get PCM to work so i can play with it again, but pcm is such a pain in the ass.
There is also the Lap squeeze files found at http://groups.yahoo.com/group/pcm3dev/files/ that I believe utilize this engine in a pretty awesome tease. I've had even less success getting that working in the past.
So thats my request. I'm gonna go back to trying to get PCM to work.
p.s. heres the .imp file
script constant_lap_rate;
/*
* This produces a standard slideshow from a directory of images,
* with a metronome accompaniment and a 'Lap' button.
*
* The trick is that the script adjusts the 'lap break' and the
* metronome rate as to try to keep a constant lap every 15 seconds.
*/
int lapButton;
float ssDelay = 10.0;
int lapCount = 0;
string path = "c:\\pics\\";
int minLap = 5;
int maxLap = 15;
float minRate = 30.0;
float maxRate = 240.0;
void main() is
lapButton = createButton("Lap");
// Warmup
metroStart();
slideshow(60.0,10.0,1:00);
slideshow(90.0,10.0,1:00);
slideshow(120.0,10.0,1:00);
if lapCount < 3 then slideshow(150.0,10.0,1:00); end;
if lapCount < 3 then slideshow(180.0,10.0,1:00); end;
if lapCount < 3 then slideshow(210.0,10.0,1:00); end;
if lapCount < 3 then slideshow(240.0,10.0,1:00); end;
metroStop();
setText("Now that you're warmed up, lets start.");
setDelay(10);
wait(_TIMER);
metroStart();
int numLaps = randomInt(50,120); // # laps to do
while lapCount < numLaps do
int baseRate = randomInt(40,150);
setText("Let's switch it up a bit ...");
setDelay(5);
wait(_TIMER);
rateGame(baseRate,15,0:15,5:00);
end;
metroStop();
setText("Finished");
end;
void slideshow(float beat, float lapDelay, interval duration) is
int event = _TIMER;
string image;
metroRate(beat);
datetime startTime = now();
while now() < (startTime + duration) do
setDelay(ssDelay);
image = setRandomImage(path);
setText(image);
event = wait(_TIMER+lapButton);
if event == lapButton then
metroStop();
setText("STOP! Hands off.");
lap(lapDelay);
metroStart();
end;
end;
end;
/*
* The rate game
*/
void rateGame(float initialBeat, float lapDelay, interval lapTarget, interval duration) is
int event = _TIMER;
float rate = initialBeat;
showSpeed(rate);
metroRate(rate);
datetime startTime = now();
datetime lapTime = now();
while now() < (startTime + duration) do
setDelay(ssDelay);
setRandomImage(path);
event = wait(_TIMER+lapButton);
if event == lapButton then
metroStop();
datetime thisLap = now();
interval thisTime = now() - lapTime;
/* Adjust the lap delay */
if thisTime > lapTarget then
lapDelay = lapDelay * 0.8;
rate = rate * 1.1;
else
lapDelay = lapDelay * 1.2;
rate = rate * 0.9;
end;
/* Keep the parameters within sensible bounds */
if lapDelay < minLap then lapDelay = minLap; end;
if lapDelay > maxLap then lapDelay = maxLap; end;
if rate < minRate then rate = minRate; end;
if rate > maxRate then rate = maxRate; end;
setText("Last lap time "&thisTime);
lap(lapDelay);
showSpeed(rate);
metroRate(rate);
metroStart();
lapTime = now();
end;
end;
end;
void showSpeed(int rate) is
setText("Wanking at "&rate&" beats per minute");
end;
string setRandomImage(string path) is
string image = randomImage(path);
println(image);
setImage(image);
return image;
end;
void lap(float lapDelay) is
lapCount = lapCount + 1;
setDelay(lapDelay-3);
wait(_TIMER);
setDelay(1);
setText("3..."); wait(_TIMER);
setText("2..."); wait(_TIMER);
setText("1..."); wait(_TIMER);
end;