Dump content between markers in Bach.roll

Discussions, advice, bug reports and much more about the "bach" environment.
Post Reply
dhirst
Posts: 5
Joined: Sat Mar 10, 2018 11:44 am

Dump content between markers in Bach.roll

Post by dhirst » Sat Mar 10, 2018 12:05 pm

I am a new user of Bach so please excuse this naive question, but I have spent days looking at the documentation and examples and I can’t find a simple way to dump all the note data (llll) that is contained between two markers, eg. Marker 1 & marker 2 - from a bach.roll into another bach.roll
Can anyone help with this?
I have looked at objects like cage.slice etc but it requires two time specifications. I want to just place two markers and then dump the stuff between them.
Cheers,
David

danieleghisi
Site Admin
Posts: 1347
Joined: Fri Dec 03, 2010 1:25 pm

Re: Dump content between markers in Bach.roll

Post by danieleghisi » Sat Mar 10, 2018 11:13 pm

Hi, and welcome aboard!

[cage.slice], without any argument, does exactly that: it slices via markers.
Have a look at its help file.

dhirst
Posts: 5
Joined: Sat Mar 10, 2018 11:44 am

Re: Dump content between markers in Bach.roll

Post by dhirst » Sun Mar 11, 2018 1:11 am

Thank you Daniele that is very helpful, but cage.slice works with bach.pick which assumes you already know the number of sections you have sliced the roll into.
What if I have a long roll, with say 7 markers, and I want to dump the section between marker 4 and marker 5?

I've tried bach.nth since I can input its argument via the right inlet to select the nth slice, but bach.nth doesn't seem to work in the same manner as bach.pick

For example bach.nth 2 doesn't give the same (or any roll) output as the 2nd outlet of bach.pick 1 2 3

Is there a way I can use bach.nth to obtain the nth slice of a bach.roll/cage.slice combination to dump into another bach.roll?

cheers,
David

danieleghisi
Site Admin
Posts: 1347
Joined: Fri Dec 03, 2010 1:25 pm

Re: Dump content between markers in Bach.roll

Post by danieleghisi » Sun Mar 11, 2018 8:17 am

Yes, just put a [bach.flat 1] after [bach.nth].

You might want to follow the first bach tutorial (the one about lllls) if you want to know why this works.

Best,
d

dhirst
Posts: 5
Joined: Sat Mar 10, 2018 11:44 am

Re: Dump content between markers in Bach.roll

Post by dhirst » Sun Mar 11, 2018 8:59 am

Yes that works brilliantly. Thanks very much - again. Now back to the tutorials to work out why, etc.
Thanks
David

Post Reply