[Csnd] readk does not seem to work properly
Date | 2019-12-30 05:30 |
From | Michael McConney |
Subject | [Csnd] readk does not seem to work properly |
All, readk does not seem to be reading the assigned file as it updates. The applicable part of the code I am is shown below (ran through a python wrapper). The volume.txt file is adjusted to an integer between 1 and 10 with rotary encoder that is run on a separate process that changes the file and also prints the value. I have confirmed that this separate process works by updating the file when the rotary encoder is turned. I have put some example output below as well to help diagnose this issue. one notable thing is that the actual value read into the file does not seem to be directly related to what numbers are written into the text file. I have tried many things including inputting appropriate binary code into the text file and despite this I cannot seem to figure out what is happening. One other notable feature is that the value always decreases after the first or few time constants associated with readk. If anyone knows the source of this issue or has suggestions as to now I can solve this issue I would sincerely appreciate any help. Regards, Mike applicable Csound code: orc = """sr=44100 ksmps=32 nchnls=2 0dbfs=1 instr 1 ainL, ainR ins kvol readk "/home/pi/Desktop/volume.txt", 1, 0.5 outs ainL*(kvol/20), ainR*(kvol/20) printk 2, kvol endin""" sco = "i1 0 3600" Example output: volume value in text file callback (rot encode) is 5 i 1 time 0.00000: 52.00000 i 1 time 2.00054: 20.00000 volume value in text file callback (rot encode) is 4 volume value in text file callback (rot encode) is 5 volume value in text file callback (rot encode) is 6 volume value in text file callback (rot encode) is 7 i 1 time 4.00036: 20.00000 i 1 time 6.00018: 20.00000 i 1 time 8.00000: 20.00000 |
Date | 2019-12-30 06:43 |
From | Michael McConney |
Subject | Re: [Csnd] readk does not seem to work properly |
I figured out my mistake. I was not properly using readk, I had not realized that readk is looking for a constant stream of values. Being new to Csound, it is still hard to get used to the data streaming aspects of the code. Regards, Mike On Mon, Dec 30, 2019, 12:30 AM Michael McConney <mcconney@gmail.com> wrote:
|
Date | 2019-12-30 12:31 |
From | Dave Seidel |
Subject | Re: [Csnd] readk does not seem to work properly |
Is it impractical for the process writing to the file to use something like OSC to send the changing data values directly to the Csound app? On Mon, Dec 30, 2019 at 1:43 AM Michael McConney <mcconney@gmail.com> wrote:
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
|
Date | 2019-12-30 14:02 |
From | Michael McConney |
Subject | Re: [Csnd] readk does not seem to work properly |
Dave, I started working osc and from a python simplicity standpoint I thought it seemed to be an impractical solution to send the occasional bit of data (mainly want to adjust a few thresholds for signal processing). That said , I am a novice in this type of communication and this combined with my preference to avoid using a socket api made this seem to be a challenging approach for me. chnget and chnexport worked well to send the occasional amount of data and so this seemed like the most practical route, but so far I have been unable to initiate csound to update the values in the way I want. I recently saw your post about using open stage control. This seems like this maybe the best way for me to solve this. But I think I will first try to debug the socket communication code I already wrote in python to implement osc and if I can't bang through with that I will switch to a socket api, likely open stage control. Thank you for your help. Regards, Mike On Mon, Dec 30, 2019, 7:32 AM Dave Seidel <dave.seidel@gmail.com> wrote:
|