Skip to main content

BadPenni - MIDI Triggered Sound Looper

This program reads MIDI input and plays/loops the assigned sound files.

Brian Gryder
This program is a single simple text file. All of the MIDI notes and sound files are assigned near the top of the file and the install/operation instructions are at the bottom. Just edit the parameters, save it in the folder with your sounds, plug up your MIDI device, run the program, and rock out (in a Devo/Skinny Puppy sort of way).

I wrote this to play loops with a midi foot controller while playing live drums. All of the parameters are (editable , but) hard coded in the program, with no fancy knobs and sliders to mess up on-stage. Contact me if you have any suggestions for improvement.
Installing the Program: 

    1) Install Pygame. (
    2) Copy this file into a folder with sound files. 
    3) Edit the file to assign the sound files to simple variable at line 11 like this:

sound1 = pygame.mixer.Sound("beat1.wav")
sound2 = pygame.mixer.Sound("beat2.wav")
sound3 = pygame.mixer.Sound("beat3.wav")
sound4 = pygame.mixer.Sound("beat4.wav")
(and so on..)

    4) Edit the file to assign the sound files to MIDI note numbers 
    (C=48, C#=49, D=50 etc) at line 18 like this: 

        if mymidinote == "48":
            nextsound = sound1
        if mymidinote == "50":
            nextsound = sound2
        if mymidinote == "52":
            nextsound = sound3
        if mymidinote == "53":
            nextsound = sound4

(*Hint watch the spaces in front of the lines, they are important)

Running the Program:

    1) Open a terminal window
    2) Change to the folder with the program and sound files
    3) Enter this command: python -u
    4) This prompt will be displayed:

 0: interface :ALSA:, name :Midi Through Port-0:, opened :0:  (output)
 1: interface :ALSA:, name :Midi Through Port-0:, opened :0:  (input)
 2: interface :ALSA:, name :Virtual Keyboard:, opened :0:  (input)
See list above. Please enter the number for your midi input device:

    6) Enter the number from the list for your MIDI device.

    7) Play the assigned notes with your MIDI device. 
    The assigned sounds will play and loop. 
    Newly triggered sounds will be queued to play when the current loop finishes. 



Home Page


BadPenni - MIDI Triggered Sound Looper 0.01 — 31 Dec, 2010 account Comments