asimmetric waveform

I have a waveform that goes from -0,3 to +0,7 db. I want to keep only the positive values.

For example the upper waveform I want to become like the other down.
I tried dc offset, but it only centers the wave.

Select the track,
Effect menu > Nyquist prompt

Enter this code:

(sum 1 (clip (sum s -1) 1))

Press “OK”

If you also need it to work on stereo tracks (and mono tracks), use this code instead:

(if (arrayp s)(vector
   (sum 1 (clip (sum (aref s 0) -1) 1))
   (sum 1 (clip (sum (aref s 1) -1) 1)))
(sum 1 (clip (sum s -1) 1)))

Thank you a lot. This worked and it can be good.

But it has erased the negative values.
Is it possible to ‘move’ all the waveform up, keeping all the excursion values?

That’s what you asked for “I want to keep only the positive values”

If you know exactly how much you want to move it up it is very easy - you simply “add” the required off-set to the sound.
For example, to move it up by 0.3 use this code:

(sum s 0.3)

To move it by a different amount, change the “0.3” to the value that you require.

Excellent. That solved all.