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


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

splice remove "events"

Started byJonas Thörnvall <jonas.thornvall@gmail.com>
First post2018-01-16 21:41 -0800
Last post2018-01-17 00:35 -0800
Articles 6 — 1 participant

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


Contents

  splice remove "events" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-16 21:41 -0800
    Re: splice remove "events" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-16 21:45 -0800
      Re: splice remove "events" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-17 00:11 -0800
        Re: splice remove "events" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-17 00:26 -0800
          Re: splice remove "events" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-17 00:33 -0800
            Re: splice remove "events" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-17 00:35 -0800

#34575 — splice remove "events"

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-01-16 21:41 -0800
Subjectsplice remove "events"
Message-ID<d034abe3-f4c9-49f8-b645-186fc9563c1f@googlegroups.com>
function makeTrack()
{
   for (var m = 1; m < 16; m ++ )
   {
     track[m] ={
     time:[],
     data0:[],
     data1:[],
     data2:[]
   };
   }
   defaultTrack();
   return track;
}

function removeTrackMessages(){
  for (var i=0;i<track[tracknr].time.length;i++){
     if(track[tracknr].time[i]>=rs && track[tracknr].time[i]<=re){
       track[tracknr].time.splice(i,1);
       console.log("did remove "+i);
     }
  }
}

Why does not the code above not remove all of the event messages recorded? 
If i "overdub" manytimes without recording any new messages it finally will.

rs and re are start and endtimes for recording. 

I try to implement "replace" or "overdub" so remove TrackMessages is called if you chose to "replace" the current recording events within bar constraint rs time bar 4  re time bar 8. 

So rs and re hold timecode depending on bpm and start end bar.
But it just will not do what i thought, i can't see how it can skip remove events?

I do not know if it have with the time format of performance now todo?
Can this cause trouble 510.0000000000001 because that is what is stored.

Even a hint would be helpful. I do not like spend time on mysteries so i go on to overdub instead, and sort events correct after overdub. 

Example DATA "BEFORE REPLACE" removeTrackMessages()
EvTime 2039 D0144 D157 D242
EvTime 2330.999999999998 D0144 D160 D21
EvTime 2670 D0128 D157 D25
EvTime 2686 D0144 D164 D231
EvTime 2855 D0128 D160 D21
EvTime 2903 D0128 D164 D25
EvTime 4593.999999999998 D0144 D150 D210
EvTime 4930.000000000002 D0144 D153 D21
EvTime 5181.999999999998 D0144 D157 D268
EvTime 5215.000000000002 D0128 D150 D25
EvTime 5355.995000000001 D0128 D153 D21
EvTime 5401.999999999998 D0128 D157 D227
EvTime 6373.994999999997 D0144 D145 D231
EvTime 6738.000000000002 D0144 D148 D227
EvTime 7015.999999999998 D0144 D152 D255
EvTime 7058.000000000002 D0128 D145 D25
EvTime 7224.999999999998 D0128 D148 D25
EvTime 7247.999999999998 D0128 D152 D210

Example DATA "BEFORE REPLACE" removeTrackMessages()
EvTime 2330.999999999998 D0144 D160 D21
EvTime 2686 D0144 D164 D231
EvTime 2903 D0128 D164 D25
EvTime 4930.000000000002 D0144 D153 D21
EvTime 5215.000000000002 D0128 D150 D25
EvTime 5401.999999999998 D0128 D157 D227
EvTime 6738.000000000002 D0144 D148 D227
EvTime 7058.000000000002 D0128 D145 D25
EvTime 7247.999999999998 D0128 D152 D210

I do not get it?

[toc] | [next] | [standalone]


#34576

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-01-16 21:45 -0800
Message-ID<aea924ca-8bc6-4c72-b73d-4daa481d9183@googlegroups.com>
In reply to#34575
Den onsdag 17 januari 2018 kl. 06:41:24 UTC+1 skrev Jonas Thörnvall:
> function makeTrack()
> {
>    for (var m = 1; m < 16; m ++ )
>    {
>      track[m] ={
>      time:[],
>      data0:[],
>      data1:[],
>      data2:[]
>    };
>    }
>    defaultTrack();
>    return track;
> }
> 
> function removeTrackMessages(){
>   for (var i=0;i<track[tracknr].time.length;i++){
>      if(track[tracknr].time[i]>=rs && track[tracknr].time[i]<=re){
>        track[tracknr].time.splice(i,1);
>        console.log("did remove "+i);
>      }
>   }
> }
> 
> Why does not the code above not remove all of the event messages recorded? 
> If i "overdub" manytimes without recording any new messages it finally will.
> 
> rs and re are start and endtimes for recording. 
> 
> I try to implement "replace" or "overdub" so remove TrackMessages is called if you chose to "replace" the current recording events within bar constraint rs time bar 4  re time bar 8. 
> 
> So rs and re hold timecode depending on bpm and start end bar.
> But it just will not do what i thought, i can't see how it can skip remove events?
> 
> I do not know if it have with the time format of performance now todo?
> Can this cause trouble 510.0000000000001 because that is what is stored.
> 
> Even a hint would be helpful. I do not like spend time on mysteries so i go on to overdub instead, and sort events correct after overdub. 
> 
> Example DATA "BEFORE REPLACE" removeTrackMessages()
> EvTime 2039 D0144 D157 D242
> EvTime 2330.999999999998 D0144 D160 D21
> EvTime 2670 D0128 D157 D25
> EvTime 2686 D0144 D164 D231
> EvTime 2855 D0128 D160 D21
> EvTime 2903 D0128 D164 D25
> EvTime 4593.999999999998 D0144 D150 D210
> EvTime 4930.000000000002 D0144 D153 D21
> EvTime 5181.999999999998 D0144 D157 D268
> EvTime 5215.000000000002 D0128 D150 D25
> EvTime 5355.995000000001 D0128 D153 D21
> EvTime 5401.999999999998 D0128 D157 D227
> EvTime 6373.994999999997 D0144 D145 D231
> EvTime 6738.000000000002 D0144 D148 D227
> EvTime 7015.999999999998 D0144 D152 D255
> EvTime 7058.000000000002 D0128 D145 D25
> EvTime 7224.999999999998 D0128 D148 D25
> EvTime 7247.999999999998 D0128 D152 D210
> 
> Example DATA "BEFORE REPLACE" removeTrackMessages()
> EvTime 2330.999999999998 D0144 D160 D21
> EvTime 2686 D0144 D164 D231
> EvTime 2903 D0128 D164 D25
> EvTime 4930.000000000002 D0144 D153 D21
> EvTime 5215.000000000002 D0128 D150 D25
> EvTime 5401.999999999998 D0128 D157 D227
> EvTime 6738.000000000002 D0144 D148 D227
> EvTime 7058.000000000002 D0128 D145 D25
> EvTime 7247.999999999998 D0128 D152 D210
> 
> I do not get it?

Sorry below should say *AFTER*

[toc] | [prev] | [next] | [standalone]


#34577

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-01-17 00:11 -0800
Message-ID<2a988e47-2492-4c8e-9b0a-521abdb8be7d@googlegroups.com>
In reply to#34576
Den onsdag 17 januari 2018 kl. 06:45:37 UTC+1 skrev Jonas Thörnvall:
> Den onsdag 17 januari 2018 kl. 06:41:24 UTC+1 skrev Jonas Thörnvall:
> > function makeTrack()
> > {
> >    for (var m = 1; m < 16; m ++ )
> >    {
> >      track[m] ={
> >      time:[],
> >      data0:[],
> >      data1:[],
> >      data2:[]
> >    };
> >    }
> >    defaultTrack();
> >    return track;
> > }
> > 
> > function removeTrackMessages(){
> >   for (var i=0;i<track[tracknr].time.length;i++){
> >      if(track[tracknr].time[i]>=rs && track[tracknr].time[i]<=re){
> >        track[tracknr].time.splice(i,1);
> >        console.log("did remove "+i);
> >      }
> >   }
> > }
> > 
> > Why does not the code above not remove all of the event messages recorded? 
> > If i "overdub" manytimes without recording any new messages it finally will.
> > 
> > rs and re are start and endtimes for recording. 
> > 
> > I try to implement "replace" or "overdub" so remove TrackMessages is called if you chose to "replace" the current recording events within bar constraint rs time bar 4  re time bar 8. 
> > 
> > So rs and re hold timecode depending on bpm and start end bar.
> > But it just will not do what i thought, i can't see how it can skip remove events?
> > 
> > I do not know if it have with the time format of performance now todo?
> > Can this cause trouble 510.0000000000001 because that is what is stored.
> > 
> > Even a hint would be helpful. I do not like spend time on mysteries so i go on to overdub instead, and sort events correct after overdub. 
> > 
> > Example DATA "BEFORE REPLACE" removeTrackMessages()
> > EvTime 2039 D0144 D157 D242
> > EvTime 2330.999999999998 D0144 D160 D21
> > EvTime 2670 D0128 D157 D25
> > EvTime 2686 D0144 D164 D231
> > EvTime 2855 D0128 D160 D21
> > EvTime 2903 D0128 D164 D25
> > EvTime 4593.999999999998 D0144 D150 D210
> > EvTime 4930.000000000002 D0144 D153 D21
> > EvTime 5181.999999999998 D0144 D157 D268
> > EvTime 5215.000000000002 D0128 D150 D25
> > EvTime 5355.995000000001 D0128 D153 D21
> > EvTime 5401.999999999998 D0128 D157 D227
> > EvTime 6373.994999999997 D0144 D145 D231
> > EvTime 6738.000000000002 D0144 D148 D227
> > EvTime 7015.999999999998 D0144 D152 D255
> > EvTime 7058.000000000002 D0128 D145 D25
> > EvTime 7224.999999999998 D0128 D148 D25
> > EvTime 7247.999999999998 D0128 D152 D210
> > 
> > Example DATA "BEFORE REPLACE" removeTrackMessages()
> > EvTime 2330.999999999998 D0144 D160 D21
> > EvTime 2686 D0144 D164 D231
> > EvTime 2903 D0128 D164 D25
> > EvTime 4930.000000000002 D0144 D153 D21
> > EvTime 5215.000000000002 D0128 D150 D25
> > EvTime 5401.999999999998 D0128 D157 D227
> > EvTime 6738.000000000002 D0144 D148 D227
> > EvTime 7058.000000000002 D0128 D145 D25
> > EvTime 7247.999999999998 D0128 D152 D210
> > 
> > I do not get it?
> 
> Sorry below should say *AFTER*

Uuuuuh i think i get it the index of all items change....

Well, well it seem a while loop, would be more suitable.

[toc] | [prev] | [next] | [standalone]


#34578

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-01-17 00:26 -0800
Message-ID<590d0465-dd84-42c0-a937-6ec080f64c1b@googlegroups.com>
In reply to#34577
Den onsdag 17 januari 2018 kl. 09:11:38 UTC+1 skrev Jonas Thörnvall:
> Den onsdag 17 januari 2018 kl. 06:45:37 UTC+1 skrev Jonas Thörnvall:
> > Den onsdag 17 januari 2018 kl. 06:41:24 UTC+1 skrev Jonas Thörnvall:
> > > function makeTrack()
> > > {
> > >    for (var m = 1; m < 16; m ++ )
> > >    {
> > >      track[m] ={
> > >      time:[],
> > >      data0:[],
> > >      data1:[],
> > >      data2:[]
> > >    };
> > >    }
> > >    defaultTrack();
> > >    return track;
> > > }
> > > 
> > > function removeTrackMessages(){
> > >   for (var i=0;i<track[tracknr].time.length;i++){
> > >      if(track[tracknr].time[i]>=rs && track[tracknr].time[i]<=re){
> > >        track[tracknr].time.splice(i,1);
> > >        console.log("did remove "+i);
> > >      }
> > >   }
> > > }
> > > 
> > > Why does not the code above not remove all of the event messages recorded? 
> > > If i "overdub" manytimes without recording any new messages it finally will.
> > > 
> > > rs and re are start and endtimes for recording. 
> > > 
> > > I try to implement "replace" or "overdub" so remove TrackMessages is called if you chose to "replace" the current recording events within bar constraint rs time bar 4  re time bar 8. 
> > > 
> > > So rs and re hold timecode depending on bpm and start end bar.
> > > But it just will not do what i thought, i can't see how it can skip remove events?
> > > 
> > > I do not know if it have with the time format of performance now todo?
> > > Can this cause trouble 510.0000000000001 because that is what is stored.
> > > 
> > > Even a hint would be helpful. I do not like spend time on mysteries so i go on to overdub instead, and sort events correct after overdub. 
> > > 
> > > Example DATA "BEFORE REPLACE" removeTrackMessages()
> > > EvTime 2039 D0144 D157 D242
> > > EvTime 2330.999999999998 D0144 D160 D21
> > > EvTime 2670 D0128 D157 D25
> > > EvTime 2686 D0144 D164 D231
> > > EvTime 2855 D0128 D160 D21
> > > EvTime 2903 D0128 D164 D25
> > > EvTime 4593.999999999998 D0144 D150 D210
> > > EvTime 4930.000000000002 D0144 D153 D21
> > > EvTime 5181.999999999998 D0144 D157 D268
> > > EvTime 5215.000000000002 D0128 D150 D25
> > > EvTime 5355.995000000001 D0128 D153 D21
> > > EvTime 5401.999999999998 D0128 D157 D227
> > > EvTime 6373.994999999997 D0144 D145 D231
> > > EvTime 6738.000000000002 D0144 D148 D227
> > > EvTime 7015.999999999998 D0144 D152 D255
> > > EvTime 7058.000000000002 D0128 D145 D25
> > > EvTime 7224.999999999998 D0128 D148 D25
> > > EvTime 7247.999999999998 D0128 D152 D210
> > > 
> > > Example DATA "BEFORE REPLACE" removeTrackMessages()
> > > EvTime 2330.999999999998 D0144 D160 D21
> > > EvTime 2686 D0144 D164 D231
> > > EvTime 2903 D0128 D164 D25
> > > EvTime 4930.000000000002 D0144 D153 D21
> > > EvTime 5215.000000000002 D0128 D150 D25
> > > EvTime 5401.999999999998 D0128 D157 D227
> > > EvTime 6738.000000000002 D0144 D148 D227
> > > EvTime 7058.000000000002 D0128 D145 D25
> > > EvTime 7247.999999999998 D0128 D152 D210
> > > 
> > > I do not get it?
> > 
> > Sorry below should say *AFTER*
> 
> Uuuuuh i think i get it the index of all items change....
> 
> Well, well it seem a while loop, would be more suitable.

First try just stall in loop, there must be a general solution to this that i do  not remember....

function removeTrackMessages(){
 
  for (i=0;i<track[tracknr].time.length;i++){
     if(track[tracknr].time[i]>=rs && track[tracknr].time[i]<=re){
       track[tracknr].time.splice(i,0);
       track[tracknr].data0.splice(i,0);
       track[tracknr].data1.splice(i,0);
       track[tracknr].data2.splice(i,0);
       track[tracknr].outport.splice(i,0);
       track[tracknr].portname.splice(i,0);
       track[tracknr].midichannel.splice(i,0);
       track[tracknr].program.splice(i,0);
      console.log("did remove "+i);
      
       i--;
     }
  }
}

[toc] | [prev] | [next] | [standalone]


#34579

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-01-17 00:33 -0800
Message-ID<6b3acd35-2eb4-44ff-b197-c39f2bb76712@googlegroups.com>
In reply to#34578
Den onsdag 17 januari 2018 kl. 09:26:11 UTC+1 skrev Jonas Thörnvall:
> Den onsdag 17 januari 2018 kl. 09:11:38 UTC+1 skrev Jonas Thörnvall:
> > Den onsdag 17 januari 2018 kl. 06:45:37 UTC+1 skrev Jonas Thörnvall:
> > > Den onsdag 17 januari 2018 kl. 06:41:24 UTC+1 skrev Jonas Thörnvall:
> > > > function makeTrack()
> > > > {
> > > >    for (var m = 1; m < 16; m ++ )
> > > >    {
> > > >      track[m] ={
> > > >      time:[],
> > > >      data0:[],
> > > >      data1:[],
> > > >      data2:[]
> > > >    };
> > > >    }
> > > >    defaultTrack();
> > > >    return track;
> > > > }
> > > > 
> > > > function removeTrackMessages(){
> > > >   for (var i=0;i<track[tracknr].time.length;i++){
> > > >      if(track[tracknr].time[i]>=rs && track[tracknr].time[i]<=re){
> > > >        track[tracknr].time.splice(i,1);
> > > >        console.log("did remove "+i);
> > > >      }
> > > >   }
> > > > }
> > > > 
> > > > Why does not the code above not remove all of the event messages recorded? 
> > > > If i "overdub" manytimes without recording any new messages it finally will.
> > > > 
> > > > rs and re are start and endtimes for recording. 
> > > > 
> > > > I try to implement "replace" or "overdub" so remove TrackMessages is called if you chose to "replace" the current recording events within bar constraint rs time bar 4  re time bar 8. 
> > > > 
> > > > So rs and re hold timecode depending on bpm and start end bar.
> > > > But it just will not do what i thought, i can't see how it can skip remove events?
> > > > 
> > > > I do not know if it have with the time format of performance now todo?
> > > > Can this cause trouble 510.0000000000001 because that is what is stored.
> > > > 
> > > > Even a hint would be helpful. I do not like spend time on mysteries so i go on to overdub instead, and sort events correct after overdub. 
> > > > 
> > > > Example DATA "BEFORE REPLACE" removeTrackMessages()
> > > > EvTime 2039 D0144 D157 D242
> > > > EvTime 2330.999999999998 D0144 D160 D21
> > > > EvTime 2670 D0128 D157 D25
> > > > EvTime 2686 D0144 D164 D231
> > > > EvTime 2855 D0128 D160 D21
> > > > EvTime 2903 D0128 D164 D25
> > > > EvTime 4593.999999999998 D0144 D150 D210
> > > > EvTime 4930.000000000002 D0144 D153 D21
> > > > EvTime 5181.999999999998 D0144 D157 D268
> > > > EvTime 5215.000000000002 D0128 D150 D25
> > > > EvTime 5355.995000000001 D0128 D153 D21
> > > > EvTime 5401.999999999998 D0128 D157 D227
> > > > EvTime 6373.994999999997 D0144 D145 D231
> > > > EvTime 6738.000000000002 D0144 D148 D227
> > > > EvTime 7015.999999999998 D0144 D152 D255
> > > > EvTime 7058.000000000002 D0128 D145 D25
> > > > EvTime 7224.999999999998 D0128 D148 D25
> > > > EvTime 7247.999999999998 D0128 D152 D210
> > > > 
> > > > Example DATA "BEFORE REPLACE" removeTrackMessages()
> > > > EvTime 2330.999999999998 D0144 D160 D21
> > > > EvTime 2686 D0144 D164 D231
> > > > EvTime 2903 D0128 D164 D25
> > > > EvTime 4930.000000000002 D0144 D153 D21
> > > > EvTime 5215.000000000002 D0128 D150 D25
> > > > EvTime 5401.999999999998 D0128 D157 D227
> > > > EvTime 6738.000000000002 D0144 D148 D227
> > > > EvTime 7058.000000000002 D0128 D145 D25
> > > > EvTime 7247.999999999998 D0128 D152 D210
> > > > 
> > > > I do not get it?
> > > 
> > > Sorry below should say *AFTER*
> > 
> > Uuuuuh i think i get it the index of all items change....
> > 
> > Well, well it seem a while loop, would be more suitable.
> 
> First try just stall in loop, there must be a general solution to this that i do  not remember....
> 
> function removeTrackMessages(){
>  
>   for (i=0;i<track[tracknr].time.length;i++){
>      if(track[tracknr].time[i]>=rs && track[tracknr].time[i]<=re){
>        track[tracknr].time.splice(i,0);
>        track[tracknr].data0.splice(i,0);
>        track[tracknr].data1.splice(i,0);
>        track[tracknr].data2.splice(i,0);
>        track[tracknr].outport.splice(i,0);
>        track[tracknr].portname.splice(i,0);
>        track[tracknr].midichannel.splice(i,0);
>        track[tracknr].program.splice(i,0);
>       console.log("did remove "+i);
>       
>        i--;
>      }
>   }
> }

Ooops where did the zeros come from ;)

[toc] | [prev] | [next] | [standalone]


#34580

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-01-17 00:35 -0800
Message-ID<18283590-8ae2-4c6d-b1e7-43ff86d83409@googlegroups.com>
In reply to#34579
Den onsdag 17 januari 2018 kl. 09:34:04 UTC+1 skrev Jonas Thörnvall:
> Den onsdag 17 januari 2018 kl. 09:26:11 UTC+1 skrev Jonas Thörnvall:
> > Den onsdag 17 januari 2018 kl. 09:11:38 UTC+1 skrev Jonas Thörnvall:
> > > Den onsdag 17 januari 2018 kl. 06:45:37 UTC+1 skrev Jonas Thörnvall:
> > > > Den onsdag 17 januari 2018 kl. 06:41:24 UTC+1 skrev Jonas Thörnvall:
> > > > > function makeTrack()
> > > > > {
> > > > >    for (var m = 1; m < 16; m ++ )
> > > > >    {
> > > > >      track[m] ={
> > > > >      time:[],
> > > > >      data0:[],
> > > > >      data1:[],
> > > > >      data2:[]
> > > > >    };
> > > > >    }
> > > > >    defaultTrack();
> > > > >    return track;
> > > > > }
> > > > > 
> > > > > function removeTrackMessages(){
> > > > >   for (var i=0;i<track[tracknr].time.length;i++){
> > > > >      if(track[tracknr].time[i]>=rs && track[tracknr].time[i]<=re){
> > > > >        track[tracknr].time.splice(i,1);
> > > > >        console.log("did remove "+i);
> > > > >      }
> > > > >   }
> > > > > }
> > > > > 
> > > > > Why does not the code above not remove all of the event messages recorded? 
> > > > > If i "overdub" manytimes without recording any new messages it finally will.
> > > > > 
> > > > > rs and re are start and endtimes for recording. 
> > > > > 
> > > > > I try to implement "replace" or "overdub" so remove TrackMessages is called if you chose to "replace" the current recording events within bar constraint rs time bar 4  re time bar 8. 
> > > > > 
> > > > > So rs and re hold timecode depending on bpm and start end bar.
> > > > > But it just will not do what i thought, i can't see how it can skip remove events?
> > > > > 
> > > > > I do not know if it have with the time format of performance now todo?
> > > > > Can this cause trouble 510.0000000000001 because that is what is stored.
> > > > > 
> > > > > Even a hint would be helpful. I do not like spend time on mysteries so i go on to overdub instead, and sort events correct after overdub. 
> > > > > 
> > > > > Example DATA "BEFORE REPLACE" removeTrackMessages()
> > > > > EvTime 2039 D0144 D157 D242
> > > > > EvTime 2330.999999999998 D0144 D160 D21
> > > > > EvTime 2670 D0128 D157 D25
> > > > > EvTime 2686 D0144 D164 D231
> > > > > EvTime 2855 D0128 D160 D21
> > > > > EvTime 2903 D0128 D164 D25
> > > > > EvTime 4593.999999999998 D0144 D150 D210
> > > > > EvTime 4930.000000000002 D0144 D153 D21
> > > > > EvTime 5181.999999999998 D0144 D157 D268
> > > > > EvTime 5215.000000000002 D0128 D150 D25
> > > > > EvTime 5355.995000000001 D0128 D153 D21
> > > > > EvTime 5401.999999999998 D0128 D157 D227
> > > > > EvTime 6373.994999999997 D0144 D145 D231
> > > > > EvTime 6738.000000000002 D0144 D148 D227
> > > > > EvTime 7015.999999999998 D0144 D152 D255
> > > > > EvTime 7058.000000000002 D0128 D145 D25
> > > > > EvTime 7224.999999999998 D0128 D148 D25
> > > > > EvTime 7247.999999999998 D0128 D152 D210
> > > > > 
> > > > > Example DATA "BEFORE REPLACE" removeTrackMessages()
> > > > > EvTime 2330.999999999998 D0144 D160 D21
> > > > > EvTime 2686 D0144 D164 D231
> > > > > EvTime 2903 D0128 D164 D25
> > > > > EvTime 4930.000000000002 D0144 D153 D21
> > > > > EvTime 5215.000000000002 D0128 D150 D25
> > > > > EvTime 5401.999999999998 D0128 D157 D227
> > > > > EvTime 6738.000000000002 D0144 D148 D227
> > > > > EvTime 7058.000000000002 D0128 D145 D25
> > > > > EvTime 7247.999999999998 D0128 D152 D210
> > > > > 
> > > > > I do not get it?
> > > > 
> > > > Sorry below should say *AFTER*
> > > 
> > > Uuuuuh i think i get it the index of all items change....
> > > 
> > > Well, well it seem a while loop, would be more suitable.
> > 
> > First try just stall in loop, there must be a general solution to this that i do  not remember....
> > 
> > function removeTrackMessages(){
> >  
> >   for (i=0;i<track[tracknr].time.length;i++){
> >      if(track[tracknr].time[i]>=rs && track[tracknr].time[i]<=re){
> >        track[tracknr].time.splice(i,0);
> >        track[tracknr].data0.splice(i,0);
> >        track[tracknr].data1.splice(i,0);
> >        track[tracknr].data2.splice(i,0);
> >        track[tracknr].outport.splice(i,0);
> >        track[tracknr].portname.splice(i,0);
> >        track[tracknr].midichannel.splice(i,0);
> >        track[tracknr].program.splice(i,0);
> >       console.log("did remove "+i);
> >       
> >        i--;
> >      }
> >   }
> > }
> 
> Ooops where did the zeros come from ;)

Fantastico!

[toc] | [prev] | [standalone]


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


csiph-web