Python for manufacturing
musical instruments
Olivier CAYROL - June 15th, 2016
 
Prolegomena
•  A few words about me:
•  co-founder and deputy CEO of Logilab
•  cuddling computers for 30 years
•  data modelling, software design
•  A few words about my company:
•  created in 2000, 20 engineers today
•  Python since the beginning, agile development
•  active free software supporter
•  development of strategic semantic Web applications:
•  data.bnf.fr (national library), francearchives.fr (national archives)
2
 
Context
•  Making and repair of musical instruments:
•  2,400 companies in France, 2/3 with only 1 employee
•  employees: 11,000 people in France
•  turnover: 800 millions Euros / year
•  exported production rate: 80%
•  Assets:
•  traditional craftsmanship
•  world-famous quality
•  Challenge:
•  aggressive competition from foreign countries
3
 
Context illustration
Restoration of baritone saxo from 1901, Gaëtan Schneider
4
 
ITEMM laboratory
•  European Technological Institute for Musical Professions
•  Based in Le Mans, France
•  Designing digital tools dedicated to the manufacturing of musical
instruments:
•  characterization of instruments
•  analysis of the sounds the instruments produce
•  development of digital models to predict the sounds of the instruments
•  Driving the digital revolution of the French sector of instruments
craftsmanship
5
 
Needs of the instrument makers
•  When designing an instrument, makers are interested in:
•  tuning
•  timbre
•  ease of playing
•  Traditionally, makers:
•  build multiple prototypes
•  in order to choose the proper instrument dimensions
6
 
PAFI platform
•  Web application developped by ITEMM and Logilab
•  source code to be soon published as free software
•  Support for woodwind and brass wind instruments:
•  trumpets, horns, trombones, saxophones, clarinets, oboes, etc.
•  Dedicated digital tools:
•  instrument models, fingering descriptions
•  computation of acoustic input impedance for a given fingering
•  tuning diagram for each fingering
•  capture of acoustic input impedance from a real instrument
•  Ability to share and clone instrument models
7
 
PAFI platform overview
8
 
Use case 1 - introduction
•  Project made by Baptiste Le Guillou
•  student at the ITEMM
•  in the context of his degree in Arts and Crafts (Brevet des Métiers d'Art)
•  project duration: 2 years
•  Turning a valves trumpet into a valves and slide trumpet
•  the added slide must modify the note up to one tone
•  the added slide allows playing quarter tones or glissando effects
9
 
Use case 1 - work to be done
•  Add tubings in the tuning slide to allow the desired effect
•  Remove a part of the tubing between the bell and the valves
•  in order to have a longer space for the tuning slide
10
 
Use case 1 - study
•  Questions to be answered:
•  what length of tubing should be added to the tuning slide?
•  what are the effects of the modifications on the instrument?
•  Use of the digital simulation instead of numerous trial / error cycles:
•  cheaper, faster
•  ability to explore more possibilities
11
 
Use case 1 - geometry
•  Measure of the actual instrument:
•  tubings length and diameter
•  valves position
•  Description of the instrument in the platform:
•  series of tubings, cones, valves, returns, holes, etc.
•  different fingerings:
•  which holes are closed, half-closed, opened
•  which valve pistons are pushed
•  what note is expected
12
 
Use case 1 - computation
•  Computation of the acoustic impedance:
•  Fourier transform of the pressure divided by the volume flow
•  shows the resonance frequencies of the instrument
•  and thus the notes that can be played
•  Computation of the tuning diagram:
•  difference between the expected note and the actual note (computed above)
•  the musician must adjust his playing to correct the note:
•  small differences mean ease of playing
13
 
Use case 1 - results
14
 
Use case 1 - checking
•  Measure of the actual acoustic impedance of the instrument
•  with dedicated sensors (loudspeakers and microphone)
•  connection through the Web browser thanks to the Web audio API
•  Comparison of the two impedance graphs
•  especially the resonance frequencies
15
 
Use case 1 - measures
16
 
Use case 1 - conclusion
•  Different slide lengths have been simulated
•  The best option has been implemented on the instrument
•  The result perfectly meets the initial requirements
17
 
Use case 2 - introduction
•  Project made by Gaëtan Schneider
•  student at the ITEMM
•  in the context of his degree in Arts and Crafts (Brevet des Métiers d'Art)
•  project duration: 2 years
•  Restoring a Couesnon baritone saxo from 1901
•  numerous keys are twisted
•  the neck is smashed and splitted
•  it can't be restored
18
 
Use case 2 - initial state
19
 
Use case 2 - study
•  A new neck must be built
•  Question to be answered:
•  what must be the length and the shape of the neck?
•  Study:
•  geometry description
•  computation of tuning diagram
•  digital try of different necks
20
 
Use case 2 - model
21
 
Use case 2 - results
22
 
Under the hood
•  Web application coded in Python and javascript
•  Computations based on numpy and scipy libraries
•  refactored from Matlab prototypes
•  Simple model and simple computations
•  easy to describe
•  fast to compute
•  sufficient accuracy for the expected physical values
•  the played note corresponds to the first order in physics
23
 
Feedbacks
•  Craftsmen:
•  easy test of instrument designs with a digital tool
•  ability to explore and dig in several options
•  no installation (Web application)
•  Researchers:
•  easy-to-understand code
•  Python compactness, high-level operations in its numeric libraries
•  structuring in modules
•  security from the numerous automatic tests
•  ability to enhance the algorithms without regression
24
 
We are hiring!
•  Visit http://www.logilab.fr/emplois
•  Web developer (javascript + Python)
•  Developer for data analysis and semantic Web (Python)
•  Thank you for your attention
•  Email: olivier.cayrol@logilab.fr
•  Twitter: @OCayrol
25
Pydata Paris Python for manufacturing musical instruments

Pydata Paris Python for manufacturing musical instruments

  • 1.
      Python for manufacturing musicalinstruments Olivier CAYROL - June 15th, 2016
  • 2.
      Prolegomena •  A few wordsabout me: •  co-founder and deputy CEO of Logilab •  cuddling computers for 30 years •  data modelling, software design •  A few words about my company: •  created in 2000, 20 engineers today •  Python since the beginning, agile development •  active free software supporter •  development of strategic semantic Web applications: •  data.bnf.fr (national library), francearchives.fr (national archives) 2
  • 3.
      Context •  Making and repairof musical instruments: •  2,400 companies in France, 2/3 with only 1 employee •  employees: 11,000 people in France •  turnover: 800 millions Euros / year •  exported production rate: 80% •  Assets: •  traditional craftsmanship •  world-famous quality •  Challenge: •  aggressive competition from foreign countries 3
  • 4.
      Context illustration Restoration ofbaritone saxo from 1901, Gaëtan Schneider 4
  • 5.
      ITEMM laboratory •  European TechnologicalInstitute for Musical Professions •  Based in Le Mans, France •  Designing digital tools dedicated to the manufacturing of musical instruments: •  characterization of instruments •  analysis of the sounds the instruments produce •  development of digital models to predict the sounds of the instruments •  Driving the digital revolution of the French sector of instruments craftsmanship 5
  • 6.
      Needs of theinstrument makers •  When designing an instrument, makers are interested in: •  tuning •  timbre •  ease of playing •  Traditionally, makers: •  build multiple prototypes •  in order to choose the proper instrument dimensions 6
  • 7.
      PAFI platform •  Web applicationdevelopped by ITEMM and Logilab •  source code to be soon published as free software •  Support for woodwind and brass wind instruments: •  trumpets, horns, trombones, saxophones, clarinets, oboes, etc. •  Dedicated digital tools: •  instrument models, fingering descriptions •  computation of acoustic input impedance for a given fingering •  tuning diagram for each fingering •  capture of acoustic input impedance from a real instrument •  Ability to share and clone instrument models 7
  • 8.
  • 9.
      Use case 1 - introduction •  Projectmade by Baptiste Le Guillou •  student at the ITEMM •  in the context of his degree in Arts and Crafts (Brevet des Métiers d'Art) •  project duration: 2 years •  Turning a valves trumpet into a valves and slide trumpet •  the added slide must modify the note up to one tone •  the added slide allows playing quarter tones or glissando effects 9
  • 10.
      Use case 1 - workto be done •  Add tubings in the tuning slide to allow the desired effect •  Remove a part of the tubing between the bell and the valves •  in order to have a longer space for the tuning slide 10
  • 11.
      Use case 1 - study •  Questionsto be answered: •  what length of tubing should be added to the tuning slide? •  what are the effects of the modifications on the instrument? •  Use of the digital simulation instead of numerous trial / error cycles: •  cheaper, faster •  ability to explore more possibilities 11
  • 12.
      Use case 1 - geometry •  Measureof the actual instrument: •  tubings length and diameter •  valves position •  Description of the instrument in the platform: •  series of tubings, cones, valves, returns, holes, etc. •  different fingerings: •  which holes are closed, half-closed, opened •  which valve pistons are pushed •  what note is expected 12
  • 13.
      Use case 1 - computation •  Computationof the acoustic impedance: •  Fourier transform of the pressure divided by the volume flow •  shows the resonance frequencies of the instrument •  and thus the notes that can be played •  Computation of the tuning diagram: •  difference between the expected note and the actual note (computed above) •  the musician must adjust his playing to correct the note: •  small differences mean ease of playing 13
  • 14.
  • 15.
      Use case 1 - checking •  Measureof the actual acoustic impedance of the instrument •  with dedicated sensors (loudspeakers and microphone) •  connection through the Web browser thanks to the Web audio API •  Comparison of the two impedance graphs •  especially the resonance frequencies 15
  • 16.
  • 17.
      Use case 1 - conclusion •  Differentslide lengths have been simulated •  The best option has been implemented on the instrument •  The result perfectly meets the initial requirements 17
  • 18.
      Use case 2 - introduction •  Projectmade by Gaëtan Schneider •  student at the ITEMM •  in the context of his degree in Arts and Crafts (Brevet des Métiers d'Art) •  project duration: 2 years •  Restoring a Couesnon baritone saxo from 1901 •  numerous keys are twisted •  the neck is smashed and splitted •  it can't be restored 18
  • 19.
  • 20.
      Use case 2 - study •  Anew neck must be built •  Question to be answered: •  what must be the length and the shape of the neck? •  Study: •  geometry description •  computation of tuning diagram •  digital try of different necks 20
  • 21.
  • 22.
  • 23.
      Under the hood •  Webapplication coded in Python and javascript •  Computations based on numpy and scipy libraries •  refactored from Matlab prototypes •  Simple model and simple computations •  easy to describe •  fast to compute •  sufficient accuracy for the expected physical values •  the played note corresponds to the first order in physics 23
  • 24.
      Feedbacks •  Craftsmen: •  easy test ofinstrument designs with a digital tool •  ability to explore and dig in several options •  no installation (Web application) •  Researchers: •  easy-to-understand code •  Python compactness, high-level operations in its numeric libraries •  structuring in modules •  security from the numerous automatic tests •  ability to enhance the algorithms without regression 24
  • 25.
      We are hiring! •  Visithttp://www.logilab.fr/emplois •  Web developer (javascript + Python) •  Developer for data analysis and semantic Web (Python) •  Thank you for your attention •  Email: olivier.cayrol@logilab.fr •  Twitter: @OCayrol 25