-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from umjammer/0.0.3
0.0.3
- Loading branch information
Showing
33 changed files
with
1,107 additions
and
942 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
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,3 @@ | ||
unpacked.bin | ||
/tmp/ | ||
local.properties |
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,2 @@ | ||
jdk: | ||
- openjdk17 |
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,4 @@ | ||
#test.midi=/foo/bar.mid | ||
|
||
vavi.test.volume=0.02 | ||
vavi.test.volume.midi=0.2 |
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,47 @@ | ||
package vavi.sound.dx7; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
|
||
/** | ||
* Context. | ||
* | ||
* @author <a href="mailto:umjammer@gmail.com">Naohide Sano</a> (nsano) | ||
* @version 0.00 2022-06-15 nsano initial version <br> | ||
*/ | ||
public class Context { | ||
public float sampleRate; | ||
|
||
// The original DX7 had one single LFO. Later units had an LFO per note. | ||
public Lfo lfo; | ||
public FreqLut freqLut; | ||
public PitchEnv pitchEnv; | ||
|
||
private static Map<Float, Context> instances = new HashMap<>(); | ||
|
||
public static Context getInstance(float sampleRate) { | ||
if (instances.containsKey(sampleRate)) { | ||
return instances.get(sampleRate); | ||
} else { | ||
Context context = new Context(sampleRate); | ||
instances.put(sampleRate, context); | ||
return context; | ||
} | ||
} | ||
|
||
private Context(float sampleRate) { | ||
this.sampleRate = sampleRate; | ||
freqLut = new FreqLut(sampleRate); | ||
lfo = new Lfo(sampleRate); | ||
pitchEnv = new PitchEnv(sampleRate); | ||
} | ||
|
||
public void setSampleRate(float sampleRate) { | ||
this.sampleRate = sampleRate; | ||
Context context = getInstance(sampleRate); | ||
this.freqLut = context.freqLut; | ||
this.lfo = context.lfo; | ||
this.pitchEnv = context.pitchEnv; | ||
} | ||
} |
Oops, something went wrong.