pygame is
Simple DirectMedia Layer is
Site Swing
BadPenni - MIDI Triggered Sound Looper

BadPenni - MIDI Triggered Sound Looper - 0.01

Brian Gryder (bgryderclock)



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:


click to view original size


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

If you wish to leave a comment with your account, please sign in first.

No user comments have been submitted.

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Feb 21, 2017

Jan 31, 2017

Jan 24, 2017

Jan 18, 2017

Jan 7, 2017

Dec 30, 2016

Dec 8, 2016

Nov 28, 2016

Nov 27, 2016

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)