Beat Box
by OXT-Beyond contributors
- Opens or saves files
- Runs JavaScript
Plays right here in your browser, boxed in: it cannot reach your files or your computer. How that works.
About this stack
A drum machine with sixteen steps. Click the squares to lay down a beat, press play, and change the tempo while it runs. The drums are made by the browser as it plays.
What this stack uses
- Opens or saves files. It keeps things in files. In your browser these stay inside the page and are gone when you close it.
- Runs JavaScript. It runs JavaScript in its own boxed-in page, for example to make sound.
For xTalk developers: how it is built
- Beat Box (Beat Box.oxtstack): 159 objects, 875 lines of script, with 1 substack
Opens or saves files
- card id 1002 (card 1), line 355
put specialFolderPath("documents") into tFolder - card id 1002 (card 1), line 357
put specialFolderPath("temporary") & "/oxt-beat-box" into tFolder - card id 1002 (card 1), line 359
if there is not a folder tFolder then create folder tFolder - card id 1002 (card 1), line 370
put tText into url ("file:" & bbSavePath()) - card id 1002 (card 1), line 375
put url ("file:" & bbSavePath()) into tText
Runs JavaScript
- card id 1002 (card 1), line 241
do bbEngineJs() as "JavaScript" - card id 1002 (card 1), line 264
do "oxtBeat.rows=[" & tRows & "];oxtBeat.mutes=[" & tMutes & "];oxtBeat.bpm=" & sBpm & ";" as "JavaScript" - card id 1002 (card 1), line 268
if bbReady() then do "oxtBeat.hit(" & pRow - 1 & ")" as "JavaScript" - card id 1002 (card 1), line 285
do "oxtBeat.start()" as "JavaScript" - card id 1002 (card 1), line 298
if sAudio is "ok" then do "oxtBeat.stop()" as "JavaScript" - card id 1002 (card 1), line 313
do "oxtBeat.now()" as "JavaScript"
The labels come from the checker, which reads every script without running any of it. Read all the scripts.
Open it in OXT-Beyond
- Download it (37 KB)
- Unzip the file you get.
- Open Beat Box.oxtstack in OXT-Beyond with File > Open Stack... and change anything you like.
A stack you open on your own computer is no longer boxed in: it can do what any program can. Open stacks only from people you trust, and read the scripts first.



