Memo: Maven

Installation How to install Maven on Windows Maven is a Java application, so we are just fine with expanding product zip package and setting environment variables M2_HOME and JAVA_HOME and set PATH. Creating a Maven Project Maven in 5 Minutes Maven in 5 seconds... dothis: mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

Stub Synth Module for MOM Development

MOM (Master Of Modules) manages synthesizer modules to make them work as a single musical instrument.  The main responsibilities of MOM are Control patching. Control parameters. Organize voices. (possibly) Organize modules such as device ID management. Designing and implementing MOM and synth module data model is yet another challenge out of building CAN network.  Basically, the inter-module communication depends on CAN physical layer, but it's a pain to dragging such a dependency during the MOM development.  I'm sure the CAN network would be quite unstable at first and I don't want to stop and troubleshoot CAN while I'm working on MOM. So, in order to remove dependency on CAN network,…

MCP2515 CAN Controller

As I mentioned in the previous article, I'll use MCP2515 CAN controller for inter-module communication (initially, at least) for the Analog3 Project. Datasheet of this device is available at the product page. MCP2515 consists of CAN protocol engine, data buffers,  controller, and SPI interface as illustrated in the picture below. You need to attach a processor to make this device functional.  In early phase of the project, I'm thinking of using a Raspberry Pi as the Master Of Modules (mom) and Arduino's for dummy synthesizer modules.  Arduino is not a realistic solution for Analog3 both in terms of cost and performance.  So, I'm thinking of implementing a common synthesizer module…

Changing the Strategy for Analog3

I've been trying for a year to make my own serial interface protocol to exchange data among synth modules.  Though it showed some progress, I kind of giving up this approach.  The problem is complexity of serial interface controller.  A controller for multi-master serial interface is complex.  Implementing using a generic device is more costly in many sense than I expected.  I started with Arduino.  This was the easiest approach but channel was too slow.  I could only achieve 50kbps.  Then I tried implementing it into AVR using assembler language.  It went 100kbps but it was about the limit.  The most serious problem with MPU was that the processing is…

Raspberry Pi I2C clock-stretching problem

The I2C slave that I'm developing has been failing intermittently.  I finally noticed this was a known bug in Raspberry Pi that mishandles clock stretching. I2C slave may delay response by holding SCL low.  However, when the slave does it, the I2C master in Raspberry Pi gives very short clock for the first bit of the next byte.  The symptom can be seen as following picture. More detail explanation can be read in this link: http://www.advamation.com/knowhow/raspberrypi/rpi-i2c-bug.html In order to workaround this, I set data rate in I2C slave module higher.  The communication rate is 400 kbps, but I set the data rate 1000 kbps.  It worked for me.  Here is…

Raspberry Pi Setup Memo

Search engine helps, but I'm so lazy that I don't like to do the same search repeatedly. Wireless LAN setup: Use application "Wifi Configuration" from GUI menu. Common WIFI dongle problem of falling of network: Power management feature is enabled in default for device 8192cu.  Having following file resolves the issue: pi@raspberrypi ~ $ cat /etc/modprobe.d/8192cu.conf # prevent power down of wireless when idle options 8192cu rtw_power_mgnt=0 rtw_enusbss=0 See https://github.com/xbianonpi/xbian/issues/217 CAP/CTRL swap: See http://raspberrypi.stackexchange.com/questions/5333/how-to-map-caps-lock-key-to-something-useful Set static address to wifi interface: Edit /etc/network/interfaces.  If the setup for wlan looks like following, allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp modify as follows: allow-hotplug wlan0 iface wlan0 inet manual wpa-roam…

Noise Source Transistor — Conclusion

I have been working for a while to determine which transistor to use for noise source in noise generator.  I was using 2SC3311 which was obsoleted recently. I did several tests, mainly by listening, and chose BC547.  The reasons are: It has good taste as a noise source.  Easy to find sweet spots when using it with a filter and VCA. Noise level was close to 2SC3311, so my previous design works with simple replacement. Availability is good. Unlikely to get obsoleted soon. I started the test with listening "raw" noise without any modification and filtering.  However, it didn't work well.  Many of the candidates sounds similarly.  However, I found…

Reading Keypress with Python

This works for windows. http://stackoverflow.com/questions/12175964/python-method-for-reading-keypress However, you cannot use this feature from cygwin.  You need to invoke python script directly from Windows.  Double-clicking the python script works, but you need to catch exceptions in the case (otherwise, you don't know what happened when an exception was raised). Here is the sample program to read arrow keys. #!c:\Python32\python from msvcrt import getch import sys print("press ESC to exit") while True:     try:         key = ord(getch())         if key == 27: #ESC             break         elif key == 224: # special keys (arros, f keys, ins, del, etc.)             key = ord(getch())             if key == 75:                 print("left")             elif…

How to Play Sound with Python

This link helped http://stackoverflow.com/questions/307305/play-a-sound-with-python I'm working on Windows, so winsound worked.  It was as simple as #!/usr/bin/env python import winsound winsound.PlaySound("ex1.wav", winsound.SND_FILENAME)