Skip to content

Commit

Permalink
re-wording some things
Browse files Browse the repository at this point in the history
  • Loading branch information
wustep committed Apr 20, 2019
1 parent c4fcd0a commit 4a8503a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 28 deletions.
Binary file modified docs/report.pdf
Binary file not shown.
Binary file modified docs/report/report.pdf
Binary file not shown.
22 changes: 8 additions & 14 deletions docs/report/report.tex
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
areas in the practice file which are most unlike the professional file for the
sake of improvement.

This project is named "JuxtaMIDI", since it juxtaposes MIDI files
This project is named JuxtaMIDI, since it juxtaposes MIDI files
for users to compare and analyze.

\section{Planning}
Expand Down Expand Up @@ -504,8 +504,7 @@ \subsection{Data Abstraction}
contained a lot of nested information about tracks and events but almost no
clear information on how that data maps to musical notes, rhythms, and dynamics.
To make matters worse, MIDI files store events using numeric codes, so the
data is not easy to read. For example, how are we supposed to know what
the following means:
data is not easy to read, like below:

\begin{itemize}
\item Type: 9
Expand All @@ -514,10 +513,9 @@ \subsection{Data Abstraction}
\item Duration: 120
\end{itemize}

To do with this, we had to go up another level of abstraction using LUTs.
For instance, it may be nice to know that a type 9 event indicates onset which
marks the beginning of a note. It might also be helpful to know which note 47
is and exactly how to make sense of the velocity tuple.
To deal with this, we had to do significant data modifications for our work.
For example, a type 9 event indicates onset which marks the beginning of a note, while a type 8 event represents the end.
Some MIDI files also choose to represent their note off events as note onsets with 0 volume.

Ultimately, we wanted the user to interact with the music in a way that they
think about it on a daily basis: notes, rhythms, dynamics, chords, etc. To get
Expand Down Expand Up @@ -573,10 +571,6 @@ \section{Results and Analysis}
updated prototype on April 6, 2019. Feedback was gathered from both phases to
evaluate and improve the product.

For the updated prototype evaluation, we shared the tool with one of our advisors.
Unfortunately, they hadn’t gotten around to the tool in time due to vis paper
deadlines. As a result, we decided to review the tool ourselves.

\subsection{Prototype Design}

The initial prototype aimed to accomplish several of the major tasks mentioned
Expand Down Expand Up @@ -620,8 +614,8 @@ \subsection{Peer Feedback}
\subsection{Musician Feedback}

In addition to the in class feedback, we also chose to evaluate the JuxtaMIDI
platform ourselves. In particular, Stephen leveraged his intermediate piano
playing abilities to generate the following list of comments:
platform ourselves. In particular, Stephen leveraged his piano background to come up with
some thoughts.

Inherent limitations:
\begin{itemize}
Expand Down Expand Up @@ -690,7 +684,7 @@ \subsection{Design Changes}
\begin{enumerate}
\item Adding a time marker to show where the user is in the song
\item Changing velocity plot to be more expressive
\item Reordering the color array so additional tracks have drastically different colors
\item Improving color choices or overlay so that tracks are more easily distinguished
\item Adding option for user to specify tempo, changing time to measure
\end{enumerate}

Expand Down
44 changes: 30 additions & 14 deletions midiviz/js/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Dashboard {
* ...]
*/
getNotesMapping() {
var mapping = []
var mapping = [];
for (const [name, midiFile] of Object.entries(this.midiFiles)) {
var track = midiFile.track;
track.forEach(function(midiEvent) {
Expand All @@ -52,7 +52,8 @@ class Dashboard {
var currentEvent = midiEvent.event[i];
runningTime += currentEvent.deltaTime;

if (currentEvent.type == 9 && currentEvent.data[1] > 0) { // Note is "noteOn" event
if (currentEvent.type == 9 && currentEvent.data[1] > 0) {
// Note is "noteOn" event
var currentNote = currentEvent.data[0];
var runningTimeSinceCurrent = 0;

Expand All @@ -66,7 +67,11 @@ class Dashboard {
runningTimeSinceCurrent += nextEvent.deltaTime;
if ("data" in nextEvent && nextEvent.data.length > 0) {
var nextNote = nextEvent.data[0];
if ((nextEvent.type == 8 || nextEvent.type == 9) && nextNote == currentNote && currentEvent.channel == nextEvent.channel) {
if (
(nextEvent.type == 8 || nextEvent.type == 9) &&
nextNote == currentNote &&
currentEvent.channel == nextEvent.channel
) {
mapping.push({
name: name,
time: runningTime,
Expand All @@ -83,18 +88,21 @@ class Dashboard {
}
});
}
mapping.sort((a, b) => Constants.NOTE_MAPPING.indexOf(b.note) - Constants.NOTE_MAPPING.indexOf(a.note))
mapping.sort(
(a, b) =>
Constants.NOTE_MAPPING.indexOf(b.note) -
Constants.NOTE_MAPPING.indexOf(a.note)
);
return mapping;
}


/**
* Generate a mapping of timestmaps and velocities.
*
* [{name: "3.mid", time: 10, velocity: 201, note: "F#4", color: "#a6cee3"}, ...]
*/
getVelocityMapping() {
var mapping = []
var mapping = [];
for (const [name, midiFile] of Object.entries(this.midiFiles)) {
var track = midiFile.track;
track.forEach(function(midiEvent) {
Expand All @@ -104,14 +112,23 @@ class Dashboard {
if (d.type == 9 && d.data[1] > 0) {
var existingTimestamp;
for (var timestamp of mapping) {
if (timestamp["name"] == name && timestamp["time"] == runningTime) {
if (
timestamp["name"] == name &&
timestamp["time"] == runningTime
) {
existingTimestamp = timestamp;
break;
}
}
if (existingTimestamp) {
existingTimestamp.loVelocity = Math.min(d.data[1], existingTimestamp.loVelocity);
existingTimestamp.hiVelocity = Math.max(d.data[1], existingTimestamp.hiVelocity);
existingTimestamp.loVelocity = Math.min(
d.data[1],
existingTimestamp.loVelocity
);
existingTimestamp.hiVelocity = Math.max(
d.data[1],
existingTimestamp.hiVelocity
);
} else {
mapping.push({
name: name,
Expand All @@ -125,11 +142,10 @@ class Dashboard {
});
});
}
mapping.sort((a, b) => a.time - b.time)
mapping.sort((a, b) => a.time - b.time);
return mapping;
}


/**
* Populates a mapping based on note frequency.
*/
Expand All @@ -154,7 +170,7 @@ class Dashboard {
color: midiFile.color,
note: find,
count: 1
})
});
}
}
});
Expand All @@ -167,8 +183,8 @@ class Dashboard {
master.forEach(function(d) {
const notes = mapping.filter(item => item.note == d.note);
const match = notes.every(item => item.count == notes[0].count);
notes.forEach(item => item.match = match);
notes.forEach(item => item.fileCount = files.length);
notes.forEach(item => (item.match = match));
notes.forEach(item => (item.fileCount = files.length));
});

return mapping;
Expand Down

0 comments on commit 4a8503a

Please sign in to comment.