audio (example config files)

Machine config examples

Here are some example machine-wide config files that show real-world examples of how these configs are used.

Note that there are multiple machine config examples here. They’re just included to show different options. You wouldn’t actually use more than one.

#config_version=5
displays:
  default:
    width: 400
    height: 300

sound_system:
  buffer: 2048
  frequency: 44100
  channels: 2
  master_volume: 0.9
  tracks:
    music:
      volume: 0.5
      simultaneous_sounds: 1
    sfx:
      volume: 0.3
      simultaneous_sounds: 8
    voice:
      volume: 0.6
      simultaneous_sounds: 1

assets:
  sounds:
    default:
      load: preload
    voice:
      load: preload
      track: voice
    sfx:
      load: on_demand
      track: sfx
    music:
      load: on_demand
      track: music
    loops:
      load: preload
      track: sfx
    playlist:
      load: on_demand
      track: sfx
  videos:
      default:
          load: preload
      preload:
          load: preload
      on_demand:
          load: on_demand
      mode_start:
          load: mode_start

sounds:
  264828_text:
    volume: 0.1
    events_when_played: text_sound_played
    events_when_looping: text_sound_looping
    events_when_stopped: text_sound_stopped
    loops: 6
    simultaneous_limit: 3
    stealing_method: skip

  210871_synthping:
    simultaneous_limit: 3
    stealing_method: oldest
    events_when_played: synthping_played

  198361_sfx-028:
    volume: 0.25

  263774_music:
    volume: 0.4

  city_loop:
    file: 223093__qubodup__seamless-city-loop.flac
    streaming: True
    volume: 0.15
    fade_in: 2.0 sec

sound_player:
  play_sound_text: 264828_text
  play_sound_synthping: 210871_synthping
  play_sound_sfx_028: 198361_sfx-028
  play_city_loop: city_loop
  stop_city_loop:
    city_loop:
      action: stop
      fade_out: 0.1s

slides:
  video_test:
    - type: video
      video: mpf_video_small_test
    - type: text
      text: Sound and Video Test
      y: bottom+20%
    - type: text
      text: ""
      y: bottom+10%

slide_player:
  show_slide1: video_test

videos:
  mpf_video_small_test:
    width: 100
    height: 70
    events_when_played: test_video_played
    events_when_stopped: test_video_stopped
#config_version=5

# No sound_system section, default settings should be used

modes:
 - mode1

assets:
    sounds:
        default:
            load: preload
        voice:
            load: preload
            track: default
        sfx:
            load: on_demand
            track: default
            ducking:
                target: default
                delay: 0
                attack: 0.3 sec
                attenuation: 0.45
                release_point: 0.5 sec
                release: 1.0 sec
        music:
            load: on_demand
            track: default
        loops:
            load: preload
            track: default
        playlist:
            load: on_demand
            track: default
#config_version=5
sound_system:
  buffer: 2048
  frequency: 44100
  channels: 2
  master_volume: 0.9
  tracks:
    playlist:
      type: playlist
      volume: 0.6
      crossfade_time: 2s

assets:
  sounds:
    default:
      load: preload
    playlist:
      load: preload
      track: playlist

sounds:
  drumbeat_7:
    file: 144554__kxtells__drumbeat-7.ogg
    events_when_played: drumbeat_7_played
    events_when_stopped: drumbeat_7_stopped
  hippie_ahead:
    file: 214473__diboz__hippeahead.ogg
    events_when_played: hippie_ahead_played
    events_when_stopped: hippie_ahead_stopped
  rainbow_disco_bears:
    file: 322071__edemson86__rainbowdiscobears.ogg
    events_when_played: rainbow_disco_bears_played
    events_when_stopped: rainbow_disco_bears_stopped
  dirty_grinding_beat_loop:
    file: 385984__blockh34d__dirty-grinding-beat-loop.ogg
    events_when_played: dirty_grinding_beat_loop_played
    events_when_stopped: dirty_grinding_beat_loop_stopped

playlists:
  attract_music:
    sounds: drumbeat_7, rainbow_disco_bears, dirty_grinding_beat_loop, hippie_ahead
    shuffle: False
    repeat: False
    events_when_played: attract_music_played
    events_when_stopped: attract_music_stopped
    events_when_looping: attract_music_looping
    events_when_sound_changed: attract_music_sound_changed
    events_when_sound_stopped: attract_music_sound_stopped
  other_playlist:
    sounds: hippie_ahead, rainbow_disco_bears
    events_when_played: other_playlist_played
    events_when_stopped: other_playlist_stopped
  third_playlist:
    sounds: dirty_grinding_beat_loop, drumbeat_7
    events_when_played: third_playlist_played
    events_when_stopped: third_playlist_stopped

playlist_player:
  play_attract_music:
    playlist:
      playlist: attract_music
      action: play

  advance_playlist:
    playlist:
      action: advance

  stop_playlist:
    playlist:
      action: stop
#config_version=5
sound_system:
  buffer: 1000 # Not a power or two as required
  tracks:
    voice:
      volume: 0.6
      simultaneous_sounds: 1
      preload: yes
    sfx:
      volume: 0.4
      simultaneous_sounds: 8
      preload: yes
    music:
      volume: 0.5
      simultaneous_sounds: 1

modes:
 - mode1

assets:
    sounds:
        default:
            load: preload
        voice:
            load: preload
            track: voice
        sfx:
            load: on_demand
            track: sfx
        music:
            load: on_demand
            track: music
        loops:
            load: preload
            track: sfx
        playlist:
            load: on_demand
            track: sfx
#config_version=5
sound_system:
  buffer: 2048
  frequency: 44100
  channels: 2
  master_volume: 0.9
  tracks:
    music:
      volume: 0.5
      simultaneous_sounds: 1
      events_when_stopped: music_track_stopped
      events_when_played: music_track_played, keep_going
      events_when_paused: music_track_paused
    sfx:
      volume: 0.4
      simultaneous_sounds: 8
      preload: yes
    voice:
      volume: 0.6
      simultaneous_sounds: 1
      preload: yes


modes:
 - mode1
 - mode2

assets:
    sounds:
        default:
            load: preload
        voice:
            load: preload
            track: voice
        sfx:
            load: preload
            track: sfx
        music:
            load: on_demand
            track: music
        loops:
            load: preload
            track: sfx
        playlist:
            load: on_demand
            track: sfx

sounds:
    264828_text:
        events_when_played: text_sound_played
        events_when_looping: text_sound_looping
        events_when_stopped: text_sound_stopped
        loops: 7
        simultaneous_limit: 3
        stealing_method: skip
    104457_moron_test:
        streaming: False
        events_when_played: moron_test_played
        events_when_stopped: moron_test_stopped
        events_when_about_to_finish: moron_test_about_to_finish
        volume: 0.6
        about_to_finish_time: 2s
        ducking:
            target: music
            delay: 0
            attack: 1.0sec
            attenuation: -18db
            release_point: 3sec
            release: 2.25sec
        markers:
            - time: 2.5sec
              events: moron_marker
            - time: 3.5sec
              name: verse_1
              events: moron_next_marker, last_marker
    210871_synthping:
        simultaneous_limit: 3
        stealing_method: oldest
        events_when_played: synthping_played
    198361_sfx-028:
        simultaneous_limit: 3
        stealing_method: newest
    263774_music:
        streaming: False

sound_pools:
    drum_group:
        load: preload
        type: sequence
        simultaneous_limit: 3
        stealing_method: skip
        track: sfx
        sounds:
            - 4832__zajo__drum07
            - 84480__zgump__drum-fx-4
            - 100184__menegass__rick-drum-bd-hard

sound_player:
    load_music:
        263774_music:
            action: load
    unload_music:
        263774_music:
            action: unload
    play_sound_synthping: 210871_synthping
    play_sound_text:
        264828_text:
            loops: -1
            priority: 100
    stop_sound_looping_text:
        264828_text:
            action: stop_looping
    play_sound_moron_test: 104457_moron_test
    stop_sound_moron_test:
        104457_moron_test:
            action: stop
    play_sound_test:
        113690_test:
            volume: 0.25
    play_sound_music:
        263774_music:
            volume: 0.5
    stop_sound_music:
        263774_music:
            action: stop
    play_sound_drum_group: drum_group
    play_sound_text_default_params: 264828_text
    play_sound_text_param_set_1:
        264828_text:
            volume: 0.67
            loops: 2
            priority: 1000
            start_at: 0.05s
            fade_in: 0.25s
            fade_out: 0.1s
            max_queue_time: 0.15s
            events_when_played: text_sound_played_param_set_1
            events_when_stopped: text_sound_stopped_param_set_1
            events_when_looping: text_sound_looping_param_set_1

track_player:
    stop_all_tracks:
        __all__:
            action: stop
            fade: 1.5 sec
    stop_music_track:
        music:
            action: stop
            fade: 1.5 sec
    play_music_track:
        music:
            action: play
            fade: 1.5 sec
    pause_music_track:
        music:
             action: pause
    resume_music_track:
        music:
             action: play
    set_music_track_volume_loud:
        music:
             action: set_volume
             volume: 0.95
             fade: 0.5 sec
    set_music_track_volume_quiet:
        music:
             action: set_volume
             volume: 0.3
             fade: 0.5 sec
    stop_all_sounds_on_music_track:
        music:
             action: stop_all_sounds
             fade: 0.5 sec
    stop_all_sounds:
        __all__:
             action: stop_all_sounds
#config_version=5
sound_system:
  buffer: 2048
  frequency: 44100
  channels: 2
  master_volume: 0.9
  tracks:
    loops:
      type: sound_loop
      volume: 0.6
    music:
      volume: 0.5
      simultaneous_sounds: 1
    sfx:
      volume: 0.4
      simultaneous_sounds: 8
      preload: yes
    voice:
      volume: 0.6
      simultaneous_sounds: 1
      preload: yes

assets:
  sounds:
    default:
      load: preload
    loops:
      load: preload
      track: loops
    voice:
      load: preload
      track: voice
    sfx:
      load: preload
      track: sfx
    music:
      load: on_demand
      track: music
    playlist:
      load: on_demand
      track: sfx

sounds:
  kick:
    markers:
      - time: 1.0s
        events: kick_marker_1
  hihat:
    markers:
      - time: 0.5s
        events: hihat_marker_1
      - time: 1.5s
        events: hihat_marker_2

sound_loop_sets:
  basic_beat:
    sound: kick
    volume: 0.5
    tempo: 130
    layers:
      - sound: hihat
        volume: 0.7
        initial_state: stop
      - sound: snare
        volume: 0.6
        initial_state: stop
      - sound: clap
        volume: 0.45
        initial_state: stop
    events_when_played: basic_beat_played
    events_when_looping: basic_beat_looping
    events_when_stopped: basic_beat_stopped, sound_loop_set_stopped
  basic_beat2:
    sound: kick2
    volume: 0.5
    tempo: 130
    layers:
      - sound: hihat
        volume: 0.7
      - sound: snare
        volume: 0.6
      - sound: clap
        volume: 0.45
        initial_state: stop
      - sound: bass_synth
        volume: 0.5
        initial_state: play
    events_when_played: basic_beat2_played

sound_loop_player:
  play_basic_beat:
    loops:
      action: play
      sound_loop_set: basic_beat
  add_hi_hats:
    loops:
      action: play_layer
      layer: 1
  stop_hi_hats:
    loops:
      action: stop_looping_layer
      layer: 1
  add_snare:
    loops:
      action: play_layer
      fade_in: 2s
      layer: 2
  add_claps:
    loops:
      action: play_layer
      layer: 3

  play_basic_beat2:
    loops:
      action: play
      sound_loop_set: basic_beat2
      timing: next_beat_interval
      interval: 2
  add_bass_synth:
    loops:
      action: play_layer
      layer: 4
      fade_in: 3s
  fade_out_bass_synth:
    loops:
      action: stop_layer
      layer: 4
      fade_out: 4s

  stop_looping_current_loop:
    loops:
      action: stop_looping
  stop_current_loop:
    loops:
      action: stop
      fade_out: 1.5s
  reset_current_loop:
    loops:
      action: jump_to
      time: 0s

sound_player:
    play_sound_synthping: 210871_synthping
    basic_beat2_played: 210871_synthping
#config_version=5
sound_system:
  enabled: False

modes:
 - mode1

Mode config examples

Here are some example mode config files that go along with the machine-wide config above.

Note that there are multiple mode config examples here. You might not necessarily use more than one in your machine.

#config_version=5

mode:
  priority: 500

sound_player:
    play_sound_synthping_in_mode: 210871_synthping
    play_sound_drum_group_in_mode: drum_group
#config_version=5

mode:
  priority: 500

sounds:
    boing_mode2:
        file: 140867__juskiddink__boing.wav
        events_when_played: boing_sound_played

sound_player:
    play_sound_boing_in_mode2: boing_mode2
    play_sound_music_fade_at_mode_end:
        263774_music:
            volume: 0.8
            mode_end_action: stop
            fade_out: 1s