Skip to content

Commit

Permalink
release v0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pussinboot committed Oct 25, 2015
1 parent 77fb9fe commit 8dfd104
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 21 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### mdvj v0.5.0 - milkdrop vj midi controller :notes:
### mdvj v0.5.1 - milkdrop vj midi controller :notes:

simple application that makes it easier to control milkdrop. supports any midi device or control with the mouse alone : )

Expand All @@ -7,15 +7,15 @@ simple application that makes it easier to control milkdrop. supports any midi d
## installation instructions

1. make sure you have the dependencies fulfilled
- pygame32 from [here](http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame)
- pywin32 from [here](http://sourceforge.net/projects/pywin32/)
- pygame32 from [here](http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame) (only if you plan on using midi)
2. clone this repo
3. `python ./setup.py install`
4. to run execute: `mdvj`

-OR-

download and extract the precompiled zip from [here](https://dl.dropboxusercontent.com/u/9812886/mdvj_v_0_5_0.zip)
download and extract the precompiled zip from [here](https://dl.dropboxusercontent.com/u/9812886/mdvj_v_0_5_1.zip)

## usage instructions

Expand All @@ -26,6 +26,13 @@ download and extract the precompiled zip from [here](https://dl.dropboxuserconte

for use with resolume follow the instructions [here](https://github.com/pussinboot/mdvj/blob/master/resolume.md)

## known bugs

milkdrop uses a funny sorting algorithm for determining order of presets so the name of a preset will not always match up with what you select.
no worries, the screenshot is still correct.. if this bothers you, you can rename your presets so that milkdrop follows the same order as your file explorer.

if after setup everything closes, just start mdvj again and it will work (this will happen if you have no midi devices sorry)

## to-do

- record/playback function >:D
Expand Down
15 changes: 8 additions & 7 deletions mdvj/control_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ def midi_start(self,inp=None):
if inp:
self.MC.MC.set_inp(inp)
def process_midi(queue):
while self.MC.running:
msg = self.MC.MC.test_inp()
if msg:
#queue.put(mg)
if msg[0] in self.key_to_fun:
resp = self.key_to_fun[msg[0]](msg[1])
if resp: queue.put(resp)
if self.MC.MC.inp:
while self.MC.running:
msg = self.MC.MC.test_inp()
if msg:
#queue.put(mg)
if msg[0] in self.key_to_fun:
resp = self.key_to_fun[msg[0]](msg[1])
if resp: queue.put(resp)

self.MC.start(process_midi)
else:
Expand Down
1 change: 1 addition & 0 deletions mdvj/mdvj.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ def Setup(self):
#directory = s.start()
#print(directory)
#ConfigMidi(tk.Toplevel())
self.Save()
self.Run()

def Load(self,filename="saved_state"):
Expand Down
7 changes: 5 additions & 2 deletions mdvj/midi_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(self,frame=None):
self.master.wm_state('iconic')
else:
self.master = frame
self.no_midi = False
self.queue = None
self.midi_started = False
self.input_storage = None
Expand Down Expand Up @@ -86,7 +87,8 @@ def start(self):
# if no device
device_select = DeviceSelect(self)
#device_select.focus_force()
self.master.mainloop()
if not self.no_midi:
self.master.mainloop()
# now start the midi thread

def config_line(self,p_frame,desc,bind,ctype,type_restrict,radio=True): #,None] # need to pass in higher level variable fxns otherwise will have weird as behavior
Expand Down Expand Up @@ -250,7 +252,8 @@ def __init__(self,parent):

if self.inputs == []:
self.return_vals()

parent.no_midi = True
return
self.input_select = tk.OptionMenu(self.device_select_frame,self.input_choice,*self.inputs)
self.output_select = tk.OptionMenu(self.device_select_frame,self.output_choice,*self.outputs)

Expand Down
34 changes: 25 additions & 9 deletions mdvj/midi_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@
then can run .start()
then can do mainloop or whatever else
"""

import pygame.midi
try:
import pygame.midi
midi_loaded = True
except:
print('pygame midi not installed')
midi_loaded = False

import threading
import queue

class MidiControl:
def __init__(self):
pygame.midi.init()
global midi_loaded
if midi_loaded:
pygame.midi.init()
self.inp = None #pygame.midi.Input(pygame.midi.get_default_input_id())

def set_inp(self,inp=None):
Expand All @@ -25,9 +31,15 @@ def set_inp(self,inp=None):
return
except:
pass
self.inp = pygame.midi.Input(pygame.midi.get_default_input_id())
try:
self.inp = pygame.midi.Input(pygame.midi.get_default_input_id())
except:
self.inp = None

def collect_device_info(self): # using this can construct list of inputs/outputs and have their corresponding channels
global midi_loaded
if not midi_loaded:
return [{},{}]
inputs = {}
outputs = {}
i = res = 0
Expand All @@ -44,6 +56,9 @@ def collect_device_info(self): # using this can construct list of inputs/outputs

def quit(self):
# self.out.close()
global midi_loaded
if not midi_loaded:
return
try:
self.inp.close()
pygame.midi.quit()
Expand Down Expand Up @@ -132,11 +147,12 @@ def workerThread1(self,queue):
One important thing to remember is that the thread has to yield
control.
"""
while self.running:

msg = self.MC.test_inp()
if msg:
queue.put(msg)
if self.MC.inp:
while self.running:

msg = self.MC.test_inp()
if msg:
queue.put(msg)

def endApplication(self):
self.running = 0
Expand Down
Binary file modified mdvj/saved_state
Binary file not shown.

0 comments on commit 8dfd104

Please sign in to comment.