Csound Csound-dev Csound-tekno Search About

[Csnd] sprintfk

Date2011-08-17 09:22
FromRene Jopi
Subject[Csnd] sprintfk
Attachmentssprintfk.csd  
Hi list,

What I am doing wrong ?

I was expecting this csd to print :

Value of knb : 1  -> but it prints only this line !
Value of knb : 2
Value of knb : 3
Value of knb : 4
Value of knb : 5
Value of knb : 6


<CsoundSynthesizer>
<CsOptions>
-dm0 -odac -+rtaudio=null -+rtmidi=null
</CsOptions>
<CsInstruments>

instr 1
knb line 1.1, p3, 6.1
String sprintfk "Value of knb : %d \n", knb
ktrig metro 1
puts String, ktrig
endin
</CsInstruments>
<CsScore>
i 1 0 10
</CsScore>
</CsoundSynthesizer>

I am on Ubuntu...
Cheers,
Rene

Date2011-08-17 10:24
FromOeyvind Brandtsegg
SubjectRe: [Csnd] sprintfk
This should do it.
 
instr 1
 knb line  1.1, p3, 6.1
 String sprintfk "Value of knb : %d \n", knb
 ktrig = int(knb)
  puts  String, ktrig
endin
best
Oeyvind
2011/8/17 Rene Jopi <rene.jopi@gmail.com>
Hi list,

What I am doing wrong ?

I was expecting this csd to print :

Value of knb : 1  -> but it prints only this line !
Value of knb : 2
Value of knb : 3
Value of knb : 4
Value of knb : 5
Value of knb : 6


<CsoundSynthesizer>
<CsOptions>
-dm0 -odac -+rtaudio=null -+rtmidi=null
</CsOptions>
<CsInstruments>

instr 1
knb line 1.1, p3, 6.1
String sprintfk "Value of knb : %d \n", knb
ktrig metro 1
puts String, ktrig
endin
</CsInstruments>
<CsScore>
i 1 0 10
</CsScore>
</CsoundSynthesizer>

I am on Ubuntu...
Cheers,
Rene


Date2011-08-17 11:05
FromRene Jopi
SubjectRe: [Csnd] sprintfk
Hi,

It works, thanks for your reply.

But in my example ktrig is changing every second, so puts should print more than one line.

Cheers,
Rene



2011/8/17 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>
This should do it.
 
instr 1
 knb line  1.1, p3, 6.1
 String sprintfk "Value of knb : %d \n", knb
 ktrig = int(knb)
  puts  String, ktrig
endin
best
Oeyvind
2011/8/17 Rene Jopi <rene.jopi@gmail.com>
Hi list,

What I am doing wrong ?

I was expecting this csd to print :

Value of knb : 1  -> but it prints only this line !
Value of knb : 2
Value of knb : 3
Value of knb : 4
Value of knb : 5
Value of knb : 6


<CsoundSynthesizer>
<CsOptions>
-dm0 -odac -+rtaudio=null -+rtmidi=null
</CsOptions>
<CsInstruments>

instr 1
knb line 1.1, p3, 6.1
String sprintfk "Value of knb : %d \n", knb
ktrig metro 1
puts String, ktrig
endin
</CsInstruments>
<CsScore>
i 1 0 10
</CsScore>
</CsoundSynthesizer>

I am on Ubuntu...
Cheers,
Rene



Date2011-08-17 11:27
FromOeyvind Brandtsegg
SubjectRe: [Csnd] sprintfk
IIRC puts needs the value to actually change
Not only from zero to 1, but that the nonzero value needs to be new, ... I might be wrong... you could test
 
kcount init 0
ktrig metro 1
kcount = kcount + ktrig
then use kcount as the trigger variable to puts
 
Oeyvind
2011/8/17 Rene Jopi <rene.jopi@gmail.com>
Hi,

It works, thanks for your reply.

But in my example ktrig is changing every second, so puts should print more than one line.

Cheers,
Rene



2011/8/17 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>
This should do it.
 
instr 1
 knb line  1.1, p3, 6.1
 String sprintfk "Value of knb : %d \n", knb
 ktrig = int(knb)
  puts  String, ktrig
endin
best
Oeyvind
2011/8/17 Rene Jopi <rene.jopi@gmail.com>
Hi list,

What I am doing wrong ?

I was expecting this csd to print :

Value of knb : 1  -> but it prints only this line !
Value of knb : 2
Value of knb : 3
Value of knb : 4
Value of knb : 5
Value of knb : 6


<CsoundSynthesizer>
<CsOptions>
-dm0 -odac -+rtaudio=null -+rtmidi=null
</CsOptions>
<CsInstruments>

instr 1
knb line 1.1, p3, 6.1
String sprintfk "Value of knb : %d \n", knb
ktrig metro 1
puts String, ktrig
endin
</CsInstruments>
<CsScore>
i 1 0 10
</CsScore>
</CsoundSynthesizer>

I am on Ubuntu...
Cheers,
Rene




Date2011-08-17 11:45
FromRene Jopi
SubjectRe: [Csnd] sprintfk
Working too, you are right :)
Thanks,
Rene


2011/8/17 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>
IIRC puts needs the value to actually change
Not only from zero to 1, but that the nonzero value needs to be new, ... I might be wrong... you could test
 
kcount init 0
ktrig metro 1
kcount = kcount + ktrig
then use kcount as the trigger variable to puts
 
Oeyvind
2011/8/17 Rene Jopi <rene.jopi@gmail.com>
Hi,

It works, thanks for your reply.

But in my example ktrig is changing every second, so puts should print more than one line.

Cheers,
Rene



2011/8/17 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>
This should do it.
 
instr 1
 knb line  1.1, p3, 6.1
 String sprintfk "Value of knb : %d \n", knb
 ktrig = int(knb)
  puts  String, ktrig
endin
best
Oeyvind
2011/8/17 Rene Jopi <rene.jopi@gmail.com>
Hi list,

What I am doing wrong ?

I was expecting this csd to print :

Value of knb : 1  -> but it prints only this line !
Value of knb : 2
Value of knb : 3
Value of knb : 4
Value of knb : 5
Value of knb : 6


<CsoundSynthesizer>
<CsOptions>
-dm0 -odac -+rtaudio=null -+rtmidi=null
</CsOptions>
<CsInstruments>

instr 1
knb line 1.1, p3, 6.1
String sprintfk "Value of knb : %d \n", knb
ktrig metro 1
puts String, ktrig
endin
</CsInstruments>
<CsScore>
i 1 0 10
</CsScore>
</CsoundSynthesizer>

I am on Ubuntu...
Cheers,
Rene