This is a Java library for building Native Format Scores.
Note: This library does not include the Smart Player.
Include the following dependency in your pom.xml file, with LATEST-VERSION set to the latest released verison, for example, 0.1.1.
<dependency>
<groupId>com.spotify.nativeformat</groupId>
<artifactId>nf-grapher-java</artifactId>
<version>LATEST-VERSION</version>
</dependency>// Build a spotify node
final FileNode.Config fileConfig =
new FileNode.Config().file("spotify:track:4RDKrwyA9YouzL1LxvMaxH");
final FileNode source = FileNode.create(fileConfig);
// Create a loop node
// Start a 5.6 second loop from the beginning of the track
final LoopNode.Config loopConfig = new LoopNode.Config()
.when(Time.ZERO)
.duration(Time.fromSeconds(5.6));
final LoopNode loop = LoopNode.create(loopConfig);
final Graph graph = Graph.builder()
.id(UUID.randomUUID().toString())
.addNode(source)
.addNode(loop)
.addEdge(source.connect(loop))
.build();See the the generated documentation from the Smart Player Contract for a full list of all Plugins, Params, and Config values.
This project relies on generated code from nf-gen-ts. If you're updating the Smart Player contract, you should run the generate:java script from the nf-gen-ts directory.
If you're updating the Score protocol, you'll need to make manual changes to the interfaces in the score package.
This project is built with maven. Run
mvn clean packageto build, test, and package the library.
TODO