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 ...

Python music - Better MIDI sound using Studio One 5 Prime

I use Windows 10. And default MIDI sound is not superb. So I send MIDI messages to DAW and real-time play sounds on it. See below video for sample sounds.

I use free version of Studio One, Studio One 5 Prime. Thank you, PreSonus.
(I used Digitai Performer and BitWig 1,2,3. But both have some issues. So I just started to use Studio One 5 Prime, because it is free.)

This is a step.
1. Install loopMIDI and create MIDI port, where python can MIDI message to and DAW receives them from.

2. Start Studio One, create tracks and select several instruments e.g. violin, piano, bass and drum kit from pre-included sounds.

3. Go to Options - External Devices, Add to add loopMIDI channel 1,2,3,10 for python channel 0,1,2,9. Be noted that "channel number differs by 1".

4. For each track click Recording button (white circle) to make background color Red. (See above) 

Now you can hear the sound from DAW.

5. If you want to capture the sound, you shoud not select "exclusive mode" (Option-Audio Setup-Control Panel.


Comments