Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add information to printks manual page #660

Open
PvonN opened this issue Nov 12, 2022 · 4 comments
Open

add information to printks manual page #660

PvonN opened this issue Nov 12, 2022 · 4 comments
Assignees

Comments

@PvonN
Copy link
Contributor

PvonN commented Nov 12, 2022

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
Copy link
Member

can you give a simple csd that shows this?

@PvonN
Copy link
Contributor Author

PvonN commented Nov 12, 2022

`


-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
Copy link
Contributor

joachimheintz commented Nov 12, 2022 via email

@tjingboem
Copy link
Member

tjingboem commented Nov 12, 2022

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants