Package de.maramuse.soundcomp.generator

Examples of de.maramuse.soundcomp.generator.SawTooth


  ProcessElement m=new mul();
  ProcessElement m1=new mul();
  ProcessElement m2=new mul();
  ProcessElement p1=new plus();
  ProcessElement p2=new plus();
  ProcessElement st=new SawTooth();
  try{
    ev.setSource(SYNC.i, tom, GATE.i);
    ev.setSource(A.i, ConstStream.c(0.01), OUT.i);
    ev.setSource(D.i, ConstStream.c(1), OUT.i);
    ev.setSource(R.i, ConstStream.c(1), OUT.i);
    ev.setSource(S.i, ConstStream.c(0), OUT.i);
    m.setSource(IN_IMAG.i, ev, OUT.i);
    m.setSource(IN.i, st, OUT.i);
    m1.setSource(IN_IMAG.i, ev, OUT.i);
    m1.setSource(IN.i, ConstStream.c(20), OUT.i);
    p1.setSource(IN_IMAG.i, m1, OUT.i);
    p1.setSource(IN.i, ConstStream.c(150), OUT.i);
    st.setSource(FREQUENCY.i, p1, OUT.i);
    p2.setSource(IN_IMAG.i, m2, OUT.i);
    m2.setSource(IN.i, ConstStream.c(0.3), OUT.i);
    m2.setSource(IN_IMAG.i, ev, OUT.i);
    p2.setSource(IN.i, ConstStream.c(0.5), OUT.i);
    st.setSource(DUTYCYCLE.i, p2, OUT.i);
  }catch(UnknownConnectionException e){
    e.printStackTrace();
  }catch(TypeMismatchException e){
    e.printStackTrace();
  }
View Full Code Here


  ProcessElement m=new mul();
  ProcessElement m1=new mul();
  ProcessElement m2=new mul();
  ProcessElement p1=new plus();
  ProcessElement p2=new plus();
  ProcessElement st=new SawTooth();
  ProcessElement m3=new mul();
  ProcessElement m4=new mul();
  try{
    ev.setSource(SYNC.i, bd, GATE.i);
    ev.setSource(A.i, ConstStream.c(0.01), OUT.i);
    ev.setSource(D.i, ConstStream.c(0.7), OUT.i);
    ev.setSource(R.i, ConstStream.c(0.7), OUT.i);
    ev.setSource(S.i, ConstStream.c(0), OUT.i);
    m.setSource(IN_IMAG.i, ev, OUT.i);
    m.setSource(IN.i, st, OUT.i);
    m1.setSource(IN_IMAG.i, ev, OUT.i);
    m1.setSource(IN.i, ConstStream.c(20), OUT.i);
    p1.setSource(IN_IMAG.i, m1, OUT.i);
    p1.setSource(IN.i, ConstStream.c(50), OUT.i);
    st.setSource(FREQUENCY.i, p1, OUT.i);
    p2.setSource(IN_IMAG.i, m2, OUT.i);
    m2.setSource(IN.i, ConstStream.c(0.3), OUT.i);
    m2.setSource(IN_IMAG.i, ev, OUT.i);
    p2.setSource(IN.i, ConstStream.c(0.5), OUT.i);
    st.setSource(DUTYCYCLE.i, p2, OUT.i);
    bd.addElement(ev);
    bd.addElement(m);
    bd.addElement(m1);
    bd.addElement(m2);
    bd.addElement(p1);
View Full Code Here

  // create one note instance for the solo instrument
  private Event createSoloNote(note n, double volume) {
  double effvol=volume;
  if(n.beats<1.0/8)effvol*=0.7;
  Event event=new Event();
  SawTooth st=new SawTooth();
  PinkNoise pn=new PinkNoise();
  mul noisevol=new mul();
  mul sawvol=new mul();
  Envelope noiseenv=new Envelope();
  Envelope sawenv=new Envelope();
  Mixer out=new Mixer();
  try{
    st.setSource(FREQUENCY.i, ConstStream.c(n.frequency), OUT.i);
    st.setSource(DUTYCYCLE.i, ConstStream.c(0.5), OUT.i);
    out.setSource(-1, sawvol, OUT.i);
    out.setSource(-1, ConstStream.c(0.5*effvol), OUT.i);
    out.setSource(-2, noisevol, OUT.i);
    out.setSource(-2, ConstStream.c(0.4*effvol), OUT.i);
    sawvol.setSource(IN_IMAG.i, st, OUT.i);
View Full Code Here

  event.setStarttime(ts);
  event.setDuration(durationGate);
  event.setLivetime(durationTotal);
  event.setFrequency(scale.getValueFor(note));
  event.setPitch(scale.getPitch(note));
  SawTooth st=new SawTooth();
  st.setAbstractName("bass-st");
  st.setInstanceName("bass-st"+nameCount++);
  Envelope filterEnv=new Envelope();
  Envelope volumeEnv=new Envelope();
  StateVariableFilter svf=new StateVariableFilter();
  mul mfilfreq=new mul(), mfilfreq2=new mul();
  plus pfilfreq=new plus();
  mul mout=new mul();
  mul mvol=new mul();
  try{
    filterEnv.setSource(SYNC.i, event, GATE.i);
    filterEnv.setSource(A.i, ConstStream.c(0.2), OUT.i);
    filterEnv.setSource(D.i, ConstStream.c(0.4), OUT.i);
    filterEnv.setSource(R.i, ConstStream.c(0.4), OUT.i);
    filterEnv.setSource(S.i, ConstStream.c(0), OUT.i);
    volumeEnv.setSource(SYNC.i, event, GATE.i);
    volumeEnv.setSource(A.i, ConstStream.c(0.1), OUT.i);
    volumeEnv.setSource(D.i, ConstStream.c(0.3), OUT.i);
    volumeEnv.setSource(R.i, ConstStream.c(0.3), OUT.i);
    volumeEnv.setSource(S.i, ConstStream.c(0.3), OUT.i);
    st.setSource(FREQUENCY.i, event, FREQUENCY.i);
    svf.setSource(IN.i, st, OUT.i);
    mfilfreq.setSource(IN.i, filterEnv, OUT.i);
    mfilfreq.setSource(IN_IMAG.i, ConstStream.c(4), OUT.i);
    mfilfreq2.setSource(IN.i, mfilfreq, OUT.i);
    mfilfreq2.setSource(IN_IMAG.i, event, FREQUENCY.i);
View Full Code Here

  ProcessElement m=new mul();
  ProcessElement m1=new mul();
  ProcessElement m2=new mul();
  ProcessElement p1=new plus();
  ProcessElement p2=new plus();
  ProcessElement st=new SawTooth();
  try{
    ev.setSource(SYNC.i, tom, GATE.i);
    ev.setSource(A.i, ConstStream.c(0.01), OUT.i);
    ev.setSource(D.i, ConstStream.c(1), OUT.i);
    ev.setSource(R.i, ConstStream.c(1), OUT.i);
    ev.setSource(S.i, ConstStream.c(0), OUT.i);
    m.setSource(IN_IMAG.i, ev, OUT.i);
    m.setSource(IN.i, st, OUT.i);
    m1.setSource(IN_IMAG.i, ev, OUT.i);
    m1.setSource(IN.i, ConstStream.c(20), OUT.i);
    p1.setSource(IN_IMAG.i, m1, OUT.i);
    p1.setSource(IN.i, ConstStream.c(150), OUT.i);
    st.setSource(FREQUENCY.i, p1, OUT.i);
    p2.setSource(IN_IMAG.i, m2, OUT.i);
    m2.setSource(IN.i, ConstStream.c(0.3), OUT.i);
    m2.setSource(IN_IMAG.i, ev, OUT.i);
    p2.setSource(IN.i, ConstStream.c(0.5), OUT.i);
    st.setSource(DUTYCYCLE.i, p2, OUT.i);
  }catch(UnknownConnectionException e){
    e.printStackTrace();
  }catch(TypeMismatchException e){
    e.printStackTrace();
  }
View Full Code Here

  ProcessElement m=new mul();
  ProcessElement m1=new mul();
  ProcessElement m2=new mul();
  ProcessElement p1=new plus();
  ProcessElement p2=new plus();
  ProcessElement st=new SawTooth();
  ProcessElement m3=new mul();
  ProcessElement m4=new mul();
  try{
    ev.setSource(SYNC.i, bd, GATE.i);
    ev.setSource(A.i, ConstStream.c(0.01), OUT.i);
    ev.setSource(D.i, ConstStream.c(0.7), OUT.i);
    ev.setSource(R.i, ConstStream.c(0.7), OUT.i);
    ev.setSource(S.i, ConstStream.c(0), OUT.i);
    m.setSource(IN_IMAG.i, ev, OUT.i);
    m.setSource(IN.i, st, OUT.i);
    m1.setSource(IN_IMAG.i, ev, OUT.i);
    m1.setSource(IN.i, ConstStream.c(20), OUT.i);
    p1.setSource(IN_IMAG.i, m1, OUT.i);
    p1.setSource(IN.i, ConstStream.c(50), OUT.i);
    st.setSource(FREQUENCY.i, p1, OUT.i);
    p2.setSource(IN_IMAG.i, m2, OUT.i);
    m2.setSource(IN.i, ConstStream.c(0.3), OUT.i);
    m2.setSource(IN_IMAG.i, ev, OUT.i);
    p2.setSource(IN.i, ConstStream.c(0.5), OUT.i);
    st.setSource(DUTYCYCLE.i, p2, OUT.i);
    bd.addElement(ev);
    bd.addElement(m);
    bd.addElement(m1);
    bd.addElement(m2);
    bd.addElement(p1);
View Full Code Here

  private Event createSoloNote(note n, double volume) {
  double effvol=volume;
  if(n.beats<1.0/8)
    effvol*=0.7;
  Event event=new Event();
  SawTooth st=new SawTooth();
  WhiteNoise pn=new WhiteNoise();
  mul noisevol=new mul();
  mul sawvol=new mul();
  Envelope noiseenv=new Envelope();
  Envelope sawenv=new Envelope();
  Sine dclfo1=new Sine();
  Sine dclfo2=new Sine();
  mul lfomul1=new mul(), lfomul2=new mul();
  mul lfomul1a=new mul(), lfomul2a=new mul();
  plus lfopl1=new plus(), lfopl2=new plus();
  Mixer out=new Mixer();
  try{
    lfomul1.setSource(IN_IMAG.i, ConstStream.c(n.frequency), OUT.i);
    lfomul1.setSource(IN.i, ConstStream.c(0.00033), OUT.i);
    dclfo1.setSource(FREQUENCY.i, lfomul1, OUT.i);
    lfomul1a.setSource(IN_IMAG.i, dclfo1, OUT.i);
    lfomul1a.setSource(IN.i, ConstStream.c(0.333), OUT.i);
    lfopl1.setSource(IN_IMAG.i, lfomul1a, OUT.i);
    lfopl1.setSource(IN.i, ConstStream.c(0.5), OUT.i);
    lfomul2.setSource(IN_IMAG.i, ConstStream.c(n.frequency), OUT.i);
    lfomul2.setSource(IN.i, ConstStream.c(0.00013), OUT.i);
    dclfo2.setSource(FREQUENCY.i, lfomul2, OUT.i);
    lfomul2a.setSource(IN_IMAG.i, dclfo2, OUT.i);
    lfomul2a.setSource(IN.i, ConstStream.c(0.133), OUT.i);
    lfopl2.setSource(IN_IMAG.i, lfomul2a, OUT.i);
    lfopl2.setSource(IN.i, lfopl1, OUT.i);
    st.setSource(FREQUENCY.i, ConstStream.c(n.frequency), OUT.i);
    st.setSource(DUTYCYCLE.i, lfopl2, OUT.i);
    out.setSource(-1, sawvol, OUT.i);
    out.setSource(-1, ConstStream.c(0.5*effvol), OUT.i);
    out.setSource(-2, noisevol, OUT.i);
    out.setSource(-2, ConstStream.c(0.4*effvol), OUT.i);
    sawvol.setSource(IN_IMAG.i, st, OUT.i);
View Full Code Here

  event.setStarttime(ts);
  event.setDuration(durationGate);
  event.setLivetime(durationTotal);
  event.setFrequency(scale.getValueFor(note));
  event.setPitch(scale.getPitch(note));
  SawTooth st=new SawTooth();
  st.setAbstractName("bass-st");
  st.setInstanceName("bass-st"+nameCount++);
  Envelope filterEnv=new Envelope();
  Envelope volumeEnv=new Envelope();
  StateVariableFilter svf=new StateVariableFilter();
  mul mfilfreq=new mul(), mfilfreq2=new mul();
  plus pfilfreq=new plus();
  mul mout=new mul();
  mul mvol=new mul();
  try{
    filterEnv.setSource(SYNC.i, event, GATE.i);
    filterEnv.setSource(A.i, ConstStream.c(0.2), OUT.i);
    filterEnv.setSource(D.i, ConstStream.c(0.4), OUT.i);
    filterEnv.setSource(R.i, ConstStream.c(0.4), OUT.i);
    filterEnv.setSource(S.i, ConstStream.c(0), OUT.i);
    volumeEnv.setSource(SYNC.i, event, GATE.i);
    volumeEnv.setSource(A.i, ConstStream.c(0.1), OUT.i);
    volumeEnv.setSource(D.i, ConstStream.c(0.3), OUT.i);
    volumeEnv.setSource(R.i, ConstStream.c(0.3), OUT.i);
    volumeEnv.setSource(S.i, ConstStream.c(0.3), OUT.i);
    st.setSource(FREQUENCY.i, event, FREQUENCY.i);
    svf.setSource(IN.i, st, OUT.i);
    mfilfreq.setSource(IN.i, filterEnv, OUT.i);
    mfilfreq.setSource(IN_IMAG.i, ConstStream.c(4), OUT.i);
    mfilfreq2.setSource(IN.i, mfilfreq, OUT.i);
    mfilfreq2.setSource(IN_IMAG.i, event, FREQUENCY.i);
View Full Code Here

  event.setStarttime(ts);
  event.setDuration(durationGate);
  event.setLivetime(durationTotal);
  event.setFrequency(scale.getValueFor(note));
  event.setPitch(scale.getPitch(note));
  SawTooth st=new SawTooth();
  st.setAbstractName("pad-st");
  st.setInstanceName("pad-st"+nameCount++);
  Envelope filterEnv=new Envelope();
  Sine lfo=new Sine();
  Envelope volumeEnv=new Envelope();
  StateVariableFilter svf=new StateVariableFilter();
  StateVariableFilter hp=new StateVariableFilter();
  mul mfilfreq=new mul(), mfilfreq2=new mul();
  plus pfilfreq=new plus();
  mul mout=new mul();
  mul lfof=new mul();
  mul mvol=new mul();
  mul dmul=new mul();
  mul dmul2=new mul();
  plus dpl=new plus();
  plus dpl2=new plus();
  try{
    lfof.setSource(IN_IMAG.i, event, FREQUENCY.i);
    lfof.setSource(IN.i, ConstStream.c(0.005), OUT.i);
    lfo.setSource(FREQUENCY.i, lfof, OUT.i);
    hp.setSource(FREQUENCY.i, ConstStream.c(20), OUT.i);
    hp.setSource(IN.i, st, OUT.i);
    filterEnv.setSource(SYNC.i, event, GATE.i);
    filterEnv.setSource(A.i, ConstStream.c(0.4), OUT.i);
    filterEnv.setSource(D.i, ConstStream.c(0.7), OUT.i);
    filterEnv.setSource(R.i, ConstStream.c(0.7), OUT.i);
    filterEnv.setSource(S.i, ConstStream.c(0), OUT.i);
    volumeEnv.setSource(SYNC.i, event, GATE.i);
    volumeEnv.setSource(A.i, ConstStream.c(0.4), OUT.i);
    volumeEnv.setSource(D.i, ConstStream.c(3.1), OUT.i);
    volumeEnv.setSource(R.i, ConstStream.c(5.1), OUT.i);
    volumeEnv.setSource(S.i, ConstStream.c(0.8), OUT.i);
    st.setSource(FREQUENCY.i, event, FREQUENCY.i);
    dmul.setSource(IN_IMAG.i, filterEnv, OUT.i);
    dmul.setSource(IN.i, ConstStream.c(0.15), OUT.i);
    dpl.setSource(IN_IMAG.i, dmul, OUT.i);
    dpl.setSource(IN.i, ConstStream.c(0.8), OUT.i);
    st.setSource(DUTYCYCLE.i, dpl2, OUT.i);
    dpl2.setSource(IN.i, dpl, OUT.i);
    dpl2.setSource(IN_IMAG.i, dmul2, OUT.i);
    dmul2.setSource(IN_IMAG.i, lfo, OUT.i);
    dmul2.setSource(IN.i, ConstStream.c(0.2), OUT.i);
    svf.setSource(IN.i, hp, HP.i);
View Full Code Here

TOP

Related Classes of de.maramuse.soundcomp.generator.SawTooth

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.