OP-Z custom chromatic samples without OP-1: hacky solution


#1

Hi everyone,

edit: find the tool here: http://gerotakke.de/op-z-sample/
Works in your browser, samples don’t get uploaded

so I got my OP-Z today and was super impressed and happy until I tried getting my samples on it.
I couldn’t believe it at first, but I spent a lot of time and confirmed it: it really is not possible to get samples on there that you can play on the chromatic tracks without using an OP-1.
You can use OP-1 Drum Utility to create a drum sample pack but no synth sample pack.
Synth samples exported from an OP-1 work fine but no chromatic custom 14 16 mono aiffff samples. Dreams were still dreams.

I couldn’t live with this situation so I started digging and found a solution: AIFFs can have custom chunks and the OP-1 inserts a special chunk for controlling the settings for synth samples. There’s a bit of documentation about this here: https://github.com/operator1/op1/wiki/Op-1-Application-Chunk-format

The file I took for reference had a JSON string inside of this APPL chunk:
{“adsr”:[2624,576,26623,6720,4000,64,4000,4000],“base_freq”:440.0,“fx_active”:true,“fx_params”:[8896,14816,1536,6688,8000,8000,8000,8000],“fx_type”:“spring”,“knobs”:[0,28448,32503,32503,12000,0,0,9832],“lfo_active”:false,“lfo_params”:[2000,26304,5728,14464,0,0,0,0],“lfo_type”:“element”,“name”:“20140407_1233”,“octave”:1,“synth_version”:1,“type”:“sampler”}

So what I did: I opened my own custom AIFF file in a hex editor, located the SND chunk, pasted the whole AAPL chunk from the reference file before that and voila, the sample would now be loaded after being put on the disc in OP-Z content mode.

I think I’ll try and write some little software that does this automatically if there is any interest.
Is there? :slight_smile:

Best
Gero


#2

Yes there is interest. Happy to help with this also.


#3

It’s essential that someone does something about this. Thanks Gero for investigating.


#4

Ok, so let’s chat a bit how this could work. The simplest thing I can think of right now is using nodejs (since I’m fluent with that) to read an aiff file into a buffer and do exactly what I did manually: find the SSND, paste a fixed APPL before it. This is very error prone and would require users to install node and use the command line. I’m still not 100% sure that the files I created are valid aiffs (third test now, all successful). I also have an issue in the OP-Z with it, there’s some other audio content that’s played after the sample; I worked around that using an ADSR for now. It seems that there is a buffer size somewhere in there, I didn’t find that yet.
I think I could hack something together that will work like this in a couple of hours.

My ideal solution would be an electron app (yes, everybody hates them, I get it; but it runs everywhere) that uses a real aiff implementation (like libaiff) to convert all kinds of audio to mono 16 44.1k aiffs, maybe even let the user edit the JSON data and then put out a real valid aiff that can then be loaded onto the OP-Z. That would take months for me.

The best way would probably be something in between. I think I’ll start with that node thing and see where it gets us.


#5

are your files .aiff or .aif?
i think it wants .aif


#6

I used .aif. It’s not the filename, believe me, I’ve tried.


#7

Alright, the trailing sample junk was because OP-Z and OP-1 expect the samples to be exactly 6 seconds.
I’ve got the whole deal working in the browser, find it here:
http://gerotakke.de/op-z-sample/

Only drawback so far is that the APPL marker I used has a very short ADSR, I’ll update this with a better one soon.


#8

word, nice sleuthing btw.
would it be possible to add a box to enter the root note of your sample
that would feed into the ‘base_freq’ field.
would give more flexibility than just restricting to A

ps seems lame that TE didn’t account for this.
i believe the op1 will auto add the header if its not there.


#9

Meanwhile TE are just like “yeah, whatever, f*** you.” Haha, I’m kidding I know the issue is more complex than this, but my comment makes me laugh.


#10

Thanks Gero, it worked with an old dusty sample.


#11

@docshermsticks said:
would it be possible to add a box to enter the root note of your sample
that would feed into the ‘base_freq’ field.
would give more flexibility than just restricting to A

I guess this would work but since you need to edit the sample anyway to make it exactly 6 seconds long, I don’t really think it’s necessary. I’m a bit reluctant to do any manipulations to the chunk since I don’t really know what I’m doing :wink: There might be a buffer length info somewhere in there and changing it could screw up the file in a bad way, things like that.


#12

My dusty old sample was around 4 secs. something. And it worked.


#13

@eyescream54 said:
My dusty old sample was around 4 secs. something. And it worked.

Have you tried holding the key (and have the adsr adjusted so it plays out) ? For me that played some other random samples until the 6 seconds were full.


#14

Oh damn. That’s what is happening. I actually shortened the sound to get a guitar stab. And I thought I didn’t crop properly. I even deleted the sample for an even shorter one. And when I got back in the Z , still a long sample. So my first reflex was to think that there was a bug in deleting samples. That is so funny. Thanks for making that process clear Gero.


#15

Thanks for doing the code work gero. I’m curious–does the sample playback loop or is it just oneshot?

I tried and am only getting Oneshot.
Cheers,


#16

Hi Minch,

we figured out how to do looping, there’s another thread. However the controls are pretty strange and we haven’t been able to produce a perfect loop, always a nasty click at the loop point so it doesn’t really make sense to add it to the tool. I’ve given up on the subject (twice now). Thead is here: UPDATE: Perl script to convert sound files into OP-1 / OP-Z SYNTH or DRUM samples
Cheers,
Gero


#17

Hmm. Have you tried asking Teenage Engineering?

Have another query–have we worked out what the P1 and P2 actually do?


#18

P1 is bitcrushing, P2 does nothing. No way to change it.
I contacted TE sometime last year and it took over 2 months to get a reply in which they didn’t even address any of my questions. I won’t be contacting them again; the one thing I’d ask for is my money back (yes, I’m super pissed by now)


#19

That’s some bad news right there gero, you got rid of it? Without your site I wouldn’t have any decent samples on my
OP-Z. I had an op1 since the early days and if you were to compare what the op1 was when it was first launched to what it has become I imagine a lot of people might not have bothered with it. It will get better and more features will get added but not sure about this looping issue as I contacted them about looping options on the op1 years ago and nothing changed so I won’t hold my breath for a looping option and if it does arrive it will be very basic. Surprised and worried TE didn’t give you a bit more respect tho gero since their product relies on your work.


#20

Sorry to open old wounds. It’s funny, I assumed that TE would be good with it’s customers–but considering that they are shit at meeting product demand I don’t know why I thought that (especially with the OP-1). Just for good measure, I will email them and see what happens and respond to you in 2 months.

They must have a plan, surely…everything else seems well thought out. Perhaps they plan to monetize sample packs… but they do allow people to produce their own visuals… hmm

Bitcrushing sucks.

I used to own a Novation Circuit–that thing evolved overtime with many quality firmware updates that really changed the function of the device… here is to hoping the same thing will happen to the OP-Z. I will note one cool thing from the most recent patch update–you can now increase the sequence length to 16 times the original length.

But yeah–we need some synthesis control. Maybe we can ask Cuckoo to have some influence?

Thanks Gero