mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
playwav now resamples LPCM
This commit is contained in:
@@ -38,8 +38,8 @@ class AudioJSR223Delegate(private val vm: VM) {
|
||||
|
||||
fun setSampleUploadLength(playhead: Int, length: Int) { getPlayhead(playhead)?.pcmUploadLength = length and 65535 }
|
||||
|
||||
fun setSamplingRate(playhead: Int, rate: Int) { getPlayhead(playhead)?.setSamplingRate(rate) }
|
||||
fun getSamplingRate(playhead: Int) = getPlayhead(playhead)?.getSamplingRate()
|
||||
// fun setSamplingRate(playhead: Int, rate: Int) { getPlayhead(playhead)?.setSamplingRate(rate) }
|
||||
// fun getSamplingRate(playhead: Int) = getPlayhead(playhead)?.getSamplingRate()
|
||||
|
||||
fun startSampleUpload(playhead: Int) { getPlayhead(playhead)?.pcmUpload = true }
|
||||
|
||||
|
||||
@@ -371,12 +371,12 @@ class AudioAdapter(val vm: VM) : PeriBase {
|
||||
}
|
||||
}
|
||||
|
||||
fun getSamplingRate() = 30000 - ((bpm - 24).and(255) or tickRate.and(255).shl(8)).toShort().toInt()
|
||||
/*fun getSamplingRate() = 30000 - ((bpm - 24).and(255) or tickRate.and(255).shl(8)).toShort().toInt()
|
||||
fun setSamplingRate(rate: Int) {
|
||||
val rateDiff = (rate.coerceIn(0, 95535) - 30000).toShort().toInt()
|
||||
bpm = rateDiff.and(255) + 24
|
||||
tickRate = rateDiff.ushr(8).and(255)
|
||||
}
|
||||
}*/
|
||||
|
||||
fun resetParams() {
|
||||
position = 0
|
||||
|
||||
Reference in New Issue
Block a user