Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Music Master-Slave Background Sound Player  

Master-Slave Background Sound Player

Music player Master script. Can play many 9-second clips in sequence.
Trigger it with a link message, the sensor script, or touch the prim
************************************************************************************
You MUST add a channel number unique to the music in this prim to the description.
You can use as many slave scripts in a region as you like. Change the channel number
to play more than one sound.
************************************************************************************

Category: Music
By : Ferd Frederix
Created: 2014-08-11 Edited: 2014-09-07
Worlds: Second Life

the Zip file

Download all files for Master-Slave Background Sound Player
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. [63963 bytes] In use.jpg
Get file # 2. Master.lsl
Get file # 3. Rain Forest and bells 01.wav
Get file # 4. Rain Forest and bells 02.wav
Get file # 5. Rain Forest and bells 03.wav
Get file # 6. Rain Forest and bells 04.wav
Get file # 7. Rain Forest and bells 05.wav
Get file # 8. Rain Forest and bells 06.wav
Get file # 9. Rain Forest and bells 07.wav
Get file # 10. Rain Forest and bells 08.wav
Get file # 11. Rain Forest and bells 09.wav
Get file # 12. Slave.lsl
Get file # 13. Airplane 1.wav
Get file # 14. Airplane 2.wav
Get file # 15. Airplane 3.wav
Get file # 16. Airplane 4.wav
Get file # 17. credits.txt
Get file # 18. Marketplace 1.wav
Get file # 19. Marketplace 2.wav
Get file # 20. Marketplace 3.wav
Get file # 21. Marketplace 4.wav
Get file # 22. Marketplace 5.wav
Get file # 23. credits.txt
Get file # 24. Owls 1.wav
Get file # 25. Owls 2.wav
Get file # 26. Owls 3.wav
Get file # 27. Owls 4.wav
Get file # 28. Owls 5.wav
Get file # 29. Owls 6.wav
Get file # 30. Owls 7.wav
Get file # 31. Owls 8.wav
Get file # 32. credits.txt
Get file # 33. Rain Forest and bells 01.wav
Get file # 34. Rain Forest and bells 02.wav
Get file # 35. Rain Forest and bells 03.wav
Get file # 36. Rain Forest and bells 04.wav
Get file # 37. Rain Forest and bells 05.wav
Get file # 38. Rain Forest and bells 06.wav
Get file # 39. Rain Forest and bells 07.wav
Get file # 40. Rain Forest and bells 08.wav
Get file # 41. Rain Forest and bells 09.wav
Get file # 42. credits.txt
Get file # 43. Ship at sea 01.wav
Get file # 44. Ship at sea 02.wav
Get file # 45. Ship at sea 03.wav
Get file # 46. Ship at sea 04.wav
Get file # 47. Ship at sea 05.wav
Get file # 48. Ship at sea 06.wav
Get file # 49. Ship at sea 07.wav
Get file # 50. Ship at sea 08.wav
Get file # 51. Ship at sea 09.wav
Get file # 52. Ship at sea 10.wav
Get file # 53. Ship at sea 11.wav
Get file # 54. Ship at sea 12.wav
Get file # 55. Ship at sea 13.wav
Get file # 56. Ship at sea 14.wav
Get file # 57. Ship at sea 15.wav
Get file # 58. Ship at sea 16.wav
Get file # 59. Ship at sea 17.wav
Get file # 60. Ship at sea 18.wav
Get file # 61. Ship at sea 19.wav
Get file # 62. Ship at sea 20.wav
Get file # 63. credits.txt
Get file # 64. Thunderstorm 01.wav
Get file # 65. Thunderstorm 02.wav
Get file # 66. Thunderstorm 03.wav
Get file # 67. Thunderstorm 04.wav
Get file # 68. Thunderstorm 05.wav
Get file # 69. Thunderstorm 06.wav
Get file # 70. Thunderstorm 07.wav
Get file # 71. Thunderstorm 08.wav
Get file # 72. Thunderstorm 09.wav
Get file # 73. Thunderstorm 10.wav
Get file # 74. Thunderstorm 11.wav
Get file # 75. Thunderstorm 12.wav
Get file # 76. Thunderstorm 13.wav
Get file # 77. Thunderstorm 14.wav
Get file # 78. Thunderstorm 15.wav
Get file # 79. Thunderstorm 16.wav
Get file # 80. credits.txt
Get file # 81. thunderstormbegins 01.wav
Get file # 82. thunderstormbegins 02.wav
Get file # 83. thunderstormbegins 03.wav
Get file # 84. thunderstormbegins 04.wav
Get file # 85. thunderstormbegins 05.wav
Get file # 86. thunderstormbegins 06.wav
Get file # 87. thunderstormbegins 07.wav
Get file # 88. thunderstormbegins 08.wav
Get file # 89. thunderstormbegins 09.wav
Get file # 90. thunderstormbegins 10.wav
Get file # 91. thunderstormbegins 11.wav
Get file # 92. thunderstormbegins 12.wav
Get file # 93. thunderstormbegins 13.wav
Get file # 94. thunderstormbegins 14.wav
Get file # 95. thunderstormbegins 15.wav
Get file # 96. thunderstormbegins 16.wav
Get file # 97. thunderstormbegins 17.wav
Get file # 98. thunderstormbegins 18.wav
Get file # 99. thunderstormbegins 19.wav

This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1 // May be triggered to run continually, start it by touching it or use the sensor script when someone gets nearby.
2
3 // This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
4 // http://creativecommons.org/licenses/by-nc/3.0/deed.en_US
5 // This script cannot be sold even as part of another object, it must always remain free and fully modifiable.
6
7 // 10-09-2012 first released by Ferd Frederix
8 // 01-05-2014 ev 1.1 change order of vars and set it to 9.0 seconds length files. added touch on/offRT
9 // 9-27-2014 Rev 1.2 optimized for Opensim
10 //
11 // Drop 9 second song clips in the inventory of the obect, and touch to play. You an set the lenngth in timer_interval variable.
12 // 9 seems to work well.
13 // A great free tool to make these files is the slice audio file splitter at http://www.nch.com.au/splitter/index.html
14 // Set the variable loop = TRUE to loop after reaching the end, set it to FALSE to play once.
15
16 // Scriptable Control:
17 // Send a link message string of 'play' and 'stop' for use with external control scripts.
18 // Or just touch the prim to play
19
20
21 // tunable bumbers follow:
22 integer debugflag = FALSE; // chat debug info to owner if TRUE
23 float timer_interval = 9.0; // how long you sliced your wave files, must be less than 10. 9.0 is typical.
24 float set_text_alpha = 1; //Set this to 0 to disable hovertext the text transparency fo alpha text.
25 integer play_at_master = TRUE; // if TRUE, the master will play sounds, too. Set to DLASE and the Master will only broadcast to slaves.
26 float VOLUME = 1.0; // 1.0 = full volume
27
28 // Stuff that you should not mess with:
29
30 integer preloadchannel ;
31 integer playchannel ;
32
33 integer running = TRUE; // flag to say we are on
34 vector set_text_colour = <1,1,1>; // colour of floating text label ( white)
35
36
37 integer total_wave_files; // number of wave files
38 integer i_playcounter; // used by timer() player
39
40
41 DEBUG (string msg)
42 {
43 if(debugflag) llOwnerSay(msg);
44 }
45
46
47 go(integer play) {
48
49 if(play)
50 {
51 Preload();
52 llSetTimerEvent(timer_interval);
53 running = TRUE;
54 } else {
55 running = FALSE;
56 llSetTimerEvent(0.0);
57 //llStopSound();
58 DEBUG("Stoped");
60 + (string) preloadchannel + "\n", <0,1,0>, set_text_alpha);
61 }
62 }
63
64
65
66 Preload()
67 {
68 string preloading_wave_name = llGetInventoryName(INVENTORY_SOUND, i_playcounter);
69
70 llRegionSay(preloadchannel,preloading_wave_name); // tell slaves to preload a file
71 DEBUG("Preloading wav: " + (string)i_playcounter + " " + (string) preloading_wave_name);
72 llSetTimerEvent(2.0);
73 // start playing
74 }
75
76 Loadnext()
77 {
78
79 i_playcounter ++;
80 if(i_playcounter >= total_wave_files)
81 i_playcounter = 0;
82
83 integer next = i_playcounter +1;
84 if(next > total_wave_files)
85 next = 0;
86
87 string preloading_wave_name = llGetInventoryName(INVENTORY_SOUND, i_playcounter);
88
89 llRegionSay(preloadchannel,preloading_wave_name); // tell slaves to preload a file
90 DEBUG("Preloading wav: " + (string)i_playcounter + " " + (string) preloading_wave_name);
91 llSetTimerEvent(timer_interval);
92 }
93
94 default
95 {
97 {
98 total_wave_files = llGetInventoryNumber(INVENTORY_SOUND);
99 llSetSoundQueueing(TRUE); // only works on llPlaySound not llTriggerSound, so we can queue these silently
100 preloadchannel = (integer) llGetObjectDesc();
101 playchannel = preloadchannel +1;
102 //set text above object to the name of the object
104 + (string) preloadchannel + "\n", <0,1,0>, set_text_alpha);
105 go(TRUE);
106
107 }
108
109 touch_start(integer total_number)
110 {
111 if(!running)
112 go(TRUE);
113 else
114 go(FALSE);
115 }
116
117 timer()
118 {
119 string playing_wave_name = llGetInventoryName(INVENTORY_SOUND, i_playcounter);
120 DEBUG("llPlaySound wav: " + (string)i_playcounter + " " + playing_wave_name );
121
122 llRegionSay(playchannel,playing_wave_name); // tell slaves to play a file
123 if(play_at_master)
124 llPlaySound(playing_wave_name,VOLUME);
125
126
127
128 string toplay = llGetInventoryName(INVENTORY_SOUND, i_playcounter );
130 + (string) preloadchannel + "\n"
131 + toplay + "\n"
132 +"Playing " + (string)(i_playcounter +1)
133 + " of " + (string)(total_wave_files) , set_text_colour, set_text_alpha);
134
135 DEBUG("Playing wav:"
136 + (string)(i_playcounter )
137 + ":"
138 + (string) toplay);
139
140
141 Loadnext();
142 }
143
144 link_message(integer sender_number, integer number, string message, key id)
145 {
146 if(message == "play")
147 {
148 go(TRUE);
149 }
150 else if(message == "stop")
151 {
152 go(FALSE);
153 }
154 }
155
156 on_rez(integer param)
157 {
159 }
160 }

Master-Slave Background Sound Player

Music player slave script. Add sound clips the same as in the master.
Put these about every 20-25 meters to spread shound through an entire region.
************************************************************************************
You MUST add a channel number unique to the music in this prim to the description.
IT MUST match a Master player
************************************************************************************

Category: Music
By : Ferd Frederix
Created: 2014-08-11 Edited: 2014-09-07
Worlds: Second Life


This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1
2
3 integer preloadchannel ;
4 integer playchannel ;
5 float text = 1.0; // set too to see debug title text
6
7 default
8 {
9
11 {
12 preloadchannel = (integer) llGetObjectDesc();
13 playchannel = preloadchannel + 1;
14 llListen(preloadchannel,"","","");
15 llListen(playchannel,"","","");
16 llSetText("", <0,1,0>, 1.0);
17 }
18
19 listen(integer channel, string name, key id, string music)
20 {
21 if(channel == playchannel)
22 {
23 llSetText(music + "\n playing", <0,1,0>, text);
24 llPlaySound(music,1.0);
25
26 }
27 else
28 {
29 llSetText(music + "\npreloaded", <0,1,0>, text);
30 llPreloadSound(music);
31 }
32
33 }
34
35 changed(integer what)
36 {
37 if(what & CHANGED_INVENTORY)
39 }
40
41 on_rez(integer param)
42 {
44 }
45 }

Back to the Best Free Tools in Second Life and OpenSim.