Skip to content

REQUEST: audio chip support Yamaha YM3812 and Commodore 6581 #1410

Closed

Description

@pappavis

I'd like to modify the Piezzo Buzzer so as to use a MOS technology 6581 "SID"-chip or Yamaha YM3812 OPL2 sound support.

The piezzo.js already has the basic blocks, however one need to communicate with the sound chip. For example, the sonar sensor communication.

I suppose a "lib/6581sid.js" would do the trick, however, how to get the arduino .cpp-library translated to johnny-five? Any ideas?

Regards,
Michiel Erasmus / Easylab4kids

Activity

  1. rwaldron commented on Nov 20, 2017

    @rwaldron
    Owner

    @pappavis The code in piezo.js is not capable of producing actual tones, due to timing sensitive constraints and limitations of JavaScript itself. For new, more specific functionality I recommend first creating a plugin to prove out the idea; for example: https://github.com/rwaldron/j5-button-gestures or https://github.com/rwaldron/j5-ds-touch

  2. pappavis commented on Nov 20, 2017

    @pappavis
    Author

    Thanks! I'd hope to get SIDuino working in Johnny-five.
    https://playground.arduino.cc/Main/SIDuinoI2c

    and the library to "port" --> https://github.com/cybernesto/sid-arduino-lib

  3. pappavis commented on Nov 22, 2017

    @pappavis
    Author

    @rwaldron
    I am clueless reading the ds_touch_slave digitalinput/outputs in javascript .

    What i wanna do is mimic Pizzo functionality such as Play() so can interchange piezo for OPL2 without code rewrite.

       var objPiezo_1;  //piezo object
    
       objPiezo_1_playing = true;
       objPiezo_1.play({
         song: "E - D - C - D - - E E E D D D - E - G ",
         beats: 4 / 4,
         tempo: 250});
      objPiezo_1_playing = false
    

    I wanna play for example this --> https://github.com/DhrBaksteen/ArduinoOPL2/blob/master/examples/SimpleTone/SimpleTone.ino
    [which isnt as straihtforward as your Pizzo play function]
    In above example 2x libraries are included.

    Furthermore.

    • Wheres the link from readY() in ds_touch_slave.ino to where it can be used in javascript plugin code? is it sent to a I2C adress?
    • What must be done to translate C++ opl2.setTremolo() --> plugin, so it becomes javascript?

    How I think tot do it;

    • Use your PingFirmata.ino and add #include OPL2.h and SPI.h to it.
    • Let it make a simple bell-sound.

    TIPS needed here;

    • Make plugin. Sumhow get javascript setTremolo so it can be received by Firmata. HOW?
  4. dtex commented on Jan 1, 2018

    @dtex
    Collaborator

    @pappavis

    Sumhow get javascript setTremolo so it can be received by Firmata. HOW?

    For the OPL2 you will need SPI which has been proposed but is not yet supported by firmata. Contributing to that proposal would be the first step for that device.

    You've referenced two different approaches to SID. There's the sid-arduino-lib which is an emulator that uses nothing but an Arduino and the SIDuino i2c SID-emulator shield which is an I2C device that works with an Arduino.

    If you want to use the sid-arduino-lib you might consider creating an I2C Component Backpack for Johnny-Five.

    The SIDuino shield might be the easiest JS solution to implement as you can completely craft the i2c messages in node and push them over via the existing i2c write methods in firmata. The only thing I'm worried about is how many i2c messages you might need to send in short order. They can get jammed up. The code you would need to port is in siduino_midi_i2c.pde which can be found in a zip file on this page.

    As for how to make it fit in the Johnny-Five class schema, a plug-in is the way to test the idea out and I don't think it's something that could ever fit under piezo as these devices can do so much more.

  5. dtex commented on Jan 11, 2018

    @dtex
    Collaborator

    Hi @pappavis

    Johnny-Five contributors and maintainers are loathe to close issues where someone has a need. We don't want anyone to ever feel that we don't care, but we just don't know when someone will have the time to add this (admittedly very cool) new functionality. Rather than leave it languishing as an open issue we have created a Requested Features page and added a new class request for "Sound Generator/Synthesizer" there.

  6. pappavis commented on Jan 21, 2018

    @pappavis
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions