Example Uses

The HTML page has been derived from the sandbox example, pressing the Try it button will play the tune. We simply added the a registrations of note/1 to the example. We also populated the initial text area with a play/1 predicate that can play a sequence. There is then a query in the Prolog text that passes a list with Mary had a little Lamb notes.


Picture 6: Audio Sequencer with Default Music

The realization of the play/1 predicate makes use of the Dogelog sleep/1 command. This command will yield the Prolog engine for the given time. The Prolog engine will also automati-cally yield 60 times per second. The example seems to work in browsers such as Chrome and Edge, but for example Safari causes troubles in that it dims the audio.