GithubHelp home page GithubHelp logo

Comments (3)

ctford avatar ctford commented on July 26, 2024

The live/jam fn is handy because it takes a var and loops it, dereferencing the var over and over again so that you can edit it live e.g. (live/jam (var melody)).

Sometimes, however, melodies start in negative time, i.e. the time series of notes has an initial note or notes with a negative time e.g. [{:time -1 :duration 1/2 :pitch 2} {:time -1/2 :duration 1/2 :pitch 1} {:time 0 :duration 1 :pitch 0}]. This is not (necessarily) a mistake - some melodies have lead-in notes that start before the emphasis on the first beat of the bar.

When we try and use var/jam on a melody that starts in negative time, however, those notes are horribly mangled. This is because we only redereference the var just as we need it, and by the time we get to that loop, those notes are already in the past.

There are two possible solutions I can think to this:

  • Filter out negative notes, which is simple but cuts out these notes altogether.
  • Transplant negative notes to the end of the melody so that the lead-in notes are still played at the right time.

I prefer the latter solution, though I'm open to suggestions.

from leipzig.

rogerallen avatar rogerallen commented on July 26, 2024

In play you set the time=0 origin with (melody/after (overtone/now))

It seems like you would want to set 0 to some time in the future, enough to handle the negative values. The "real world" convention is one measure in the future...people count "1 2 3 4" but we know they are really indicating "-4 -3 -2 -1" 😃

So, something like:
(melody/after (+ (overtone/now) (* beats-per-measure beats-per-millisecond)))

Will you drop the notes on replay or play them? My intuition says drop them.

from leipzig.

ctford avatar ctford commented on July 26, 2024

Hmm, there are disadvantages to both dropping and keeping:

  • Dropping - those notes aren't available anymore, so you can't work on them or use them in a performance.
  • Not dropping - the loop will now have an uneven length.

I'd also considered transplanting the lead-in notes to play in parallel with the end of the loop. That would produce the right effect on an unchanging loop, though it might act a bit oddly as you edit it.

from leipzig.

Related Issues (12)

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.