From: Dominique F. <fo...@gr...> - 2016-07-05 08:15:41
|
That’s done ! There is a new API: /** \brief Gives the current meter on a given date and voice. \param inHandleAR a Guido opaque handle to a AR structure. \param voicenum a voice number (starts at 1). \param date the target date. \param meter on output: the current meter \return a Guido error code. \see the GuidoMeter structure for the meter encoding conventions */ GUIDOAPI(GuidoErrCode) GuidoGetMeterAt (CARHandler inHandleAR, int voicenum, const GuidoDate &date, GuidoMeter& meter); It’s available from the ‘dev’ branch of the repository. The corresponding engine version is 1.63. Note that the ‘src/tools’ folder includes also an example of use (guidogetmeter.cpp) Best, — Dom > Le 30 juin 2016 à 15:17, Arshia Cont <ars...@an...> a écrit : > > Dominique et al. > > You are totally right about the ambiguity of querying the “beat duration” of a GuidoDate, which in the end will be application-specific. > > I suggest, to start with, to enable the query of the time-signature at a given position in the score. This way, each coder can do the translation as needed. > > If you can enable a method like this as you suggested in an earlier email (similar to GuidoPage stuff) it’d be wonderful for us. > > Bests, > > > Arshia > > >> On 28 Jun 2016, at 13:55, Dominique Fober <fo...@gr...> wrote: >> >> >>> 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 >> >> >> ------------------------------------------------------------------------------ >> 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 > |