kopia lustrzana https://github.com/jameshball/osci-render
Allow octaves to be changed outside of using MIDI
rodzic
f6218e2c3c
commit
8bbcc1fb07
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
|||
|
||||
<groupId>sh.ball</groupId>
|
||||
<artifactId>osci-render</artifactId>
|
||||
<version>1.11.8</version>
|
||||
<version>1.11.9</version>
|
||||
|
||||
<name>osci-render</name>
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ public class ShapeAudioPlayer implements AudioPlayer<List<Shape>> {
|
|||
private int count = 0;
|
||||
private List<Double> frequencies = List.of(MIDDLE_C);
|
||||
private double mainFrequency = MIDDLE_C;
|
||||
private double maxFrequency = MIDDLE_C;
|
||||
private double pitchBend = 1.0;
|
||||
private double trace = 0.5;
|
||||
private int octave = 0;
|
||||
|
@ -146,7 +147,7 @@ public class ShapeAudioPlayer implements AudioPlayer<List<Shape>> {
|
|||
@Override
|
||||
public void setBaseFrequencies(List<Double> frequencies) {
|
||||
this.frequencies = frequencies;
|
||||
double maxFrequency = frequencies.stream().max(Double::compareTo).get();
|
||||
this.maxFrequency = frequencies.stream().max(Double::compareTo).get();
|
||||
this.mainFrequency = maxFrequency * Math.pow(2, octave - 1);
|
||||
updateLengthIncrement();
|
||||
|
||||
|
@ -231,6 +232,7 @@ public class ShapeAudioPlayer implements AudioPlayer<List<Shape>> {
|
|||
@Override
|
||||
public void setOctave(int octave) {
|
||||
this.octave = octave;
|
||||
this.mainFrequency = maxFrequency * Math.pow(2, octave - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -184,7 +184,6 @@ public class Controller implements Initializable, FrequencyListener, MidiListene
|
|||
@FXML
|
||||
private ComboBox<AudioDevice> deviceComboBox;
|
||||
|
||||
|
||||
public Controller(AudioPlayer<List<Shape>> audioPlayer) throws IOException {
|
||||
this.audioPlayer = audioPlayer;
|
||||
FrameSet<List<Shape>> frames = new ObjParser(DEFAULT_OBJ).parse();
|
||||
|
|
Ładowanie…
Reference in New Issue