# Linseg opcode minus sign

**URL:** <https://forum.csound.com/t/linseg-opcode-minus-sign/1482>\
**Category:** Newbies\
**Created:** [December 22, 2023, 12:53pm UTC](https://forum.csound.com/t/linseg-opcode-minus-sign/1482 "2023-12-22T12:53:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NotSure](https://forum.csound.com/user_avatar/forum.csound.com/notsure/32/656_2.png) [@NotSure](https://forum.csound.com/u/NotSure)\
**Post date:** [December 22, 2023, 12:53pm UTC](https://forum.csound.com/t/linseg-opcode-minus-sign/1482/1 "2023-12-22T12:53:21Z")

</div>

Hello,  
I decided to deepen the study of Csound with CsoundQt.  
I just spent three days on the linseg opcode to feed the diskin opcode to read the fox.wav sample.  
I have succeeded 90% in mastering the linseg opcode but I can not control the reading time in reverse of the fox.wav sample with the minus sign.Attached is the diskin\_io3.csd file I created. If anyone knows the trick, I’m all for it.

Thank you

```csound
<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
;-odac ;;;RT audio out
;-iadc ;;;uncomment -iadc if RT audio input is needed too
; For Non-realtime ouput leave only the line below:

 -o io_io3.wav -W ;;; for file output any platform

</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 1
0dbfs = 1

instr 1

ktrans linseg 1, 2.757, 1, 0, 1/2, (2.757*2), 1/2, 0, 2, (2.757/2), 2, 0, 1, 2.757, 1

a1 diskin "fox.wav", ktrans, 0, 1, 0, 32

       outs a1, a1

endin

</CsInstruments>
<CsScore>

i 1 0 12.4065
e

</CsScore>

</CsoundSynthesizer>

```

---

<div class="post-metadata">

**Author:** ![ST\_Music](https://forum.csound.com/user_avatar/forum.csound.com/st_music/32/239_2.png) [@ST\_Music](https://forum.csound.com/u/ST_Music)\
**Post date:** [December 23, 2023, 10:26pm UTC](https://forum.csound.com/t/linseg-opcode-minus-sign/1482/2 "2023-12-23T22:26:29Z")

</div>

```csound
ktrans linseg -1, 2.757, -1, 0, -.5, 2.757*2, -(1/2), 0, -2, 2.757/2, -2, 0, 1, 2.757, 1

```

The last segment will of course play forwards.

Another way you could do this is to use your existing linseg & instead put:

ktrans \* -1

for the pitch parameter of diskin.

HTH,  
Scott

---

<div class="post-metadata">

**Author:** ![NotSure](https://forum.csound.com/user_avatar/forum.csound.com/notsure/32/656_2.png) [@NotSure](https://forum.csound.com/u/NotSure)\
**Post date:** [December 25, 2023, 2:51pm UTC](https://forum.csound.com/t/linseg-opcode-minus-sign/1482/3 "2023-12-25T14:51:47Z")

</div>

Hello and thank you very much Scott,  
thanks to your help, it clicked. In fact, I was trying to read only the last sample backwards.  
` ktrans linseg 1, 2.757, 1, 0, 1/2, (2.757*2), 1/2, 0, 2, (2.757/2), 2, 0, -1, 2.757, -1`  
I’m not good at it,  
but I’m stubborn. So to play the last sample upside down, you have to frame it with 2 negative ix values.  
Subject resolved.  
Thanks again Scott.
