Well, perhaps `init_getstring' (Top/getstring.c) is a better place (`csoundInitialize' calls `init_getstring'). tito On Wed, Feb 29, 2012 at 10:03:33AM +0100, Francois PINOT wrote: > Hello, > > I had a problem in blue using the new parser: as soon as there was a > literal floating point value in the orchestra, i got an error about numeric > values. It's a locale problem because in French, the decimal separator is a > comma instead of a dot. > > I first thought that the problem was specific to blue and I transmitted the > problem to Steven. But then Joachim Heintz signaled that he add the same > problem with csoundQt and Tito Latini suggested that a solution might be to > export LC_NUMERIC=C to force C syntax for floating point literals. > > I investigated in the csound sources and I found that the error comes from > the strtod function used by csound in different files of the csound5/Engine > dir: csound_orc_compile.c, express.c, linevent.c, otran.c, sread.c, and in > csound5/Opcodes/ftgen.c > > We find this statement in csound5/Engine/otran.c (line306): > > setlocale(LC_NUMERIC, "C"); /* Ensure C syntax */ > > So, if otran is not used by the new parser, this could explain that we have > not this problem with the old parser. > > I suggest to solve the problem by inserting the setlocale(LC_NUMERIC, "C"); > statement in the csoundCreate function of the csound5/Top/csound.c source > file, so that we are sure to have C syntax for literal floating point > values in all cases (i.e. csound being launched from console, from a system > call or through the API). I tried the solution here and it seems to work. > > If other developpers don't have any objection, I'll commit the patch to git > when I'm back home this evening. > > Regards > > Francois > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Csound-devel mailing list > Csound-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/csound-devel ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net