# Play entire file when pressed a note

**URL:** <https://forum.cabbageaudio.com/t/play-entire-file-when-pressed-a-note/3000>\
**Category:** Csound Noobs\
**Created:** [21 December 2021 00:52 UTC](https://forum.cabbageaudio.com/t/play-entire-file-when-pressed-a-note/3000 "2021-12-21T00:52:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lucas\_Minatelli](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/lucas_minatelli/32/3811_2.png) [@Lucas\_Minatelli](https://forum.cabbageaudio.com/u/Lucas_Minatelli)\
**Post date:** [21 December 2021 00:52 UTC](https://forum.cabbageaudio.com/t/play-entire-file-when-pressed-a-note/3000/1 "2021-12-21T00:52:50Z")

</div>

Hello!  
I’ve been trying to play a .wav file when pressed a synth note but it’s not good enough.  
The file plays while I press the key down, but stops when leaves the key.  
What I would like to do is play the entire file “on click” the key, even then click out.

I’m using diskin2… Is this right?

Thks =]

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [21 December 2021 07:23 UTC](https://forum.cabbageaudio.com/t/play-entire-file-when-pressed-a-note/3000/2 "2021-12-21T07:23:19Z")

</div>

`diskin2` sounds right. What you can do is extend the release section of the note for the entire duration of the sound file:

```
instr 1
    iLen = filelen("soundfile.wav")
    xtratim iLen
    a1, a2 diskin2 "soundfile.wav"
    outs a1, a2
endin

```

If that doesn’t work, you can simple create a dummy `madsr`, and set `iLen` as the release time.

---

<div class="post-metadata">

**Author:** ![Lucas\_Minatelli](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/lucas_minatelli/32/3811_2.png) [@Lucas\_Minatelli](https://forum.cabbageaudio.com/u/Lucas_Minatelli)\
**Post date:** [21 December 2021 11:18 UTC](https://forum.cabbageaudio.com/t/play-entire-file-when-pressed-a-note/3000/3 "2021-12-21T11:18:10Z")

</div>

@rorywalsh thanks a lot !!! works
