Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #36320 > unrolled thread
| Started by | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| First post | 2019-04-06 04:33 -0700 |
| Last post | 2019-04-06 05:38 -0700 |
| Articles | 4 — 1 participant |
Back to article view | Back to comp.lang.javascript
Play "subset of recorded notes during record". Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-04-06 04:33 -0700
Re: Play "subset of recorded notes during record". Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-04-06 05:23 -0700
Re: Play "subset of recorded notes during record". Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-04-06 05:30 -0700
Re: Play "subset of recorded notes during record". Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-04-06 05:38 -0700
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2019-04-06 04:33 -0700 |
| Subject | Play "subset of recorded notes during record". |
| Message-ID | <25b44a76-4d39-45cc-9063-a23c064f1187@googlegroups.com> |
function PlaylistGen() {
if (mode=="Play"){
waitEv = new Array();
for (var i = 0; i < track[0].midiMess.length; i++) {
//Generate waitlist used in play
if (i > 0) {
waitEv[i] = track[0].midiMess[i].time - track[0].midiMess[i - 1].time;
} else {
waitEv[0] = track[0].midiMess[i].time
}
}
} else is (mode=="Record"){
//////////////////////
}
}
midiMess.time is the "recorded" time for an event **to be played**. Using a startpoint we can find an offset, to next event "note" to be played.
In mode play all recorded notes are played and that is no problem.
I have all recorded notes from all tracks downmixed on a single track to be played.
But during recording of a time range "in bars", i need to set same boundary for ***playup*** as for recording to be able to play to what is already recorded.
So find "what subset of notes to playup" and what time to start play first note, depends upon "start bar-end bar" recording.
Start bar, is time zero for the played up notes. So i need to find the notes in range between start and end and get the first notes waitEv to have synced playup with the bars i will record....
That will be hard especially after some Campari.
If RS is startrec offset and RE stoprec offset is end and clock is
clock = clock + rs; This TIME will be reocrded for message
How do i select subset for playup and how do i set the conditions for notes to playup, and set the first waitEv[].
Of you go and find the conditon for else is (mode==record)....
Yeah this will be awkward...
I think it is a bit beyond your logical capabilities ;)
[toc] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2019-04-06 05:23 -0700 |
| Message-ID | <369c0322-e463-41ac-b36d-1d984c3c0326@googlegroups.com> |
| In reply to | #36320 |
Den lördag 6 april 2019 kl. 13:33:58 UTC+2 skrev Jonas Thörnvall:
> function PlaylistGen() {
> if (mode=="Play"){
> waitEv = new Array();
> for (var i = 0; i < track[0].midiMess.length; i++) {
> //Generate waitlist used in play
> if (i > 0) {
> waitEv[i] = track[0].midiMess[i].time - track[0].midiMess[i - 1].time;
> } else {
> waitEv[0] = track[0].midiMess[i].time
> }
> }
> } else is (mode=="Record"){
> //////////////////////
> }
> }
>
> midiMess.time is the "recorded" time for an event **to be played**. Using a startpoint we can find an offset, to next event "note" to be played.
>
> In mode play all recorded notes are played and that is no problem.
> I have all recorded notes from all tracks downmixed on a single track to be played.
>
> But during recording of a time range "in bars", i need to set same boundary for ***playup*** as for recording to be able to play to what is already recorded.
>
> So find "what subset of notes to playup" and what time to start play first note, depends upon "start bar-end bar" recording.
>
> Start bar, is time zero for the played up notes. So i need to find the notes in range between start and end and get the first notes waitEv to have synced playup with the bars i will record....
>
> That will be hard especially after some Campari.
>
> If RS is startrec offset and RE stoprec offset is end and clock is
> clock = clock + rs; This TIME will be reocrded for message
>
> How do i select subset for playup and how do i set the conditions for notes to playup, and set the first waitEv[].
>
> Of you go and find the conditon for else is (mode==record)....
> Yeah this will be awkward...
>
> I think it is a bit beyond your logical capabilities ;)
Seem like a good start
} else if (mode=="Record"){
if (track[0].midiMess[i].time>rs && track[0].midiMess[i].time<re) {}
}
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2019-04-06 05:30 -0700 |
| Message-ID | <0cdac358-e23d-4cad-9330-40601cfff5db@googlegroups.com> |
| In reply to | #36321 |
Den lördag 6 april 2019 kl. 14:24:00 UTC+2 skrev Jonas Thörnvall:
> Den lördag 6 april 2019 kl. 13:33:58 UTC+2 skrev Jonas Thörnvall:
> > function PlaylistGen() {
> > if (mode=="Play"){
> > waitEv = new Array();
> > for (var i = 0; i < track[0].midiMess.length; i++) {
> > //Generate waitlist used in play
> > if (i > 0) {
> > waitEv[i] = track[0].midiMess[i].time - track[0].midiMess[i - 1].time;
> > } else {
> > waitEv[0] = track[0].midiMess[i].time
> > }
> > }
> > } else is (mode=="Record"){
> > //////////////////////
> > }
> > }
> >
> > midiMess.time is the "recorded" time for an event **to be played**. Using a startpoint we can find an offset, to next event "note" to be played.
> >
> > In mode play all recorded notes are played and that is no problem.
> > I have all recorded notes from all tracks downmixed on a single track to be played.
> >
> > But during recording of a time range "in bars", i need to set same boundary for ***playup*** as for recording to be able to play to what is already recorded.
> >
> > So find "what subset of notes to playup" and what time to start play first note, depends upon "start bar-end bar" recording.
> >
> > Start bar, is time zero for the played up notes. So i need to find the notes in range between start and end and get the first notes waitEv to have synced playup with the bars i will record....
> >
> > That will be hard especially after some Campari.
> >
> > If RS is startrec offset and RE stoprec offset is end and clock is
> > clock = clock + rs; This TIME will be reocrded for message
> >
> > How do i select subset for playup and how do i set the conditions for notes to playup, and set the first waitEv[].
> >
> > Of you go and find the conditon for else is (mode==record)....
> > Yeah this will be awkward...
> >
> > I think it is a bit beyond your logical capabilities ;)
>
> Seem like a good start
>
> } else if (mode=="Record"){
> if (track[0].midiMess[i].time>rs && track[0].midiMess[i].time<re) {}
> }
Have not tested but this is what my brain told me.
function PlaylistGen() {
if (mode=="Play"){
var k=0;
waitEv = new Array();
for (var i = 0; i < track[0].midiMess.length; i++) {
//Generate waitlist used in play
if (i > 0) {
waitEv[i] = track[0].midiMess[i].time - track[0].midiMess[i - 1].time;
} else {
waitEv[0] = track[0].midiMess[i].time;
}
}
} else if (mode=="Record"){
if (track[0].midiMess[i].time>rs && track[0].midiMess[i].time<re) {
if (k > 0) {
waitEv[k] = track[0].midiMess[i].time - track[0].midiMess[i - 1].time;
} else {
waitEv[0] = track[0].midiMess[i].time;
}
k++;
}
}
}
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2019-04-06 05:38 -0700 |
| Message-ID | <9908dcc8-19ac-4609-b357-dc55e13f844a@googlegroups.com> |
| In reply to | #36322 |
Den lördag 6 april 2019 kl. 14:31:00 UTC+2 skrev Jonas Thörnvall:
> Den lördag 6 april 2019 kl. 14:24:00 UTC+2 skrev Jonas Thörnvall:
> > Den lördag 6 april 2019 kl. 13:33:58 UTC+2 skrev Jonas Thörnvall:
> > > function PlaylistGen() {
> > > if (mode=="Play"){
> > > waitEv = new Array();
> > > for (var i = 0; i < track[0].midiMess.length; i++) {
> > > //Generate waitlist used in play
> > > if (i > 0) {
> > > waitEv[i] = track[0].midiMess[i].time - track[0].midiMess[i - 1].time;
> > > } else {
> > > waitEv[0] = track[0].midiMess[i].time
> > > }
> > > }
> > > } else is (mode=="Record"){
> > > //////////////////////
> > > }
> > > }
> > >
> > > midiMess.time is the "recorded" time for an event **to be played**. Using a startpoint we can find an offset, to next event "note" to be played.
> > >
> > > In mode play all recorded notes are played and that is no problem.
> > > I have all recorded notes from all tracks downmixed on a single track to be played.
> > >
> > > But during recording of a time range "in bars", i need to set same boundary for ***playup*** as for recording to be able to play to what is already recorded.
> > >
> > > So find "what subset of notes to playup" and what time to start play first note, depends upon "start bar-end bar" recording.
> > >
> > > Start bar, is time zero for the played up notes. So i need to find the notes in range between start and end and get the first notes waitEv to have synced playup with the bars i will record....
> > >
> > > That will be hard especially after some Campari.
> > >
> > > If RS is startrec offset and RE stoprec offset is end and clock is
> > > clock = clock + rs; This TIME will be reocrded for message
> > >
> > > How do i select subset for playup and how do i set the conditions for notes to playup, and set the first waitEv[].
> > >
> > > Of you go and find the conditon for else is (mode==record)....
> > > Yeah this will be awkward...
> > >
> > > I think it is a bit beyond your logical capabilities ;)
> >
> > Seem like a good start
> >
> > } else if (mode=="Record"){
> > if (track[0].midiMess[i].time>rs && track[0].midiMess[i].time<re) {}
> > }
>
> Have not tested but this is what my brain told me.
>
> function PlaylistGen() {
> if (mode=="Play"){
> var k=0;
> waitEv = new Array();
> for (var i = 0; i < track[0].midiMess.length; i++) {
> //Generate waitlist used in play
> if (i > 0) {
> waitEv[i] = track[0].midiMess[i].time - track[0].midiMess[i - 1].time;
> } else {
> waitEv[0] = track[0].midiMess[i].time;
> }
> }
> } else if (mode=="Record"){
> if (track[0].midiMess[i].time>rs && track[0].midiMess[i].time<re) {
> if (k > 0) {
> waitEv[k] = track[0].midiMess[i].time - track[0].midiMess[i - 1].time;
> } else {
> waitEv[0] = track[0].midiMess[i].time;
> }
> k++;
> }
> }
> }
Turned out to be correct.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web