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


Groups > comp.lang.javascript > #34576

Re: splice remove "events"

Newsgroups comp.lang.javascript
Date 2018-01-16 21:45 -0800
References <d034abe3-f4c9-49f8-b645-186fc9563c1f@googlegroups.com>
Message-ID <aea924ca-8bc6-4c72-b73d-4daa481d9183@googlegroups.com> (permalink)
Subject Re: splice remove "events"
From Jonas Thörnvall <jonas.thornvall@gmail.com>

Show all headers | View raw


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*

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

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

csiph-web