tamte
channel in Houdini refers to many things and it can get confusing, ch() is to sample channels of parameters, not CHOP channels
but since you are interested in a chop channel coming from input chop ( assuming you named your channel "phoneme" )you can use chinput():
float phoneme_value = chinput(0, "phoneme", I); // to read at the current sample or use custom sample number instead of I
to read and write value of the current channel at current sample you can use V global variable
float current_channel_value = V; // read current channel's value at current sample
V = 5; //set current channel's value at current sample to 5
there are other global variables [www.sidefx.com] that can help you, like C for current channel number or CN for current channel name, ..
Thank you, the documentation can get pretty sparse for CHOPs and VEX, so this helps. I've tried using V before, but wasn't quite sure how, and I didn't bother with I because I didn't think I wanted the INDEX of a sample. Now I'm back to the problem I was having before I only got 0: it prints the value of Phoneme at EVERY frame, so now it outputs 00000031313131313144444443535353535358888880000003131313131311515151515151500000066666638383838383800000037373737373737101010101010383838383838000000272727272727271111111111112121212121211313131313133232323232322727272727272719191919191955555533333333333327272727272722222222828282828280000000.
This is only when the Wrangle is set to Channels and Samples, or Samples and Channels. If I set it to Channels, it outputs a single 0, and if Samples, a 0 for every frame. Is the current output of the value at every frame workable, or is there a way to output only the value at the current frame? I'm still at the stage where I'm frenetically changing parameters in the vain hope of getting the results I want, so I don't fully grasp what a lot of those parameters do.
EZiniT
If you simply need to read the value of a channel into a parameter in SOPs for example you can use the chopcf() function to read any channel value at any given time directly.
Also look into the "channel sop" in combination with a "geometry node" from in chops to pull in existing data, manipulate the channels in sops with a math node and waveform or whatever and return them back to sops using the channel sop, it will overwrite the existing data from sops with the chop modified version.....this allows many channels to be adjusted at the same time....cool for delay effects, offsets etc.
Every time I've tried to use a Geometry CHOP, I get an invalid SOP error, so I haven't spent a lot of time with them. I'll definitely give chopcf a try, though. Thank you.