Loading...
Logo
Processing Forum
I am working on a project for an interactive music-project where one should be able to choose between one, two or three options at the end of each song. I already did a sidescroller with music and sounds from scratch using the minim library (and my brain to figure it out) - so I thought I could do it.

I'm on the early planing stage but I'm kinda stuck:
I made a Tabulator-seperated file in which each track is listed (with filepath etc). Also there is a list of the songs that should come after this song. So there the outcome should be an irregular net-like strukture with knots. I figured out how to descripe it to fit in a file. Also I think it will not be so hard to let those tracks play in the desired order.

My Problem: I fail at displaying this structure. All I want to do is to display a structure with knots and branches where lenght equals tracklength.

There are three cases:
  1. One knot leads to one or many knots (easy - but how should the angles beto not destroy the possibility of the child branches to return to their desired knot?)
  2. Two knots leading to the same knot (could be solved with trigonometry I guess)
  3. Many knots leading to the same point (???)
It seems like an problem where one can not just solve things in a serial matter but the whole thing must be solved parallel? Is it even geometrical possible to display this thing? I'm stuck in my thinking and I have no idea what therms I should use in a websearch.

To make it more understandable heare a link to a brach structure I like to have as an outcome. The knots are on the same x-axis to describe the branching levels.

If someone knows a way to tackle this issue or if someone could give me a little hint I would be very pleased ; )

But I think its very likely that someone has thought about this thing before.



Replies(3)

I don't have an answer, just a first impression. I was surprised to see a vertical representation. In thinking of music I was expecting a horizontal arrangement.

Think Graph Theory, edges and vertices. 

Also the recent topic  Pathfinding? Simplified make mention of  Example using path finding library

If you set up a grid, each point being a vertex, you can construct a path be adding edges. (Note: you can't avoid edge crossing, the minimal case being 3 at level x connecting to 3 at level x+ 1. The old puzzle 3 houses each connected to gas, phone, and electricity, with no line crossed.) 

No sure if you want to dynamically adjust the spacing to have a central axis where the first and last land and what is in between is balanced. If yes then adding a branch will require re-positioning the graph, even the start point.
-----------------------
Here is a quick rendering with grid, circles, edges done using PowerPoint to give the vertical and horizontal presentation, with equal spacing:


Thanks for your reply ; )

Maybe I can try to bring this thing into a small grid and then alter points according to the "real length" of the edges(=each song)... Dunno. Crossing lines and off-axis is no problem for me (as long as it starts straight up). But you are right - why didn't I think of good old polygons? I mean it's pretty shure that not every pattern is possible, but I could stick to a "vertecies and edges"-structure. Maybe I also find a algorithm that will work for this thing.

Lets stick to classical non-crossing triangular polygons.
I have 22 edges (two of them independent -> top and bottom) and I know where the knots(=vertecies) should be. There must be an way to get the exact position of the knots (although there might be a few solutions for the same structure.
Atm. I don't have the time to think about it because I have to get up early tomorrow. But you gave me a good impulse - thanks ; )

And maybe someone already has a solution for this problem ; )
Good night
Thinking about it, I think that the duration of the branch should be "measured" not by the length of the line but the measure on the grid. So branch B of length 3 and branch C of length 9 could be replaced by 2 occurrences of branch D of length 6.
          /B---C---------\
  A ---                     E------
          \D------D------/


 Also I really think a horizontal presentation is warranted give the strong musical nature of the interface and that reading music is left to right.