本文整理汇总了C#中Song.getBPS方法的典型用法代码示例。如果您正苦于以下问题:C# Song.getBPS方法的具体用法?C# Song.getBPS怎么用?C# Song.getBPS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Song
的用法示例。
在下文中一共展示了Song.getBPS方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: fakeCreation
void fakeCreation(Song s)
{
var theBPMCounter = 1;
var theSTOPCounter = 0;
double mesurecount = 0;
double prevmesure = 0;
double timecounter = 0;
double timeBPM = 0;
double timestop = 0;
double timetotal = 0;
float prec = 0.001f;
//stepBySecondsAverage
double timestart = -10f;
double stoptime = 0;
int countStep = 0;
double stepbysecAv = 0f;
//stepmax
double maxStepPerSeconds = 0f;
int numberStepBetweenTwoBeat = 0;
double timestartMax = -10f;
//double maxLenght = 0f;
//longestStream
double lenghtStream = 0f;
double maxLenghtStream = 0f;
double speedOfMaxStream = 0f;
double previousSpeed = 0f;
//Footswitch
int numberOfFootswitch = 0;
int[] casevalidate = new int[4]; //left down up right
casevalidate[0] = 0;
casevalidate[1] = 0;
casevalidate[2] = 0;
casevalidate[3] = 0;
//Cross
int numberOfCross = 0;
int[] caseCrossvalidate = new int[4]; //left down up right
caseCrossvalidate[0] = 0;
caseCrossvalidate[1] = 0;
caseCrossvalidate[2] = 0;
caseCrossvalidate[3] = 0;
//Hands
int numberOfHands = 0;
//freeze
var freezed = new int[4];
freezed[0] = 0;
freezed[1] = 0;
freezed[2] = 0;
freezed[3] = 0;
//graph
var listNumberStep = new Dictionary<double, double>();
foreach(var mesure in s.stepchart){
for(int beat=0;beat<mesure.Count;beat++){
#region BPMChange
var bps = s.getBPS(s.bpms.ElementAt(theBPMCounter-1).Value);
if(theBPMCounter < s.bpms.Count && theSTOPCounter < s.stops.Count){
while((theBPMCounter < s.bpms.Count && theSTOPCounter < s.stops.Count)
&& (s.mesureBPMS.ElementAt(theBPMCounter) < mesurecount - prec || s.mesureSTOPS.ElementAt(theSTOPCounter) < mesurecount - prec)){
if(s.mesureBPMS.ElementAt(theBPMCounter) < s.mesureSTOPS.ElementAt(theSTOPCounter)){
timecounter += (s.mesureBPMS.ElementAt(theBPMCounter) - prevmesure)/bps;
timeBPM += timecounter;
timecounter = 0;
prevmesure = s.mesureBPMS.ElementAt(theBPMCounter);
theBPMCounter++;
bps = s.getBPS(s.bpms.ElementAt(theBPMCounter-1).Value);
//Debug.Log("And bpm change before / bpm");
}else if(s.mesureBPMS.ElementAt(theBPMCounter) > s.mesureSTOPS.ElementAt(theSTOPCounter)){
timestop += s.stops.ElementAt(theSTOPCounter).Value;
theSTOPCounter++;
//Debug.Log("And stop change before");
}else{
timecounter += (s.mesureBPMS.ElementAt(theBPMCounter) - prevmesure)/bps;
timeBPM += timecounter;
timecounter = 0;
prevmesure = s.mesureBPMS.ElementAt(theBPMCounter);
theBPMCounter++;
bps = s.getBPS(s.bpms.ElementAt(theBPMCounter-1).Value);
timestop += s.stops.ElementAt(theSTOPCounter).Value;
theSTOPCounter++;
//Debug.Log("And bpm change before");
//Debug.Log("And stop change before");
}
}
}else if(theBPMCounter < s.bpms.Count){
while((theBPMCounter < s.bpms.Count) && s.mesureBPMS.ElementAt(theBPMCounter) < mesurecount - prec){
//.........这里部分代码省略.........
示例2: createTheChart
//Create the chart
void createTheChart(Song s)
{
var ypos = 0f;
arrowLeftList = new List<Arrow>();
arrowUpList = new List<Arrow>();
arrowDownList = new List<Arrow>();
arrowRightList = new List<Arrow>();
mineLeftList = new List<Arrow>();
mineUpList = new List<Arrow>();
mineDownList = new List<Arrow>();
mineRightList = new List<Arrow>();
var theBPMCounter = 1;
var theSTOPCounter = 0;
double mesurecount = 0;
double prevmesure = 0;
double timecounter = 0;
double timeBPM = 0;
double timestop = 0;
double timetotal = 0;
float prec = 0.001f;
var ArrowFreezed = new Arrow[4];
Bumps = new List<double>();
foreach(var mesure in s.stepchart){
for(int beat=0;beat<mesure.Count;beat++){
var bps = s.getBPS(s.bpms.ElementAt(theBPMCounter-1).Value);
if(theBPMCounter < s.bpms.Count && theSTOPCounter < s.stops.Count){
while((theBPMCounter < s.bpms.Count && theSTOPCounter < s.stops.Count)
&& (s.mesureBPMS.ElementAt(theBPMCounter) < mesurecount - prec || s.mesureSTOPS.ElementAt(theSTOPCounter) < mesurecount - prec)){
if(s.mesureBPMS.ElementAt(theBPMCounter) < s.mesureSTOPS.ElementAt(theSTOPCounter)){
timecounter += (s.mesureBPMS.ElementAt(theBPMCounter) - prevmesure)/bps;
timeBPM += timecounter;
timecounter = 0;
prevmesure = s.mesureBPMS.ElementAt(theBPMCounter);
theBPMCounter++;
bps = s.getBPS(s.bpms.ElementAt(theBPMCounter-1).Value);
//Debug.Log("And bpm change before / bpm");
}else if(s.mesureBPMS.ElementAt(theBPMCounter) > s.mesureSTOPS.ElementAt(theSTOPCounter)){
timestop += s.stops.ElementAt(theSTOPCounter).Value;
theSTOPCounter++;
//Debug.Log("And stop change before");
}else{
timecounter += (s.mesureBPMS.ElementAt(theBPMCounter) - prevmesure)/bps;
timeBPM += timecounter;
timecounter = 0;
prevmesure = s.mesureBPMS.ElementAt(theBPMCounter);
theBPMCounter++;
bps = s.getBPS(s.bpms.ElementAt(theBPMCounter-1).Value);
timestop += s.stops.ElementAt(theSTOPCounter).Value;
theSTOPCounter++;
//Debug.Log("And bpm change before");
//Debug.Log("And stop change before");
}
}
}else if(theBPMCounter < s.bpms.Count){
while((theBPMCounter < s.bpms.Count) && s.mesureBPMS.ElementAt(theBPMCounter) < mesurecount - prec){
timecounter += (s.mesureBPMS.ElementAt(theBPMCounter) - prevmesure)/bps;
timeBPM += timecounter;
timecounter = 0;
prevmesure = s.mesureBPMS.ElementAt(theBPMCounter);
theBPMCounter++;
bps = s.getBPS(s.bpms.ElementAt(theBPMCounter-1).Value);
}
}else if(theSTOPCounter < s.stops.Count){
while((theSTOPCounter < s.stops.Count) && s.mesureSTOPS.ElementAt(theSTOPCounter) < mesurecount - prec){
timestop += s.stops.ElementAt(theSTOPCounter).Value;
theSTOPCounter++;
}
}
timecounter += (mesurecount - prevmesure)/bps;
timetotal = timecounter + timeBPM + timestop;
if((beat)%(mesure.Count/4) == 0) Bumps.Add(timetotal);
var previousnote = mesure.ElementAt(beat).Trim();
//Traitement
if(displayValue[0]){ //No mine
previousnote = previousnote.Replace('M', '0');
}
if(displayValue[1]){ //No jump
if(previousnote.Where( c => c == '1' || c == '2' || c == '4').Count() == 2){
var done = false;
for(int i=0; i<4; i++){
if(previousnote.ElementAt(i) == '1' || previousnote.ElementAt(i) == '2' || previousnote.ElementAt(i) == '4'){
if(done){
previousnote = previousnote.Remove(i, 1);
//.........这里部分代码省略.........