Cabbage Logo
Back to Cabbage Site

Play entire file when pressed a note

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 =]

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.

1 Like

@rorywalsh thanks a lot !!! works

1 Like