Skip to content

Commit

Permalink
Merge pull request #37 from svsdval/cleanup
Browse files Browse the repository at this point in the history
Lot of C0rn3j work to cleanup video2midi =)
  • Loading branch information
svsdval authored Apr 19, 2023
2 parents 7568d49 + 41184d4 commit a6be7c3
Show file tree
Hide file tree
Showing 37 changed files with 1,634 additions and 1,637 deletions.
Binary file modified docs/frame47.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var1/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var1/10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var1/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var1/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var1/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var1/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var1/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var1/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var1/8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var1/9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var2/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var2/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var2/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var2/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var2/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var2/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var2/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var2/8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gnu_linux_install/var2/9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/macos_install/macos_step_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/macos_install/macos_step_002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/macos_install/macos_step_003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/macos_install/macos_step_004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/macos_install/macos_step_005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/macos_install/macos_step_006.png
Binary file modified docs/macos_install/macos_step_007.png
Binary file modified docs/mainwindow.png
Binary file modified docs/manual/snap_to_grid_on1.png
Binary file modified docs/manual/use_sparks_off_result.png
Binary file modified docs/manual/use_sparks_on_result.png
Binary file modified docs/multichannel.png
1,783 changes: 891 additions & 892 deletions v2m.py

Large diffs are not rendered by default.

1,098 changes: 548 additions & 550 deletions video2midi/gl.py

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions video2midi/midi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from midiutil.MidiFile import MIDIFile
import os;
import os

class midinotes:
def __init__(self, midi_file_format):
Expand All @@ -8,13 +8,13 @@ def __init__(self, midi_file_format):
self.miditrackname = "Sample Track"
self.tempo = 0
self.track = 0
self.midi_file_format = int(midi_file_format);
print("initialize midifile...");
self.midi_file_format = int(midi_file_format)
print("initialize midifile...")
self.mf = MIDIFile(1,file_format=self.midi_file_format,
removeDuplicates=True,
deinterleave=False,
adjust_origin=False)
print("initialize midifile done.");
print("initialize midifile done.")

def addNote(self,track, channel, note, start_time, duration, volume ):
self.notes.append( {'track' : track, 'channel' : channel, 'note' : note, 'start_time' : start_time, 'duration' : duration, 'volume' : volume } )
Expand Down Expand Up @@ -54,9 +54,9 @@ def save_to_disk(self, filename):
def save_to_disk_per_channel(self, filename):
if len(self.notes) < 1:
return 0, "No notes to save.."
fname,ext =os.path.splitext(filename);
fname,ext =os.path.splitext(filename)
for channel in range(16):
cnt=0;
cnt=0
#
print( " processing channel %s" % channel )
self.mf = MIDIFile(1,file_format=self.midi_file_format)
Expand All @@ -74,5 +74,5 @@ def save_to_disk_per_channel(self, filename):
self.mf.writeFile(outf)
except Exception as E:
print("Error on save to disk:%s"% E)
#
#
return 1, "Saved to disk: %s_channel_[1..16]%s " % (fname,ext)
28 changes: 14 additions & 14 deletions video2midi/prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class prefs:
minimal_duration = 0.1
ignore_minimal_duration = False

keyp_delta = 90; # sensitivity
keyp_delta = 90 # sensitivity

octave = 3
tempo = 120
Expand All @@ -24,10 +24,10 @@ class prefs:

use_alternate_keys = False
rollcheck = False
rollcheck_priority = 0;
rollcheck_priority = 0

keyp_colors_channel = [ 0,0, 1,1, 2,2, 3,3, 4,4, 5,5, 6,6, 7,7, 8,8, 9,9, 10,10, 11,11 ]; # MIDI channel per color
keyp_colors_channel_prog = [ 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0, 0, 0, 0 ]; # MIDI program ID per channel
keyp_colors_channel = [ 0,0, 1,1, 2,2, 3,3, 4,4, 5,5, 6,6, 7,7, 8,8, 9,9, 10,10, 11,11 ] # MIDI channel per color
keyp_colors_channel_prog = [ 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0, 0, 0, 0 ] # MIDI program ID per channel

xoffset_whitekeys = 60
yoffset_whitekeys = 673
Expand All @@ -47,7 +47,7 @@ class prefs:
[255,212,85 ], [255,138, 0],
#L.RED D.RED
[253,125,114], [255, 37, 9],
#EMPTY
#EMPTY
[0 , 0, 0], [ 0, 0, 0],
[0 , 0, 0], [ 0, 0, 0],
[0 , 0, 0], [ 0, 0, 0],
Expand All @@ -56,17 +56,17 @@ class prefs:
[0 , 0, 0], [ 0, 0, 0],
[0 , 0, 0], [ 0, 0, 0]
# .....
];
]
keyp_colors_sparks_sensitivity = [50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50]

keys_pos=[]
keys_angle = 90;
keys_angle = 90
#
use_percolor_delta=False;
use_percolor_delta=False
#
percolor_delta=[90]*20;
autoclose = 1;
sync_notes_start_pos = False;
sync_notes_start_pos_time_delta = 1000;
save_to_disk_message = "";
save_to_disk_per_channel = False;
percolor_delta=[90]*20
autoclose = 1
sync_notes_start_pos = False
sync_notes_start_pos_time_delta = 1000
save_to_disk_message = ""
save_to_disk_per_channel = False
Loading

0 comments on commit a6be7c3

Please sign in to comment.