Skip to content

Commit

Permalink
All the bela changes, in one single commit, rebased on 3.11.x
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliomoro committed Dec 18, 2020
1 parent 392d97d commit 7e3a993
Show file tree
Hide file tree
Showing 33 changed files with 3,735 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ else() # ARM platforms do not have SSE
set(SSE2 OFF)
endif()

set(AUDIOAPI "default" CACHE STRING "Audio API to use (one of {default,coreaudio,jack,portaudio})")
set(AUDIOAPI "default" CACHE STRING "Audio API to use (one of {default,coreaudio,jack,portaudio,bela})")

if (AUDIOAPI STREQUAL jack)
# here we check for JACK metadata API
Expand Down
50 changes: 50 additions & 0 deletions HelpSource/Classes/AnalogIn.schelp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
class:: AnalogIn
summary:: Read data from an analog input of the BELA board
related:: Classes/AnalogOut, Classes/DigitalIn, Classes/DigitalOut, Classes/DigitalIO
categories:: UGens>BELA


Description::

Reads analog data from an analog input of the BELA board.

note::
This UGen only works on BeLa
::

classmethods::

method::ar

argument::analogPin

Analog pin number to read. Pin numbers begin at 0. This value can be modulated at audiorate.

argument::mul

argument::add

method::kr

argument::analogPin

Analog pin number to read. Pin numbers begin at 0.

argument::mul

argument::add

Examples::

code::
// modulate frequency of a sine oscillator

(
SynthDef("help-AnalogIn",{ arg out=0;
Out.ar(out,
SinOsc.ar( AnalogIn.ar( 0 ).exprange( 200, 5000 ), 0, 0.1 )
)
}).play;
)
::

55 changes: 55 additions & 0 deletions HelpSource/Classes/AnalogOut.schelp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
class:: AnalogOut
summary:: Write data to an analog output of the BELA board
related:: Classes/AnalogIn, Classes/DigitalIn, Classes/DigitalOut, Classes/DigitalIO
categories:: UGens>BELA


Description::

Writes analog data to an analog output of the BELA board.

note::
This UGen only works on BeLa
::

classmethods::

method::ar

argument::analogPin

Analog pin number to read. Pin numbers begin at 0. This value can be modulated at audiorate.

argument::output

Value to write out to the pin.

argument::mul

argument::add

method::kr

argument::analogPin

Analog pin number to read. Pin numbers begin at 0.

argument::output

Value to write out to the pin.

argument::mul

argument::add

Examples::

code::
// write a sine oscillator's output to a pin

(
SynthDef("help-AnalogOut",{ arg out=0;
AnalogOut.ar( 0 , SinOsc.ar( 10 ) );
}).play;
)
::
72 changes: 72 additions & 0 deletions HelpSource/Classes/DigitalIO.schelp
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
class:: DigitalIO
summary:: Read or write data to a digital pin of the BELA board
related:: Classes/AnalogIn, Classes/AnalogOut, Classes/DigitalIn, Classes/DigitalOut
categories:: UGens>BELA


Description::

Read or write digital data from or to a digital pin. The pin number of this UGen can be modulated, as well as its I/O mode.

note::
This UGen only works on BeLa.
::

note::
If you do not need to change the pin mode or the pin, you should use the UGen link::Classes/DigitalIn:: or link::Classes/DigitalOut::
::

classmethods::

method::ar

The output of this UGen is always the last value read when the digital pin was an input.

argument::digitalPin

Digital pin number to write to. Pin numbers begin at 0. This value can be modulated at audiorate.

argument::output

Value to write out to the pin - the value will be 1 when the argument is larger than 0, otherwise 0. This value can be modulated at audio rate.

argument::pinMode

Value to write out to the pin - the pin will be an input when the argument is smaller than 0.5, otherwise an output. This value can be modulated at audiorate.

argument::mul

argument::add

method::kr

The output of this UGen is always the last value read when the digital pin was an input.

argument::digitalPin

Digital pin number to write to. Pin numbers begin at 0.

argument::output

Value to write out to the pin - the value will be 1 when the argument is larger than 0, otherwise 0.

argument::pinMode

Value to write out to the pin - the pin will be an input when the argument is smaller than 0.5, otherwise an output.

argument::mul

argument::add

Examples::

code::
// write a sine oscillator's output to a pin, and read the pin value at other times

(
SynthDef("help-DigitalIO",{ arg out=0;
DigitalIO.ar( 0, SinOsc.ar( 10 ),LFPulse.kr( 0.1 ) ).poll;
}).play;
)

::
55 changes: 55 additions & 0 deletions HelpSource/Classes/DigitalIn.schelp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
class:: DigitalIn
summary:: Read data from a digital input of the BELA board
related:: Classes/AnalogIn, Classes/AnalogOut, Classes/DigitalOut, Classes/DigitalIO
categories:: UGens>BELA


Description::

Reads digital data from an digital input of the BELA board.

note::
This UGen only works on BeLa.
::

note::
If you want to modulate the pin number, you should use the UGen link::Classes/DigitalIO::
::

classmethods::

method::ar

argument::digitalPin

Digital pin number to read. Pin numbers begin at 0. This value cannot be modulated.

argument::mul

argument::add

method::kr

argument::digitalPin

Digital pin number to read. Pin numbers begin at 0. This value cannot be modulated.

argument::mul

argument::add


Examples::

code::
// turn on and off a sine oscillator

(
SynthDef("help-DigitalIn",{ arg out=0;
Out.ar(out,
SinOsc.ar( 500, 0, 0.1 * DigitalIn.ar( 0 ) )
)
}).play;
)
::

71 changes: 71 additions & 0 deletions HelpSource/Classes/DigitalOut.schelp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
class:: DigitalOut
summary:: Write data to a digital input of the BELA board
related:: Classes/AnalogIn, Classes/AnalogOut, Classes/DigitalIn, Classes/DigitalIO
categories:: UGens>BELA


Description::

Write digital data to a digital output of the BELA board.

note::
This UGen only works on BeLa.
::

note::
If you want to modulate the pin number, you should use the UGen link::Classes/DigitalIO::
::

classmethods::

method::ar

argument::digitalPin

Digital pin number to write to. Pin numbers begin at 0. This value cannot be modulated.

argument::output

Value to write out to the pin - the value will be 1 when the argument is larger than 0, otherwise 0.

argument::writeMode

Mode of writing to the output, this can be 0 (using Bela's DigitalWrite and only when value changes) or 1 (using Bela's DigitalWriteOnce). This value cannot be modulated.

argument::mul

argument::add


method::kr

argument::digitalPin

Digital pin number to write to. Pin numbers begin at 0. This value cannot be modulated.

argument::output

Value to write out to the pin - the value will be 1 when the argument is larger than 0, otherwise 0.

argument::writeMode

Mode of writing to the output, this can be 0 (using Bela's DigitalWrite and only when value changes) or 1 (using Bela's DigitalWriteOnce). This value cannot be modulated.

argument::mul

argument::add


Examples::

code::
// write a sine oscillator's output to a pin

(
SynthDef("help-DigitalOut",{ arg out=0;
DigitalOut.ar( 0, SinOsc.ar( 10 ) );
}).play;
)

::

58 changes: 58 additions & 0 deletions HelpSource/Classes/MultiplexAnalogIn.schelp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
class:: MultiplexAnalogIn
summary:: Read data from an analog input of the BELA board
related:: Classes/AnalogIn, Classes/AnalogOut, Classes/DigitalIn, Classes/DigitalOut, Classes/DigitalIO
categories:: UGens>BELA


Description::

Reads analog data from a multiplexed analog input of the BELA board, with the additional Multiplexer board.

note::
This UGen only works on BeLa
::

classmethods::

method::ar

argument::analogPin

Analog pin number to read. Pin numbers begin at 0. This value can be modulated at audiorate.

argument::muxChannel

Multiplex channel to read. Pin numbers begin at 0. This value can be modulated at audiorate.

argument::mul

argument::add

method::kr

argument::analogPin

Analog pin number to read. Pin numbers begin at 0.

argument::muxChannel

Multiplex channel to read. Pin numbers begin at 0.

argument::mul

argument::add

Examples::

code::
// modulate frequency of a sine oscillator

(
SynthDef("help-MultiplexAnalogIn",{ arg out=0;
Out.ar(out,
SinOsc.ar( MultiplexAnalogIn.ar( 0, 1 ).exprange( 200, 5000 ), 0, 0.1 )
)
}).play;
)
::

Loading

0 comments on commit 7e3a993

Please sign in to comment.