Skip to main content

Featured

Python programming 8 Music with mouse-drawn lines by PyGame

I revised my previous program "Small interactive music maker" and now melody is made from mouse-drawn lines. Actually, change is not big. Instead of my Fourier series function, two key functions are included as - draw lines with mouse by pygame - from line to fx Drawing lines from below.   https://www.dreamincode.net/forums/topic/401541-buttons-and-sliders-in-pygame/ This must be some pretty fun for kids!   ---------------------------------------------------------------------------------------------- blog 8 Some versions of pygame may have some bug. Need " pip install pygame==2.0.0.dev6 " import pygame, math, sys, time import pygame.midi # use pygame.midi (not Mido) from random import random, choice pygame.init() # initialize Pygame pygame.midi.init() # initialize Pygame MIDI port = pygame.midi.Output(0) # port open port.set_instrument(53, channel = 0) # Voice port.set_instrument(0, channel = 1) # piano port.set_instrument(33, channel = 2) # bass X = 900 ...

A song "Etude No.2 - Ambient music" inspired by Fripp and Eno uploaded to Youtube.

 Composed music: Etude (a trial piece) No. 2 - Ambient music  uploaded to Youtube.


 

 https://www.youtube.com/watch?v=XspX3ENg2RI

Julia animation was made by python matplotlib.

 https://matplotlib.org/matplotblog/posts/animated-fractals/

This song was made with just random up/down of pitch movement before I started to use Fourier series.
For each small part (16 bar), starting from chord note, pitch moves up or down on a scale (e.g. C major) with some probabilities. Length of each note is also randomly selected (e.g. choice([2,1.5,1.1.1.,0.5,0.5,0.25]) where 1 means 1 beat (1/4 note))

This is ambient music because I liked Fripp and Eno before and I wanted to make something like that. I hope the sound is somewhat similar to Frippertronics.

Comments