DePauwREU2013 / scales

2 stars 0 forks source link

Convert All Animation to Reactive #19

Open mfansler opened 11 years ago

mfansler commented 11 years ago

Theoretically, everything which can be done using Anim (via Step Actors) can be done using the ReactivePanel. Ultimately it would make sense to convert Anim to be based entirely on FRP (whether directly using the ReactivePanel, or not).

As it currently stands the library contains two (under-the-hood) very different ways of creating animations. Unfortunately, it looks like the library is going to be released like this, which could be confusing for students.

In the future, it should be high-priority to remove as much of the Step Actor implementation as possible. However, it is yet to be determined how well the present implementation of the music aspect of the library can be ported over to use reactivity.

bhoward commented 11 years ago

How easy would it be to add a user-defined event stream to FRP? I imagine having a Sequencer object that takes a stream of (int, event) pairs, where the ints form a non-decreasing sequence of times (with 0 being the time at which the Sequencer is started). The Sequencer would then generate the events at the corresponding times and push them out to whatever ReactivePanel is listening. Music would be handled by a function that flattens a music ADT into a stream of pairs of time offsets and NoteOn/NoteOff events, then loads it into a Sequencer and starts it. The ReactivePanel would just sit there and pass each Note event on to the MIDI synthesizer (I assume this is basically how the MidiSequencer works, but it lets us also generate other kinds of events in the sequence -- I could imagine choreographing animated characters that dance along to the music, for example).

On Sun, Jul 28, 2013 at 1:41 AM, Mervin Fansler notifications@github.comwrote:

Theoretically, everything which can be done using Anim (via Step Actors) can be done using the ReactivePanel. Ultimately it would make sense to convert Anim to be based entirely on FRP (whether directly using the ReactivePanel, or not).

As it currently stands the library contains two (under-the-hood) very different ways of creating animations. Unfortunately, it looks like the library is going to be released like this, which could be confusing for students.

In the future, it should be high-priority to remove as much of the Step Actor implementation as possible. However, it is yet to be determined how well the present implementation of the music aspect of the library can be ported over to use reactivity.

— Reply to this email directly or view it on GitHubhttps://github.com/DePauwREU2013/scales/issues/19 .