csound / manual

Csound Reference Manual (English)
Other
45 stars 29 forks source link

add information to printks manual page #660

Open PvonN opened 1 year ago

PvonN commented 1 year ago

the behavior of printks in an k-cylce is not described fully in the manual. there should be information about, that printks only print once in an k-loop.

tjingboem commented 1 year ago

can you give a simple csd that shows this?

PvonN commented 1 year ago

`

-d -odac -W -3 sr = 96000 ksmps = 128 nchnls = 2 0dbfs = 1.0 ;----------------------------------------------------------- instr 1 kcount init 0 ktimek timeinstk if ktimek == 100 kgoto loop kgoto noloop loop: printks "k-cycle %d reached!%n", 0, ktimek kcount = kcount + 1 printk2 kcount if kcount < 11 kgoto loop printks "k-END!%n", 0 noloop: endin ;----------------------------------------------------------- i1 0 1

`

joachimheintz commented 1 year ago

or perhaps easier for what it is about here:

instr 1 kIndx = 0 while kIndx < 10 do printks "hello loop\n", 0 printk2 kIndx kIndx += 1 od turnoff endin schedule(1,0,1)

On 12/11/2022 19:22, PhNeum wrote:

`

-d -odac -W -3

sr = 96000 ksmps = 128 nchnls = 2 0dbfs = 1.0

;----------------------------------------------------------- instr 1 kcount init 0 ktimek timeinstk if ktimek == 100 kgoto loop kgoto noloop loop: printks "k-cycle %d reached!%n", 0, ktimek kcount = kcount + 1 printk2 kcount if kcount < 11 kgoto loop printks "k-END!%n", 0 noloop: endin ;-----------------------------------------------------------

i1 0 1 `

— Reply to this email directly, view it on GitHub https://github.com/csound/manual/issues/660#issuecomment-1312544103, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQYHKWMQCDFQL22UPD7ZTLWH7N5TANCNFSM6AAAAAAR6MGBNE. You are receiving this because you are subscribed to this thread.Message ID: @.***>

tjingboem commented 1 year ago

this proves the same thing:

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
; Audio out   Audio in
-odac         ;  -iadc    ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o printks.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 1

instr 1

  kIndx = 0
  while kIndx < 10 do
   printks "hello loop %d\n", 0, kIndx
   printk2 kIndx
   kIndx += 1
  od
  turnoff
endin

</CsInstruments>
<CsScore>
i1 0 1
e
</CsScore>
</CsoundSynthesizer>

The output:

hello loop 0
 i1     0.00000
 i1     1.00000
 i1     2.00000
 i1     3.00000
 i1     4.00000
 i1     5.00000
 i1     6.00000
 i1     7.00000
 i1     8.00000
 i1     9.00000

i do not know why only hello loop 0 is printed and not the rest. Might be something not correct in the code? I will ask the developers...