6 changed files with 402 additions and 0 deletions
-
BINcode/Midi/.DS_Store
-
BINcode/Midi/.mid
-
BINcode/pdf/.DS_Store
-
BINcode/pdf/.pdf
-
341code/pdf/.xml
-
61server/index.php
@ -0,0 +1,341 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 3.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd"> |
||||
|
<score-partwise version="3.0"> |
||||
|
<work> |
||||
|
<work-title>Make Your Chord</work-title> |
||||
|
</work> |
||||
|
<movement-title>Make Your Chord</movement-title> |
||||
|
<identification> |
||||
|
<creator type="composer">MYC</creator> |
||||
|
<encoding> |
||||
|
<encoding-date>2021-06-12</encoding-date> |
||||
|
<software>music21 v.6.7.1</software> |
||||
|
</encoding> |
||||
|
</identification> |
||||
|
<defaults> |
||||
|
<scaling> |
||||
|
<millimeters>7</millimeters> |
||||
|
<tenths>40</tenths> |
||||
|
</scaling> |
||||
|
</defaults> |
||||
|
<part-list> |
||||
|
<score-part id="Pbe3026033145f35b65032362e79cf354"> |
||||
|
<part-name>Track 0</part-name> |
||||
|
<part-abbreviation>Pno</part-abbreviation> |
||||
|
<score-instrument id="I5695aa30c9d922a8c115a78c7ef47552"> |
||||
|
<instrument-name>Piano</instrument-name> |
||||
|
<instrument-abbreviation>Pno</instrument-abbreviation> |
||||
|
</score-instrument> |
||||
|
<midi-instrument id="I5695aa30c9d922a8c115a78c7ef47552"> |
||||
|
<midi-channel>1</midi-channel> |
||||
|
<midi-program>1</midi-program> |
||||
|
</midi-instrument> |
||||
|
</score-part> |
||||
|
</part-list> |
||||
|
<!--=========================== Part 1 ===========================--> |
||||
|
<part id="Pbe3026033145f35b65032362e79cf354"> |
||||
|
<!--========================= Measure 1 ==========================--> |
||||
|
<measure number="1"> |
||||
|
<attributes> |
||||
|
<divisions>10080</divisions> |
||||
|
<time> |
||||
|
<beats>4</beats> |
||||
|
<beat-type>4</beat-type> |
||||
|
</time> |
||||
|
<clef> |
||||
|
<sign>G</sign> |
||||
|
<line>2</line> |
||||
|
</clef> |
||||
|
</attributes> |
||||
|
<direction> |
||||
|
<direction-type> |
||||
|
<metronome parentheses="no"> |
||||
|
<beat-unit>quarter</beat-unit> |
||||
|
<per-minute>90</per-minute> |
||||
|
</metronome> |
||||
|
</direction-type> |
||||
|
<sound tempo="90" /> |
||||
|
</direction> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>E</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>D</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>C</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>D</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
</measure> |
||||
|
<!--========================= Measure 2 ==========================--> |
||||
|
<measure number="2"> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>E</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>E</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>E</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>E</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
</measure> |
||||
|
<!--========================= Measure 3 ==========================--> |
||||
|
<measure number="3"> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>D</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>D</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>D</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>D</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
</measure> |
||||
|
<!--========================= Measure 4 ==========================--> |
||||
|
<measure number="4"> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>E</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>E</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>E</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>E</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
</measure> |
||||
|
<!--========================= Measure 5 ==========================--> |
||||
|
<measure number="5"> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>E</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>D</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>C</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>D</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
</measure> |
||||
|
<!--========================= Measure 6 ==========================--> |
||||
|
<measure number="6"> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>E</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>E</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>E</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>E</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
</measure> |
||||
|
<!--========================= Measure 7 ==========================--> |
||||
|
<measure number="7"> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>D</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>D</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>E</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>D</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
</measure> |
||||
|
<!--========================= Measure 8 ==========================--> |
||||
|
<measure number="8"> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>C</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>C</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>C</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<note dynamics="111.11"> |
||||
|
<pitch> |
||||
|
<step>C</step> |
||||
|
<octave>4</octave> |
||||
|
</pitch> |
||||
|
<duration>10080</duration> |
||||
|
<type>quarter</type> |
||||
|
</note> |
||||
|
<barline location="right"> |
||||
|
<bar-style>light-heavy</bar-style> |
||||
|
</barline> |
||||
|
</measure> |
||||
|
</part> |
||||
|
</score-partwise> |
||||
@ -0,0 +1,61 @@ |
|||||
|
<?php |
||||
|
|
||||
|
// get image, wav
|
||||
|
$image = $_POST["image"]; |
||||
|
$wav_Str = $_POST["wav_Str"]; |
||||
|
$title = $_POST["title"]; |
||||
|
|
||||
|
// replace spaces with +
|
||||
|
$data = str_replace(" ", "+", $image); |
||||
|
$wav_data = str_replace(" ", "+", $wav_Str); |
||||
|
$title_data = str_replace(" ", "+", $title); |
||||
|
|
||||
|
// decoding base 64
|
||||
|
$data = base64_decode($data); |
||||
|
$wav_data = base64_decode($wav_data); |
||||
|
$title_data = base64_decode($title_data); |
||||
|
|
||||
|
// saving in file as image
|
||||
|
file_put_contents("image.jpg", $data); |
||||
|
file_put_contents("/Users/seungwoomun/Documents/MYC/code/wav/title.wav", $wav_data); |
||||
|
|
||||
|
// run python script
|
||||
|
exec("cd /Users/seungwoomun/Documents/MYC/code/ && python3 use_Model.py"); |
||||
|
// $command = escapeshellcmd("cd /Users/seungwoomun/Documents/MYC/code/ && python3 use_Model.py");
|
||||
|
// shell_exec($command.print_pdf("$title_data.wav"));
|
||||
|
|
||||
|
// $command = escapeshellcmd('/Users/seungwoomun/Documents/MYC/code/use_Model.py');
|
||||
|
// $output = shell_exec($command);
|
||||
|
// echo $output;
|
||||
|
|
||||
|
// $pdf->setSourceFile('./airplane_1.pdf');
|
||||
|
// pdf 파일 이름 수정
|
||||
|
rename("/Users/seungwoomun/Documents/MYC/code/pdf/title.pdf", "/Users/seungwoomun/Documents/MYC/code/pdf/$title_data.pdf"); |
||||
|
rename("/Users/seungwoomun/Documents/MYC/code/pdf/title.xml", "/Users/seungwoomun/Documents/MYC/code/pdf/$title_data.xml"); |
||||
|
rename("/Users/seungwoomun/Documents/MYC/code/midi/title.mid", "/Users/seungwoomun/Documents/MYC/code/midi/$title_data.mid"); |
||||
|
rename("/Users/seungwoomun/Documents/MYC/code/wav/title.wav", "/Users/seungwoomun/Documents/MYC/code/wav/$title_data.wav"); |
||||
|
|
||||
|
// sending response back
|
||||
|
echo "$title_data 변환 완료"; |
||||
|
|
||||
|
// var express = require('express'); require('dotenv').config();
|
||||
|
// var cors = require('cors');
|
||||
|
// var mysql = require('mysql');
|
||||
|
// var bodyParser = require('body-parser');
|
||||
|
// var http = require('http');
|
||||
|
// var app = express();
|
||||
|
|
||||
|
// app.use(bodyParser.urlencoded({ extended: true }));
|
||||
|
// app.use(bodyParser.json());
|
||||
|
// app.use(bodyParser.raw({ type: 'audio/m4a', limit: '60mb' })) app.use(cors());
|
||||
|
|
||||
|
// app.post('/addAudio', function (req, res) {
|
||||
|
// console.log("Audio is successfully posted!");
|
||||
|
// console.log("Obtained audio data: ", req.body);
|
||||
|
// });
|
||||
|
|
||||
|
// app.listen(8080, function () {
|
||||
|
// console.log("Server is listening on port 8080!");
|
||||
|
// });
|
||||
|
?>
|
||||
|
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue