Skip to content

Commit

Permalink
added ShaperOS and OscOS3
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Pluta committed Apr 16, 2024
1 parent 1a18d43 commit 847ff7f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
build/
build_win/
OversamplingOscillators/UGens/
OversamplingOscillators/scxFiles/
Binary file added OversamplingOscillators/.DS_Store
Binary file not shown.
8 changes: 5 additions & 3 deletions OversamplingOscillators/HelpSource/OscOS3.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ DESCRIPTION::

OscOS3 is an oversampled 3D wavetable oscillator which takes a multichannel multi-wavetable buffer, allowing transformation between waveforms, rapid scanning of wavetables, and completely alias-free playback.

OscOS3 provides an internal class function, make_oscos3_mipmap, which will take any wariable waveform and convert it to a multi-octave filtered waveform with N wavetables per octave. The result is a multichannel buffer with each channel being an increasing filtered version of the original buffer. THIS FUNCTIONALITY REQUIRES THE Buf_FFT LIBRARY, which is used to quickly process the buffer in NRT mode.
OscOS3 provides an internal class function, make_oscos3_mipmap, which will take any wariable waveform and convert it to a multi-octave filtered waveform with N wavetables per octave. The result is a multichannel buffer with each channel being an increasing filtered version of the original buffer. THIS FUNCTIONALITY REQUIRES THE BufFFT LIBRARY, which is used to quickly process the buffer in NRT mode.

The oscillator uses an internal sawtooth wave to look into the oscillator wavetable. If provided an optional phase buffer (or variable phase buffer), the user can alter the shape of the lookup phasor over time.

Expand Down Expand Up @@ -65,7 +65,7 @@ ARGUMENT:: add
add

METHOD:: make_oscos3_mipmap
THIS REQUIRES THE Buf_FFT LIBRARY TO BE INSTALLED AS WELL. make_oscos3_mipmap creates a 3D buffer of variable wavetables for use with OscOS3. The user provides a single channel buffer with N wavetables loaded in it and the function produces a 3D buffer with N wavetables from left to right and M fft filtered versions of the buffer with increasingly fewer and fewer harmonics in each channel. The last channel should contain only a sine wave in each wavetable.
THIS REQUIRES THE BufFFT LIBRARY TO BE INSTALLED AS WELL. make_oscos3_mipmap creates a 3D buffer of variable wavetables for use with OscOS3. The user provides a single channel buffer with N wavetables loaded in it and the function produces a 3D buffer with N wavetables from left to right and M fft filtered versions of the buffer with increasingly fewer and fewer harmonics in each channel. The last channel should contain only a sine wave in each wavetable.

ARGUMENT:: server
the local server
Expand Down Expand Up @@ -103,7 +103,9 @@ code::
.addAll(Env([0,1,1,-1,-1,0],[0,1,0,1,0]).asSignal(~fft_size))
.addAll(Env([0,1,-1,0],[1,0,1]).asSignal(~fft_size));

~signal.write(Platform.defaultTempDir++"standard_waves.wav");
//Signal.write requires the SignalBox quark...which you can download with one click. Highly recommended.
//Otherwise this won't work
~signal.write(Platform.defaultTempDir++"standard_waves.wav", "WAV");
)

//use make_oscos3_mipmap to create a 3D buffer of variable wavetables from the temporary file
Expand Down
8 changes: 4 additions & 4 deletions OversamplingOscillators/OversamplingOscillators.sc
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ OscOS3 : PureUGen {

out_file = Platform.defaultTempDir++"oscos3d_temp.wav";

nrt_server = Server(("nrt"++NRT_Server_ID.next).asSymbol,
nrt_server = Server(("oscOS_nrt"++1000.rand).asSymbol,
options: Server.local.options
.numOutputBusChannels_(num_bufs)
.numInputBusChannels_(num_bufs)
Expand Down Expand Up @@ -731,13 +731,13 @@ OscOS3 : PureUGen {
nrt_jam.recordNRT(
outputFilePath: out_file.standardizePath,
sampleRate: 44100,
headerFormat: "wav",
headerFormat: "WAV",
sampleFormat: "float",
options: nrt_server.options,
duration: signal_sf.numFrames/44100,
action: {
SoundFile.normalize("/Users/spluta1/Library/Application Support/SuperCollider/tmp/oscos3d_temp.wav", "/Users/spluta1/Library/Application Support/SuperCollider/tmp/oscos3d_temp2.wav",numFrames:signal_sf.numFrames, linkChannels: normalize_link_chans);
Buffer.read(server, "/Users/spluta1/Library/Application Support/SuperCollider/tmp/oscos3d_temp2.wav", action:{|buf| action.value(buf)});
SoundFile.normalize(Platform.defaultTempDir++"oscos3d_temp.wav", Platform.defaultTempDir++"oscos3d_temp2.wav",numFrames:signal_sf.numFrames, linkChannels: normalize_link_chans);
Buffer.read(server, Platform.defaultTempDir++"oscos3d_temp2.wav", action:{|buf| action.value(buf)});
"done".postln;
}
);
Expand Down
4 changes: 3 additions & 1 deletion OversamplingOscillators/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
OversamplingOscillators (and BandLimited as well)
Sam Pluta

Optional Dependencies: BufFFT Plugins and SignalBox Quark

Oversampling Oscillators use the VariableOversampling class from Jatin Chowdhury's ChowDSP library. That source is included with the download.

Standard Oversampling Oscillators include SinOscOS, TriOS, SawOS, SquareOS, VarSawOS, PMOscOS, PM7OS, FM7OS, FM7aOS, and FM7bOS.

Oversampled WAVETABLE Oscillators include OscOS and OscOS3.
Oversampled WAVETABLE Oscillators include OscOS and OscOS3. It is highly recommended to download the BufFFT library to be able to construct 3d wavetables for OscOS3 on the NRT server.

Oversampled Waveshapers include ShaperOS, ShaperOS2, BuchlaFoldOS, and SergeFoldOS.

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
OversamplingOscillators (and BandLimited as well)
Sam Pluta

Optional Dependencies: BufFFT Plugins and SignalBox Quark

Oversampling Oscillators use the VariableOversampling class from Jatin Chowdhury's ChowDSP library. That source is included with the download.

Standard Oversampling Oscillators include SinOscOS, TriOS, SawOS, SquareOS, VarSawOS, PMOscOS, PM7OS, FM7OS, FM7aOS, and FM7bOS.

Oversampled WAVETABLE Oscillators include OscOS and OscOS3.
Oversampled WAVETABLE Oscillators include OscOS and OscOS3. It is highly recommended to download the BufFFT library to be able to construct 3d wavetables for OscOS3 on the NRT server.

Oversampled Waveshapers include ShaperOS, ShaperOS2, BuchlaFoldOS, and SergeFoldOS.

Expand Down

0 comments on commit 847ff7f

Please sign in to comment.