Code Monkey home page Code Monkey logo

Comments (2)

leonawicz avatar leonawicz commented on August 18, 2024

Ah, okay. See the help docs for volta. endings takes a list type object. list(e1,e2) vs. c(e1,e2).

> volta(p("c ec'g' ec'g'", "4 4 2", "5 432 432"), n = 2, endings = list(p("a", 1, 5), p("b", 1, 5)))

The extra curly braces are proper: http://lilypond.org/doc/v2.18/Documentation/notation/long-repeats

Using c worked in this case before (unintended) but no longer will and isn't meant to. In general phrase objects always needed to be listed with list to avoid coercing them to strings. Previously, using c for basic concatenation fell back on the default method of coercing them to simple character strings (an atomic vector, unlike a list). That just happened to be what this function was going to do to those endings phrases anyway so it slipped through.

Now that a custom method has been written for c for the phrase class (it binds them together into a longer phrase object), you have to use the argument as intended to make a list of that object type. In R help docs list means list type and not an atomic vector like character or numeric. The addition of the c.phrase method is one of those breaking changes that was bound to hit some users. Probably one of the last ones there will be in the package that can have such sweeping consequences. Really, this function should have rejected the non-list before, but didn't.

These repeat functions will probably get some refining later. For example, I may remove the aggressive interpretation of basic strings as potentially valid phrases and simply require that a legit phrase object be provided. It's convenient when I just want to say "r1" but I may be giving these repeat functions a bit too much power there. In other places in the package I have been limiting which functions eagerly try to turn character to a tabr class object. Tending toward reserving that eagerness turning a simple class into a more complex one for functions that are explicitly about class coercion like as_noteworthy and a handful of others.

from tabr.

kimo-k avatar kimo-k commented on August 18, 2024

Right, I understand. Funny, I forgot how voltas work in ly.
I'm excited to see the potential of these new class methods.

So far I've been doing straight transcription, but soon I may start using tabr as an educational tool, using more of the analytic capabilities.

from tabr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.