/* Instrument inspired from Rob Hordijk's Benjolin, it requires sc3-plugins (PulseDPW, SVF and DFM1)
outSignal: 1-triangle osc1, 2-square osc1, 3-triangle osc2, 4-pulse osc2, 5-XOR output, 6-Filter output
| var simpleFormatRE1 = /\r\n?/g; | |
| var simpleFormatRE2 = /\n\n+/g; | |
| var simpleFormatRE3 = /([^\n]\n)(?=[^\n])/g; | |
| function simpleFormat(str) { | |
| var fstr = str; | |
| fstr = fstr.replace(simpleFormatRE1, "\n") // \r\n and \r -> \n | |
| fstr = fstr.replace(simpleFormatRE2, "</p>\n\n<p>") // 2+ newline -> paragraph | |
| fstr = fstr.replace(simpleFormatRE3, "$1<br/>") // 1 newline -> br | |
| fstr = "<p>" + fstr + "</p>"; | |
| return fstr; |
| class MasterOfCeremonies { //I hate naming in potted examples | |
| public void handle(Dog dog) { | |
| dog.speak(); | |
| } | |
| } | |
| class Dog { | |
| public void speak() { | |
| //something | |
| } |
/* Instrument inspired from Rob Hordijk's Benjolin, it requires sc3-plugins (PulseDPW, SVF and DFM1)
outSignal: 1-triangle osc1, 2-square osc1, 3-triangle osc2, 4-pulse osc2, 5-XOR output, 6-Filter output