def METHOD_NAME(bpod, sound_msg):
    if sound_msg == sc_play_tone:
        t = 0.102
    elif sound_msg == sc_play_noise:
        t = 0.510
    sma = StateMachine(bpod)
    sma.add_state(
        state_name="play_tone",
        state_timer=t,
        output_actions=[("Serial3", sound_msg)],
        state_change_conditions={"BNC2Low": "exit", "Tup": "exit"},
    )
    bpod.send_state_machine(sma)
    bpod.run_state_machine(sma)  # Locks until state machine 'exit' is reached
    return