Reverse Sample will not update on Macro Page

is there a function to see on the Macro Page that a loaded Sample will play “Reverse” if the Playback Mode is set to “Reverse”? In the “Zone Editor” the direction will change, but nothing happened on the Macro Page in the Sample View.
I searched but I only found this nearly 10 years old Topic:

Any ideas to this?

1 Like

I don’t think it’s possible with sample display template. Maybe a feature request?

Yes, maybe otherwise it takes 10 more years…
But now I see in a Video from “Transverse” that it is possible to reverse the Playback Position. The Sample stays in Position and the Position Bar runs from the other side.
But how to do this is far away from my knowledge.

This should work once you connect play position correctly. You may need to check the documentation as I think it’s different for sample and grain zone.

I don’t use the Sample Template. I create a new Waveform and use your Sample OSC Script wich is really great to control the Sample Start/End Position and the Loop Start/End Position. The connection to the Play Position has the right Value. I just create a quick Page to test it again without the script but nothing will change.

You are right.

Maybe you could get around this by calculating the play position (SampleEnd - PlayPosition) if the playback is set to reversed. Here’s an example of what I mean. You can try to adapt it so it works for you.

Play (5.4 KB)

The ui script used:

defineParameter("SampleStart", nil, 0, 0, 0x7fffffff)
defineParameter("SampleEnd", nil, 0, 0, 0x7fffffff)
defineParameter("PlayPosition", nil, 0, 0, 0x7fffffff, function() playPositionChanged() end)
defineParameter("PlayPosition2", nil, 0, 0, 0x7fffffff)
defineParameter("PlaybackMode", nil, 1, {"Normal", "Reversed", "One-shot", "Reversed One-shot"}, function() playPositionChanged() end)

function playPositionChanged()
    if PlaybackMode == 2 or PlaybackMode == 4 then
        PlayPosition2 = SampleEnd - PlayPosition
        PlayPosition2 = PlayPosition

Thank you. In your example it works exacly as it should. But I like to make things more complicatet.
I connect the Sample Start/End from the UI Script to the Sample OSC Script and the others to the Sample OSC and the Playposition 2 to the Waveform as in your example.
But this did not work. I have 2 Faders for Start and End and if I change the positions it will not work. I also connect them o the UI Script. Also the Playposition 2 will not work.
The other thing is, I have more than one Sample Layer in other Layers. So I thought, I can copy the Script and change the name of the defined Parameter.
For example “SampleStart3”, “Sample End3”, “PlayPostion3”, “Playposition4”, “PlaybackMode3” and so on. I also change the names in the function. But then the Playposition disappear complete.
So I thought I can combine the both Scripts and put everything in the Sample OSC Script. But know I have 2 Playpositions and only one Valuefield.
I can rebuild it on a single Program later on to show it.

You can do.

The play position needs to be done in ui script.
If you have more sample displays you may want to create your own template and put the script inside this template.

So, now I rebuilt it.
There are 3 Layers.
Layer One - UI Script and Sample OSC Script. That works with the reverse function, but now there is a Delay in the Loop Mode. The Play Position don’t follow the Loop Markers.

Layer Two - Sample OSC Script. No Reverse visual, but no Delay in the Loop Mode.

Layer Three - I’ve tried to create an own Wave Template within the Script. But I don’t know how to connect the different Parameters. I defined some more Parameters in the Sample OSC Script to connect all from the UI Script in the Template. No Play Position is showing, but I createt a Zoom to the Waveform as I change the Start and End Point. I don’t know why and I don’t need this because I can’T see the Position in the Sample, but it’s nice.
I’m shur I mixed everything in a wrong way.
Also I don’t know how to integreat the Samples during the Export so you have to Load your own Samples. Sorry
Playposition_UI.vstpreset (20.8 KB)

If you try now?
Play Position 2.vstpreset (8.8 KB)
Playposition_UI 2.vstpreset (16.8 KB)

The Play Position 2 Preset works. I have to check it in detail after connecting all Sliders.
In the Playposition_UI 2 Preset there are a lot of things going wrong.
I will check it in detail tomorrow.

I try and error today and now I know how to connect everything and what is going wrong.
The thing is, when the Reverse Mode is choosen and Loop Markers are set, the Markers don’t change to reverse, they stay in Position and reverence to the Position of the Normal Mode.
The other thing is, I don’t understand, why the Sample will Zoom in when the Start and Endpoit is set. It looks nice, but in my opinion not really practicable because it seems that the Markers don’t show the right Playposition.

Playposition_UI 3.vstpreset (16.8 KB)

You don’t have it set correctly. Those need to be set to LoopStart2, LoopEnd2.

The waveform display shows the part of the sample between start and end. And it’s not just zoom. It will only play that portion of sample. But I agree it’s clunky. You don’t need to use them. I wouldn’t.

I trie this in different ways, set it in the Template, in the Waveform, connect it to the Sample OSC, to the Sample OSC Script, I mix them - nothing. Maybe I forgott some setting.

It worked before without the UI Script and I need this function.
I think I trie it from the beginning step by step.

This can get confusing :joy:

The reason for the sample control script is that when connecting Drop or Path Browser controls to Filename parameter directly it didn’t update the sample end. Maybe this has been fixed recently. I don’t know. So the idea is the script checks the sample and sets the Filename parameter, sample start and sample end, loop start and loop end.

Another problem is the sample start and end parameters. If you check them in parameter list, the max value is always the same and doesn’t reflect the sample length. So if you connect them directly to macro page you can set them far beyond the actual sample length. So this is the reason for the script parameters.

The waveform control should display the whole sample if you connect only Filename. Once you connect sample start and sample end it will show only that part of the sample.

Having controls for sample start,sample end, loop start, loop end is a bit clunky. It’s a simple waveform display, not a sample editor. You can’t zoom in to see what you are doing. Not to mention zero crossings or fades. Moving any of those (e.g. sample start) moves just that. So you can end up in situation where sample start is after sample end and loop markers are out of range.

Really confusing.
Earlyer I tried to connect the Samplstart/End direct from the Sample OSC to a Slider but this never worked. So as I found your Script it work the way I like and that the Reverse Function will not work makes me crazy.
Now the Reverse works but other things not. That is really frustrating.

Yes, I know this. So I have to choose which function is more important for me.
Another Question I’ve also thinking about. After Loading a Sample, the whole path is shown in the Browser. Is it possible only to show the Samplename, maybe in another Window or in the Browser?

You’re right. Not so simple if you want sample start, sample end, loop start, loop end to work in reverse.

Once you have path you could extract just the name from it. Maybe create another string parameter.

Name = Filename:match('^.+[\\/](.+)%..+$')

OK. Maybe a bit closer to what you want.
Play Position 3.vstpreset (8.8 KB)

Wow, great, thats exactly what I want. Good Job, you’re the Best! Thank you very much.
After I put in a Pathbrowser there are some mistakes, thats why I connect to the Filename in the Script and not to the Path. But then it works perfect.
Now I integrate it in my Programm and we will see what comes next.
Thanks again!