HISE Logo Forum
    • Categories
    • Register
    • Login

    Faust how to make a sound?

    Scheduled Pinned Locked Moved Faust Development
    15 Posts 3 Posters 703 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • hisefiloH
      hisefilo
      last edited by hisefilo

      Hi guys and girls!! I was trying to make a sound out of Faust via HISE, but no luck. A simple oscillator, or any of the examples you can found on the Faust Online IDE (super cool) https://faustide.grame.fr/

      Anyone played any sound using MIDI + FAUST within HISE?
      What am I doing wrong?

      HiseSnippet 953.3ocwVs0aiSDEdbZltjP4xJAumGyJUpRfcWPZeX2ljFHBZVqMgn8sUSGOoYTFOi03wsDP7N+r3mD+CfywiSsSanTr3RpTkO277cNmuyYbn0vEooFKIn07MIBRvQzYaztUCWwjZxjQjfOjdNK0Irc7pFrIgklJhHAAG70nhfVMI4+9sWNfoXZtnTEgrvH4huSFKckZCe02JUpwrHwbYbEue5qlvM5gFkICvyAzdjDFeM6RwTF5VCJI3vyhjNicli4DofOCLQalsxbs16+BYp7Bk.E5SlAuHuZxvURUT31bMkPBZFVl4G3y7OgdtLRdi9xJvGmanSYDUqAAMtOH0+uAjBp.oldH8X5LtUl3Jsf348oSzPCYICJ0Ugh2WRvuRGZ.GztShYqEisfvMAz8485cbG3eO4EKyzbmzn6XzSMNwq0ceR6epcq1+b6N21zxk60FdLViRIr60L1cs2Wfc0YwWHrG24JlJSbiiP5uaM8vGVMk6y5JNZzSzR2qSDExiMpHrVgOe2N.onrAO88SFwbLroTnC7KQXcRDNAiDWArZeKpEcjHcsyj.756z+.liIJSwb6Rmv4lBCP8XmdH1nzoR2lpyU2li07OudzqR83uHaefv8wzPoiuZ+3swdvKT092FuESre.8rkKEbWIXaRG+16c7r4CiJUBkG5nZ6hQU37QfbTgXmwus+dGR+EZ4.QhUjvrh4lPEaS2TVbhR7F.uG24Bkgudl7GE2cJJwCgAnGc4qXZsPkVmgsC+GZAF4MlLmTe44LmU9Cj.5zr3YvpbtXXA5.cAMv4LubOTF4KyD5nbgeG9UXrOJGTXr+ViUFQmJbWarqyaGEOC4BV6aQgDwMJMgbpRYtdnINQVPcgFPttPiZSxJiVxQUdO1BySiMYvITf0ugkNmIUHWegvll+RdDs2Ive.OepIBpLzwLNTA2DxbqvAFbQDvHE1S32vLKAUU1.F+1K770B.KwXBlec2AUV63YcnDLq0vywljt.sxYJxBrqhnjfuSeUwCN+UFwvUXdzrCX+zJfszk+Of3inKYYotcg2Q.7rhS7VpMpZbKT0hNTAuoIQagDb1pLmHeGSUG+HjCGxrv2e.2elt0c+ARpX.noWiaImyrWJbo213NBCLl0wrbla8tm4+h4rXF2ZdG2u5.qguWtFnxpy+XrVvWEBxc5StpnlfyDDjB8NNGWD+YvR78GymWiX9hZDySqQLOqFw77ZDyWViX9p6MF7aTOMyYh8a5.EgmkStBBNSyfM34yMj+.TqiD0.
      

      Screen Shot 2022-11-01 at 7.57.31 AM.png Screen Shot 2022-11-01 at 7.57.36 AM.png

      Christoph HartC 1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @hisefilo
        last edited by

        In Faust there is a convention of three parameters that need to be defined in order to control voices

        • freq
        • gain
        • gate

        if you define any of these parameters the faust patch will react to MIDI messages (if you put it in a midichain like you already did).

        Your snippet doesn't define parameters, so you need to do that yourself. This example should react to MIDI messages accordingly:

        // Faust Source File: synth_test
        // Created with HISE on 2022-10-31
        import("stdfaust.lib");
        
        // define a freq slider (note frequency)
        freq = hslider("freq", 200, 20, 20000, 0.1);
        
        // define a gate button (note-on / off)
        gate = button("gate");
        
        // define a parameter that will be mapped to velocity (we'll use it for the filter decay time)
        gain = hslider("gain", 0.0, 0.0, 1.0, 0.01);
        
        // create an envelope from the gate button
        lpEnv = en.ar(0,0.5 * gain,gate);
        
        // create a sawtooth with a LP filter with a envelope modulated by the velocity
        osc = os.sawtooth(freq) : fi.resonlp(100 + 1000 * lpEnv,3.0,1.0);
        
        process = osc, osc;
        
        hisefiloH 1 Reply Last reply Reply Quote 0
        • hisefiloH
          hisefilo @Christoph Hart
          last edited by

          @Christoph-Hart Yeah I remember that convention.
          Still no sound. It's supposed to do it JIT right?? Or I need to compile DLLs to make it work?

          Screen Shot 2022-11-01 at 8.55.56 AM.png

          HiseSnippet 955.3ocwV00iZbCE0Cf2DnaZajZemGIRaWAMooUpOzr.Ksn1kLJPQ4sHudLKV3wdjsmcCspumeV4mT+Gzd83gclYCYEZT+.jPb+x9LGetWOgZEkYLJMJn8hsILTvw34ak10iVS3RzzwnfOEeAwXY5tdWC2lPLFVDJHn4O5bDztEJ6ye9CCIBhjxJbgPKUbJ6W3wbag2vW7ybgXBIhsfGWJ6m8hoTkbjRnRA7zD2GkPnaHWwlQbo0.iBN57HtUomaIVlAEzZnJZ670paj97WxM7KELmw.zbXg7tmnDQND67hFslKhB28baPvpDVvBM8rvWfufGwu0eAa74YA5VTQY9HnQU30rB7F7wf2dfTPIH0xCoGimS07DaQDGd9D7TIb3rh.zdYn3yEE7d7HEjfzdZLYCahFLtsfdOue+S5B+7jueUpjZ4JYWkblxxdor2S576cZ24O5z8tgVsZuwbaiVIDL8dC6No02Wg8jowWxzmz8ZhHkcahvieUN8nCiSo9m5RIpjSkb6KSX412un.kSav+90oiIVh6PI2GjWBSa4N3DLlcMnv8GQswiYlMVUBnw+fyOP4nhREDaU4jqGJO.vGUNCcGTRC2tsbO1c0Xs937Q+CtE3Pg6iwgbKc89wai8fWf092Fu4crOBe9pULps.rsvSd881d15vjREP4PaU6j2pB6uCHGma1cxqGr2lz2gKZHRzrDhlsPEJHa6YHwIB1q.7dR2KEJ5l47ei8gcQIdHLzkQO5ZhTxDl5zrcz+PCvPuRkZ4xqtfX072hBvyRimCi0orQ4nC7Ezv0m4s66rc5k4LYTlweAexCNvYGjGbvtfkZQmwr2nzaxNNx+O7r339GgGaRxc8TzYBg5lQp3Ddt7ETsY9BUhsIqURN04xmwNndVrJE1kb79SDyBBW3RaISaxVjGf6eJ7Ez5yTQ.6fmPn.KtMjXW6ZZbCi.UISeJ8V0YUfUVU3VicWB54D.OwtGzrq.aVZ7iW84rfdtFds1TyRWTJQfV5NccHE4VSO63An+piX3pLOhp.3urDfKR4+CH9.7JRpwVEdGCvSyN0Go1npwcPUa7HArRSi1AoN98VYnYiaJm6m4jygDM7ZIvUolcU32STo.fh8F2.yED8ULq4tAqXLTo1DSxDw06Jm+KZ4hITs5MT+TDGM9vLO.4JydGs1vKKB1cGftNmSbsFHmJ5MTpal7WAyy2eMecMp4o0nlmUiZ9lZTyyqQMeaMp46t2Zbut5YoVUrefG3H77LwUPv4RBLLOq0A82sLkRgB
          
          Christoph HartC 1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart @hisefilo
            last edited by

            @hisefilo Please tell me you have pressed F5 to compile that patch :)

            hisefiloH 1 Reply Last reply Reply Quote 0
            • hisefiloH
              hisefilo @Christoph Hart
              last edited by

              @Christoph-Hart I don't have F5 LOL. Im on Mac. just clicked this

              Screen Shot 2022-11-01 at 9.00.20 AM.png

              Christoph HartC 1 Reply Last reply Reply Quote 0
              • Christoph HartC
                Christoph Hart @hisefilo
                last edited by

                @hisefilo Try Fn+F5 :) I haven't added that compile button yet, and this button will just reload the existing code from the text file. 100% brain capacity was used when implementing this feature.

                hisefiloH 2 Replies Last reply Reply Quote 0
                • hisefiloH
                  hisefilo @Christoph Hart
                  last edited by

                  @Christoph-Hart Yes already tried after your previous message. Still no sound. Will record a video maybe you can catch what I'm doing wrong

                  Christoph HartC 1 Reply Last reply Reply Quote 0
                  • Christoph HartC
                    Christoph Hart @hisefilo
                    last edited by

                    @hisefilo I'm adding the compile bar like with every other code editor so you have something to click on (it's just an unreasonable amount of code-reshuffling required for that but I'll guess now is the time).

                    1 Reply Last reply Reply Quote 1
                    • hisefiloH
                      hisefilo @Christoph Hart
                      last edited by

                      @Christoph-Hart

                      1 Reply Last reply Reply Quote 0
                      • oskarshO
                        oskarsh
                        last edited by

                        @hisefilo I believe you will need to edit the faust code in a external editor or at least make sure it is saved under DspNetworks/CodeLibrary/faust/yourFaustFile.dsp. If your code is in this file you can go ahead to ScriptNode and click the first Icon (two arrows) in the faust node to 'refresh and recompile' the code.

                        hisefiloH 1 Reply Last reply Reply Quote 1
                        • hisefiloH
                          hisefilo @oskarsh
                          last edited by

                          @oskarsh Yeaaaa that was it. Was not saving the .dsp
                          Thank for teaching me! Now I get a no ending sound. But at least note on is working. Will investigate the gate param

                          Screen Shot 2022-11-01 at 10.34.35 AM.png

                          Christoph HartC 1 Reply Last reply Reply Quote 0
                          • Christoph HartC
                            Christoph Hart @hisefilo
                            last edited by

                            @hisefilo I've pushed a change that adds the compile bar on the faust code editor so you should be able to use it on macOS too.

                            hisefiloH 2 Replies Last reply Reply Quote 2
                            • hisefiloH
                              hisefilo @Christoph Hart
                              last edited by

                              @Christoph-Hart thanks mate. Reporting this!

                              Screen Shot 2022-11-01 at 10.52.29 AM.png

                              hisefiloH 1 Reply Last reply Reply Quote 0
                              • hisefiloH
                                hisefilo @hisefilo
                                last edited by

                                replacing var to bool made it compile. Don't know if it's safe

                                1 Reply Last reply Reply Quote 0
                                • hisefiloH
                                  hisefilo @Christoph Hart
                                  last edited by

                                  @Christoph-Hart Still not saving the .dsp on DspNetworks/CodeLibrary/faust/

                                  Screen Shot 2022-11-01 at 11.32.45 AM.png

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post

                                  17

                                  Online

                                  1.7k

                                  Users

                                  11.8k

                                  Topics

                                  102.8k

                                  Posts