SlideShare a Scribd company logo
1 of 25
Download to read offline
LiveCoding
Package for Pharo
https://github.com/lucretiomsp/PharoLiveCoding
Domenico Cipriani
On-the-
fl
y programming music


(or Live Coding)
• Increasingly popular creative practice for audio-visual creation.
• The
fi
gure of the live coder is who performs the act of live coding, “usually
artists who want to learn the code, and coders who want to express
themselves, or in terms of Wang & Cook the “programmer/performer/
composer”
•On-the-
fl
y promotes live coding practice since 2020. This is a project co-
funded by the Creative European program and run in Hangar, ZKM, Ljudmila
and Creative Code Utrecht
•TOPLAP (The (Temporary|Transnational|Terrestrial|Transdimensional)
Organisation for the (Promotion|Proliferation|Permanence|Purity) of Live
(Algorithm|Audio|Art|Artistic) Programming) is an informal organization
formed in February 2004 to bring together the various communities that had
formed around live coding environments.
• Typically, the process of writing source code is made visible by projecting the
computer screen in the audience space, with ways of visualising the code an
area of active research.
• “If the only tool you have is an hammer,
everything looks like a nail” (Abraham Maslow)
• “The most disastrous thing that you can ever learn
is your
fi
rst programming language” (Alan Kay)
Why Pharo?
• For Smalltalk! 

• Arrays are at the core of electronic music, their manipulation in Pharo is
extremely powerful.

• Because the Playground is the perfect environment for Live Coding.

• Because there are not other pure Object Oriented languages for Live
Coding.

• For its expressiveness and re
fl
ectiveness.

• Because new methods and classes are created easily and always
available to the system (i.e. no headers, no extra dependence, no tedious
fi
le management).
Symbolic Sound Kyma
• Music programming language and IDE written in
Smalltalk created by Carla Scaletti and Kurt J.
Hebel at Urbana Champaign, Illinois.
• The Smalltalk code is
compiled on an external
DSP called Paca(rana)
• M o s t p r o b a b l y : ) i t s d e v e l o p e d o n
ObjectworksSmalltalk, Release 4.1 of 15 April
1992
• “The Holy Grail of sound
design”
Kyma 7
• “L’unico principio primario in ogni azione umana, é il dispendio
del minimo sforzo per portare a termine un compito” (George
Zipf)
• “L’iconicitá é la relazione di somiglianza tra i due aspetti di un
segno: la sua forma e il suo signi
fi
cato. Un segno iconico é un
segno che in qualche modo assomiglia al suo signi
fi
cato” (Meir)
2 principi: economia e trasparenza
• La sintassi di Smalltalk può stare su una cartolina, mentre la sua
semantica può essere letta come un pidgin English ed é
pensata per i bambini
Principi della programmazione orientata agli oggetti
(Object Oriented Programming / OOP)
• Incapsulamento

• Astrazione

• Ereditarietà

• Polimor
fi
smo (late binding)
• A front-end to write real time scores for a real-time audio
synthesis backend (via OSC) or a MIDI device
• A DSL to write quickly and easily rhythmical patterns and
melodies
What is the LiveCoding Package?
• An ethnomusical quick-guide
• The sound generators created on the backend must adhere to
the LiveCoding Package syntax ( !InstrumentGate ! /
InstrumentNote / !InstrumentDuration / !InstrumentExtra1 )
P e r f o r m a n c e : a s u b c l a s s o f
Dictionary that will contains
instances of the Sequencer class or
arrays
Sequencer
Gates
Notes
Durations
Extra1 (optional)
Extra2 (optional)
noteIndex
Process - Performance - Sequence - Rhythm
• Performance is a subclass of Dictionary.
• It contains association of Symbols and Arrays or Sequences
• Sequencer is an Object whose main instance variables are: Gates,
NoteNumbers, Durations, Extra1, Extra2. 

It is created sending the message asSeq to an instance of the Rhythm
• Rhythm is a convenience subclass of Array
• aPerformance playKymasequenceAt: aStepDuration rate: aNumberOfSteps
• The Process forked at timingPriority check if the value of the key in the
performance is a Sequencer or not.
• If the value is a Sequencer, 3 OSC messages are sento to the client:
- appending ‘Gate’, ‘Note’, ‘Duration’ to the key asString
• aPerformance playLocalSequenceAt: aStepDuration rate: aNumberOfSteps
• If it is a Sequencer, the noteIndex of the Sequencer is incremented at every
stepDuration and reset to 1 every time it reaches the size of gates
The LiveCoding package also
contains a collection of Euclidean
world rhythms and musical scales.
• “The only primary principle of every human action, including
verbal communication, is the expenditure of the least amount
of e
ff
ort to accomplish a task. (George Zipf)
• “Iconicty is the relation of similarity between to aspects of a
sign: its form and its meaning. An iconic sign is a sign that in
some way resembles its meaning.”(Meir)
Economy and transparency
The LiveCoding Package
•Iconicity
•Economy
•Polysemy
• To write music on-the-
fl
y with Pharo
• Also for studio composition: a new kind of musical score
Written code should resemble what we hear
The less we type, the better
PRINCIPLES
Many ways to do the same thing
• Pharo acts as an arranger, another program generates the sound
(Kyma, PureData, MaxMSP, ChucK, SuperCollider, and so on.
• Based on the OpenSoundControl at the moment, but MIDI
implementation on the pipeline
16 upbeats
#(60 63 67) + 16
16 randomsFrom: #(50 54 57)
16 randomNotes: (50 54 47)
OpenSoundControl OSC
• Developed by Adrian Free and Matt Wright at CNMAT at the end of the 90s.
Firs speci
fi
cation published in 2002.

• Flexile, fast and accurate alternative to the MIDI standard..

• Indipendent from the transport mechanism, OSC packets are typically sent
and received thru UDP Sockets.

• Server/Client architecture The server sends the package, the client
receives them.

• An OSC message consists of an OSC Address Pattern, followed by an
OSC Type Tag String, followed by zero or more OSC Arguments ( for
example: /frequency,f 0.3 ).
• At the core of the LiveCoding Package for Pharo.
OpenSoundControl OSC
• The LiveCoding package simplify the creation and dispatching of OSC messages
aNumber toLocal: aString.
aNumber toKyma: aString.
Send to the local host the message:

‘/aString, f aNumber’
Send to the Paca(rana) the message

’/aString, f aNumber’
Step Sequencers
On a Step Sequencer, a step can be active (1) or not active (0).
In the Live Coding package you can create
Sequencer or of numbers by sending
messages to integers, for example:
• 16 zeros
• 64 randoms
• 32 rumba
• 16 quavers
• Sending a message with the name of a scale to the
Scale class returns an array with the intervals of that
scale. For example, Scale sakura returns #(0 1 5 7 8)
Scales!
• BINARY: 1000100010001000

• HEXADECIMAL: 8888
A rhythm can be represented as an array of 0s and 1s, where a 1 represents a
trig.
• SMALLTALK: #(1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0)

• LIVECODINGTALK: 16 downbeats 

• LIVECODINGTALK: ‘8888’ pattern
• BINARY: 1001 0001 0010 1000

• HEXADECIMAL: 9128
• SMALLTALK: #(1 0 0 1 0 0 0 1 0 0 1 0 1 0 0 0 )

• LIVECODINGTALK: 16 rumba 

• LIVECODINGTALK: ‘9128’ pattern
• SMALLTALK: #(1 0 1 0 1 0 1 0 1 0 1 0 1 1 1)

• LIVECODINGTALK: 12 quavers, 4 semiquavers 

• LIVECODINGTALK: ‘AAAF’ pattern
• BINARY: 1010 1010 1010 1111

• HEXADECIMAL: AAAF
Bars, Bytes, Beats, Nibbles, Steps, Bits
• 4 bits = 1 Nibble / 8 bit = 1 Byte.
• 1 Bar, 16 Steps (1/16th quantisation).
• If every step corrisponds to a Bit of Information, in a Bar we
fi
no 16 Bits, i.e. 2 Bytes
• In every Bar there are 4 Beats, so in each Beat there are 4 Bits, i.e. 1 Nibble.
• Every Hexadecimal symbol represents a Nibble.
C
D
E
F
B
0
1
2
3
4
5
7
8
9
6
A
Upbeat
Downbeat
Quavers
Semiquavers
• In the spring of 2022, the Pharo team in Lille helped with the development of
MIDI compatibility for the LiveCoding Package. 

• A graduating student, Antoine Delaby, tutored by Santiago Bragagnolo,
ported the MIDI output functionality of the C PortMidi library by the means of
the Uni
fi
ed ForeignFunctionInterface provide by Pharo

• It is now possible to send out MIDI noteOn and noteO
ff
messages from
Pharo to external MIDI hardware connected to the host computer.

• The MIDISender object provided by the LiveCoding package is a
convenience object modelled from the MIDIOut object of the ChucK
programming language
MIDI integration
aMIDISender playNote: aNoteNumber onChannel: aMIDIChannel duration: aDurationInSeconds
• aPerformance playMIDISequenceAt: aStepDuration rate: aNumberOfSteps on: aMIDISender
As supercollider frontend
• Super Collider is an environment and programming language originally
released in 1996 by James McCartney for real-time audio synthesis and
algorithmic composition

• It combines the object-oriented structure of Smalltalk, with a C-like
syntax and features from functional programming language

• SuperCollider’s sound generation is bundled into an optimised
command-line executable (named scsynth) that is usually controlled
within the SuperCollider language (sclang), bu that can be controlled via
OpenSoundControl
• A full Pharo front-end for the scsynth server is being developed, to
enable the user to generate synthesiser and e
ff
ect and control the with
Pharo syntax
Future Challenges
• Tests and DebugDriverDevelopment!
• Documentation, user guide, tutorials

• Optimisation!

• MIDI input management.

• Real polyrhythms (thanks Kasper for the complaint)

• Graphical User Interface easy creation
• Porting of PortAudio C library.

• An audio server running inside Pharo, on the model of SuperCollider
scServer.
• A full programming language inside Pharo capable not only of
algorithmic composition but also of sound production and sound
synthesis - communicating via OSC messages to the internal audio
server.

More Related Content

Similar to LiveCoding Package for Pharo

Summer training vhdl
Summer training vhdlSummer training vhdl
Summer training vhdlArshit Rai
 
Summer training vhdl
Summer training vhdlSummer training vhdl
Summer training vhdlArshit Rai
 
cReComp : Automated Design Tool for ROS-Compliant FPGA Component
cReComp : Automated Design Tool  for ROS-Compliant FPGA Component cReComp : Automated Design Tool  for ROS-Compliant FPGA Component
cReComp : Automated Design Tool for ROS-Compliant FPGA Component Kazushi Yamashina
 
#Pharo Days 2016 Data Formats and Protocols
#Pharo Days 2016 Data Formats and Protocols#Pharo Days 2016 Data Formats and Protocols
#Pharo Days 2016 Data Formats and ProtocolsPhilippe Back
 
Lecture 1 introduction to language processors
Lecture 1  introduction to language processorsLecture 1  introduction to language processors
Lecture 1 introduction to language processorsRebaz Najeeb
 
OSCON: System software goes weird
OSCON: System software goes weirdOSCON: System software goes weird
OSCON: System software goes weirdDocker, Inc.
 
ElixirでFPGAを設計する
ElixirでFPGAを設計するElixirでFPGAを設計する
ElixirでFPGAを設計するHideki Takase
 
Structure-Compiler-phases information about basics of compiler. Pdfpdf
Structure-Compiler-phases information  about basics of compiler. PdfpdfStructure-Compiler-phases information  about basics of compiler. Pdfpdf
Structure-Compiler-phases information about basics of compiler. Pdfpdfovidlivi91
 
One Shellcode to Rule Them All: Cross-Platform Exploitation
One Shellcode to Rule Them All: Cross-Platform ExploitationOne Shellcode to Rule Them All: Cross-Platform Exploitation
One Shellcode to Rule Them All: Cross-Platform ExploitationQuinn Wilton
 
Speech Compression using LPC
Speech Compression using LPCSpeech Compression using LPC
Speech Compression using LPCDisha Modi
 
#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...
#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...
#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...Paris Open Source Summit
 
OpenSAF Symposium_Python Bindings_9.21.11
OpenSAF Symposium_Python Bindings_9.21.11OpenSAF Symposium_Python Bindings_9.21.11
OpenSAF Symposium_Python Bindings_9.21.11OpenSAF Foundation
 
2016 bioinformatics i_python_part_1_wim_vancriekinge
2016 bioinformatics i_python_part_1_wim_vancriekinge2016 bioinformatics i_python_part_1_wim_vancriekinge
2016 bioinformatics i_python_part_1_wim_vancriekingeProf. Wim Van Criekinge
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsSerge Stinckwich
 
Advanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONLyon Yang
 

Similar to LiveCoding Package for Pharo (20)

Summer training vhdl
Summer training vhdlSummer training vhdl
Summer training vhdl
 
Summer training vhdl
Summer training vhdlSummer training vhdl
Summer training vhdl
 
CD U1-5.pptx
CD U1-5.pptxCD U1-5.pptx
CD U1-5.pptx
 
cReComp : Automated Design Tool for ROS-Compliant FPGA Component
cReComp : Automated Design Tool  for ROS-Compliant FPGA Component cReComp : Automated Design Tool  for ROS-Compliant FPGA Component
cReComp : Automated Design Tool for ROS-Compliant FPGA Component
 
#Pharo Days 2016 Data Formats and Protocols
#Pharo Days 2016 Data Formats and Protocols#Pharo Days 2016 Data Formats and Protocols
#Pharo Days 2016 Data Formats and Protocols
 
#PDR15 - Voice API
#PDR15 - Voice API#PDR15 - Voice API
#PDR15 - Voice API
 
Lecture 1 introduction to language processors
Lecture 1  introduction to language processorsLecture 1  introduction to language processors
Lecture 1 introduction to language processors
 
OSCON: System software goes weird
OSCON: System software goes weirdOSCON: System software goes weird
OSCON: System software goes weird
 
ElixirでFPGAを設計する
ElixirでFPGAを設計するElixirでFPGAを設計する
ElixirでFPGAを設計する
 
Structure-Compiler-phases information about basics of compiler. Pdfpdf
Structure-Compiler-phases information  about basics of compiler. PdfpdfStructure-Compiler-phases information  about basics of compiler. Pdfpdf
Structure-Compiler-phases information about basics of compiler. Pdfpdf
 
One Shellcode to Rule Them All: Cross-Platform Exploitation
One Shellcode to Rule Them All: Cross-Platform ExploitationOne Shellcode to Rule Them All: Cross-Platform Exploitation
One Shellcode to Rule Them All: Cross-Platform Exploitation
 
ZeroMQ
ZeroMQZeroMQ
ZeroMQ
 
Speech Compression using LPC
Speech Compression using LPCSpeech Compression using LPC
Speech Compression using LPC
 
#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...
#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...
#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...
 
OpenSAF Symposium_Python Bindings_9.21.11
OpenSAF Symposium_Python Bindings_9.21.11OpenSAF Symposium_Python Bindings_9.21.11
OpenSAF Symposium_Python Bindings_9.21.11
 
Rustbridge
RustbridgeRustbridge
Rustbridge
 
2016 bioinformatics i_python_part_1_wim_vancriekinge
2016 bioinformatics i_python_part_1_wim_vancriekinge2016 bioinformatics i_python_part_1_wim_vancriekinge
2016 bioinformatics i_python_part_1_wim_vancriekinge
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systems
 
Stoop 305-reflective programming5
Stoop 305-reflective programming5Stoop 305-reflective programming5
Stoop 305-reflective programming5
 
Advanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCON
 

More from ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsESUG
 

More from ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Recently uploaded

Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 

Recently uploaded (20)

Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 

LiveCoding Package for Pharo

  • 2. On-the- fl y programming music (or Live Coding) • Increasingly popular creative practice for audio-visual creation. • The fi gure of the live coder is who performs the act of live coding, “usually artists who want to learn the code, and coders who want to express themselves, or in terms of Wang & Cook the “programmer/performer/ composer” •On-the- fl y promotes live coding practice since 2020. This is a project co- funded by the Creative European program and run in Hangar, ZKM, Ljudmila and Creative Code Utrecht •TOPLAP (The (Temporary|Transnational|Terrestrial|Transdimensional) Organisation for the (Promotion|Proliferation|Permanence|Purity) of Live (Algorithm|Audio|Art|Artistic) Programming) is an informal organization formed in February 2004 to bring together the various communities that had formed around live coding environments. • Typically, the process of writing source code is made visible by projecting the computer screen in the audience space, with ways of visualising the code an area of active research.
  • 3. • “If the only tool you have is an hammer, everything looks like a nail” (Abraham Maslow) • “The most disastrous thing that you can ever learn is your fi rst programming language” (Alan Kay)
  • 4. Why Pharo? • For Smalltalk! • Arrays are at the core of electronic music, their manipulation in Pharo is extremely powerful. • Because the Playground is the perfect environment for Live Coding. • Because there are not other pure Object Oriented languages for Live Coding. • For its expressiveness and re fl ectiveness. • Because new methods and classes are created easily and always available to the system (i.e. no headers, no extra dependence, no tedious fi le management).
  • 5. Symbolic Sound Kyma • Music programming language and IDE written in Smalltalk created by Carla Scaletti and Kurt J. Hebel at Urbana Champaign, Illinois. • The Smalltalk code is compiled on an external DSP called Paca(rana) • M o s t p r o b a b l y : ) i t s d e v e l o p e d o n ObjectworksSmalltalk, Release 4.1 of 15 April 1992 • “The Holy Grail of sound design”
  • 7. • “L’unico principio primario in ogni azione umana, é il dispendio del minimo sforzo per portare a termine un compito” (George Zipf) • “L’iconicitá é la relazione di somiglianza tra i due aspetti di un segno: la sua forma e il suo signi fi cato. Un segno iconico é un segno che in qualche modo assomiglia al suo signi fi cato” (Meir) 2 principi: economia e trasparenza • La sintassi di Smalltalk può stare su una cartolina, mentre la sua semantica può essere letta come un pidgin English ed é pensata per i bambini
  • 8. Principi della programmazione orientata agli oggetti (Object Oriented Programming / OOP) • Incapsulamento • Astrazione • Ereditarietà • Polimor fi smo (late binding)
  • 9. • A front-end to write real time scores for a real-time audio synthesis backend (via OSC) or a MIDI device • A DSL to write quickly and easily rhythmical patterns and melodies What is the LiveCoding Package? • An ethnomusical quick-guide • The sound generators created on the backend must adhere to the LiveCoding Package syntax ( !InstrumentGate ! / InstrumentNote / !InstrumentDuration / !InstrumentExtra1 )
  • 10. P e r f o r m a n c e : a s u b c l a s s o f Dictionary that will contains instances of the Sequencer class or arrays Sequencer Gates Notes Durations Extra1 (optional) Extra2 (optional) noteIndex
  • 11. Process - Performance - Sequence - Rhythm • Performance is a subclass of Dictionary. • It contains association of Symbols and Arrays or Sequences • Sequencer is an Object whose main instance variables are: Gates, NoteNumbers, Durations, Extra1, Extra2. It is created sending the message asSeq to an instance of the Rhythm • Rhythm is a convenience subclass of Array • aPerformance playKymasequenceAt: aStepDuration rate: aNumberOfSteps • The Process forked at timingPriority check if the value of the key in the performance is a Sequencer or not. • If the value is a Sequencer, 3 OSC messages are sento to the client: - appending ‘Gate’, ‘Note’, ‘Duration’ to the key asString • aPerformance playLocalSequenceAt: aStepDuration rate: aNumberOfSteps • If it is a Sequencer, the noteIndex of the Sequencer is incremented at every stepDuration and reset to 1 every time it reaches the size of gates
  • 12. The LiveCoding package also contains a collection of Euclidean world rhythms and musical scales.
  • 13. • “The only primary principle of every human action, including verbal communication, is the expenditure of the least amount of e ff ort to accomplish a task. (George Zipf) • “Iconicty is the relation of similarity between to aspects of a sign: its form and its meaning. An iconic sign is a sign that in some way resembles its meaning.”(Meir) Economy and transparency
  • 14. The LiveCoding Package •Iconicity •Economy •Polysemy • To write music on-the- fl y with Pharo • Also for studio composition: a new kind of musical score Written code should resemble what we hear The less we type, the better PRINCIPLES Many ways to do the same thing • Pharo acts as an arranger, another program generates the sound (Kyma, PureData, MaxMSP, ChucK, SuperCollider, and so on. • Based on the OpenSoundControl at the moment, but MIDI implementation on the pipeline 16 upbeats #(60 63 67) + 16 16 randomsFrom: #(50 54 57) 16 randomNotes: (50 54 47)
  • 15. OpenSoundControl OSC • Developed by Adrian Free and Matt Wright at CNMAT at the end of the 90s. Firs speci fi cation published in 2002. • Flexile, fast and accurate alternative to the MIDI standard.. • Indipendent from the transport mechanism, OSC packets are typically sent and received thru UDP Sockets. • Server/Client architecture The server sends the package, the client receives them. • An OSC message consists of an OSC Address Pattern, followed by an OSC Type Tag String, followed by zero or more OSC Arguments ( for example: /frequency,f 0.3 ). • At the core of the LiveCoding Package for Pharo.
  • 16. OpenSoundControl OSC • The LiveCoding package simplify the creation and dispatching of OSC messages aNumber toLocal: aString. aNumber toKyma: aString. Send to the local host the message: ‘/aString, f aNumber’ Send to the Paca(rana) the message ’/aString, f aNumber’
  • 17. Step Sequencers On a Step Sequencer, a step can be active (1) or not active (0).
  • 18. In the Live Coding package you can create Sequencer or of numbers by sending messages to integers, for example: • 16 zeros • 64 randoms • 32 rumba • 16 quavers
  • 19. • Sending a message with the name of a scale to the Scale class returns an array with the intervals of that scale. For example, Scale sakura returns #(0 1 5 7 8) Scales!
  • 20. • BINARY: 1000100010001000 • HEXADECIMAL: 8888 A rhythm can be represented as an array of 0s and 1s, where a 1 represents a trig. • SMALLTALK: #(1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0) • LIVECODINGTALK: 16 downbeats • LIVECODINGTALK: ‘8888’ pattern
  • 21. • BINARY: 1001 0001 0010 1000 • HEXADECIMAL: 9128 • SMALLTALK: #(1 0 0 1 0 0 0 1 0 0 1 0 1 0 0 0 ) • LIVECODINGTALK: 16 rumba • LIVECODINGTALK: ‘9128’ pattern • SMALLTALK: #(1 0 1 0 1 0 1 0 1 0 1 0 1 1 1) • LIVECODINGTALK: 12 quavers, 4 semiquavers • LIVECODINGTALK: ‘AAAF’ pattern • BINARY: 1010 1010 1010 1111 • HEXADECIMAL: AAAF
  • 22. Bars, Bytes, Beats, Nibbles, Steps, Bits • 4 bits = 1 Nibble / 8 bit = 1 Byte. • 1 Bar, 16 Steps (1/16th quantisation). • If every step corrisponds to a Bit of Information, in a Bar we fi no 16 Bits, i.e. 2 Bytes • In every Bar there are 4 Beats, so in each Beat there are 4 Bits, i.e. 1 Nibble. • Every Hexadecimal symbol represents a Nibble. C D E F B 0 1 2 3 4 5 7 8 9 6 A Upbeat Downbeat Quavers Semiquavers
  • 23. • In the spring of 2022, the Pharo team in Lille helped with the development of MIDI compatibility for the LiveCoding Package. • A graduating student, Antoine Delaby, tutored by Santiago Bragagnolo, ported the MIDI output functionality of the C PortMidi library by the means of the Uni fi ed ForeignFunctionInterface provide by Pharo • It is now possible to send out MIDI noteOn and noteO ff messages from Pharo to external MIDI hardware connected to the host computer. • The MIDISender object provided by the LiveCoding package is a convenience object modelled from the MIDIOut object of the ChucK programming language MIDI integration aMIDISender playNote: aNoteNumber onChannel: aMIDIChannel duration: aDurationInSeconds • aPerformance playMIDISequenceAt: aStepDuration rate: aNumberOfSteps on: aMIDISender
  • 24. As supercollider frontend • Super Collider is an environment and programming language originally released in 1996 by James McCartney for real-time audio synthesis and algorithmic composition • It combines the object-oriented structure of Smalltalk, with a C-like syntax and features from functional programming language • SuperCollider’s sound generation is bundled into an optimised command-line executable (named scsynth) that is usually controlled within the SuperCollider language (sclang), bu that can be controlled via OpenSoundControl • A full Pharo front-end for the scsynth server is being developed, to enable the user to generate synthesiser and e ff ect and control the with Pharo syntax
  • 25. Future Challenges • Tests and DebugDriverDevelopment! • Documentation, user guide, tutorials • Optimisation! • MIDI input management. • Real polyrhythms (thanks Kasper for the complaint) • Graphical User Interface easy creation • Porting of PortAudio C library. • An audio server running inside Pharo, on the model of SuperCollider scServer. • A full programming language inside Pharo capable not only of algorithmic composition but also of sound production and sound synthesis - communicating via OSC messages to the internal audio server.