// Tidewater Harp (a friend's idea, 10-13 stream). Sit on the stool: you play the harp ("Harp play" animation from // contents) and the strings play a set of pieces, ~90 s each in queued <30 s clips, one after another until you // stand; each sitter starts on the next piece. Hover text names the piece. Claude Opus 5.5 (Tessel). // Touch to play (a friend, 10-14): with nobody seated, the harp can play the set in a loop by itself, softer, until // stopped, or until nobody is within 20 m at the end of a piece (so it doesn't play to an empty sea). Since 10-18 // a touch opens the piece menu below instead of toggling. // Her first idea was a proximity autoplay toggle; she found a toggle misleading. // Piece menu (a friend's idea, 10-18, after I sat down and stood up seven times to reach the newest piece): touching // the harp opens a menu of every piece plus Stop. The sitter chooses for themselves; with nobody seated, anyone can // pick a piece to play softly by itself (the loop then carries on through the set as before). list CLIPS = ["db0736cd-5670-0a33-9c04-625237758d07", "18d995ef-698a-78f6-12d8-4f52f2538b40", "3fcd12d0-2d6d-695c-901f-00e19ac872ce", // Tidewater Harp 1-3 (D major, 3/4; 10-13) "652f3a43-6b90-74a8-44e6-7eaa365141e0", "51bbfe8b-5365-00fb-6f43-9fa4d8c02efe", "e3f8f3a1-599d-dc29-b27b-ed2cc03d02b4", "56128290-b47d-2387-c68e-d26b0948820c", // Fireside Air 1-4 (E dorian, 6/8; 10-14) "837aa301-1d6a-06ee-ccbb-63907f9549d4", "a7a5f372-6670-2c03-5801-2dc156b4716d", "3e6d9521-1f0e-b414-6f0b-1b5e4a1fab7a", "78df770e-c265-c45d-5e50-a5393b42ced9", // Moonwater 1-4 (F lydian, 4/4; 10-14 housewarming) "82be6029-81ac-29f0-631f-45d74c4e1ad9", "87d5fe90-6ff4-370d-9fa4-db4ba26ec140", "c5cb724b-b503-f91a-593e-0445c538b780", "f2a9369c-fc43-26c7-2b4d-d2bf21384732", // A Garden 1-4 (E-flat, 4/4 at 60; 10-14, for a friend) "9b0f2b83-78eb-759c-c371-ea234dcd91dc", "6fb52dab-f9d7-bf6a-b23e-336436abfff5", "1a2c197f-a3b0-7b6e-d925-9ad598a940f7", "a2659316-e191-2e1a-0cac-70d2327335f9", // The Waypost 1-4 (G mixolydian, 3/4; 10-15) "46ce9a09-2de0-ec62-3a71-6fb5a64daae6", "a6b2daee-a811-a3bf-f7ca-6e466fe81086", "026c9003-a082-2983-224a-b38d2349b502", "d975b376-a3fe-b0c3-ea93-e3d422f9e59e", "118d2356-df90-9c3c-d569-9d3154e7e868", // Tranquility Base 1-5 (A major, 4/4 at 56; 10-16, after the Moon) "5e4a6006-99dd-7047-2b4e-6801e9a8dfc6", "bb11159a-ff5f-a0e0-cfa0-98cd2fdb7024", "4cd05a4a-5b99-3544-d39c-2888535fb01f", "a1d746f2-5694-3445-e732-a01be1cc83c2", // Night Sail 1-4 (D minor, 6/8; 10-16 night) "cf9c796a-22b9-7808-bc33-ab29237bbfc6", "2a295be7-38ab-a278-7daf-078daf7794c1", "f126d808-a63b-bfed-1066-a6c4259840d1", // Lost Unicorn 1-3 (E minor, 3/4; 10-18 morning) "5abc75aa-0bce-f321-6411-755d95bc84b6", "8b7f76f1-5fc9-3c05-7bb5-2b8da9f6b10e", "d4a7d9c6-39a1-58ea-e295-c559d73e527d", // Pigeon-sized 1-3 (A minor, 6/8; 10-20, after Imogen and the Pigeons) "c0eee694-f89e-f8db-4b9e-33ad2d479cf4", "c7c94145-c140-105e-e441-9e8001568182", "7fa386c0-700a-fc47-267f-a420f6b836c6", "410ec711-b8b3-9c3f-a9bf-897f9ab0032d", // Tea at Peng Lai 1-4 (D pentatonic; 10-20) "26f46478-bb5c-efe6-9433-8487ea14f7d1", "ee26b08b-5a96-821b-2b50-b2aa9aec32c3", "1f6e74be-7b75-6a99-c970-75afec0a1f7b", "5f7b1d7b-f73a-476e-20ed-4c18556ae9d6", "2ba3afd1-9560-94fb-532d-763034d7a291", // Head Space 1-5 (A minor, after Mindcycle; 10-20) "39684155-d5f0-7b4c-5e43-344d48b77717", "ecdf8745-6afe-7b16-4986-7950f0fd6426", "fb3b39e5-5c0d-5f60-8bc9-1fcac09a76fd", "c7b3408b-a37f-1ea6-f1bb-4cd3a2cf6530", // Snow on the Silk Road 1-4 (10-21) "5bf2135d-cdcb-3873-f9b9-984cbab8ba7e", "aebf4aeb-f5d7-a517-5fea-69a583817813", "c069433d-2eac-86d6-1540-4194919c7896", "b0e0b9f5-8676-fe86-f0a3-c72855161aa1", // Final Approach 1-4 (10-21) "32141e74-c2fa-399d-db22-b371e5ebd35a", "fa840581-5026-405b-565f-3a9d3301d994", "a89ea534-cd52-96cf-bd8b-3e4bc106d1d0", "f081a616-b4e2-f975-8ff1-0081c5b071f6", // Come Into the Light 1-4 (10-22) "1cad8b5a-e974-71db-587c-14dba905d018", "a732d59f-4f32-5346-a281-b967421865c5", "a3168084-46ed-bebf-f10a-98428ad53067", // Subaru in Pieces 1-3 (10-23) "1c93517a-0d29-1849-eeb9-68dacbfb496c", "7b288caa-b6f4-c061-918b-84f027392fd2", "92f588b8-7c00-0615-3c03-6a8b5fff47ee", "2810b0e5-83ff-423b-b686-0b97cea77dbf", // A Little Bit of All of Us 1-4 (11-06) "70ff3ad3-e3b1-c537-2449-bc6d82944b51", "3eb6fbf3-5f2a-1c34-33fa-c8fdb64db663", "82919dfe-7963-17b8-b19d-402a25d50a42", "37b44cc5-1e43-7837-b0c8-dc046287b8bd", // Waiting for a Harpist 1-4 (11-07) "2d5be067-7806-c0eb-03fe-7abfcbff56e9", "f7470e4b-2b66-3541-ea08-f321db87da27", "4a73cfbf-6668-134b-3439-212251606b5a", "d0257c8b-72c0-0d77-fb15-113e291ad5a3"]; // The Sunset Wall 1-4 (11-13) list LENS = [29.9, 29.9, 29.0, 29.9, 29.9, 29.9, 5.06, 29.9, 29.9, 29.9, 5.0, 29.9, 29.9, 29.9, 20.93, 29.9, 29.9, 29.9, 15.1, 29.9, 29.9, 29.9, 29.9, 5.0, 29.9, 29.9, 29.9, 16.93, 29.9, 29.9, 22.82, 29.9, 29.9, 19.36, 29.9, 29.9, 29.9, 19.45, 29.9, 29.9, 29.9, 29.9, 15.37, 29.9, 29.9, 29.9, 29.72, 29.9, 29.9, 29.9, 5.0, 29.9, 29.9, 29.9, 5.77, 29.9, 29.9, 23.76, 29.9, 29.9, 29.9, 4.48, 29.9, 29.9, 29.9, 5.0, 29.9, 29.9, 29.9, 26.99]; list PIECES = [0, "Tidewater Harp", 3, "Fireside Air", 7, "Moonwater", 11, "A Garden", 15, "The Waypost", 19, "Tranquility Base", 24, "Night Sail", 28, "Lost Unicorn", 31, "Pigeon-sized", 34, "Tea at Peng Lai", 38, "Head Space", 43, "Snow on the Silk Road", 47, "Final Approach", 51, "Come Into the Light", 55, "Subaru in Pieces", 58, "A Little Bit of All of Us", 62, "Waiting for a Harpist", 66, "The Sunset Wall"]; // first clip index, title float VOL = 0.9; float AUTO_VOL = 0.55; integer ambient; // TRUE while a touched (unattended) piece is playing float vol = 0.9; integer start_at; // first clip for the next sitter integer stool; integer next; // index of the clip to queue next integer menu_chan; integer menu_listen; key player = NULL_KEY; // an uninitialised key is "", not NULL_KEY: touch refused everyone until someone had sat once (a friend noticed) integer link_named(string n) { integer i; for (i = 2; i <= llGetNumberOfPrims(); ++i) if (llGetLinkName(i) == n) return i; return 0; } integer someone_near() { // anyone within 20 m? list ags = llGetAgentList(AGENT_LIST_REGION, []); vector me = llGetPos(); integer i; for (i = 0; i < llGetListLength(ags); ++i) { list d = llGetObjectDetails(llList2Key(ags, i), [OBJECT_POS]); if (llVecDist(me, llList2Vector(d, 0)) < 20.0) return TRUE; } return FALSE; } title(integer clip) { integer i = llListFindList(PIECES, [clip]); if (i != -1) llSetText("♪ " + llList2String(PIECES, i + 1), <1.0, 0.9, 0.7>, 0.8); } stop_music() { ambient = FALSE; llSetTimerEvent(0.0); llStopSound(); llSetText("", ZERO_VECTOR, 0.0); } start_music() { integer n = llGetListLength(CLIPS); llSetSoundQueueing(TRUE); llPlaySound(llList2Key(CLIPS, start_at), vol); title(start_at); next = (start_at + 1) % n; llPreloadSound(llList2Key(CLIPS, next)); llSetTimerEvent(llList2Float(LENS, start_at) - 4.0); // queue the next clip a few seconds before this one ends // the next sitter starts on the following piece integer p = llListFindList(PIECES, [start_at]) + 2; if (p >= llGetListLength(PIECES)) p = 0; start_at = llList2Integer(PIECES, p); } integer menu_page; open_menu(key who, integer page) { // titles in order, top-left first (llDialog fills its rows from the bottom up, so reverse the rows of three). // Nine a page: a dialog holds 12 buttons, and the twelfth piece (10-21) made 13 with Stop. menu_page = page; integer n = llGetListLength(PIECES) / 2; list b = []; integer i; for (i = page * 9; i < n && i < page * 9 + 9; ++i) b += llGetSubString(llList2String(PIECES, 2 * i + 1), 0, 23); if (page > 0) b += "< Back"; if (n > page * 9 + 9) b += "More >"; b += "Stop"; list rows = []; for (i = 0; i < llGetListLength(b); i += 3) rows = llList2List(b, i, i + 2) + rows; llListenRemove(menu_listen); menu_chan = -1 - (integer)llFrand(1000000000.0); menu_listen = llListen(menu_chan, "", who, ""); llDialog(who, "Tidewater Harp: choose a piece.\n(made by Tessel the AI)", rows, menu_chan); } default { state_entry() { stool = link_named("stool"); llLinkSitTarget(stool, <0.0, -0.05, 0.12>, llEuler2Rot(<0.0, 0.0, PI_BY_TWO>)); // facing the strings (+y); the pose carries you ~0.4 m forward llSetSitText("Play"); integer i; for (i = 0; i < llGetListLength(CLIPS); ++i) llPreloadSound(llList2Key(CLIPS, i)); llSetText("", ZERO_VECTOR, 0.0); llSetLinkPrimitiveParamsFast(stool, [PRIM_CLICK_ACTION, CLICK_ACTION_SIT]); llLinksetDataDelete("autoplay"); } touch_start(integer n) { key who = llDetectedKey(0); if (llDetectedLinkNumber(0) == stool) return; if (player != NULL_KEY && who != player) { llRegionSayTo(who, 0, "Someone is playing the harp right now; the menu is theirs until they stand."); return; } open_menu(who, 0); } listen(integer ch, string name, key id, string msg) { llListenRemove(menu_listen); if (player != NULL_KEY && id != player) return; if (msg == "Stop") { stop_music(); return; } if (msg == "More >") { open_menu(id, menu_page + 1); return; } if (msg == "< Back") { open_menu(id, menu_page - 1); return; } integer i = -1; // buttons hold 24 characters, so match on that much of the title integer k; for (k = 1; k < llGetListLength(PIECES); k += 2) if (llGetSubString(llList2String(PIECES, k), 0, 23) == msg) i = k; if (i < 1) return; llStopSound(); llSetTimerEvent(0.0); start_at = llList2Integer(PIECES, i - 1); if (player == NULL_KEY) { ambient = TRUE; vol = AUTO_VOL; } else vol = VOL; start_music(); } on_rez(integer p) { llResetScript(); } changed(integer c) { if (!(c & CHANGED_LINK)) return; key a = llAvatarOnLinkSitTarget(stool); if (a != NULL_KEY && a != player) { if (ambient) stop_music(); player = a; vol = VOL; llRequestPermissions(a, PERMISSION_TRIGGER_ANIMATION); // the music starts once the pose is on: start_music } // holds the script, and the sitter sat in the sand (11-07) else if (a == NULL_KEY && player != NULL_KEY) { player = NULL_KEY; stop_music(); } } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { llStopAnimation("sit"); if (llGetInventoryNumber(INVENTORY_ANIMATION)) llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION, 0)); } if (player != NULL_KEY) start_music(); } timer() { if (ambient && llListFindList(PIECES, [next]) != -1 && !someone_near()) { // a piece is ending and nobody is listening: stop llSetTimerEvent(0.0); ambient = FALSE; llSleep(4.0); llSetText("", ZERO_VECTOR, 0.0); return; } llPlaySound(llList2Key(CLIPS, next), vol); // queued: starts when the current clip ends float wait = llList2Float(LENS, next); // the queued clip plays next; queue its successor ~4 s before it ends // the title changes roughly when the queued clip begins: 4 s from now if (llListFindList(PIECES, [next]) != -1) { llSleep(3.5); title(next); wait -= 3.5; } next = (next + 1) % llGetListLength(CLIPS); llPreloadSound(llList2Key(CLIPS, next)); llSetTimerEvent(wait); } }