-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvocal-guide.php
More file actions
30 lines (27 loc) · 758 Bytes
/
vocal-guide.php
File metadata and controls
30 lines (27 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
use Midi\MidiLyric;
use MusicProductionManager\Data\Entity\Song;
require_once "inc/app.php";
$songEnt = new Song(null, $database);
try
{
$songs = $songEnt->findAll(null, null, null);
$results = $songs->getResult();
foreach($results as $song)
{
$midiPath = $song->getFilePathMidi();
if(file_exists($midiPath))
{
$midi = new MidiLyric();
$midi->importMid($midiPath);
$vocalGuide = json_encode(array_values($midi->getSong($song->getMidiVocalChannel())));
$song->setVocalGuide($vocalGuide);
$song->update();
echo "Update vocal guide ".$song->getName()."<br>\r\n";
}
}
}
catch(Exception $e)
{
// do nothing
}