How a Shot Profile and a Show Interact

9 views
Skip to first unread message

Thomas Trickel

unread,
Dec 11, 2025, 6:22:52 PM (6 days ago) Dec 11
to MPF Users
Should add this to the tutorial? 
How obvious was this to you?

I "learned" this while trying make a shot that blinked and stayed on when the shot was hit. My first thought was well this is easy just have the step of the show turn the LED on,  off, on. Turns out it is easy once you've got it working. :-)

Shot profiles loop by default
So loops: 0 must be added to state
Shows turn off LEDs at the end of the show
So duration: -1 must be added to the show to have the LED stay on after the show "ends" ("s because the show hasn't ended - the show is held indefinitely in its last step)

It seems an odd choice to me to have the states of a shot not loop by default but to have the states themselves loop by default.

For all examples the shot is:
shots:
  mission_spot_1_shot:
    switch: s_mission_spot_1
    show_tokens:
      led: l_mission_spot_1
    profile: mission

Example 1: Results in LED continuously blinking because shot profiles loop by default.
 
shot_profiles:
  mission:
    states:
      - name: off
        show: off
      - name: lit
        show: "mission_flash_purple"
     loop: true

shows:
  mission_flash_purple:
     - time: 0
       lights:
        (led): purple   #on
     - time: +120ms
       lights:
        (led): off
     - time: +120ms
       lights:
        (led): purple   #on

Example 2: Results in LED off at the end of the show because the lit state of the mission shot profile has loops set to 0 and lights associated with shows turn off at the end of the show .

shot_profiles:
  mission:
    states:
      - name: off
        show: off
      - name: lit
        show: "mission_flash_purple"
        loops: 0
    loop: true

shows:
  mission_flash_purple:
     - time: 0
       lights:
        (led): purple   #on
     - time: +120ms
       lights:
        (led): off
     - time: +120ms
       lights:
        (led): purple   #on

Example 3: Results in LED on because mission_flash_purple show has a duration of -1 for the last step of the show.
 
shot_profiles:
  mission:
    states:
      - name: off
        show: off
      - name: lit
        show: "mission_flash_purple"
        loops: 0         #not necessary as duration: -1 stops looping
     loop: true

shows:
  mission_flash_purple:
     - time: 0
       lights:
        (led): purple   #on
     - time: +120ms
       lights:
        (led): off
     - time: +120ms
       lights:
        (led): purple   #on
       duration: -1

Thank you for playing along.
Reply all
Reply to author
Forward
0 new messages