Hi to all, i've made a patch that read a file in loop and with ctlin can change the playback speed. at this point all ok. But now i like to add a function that when i press a midi note ,the playback speed return smoothly to its original speed using [line] feeded by [pack originalspeed 5000]
It works but ,on the first press ,just start from 0 and go smoothly to originalspeed, on the second press the [line] remember it's previous position and jump to originalspeed.
in my head i'd like to start from the current playback speed value and return to originalspeed in 5 secs everytime i press the midi note.
Some suggestion?I'm here scratching my head on this but the only idea i've tried is to feed line with actual value but it doesn't work
-
problem with [line]
-
@perdidohate try this:
Here's the logic behind it:
[line] usually takes a message with two elements (as you know):
- value to be reached
- time is ms to reach it
however, [line] can also take a single number, which has the effect of making [line] jump to a value instantly. By default, [line] starts its ramp at 0, but if you send it a single number, you can initialize line to start at a different number if you choose to give it a two-element message later.
This is what is going inside the message box under the [pack f f]. First you send [line] a single number, which in this case happens to be $2, which means the second float coming in from pack, which is the current speed. Then there is a comma meaning "send this message next" in which you give [line] the message "$1 5000" which means "go to $1 (aka, the first float in pack) in 5000 ms".
Please let me know if there is anything I can explain better!
-
thanks rjp9, i don't know that i can send a double message in [line].
knowing that i've solved it in that way
In the right is the solution adopted using your suggestions and it works like a charm!
Thank you again!