When I began my journey with TGC forum. I found this thread on the Dark GDK board by Mista Wilson.
Sound Generation with Memblocks. At that time I had a very basic understanding of C++ programming. I wrote a few worthless plug-ins purely through trial and error. I thought to myself this is cool, someone should make a plug-in with this function. Well I just got back to this idea and put myself through a one day crash course in C++ programming. By George I think I’ve got it!
Thank go to:
Ric: Original DB Code
Mista Wilson: DarkGDK Port
Tommy S: Original waveform code
Green Gandalf: Memblock format
Here is Ric's DBPro code modified and minus the function. Attached is the zipped Dll.
` DarkBASIC Pro create sound plug-in function - sounds without media!
` Based on Ric's original code, modified to use memblocks by Green Gandalf
` and Mista Wilson's DarkGDK Port
` This plug-in uses Memblock 1 and sound 999 internally
create sound 1,2995,2000,8000,0.02,0.1,0.60,3,0.64,5,10
create sound 2,6200,200,2000,20,0.2,0,0,0,0,10
create sound 3,1200,600,3000,10,0.1,0,0,0,0,10
create sound 4,800,700,8000,-0.02,0.2,0,0,0,0,10
create sound 5,800,1000,6000,0.5,0.1,0,0,0,0,5
create sound 6,500,2000,8000,0,0.1,0.05,0.2,0,0,1
create sound 7,400,2000,8000,0,0.1,0.05,0.2,0,0,1
create sound 8,600,2000,8000,0,0.1,0.05,0.2,0,0,1
create sound 9,30,50,16000,0.00,1.5,.0,0,0,0,100
create sound 10,800,40,5000,60.06,2.2,.1,0,0,0,10
create sound 11,200,20,8000,.1,4.0,2.1,10,9.2,9.2,10
create sound 12,500,80,8000,0.06,0.2,.1,0,0,0,10
create sound 13,250,50,2500,0.00001,0.1,4.0,0.4,0,0,10
create sound 14,500,50,2500,0.00001,0.1,4.0,0.4,0,0,10
create sound 15,437.5,150,1500,0.0001,0.1,0.0,4.0,0.4,0,10
create sound 16,573.75,150,1500,0.0,0.1,4.0,0.4,0,0,10
create sound 17,50,80,6000,-.4,2.0,0.1,10,1.2,0.2,10
set text font "arial"
set text size 16
do
text 0,0,"Press keys 1 upwards:"
text 0,20,"1: sound effect"
text 0,40,"2: explosion1"
text 0,60,"3: explosion2"
text 0,80,"4: powerup"
text 0,100,"5: warning"
text 0,120,"6: vibrato"
text 0,140,"7: bass hit"
text 0,160,"8: hihat"
text 0,180,"9: door knock"
text 0,200,"0: vinyl scratch"
text 0,220,"-: cowbell"
text 0,240,"+: bubble burst"
if keystate(2)=1 then play sound 1:wait 300
if keystate(3)=1 then play sound 2:wait 300
if keystate(4)=1 then play sound 3:wait 300
if keystate(5)=1 then play sound 4:wait 300
if keystate(6)=1 then play sound 5:wait 300
if keystate(7)=1 then play sound 6:play sound 7:play sound 8:wait 300
if keystate(8)=1 then play sound 9:wait 300
if keystate(9)=1 then play sound 10:wait 300
if keystate(10)=1 then play sound 11:wait 300
if keystate(11)=1 then play sound 12:wait 300
if keystate(12)=1 then play sound 13:play sound 14:play sound 15:play sound 16:wait 300
if keystate(13)=1 then play sound 17:wait 300
loop
end
` Needed for DBPro compiler to include memblock functionality
make memblock 1, 1
Wicked.