Skip to content

Instantly share code, notes, and snippets.

@tstone
Last active May 22, 2021 05:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tstone/83f8b414a01dc0cb7b89ddaae0e907e0 to your computer and use it in GitHub Desktop.
Save tstone/83f8b414a01dc0cb7b89ddaae0e907e0 to your computer and use it in GitHub Desktop.
package com.collidermodular.core;
public interface Host {
public double getSampleRate();
public double getSamplesPerMs();
public double getMsPerSample();
public double getTempo();
}
public interface ValueSource {
public double getValue();
}
public interface AvailableValueSource extends ValueSource {
public boolean isAvailable();
}
public interface PolySource {
public boolean isAvailable();
public double getValue(int channel);
}
// ------
private PolySource jackToSource(VoltagePolyJack jack) {
return new PolySource() {
public boolean isAvailable() {
return jack.IsConnected();
}
public double getValue(int channel) {
return jack.GetPolyValue(channel);
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment