[Cs-dev] New minmax opcode library added
Date | 2006-03-11 03:53 |
From | Anthony Kozar |
Subject | [Cs-dev] New minmax opcode library added |
I just committed a new set of opcodes (my first to be added to canonical! :) as the "minmax" plugin library. I added the file Opcodes/minmax.c and inserted the following line in SConstruct: makePlugin(pluginEnvironment, 'minmax', ['Opcodes/minmax.c']) Since I don't use Scons most of the time, I hope that I have done this correctly. Please let me know if there are any other changes that I need to make to SConstruct or any of the installers in order to finish adding these new opcodes. I am still working on the documentation and I will have to figure out how to add manual pages (which I cannot build or test). I assume that I need to add a page for each opcode (although it seems that these would be better explained as a group). I hope to finish adding the docs this weekend. Here is a brief summary of the syntax and functionality each opcode provides: maxaccum aAccumulator, aInput minaccum aAccumulator, aInput maxabsaccum aAccumulator, aInput minabsaccum aAccumulator, aInput amax max ain1, ain2 [, ain3] [, ain4] [...] amin min ain1, ain2 [, ain3] [, ain4] [...] amax maxabs ain1, ain2 [, ain3] [, ain4] [...] amin minabs ain1, ain2 [, ain3] [, ain4] [...] kmax max kin1, kin2 [, kin3] [, kin4] [...] kmin min kin1, kin2 [, kin3] [, kin4] [...] kmax maxabs kin1, kin2 [, kin3] [, kin4] [...] kmin minabs kin1, kin2 [, kin3] [, kin4] [...] The maxaccum and minaccum opcodes work similarly to the vincr opcode except that they store the maximum or minimum value into aAccumulator instead of adding them together. aAccumulator is used as both an input and an output signal here with the following logic: maxaccum: if (aInput > aAccumulator) aAccumulator = aInput minaccum: if (aInput < aAccumulator) aAccumulator = aInput This test is performed on a per sample basis and can easily lead to discontinuities in the output signal. For this reason, I typically use the opcodes to combine audio-rate control signals. maxabsaccum and minabsaccum are identical to maxaccum and minaccum except that they compare the absolute values of the inputs, and thus always have a positive output. The max and min families of opcodes are used to find the maximum or minimum values among any number of a-rate or k-rate signals. The ain* and kin* parameters are only read by these opcodes and the output is written to amax, amin, kmax, or kmin just as one would expect. Once again, the a-rate versions work on a per sample basis. And maxabs and minabs take the absolute value of all of the inputs before comparing them. Anthony Kozar anthonykozar AT sbcglobal DOT net ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2006-03-11 13:08 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] New minmax opcode library added |
Hi Anthony, You may want to look at how the dssi or vst opcodes are documented. They have one main page listing and explaining the functionality of the category, but each opcode has its own page. This is very useful for finding documentation on host like blue which search for the opcode's individual page. Cheers, Andrés On Fri, 2006-03-10 at 22:53 -0500, Anthony Kozar wrote: > I just committed a new set of opcodes (my first to be added to canonical! :) > as the "minmax" plugin library. I added the file Opcodes/minmax.c and > inserted the following line in SConstruct: > > makePlugin(pluginEnvironment, 'minmax', ['Opcodes/minmax.c']) > > Since I don't use Scons most of the time, I hope that I have done this > correctly. Please let me know if there are any other changes that I need to > make to SConstruct or any of the installers in order to finish adding these > new opcodes. > > I am still working on the documentation and I will have to figure out how to > add manual pages (which I cannot build or test). I assume that I need to > add a page for each opcode (although it seems that these would be better > explained as a group). I hope to finish adding the docs this weekend. > > Here is a brief summary of the syntax and functionality each opcode > provides: > > > maxaccum aAccumulator, aInput > minaccum aAccumulator, aInput > maxabsaccum aAccumulator, aInput > minabsaccum aAccumulator, aInput > > amax max ain1, ain2 [, ain3] [, ain4] [...] > amin min ain1, ain2 [, ain3] [, ain4] [...] > amax maxabs ain1, ain2 [, ain3] [, ain4] [...] > amin minabs ain1, ain2 [, ain3] [, ain4] [...] > > kmax max kin1, kin2 [, kin3] [, kin4] [...] > kmin min kin1, kin2 [, kin3] [, kin4] [...] > kmax maxabs kin1, kin2 [, kin3] [, kin4] [...] > kmin minabs kin1, kin2 [, kin3] [, kin4] [...] > > > The maxaccum and minaccum opcodes work similarly to the vincr opcode except > that they store the maximum or minimum value into aAccumulator instead of > adding them together. aAccumulator is used as both an input and an output > signal here with the following logic: > > maxaccum: if (aInput > aAccumulator) aAccumulator = aInput > minaccum: if (aInput < aAccumulator) aAccumulator = aInput > > This test is performed on a per sample basis and can easily lead to > discontinuities in the output signal. For this reason, I typically use the > opcodes to combine audio-rate control signals. > > maxabsaccum and minabsaccum are identical to maxaccum and minaccum except > that they compare the absolute values of the inputs, and thus always have a > positive output. > > The max and min families of opcodes are used to find the maximum or minimum > values among any number of a-rate or k-rate signals. The ain* and kin* > parameters are only read by these opcodes and the output is written to amax, > amin, kmax, or kmin just as one would expect. > > Once again, the a-rate versions work on a per sample basis. And maxabs and > minabs take the absolute value of all of the inputs before comparing them. > > > Anthony Kozar > anthonykozar AT sbcglobal DOT net > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Csound-devel mailing list > Csound-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/csound-devel > > > r ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2006-03-11 17:18 |
From | Anthony Kozar |
Subject | Re: [Cs-dev] New minmax opcode library added |
Thanks Andres. After looking at some of the other manual entries in CVS, I think that I will just add individual pages for each opcode. They don't need a summary page. I was just thinking about how the old Boothe manual was organized with groups of related opcodes together (it made the manual smaller and easier to navigate in my opinion). But I realize that today's front ends expect a page for each opcode so that they can implement help functionality more easily. (I was pleased that adding new manual entries turned out to be so easy, too :) Anthony Andres Cabrera wrote on 3/11/06 8:08 AM: > Hi Anthony, > You may want to look at how the dssi or vst opcodes are documented. They > have one main page listing and explaining the functionality of the > category, but each opcode has its own page. This is very useful for > finding documentation on host like blue which search for the opcode's > individual page. ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |