From: Dominique F. <fo...@gr...> - 2016-06-28 11:56:09
|
> Le 27 juin 2016 à 18:45, Jonathan Aceituno <joi...@gm...> a écrit : > > Hi all, > > Chiming in… > > Ultimately, we would like to be able to express time locations as a number of beats from the beginning of the score, as well as switch back and forth between this representation and GuidoDates. I found no trace of such representation in GuidoLib. Right, this is not provided by the library. Actually the problem is not trivial and the semantic of conversion from date to beat (and the reverse) should be clarified: - what convention if no meter is present? should a default beat value be used (e.g. a quarter note)? - how to represent dates that are not on a beat? (e.g. date 1/8 in a “4/4” meter). Should the beat be expressed using integer of floating point values ? with the former, conversion to and from are not reversible: date 3/8 in a “4/4” meter is on beat 2 but beat 2 is date 1/4, with the latter, conversions are ‘more’ reversible but face precision issues: date 1/12 is on beat 1.33333… but there is no guaranty that beat 1.3333… converts to date 1/12. Thus date to beat conversion could be an integer value + a rational to express the remainder. - is there any unambiguous convention to determine the beat for a given meter? it’s clear for meter like “4/4” but what about exotic time signature: e.g. 15/16 or 3+2+1/8. Actually, with a compound form like 3+2+1/8, I would say that beats are 3/8 + 1/4 + 1/8 but with 3+2+1/4, I would say that the beat is 1/4. Measure subdivision may denotes beats but not necessary. The grouping of notes may also denotes the beat. And sometimes grouping is purely conventional (like with 3/8, 6/8, … meters). It seems to me that the only clear strategy would be to use the denominator as beat unit, but is it always usable in a musical context? > > As I get it, to get a beat-based time location for a given GuidoDate, we would have to get a specific GRVoice, and then iterate over its events, noting changes in meter along the way for those whose AR is a ARMeter, and accumulating durations converted to beats using the most recent meter information, up until the event's getRelativeTimePosition() corresponds to the one we'd like. Performing the reciprocal operation (getting a GuidoDate for an event whose beat-based time location is known) would follow a similar pattern. Seems reasonable. And how do you determine the beat from the meter? > I'd also use a similar pattern to access to other score parameters (without the "accumulating" part), but maybe there's a better way? > > Thanks, > Jonathan Aceituno > >> Hi Arshia, >> >> Actually, there is a minimal API to query a score, see at: >> >> http://guidolib.sourceforge.net/doc/guidolib/group__Pages.html <http://guidolib.sourceforge.net/doc/guidolib/group__Pages.html> >> ; >> It could be easily extended to provide more information e.g. something like GuidoGetMeterAt (int voicenum, const GuidoDate &date). >> Any other useful contextual information that could be retrieved (while browsing a score up to a given date)? e.g a more general function to retrieve the meter, the current key signature, etc. >> Any comment and proposal are welcome. >> >> Cheers, >> — >> Dominique >> >> >>> Le 26 juin 2016 à 21:20, Arshia Cont <arshiacont@...> a écrit : >>> >>> Hello all and thanks for the great work on GuidoLib! >>> >>> I am wondering if there is any API for query of score parameters (such as Meter) from a specific location in the score. Basically, I need to know what is the Meter at a specific location in a rendered score. I see ARMeter and GRMeter classes but can’t seem to easily figure out how I can Get those stuff. >>> >>> Any hints would be appreciated. >>> >>> Cheers, >>> >>> >>> Arshia Cont >>> ------------------------------------------------------------------------------ >>> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San >>> Francisco, CA to explore cutting-edge tech and listen to tech luminaries >>> present their vision of the future. This family event has something for >>> everyone, including kids. Get more information and register today. >>> >> http://sdm.link/attshape >> >>> _______________________________________________ >>> Guidolib-devel mailing list >>> Guidolib-devel@... >>> >> https://lists.sourceforge.net/lists/listinfo/guidolib-devel > > ------------------------------------------------------------------------------ > Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San > Francisco, CA to explore cutting-edge tech and listen to tech luminaries > present their vision of the future. This family event has something for > everyone, including kids. Get more information and register today. > http://sdm.link/attshape > _______________________________________________ > Guidolib-devel mailing list > Gui...@li... > https://lists.sourceforge.net/lists/listinfo/guidolib-devel |