Each step in a drum sequence can be expressed as an item in a list.  In the following list, an “X” represents a drum strike and a “-” represents a wait.

Create a variable named “Drum Sequence” and set it to the list.

Create a command block named “Play Drum Sequence”.  As defined below, this block will check each item in the “Drum Sequence” list.  If an X is found, the solenoid strike; if not the procedure waits one step and then checks the next item in the list.