GithubHelp home page GithubHelp logo

Comments (8)

ctford avatar ctford commented on July 26, 2024

There's definitely an issue. Crab canons should be reflecting the notes based on when they finish, not when they start.

from leipzig.

ctford avatar ctford commented on July 26, 2024

The following now works as I'd expect:

((lc/simple 2) (lc/crab (lm/phrase [1 0.5 0.5] [4 5 6])))

I've offset the result by the full length of the melody, not the time of the last note.

Another possibility to reduce confusion here would be to incorporate the lc/simple offset into crab itself. Would that better fulfil people's expectations?

from leipzig.

rogerallen avatar rogerallen commented on July 26, 2024

Another possibility to reduce confusion here would be to incorporate the lc/simple offset into crab itself. Would that better fulfil people's expectations?

That would match my usage. I'd like to transform a phrase and receive a phrase that I could play in its place. I don't know about others, but I'm not sure how I would use a phrase that starts before the given phrase.

from leipzig.

rogerallen avatar rogerallen commented on July 26, 2024

You may also consider doing a sort-by :time in crab. When I pass a long phrase with multiple sub-sequences to live/play, it seems to get confused if some of the notes it plays are not sorted. Looking at the code, I'm not exactly sure how this happens, but I had some issues until I wrapped my own usage with sort-by :time.

from leipzig.

ctford avatar ctford commented on July 26, 2024

So far, I'd only considered using crab in the context of canon, and so I
relied on canon sorting things after the transformation. That assumption
seems a little shaky on closer inspection.

Are you using crab on its own?

Chris

On 10 June 2013 05:51, Roger Allen [email protected] wrote:

You may also consider doing a sort-by :time in crab. When I pass a long
phrase with multiple sub-sequences to live/play, it seems to get confused
if some of the notes it plays are not sorted. Looking at the code, I'm not
exactly sure how this happens, but I had some issues until I wrapped my own
usage with sort-by :time.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-19179000
.

from leipzig.

rogerallen avatar rogerallen commented on July 26, 2024

I have a function here: https://github.com/rogerallen/explore_overtone/blob/master/src/explore_overtone/song_algorithm.clj#L143

that takes a phrase as input, randomly alters the phrase and returns it. It is much like what you do with canon, but a replacement, rather than appending. I'm just "noodling" around, so take this as just one datapoint on how some J Random User might use Leipzig. Always returning time sorted phrases might be in line with the principle of least astonishment. But, you also might be counting on that ordering in how you use it, I don't know.

(defn alter-phrase
  [the-phrase]
  (let [r (wrand [3 1 2])]
    (case r
      0 ((lc/interval (rand-melody-pitch-step)) the-phrase)
      1 (sort-by :time (lc/crab the-phrase))
      2 ((lc/interval (rand-melody-pitch-step)) (lc/mirror the-phrase))
      )))

from leipzig.

ctford avatar ctford commented on July 26, 2024

That case does imply crab should be sorting. The way play works assumes
time is ordered, so crab currently returns technically invalid melodies.

Also, sorting ruins laziness, so keeping it out of canon allows infinite
canon.

I think I'm convinced sorting is best done on the transformation itself
i.e. crab.
On Jun 10, 2013 8:23 PM, "Roger Allen" [email protected] wrote:

I have a function here:
https://github.com/rogerallen/explore_overtone/blob/master/src/explore_overtone/song_algorithm.clj#L143

that takes a phrase as input, randomly alters the phrase and returns it.
It is much like what you do with canon, but a replacement, rather than
appending. I'm just "noodling" around, so take this as just one datapoint
on how some J Random User might use Leipzig. Always returning time sorted
phrases might be in line with the principle of least astonishment. But,
you also might be counting on that ordering in how you use it, I don't know.

(defn alter-phrase
[the-phrase](let [r %28wrand [3 1 2]%29]
%28case r
0 %28%28lc/interval %28rand-melody-pitch-step%29%29 the-phrase%29
1 %28sort-by :time %28lc/crab the-phrase%29%29
2 %28%28lc/interval %28rand-melody-pitch-step%29%29 %28lc/mirror the-phrase%29%29
%29))


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-19213620
.

from leipzig.

ctford avatar ctford commented on July 26, 2024

I've pushed the call to sort-by back up into crab.

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.