[CSOUND-DEV:4860] Bugs in score operators?
| Date | 2004-07-01 02:27 |
| From | Anthony Kozar |
| Subject | [CSOUND-DEV:4860] Bugs in score operators? |
I noticed the following code while poking around sread.c:
MYFLT operate(MYFLT a, MYFLT b, char c)
{
MYFLT ans;
extern MYFLT MOD(MYFLT,MYFLT);
switch (c) {
case '+': ans = a+b; break;
case '-': ans = a-b; break;
case '*': ans = a*b; break;
case '/': ans = a/b; break;
case '%': ans = MOD(a,b); break;
case '^': ans = (MYFLT)pow((double)a, (double)b); break;
are ----> case '&': ans = (MYFLT)(((long)a)&((long)b)); break;
these ----> case '|': ans = (MYFLT)(((long)a)&((long)b)); break;
right ----> case '#': ans = (MYFLT)(((long)a)&((long)b)); break;
????? default:
err_printf(Str(X_312,"Internal error op=%c\n"), c);
longjmp(cglob.exitjmp,1);
}
return ans;
}
I figured these three lines shouldn't all calculate the same result. But I
didn't even know that you could use logical operators in score expressions!
It doesn't seem to be documented in the manual.
Also, the @ and @@ operators seem to be giving incorrect results for some
values but not others:
f1 0 [@30] 10 1
f2 0 [@@71] 10 1 0.5
f3 0 [@499] 10 1
f4 0 [@@499] 10 1 0.5
f5 0 [@1000] 10 1
f6 0 [@@5123] 10 1 0.5
becomes
f 1 0.000000 0.000000 64 64 10 1
f 2 0.000000 0.000000 257 257 10 1 0.5
f 3 0.000000 0.000000 1024 1024 10 1
f 4 0.000000 0.000000 1025 1025 10 1 0.5
f 5 0.000000 0.000000 1024 1024 10 1
f 6 0.000000 0.000000 16385 16385 10 1 0.5
Only f5 is correct if I understand @ and @@.
Anthony Kozar
anthony.kozar@utoledo.edu
http://akozar.spymac.net/ |
| Date | 2004-07-01 06:27 |
| From | jpff@codemist.co.uk |
| Subject | [CSOUND-DEV:4861] Re: Bugs in score operators? |
Bitwise operation in the score have been around for a long time. The fact that I messed up the final version suggests that no one uses it! 2002-01-20 |
| Date | 2004-07-01 06:57 |
| From | jpff@codemist.co.uk |
| Subject | [CSOUND-DEV:4862] Re: Bugs in score operators? |
Fixed the @ problem -- it only allowed even powers as I got-it-wrong(tm) Probably time for bugfix 12 ==John ffitch |
| Date | 2004-07-01 08:44 |
| From | Anthony Kozar |
| Subject | [CSOUND-DEV:4864] Re: Bugs in score operators? |
| Attachments | tempobug2.sco tempobug.orc |
On 7/1/04 1:27 AM, jpff@codemist.co.uk |
| Date | 2004-07-01 19:14 |
| From | "Matt J. Ingalls" |
| Subject | [CSOUND-DEV:4866] Re: Bugs in score operators? |
when do you want to do that? i have some bug fixes [and bugs to fix] i can cvs or send you -m |
| Date | 2004-07-01 21:49 |
| From | Anthony Kozar |
| Subject | [CSOUND-DEV:4867] Re: Bugs in score operators? |
I think that I have solved the problem below. (Hopefully without creating any new ones :) Looking into another problem though with negative instrument numbers ... Will update CVS later. Anthony On 7/1/04 3:44 AM, Anthony Kozar |
| Date | 2004-07-05 06:42 |
| From | Anthony Kozar |
| Subject | [CSOUND-DEV:4876] Re: Bugs in score operators? |
I updated CVS with this bug fix and another bug in the error reporting for the ^+ operator as well. I also uploaded the changes to dl_opcodes.c that I made months ago to add opcode plugin support for MacOS 9. Should work the same as on other platforms ( --opcode-lib=libname ) with the important caveat that the "libname" that the user types in must exactly match the name of the code fragment in the plugin library. Since this name is invisible to the user, it is highly recommended that anyone compiling opcode plugins for MacOS 9 make the filename and code fragment name identical. (This also means that pathnames are not allowed as the argument to --opcode-lib on MacOS 9). Anthony Kozar anthony.kozar@utoledo.edu http://akozar.spymac.net/ On 7/1/04 4:49 PM, Anthony Kozar |
| Date | 2004-07-13 04:36 |
| From | Andres Cabrera |
| Subject | [CSOUND-DEV:4934] ASIO working with mingw |
Hi, I just checked out the v19-devel branch for portaudio and Hooray! ASIO is now fixed (don't get the snapshot because it is out of date, you must get the sources from cvs). However, I wanted to check with Csound but I get the following error: g++ -dynamic -o cscore.exe util1\cscore\cscore_main.o -LC:\projects\csound5\windows_dlls -Lcygwin_import_libs -LC:\tools\mingw\lib -LC:\tools\libsndfile-1.0.10pre8 -LC:\tools\portaudiov19\lib -LC:\tools\fltk-1.1.5rc1\lib -LC:\msys\1.0\local\lib -LC:\tools\fluidsynth -L. -L. -L. -L\usr\include\lib -L\usr\local\lib -lcsound -lsndfile -lfltk -lstdc++ -lsupc++ -lkernel32 -lgdi32 -lwsock32 -lole32 -luuid ./libcsound.a(mididevice.o)(.text+0xca): In function `OpenMIDIDevice': h:/c_progs/csound5/OOps/mididevice.c:203: undefined reference to `midiInGetNumDevs@0' ./libcsound.a(mididevice.o)(.text+0x109):h:/c_progs/csound5/OOps/mididevice.c:209: undefined reference to `midiInGetDevCapsA@12' ./libcsound.a(mididevice.o)(.text+0x18e):h:/c_progs/csound5/OOps/mididevice.c:228: undefined reference to `midiInOpen@20' ./libcsound.a(mididevice.o)(.text+0x1a3):h:/c_progs/csound5/OOps/mididevice.c:228: undefined reference to `midiInStart@4' ./libcsound.a(mididevice.o)(.text+0x3be): In function `CloseMIDIDevice': h:/c_progs/csound5/OOps/mididevice.c:597: undefined reference to `midiInStop@4' ./libcsound.a(mididevice.o)(.text+0x3d3):h:/c_progs/csound5/OOps/mididevice.c:597: undefined reference to `midiInReset@4' ./libcsound.a(mididevice.o)(.text+0x40a):h:/c_progs/csound5/OOps/mididevice.c:618: undefined reference to `midiInClose@4' ./libcsound.a(midisend.o)(.text+0x21): In function `send_midi_message': h:/c_progs/csound5/OOps/midisend.c:200: undefined reference to `midiOutShortMsg@8' ./libcsound.a(midisend.o)(.text+0x57): In function `note_on': h:/c_progs/csound5/OOps/midisend.c:205: undefined reference to `midiOutShortMsg@8' ./libcsound.a(midisend.o)(.text+0x85): In function `note_off': h:/c_progs/csound5/OOps/midisend.c:210: undefined reference to `midiOutShortMsg@8' ./libcsound.a(midisend.o)(.text+0xb7): In function `control_change': h:/c_progs/csound5/OOps/midisend.c:215: undefined reference to `midiOutShortMsg@8' ./libcsound.a(midisend.o)(.text+0xdf): In function `after_touch': h:/c_progs/csound5/OOps/midisend.c:220: undefined reference to `midiOutShortMsg@8' ./libcsound.a(midisend.o)(.text+0x10f):h:/c_progs/csound5/OOps/midisend.c:225: more undefined references to `midiOutShortMsg@8' follow ./libcsound.a(midisend.o)(.text+0x2b8): In function `openMIDIout': h:/c_progs/csound5/OOps/midisend.c:240: undefined reference to `midiOutGetNumDevs@0' ./libcsound.a(midisend.o)(.text+0x335):h:/c_progs/csound5/OOps/midisend.c:253: undefined reference to `midiOutGetDevCapsA@12' ./libcsound.a(midisend.o)(.text+0x360):h:/c_progs/csound5/OOps/midisend.c:255: undefined reference to `midiOutOpen@20' scons: building terminated because of errors. scons: *** [cscore.exe] Error 1 Andres |