Quantcast

Bus definition and MIDIdef.cc in included file

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bus definition and MIDIdef.cc in included file

herrkami
Hi,

please consider this example:

Having

    ~kickAmp = Bus.control(s, 1);
    MIDIdef.cc(\cc, {|value, cc| ~kickAmp.set(value/127);}, ccNum: 3, chan:0);
    Synth(\kick, [amp: ~kickAmp.asMap]);


in one file works for me. The kick amplitude is determined by the midi control when the last line is executed.

Having

    ~kickAmp = Bus.control(s, 1);
    MIDIdef.cc(\cc, {|value, cc| ~kickAmp.set(value/127);}, ccNum: 3, chan:0);


in file drums.scd and

    ("drums.scd").load;
    Synth(\kick, [amp: ~kickAmp.asMap]);


in the main file doesn't work. Does anyone have an idea why not? Thanks in advance,

Kami
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bus definition and MIDIdef.cc in included file

kflak
I suppose you could try “/full/path/to/drums.scd”.executeFile instead of .load?
Kenneth
 
— — — —
Roosna & Flak, Contemporary Dance and Music

On 25 Apr 2017, at 11:27, herrkami [via New SuperCollider Mailing Lists Forums (Use These!!!)] <[hidden email]> wrote:

Hi,

please consider this example:

Having

    ~kickAmp = Bus.control(s, 1);
    MIDIdef.cc(\cc, {|value, cc| ~kickAmp.set(value/127);}, ccNum: 3, chan:0);
    Synth(\kick, [amp: ~kickAmp.asMap]);


in one file works for me. The kick amplitude is determined by the midi control when the last line is executed.

Having

    ~kickAmp = Bus.control(s, 1);
    MIDIdef.cc(\cc, {|value, cc| ~kickAmp.set(value/127);}, ccNum: 3, chan:0);


in file drums.scd and

    ("drums.scd").load;
    Synth(\kick, [amp: ~kickAmp.asMap]);


in the main file doesn't work. Does anyone have an idea why not? Thanks in advance,

Kami


To unsubscribe from New SuperCollider Mailing Lists Forums (Use These!!!), click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bus definition and MIDIdef.cc in included file

herrkami
Thank you very much! I'll try that later at home when I have my MIDI keyboard.

But what's the difference? In the docu it states that load "[l]oad[s] and execute[s] the file", while executeFile "reads the file [], compiles it and executes it". So the difference seems to be the compilation. I thought it has to be compiled anyway to be executed. What is happening here?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bus definition and MIDIdef.cc in included file

kflak
Ah, I was looking at the documentation for the SynthDefs, and thought executeFile would be more appropriate. However, it seems your syntax might be off. Try putting the full path of the document into strings, *without* the brackets around them when calling the .load or .executeFile methods.
As for the difference between load and executeFile someone more knowledgeable than me needs to respond ;-)

K
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bus definition and MIDIdef.cc in included file

herrkami
OK, I'll try that too. But usually I am experiencing no issues with this syntax. SynthDefs for example are executed when I do it that way.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bus definition and MIDIdef.cc in included file

herrkami
Nope. Unfortunately neither of them works. Also, it seems like the MIDIdef.cc() is the issue. The Bus is created correctly. For example this works:

    executeFile("drums.scd"); // \kick and ~kickAmp bus are defined here
    MIDIdef.cc(\cc, {|value, cc| ~kickAmp.set(value/127);}, ccNum: 3, chan:0);
    Synth(\kick, [amp: ~kickAmp.asMap]);


I have to execute the MIDIdef.cc() manually... why? :(
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bus definition and MIDIdef.cc in included file

herrkami
OK, I found my mistake. I gave every MIDIdef in the included file the same key (\cc), so only the last one was not overwritten. And that was not the amplitude.

Thanks anyway for your quick help! Next time I try it first with a real minimum example.
Loading...