Sophisticated loCC/hiCC approach?

Discussion on the SFZ implementation and opcodes available in the ARIA engine.

Moderators: eric_telemaque, davidv

niki
Posts: 15
Joined: Tue Feb 23, 2016 8:12 pm

Sophisticated loCC/hiCC approach?

Postby niki » Fri Feb 26, 2016 5:52 pm

Hi!

I am looking for elegant way to disable/enable playing of sample depending on CC value.
There is currently nice and simple way with loCC/hiCC. But in some cases this way dramatically increases number of regions and size of sfz file. May be I am missing something, but is there more elegant way than one loCC/hiCC for region?

Example:
CC99 | Sample
0-9 | A
10-19 | B
20-29 | A
30-39 | B

We have 2 samples, but have to use 4 regions:

Code: Select all

<region> sample=A
loCC99=0 hiCC99=9
<region> sample=B
loCC99=10 hiCC99=19
<region> sample=A
loCC99=20 hiCC99=29
<region> sample=B
loCC99=30 hiCC99=39


Now if I have something around 30 segments of CC values with 7 samples (and considering keyswitches, velocity switches and other CCs and this was only for 1 key!)... OMG... Lots and lots of copy-paste and regions. (Which of course could be done, but may be there is another way?.. :roll:)

Main problem here (as I see it) is that we have no OR mechanism for deciding if region will play or not (only AND in some form)...

I have come already to solution that seems to work. (not so elegant though, and I am not sure that it won't make more harm in future if I choose this way)
Through custom curves and delay. (May be there is better way than using delay, but 100 seconds seem enough to be sure that sample will never actually play)

Code: Select all

<curve> curve_index=183 v0=0 v9=0 v10=1 v19=1 v20=0 v29=0 v30=1 v39=1
<curve> curve_index=184 v0=1 v9=1 v10=0 v19=0 v20=1 v29=1 v30=0 v39=0
<group>
delay_onCC99=100
<region> sample=A
delay_curveCC99=183
<region> sample=B
delay_curveCC99=184


Pros:
1) Less regions
2) Simple coding

Cons:
1) There are only around 240 curves available (I will need around 170 just for this task, not many left in reserve)
2) Eats voices (I am not sure if it really eats CPU processing power, needs testing or answer from developers)
3) Possible problems of using delay for what it wasn't actually designed (?)

Any other ideas?
Thanks!!

pljones
Posts: 100
Joined: Wed Oct 15, 2014 2:05 pm

Re: Sophisticated loCC/hiCC approach?

Postby pljones » Fri Feb 26, 2016 6:26 pm

The size of an SFZ text file is trivial compared to a WAV file... And again, regardless of the number of regions referencing a sample, that sample only gets loaded once. (I think there are some edge cases if you're using start/end/reverse here but in general, I'm pretty sure you simply don't need to worry about it.)

Stick with loCC/hiCC and get an editor that makes editing them easier, format your regions more sparingly (i.e. not on multiple lines)

<group> key=46 lovel=001 hivel=009 seq_length=8 seq_position=1
<region> loCC4=000 hiCC4=009 sample=tight_quiet_hihat_1.wav
<region> loCC4=010 hiCC4=029 sample=loose_quiet_hihat_1.wav
<region> loCC4=030 hiCC4=127 sample=open_quiet_hihat_1.wav

That format is nice and easy to read -- i.e. it says what it's doing clearly - and it's quick to adjust if you decide you want to change things a bit, etc. With Notepad++, you can do some neat editing tricks like changing the "1" before the ".wav" on all the regions by selecting vertically and hitting "2", for example, which is great for copy/paste stuff. I've done drum kits where the number of regions per note is close to 100 because of velocity layers, round robins and CC positions - it doesn't take that much effort.

Of course, if the sample names can be parsed to determine their region details, you could script the production of the SFZ file and save time (assuming writing the script takes less time than writing the SFZ file... or is more fun...).

If you don't want everything in one long file, you can break the file up into sensible chunks and have them #included in a top-level file, too.

niki
Posts: 15
Joined: Tue Feb 23, 2016 8:12 pm

Re: Sophisticated loCC/hiCC approach?

Postby niki » Fri Feb 26, 2016 7:00 pm

pljones wrote:The size of an SFZ text file is trivial compared to a WAV file... And again, regardless of the number of regions referencing a sample, that sample only gets loaded once.


Well, I just thought that there might be some restriction for max number of regions. My sfz may end up with 100,000+ regions with what I have currently in mind (if I am able to implement all of that).

pljones wrote:With Notepad++, you can do some neat editing tricks


Thanks for all nice advice!
I already use Notepad++ and I love it! =)

pljones wrote:If you don't want everything in one long file, you can break the file up into sensible chunks and have them #included in a top-level file, too.


Oh, many thanks!! I never knew of #include option (it is not in Simon Cann's book and I haven't seen it in other sources yet). This will be simpler with this.

pljones
Posts: 100
Joined: Wed Oct 15, 2014 2:05 pm

Re: Sophisticated loCC/hiCC approach?

Postby pljones » Sat Feb 27, 2016 3:16 am

If you've not got a user defined language for SFZ for Notepad++, I've done one that's "good enough" for a lot of things (tho I'd be interested in more complete ones):
http://www.drealm.info/sfz/sfz-udl.xml

niki
Posts: 15
Joined: Tue Feb 23, 2016 8:12 pm

Re: Sophisticated loCC/hiCC approach?

Postby niki » Sat Feb 27, 2016 8:18 am

pljones wrote:If you've not got a user defined language for SFZ for Notepad++, I've done one that's "good enough" for a lot of things (tho I'd be interested in more complete ones):
http://www.drealm.info/sfz/sfz-udl.xml


Oh, it is your website! Thank you, it is very useful to start with sfz programming! And I already have downloaded your xml for Notepad++

By the way I tried "one line - one region" by your advice, and it greatly improved my programming speed! Thanks a lot!!


Return to “SFZ Programming”

Who is online

Users browsing this forum: No registered users and 1 guest