n-armstrong / fosc

A SuperCollider API for generating musical notation in LilyPond.
GNU General Public License v3.0
43 stars 7 forks source link

MusicXML and playing with various SynthDef #4

Open prko opened 1 year ago

prko commented 1 year ago

Dear developers,

Thanks for the great project. I have three questions:

  1. Is there a way to read musicXML files into sclang via Fosc? I see Fosc.xmlVersion in the help document, but I cannot find how to import a musicXML file.
  2. Is there a way to write musicXML files from sclang via Fosc?
  3. .play` is great, but how can I use Synth with Fosc?

Thanks in advance and regards,

n-armstrong commented 11 months ago

Hi,

Apologies for the extremely late reply -- I somehow missed your message the first time around.

MusicXML support is still in development and not yet part of the main library. It's not going to be possible to read xml files, but writing xml files is already working in a limited way.

n-armstrong commented 11 months ago

You can use your own synthdefs with Fosc's play mechanism by accessing the pattern property of any Fosc components or selection:

SynthDef('beep', { |midinote, amp| var src; src = SinOsc.ar(midinote.midicps, 0, amp); src = src * EnvGen.kr(Env.perc, doneAction: 2); Out.ar(0, Pan2.ar(src, 0)); }).add;

s.boot;

a = FoscMusicMaker().(durations: [1/16], pitches: (60..72)); p = Pbindf(a.pattern, \instrument, 'beep'); p.play;

n-armstrong commented 11 months ago

You can also access the eventList property of any Fosc component or selection for making your own modifications or additions:

a = FoscMusicMaker().(durations: [1/16], pitches: (60..72)); a.eventList;

prko commented 11 months ago

Thank you for your kind answers!