-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modulation issues #5
Comments
It looks like the output of the sampler ugen is stereo, and the Mul ugen only takes numeric inputs. I need to do a little more work on the sampler to fix this, but for now your last line can be: c = Mul( a, Merge(b) ).connect() ... and you should get the results you're looking for. Merge just takes a stereo sample (which is an array) and sums the array members to create a mono sample (which is a number). |
Ok, this gets me part of the way. Here is what I have now:
The problem is that I dynamically change "preytable" and "predatortable" as the user manipulates sliders. However, when the user does this, there is no change in the audio. If Binops operators such as "Mul" re-evaluated their inputs, then presumably the audio would also change when the arguments change. Is there a way to enable this? As a specific example, suppose that after the above code, I change preytable via "preytable.setTable(somearray);". The preymodulated is not updated, right? |
This works fine for me... are you sure your reference to the array inside the table object isn't getting lost somewhere? You can always access the underlying array with preytable.getTable() Here's example code that removes wavetable noise after two seconds by changing all the values in the wavetable array to 1. a = new Gibberish.Table({ amp: 1 });
var t = []
for( var i = 0; i < 1024; i++ ) { t[ i ] = Gibberish.rndf(-1,1) }
a.setTable( t )
b = new Gibberish.Sampler({
file: 'resources/predator1sec.wav',
loops: true,
});
b.onload = function() { b.note(1); }
c = Mul( Merge(b),a ).connect();
Gibberish.future( function() {
for( var i = 0; i < 1024; i++ ) { t[ i ] = 1 }
}, 88200 ) |
Just to be clear, you should able to change the underlying array of a Table ugen at any time and immediately hear the results. |
Thank you — I’ll play with this. The “Mul” worked but maybe I could near here On Feb 24, 2014, at 2:39 AM, charlieroberts [email protected] wrote:
Paul Fishwick, PhD |
Not sure why this is still open :) |
Must have forgotten to close. P Sent from my iPhone Paul Fishwick, PhD
|
It seemed right to create a new thread for this...issues with modulation outside of Sampler. I am including code below. modulation test #1 is along the lines of an example you gave - that works fine since modulation is specified inside of the Sampler.
However, I have 2 related issues with the code below it
Issue 1: I need to be able to modulate b (audio file) with a (random signal). just doing "c = Mul(a,b).connect()" is not working since presumably a is a Table and b is a Sampler. How do I get a handle on the "Table" inside of b so that the Mul works?
Issue 2: I will be dynamically changing table "a" as the code runs. This would seem to require a more complex audio graph since the "Mul" is happening only once?
// Begin Gibberish sound synthesis
a = new Gibberish.Table({ amp: 1 });
var t = []
for( var i = 0; i < 1024; i++ ) { t[ i ] = Gibberish.rndf(-1,1) }
a.setTable( t )
/* Pitch modulation # 1 - works well
b = new Gibberish.Sampler({
file: 'ordinary.wav',
loops: true,
pitch: Abs( a )
}).connect();
*/
/* Amplitude modulation # 2 - no sound */
b = new Gibberish.Sampler({
file: 'ordinary.wav',
loops: true});
b.onload = function() {
b.note(1);
}
// I will be changing "a" dynamically in code but right now
// just trying to create a modulation of b using a
c = Mul(a,b).connect();
// no sound
The text was updated successfully, but these errors were encountered: