Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #35257
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2018-06-20 13:20 -0700 |
| References | (3 earlier) <tjnfx3qu3mm2.12e6bqr1lkr2i$.dlg@40tude.net> <e9db53f2-e854-401b-910d-9583192b870c@googlegroups.com> <bfd4f39f-f6dd-4c35-a780-f59df2f24ebf@googlegroups.com> <fea358b2-dcac-4315-9998-baba1cadd06f@googlegroups.com> <0d76bb0e-4c1e-4324-864f-d972a6f76946@googlegroups.com> |
| Message-ID | <5b3646a2-e950-43b4-9e4b-a7a02e9f39d7@googlegroups.com> (permalink) |
| Subject | Re: Pair matching algorithm "hard?" |
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
Den onsdag 20 juni 2018 kl. 22:15:52 UTC+2 skrev Jonas Thörnvall:
> Den onsdag 20 juni 2018 kl. 22:12:13 UTC+2 skrev Jonas Thörnvall:
> > Den onsdag 20 juni 2018 kl. 20:26:52 UTC+2 skrev Jonas Thörnvall:
> > > Den onsdag 20 juni 2018 kl. 19:56:02 UTC+2 skrev Jonas Thörnvall:
> > > > Den onsdag 20 juni 2018 kl. 15:37:30 UTC+2 skrev JJ:
> > > > > On Wed, 20 Jun 2018 20:31:22 +0700, JJ wrote:
> > > > > >
> > > > > > You forgot to take account of the MIDI channel.
> > > > > [snip]
> > > > >
> > > > > Also... do not assume that a MIDI track is exclusively for a specific MIDI
> > > > > channel. A Channel event may exist in any MIDI track. MIDI tracks are simply
> > > > > a separation of MIDI events in a `MID` file format. They do not exist in the
> > > > > MIDI protocol.
> > > >
> > > > My editor work like this i have a mixdown channel 0, the code i showed is for listing indivitual channels. But of course i need to make note on note off channel dependent in the end. Otherwise it will be hard to list and edit the omnitrack.
> > > >
> > > > "Basicly i downmix to create an omni track zero before playup, its a slow progress programming this so i am not quite there yet", but well on the way.
> > > >
> > > > But as you say when sorting events in the downmix track, you will have to also check channel of note. And even same output port.
> > > >
> > > > function sendMidiChannel(){
> > > > //Set midichannel on the track
> > > > channelC=document.getElementById("out_channel").selectedIndex+1;
> > > > if (channelC==1) {NOTE_ON=0x90; NOTE_OFF=0x80;}
> > > > else if (channelC==2) {NOTE_ON=0x91; NOTE_OFF=0x81;}
> > > > else if (channelC==3) {NOTE_ON=0x92;NOTE_OFF=0x82;}
> > > > else if (channelC==4) {NOTE_ON=0x93;NOTE_OFF=0x83;}
> > > > else if (channelC==5) {NOTE_ON=0x94;NOTE_OFF=0x84;}
> > > > else if (channelC==6) {NOTE_ON=0x95;NOTE_OFF=0x85;}
> > > > else if (channelC==7) {NOTE_ON=0x96;NOTE_OFF=0x86;}
> > > > else if (channelC==8) {NOTE_ON=0x97;NOTE_OFF=0x87;}
> > > > else if (channelC==9) {NOTE_ON=0x98;NOTE_OFF=0x88;}
> > > > else if (channelC==10) {NOTE_ON=0x99;NOTE_OFF=0x89;}
> > > > else if (channelC==11) {NOTE_ON=0xA0;NOTE_OFF=0x8A;}
> > > > else if (channelC==12) {NOTE_ON=0xA1;NOTE_OFF=0x8B;}
> > > > else if (channelC==13) {NOTE_ON=0xA2;NOTE_OFF=0x8C;}
> > > > else if (channelC==14) {NOTE_ON=0xA3;NOTE_OFF=0x8D;}
> > > > else if (channelC==15) {NOTE_ON=0xA4;NOTE_OFF=0x8E;}
> > > > else if (channelC==16) {NOTE_ON=0xA5;NOTE_OFF=0x8F;}
> > > >
> > > > }
> > >
> > > But a good thing i can make changes to listTrackEvent without any mapping, because my track object already invoke the "multi channel" data.
> > > Actually it seem the channel data is already in the midiMessage;
> > > So i do not think i need to check that"note on note off" is already recorded channel dependent in the midi data. But when i list and sort i have to consider it, "nut not while downmix and play", the info is already there.
> > >
> > > function newTrack(m) {
> > > track[m] ={
> > > outport:[],
> > > portname : [],
> > > midichannel:[],
> > > program:[],
> > > midiMess:[],
> > > //CONFIGURATION OF midiMess:[{time:0,data0:0,data1:0,data2:0}]
> > > };
> > > return track;
> > > }
> >
> > But your mapping approach probably far to advanced for me. I probably go for the range since "i think it only needed for listing/editing not for playing"
> >
> > if(track[z].midiMess[i].data0>"127" && track[z].midiMess[i].data0<"144"){
> > midiChannelToLookFor=track[z].midiMess[i].data0;
> > //And the note value is already there ;)
> > }
> >
> > What do you think, my solution seem simpler?
>
> Well i guess i have to add 16 when i look for note off.
> OffNoteToLookFor=track[z].midiMess[i].data0+16;
So...
while(track[z].midiMess[j].data1!=notenumber && OffNoteToLookFor!=track[z].midiMess[j].data1){//Search until match pair }
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Pair matching algorithm "hard?" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-20 03:26 -0700
Re: Pair matching algorithm "hard?" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-20 03:31 -0700
Re: Pair matching algorithm "hard?" Wally W. <ww84wa@aim.com> - 2018-06-20 08:45 -0400
Re: Pair matching algorithm "hard?" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-20 10:16 -0700
Re: Pair matching algorithm "hard?" JJ <jj4public@vfemail.net> - 2018-06-20 20:31 +0700
Re: Pair matching algorithm "hard?" JJ <jj4public@vfemail.net> - 2018-06-20 20:37 +0700
Re: Pair matching algorithm "hard?" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-20 10:22 -0700
Re: Pair matching algorithm "hard?" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-20 10:55 -0700
Re: Pair matching algorithm "hard?" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-20 11:26 -0700
Re: Pair matching algorithm "hard?" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-20 13:12 -0700
Re: Pair matching algorithm "hard?" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-20 13:15 -0700
Re: Pair matching algorithm "hard?" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-20 13:20 -0700
Re: Pair matching algorithm "hard?" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-20 13:26 -0700
Re: Pair matching algorithm "hard?" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-24 09:17 -0700
Re: Pair matching algorithm "hard?" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-24 09:27 -0700
Re: Pair matching algorithm "hard?" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-20 10:19 -0700
Re: Pair matching algorithm "hard?" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-20 10:28 -0700
Re: Pair matching algorithm "hard?" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-20 10:37 -0700
csiph-web