electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
Live streaming at radio.electro-music.com

  host / artist show at your time
  Faux Pas Quartet and friends Music From Last Thursday
Please visit the chat
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
ElmGen DSP Tool for Spin FV-1
Post new topic   Reply to topic Moderators: State Machine
Page 2 of 2 [33 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: Previous 1, 2
Author Message
Digital Larry



Joined: Feb 19, 2013
Posts: 10
Location: Silicon Valley, CA

PostPosted: Sun Mar 03, 2013 9:45 am    Post subject: Reply with quote  Mark this post and the followings unread

OK after rummaging around a bit, I found the specific calls for all of the delay memory read/write functions that Andrew enhanced to accept an "offset" parameter in the ElmProgram class source code.

Now it's clear to me how these map to the beginning (default) and end (#) operators in SpinASM.

If I could contribute to greater clarity in the JavaDocs, what would I need to do? I'm willing to help here.

Also, another question comes to mind as I am going through this and porting existing reference SpinASM stuff into ElmGen. This is more of a Java question but if I could answer it, it would magnify the power of this setup greatly.

All existing source code is monolithic - your phaser + reverb program is just written as phaser code + reverb code inside the program's constructor.

I started pulling this apart a bit this morning, because for example, the phaser code is working OK but the reverb code is not. So I wanted to isolate the reverb code and perhaps work on that independently of the phaser code without having to resort to commenting out large sections of code.

This was easy enough at the beginning - I just made new methods within the program class, moved all the relevant code into those methods, and then called those in the proper order in the program's constructor.

So, for example, I now have some methods which look like this:

private void SumLeftRight(int register) { ...}

// this sums the left and right inputs and puts the result into register

private void Reverb(int input_reg, int output_reg) { ...}

// executes a reverb program, with the input signal in input reg, output in output_reg

private void Phaser(int input_reg, int output_reg) { ...}

// etc...

The idea being that one could (eventually) construct functional blocks which could then be linked together easily from the template code blocks. You could eventually imagine that you might wind up with an icon driven algorithm toolbox which would be able to construct effects programs from these smaller building blocks. This seems a valid way to leverage the OOP properties of ElmGen.

I'd like to be able to make a default ReverbBlock class which would include a memory allocation method and then a code generation method.

The base ReverbBlock class would do nothing, but one could create specific implementations of this that or the other reverb and then all you'd have to change would be the name of the reverb type being used, and the proper things would happen.

OK that's a great idea, but I am in fact asking for (Java) help because I'm not so sure how I would go about this within the existing framework of packages and classes. Any input or discussion welcome!

Thanks,

DL
Back to top
View user's profile Send private message
juancra_1982



Joined: Mar 22, 2013
Posts: 2
Location: Argentina

PostPosted: Fri Mar 22, 2013 8:56 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi there!

I tried to install this on an eclipse IDE and added the JAR to the build path, but I was unsuccesful in simulating anything. Does anyone have a good tutorial on how to run this amazing tool?
Back to top
View user's profile Send private message
Digital Larry



Joined: Feb 19, 2013
Posts: 10
Location: Silicon Valley, CA

PostPosted: Fri Mar 22, 2013 9:34 pm    Post subject: Reply with quote  Mark this post and the followings unread

It's expecting a 16 bit stereo wave file to be present in c:\temp, called test1.wav. If that file isn't there, it will simply crash.

When you do this, you are running the "SimTest.java" class which is contained in the JAR file. To start writing your own code, copy the SimTest.java file into your project and with that file visible, press the "run" button in Eclipse. It will take precedence over the SimTest.java in the JAR file.

Code:
/* ElmGen - DSP Development Tool
 * Copyright (C)2011 - Andrew Kilpatrick
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http>.
 *    
 */
package org.andrewkilpatrick.elmGen.test.simTest;

import java.io.IOException;

import org.andrewkilpatrick.elmGen.EEPromHandler;
import org.andrewkilpatrick.elmGen.simulator.SpinSimulator;


public class SimTest {
   String programmerPort = "COM5";  // serial port for the Arduino
   
   /**
    * Creates code for testing.
    */
   public SimTest(String args[]) {
      boolean flash = false;  // run the flash tool
      boolean simulate = true;  // run the simulator
      
      // generate the code
      Distortion distortion = new Distortion();
      Mute mute = new Mute();
      Bypass bypass = new Bypass();
      Reverb reverb = new Reverb();
      System.out.println("Code generation complete!");
      
      // build/write the EEPROM
      if(flash) {
         try {
            EEPromHandler eeprom = new EEPromHandler("COM5");
            eeprom.fillBank(distortion, 0);
            eeprom.fillBank(bypass, 1);
            eeprom.fillBank(reverb, 2);
            eeprom.fillBank(mute, 3);
            eeprom.fillBank(mute, 4);
            eeprom.fillBank(mute, 5);
            eeprom.fillBank(mute, 6);
            eeprom.fillBank(mute, 7);
//            eeprom.writeAllBanks();
            eeprom.writeBank(2);
         } catch (IOException e) {
            e.printStackTrace();
         }
      }
            
      // run the simulator
      if(simulate) {
         String testWav = "c:\\temp\\test1.wav";  // input test file name
//         String outputFile = "c:\\temp\\out.wav";  // write out to a file
         String outputFile = null;  // play out through the sound card
         SpinSimulator sim = new SpinSimulator([b]reverb[/b], testWav, outputFile, 0.5, 0.6, 0.25);
         sim.showInteractiveControls();  //
         sim.showLevelLogger();
         sim.setLoopMode(true);
         sim.run();
      }
      
      System.exit(0);
   }      
   
   public static void main(String args[]) {
       new SimTest(args);      
   }
}


Note where I've highlighted the "reverb" program. This is what the simulator will run. The bit above with all the eeprom code is creating a bank of 8 programs to load into eeprom. I have not tried this part yet.

Also note that Andrew Kilpatrick was correct when he said the chorus LFO simulation is not fully tested. The small reverb program included works OK (it has no LFOs in it), but I have ported over chorus, pitch shift, and more complex reverb programs and they sound a bit weird. When I get a moment I may try to investigate why that is happening.

I have built quite a bit on the foundation of ElmGen and have developed some other constructs which allow you to develop building blocks of FV-1 functionality and then connect them together using Java code. If you are interested I can put my stuff somewhere you can try to use it. This way you only have to develop the algorithm for a delay line once and then it's quite easy to re-use it. It's at a somewhat basic state currently but does work.

Right now I am approaching the problem from the other side and am developing a visual CAD program that will let you assemble FV-1 blocks into programs simply by dragging and dropping blocks and connectors. This could turn out to be incredibly powerful as people will be able to create FV-1 programs without ever writing a line of assembler or Java.

Keep the questions coming! I'm pretty familiar with ElmGen by now.
Back to top
View user's profile Send private message
Digital Larry



Joined: Feb 19, 2013
Posts: 10
Location: Silicon Valley, CA

PostPosted: Fri Mar 22, 2013 9:56 pm    Post subject: Step by step instructions for getting started with ElmGen. Reply with quote  Mark this post and the followings unread

#1 In Eclipse, create a new Java Project. Call it "Test" for example.

#2 Download the individual source files from the ElmGen site, namely SimTest.java, reverb.java, bypass.java. mute.java, and distortion.java.

#3 Now import those source files into your project. Save them in the "Test" folder. [Edit - you'll have to create a new package for them, or let Eclipse move them to the package defined in the source files].

#4 Now choose "Build Path" , select "External Archives", and then find the elmgen-0.5.jar file. It should now live down in "Referenced Libraries".

#5 Highlight and open "SimTest'java" and click on the run button. It should work!

#6 Heed Andrew's note about commenting out the eeprom statements unless you want to install the RxTx library. It's not that difficult but I've forgotten how I did it.

Last edited by Digital Larry on Mon Mar 25, 2013 6:17 am; edited 2 times in total
Back to top
View user's profile Send private message
juancra_1982



Joined: Mar 22, 2013
Posts: 2
Location: Argentina

PostPosted: Sat Mar 23, 2013 4:55 pm    Post subject: Reply with quote  Mark this post and the followings unread

You are the man !!!! I'll move to eclipse in Linux and test this ASAP. Regarding the visual CAD approach you mentioned, I work in QA, so I can provide proffesional testing for the app, if you want, what do you think?
Back to top
View user's profile Send private message
Digital Larry



Joined: Feb 19, 2013
Posts: 10
Location: Silicon Valley, CA

PostPosted: Mon Mar 25, 2013 5:58 am    Post subject: Reply with quote  Mark this post and the followings unread

Hahaha, well right at the moment the QA task is immense! But sure, it would be great to have a partner in crime. Give me a few weeks. Made a fair amount of progress this weekend.
Back to top
View user's profile Send private message
Digital Larry



Joined: Feb 19, 2013
Posts: 10
Location: Silicon Valley, CA

PostPosted: Tue Apr 16, 2013 3:24 pm    Post subject:
Subject description: SpinCAD Designer based on ElmGen
Reply with quote  Mark this post and the followings unread

Wow, I've been working pretty hard in my spare time for the last 2 months because I've gone from simply getting ElmGen working on Feb 19th to actually having a visual CAD program for the FV-1 almost ready for beta. This uses ElmGen behind the scenes for code generation and I must attest to the quality of ElmGen going in - I've only made two changes so far and they were primarily to get Andrew's code working within the context of a larger program.

I've put up a couple examples over at the Spin forum:

http://www.spinsemi.com/forum/topic-378.html

Nobody's responded to my cattle call for beta testers yet! I'm just looking for 6 people. Please reply via PM though either this board or the Spin Forum. I hope to have the beta ready for limited testing on May 6th 2013.

Thanks!

Digital Larry
Back to top
View user's profile Send private message
ubiubu



Joined: Sep 13, 2014
Posts: 1
Location: berlin

PostPosted: Sat Sep 13, 2014 4:35 am    Post subject: Reply with quote  Mark this post and the followings unread

hi

has anyone used this recently?

specifically, the atmega/eeprom programmer? i've been trying to get a test program onto the eeprom, but to no avail. i've been trying on osx and linux, it compiles fine either way but when the programmer is busy all i get is "no response received from device", and it doesn't look as if elm gen is actually sending serial.

i can easily write to the eeprom from the arduino IDE, so the hardware is ok in principle. i suspect i haven't set up the java serial thing properly. any hints on what i might be doing wrong?

thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: State Machine
Page 2 of 2 [33 Posts]
View unread posts
View new posts in the last week
Goto page: Previous 1, 2
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use