Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien Bron authored and Bastien Bron committed Sep 21, 2023
1 parent 7362b51 commit 7a8b33e
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 23 deletions.
6 changes: 3 additions & 3 deletions borne/Classes/Tube.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public function getTonality($mood){

public function getMoodName($tonality){
$mood_names = array(
'D'=>'Joyeux',
'Ab'=>'Neutre',
'C'=>'Triste'
'D'=>'Joyeuse',
'Ab'=>'Stable',
'C'=>'Mélancolique'
);

return $mood_names[$tonality];
Expand Down
2 changes: 1 addition & 1 deletion machineatubes/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def main():
Tube.window = window
VideoNote.window = window
LyricsNote.window = window
webview.start(webview_cb, debug=True, private_mode=False, gui="cef")
webview.start(webview_cb, debug=True, private_mode=False, gui="qt")
exit(0)

if __name__ == "__main__":
Expand Down
3 changes: 2 additions & 1 deletion machineatubes/tube.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
videoend = threading.Event()

out = rm.MidiOut() # we may need more than one
#out2 = rm.MidiOut() # we may need more than one

notes2midi = { rm.midi2note(i): i for i in range(-255, 255) }

Expand Down Expand Up @@ -39,7 +40,7 @@
("refrain", 144, 175, 8),
("solo", 176, 207, 8),
("refrain", 208, 239, 8),
("intro", 240, 244, 8),
("intro", 240, 244, 4),
]

# pprint.pprint(notes2midi) show me all your notes
Expand Down
46 changes: 44 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import requests
'''import requests
url = "https://api.d-id.com/talks/tlk_aHPQJvRMXCubzZXhMGqNQ"
Expand All @@ -12,4 +12,46 @@
response = response.json()
print(response.get("result_url"))
print(response.get("result_url"))'''

import time
import pprint
import rtmidi2 as rm

midi_outs = rm.get_out_ports()

pprint.pprint(midi_outs)


out = rm.MidiOut() # we may need more than one
out.open_port(0)

out.send_noteon(14, 84, 127)
time.sleep(0.2)
out.send_noteoff(14, 84)

for n in range(12, 61):
out.send_noteoff(15, n)

time.sleep(0.4)

for i in range(0, 0):
for n in range(12, 61):
out.send_noteon(15, n, 127)
time.sleep(0.1)
out.send_noteon(15, n+1, 127)
time.sleep(0.1)

out.send_noteoff(15, n)
time.sleep(0.3)
out.send_noteoff(15, n+1)
time.sleep(0.3)

'''for n in range(12, 61):
out.send_noteon(15, n, 127)
time.sleep(1)
for n in range(12, 61):
out.send_noteoff(15, n)
'''
Binary file removed ui/assets/videos/machine/outro/outro.mp4
Binary file not shown.
37 changes: 21 additions & 16 deletions ui/machine.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
}

#video video{
position: absolute;
max-width: 100%;
max-height: 100%;
}
Expand Down Expand Up @@ -183,7 +184,7 @@
font-size: 0.3em;
}

.sleep, .loading, .gifintro{
.sleep, .loading, .jingle{
display: none;
text-align: center;
justify-content: center;
Expand All @@ -208,13 +209,13 @@
<div class="screen paroles" >
<div class="sleep"><img src="assets/img/logoinfos.jpg"></div>
<div class="loading"><img src="assets/img/loading.gif"></div>
<div class="gifintro"><img src="assets/img/intro_landscape.gif"></div>
<div class="jingle"><img src="assets/img/intro_landscape.gif"></div>
<div id="paroles"></div>
</div>
<div class="screen vertical" id="infos" >
<div class="sleep"><img src="assets/img/logoinfos.jpg"></div>
<div class="loading"><img src="assets/img/loading.gif"></div>
<div class="gifintro"><img src="assets/img/intro_portrait.gif"></div>
<div class="loading"><img src="assets/img/intro_portrait.gif"></div>
<div class="jingle"><img src="assets/img/intro_portrait.gif"></div>
<!-- <div id="infologo"><img src="assets/img/logoinfos.jpg"></div> -->
<div id="infonum">Chanson #57</div>
<div class="header"><span>>Titre</span></div>
Expand All @@ -233,7 +234,7 @@
<div class="screen" id="titre">
<div class="sleep"><img src="assets/img/logoinfos.jpg"></div>
<div class="loading"><img src="assets/img/loading.gif"></div>
<div class="gifintro"><img src="assets/img/intro_landscape.gif"></div>
<div class="jingle"><img src="assets/img/intro_landscape.gif"></div>
<div class="headertitre"><img src="assets/img/logotitre.jpg"><div id="numtube">CHANSON #47</div></div>
<div>
<div id="grostitre">"UNE DANSE MYSTÉRIEUSE"</div>
Expand All @@ -244,7 +245,6 @@
<div class="screen" id="video">
<div class="sleep"><img src="assets/img/logoinfos.jpg"></div>
<div class="loading"><img src="assets/img/loading.gif"></div>
<div class="gifintro"><img src="assets/img/intro_portrait.gif"></div>
<video id="dedicacevideo" style="display: none;"></video>
<video id="introvideo" style="display: none;"></video>
<video id="outrovideo" style="display:none;"></video>
Expand Down Expand Up @@ -293,24 +293,24 @@
intro_video.currentTime = 0;
intro_video.play();
intro_video.style.display = "block";
const elems = document.querySelectorAll('.jingle');
elems.forEach(function(e){
e.style.display = "flex";
});
dedi_video.src = dedi_url;
dedi_video.load();
dedi_video.currentTime = 0;
intro_video.addEventListener("ended", function(v){
const elems = document.querySelectorAll('.gifintro');
const elems = document.querySelectorAll('.jingle');
elems.forEach(function(e){
e.style.display = "flex";
e.style.display = "none";
});
intro_video.style.display = "none";
dedi_video.play();
dedi_video.style.display = "block";

dedi_video.addEventListener("ended", function(v){

const elems = document.querySelectorAll('.gifintro');
elems.forEach(function(e){
e.style.display = "none";
});
dedi_video.style.display = "none";
window.pywebview.api.videoend();
});
Expand Down Expand Up @@ -360,6 +360,7 @@
vid.src = source;
vid.muted = true;
vid.loop = true;
vid.style.position = "absolute";
vid.addEventListener("ended", function(e){
vid.style.display = "none";
});
Expand All @@ -378,12 +379,16 @@
if(source == "") return;
const vids = document.querySelectorAll('video');
let vid = document.querySelector("video[src='" + source + "']");
vid.currentTime = 0;
vid.style.display = "block";

vids.forEach(function(v){
if(v !== vid) v.style.display = "none";
if(v!==vid) v.style.display = "none";
});
console.log("playing " + source);
vid.style.display = "block";


//vid.play();
//vid.currentTime = 0;
//setTimeOut( function(){}, 200);
};

sleep();
Expand Down

0 comments on commit 7a8b33e

Please sign in to comment.