@Zathan

Ah okay, you should make it a string first, so instead of "sprite.X,sprite.y", you should use

str(sprite.x) & "," & str(sprite.y)

or

sprite.x & "," & sprite.y

lunarray wrote:@Mirlas

Maybe I understand it wrong, but is it something like this?

https://dl.dropboxusercontent.com/u/553 ... speed.capx

I think you can not synchronize the frequency of a sound with that value.

I have an example, here I am using a tween with duration of one second, press space, then a sound plays and everything is realistic.

https://dl.dropboxusercontent.com/u/60803633/exampleTweenSyncAudioFreqWithTweenDuration.capx

Okay.

But now, if I put the tween with a duration of 0.5 seconds, the sound is no longer synchronized and the results are erroneous, the sound duration is 1 second and the tween duration is 0.5 seconds.

So could somehow get the playback speed using the tween to synchronize with the sound ?, I do not mean the duration of the tween, I mean the speed with which makes the movement, you could be achieved this somehow ?.

I mean, synchronize frequency of a sound with the speed at which a tween runs.

Velocity of movement, in this case is velocity of the rotation.

**Posts:**489**Reputation:**9,263

B

21
S

9
G

13
@Mirlas

https://dl.dropboxusercontent.com/u/553 ... ation.capx

Before you read my long comment below, maybe you want to see this capx first, if this is roughly what you wanted, then the long comment below might interest you, but if it is not, then just ignore my rambling >.<

The velocity of movement, whether it is angular or positional, is always the 1st derivative of displacement. In this case, we can either take the formula of the used tween's function, then get the derivative of it, multiply it with some value (in here, the duration), then we get the velocity of it.

If you use linear tween, it is so easy to get velocity because the speed at any moment is the same everywhere. The derivative of a linear function is a constant, in this example it proportionally inverse with duration.

- So, in this case, you can set timescale of the audio to 1 for 1 sec. I just use set playback rate in the audio object to correctly change pitch also.

- When the duration is 0.5 then the speed at any given moment of time is always 2. So set timescale to 2 for duration of 0.5 sec.

- When the duration is 0.75, then the speed at any given moment is 1/0.75, 1.33333. So set timescale to 1.3333 for duration of 0.75.

- For other duration, just take 1/x as timescale.

Now the worse part.

For other tween's formula, like elastic ease, it would be hard or even impossible to take derivative, because its function is segmented. And I can't also set the audio timescale to alter the pitch. The speed at an any exact time is different. So, in these case, the previous example of how to calculate speed in every time moment would be useful. So, each tick i get the old position/angle and take the new position and angle, and then divide it by the delta time, it will make it a very roughly approximation of the current speed. If we divide this value with the linear speed of the tween, we can get the right timescale for it.

In this capx I stop and play the audio at every tick and adjust the timescale at every deltatime. In this capx example though, it has a clicking noise, because it is stopping abruptly during a waveform play, the way to eliminate this will be to use very quick crossfading between the microsample.

https://dl.dropboxusercontent.com/u/553 ... ation.capx

Before you read my long comment below, maybe you want to see this capx first, if this is roughly what you wanted, then the long comment below might interest you, but if it is not, then just ignore my rambling >.<

The velocity of movement, whether it is angular or positional, is always the 1st derivative of displacement. In this case, we can either take the formula of the used tween's function, then get the derivative of it, multiply it with some value (in here, the duration), then we get the velocity of it.

If you use linear tween, it is so easy to get velocity because the speed at any moment is the same everywhere. The derivative of a linear function is a constant, in this example it proportionally inverse with duration.

- So, in this case, you can set timescale of the audio to 1 for 1 sec. I just use set playback rate in the audio object to correctly change pitch also.

- When the duration is 0.5 then the speed at any given moment of time is always 2. So set timescale to 2 for duration of 0.5 sec.

- When the duration is 0.75, then the speed at any given moment is 1/0.75, 1.33333. So set timescale to 1.3333 for duration of 0.75.

- For other duration, just take 1/x as timescale.

Now the worse part.

For other tween's formula, like elastic ease, it would be hard or even impossible to take derivative, because its function is segmented. And I can't also set the audio timescale to alter the pitch. The speed at an any exact time is different. So, in these case, the previous example of how to calculate speed in every time moment would be useful. So, each tick i get the old position/angle and take the new position and angle, and then divide it by the delta time, it will make it a very roughly approximation of the current speed. If we divide this value with the linear speed of the tween, we can get the right timescale for it.

In this capx I stop and play the audio at every tick and adjust the timescale at every deltatime. In this capx example though, it has a clicking noise, because it is stopping abruptly during a waveform play, the way to eliminate this will be to use very quick crossfading between the microsample.

**Posts:**180**Reputation:**3,630

B

33
S

6
G

1
@Zathan

I made a quick example for it, hopefully this is what you needed.

https://dl.dropboxusercontent.com/u/553 ... value.capx

I made a quick example for it, hopefully this is what you needed.

https://dl.dropboxusercontent.com/u/553 ... value.capx

**Posts:**180**Reputation:**3,630

B

33
S

6
G

1
@formuzal

Looks like a period was accidently deleted in the link. Just add it before the zip, like so:https://dl.dropboxusercontent.com/u/55358831/lunarray.litetween.v1.5.zip

formuzal wrote:If you need the older v1.5 litetween which is the stable one, this is the place. I added some new feature in 1.7, shouldn't affect much, but just for precaution.

Download Link: LiteTween v.1.5

Could you update link? Unable to download dropbox 404 file not found

Looks like a period was accidently deleted in the link. Just add it before the zip, like so:https://dl.dropboxusercontent.com/u/55358831/lunarray.litetween.v1.5.zip

If your vision so exceeds your ability, then look to something closer.

**Posts:**4,850**Reputation:**48,301

Moderator

B

120
S

28
G

68
zenox98 wrote:@formuzalformuzal wrote:If you need the older v1.5 litetween which is the stable one, this is the place. I added some new feature in 1.7, shouldn't affect much, but just for precaution.

Download Link: LiteTween v.1.5

Could you update link? Unable to download dropbox 404 file not found

Looks like a period was accidently deleted in the link. Just add it before the zip, like so:https://dl.dropboxusercontent.com/u/55358831/lunarray.litetween.v1.5.zip

Thanks!

**Posts:**2**Reputation:**204

Banned User

B

4
the tweens are not affected by construct2's "time scale".

im getting better smoother results when moving things using the simple method of self.x+dt*speed.

i use time scale to simulate weak devices.

i would love some help,

and also thank you for this addon.

i used it a lot, and i love the cool easing options (maybe you can even let us tinker with it).

im getting better smoother results when moving things using the simple method of self.x+dt*speed.

i use time scale to simulate weak devices.

i would love some help,

and also thank you for this addon.

i used it a lot, and i love the cool easing options (maybe you can even let us tinker with it).

**Posts:**5**Reputation:**510

B

10
S

2
## Who is online |

Users browsing this forum: No registered users and 1 guest |