Warning: Use of undefined constant wp_cumulus_widget - assumed 'wp_cumulus_widget' (this will throw an Error in a future version of PHP) in /customers/a/d/4/guylevans.co.uk/httpd.www/blog/wp-content/plugins/wp-cumulus/wp-cumulus.php on line 375
Warning: Cannot modify header information - headers already sent by (output started at /customers/a/d/4/guylevans.co.uk/httpd.www/blog/wp-content/plugins/wp-cumulus/wp-cumulus.php:375) in /customers/a/d/4/guylevans.co.uk/httpd.www/blog/wp-includes/feed-rss2-comments.php on line 8
please, could you give some details of how you manage to cut your my quarterly electricity bill from £130 to just £45. it seems a huge rate.
best regards, pescadito
]]>package music.instruments.MTPiano;
import java.util.HashMap;
import com.cycling74.max.*;
import java.util.Map;
import processing.core.PApplet;
import ddf.minim.AudioOutput;
import ddf.minim.Minim;
public class NotePlayer {
private PApplet app;
public NotePlayer(PApplet app) {
this.app = app;
keys = new HashMap();
}
public enum Key {
KEY_TYPE_C,
KEY_TYPE_C_SUST,
KEY_TYPE_D,
KEY_TYPE_D_SUST,
KEY_TYPE_E,
KEY_TYPE_F,
KEY_TYPE_F_SUST,
KEY_TYPE_G,
KEY_TYPE_G_SUST,
KEY_TYPE_A,
KEY_TYPE_A_SUST,
KEY_TYPE_B,
KEY_TYPE_C_UP,
KEY_TYPE_INVALID
}
private Map keys;
public void playNote(Key k) {
closeMinim(k);
Minim minim = new Minim(app);
AudioOutput out = minim.getLineOut(Minim.MONO, 2048);
NoteMinim nm = new NoteMinim();
nm.setMinim(minim);
nm.setAudioOutput(out);
keys.put(k, nm);
if (k == Key.KEY_TYPE_A) {
out.playNote(“A”);
} else if (k == Key.KEY_TYPE_B) {
out.playNote(“B”);
} else if (k == Key.KEY_TYPE_C) {
out.playNote(“C”);
} else if (k == Key.KEY_TYPE_D) {
out.playNote(“D”);
} else if (k == Key.KEY_TYPE_E) {
out.playNote(“E”);
} else if (k == Key.KEY_TYPE_F) {
out.playNote(“F”);
} else if (k == Key.KEY_TYPE_G) {
out.playNote(“G”);
} else if (k == Key.KEY_TYPE_C_SUST) {
out.playNote(“C#”);
} else if (k == Key.KEY_TYPE_D_SUST) {
out.playNote(“D#”);
} else if (k == Key.KEY_TYPE_F_SUST) {
out.playNote(“F#”);
} else if (k == Key.KEY_TYPE_G_SUST) {
out.playNote(“G#”);
} else if (k == Key.KEY_TYPE_A_SUST) {
out.playNote(“A#”);
} else if (k == Key.KEY_TYPE_C_UP) {
out.playNote(“C5”);
}
if (out.isMuted()) {
out.unmute();
}
/*
summer.pan();
// create a SquareWave with a frequency of 440 Hz,
// an amplitude of 1 and the same sample rate as summer
SquareWave square;
if (k == NotePlayer.Key.KEY_TYPE_C) {
square = new SquareWave(240, 1, 44100);
} else {
square = new SquareWave(440, 1, 44100);
}
// create a LowPassSP filter with a cutoff frequency of 200 Hz
// that expects audio with the same sample rate as summer
LowPassSP lowpass = new LowPassSP(200, 44100);
// now we can attach the square wave and the filter to our output
summer.addSignal(square);
summer.addEffect(lowpass);
if (summer.isMuted()) {
summer.unmute();
}*/
}
public void stopNote(Key k) {
}
private void closeMinim(Key k) {
if (keys.containsKey(k)) {
NoteMinim nm = keys.get(k);
nm.getAudioOutput().mute();
nm.getAudioOutput().close();
nm.getMinim().stop();
}
}
private class NoteMinim {
private AudioOutput out;
private Minim minim;
public AudioOutput getAudioOutput() {
return out;
}
public void setAudioOutput(AudioOutput out) {
this.out = out;
}
public Minim getMinim() {
return minim;
}
public void setMinim(Minim minim) {
this.minim = minim;
}
}
}
Have you ever tired to send data up to pachube using the minim getLineIn library as the data feed?
If not, do you think this is possible to do?
]]>I have now fixed the contact form on my blog.
I recently updated the wordpress plugin and it seemed i also needed to reactivate the plugin. Thanks for letting me know that it wasn’t working correctly.
Also, the xml parser (Pachube to Max) max/msp patch has since been updated and is now available at http://apps.pachube.com/#mc
(scroll down to the bottom of page).
The current version of Pach2Max (1.01) includes a few updates to the early test version shown on my blog). I would be very grateful if you could give the updated version a test.
p.s You might also like to test out these max/msp Pachube patches, created by Nnimar (from the max/msp forums).
http://cycling74.com/toolbox/pachube-tools/
He created 2 max/msp patches, one gets data from Pachube (using OSC) and the other patch receives XML data from a CC128 Current Cost meter.
Thanks again for your comment and good luck with your projects!
]]>Thanks for sharing your Pachube to Max Patch, looks very handy indeed.
I’ve downloaded and opened the patch in Max5, filled in the various variables, but when I get to step 4 (double click to bang), all I get in my max window is an error message. Object: jit.textfile, Message: doesn’t understand “download”. Have I missed something very basic here? PS. Great blog site, heaps of really interesting e-art related info!
PPS. The contact form on your contact page doesn’t appear in any of my browsers (Mac: Safari, Firefox, Iron)
Thanks in advance,
Joel in Western Australia
Enrico
(we met in Cardiff for the arduino workshop)