Hello world! (introduction)


I just discovered FoxDot and it is great. I always dreamed of being able to make generative music using python.

Just as a warming up I coded “Clapping Music” by Steve Reich using FoxDot. Here is a link to the YouTube Video

I’m also very interested in using FoxDot to control virtual synths in the iPad. MidiOut instrument is promising, but it lacks lots of parameters which could be achieved via CC. I’m doing some experimentation with this. Stay tuned :slight_smile:

I created a new version, based on the same rhythmic pattern, but adding some notes which create intricate counterpoints. I also added a bass line. I used FoxDot to drive via midi some iPad instruments (two oboes and one cello). The result is reminiscent of Phillip Glass.

This is the new YouTube video

The script I used is:

def clapping():
    pattern = P[1,1,1,0,1,1,0,1,0,1,1,0]
    d1 >> MidiOut([0,2,4,5,4], dur=1/12, amp=pattern*PWhite(0.5,.7), 
                  pan=-.5, delay=PWhite(0, 0.01), channel=0)
    d2 >> MidiOut([7,6,5,2,1], dur=1/12, amp=pattern*PWhite(0.5,.7), 
                  pan=+.5, delay=PWhite(0, 0.01), channel=1)
    d3 >> MidiOut([0, -2, [-3, -4]], oct=4, dur=[4, [4,3]], channel=2)
    i = 0
    def rotate():
        nonlocal i
        d2.amp = pattern2 = pattern.rotate(i)
        print("{}\n{}".format(pattern, pattern2))
        i += 1
    Clock.every(8, rotate)
    Clock.future(8*13-.1, Clock.clear)

Clock.bpm = 32
Scale.default = "aeolian"

Hi there! Glad to see you’re getting stuck in and it’s cool to see the combination with MIDI also. Keep it up :slight_smile: