Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #40521 > unrolled thread

I try to serialise midi calls in time but it breaks down.

Started byJonas Thörnvall <jonas.thornvall@gmail.com>
First post2021-11-10 10:20 -0800
Last post2021-11-10 10:20 -0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.javascript


Contents

  I try to serialise midi calls in time but it breaks down. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-11-10 10:20 -0800

#40521 — I try to serialise midi calls in time but it breaks down.

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2021-11-10 10:20 -0800
SubjectI try to serialise midi calls in time but it breaks down.
Message-ID<541ca428-e674-4de6-9822-ced51346e6efn@googlegroups.com>
Without doing a countIn setInterval function that is closed "well in time" before rec is loaded it works perfect.

But as soon one try to run the countIn
MAINrecordMid.js:141 Uncaught TypeError: Failed to execute 'send' on 'MIDIOutput': Overload resolution failed.

//CALLED WHEN REC PUSHED IN HTML DOCUMENT
function recINIT() {
	console.log("recInit()"+activetrack);
	mode="Record";
	document.getElementById("keystream").value = "";
	//If record mode replace remove notes within boundary
	if (document.getElementById("recordmode").value == "REPLACE") {
		console.log("REMOVING EVENTS");
		removeTrackMessages(rectrack);
	}
	//Remember the active track, before change to temptrack for recording
	savetrack=activetrack;
	//Temptrack to record is 333 and "after cleanup" move the section into the realtrack.
	rectrack=333;
	track[rectrack].midiMess.length=0;
	buildRecTrack();  //In mixdown
	//Which device should playup metronome
	metToUse();
	drawnlines=0;
	prog=0;//?????????
	midEvent = 0; 	
	waittime = 0;  
	myTime=waittime;
	mode = "Record";
	keepGoing = true;
	recordmidi = true;
	recProgMess();
	recCCMess();
	recUIupdate();
 	reshed=0;schedTime=0;playPos=0;oldPassedTime=0;
	jint=0;mvol=1;
	stopCount=setInterval(countIn,400);
	setTimeout(mainREC,4000);
}

function countIn(){
    if (jint<8){ 
		if (mvol==1 || mvol==noteval+1) { metvol=120; } else { metvol=50;}
		if(SF2PLAY==false){
			noteMessage = [153, 77, metvol];
			outportarr[outportindex].send(noteMessage);
		} else {
			synth.NoteOn(153, 77, metvol);
			synth.NoteOff(153,77);
		}
		ctT.fillStyle = "red";
		ctT.fillRect(240+prog, 5, 10,10);
		prog=prog+15;
		jint++;
		mvol++;
	} else {
		clearInterval(stopCount);
	}
}

function mainREC(){
	recScrollAnime();
	browserLoadTIME=performance.now();
	if(SF2PLAY==false){
		stopRec=setInterval(recSomeNotes,5);
	} else {
		stopRec=setInterval(SF2RecSomeNotes,5);
	}
}

[toc] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web