Challenge - 5 Problems
Drum Sequencer Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediateOutput of a basic drum step sequence
Given a PLC drum sequencer program snippet that cycles through 4 steps activating outputs, what is the output sequence after 6 cycles?
PLC Programming
Step := 0; FOR i := 1 TO 6 DO Step := (Step + 1) MOD 4; CASE Step OF 0: Output := "Kick"; 1: Output := "Snare"; 2: Output := "HiHat"; 3: Output := "Rest"; END_CASE; END_FOR;
Attempts:
2 left
💡 Hint
Remember the step increments and modulo operation cycle through 0 to 3.
✗ Incorrect
The Step variable starts at 0 and increments by 1 each cycle, wrapping around after 3. The output corresponds to the current step. After 6 cycles, the outputs are Snare (step 1), HiHat (2), Rest (3), Kick (0), Snare (1), HiHat (2).
🧠 Conceptual
intermediateUnderstanding drum sequencer timing
In a drum sequencer controlled by a PLC, which factor most directly controls the speed at which drum steps are played?
Attempts:
2 left
💡 Hint
Think about how often the PLC updates its logic.
✗ Incorrect
The scan cycle time determines how fast the PLC program runs through its logic, thus controlling how quickly the sequencer steps advance.
🔧 Debug
advancedIdentify the error in drum step activation logic
This PLC code snippet is intended to activate drum outputs for steps 0-3, but step 0 always gets "Rest". What is the error?
PLC Programming
CASE Step OF 1: Output := "Kick"; 2: Output := "Snare"; 3: Output := "HiHat"; ELSE Output := "Rest"; END_CASE; // Step variable cycles from 0 to 3
Attempts:
2 left
💡 Hint
Check the range of Step and the CASE labels.
✗ Incorrect
Step cycles 0 to 3 but CASE only handles 1 to 3, when Step is 0 it falls to ELSE "Rest".
🚀 Application
advancedDesigning a mute function for a drum sequencer
You want to add a mute toggle to your PLC drum sequencer that stops all outputs when active. Which logic snippet correctly implements this?
Attempts:
2 left
💡 Hint
Mute should override normal output.
✗ Incorrect
Option A checks mute first and sets output to 'Rest' if active, otherwise runs normal step logic. This cleanly overrides output when muted.
📝 Syntax
expertCorrect syntax for a drum pattern array initialization
Which option correctly initializes a drum pattern array with 8 steps in IEC 61131-3 Structured Text?
Attempts:
2 left
💡 Hint
Array indices in PLC often start at 0 or 1, but initialization uses parentheses.
✗ Incorrect
Option D uses correct zero-based indexing and parentheses for initialization. Option D uses 1-based index but invalid square brackets; however, many PLCs prefer zero-based. Options B and D use invalid square brackets or braces.
