Web-Multi-Media / multi-web-audio-sequencer

Web collaborative step sequencer
https://labs.freesound.org/sequencer
GNU General Public License v3.0
10 stars 2 forks source link

Re-write sequencer state #18

Closed xavierfav closed 6 years ago

xavierfav commented 6 years ago

As explained in #5, using track names as identifiers may not be a good practice. We should use an ID for selecting and managing them. The sequencer state could maybe store the list of track names, and use indexes to describe them, something like this:

state = 
{
  trackNames: ['kick', 'snare'],
  trackPads: {
    '0': [<list of activated pads>],
    '1': [<list of activated pads>] 
  },
  trackSounds: {
    '0': <soundUrl>,
    '1': <soundUrl>
  },
  trackWaves: {
    '0': [<startTime>, <endTime>],
    '1': [<startTime>, <endTime>]
  }
}

The sequencer state should be re-written.

Also, the state could be sent as one json instead of separating pads, track names, etc... It will make the things much simpler for manipulating and sharing states.