Re: [Bluemusic-users] bug with score macros?
Brought to you by:
kunstmusik
From: Steven Y. <ste...@gm...> - 2007-07-10 00:07:14
|
Hi Dave, The use of alternative escaping syntax doesn't unfortunately help if blue needs to know what the information inside it is, i.e. for the case that a score expression occurs in p2 or p3 pfield. For instruments that have fixed value such as one in a Macro, would it be possible to just have the instrument be a BlueSynthBuilder instrument and use a knob or text entry widget to demarcate what the base pitch should be? Or is this going to be global across all instruments? I think if macros are going to be supported the only really good way to do it is to add a new macro manager for orc and sco macro's, then apply and parse new macro's whenever parsing instrument code or sco code. That part isn't too, too bad to implement (perhaps just takes a bit of time), but the problem will be when upgrading new projects or importing projects. Unless... we also allow non-managed macro's, which will then just be parsed in blue's parsing order and applied as blue renders SoundObjects, Instruments, etc. So you could have managed macros and unmanaged macros. steven On 7/8/07, Dave Seidel <da...@su...> wrote: > Hi Steven, > > I can understand you point of view, but I have found macros to be very > handy in the past, and have used them pretty extensively in a several > pieces. As a long-time (>20 years) C programmer (though it is no longer > my primary language) I'm pretty comfortable with this type of macro > despite its inferiority compared to other solutions. > > I guess one way to solve the problem in this case would be to modify my > instrument designs so that they are aware of a global base pitch setting > (which is what this particular macro is used for) -- not a great > solution, because it I don't like instruments that use globals (except > for I/O channels). > > Here's an idea for an alternative solution: blue could support an > alternative notation for "escaping" expressions (e.g., [[ expr-text ]]), > in which case it would just pass the entire expression through as text > (with the braces fixed up, of course). Thoughts? > > - Dave > > Steven Yi wrote: > > Hi Dave, > > > > It's not so much a bug as a feature! =P (Just a small joke for Sunday > > afternoon while stitting at a cafe) > > > > Macros in general are not supported in blue. They work when parsed as > > a score because blue will read it as just text and save it in the > > pfield. When used as in an expression, the expression is parsed and > > calculated by blue as it needs to do so to make sure that blue can do > > its score manipulations correctly as well as apply note processors > > (that was the idea at least), so when it tries to parse the macro as a > > number it fails. > > > > I think somewhere the manual it is listed that macros are not > > supported. I'm not a big fan of Csound macros especially when UDO's > > came out. I think it's better to use global variables or UDO's for > > just about all cases where macros might be used except the one case of > > defining and undefining a macro within the body of an instrument which > > I have found handy. The problem with Csound macros I have is the same > > as with macros in C in that they are only textual replacements and > > hence not safe. (Hygenic macros in Guile, now those are quite nice! > > =) ). > > > > Thinking about it, globals don't help at all in score situations. I > > guess I never found a need for it so never got into it. > > > > Macros could be supported in blue but I think it might be a a fair > > amount of work to do so. I think if they were to be implemented they > > should be done so in such a way that they are expanded out by blue > > while generated CSD so that blue's other features can apply to the > > expanded score. > > > > I have been reading about Antlr 3.0 now that there is a book out for > > it; perhaps implementing a macro processing system might be an > > interesting project. I do think that it might impact blue's > > compilation speed, so I'd like to get as many people's opinions on > > this to make sure it's really worth implementing. > > > > Thanks! > > steven > > > > > > On 7/8/07, Dave Seidel <da...@su...> wrote: > >> Hi Steven, > >> > >> I am encountering what seems to be a bug with score parsing. Here are > >> the details: > >> > >> In my Global Score section, I have > >> > >> #define BASE #60# > >> > >> In one of my Sound Layers, I have a GenericScore instance that contains > >> > >> i1 0 30 5000 1 $BASE. 0.0 3 3 > >> i1 0 30 5000 1 [$BASE. * 1.465571232] 1.0 3 3 > >> > >> When I click the Test button on the score editor, I get > >> > >> There was an score generation error in the soundObject: > >> > >> Type: GenericScoreName: GenericScore > >> Start Time: 30 > >> > >> Cause: > >> NoteParseException > >> Line Number: 2 > >> Note Text: i1 0 30 5000 1 [ $BASE. * 1.465571232 ] 1.0 3 3 > >> Details: > >> Invalid note text: i1 0 30 5000 1 [ $BASE. * 1.465571232 ] 1.0 3 3 > >> > >> I see that it has no problem with the first "i" statement, so I'm > >> guessing that the score parser is failing when it gets a macro > >> invocation within square braces. I have been able to use square bracket > >> notation many times with no difficulty, but not when the expression > >> contains a macro. > >> > >> Am I doing something wrong, or is this a bug? > >> > >> - Dave > >> > >> > >> > >> ------------------------------------------------------------------------- > >> This SF.net email is sponsored by DB2 Express > >> Download DB2 Express C - the FREE version of DB2 express and take > >> control of your XML. No limits. Just data. Click to get it now. > >> http://sourceforge.net/powerbar/db2/ > >> _______________________________________________ > >> Bluemusic-users mailing list > >> Blu...@li... > >> https://lists.sourceforge.net/lists/listinfo/bluemusic-users > >> > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > Bluemusic-users mailing list > > Blu...@li... > > https://lists.sourceforge.net/lists/listinfo/bluemusic-users > > > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Bluemusic-users mailing list > Blu...@li... > https://lists.sourceforge.net/lists/listinfo/bluemusic-users > |