Coder Social home page Coder Social logo

Comments (7)

polymorphicengine avatar polymorphicengine commented on June 11, 2024

thinking about this a bit more, it is probably even better to switch from [Event a] to Tree (Event a) instead of tagging the events with the keys in the tree, here Tree would be somthing like

data Tree a = Leaf a | [Tree a]

from tidal.

yaxu avatar yaxu commented on June 11, 2024

Hey @polymorphicengine, I wonder if this is a bit of a complex solution, compared to adding more support for patterns of lists?

So I think it would be good to look at the underlying use cases to check there isn't a cleaner solution.

from tidal.

polymorphicengine avatar polymorphicengine commented on June 11, 2024

i thought about this quite a bit and i don't really see a way to make it simpler unfortunately.

unless we want to sacrifice some of the nice flexibilities of stacks (for example, not allowing stacks within stacks etc.)

i think moving to a own tree like datastructure will actually make things a bit simpler as to dealing with lists of events, as i see it right now the semantics of combining multiple stacked patterns are a bit unpredictable, it would be really nice to make them more explicit. for example, right now if you have multiple stacks in binary operators on patterns it will produce all possible combinations (i think), this will lead to an exponential amount of events, it would be much nicer to zip the events by default:

"[1,2]" + "[10,[20,30]]" --> "[11, [22,32]]"

since in the current list structure everything is flat, this is quite hard to do.

there are pontentially many use cases like being able to design own arpeggiators or chord modifiers, applying functions only to certain layers of patterns etc., i've seen people wanting such features in discord or on the forum multiple times.

i think this would be a good step towards tidal being able to handle more interesting horizontal structures :)

i'm ofcourse open to other suggestions, but right now i'm convinced that this is a good and not overly complex solution, but it could well be that there will be difficulties i don't see yet :)

from tidal.

bgold-cosmos avatar bgold-cosmos commented on June 11, 2024

How does the parser decide what tree structure to give

"[a <b ~>,  c d, e f g]"

when queried for Arc 0.3 0.6? Some things that I might call parent nodes only partially exist on that interval. There's probably a way of dealing but I suspect it's generally going to be a bit arbitrary, and I haven't even gotten very complex with pattern transformations yet.

from tidal.

polymorphicengine avatar polymorphicengine commented on June 11, 2024

ah yes i forgot to take into account that tidal deals in arcs of time, i.e. a pattern represents for every arc all the events active during that time, then probably trees wont do the trick alone, but possibly a list of trees, where the list represents the horizontal and the tree the vertical part of the pattern

i will have to think about it a bit more, please do let me know if you have other ideas to tackle the vertical structure of patterns!

from tidal.

mindofmatthew avatar mindofmatthew commented on June 11, 2024

Assuming that we're in 2.0 land, a thought I've had previously that might also work here: instead of returning a list of events, might a query return a Sequence instead? If I'm reading the code correctly, the Atom constructor includes all of the relevant information that an Event would, and I think the other constructors provide all the structural information that @polymorphicengine is asking for.

In addition to allowing "polyphonic" functions like stack to encode that operation in the structure of their output, using a Sequence rather than a list of events offers more potential information about the structure of the gaps between events. (#721, #760, and #761 all discuss the potential of this)

from tidal.

polymorphicengine avatar polymorphicengine commented on June 11, 2024

instead of returning a list of events, might a query return a Sequence instead?

yes, this is basically also what i'm suggesting, sequences are basically trees in their structure, at least when i last looked at their definition. i think it might be an even more complex solution than going with simple trees, because Sequences have both vertical and horizontal structure themselves (i think there is a stack constructor for sequences)

today someone on the forum/discord asked again about how to deal with vertical structures, would be really nice to come up with a good solution!

from tidal.

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.