-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
707 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.idea | ||
.DS_Store | ||
.classpath | ||
.externalToolBuilders | ||
|
@@ -6,3 +7,4 @@ | |
dist/ | ||
target/ | ||
test/ | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Install library midimapper | ||
|
||
|
||
Move folder midimapper into Processing's libraries folder and restart Processing. | ||
|
||
|
||
How? | ||
|
||
Contributed libraries must be downloaded separately and placed within | ||
the "libraries" folder of your Processing sketchbook. To find the Processing | ||
sketchbook location on your computer, open the Preferences window from the | ||
Processing application and look for the "Sketchbook location" item at the top. | ||
|
||
Copy the contributed library's folder into the "libraries" folder at this location. | ||
You will need to create the "libraries" folder if this is your first contributed library. | ||
|
||
By default the following locations are used for your sketchbook folder. | ||
For mac users the sketchbook folder is located inside ~/Documents/Processing. | ||
for windows users the sketchbook folder is located inside folder 'My Documents'/Processing | ||
|
||
The folder structure for library midimapper should be as follows | ||
|
||
Processing | ||
libraries | ||
midimapper | ||
examples | ||
library | ||
midimapper.jar | ||
reference | ||
src | ||
|
||
|
||
After library midimapper has been successfully installed, restart Processing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
cd $HOME/Documents/workspace/midimapper/target/classes | ||
jar cf ../midimapper.jar . | ||
cp ../midimapper.jar $HOME/Documents/Processing/libraries/midimapper/library | ||
echo "midimapper compiled on $(date)" | ||
#!/bin/bash | ||
echo "Creating jar file for $1" | ||
cd $2 | ||
{ mvn compile; } & | ||
wait | ||
echo "done mvn $2" | ||
pwd | ||
cd $2/target/classes | ||
jar cf ../$1.jar . | ||
cp ../$1.jar $HOME/Documents/Processing3/libraries/$1/library | ||
echo "$1 compiled on $(date)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# UTF-8 supported. | ||
|
||
# The name of your library as you want it formatted | ||
name = MidiMapper | ||
|
||
# List of authors. Links can be provided using the syntax [author name](url) | ||
authorList = [Andreas Schlegel](http://www.sojamo.de/) | ||
|
||
# A website for your library | ||
url = http://www.sojamo.de/libraries/midimapper | ||
|
||
# The category of your library, must be one (or many) of the following: | ||
# "3D" "Animation" "Compilations" "Data" | ||
# "Fabrication" "Geometry" "GUI" "Hardware" | ||
# "I/O" "Language" "Math" "Simulation" | ||
# "Sound" "Utilities" "Typography" "Video & Vision" | ||
# | ||
# If a value other than those listed is used, your library will listed as "Other." | ||
category = Sound | ||
|
||
# A short sentence (fragment) to summarize the library's function. This will be | ||
# shown from inside the PDE when the library is being installed. Avoid repeating | ||
# the name of your library here. Also, avoid saying anything redundant like | ||
# mentioning that its a library. | ||
sentence = A midi library. | ||
|
||
# Additional information suitable for the Processing website. The value of | ||
# 'sentence' always will be prepended, so you should start by writing the | ||
# second sentence here. If your library only works on certain operating systems, | ||
# mention it here. | ||
paragraph = A midi library that maps midi input to variables and functions. | ||
|
||
# Links in the 'sentence' and 'paragraph' attributes can be inserted using the | ||
# same syntax as for authors. That is, [here is a link to Processing](http://processing.org/) | ||
|
||
|
||
# A version number that increments once with each release. This | ||
# is used to compare different versions of the same library, and | ||
# check if an update is available. You should think of it as a | ||
# counter, counting the total number of releases you've had. | ||
version = 2 # This must be parsable as an int | ||
|
||
# The version as the user will see it. If blank, the version attribute will be used here | ||
prettyVersion = 0.2.1 # This is treated as a String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,65 @@ | ||
package sojamo.midimapper; | ||
|
||
import javax.sound.midi.MidiDevice; | ||
import java.util.Collections; | ||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
|
||
public class AssignedDevice { | ||
|
||
private final MidiDevice device; | ||
private final Object parent; | ||
private final String name; | ||
|
||
AssignedDevice( Object theParent , MidiDevice theDevice, String theName ) { | ||
parent = theParent; | ||
device = theDevice; | ||
name = theName; | ||
} | ||
|
||
public MidiNote assign( int theNote ) { | ||
return new MidiNote( this , parent , theNote ); | ||
} | ||
|
||
public MidiDevice get( ) { | ||
return device; | ||
} | ||
|
||
public boolean exists( ) { | ||
return !device.equals( null ); | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
private final MidiDevice device; | ||
private final Object parent; | ||
private final String name; | ||
private final Map<Integer, MidiNote> map; | ||
|
||
AssignedDevice(Object theParent, MidiDevice theDevice, String theName) { | ||
parent = theParent; | ||
device = theDevice; | ||
name = theName; | ||
map = new LinkedHashMap<>(); | ||
} | ||
|
||
public MidiNote assign(int theNote) { | ||
MidiNote note = new MidiNote(this, parent, theNote); | ||
map.put(theNote, note); | ||
return note; | ||
} | ||
|
||
public AssignedDevice remove(int theNote) { | ||
map.remove(theNote); | ||
return this; | ||
} | ||
|
||
public AssignedDevice clear() { | ||
map.clear(); | ||
return this; | ||
} | ||
|
||
public MidiDevice get() { | ||
return device; | ||
} | ||
|
||
public boolean exists() { | ||
return !device.equals(null); | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public Map getMapping() { | ||
return Collections.unmodifiableMap(map); | ||
} | ||
|
||
public String toString() { | ||
StringBuilder b = new StringBuilder(). | ||
append("AssignedDevice{"). | ||
append(" name=").append(name). | ||
append(", device=").append(device.getDeviceInfo().getName()). | ||
append(", mapping=").append(getMapping().toString()). | ||
append(" }"); | ||
return b.toString(); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.