Added patternfolders
This commit is contained in:
parent
8e2a7a037a
commit
4f729aaac8
@ -12,9 +12,12 @@ inport = 0
|
|||||||
outport = 0
|
outport = 0
|
||||||
path = 0
|
path = 0
|
||||||
folder = 0
|
folder = 0
|
||||||
|
pattern_nr = 0
|
||||||
j = 0
|
j = 0
|
||||||
mode_select=0
|
mode_select=0
|
||||||
addsec = 0
|
addsec = 0
|
||||||
|
projectpath = 0
|
||||||
|
|
||||||
|
|
||||||
def getMIDIDevice():
|
def getMIDIDevice():
|
||||||
pass
|
pass
|
||||||
@ -37,10 +40,10 @@ def setLoop():
|
|||||||
|
|
||||||
def setParam():
|
def setParam():
|
||||||
setLoop()
|
setLoop()
|
||||||
mode = mode_select.get()
|
#mode = mode_select.get()
|
||||||
if mode == 2:
|
#if mode == 2:
|
||||||
projnr = project_input.get()
|
# projnr = project_input.get()
|
||||||
setProject(projnr)
|
# setProject(projnr)
|
||||||
|
|
||||||
def openMidi():
|
def openMidi():
|
||||||
global outport
|
global outport
|
||||||
@ -75,6 +78,13 @@ def stop_MIDI():
|
|||||||
outport.send(msg)
|
outport.send(msg)
|
||||||
displaymsg.set("Playback stopped")
|
displaymsg.set("Playback stopped")
|
||||||
|
|
||||||
|
def unmuteAll():
|
||||||
|
global outport
|
||||||
|
for i in range (0,15):
|
||||||
|
msg = mido.Message('control_change',control= 53, channel= i, value=0)
|
||||||
|
outport.send(msg)
|
||||||
|
|
||||||
|
|
||||||
def nextPattern():
|
def nextPattern():
|
||||||
global outport
|
global outport
|
||||||
msg = mido.Message('control_change', control = 103, value = 16)
|
msg = mido.Message('control_change', control = 103, value = 16)
|
||||||
@ -96,14 +106,23 @@ def setPath():
|
|||||||
|
|
||||||
def makeDir():
|
def makeDir():
|
||||||
global folder
|
global folder
|
||||||
|
global projectpath
|
||||||
folder = name_input.get()
|
folder = name_input.get()
|
||||||
os.mkdir(folder)
|
projectpath = path + '/' + folder
|
||||||
|
os.mkdir(projectpath)
|
||||||
|
|
||||||
|
def makeDirNr(pattern_nr):
|
||||||
|
global projectpath
|
||||||
|
projectpath = projectpath + '/' + str(pattern_nr) #Pfad wird addiert deswegen zusötzliche verzeichnisse
|
||||||
|
os.mkdir(projectpath)
|
||||||
|
print(projectpath)
|
||||||
|
|
||||||
def start_Rec():
|
def start_Rec():
|
||||||
displaymsg.set("Recording...")
|
displaymsg.set("Recording...")
|
||||||
global path
|
global path
|
||||||
global time
|
global time
|
||||||
global j
|
global j
|
||||||
|
global pro
|
||||||
CHUNK = 1024
|
CHUNK = 1024
|
||||||
FORMAT = pyaudio.paInt16
|
FORMAT = pyaudio.paInt16
|
||||||
CHANNELS = 2
|
CHANNELS = 2
|
||||||
@ -134,7 +153,7 @@ def start_Rec():
|
|||||||
stream.close()
|
stream.close()
|
||||||
p.terminate()
|
p.terminate()
|
||||||
|
|
||||||
wf = wave.open(path + '/'+ folder + '/' + WAVE_OUTPUT_FILENAME, 'wb')
|
wf = wave.open(projectpath + '/'+ WAVE_OUTPUT_FILENAME, 'wb')
|
||||||
wf.setnchannels(CHANNELS)
|
wf.setnchannels(CHANNELS)
|
||||||
wf.setsampwidth(p.get_sample_size(FORMAT))
|
wf.setsampwidth(p.get_sample_size(FORMAT))
|
||||||
wf.setframerate(RATE)
|
wf.setframerate(RATE)
|
||||||
@ -144,11 +163,13 @@ def start_Rec():
|
|||||||
displaymsg.set("End of Recording")
|
displaymsg.set("End of Recording")
|
||||||
|
|
||||||
def sequenceMaster():
|
def sequenceMaster():
|
||||||
print("test")
|
global pattern_nr
|
||||||
|
#print("test")
|
||||||
|
if mode_select.get() == 2:
|
||||||
|
makeDirNr(pattern_nr)
|
||||||
|
|
||||||
for i in range (0,8):
|
for i in range (0,8):
|
||||||
print("sequence started",i)
|
#print("sequence started",i)
|
||||||
displaymsg.set("Sequence started")
|
displaymsg.set("Sequence started")
|
||||||
openMidi()
|
openMidi()
|
||||||
muteAll()
|
muteAll()
|
||||||
@ -159,10 +180,14 @@ def sequenceMaster():
|
|||||||
stop_MIDI()
|
stop_MIDI()
|
||||||
mode = mode_select.get()
|
mode = mode_select.get()
|
||||||
if i == 7 and mode == 2:
|
if i == 7 and mode == 2:
|
||||||
print(mode_select)
|
#print(mode_select)
|
||||||
stop_MIDI()
|
stop_MIDI()
|
||||||
|
unmuteAll()
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
nextPattern()
|
nextPattern()
|
||||||
|
pattern_nr += 1
|
||||||
|
if pattern_nr == 9:
|
||||||
|
pattern_nr = 0
|
||||||
sequenceMaster()
|
sequenceMaster()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user