SoundBuffer: Set song volume

- Requires a new column in the database after preview: `volume` REAL
- The value is a volume multiplier, if the value is set to null or 1 there will be no change
- The volume can be set in debugger
- Imported TJA files are now read from disk every time the song is played, freeing some memory and making it easier to create charts
- Correctly parse TJA files with alphabet notes, added "A" and "B" notes, which appear as DON (Big) and KA (Big) respectively
This commit is contained in:
LoveEevee
2019-03-16 00:34:48 +03:00
parent eb4ddb0b1f
commit 61a5d6d496
17 changed files with 135 additions and 49 deletions

View File

@@ -10,18 +10,20 @@
this.difficulty = difficulty
this.offset = (offset || 0) * -1000
this.soundOffset = 0
this.noteTypes = [
{name: false, txt: false},
{name: "don", txt: strings.note.don},
{name: "ka", txt: strings.note.ka},
{name: "daiDon", txt: strings.note.daiDon},
{name: "daiKa", txt: strings.note.daiKa},
{name: "drumroll", txt: strings.note.drumroll},
{name: "daiDrumroll", txt: strings.note.daiDrumroll},
{name: "balloon", txt: strings.note.balloon},
{name: false, txt: false},
{name: "balloon", txt: strings.note.balloon}
]
this.noteTypes = {
"0": {name: false, txt: false},
"1": {name: "don", txt: strings.note.don},
"2": {name: "ka", txt: strings.note.ka},
"3": {name: "daiDon", txt: strings.note.daiDon},
"4": {name: "daiKa", txt: strings.note.daiKa},
"5": {name: "drumroll", txt: strings.note.drumroll},
"6": {name: "daiDrumroll", txt: strings.note.daiDrumroll},
"7": {name: "balloon", txt: strings.note.balloon},
"8": {name: false, txt: false},
"9": {name: "balloon", txt: strings.note.balloon},
"A": {name: "daiDon", txt: strings.note.daiDon},
"B": {name: "daiKa", txt: strings.note.daiKa}
}
this.courseTypes = {
"0": "easy",
"1": "normal",
@@ -141,6 +143,7 @@
var firstNote = true
var circles = []
var circleID = 0
var regexAZ = /[A-Z]/
var pushMeasure = () => {
var note = currentMeasure[0]
@@ -321,7 +324,7 @@
}else{
var string = line.split("")
var string = line.toUpperCase().split("")
for(let symbol of string){
@@ -334,7 +337,7 @@
scroll: scroll
})
break
case "1": case "2": case "3": case "4":
case "1": case "2": case "3": case "4": case "A": case "B":
var type = this.noteTypes[symbol]
var circleObj = {
type: type.name,
@@ -413,7 +416,14 @@
currentMeasure = []
break
default:
error = true
if(regexAZ.test(symbol)){
currentMeasure.push({
bpm: bpm,
scroll: scroll
})
}else{
error = true
}
break
}