put max and min value

This commit is contained in:
Loïc Bersier 2019-05-18 03:27:29 +02:00
parent 043e88b6bb
commit d43a726f4a
2 changed files with 16 additions and 0 deletions

View file

@ -33,6 +33,10 @@ class samCommand extends Command {
i = pitch.length; i = pitch.length;
} }
} }
if (pitch > 200)
pitch = 200;
else if (pitch < 50)
pitch = 50;
} else { } else {
pitch = 100; pitch = 100;
} }
@ -47,6 +51,10 @@ class samCommand extends Command {
i = speed.length; i = speed.length;
} }
} }
if (speed > 450)
speed = 450;
else if (speed < 30)
speed = 30;
} else { } else {
speed = 150; speed = 150;
} }

View file

@ -33,6 +33,10 @@ class samvcCommand extends Command {
i = pitch.length; i = pitch.length;
} }
} }
if (pitch > 200)
pitch = 200;
else if (pitch < 50)
pitch = 50;
} else { } else {
pitch = 100; pitch = 100;
} }
@ -47,6 +51,10 @@ class samvcCommand extends Command {
i = speed.length; i = speed.length;
} }
} }
if (speed > 450)
speed = 450;
else if (speed < 30)
speed = 30;
} else { } else {
speed = 150; speed = 150;
} }