Giter VIP home page Giter VIP logo

phausto's Introduction

phausto

Phausto is a library and API that allows to use the FAUST compiler and its libraries (Functional Audio Stream) inside Pharo

How to install

First, download the Phausto libraries for your platform, open the package, and place the librariesBundle folder into documents/Pharo/images/yourPhaustimage/

Then, copy and execute in a Playground

Metacello new
    baseline: 'Phausto';
    repository: 'github://lucretiomsp/phausto:main';
    load

Create a DSP from a valid string of FAUST code

"This content is Faust code inside a string"
content := 'import("stdfaust.lib"); 
tempo = hslider("tempo", 10000, 300, 20000, 100);
freq = hslider("freq", 300, 200, 900, 100);
process = ba.pulsen(1, tempo) : pm.djembe(freq, 0.3, 0.4, 1) <: dm.freeverb_demo;'.

"Create the DSP"
x1 := DSP create: content.
"Initialise the DSP"
x1 init.
"Start the DSP"
x1 start.

"If you want to change the parmeters, create faders and open them"
s := x1 sliderFor: 'tempo'.
s openInWindow.

s2 := x1 sliderFor: 'freq'.
s2 openInWindow 

s3 := x1 sliderFor: 'Freeverb/0x00/RoomSize'.
s3 openInWindow .

" and when you want to stop the sound" 
x1 stop.

Hello Phausto

"create a Sine wave Oscillator"
sine := SineOsc new.
"creates a stereo DSP from the Oscillator"
dsp := sine stereo asDsp.
"initialize the DSP"
dsp init.
"start the sound"
dsp start.
"stop the sound"
dsp stop.
"destroy the dsp when you no longer need it"
dsp destroy.

Get Funky

"Create two pulse generators, the first has its period changed by a LowFrequency Oscillator"
pulse1 := Pulsen new period: (LFOTriPos new freq: 0.2; offset: 0.05; amount: 4) .
pulse2 := Pulsen new period: 0.35.
"Create a djembe, triggered by pulse1"
djembe := Djembe new trigger: pulse1.
marimbaFreq := LFORandomPos new offset: 20; amount: 600; freq: (1 /0.35).
"Create a marimba, triggered by pulse2 and with the frequency modulated by an LFO with a random shape"
marimba := Marimba new trigger: pulse2; freq: marimbaFreq .
"Sum the marimba and the djembe patch them to a GreyHoleDW reverb and creates a dsp"
"The ChucK operator =>  it is our playful homage to the creators of ChucK, it simplfies and abstract the connections between Unit Generators"
dsp := (djembe + marimba => GreyHole new) stereo asDsp.

dsp init.
dsp start.
dsp stop.

phausto's People

Contributors

lucretiomsp avatar guillep avatar palumbon avatar olekscode avatar

Stargazers

Martín Dias avatar Pierre Laborde avatar  avatar Marcus Denker avatar Pavel avatar Ezequiel Birman avatar  avatar  avatar Alessandro Aresta avatar

Watchers

 avatar Stéphane Letz avatar  avatar  avatar  avatar

phausto's Issues

check effects super class

Reverbs and Delays present malfunctioning if their super class is UnitGenerator instead of PhBox. please check

representation of the boxes and of the DSP

for debugging and development it will be useful to have an 'internal representation ' of the boxes and of the dsps. as now they are kind of obscure once they are compiled

how do we call and implement a method to advance time

how do we call and implement a method to advance time?

oscFreq := PhHSlider new label: 'Freq' init: 60  min: 28  max: 940  step: 1. 

dsp := (osc * 0.2) asDsp .


[100 timesRepeat: [ dsp setValue: (Random new nextIntegerBetween: 28 and: 800 ) parameter: 'Freq'. (Delay forMilliseconds: 200) wait  ]] fork.

right way to create array of oscillators

is there a more elegant solution than this?

oscillators := SquareOsc new freq: 300.
(1 to: 10) do: [ :i | oscillators := oscillators + (SquareOsc new freq: 302 + i )].
dsp := (oscillators * 0.2) asDsp .

dsp init.
dsp start.
dsp stop.

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.