Git Product home page Git Product logo

osc_gen's People

Contributors

bitsgalore avatar dangayle avatar harveyormston avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

osc_gen's Issues

Is it possible to morph between whole wavetables?

Is it possible to?

For example lets say I create a wavetable with a sine and another wavetable with a sample, can I then morph between these?

`#Variables
wt_size_var = 100
wt_window_var = 2048

wt_output = wavetable.WaveTable(num_waves=wt_size_var)
wt_1 = wavetable.WaveTable(num_waves=wt_size_var)
wt_2 = wavetable.WaveTable(num_waves=wt_size_var)

sig_gen_1 = sig.SigGen()
sig_gen_1.num_points = 2048

cycle_1 = sig_gen_1.sin()

wt_1.waves = [cycle_1 for _ in range(100)]

wt_2 = wavetable.WaveTable().from_wav('key.wav', resynthesize=False)`

From here, take wt_1 and wt_2 and morph them?

Sig gen set to 2048, saves as 128

Trying to create a cycle size of 2048. The resulting cycle is written as 128.

wt = wavetable.WaveTable(num_waves=100)

sg = sig.SigGen()
sig.num_points = 2048

from numpy.random import uniform
random_wave = uniform(-1, 1, 2048)

wt.waves = [sg.arb(random_wave)]
wavfile.write_wavetable(wt, 'osc_gen_random.wav')

12

AttributeError: 'generator' object has no attribute 'size' with random example

Running the random generation example I get an error.

`from osc_gen import wavetable
from osc_gen import zosc
from osc_gen import sig
from osc_gen import dsp
from random import uniform

Create a signal generator.

sg = sig.SigGen()

Create a wave table with 16 slots to store the waves.

wt = wavetable.WaveTable(num_waves=16)

random_wave = (uniform(-1, 1) for _ in range(128))

Write to file.

m = sg.arb(random_wave)
wt.waves = [m]
zosc.write_wavetable(wt,'osc_gen_random.h2p')`

Saving generated wavetables using a full path name

I would like to be able to save the generated wavetable files into another path, in this case a sub directory of the working directory. When the name contains a full path, the script generates an error:
AttributeError: 'Wave_write' object has no attribute '_file'

doesn't work:
output_subdir = 'tables'
output_dir = os.getcwd() + '\' + output_subdir
output_file_name = output_dir + '\' + wt_name + "" + str(wt_window_var) + "w" + str(wt_size_var) + "s_" + str(wt_increment) + '.wav'

works:
output_file_name = wt_name + "" + str(wt_window_var) + "w" + str(wt_size_var) + "s_" + str(wt_increment) + '.wav'

wavfile.write_wavetable(wt_output, output_file_name)

1 sample missing at the end of each cycle

I am not 100% sure this is an issue, apologies beforehand if it is not and simply an error in my code but am getting a small glitch.

Noticed that by default if I use the code below without setting phase, the wavetable starts at the lowest point, I would like instead to start at the zero crossing.

Using the code below works as I intend, but I end up with a one sample offset at the end of the wave, see attached screenshot. Each cycle results in what seems to be 2047 samples and not 2048.

exampl

`wt_name = 'my_wave.wav'
wt_size = 100
wt_window = 2048

wt = wavetable.WaveTable(num_waves=wt_size)

sig_gen = sig.SigGen()
sig_gen.num_points = wt_window
sig_gen.phase = (2 * np.pi)/4

wt.waves = sig.morph((sig_gen.sin(), sig_gen.tri()), 100)

wavfile.write_wavetable(wt, wt_name)`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.