PURE DATA forum~

...that deal with pure data

You are not logged in.

#1 2012-02-20 07:16:44

Maelstorm
Administrator

Casio CZ oscillators

This abstraction attempts to emulate the Casio CZ oscillators. For those of you who don't know, the CZ oscillators were early digital oscillators that worked by distorting the phase look-up of a cosine waveform. This allowed the oscillators to create unique waveforms using minimal computation and memory. Modulating the phase with these oscillators has a sound similar to a filter sweep, though it is not an accurate emulation. But it still sounds pretty cool. Makes for some great bass sounds.

I don't actually have access to a CZ (I did once, and I didn't take advantage...SON OF BITCH!), but I do have Reason 4. The Thor synth has oscillators that emulate the CZ series. So I basically did some reverse engineering, along with studying the patent, and came up with these. They're pretty close to Thor's. I didn't bother with the bit depth, though, so if you really want to make it sound like early digital, throw in a bit crusher after it.

The helpfile uses my [spectrum.mmb~] abstraction to display the spectrum. If you don't have it, you can grab it from my library in the signature.

And in case you're wondering, since Pd-0.43-extended is doing away with loading libraries on startup and adding paths, I'm getting rid of the ".mmb" extension on my abstractions. I only put it there to keep from worrying about conflicting names, but since either [import] or namespaces are going to be forced now, it doesn't make sense to keep it. [mmb/spectrum.mmb~] is kind of redundant. :-)

UPDATE 3/22/2012: DC offset filter removed, now all waveforms are in the range of -1 to 1.

Last edited by Maelstorm (2012-03-22 19:40:41)


.mmb   |   My library

Attachments:
Attachment Icon cz-osc~-help.pd, Size: 6,791 bytes, Downloads: 315
Attachment Icon cz-osc~.pd, Size: 8,010 bytes, Downloads: 324

Offline

 

#2 2012-02-20 07:59:37

mod
Administrator

Re: Casio CZ oscillators

sweet!  I did some basic cz style oscillators a couple of years ago, but didn't really know what I was doing.  I got the filter sweep effect happening, but it was never as smooth as what you've got here. 

I just love the concept of pd (phase distortion).  It suits the digital domain so much better than emulating analogue VCO->VCF subtractive synthesis processes.

Sweeping those resonant waveforms is sounding so cool here!  Cheers!

Offline

 

#3 2012-02-20 11:53:34

moog1
Member

Re: Casio CZ oscillators

Indeed, the resonant osc's are cracking! :)

Offline

 

#4 2012-02-20 12:34:04

mod
Administrator

Re: Casio CZ oscillators

Is there any particular reason to have the two different scalings for resonance controlled externally from the abstraction?  Why not just have the resonance scaling internally managed in the abstraction, so that all resonances are scaled 0 to 1, regardless of waveform ??

Offline

 

#5 2012-02-20 13:26:43

mod
Administrator

Re: Casio CZ oscillators

try putting a lop~ between the phasor~ and the cz-osc~, and then modulating the cutoff of that lowpass.  you get some really nice buzzy discontinuities in the waveform, makes it sound nice and hollow/vocally

Offline

 

#6 2012-02-20 18:46:21

Maelstorm
Administrator

Re: Casio CZ oscillators

mod wrote:

Is there any particular reason to have the two different scalings for resonance controlled externally from the abstraction?  Why not just have the resonance scaling internally managed in the abstraction, so that all resonances are scaled 0 to 1, regardless of waveform ??

I did that to give the user more intuitive and flexible control. If I scaled the resonances to be between 0 and 1, then that means an upper limit would have to be set. The limits are needed for the non-resonant oscillators, but it's just arbitrary for the resonant ones.

Also, it just makes it easier to tune the resonant frequency, since it's just the modulation amount * fundamental frequency.


.mmb   |   My library

Offline

 

#7 2012-02-21 05:56:47

acreil
Member

Re: Casio CZ oscillators

Neato. I'd made the sawtooth and resonant waves before, but it was only for fun. Strangely it turns out that the equation used to warp the phase of the cosine into an approximate sawtooth is useful for other things. I've used it to control a piecewise linear random modulator, and in a chorus algorithm that maintains constant and symmetric detuning depth (in cents), regardless of modulation rate.

I recently got a CZ-1 also, but honestly I'm not that thrilled by hardware anymore. There's too much aliasing and the oscillator phases reset for each note.

Offline

 

#8 2012-02-21 06:34:59

Maelstorm
Administrator

Re: Casio CZ oscillators

acreil wrote:

Neato. I'd made the sawtooth and resonant waves before, but it was only for fun.

The resonant waveforms are surprisingly simple. They're just an ideal waveform set to the fundamental frequency amplitude modulating a hard-synced cosine wave set to the resonant frequency. About as simple as phase distortion gets, if you even want to call it that. The phase distortion is really just the hard-syncing. It really seems more like an AM-based oscillator in my view.

Strangely it turns out that the equation used to warp the phase of the cosine into an approximate sawtooth is useful for other things. I've used it to control a piecewise linear random modulator, and in a chorus algorithm that maintains constant and symmetric detuning depth (in cents), regardless of modulation rate.

That sounds cool. Care to share? ;-)

I recently got a CZ-1 also, but honestly I'm not that thrilled by hardware anymore. There's too much aliasing and the oscillator phases reset for each note.

Is there no mono mode? I get phase reset for polyphonic notes, but if you're playing a monophonic synth, that's just stupid.

A few weeks ago I was talking with some people about "that vintage sound". They were going on and on about how great analogue is, and I was getting quietly annoyed because the difference between analogue and digital (in terms of sound quality) isn't what it used to be. One of them eventually started talking about how cool the DX7 was. I then told him how digital the DX7 was. Didn't matter, still vintage.

[palm(
|
[face]


.mmb   |   My library

Offline

 

#9 2012-02-26 01:40:41

acreil
Member

Re: Casio CZ oscillators

Maelstorm wrote:

The phase distortion is really just the hard-syncing. It really seems more like an AM-based oscillator in my view.

I think the resonant waves were inspired somewhat by the formant synthesis stuff that people were doing in the 70s/80s. The other "phase distortion" waves are similar to some things Yamaha patented in the late 70s.

That sounds cool. Care to share? ;-)

I'll look them over and follow up with a .zip file

Is there no mono mode? I get phase reset for polyphonic notes, but if you're playing a monophonic synth, that's just stupid.

The CZ-1 has a mono mode, but it sucks. There's no legato; it plays a whole new note with reset oscillator phases and everything. I think Casio didn't permit free running oscillators in any of their instruments. You'd think multiple oscillators per voice in the HT-6000 (4 oscillators per voice) or VZ-1 (8 per voice, though it does at least have a legato mono mode) would be ideal for lush, organic detuning, but it just makes this cheesy flangey sound that's exactly the same for each note.

My hardware fetishism kind of runs out of steam when I realize I can design things without such severe flaws.

A few weeks ago I was talking with some people about "that vintage sound". They were going on and on about how great analogue is, and I was getting quietly annoyed because the difference between analogue and digital (in terms of sound quality) isn't what it used to be. One of them eventually started talking about how cool the DX7 was. I then told him how digital the DX7 was. Didn't matter, still vintage.

I don't like how worked up people get over the DX7's "vintage status" and its sound compared to something like FM8 (which is a lot closer to how FM was supposed to sound all along). Its gritty sound is nice for some things, but people never seem to correctly attribute it to the low resolution lookup tables.

Offline

 

#10 2012-02-26 05:04:04

mod
Administrator

Re: Casio CZ oscillators

i think the low res low samplerate effects really suit the style of FM done by the DX7.  i made a dx7 emulator in pd a few years back, and it sounded so thin when i ran it at 44.1khz samplerate.  It was much better when i changed pd's global samplerate to 28khz.

acreil, are you suggesting that the sine waves are also in much lower resolution tables?  that might be another reason why i never got THAT sound nailed properly.  I know i had all the algorithms done pretty much correctly.

anyway, i think that the higher samplerate and better resolution you get with pd really lends itself to these phase distortion waveforms.  They sound lovely.

Offline

 

#11 2012-02-27 04:44:20

acreil
Member

Re: Casio CZ oscillators

The DX7's sample rate really isn't that low (50 kHz). The CZ-1 is 40 kHz, as far as I know.

I think the big thing is that it uses lookup tables to avoid a multiplication (this should apply to the Casio CZ/VZ stuff as much as the DX7, but I don't remember seeing it specifically mentioned in Casio's patents).

For a piecewise linear envelope A(t), Instead of exp(A(t)) * sin(2pi*f*t), it actually implements something like exp(A(t) + log(sin(2pi*f*t))), where the sin() table is instead replaced with log(sin()). Of course in modern software you'd use a nicely interpolated high resolution sine table and floating point multiply. If you have access to a real DX7 you can see what happens when you use a sub-audio modulator on an audio rate carrier. From standard FM theory you'd expect to hear some sort of smooth vibrato, but the result is actually really nasty. You won't get that in modern software. I don't remember the actual table resolution. It's probably mentioned in the DX7 patent.

I attached the pd abstractions. No promises on them being useful. Now that I'm looking at it, I don't really remember exactly how this relates to the CZ phase distortion stuff, but it's in there somewhere. You can one equation to map a [phasor~] to a piecewise linear function that turns a [cos~] into a phase distortion pseudo-sawtooth, or for controlling the distribution of a piecewise linear random modulator, or (if I remember right) to keep the "pitch shift up" and "pitch shift down" portions of a triangle-modulated delay symmetric. This last one isn't really obvious, but if you modulate a delay with a depth of, say, 1 octave, the rising portion will play back at 2x speed (+ 1 octave) while the falling portion will effectively "stop" the read pointer by slowing it to 0x speed (-infinite octaves, so to speak). The trick is to distort the triangle such that it's rising over one third of its period and falling over two thirds. So then you get 2x alternating with 0.5x, as you'd expect.

Last edited by acreil (2012-02-27 04:48:48)


Attachments:
Attachment Icon pdmod.zip, Size: 20,325 bytes, Downloads: 110

Offline

 

#12 2012-02-27 06:32:19

mod
Administrator

Re: Casio CZ oscillators

hmm,

when i spoke to Sean Bolton, programmer of the Hexter DX7 emulator, he told me 28khz samplerate.  His emulator sounds almost indistinguishable from a DX7 in most cases.

However, i just read an interview with John Chowning saying that the DX7 did run at around 57khz for the DAC.

*scratches head*

Offline

 

#13 2012-02-27 15:20:44

acreil
Member

Re: Casio CZ oscillators

I'd heard previously that it was 28 (and 57), but I don't think that's right. There's a diagram in the service manual (also in the patent) that explains it. The master clock is about 4.8 MHz, and each operator is calculated in one clock cycle, so it's 4.8 MHz/96 = 50 kHz. Actually it's closer to 49 kHz. I also confirmed this with someone at Yamaha.

Offline

 

#14 2012-02-28 17:31:52

JKP
Member

Re: Casio CZ oscillators

thanks !!!

Offline

 

#15 2012-03-12 05:43:52

billystiltner
Member

Re: Casio CZ oscillators

yo mmb, I've had some example cz patches sitting around for a while and just now got around to checking them out. One didnt sound right.   So I seen


if(x > d)
   return sin( x * d / pi);
else 
   return sin((x-d) * pi / (1-d)  +  pi);

this on wikipedia and then just put it in an expr taht was fed by 2 analog(thor analog with matching phases.) osces that can also be wavteable osces.  yo can;t hear it much here  because Im overdriving the moog(what a moog after a cz? haha) and some alindx~ I haven't added the drumloop windowing yet but boy  thatll  be fun fo sho.  warning 100s ofmb download of 25 minute old school breaks n bass pure pure data download. http://www.ubuntuone.com/2BoVF4dr4mp6A3aeMA3UBO

i dont know if what i done is right but I can get some clean cz sounds out of it plus distortion that dont need no more distortion. one really awesome thing is detuning the osces and then making a squae pulsewidth smaller with a filter following on the verge of resonance. it's like it sweeps through some harmonics.


I will have to check out your patches now.

Offline

 

#16 2012-03-22 19:48:10

Maelstorm
Administrator

Re: Casio CZ oscillators

I just updated [cz-osc~]. The original one had a [hip~ 35] in it as a DC offset filter to match up with the waves coming out of Thor as well as recordings I found online. I wasn't initially sure if I should include it, but I did because I thought it would be more accurate. However, I've been testing other parts of Thor and recently discovered that the DC offset is part of Reason's mixer, not the synth (I assume it's in the CZ's dac as well). This makes more sense to me, since there's no mention of a need for the DC filter in the patent, and it also makes the oscillators more manageable since now they will output in the full range of -1 to 1. Before they were roughly -.5 to .5 to leave a little headroom for the transient response of the DC filter.


.mmb   |   My library

Offline

 

#17 2012-04-01 22:59:29

LarsXI
Member

Re: Casio CZ oscillators

these are cool


we, the undersigned

Offline

 

#18 2012-05-17 22:26:30

Coalman
Member

Re: Casio CZ oscillators

these are great!

Offline

 

#19 2012-05-18 16:26:42

nestor
Member

Re: Casio CZ oscillators

Awesome, hoping I can understand the equations as some point.  Any tips on what to read to be able to deconstruct them?

Offline

 

#20 2012-05-27 06:41:04

Maelstorm
Administrator

Re: Casio CZ oscillators

Hey Nestor, the equations are basically just a linear remapping of the phase. So, taking an input of a certain range and readjusting them to a different range. It might be clearer to analyze them by sticking a [tabwrite~] in and viewing it in an array. It's also very possible that I may have made them too convoluted. :-)


.mmb   |   My library

Offline

 

#21 2012-07-01 01:13:25

acreil
Member

Re: Casio CZ oscillators

I don't think it's a big deal, but I realized I was wrong about the CZ series mono mode: it does play legato if the "portamento" setting is turned on.

Offline

 

#22 2012-07-20 15:09:31

schafferdavid
Member

Re: Casio CZ oscillators

Thanks a lot for your work, I used it to do this:  http://snd.sc/OMcZMt

Offline

 

#23 2013-02-07 15:31:30

Beetlebum
Member

Re: Casio CZ oscillators

Hi to all those into the Purity of Data!

Mael, the CZ oscillators sound really good, some of the best PD generated sound I've heard. And thanks for all your patches, I'm learning a lot from them.

A niggle - the object spectrum.mmb~.pd is failing to run under 043.4.

Here's the error output:

<!DOCTYPE: no such object
d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"/>: no such object
</div><div: no such object
.
.
many repeats of this error
.
.
</div></pre></div>: no such object
">: no such object
support</a></dd>: no such object
teachers</a></dd>: no such object
pricing</a></dd>: no such object
float: no such object
spectrum.mmb~ $0-spectrum.series
... couldn't create

Offline

 

#24 2013-02-08 00:35:04

Maelstorm
Administrator

Re: Casio CZ oscillators

[spectrum.mmb~] is from my library, linked in the signature.


.mmb   |   My library

Offline

 

#25 2013-02-08 04:13:32

Beetlebum
Member

Re: Casio CZ oscillators

Thanks, Maelstrom,

I know it's yours, I down loaded it and most of your other examples as well :>)

I couldn't get it to open at all, just a string of errors. In fact none of the files ran either. I just figured out that right clicking/saving the individual files from github was a bad thing.

I noticed the zip file bundle, downloaded that, and purged the bad files. Now they work great. Sorry for the false alarm.

BB

Last edited by Beetlebum (2013-02-08 04:14:02)

Offline

 

Board footer

Powered by PunBB
Copyright 20022005 Rickard Andersson


pd.webring info