8X Soundboard / Just play samples, sounds and loops with 8 pads

This is something i always wanted to have as a VST but never could find it… maybe it’s too simple?!
A basic sample based audioplayer with 8 pads, where you can load a diffrent sound on each and then play it as one-shot triggered, loop repeating, play as long as you press the pad…
All of them should be able to play independently from the others in asynchronous manner.

So, when it doesn’t exist, it has to be made! :smiley:
To achive this goal i had to use eight separate Audio-Player plugin blocks, where the needed sound file will be loaded in the lane 1 of each player module (don’t use the other lanes!)

To open the respecting AudioFilePlayer (AFP) instance just click on the light blue text label
(it’s magic :sunglasses: :magic_wand:).
The rest should be quite self-explanatory… the “Trigger Pad” is the one which starts/stops the corresponding playhead and this widget is also the one that might be learned to a pad of a midi controller (i.e.).

The additional functions:
“RETRIGGER” : always start the sound from the beginning
“LATCH” : ON keeps the sound playing until end or until it’s stopped (trigger again), OFF the sound plays only as long as the trigger is pressed
“LOOP / ONESHOT” : Loop mode (sound is repeating over and over) or One Shot (sound will only play once)
There is also a small volume adjustment and a mut-option per module.

Oh… almost forgot to mention the Script behind the scenes:

var
phpos_afp1, phpos_afp2, phpos_afp3, phpos_afp4, phpos_afp5, phpos_afp6, phpos_afp7, phpos_afp8 : widget //playhead positions
status_afp1, status_afp2, status_afp3, status_afp4, status_afp5, status_afp6, status_afp7, status_afp8 : widget //textlabels as PLAY/STOP indicator
play_afp1, play_afp2, play_afp3, play_afp4, play_afp5, play_afp6, play_afp7, play_afp8 : widget //actual play widgets (hidden)

trigg_afp1, trigg_afp2, trigg_afp3, trigg_afp4, trigg_afp5, trigg_afp6, trigg_afp7, trigg_afp8 :widget // trigger widgets (only for script)
retrigg_afp1, retrigg_afp2, retrigg_afp3, retrigg_afp4, retrigg_afp5, retrigg_afp6, retrigg_afp7, retrigg_afp8 : widget //retrigger-mode
loop_os_afp1, loop_os_afp2, loop_os_afp3, loop_os_afp4, loop_os_afp5, loop_os_afp6, loop_os_afp7, loop_os_afp8 : widget //loop or one-shot mode (after start run/repeat until trigger release)
latch_afp1, latch_afp2, latch_afp3, latch_afp4, latch_afp5, latch_afp6, latch_afp7, latch_afp8 : widget //latching mode (keep playing until retrigger/stop or end)

manustop_afp1, manustop_afp2, manustop_afp3, manustop_afp4, manustop_afp5, manustop_afp6, manustop_afp7, manustop_afp8 : boolean = false //internal manual stop indicator

//array definitions for alll the above
ph_positions : widget Array = [phpos_afp1, phpos_afp2, phpos_afp3, phpos_afp4, phpos_afp5, phpos_afp6, phpos_afp7, phpos_afp8]
status_labels : widget Array = [status_afp1, status_afp2, status_afp3, status_afp4, status_afp5, status_afp6, status_afp7, status_afp8]
play_buttons : widget Array = [play_afp1, play_afp2, play_afp3, play_afp4, play_afp5, play_afp6, play_afp7, play_afp8]

trigger_pads : widget Array = [trigg_afp1, trigg_afp2, trigg_afp3, trigg_afp4, trigg_afp5, trigg_afp6, trigg_afp7, trigg_afp8]
retrigger_switches : widget Array = [retrigg_afp1, retrigg_afp2, retrigg_afp3, retrigg_afp4, retrigg_afp5, retrigg_afp6, retrigg_afp7, retrigg_afp8]
loop_switches : widget Array = [loop_os_afp1, loop_os_afp2, loop_os_afp3, loop_os_afp4, loop_os_afp5, loop_os_afp6, loop_os_afp7, loop_os_afp8]
latch_buttons : widget Array = [latch_afp1, latch_afp2, latch_afp3, latch_afp4, latch_afp5, latch_afp6, latch_afp7, latch_afp8]

manustops : Boolean Array = [manustop_afp1, manustop_afp2, manustop_afp3, manustop_afp4, manustop_afp5, manustop_afp6, manustop_afp7, manustop_afp8]

color_green : integer = -16729569 //color setting for "green"
color_red  : integer = -4568320 // color setting for "red"


Initialization
var index : integer
    For index =0; index <Size(manustops); index = index +1 Do
        manustops[index] = false //set all manustops to false
    End
End

Function setPlayStatus (index : integer, PlayStatus : boolean)
    If PlayStatus == true then
        SetWidgetValue (play_buttons[index], 1.0)
        SetWidgetFillColor(status_labels[index], color_green)
        SetWidgetLabel (status_labels[index], "PLAYING!")
    Else
        SetWidgetValue (play_buttons[index], 0.0)
        SetWidgetFillColor(status_labels[index], color_red)
        SetWidgetLabel (status_labels[index], "STOPPED!")
    End
    
    If GetWidgetValue(trigger_pads[index]) > 0.9 and GetWidgetValue(retrigger_switches[index]) > 0.9 Then
        SetWidgetValue (ph_positions[index], 0.0)
    End
End

On WidgetValueChanged (w : widget, index : integer, padval : double) from trigg_afp1, trigg_afp2, trigg_afp3, trigg_afp4, trigg_afp5, trigg_afp6, trigg_afp7, trigg_afp8
    Select
    padval >0.9 and GetWidgetValue (play_buttons[index]) <0.1 and manustops[index] == false do 
    setPlayStatus (index, true)
            
    padval >0.9 and GetWidgetValue (play_buttons[index]) >0.9 and GetWidgetValue (latch_buttons[index]) >0.9 and manustops[index] == false do 
    manustops[index] = true
    setPlayStatus (index, false)
    
    padval < 0.1 and GetWidgetValue (latch_buttons[index]) > 0.9 and manustops[index] == true do
    manustops[index] = false
            
    padval < 0.1 and GetWidgetValue (latch_buttons[index]) < 0.1 do
    setPlayStatus (index, false)

   //Optionally include this for when none of the above matched
   //True do statements
    End
End

On WidgetValueChanged (w : widget, index : integer, bval : double) from play_afp1, play_afp2, play_afp3, play_afp4, play_afp5, play_afp6, play_afp7, play_afp8 
//if playhead stops, set everything to stop
    If bval <0.1 Then
        setPlayStatus (index, false)
    End
End



8xAFP_Soundboard_V1.2.gig (1.4 MB)

EDIT 2023/03/09:
NEW VERSION V1.2 - fixed option to “pause” a player by switching of “Retrigger” switch!
PLEASE RELOAD THE GIG FILE!

Now, go and play with this fine toy! :nerd_face: :grin: :beers:
…hope you like it.
Cheers!
Erik

12 Likes

Thanks for sharing @schamass :wink: AFP keeps on giving good ideas!

I got this error from script log (trigger AFP 8)
and afterwards no other AFP plays ;-(

8X Soundboard (Rackspace) - Array index out of bounds: index (zero-based) = 7: Current array length = 7
1 Like

Thanks for the nice words. :slight_smile: When i’m at home again, i will have a look at this… though i thought i tried everything for proper function i may have missed something (it was late).

1 Like

I just had a look at the source code and it’s most obvious that this line is short by one array member!
Just add a ‘phpos_afp8’ at the end of the array, recompile the script and it should work (hopefully).

1 Like

and… had to add this also:

var
phpos_afp1, phpos_afp2, phpos_afp3, phpos_afp4, phpos_afp5, phpos_afp6, phpos_afp7, phpos_afp8: widget //playhead positions

It compiles, but does not play ;-(
Take your time; you will make it work.

1 Like

OK, the gig file should be working now properly (at least module #8).

I have uploaded a new file in the first post.

The issues were: A missing variable, and a faulty widget/parameter assignment.

@schamass …Thanks…this is great and very useful!

1 Like

hello, i’ve been testing this player cause it’s really perfect for the coverband i’m in and i used a lot of little samples in the songs we do
but now i was trying to link the trigger pad to my akai LPD 8 controller and i can only start the player with the pad on the akai one time and than the triggerlight keeps lightning and it only stop the player when i move over the triggerpad with my mouse
what i’m doing wrong ?

thanks in advance for the help
erwin

I guess, your controller’s buttons might be configured as “latching” - means you have to press them to go ON and press again to go OFF, while the widgets expect a “momentary” pulse (press=ON/release=OFF).
Best try to configure your controller as “momentary” if possible.

@schamass no i have an editor for the akai and i’ll tried every possible config so the pad is set up as momentery, but i’ll try it with note on, or with a cc control i’ll even try it with a keyboard on a single note but nothing works to trigger it when you hold it and stops when you release it
i really have no clue

Besides AKAI’s configuration, also experiment with the Widget Properties Inspector:

1 Like

i don’t really undestand what’s wrong,normally i used the TX16W sampler vst and everything works fine with the akai controller but this audioplayer rack have a much better overview so thats why i wanted to use it , but i’ll gonna try to fix it

well after a good night sleep and some work i’ll finally got the player working how i wanted it
so @schamass thanks for the great player you build .
and thanks for all the support everybody in this great forum

3 Likes

Great you made it! :metal:
Would you mind to tell us what the problem was?
Maybe other users might encounter a similar issue and will then profit from your experience…

1 Like

the main problem was the velocity of the akai pads, you have to hit them really hard to trigger the sampleplayer and with my TX16W vst i didn’t had this problem so everytime i hit the pad with normal pressure it only starts playing the whole sample…
strange problem but luckily it works fine now

1 Like

I’m still struggeling a bit … i use the sounboard in all of my songs i’ve made but i’ve got now around 12 songs and in idle the cpu is already at 35%
i only use in every song 2 blocks of zenology and the soundboard, is there maybe a possibility to put the soundboard in the global rackspace to save some cpu ?

Sure, just do it… :wink:
It’s just that you will be limited to only eight sound files.
Export that rackspace, then switch over to the global rackspace and re-import it there.

thank that will be great, and i’ll use 8 sampels at max on a song
there’s only one :sweat_smile: with 8 parts and that’s the child choir on another brick

Hi
I will this work in global rackspace?
Gpsays script is only for local rackspace
Cheers

I don’t see any reason why this shouldn’t work…
What exactly did you do (step by step, if possible) and was exactly happened (error messages, etc.)?