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!
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
).
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!
…hope you like it.
Cheers!
Erik