Hello all!
I need some help with an opcode design:
A opcode i wrote in C can receive a k-trig to set some internal variables to a specific state, which influences the a-output, more precise it sets the output values to a predefined value.
But since it’s a k-trig the whole audio output vector will be set to this value. This is to long for my purpose. I want only the first value of the vector to have this value and go on with the processing loop.
I could change the k-trig to an a-trig, but this makes the opcode not very userfriendly inside csound, because k-trigs are more common.
Can i solve this in some way?
All the Best,
Philipp von Neumann (He/Him)
Composition | Computer Music | Programming
philipp@von-neumann.com
+49 159 01 20 71 03
von-neumann.com
SoundCloud: Stream Philipp von Neumann music | Listen to songs, albums, playlists for free on SoundCloud
Bluesky: @von-neumann.com on Bluesky
Mastodon: Philipp von Neumann (@PvN@mastodon.social) - Mastodon
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
GitHub · Where software is built
Discussions of bugs and features can be posted here
Not sure I understand the problem. Why don't you have a k-var output if you only need a scalar to be set instead of a whole vector?
Maybe you can show the opcode syntax description so we have a better idea.
Prof. Victor Lazzarini
Maynooth University
Ireland
Ok, i try to explain it more clear, i hope this makes this understandable:
This is a simplified version of the opcode syntax:
a1 my_opcode kTrig, iStart
When the instrument is called the first value of the output vector is iStart. After this a differential equation is calculating the next values of the vector.
When kTrig = 1 the output vector is reset to iStart. And this is the problem. Because kTrig is equal to 1 for a whole k-cycle the whole output vector is now set to iStart. But i only need to set the first value of the output vector to iStart and let the differential equation inside the processing loop fill the next values of the output vector.
Is this more clear?
Ok, so all you need to do is use ktrig to do what you said, when it's one you reset the start value and go off to compute the rest of the vector. It does not matter that ktrig does not change - unless you want the reset to happen on sample boundary rather than block boundary.
I don't really see a problem. It's just a matter of using the right logic. If ktrig is zero, nothing is done, just carry on computing, if it's one, set first value and move on to compute the rest. The process does not need to be dependent on ktrig changing during the processing loop.
HTH
Prof. Victor Lazzarini
Maynooth University
Ireland
Thanks Victor!
I double checked my opcode and it’s results now and it works like you said!
greetings,
philipp
Ok, so all you need to do is use ktrig to do what you said, when it's one you reset the start value and go off to compute the rest of the vector. It does not matter that ktrig does not change - unless you want the reset to happen on sample boundary rather than block boundary.
I don't really see a problem. It's just a matter of using the right logic. If ktrig is zero, nothing is done, just carry on computing, if it's one, set first value and move on to compute the rest. The process does not need to be dependent on ktrig changing during the processing loop.
HTH
Prof. Victor Lazzarini
Maynooth University
Ireland
*Warning*
This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
Ok, i try to explain it more clear, i hope this makes this understandable:
This is a simplified version of the opcode syntax:
a1 my_opcode kTrig, iStart
When the instrument is called the first value of the output vector is iStart. After this a differential equation is calculating the next values of the vector.
When kTrig = 1 the output vector is reset to iStart. And this is the problem. Because kTrig is equal to 1 for a whole k-cycle the whole output vector is now set to iStart. But i only need to set the first value of the output vector to iStart and let the differential equation inside the processing loop fill the next values of the output vector.
Is this more clear?
Not sure I understand the problem. Why don't you have a k-var output if you only need a scalar to be set instead of a whole vector?
Maybe you can show the opcode syntax description so we have a better idea.
Prof. Victor Lazzarini
Maynooth University
Ireland
Hello all!
I need some help with an opcode design:
A opcode i wrote in C can receive a k-trig to set some internal variables to a specific state, which influences the a-output, more precise it sets the output values to a predefined value.
But since it’s a k-trig the whole audio output vector will be set to this value. This is to long for my purpose. I want only the first value of the vector to have this value and go on with the processing loop.
I could change the k-trig to an a-trig, but this makes the opcode not very userfriendly inside csound, because k-trigs are more common.
Can i solve this in some way?
All the Best,
Philipp von Neumann He/Him
Composition | Computer Music | Programming
philipp@von-neumann.com
+49 159 01 20 71 03
von-neumann.com
SoundCloud: Stream Philipp von Neumann music | Listen to songs, albums, playlists for free on SoundCloud
Bluesky: @von-neumann.com on Bluesky
Mastodon: https://mastodon.social/@PvN
Csound mailing list
Csound@listserv.heanet.ie
LISTSERV 16.5 - CSOUND List at LISTSERV.HEANET.IE
Send bugs reports to
Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
LISTSERV 16.5 - CSOUND List at LISTSERV.HEANET.IE
Send bugs reports to
Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
LISTSERV 16.5 - CSOUND List at LISTSERV.HEANET.IE
Send bugs reports to
Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
LISTSERV 16.5 - CSOUND List at LISTSERV.HEANET.IE
Send bugs reports to
Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
Send bugs reports to
Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here