This is why I think that playing MIDI sounds is the correct model for the world.
On tick we add to the world the sounds that are to be played - they stop 
playing when the next tick starts. (Or, if we control the duration, we include 
the information for how many ticks should the sound be played and turn off 
those sounds after the desired time has elapsed.)

I handle the key events by processing separately key pressed and key released 
events, and any sound to be played on key event starts when the key is pressed 
and remains playing until the release. (All other key events are only possible 
on key press as before. The key release is not visible to the programmer.)

And I include appropriate hooks so the programmer can write tests whether the 
specified sounds are currently active (being played).

Of course, (sorry) this is all Java --- but I think it is a model that 
preserves the design of the world and universe.

-- Viera

On Oct 20, 2011, at 7:59 AM, Matthias Felleisen wrote:

> 
> I think you rather mean the difference between event handlers in Worlds and 
> event handlers for Universe Worlds: return a package that may include a sound 
> to be played. Sounds depend too much on the exact action you took. 
> 
> What I dont understand is why John thinks it's simple. I don't understand 
> sound at any deep level. I do understand that it takes time and that playing 
> in asynchronously may create noise and nothing pleasant. How are you going to 
> avoid this? 
> 
> -- Matthias
> 
> 
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users


_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Reply via email to