Csound Csound-dev Csound-tekno Search About

[Csnd] Re: turnoff2

Date2008-02-15 22:17
From" Partev Barr Sarkissian"
Subject[Csnd] Re: turnoff2
I don't see a k-rate in the header. Is this some function where the k-rate need not be specified?
 
- Partev
 
 
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 


--- k_o_m_p@yahoo.de wrote:

From: Luís Antunes Pena <k_o_m_p@yahoo.de>
To: csound@lists.bath.ac.uk
Subject: [Csnd] turnoff2
Date: Fri, 15 Feb 2008 16:39:47 +0100 (CET)

Hello,

I am working on project where a knob (midi and FLTK) starts one instrument and the same knob going in the other direction turns the instrument off.

It all works fine but it seams like the turnoff2 opcode kills the midi connection and nothing works after activating the turnoff2 opcode. After that you can't turn the instrument on again. Is this an expected behaviour of the opcode?

I am attaching the csd-file.

Thanks for any help,

-Luis

<CsoundSynthesizer>
<CsOptions>
-d -odac -M0 -m0
</CsOptions>
<CsInstruments>

  sr        =  44100
  ksmps        =  128
  nchnls    =  2


  gkenv31   init      1

        ; global definitions

#define SSDIR #/Volumes/sndbook/tanz_elek/ssdir#
#define CSND #/Volumes/sndbook/tanz_elek/csd#

#define RESYNTH(CHANNEL) #$SSDIR/resyn_44_$CHANNEL..aiff#

        ; instr 1 GUI for UC-33
#include "uc-33_all.inc"
    ; ---------- GUI ------------

    instr 30                       ; control sound
  ktrigger  init      0
  ksig        init      0

  ichan        =  5
  ictlno    =  10
  ivalue    =  0
        initc7    ichan, ictlno, ivalue

  ksig        =  gk13

  iftlen    filelen   "$RESYNTH(1)"

  ithreshold   =      .5
  imode        =  2
  iwhen        =  0

  ktriggera trigger   ksig, ithreshold, 0
        schedkwhen    ktriggera, -1, 5, 31, iwhen, iftlen
  ktriggerb trigger   ksig, ithreshold, 1
        schedkwhen    ktriggerb, -1, 5, 32, iwhen, .2


    endin


    instr 31                                          ; PLAY RESYNTH
  kamp        =  gk05

  iatt        =  0.02
  kenv        expsegr   0.001, iatt , 1, iatt, 0.001
  itrans    =  1

  a1        diskin2   "$RESYNTH(1)",  itrans
  a2        diskin2   "$RESYNTH(2)",  itrans
  a3        diskin2   "$RESYNTH(3)",  itrans
  a4        diskin2   "$RESYNTH(4)",  itrans
  a5        diskin2   "$RESYNTH(5)",  itrans
  a6        diskin2   "$RESYNTH(6)",  itrans
  a7        diskin2   "$RESYNTH(7)",  itrans
  a8        diskin2   "$RESYNTH(8)",  itrans

  aout1        =  a1 + a3 + a5 + a7
  aout2        =  a2 + a4 + a6 + a8
        outs      aout1*kamp*kenv, aout2*kamp*kenv
    endin

    instr 32
  idec        =  0.1
        turnoff2  31, 0, idec
    endin
</CsInstruments>
<CsScore>
i1  0  6000                ; uc-33
i30 0  6000
</CsScore>
</CsoundSynthesizer>



Ihre erste Baustelle? Wissenswertes für Bastler und Hobby Handwerker.
 

Netscape.  Just the Net You Need.