Hello! I wanna know if there's a way to check if an specific sound in a sample library is currently playing through the SamplePlayer, like checking by name.
In my project (a musical instrument game), my goal is to play a note if it's not already playing, and checking if a voice is active (SamplePlayer.isvoiceactive) is not a solution, since the index can change because of the polyphonic nature of the instrument.
The instrument have samples named according to its midi number (A1 = 045, E7 = 112, etc), just for you to know what will be inside the notes_playing array.
Here's my current code:
var notes_playing = 
var sample_player = self.get_node("sample_player")
# If there's notes playing
if notes_playing != :
# Process all notes to play
for note in notes_playing:
var current_note = str(note)
# Avoid issues with two digit sample names (ex: 53 must be 053)
if int(current_note) < 100:
current_note = str("0" + current_note)
# Play note
if "current_note IN sample_player IS NOT PLAYING":
# If there's not notes playing
if notes_playing ==  and sample_player.is_active()::