soul-lang / SOUL

The SOUL programming language and API
Other
1.71k stars 95 forks source link

One off processor in graph connection declaration throws error with specialization parameters #42

Closed DocSunset closed 3 years ago

DocSunset commented 3 years ago

The language guide says here:

"If you only want a single instance of a particular type of processor in the graph, you may omit the let declaration and just refer to the processor type in the connection section"

and it works perfectly unless I try to use a processor that has specialization parameters. Here's a contrived minimal example:

// example.soul
graph example  [[main]]
{
    input event soul::midi::Message midiIn;
    output stream float audioOut;

    connection
    {
        audioIn -> Offset(0.1) -> audioOut;
    }
}

processor Offset(float offset)
{
    input stream float audioIn;
    output stream float audioOut;
    void run() 
    {
        loop
        { 
            audioOut << offset + audioIn; 
            advance(); 
        }
    }
}
example.soul:8:20: error: Unknown function: 'Offset'
        audioIn -> Offset(0.1) -> audioOut;

                   ^
cesaref commented 3 years ago

Good spot - i'll investigate

julianstorer commented 3 years ago

Right - we'd been holding back from implementing that yet, as we want to be able to allow pure function calls inside connections, which would share the same syntax.. So I agree that the error message is a confusing, but it's something we're working on, and will be resolved soon!