Ref to my New Project thread in Design Concepts

I have had a thread over in the Design Concepts area regarding the following:

I have an old Paia keyboard I wanted to interface to midibox. (switch contacts only). I wanted this to drive a dual midibox project I have already built (MoogModular MidiBox).  And I wanted to be able to use the keyboard for other midi instruments (softsynths, midi enabled DIY modular analog gear).

the above was accomplished yesterday!!!

Next, I want to hook an AOUT board to this setup and be able to control analog gear directly. (non midified modular analog gear).

My question/dilema is…  how do I include the code for MidiBoxCV into my Midibox64 system?  Do i recompile MIOS with MidiBoxCV included?.. OR…

since I am only using 2 cores now… do I add MidiBoxCV to a third core and use MidiLink? (presumably this would be the easiest, but I would like to utilize the spare functions from my exsisting cores)

Comments? Clarifications?

Thanx in advance and have a Happy New Year !!!

gb

Hi,

when you take a look into the app_defines.inc files, you will notice that both applications (MIDIbox64 and MIDIbox CV) allocate so much memory that they cannot be combined to a single application. So, it won’t be so easy to merge the projects without some programming knowledge.

On the other hand: if you don’t need all the features of MIDIbox64, but only the possibility to send static (predefined and not changeable) MIDI events with 64 pots and up to 128 buttons, you could add this to the MIDIbox CV application without much effort. It would only require a small number of code lines (initialize the MIOS drivers and send the events from the AIN/DIN hooks)

Best Regards, Thorsten.

Thanx for the reply TK!

Not sure i want to reinvent the wheel with this project… so i think i will go for the 3 core option…   :slight_smile:

BTW… great job with the AOUT board! it tracks my PAIA Midi2CV8 perfectly…

now on another note. How about some code that makes MidiCV volt/hz?  I have a bunch of exponential gear I would like to control along with linear stuff.  

I have looked through the code.. but am not an ASM person, trying to locate the conversion values.  should / can this be done programatically? or can the exponential response be obtained by changing Rx/Ry/Rp values?

thanx in advance and have a GREAT DAY!!!

gb

hello gbeth,

don’t know about an assembler solution but maybe

you can try an hardware v/oct->v/hz

like the one on magnus danielson’ site:

http://home.swipnet.se/cfmd/synths/schematics/

bye,

Michaël

Yeah, i had that schematic… somewhere on my hard drive, and had been looking for it. Forgot it was Magnus’s. Thanx for the reminder/location link.

gb

Howdy!!

  Back again with more about this project.

  After looking at using an expo/lin converter (and the associated costs !!), I have decided to do this with hardware on hand.

  I have a functional D/A converter based on the PAIA V/Hz design in their midiCV8 and Fatman.  It uses 4 bits for top octave note voltages, and 2 bits (soon to be at least 3 bit for 5 octave range) for octave range.  I have built a circuit based on pic 16f877 that takes a midi in and turns note data from the keyboard into these 6 bits of data to drive the d/a converter.  this all works… albeit  too slowly for my liking.

  Could I not simply use a MIOS/dout combination to do the same thing?  seems logical to me… but i have not found where i would edit  a file to be able to perform the translation from midi/mios/dout module.  i am presuming this is possible?

as always, any help or suggestions are greatly appreciated. :slight_smile:

gb

It’s a piece of cake with cmios :slight_smile:

/////////////////////////////////////////////////////////////////////////////
//  This function is called by MIOS when a complete MIDI event has been received
/////////////////////////////////////////////////////////////////////////////
void MPROC_NotifyReceivedEvnt(unsigned char evnt0, unsigned char evnt1, unsigned char evnt2)
{
  // convert note off messages to note on with velocity 0
  if( (evnt0 & 0xf0) == 0x80 )
      evnt0 = 0x90 | (evnt0 & 0x0f);

  // react on notes at channel 1
  if( evnt0 == 0x90 )
  {
      // forward the 7-bit value to the first DOUT shift register
      MIOS_DOUT_SRSet(0, evnt1);
  }
}
[/code]









Best Regards, Thorsten.

Thanx TK !!!

  I thought it should be possible… just didn’t know where to look… I will get started with this immediatly!!!

thank you, thank you, thank you  ;D

gb

AAARRRRGGGGG !!!

  wouldn’t you know it…  it’s sunday… parts stores not open.. and i don’t have a 74595 !!! >:(

  oh well, i can burn the pcb for it today… and get one tomorrow.

  have a GREAT WEEKEND Guys !!!

gb

thought i would get started on the programming of this and realized…

MIOS does not know what value I need to feed into the D/A converter.

my D/A does not provide a sequential map.  it’s not 1:1 from note event value to D/A input value.

i need to use 4 bits for  top octave note pickoff and 2 bits for octave select pickoff.

do I need an .ini file to load into MIOS once it’s running to tell it how to map midi note event values to a ‘byte’ coming out of the dout circuit?  if so.. guess I need to see which commands would be for a dout used the way i am doing here.

any examples appreciated !!!

gb

y’know… after looking at the website again… it looks like the J5_dout thing might be exactly what I’m looking for.

just need to set the midi input event triggers to J5 data out to my D/A  in the MIOS_TABLES.inc file… now if i could just get some input on how that happens.  i see the input stuff, but not where it gets mapped to output stuff.

thanx in advance…

gb

later that same day… :slight_smile:

ok, i have j5_dout application running… swapped J5_Dout_pinset  to j5_dout_set (to get parallel data, and this works…)

however… my D/A converter does not correspond 1:1 with key numbers.  i need to be able to tell the program that

MT_ENTRY 0x90, 0x24  should output  0000 0000 (the data I need to drive my D/A for C0 on analog gear)

and that

MT_ENTRY 0x90, 0x30 (one octave up) should output 0000 0001 (the number i need to drive the D/A for C1)

i need the upper 4 bits  to control the note of the top octave, thus I only need the number 12 to get all 12 tones…

0000 0000 - C0

0001 0000 - C#0

0010 0000 - D0

0011 0000 - D#0

1011 0000 - B0

then back to

0000 0001 for C1

the lower 4 bits control the octave

0000 0000  C0 

0000 0001  C1

0000 0010  C2

0000 0011  C3

hope i am explaining how this works clearly…and that there is a way to get MIOS to do this for me…

gb

Simple and fastest solution without much programming effort: Just map the note values to new values by using a table with 128 entries:

TABLE_ADDR MY_TABLE
movf	MIOS_PARAMETER1, W	; (contains the note value)
TABLE_ADD_W ; add to table pointer
tblrd*+ ; read byte from table
movf	TABLAT, W ; result in TABLAT

;; now you can do what you want with the new value



;; should be located at the end of the assembler program
MY_TABLE
db	0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
;; ... 128 bytes (=16 lines) in total
db	0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f
[/code]









Best Regards, Thorsten.

Thanx again, TK!!!

that looks like what I need.  just need to sit down with the bin/hex calculator and come up with my table values!

y’know… in a year or two I might just get the hang of this  :slight_smile:

Woo Hoo!!!

gb

i am so dense!!

one last question… where do i stick this code… which file i mean… main.asm,  j5_dout.inc?

again, thanx for all the help !

gb

TK !

i’m dying here… just can not get my head around it…

to quote Jerry Ciarcia… (byte, circuit cellar)

my favorite programming language… is a soldering iron.

ok, I am back to midiboxing after a month of realworld work…

i am attempting to integrate the code below…which TK gave me last month:

Code:

TABLE_ADDR MY_TABLE

movf MIOS_PARAMETER1, W ; (contains the note value)

TABLE_ADD_W ; add to table pointer

tblrd*+ ; read byte from table

movf TABLAT, W ; result in TABLAT

;; now you can do what you want with the new value

;; should be located at the end of the assembler program

MY_TABLE

db 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07

;; … 128 bytes (=16 lines) in total

db 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f

my problem is… i have no idea where to stick this code and table…

i was thinking since i’m using j5_dout… that the  code bit would go in j5_dout.inc  and get executed when there is

the call to J5_DOUT_Set… but not being sure where it would go in order to intercept the value in W…(midi note event, i think)

and then look at the table to translate to the correct output on j5 to drive my expo-D/A converter.

if anybody can answer the following, i would greatly appreciate it:

  1. where does the code go? (which file, and where in the file)

  2. where does the table data go? (which file, and where in the file)

  3. Don’t I need to change something in J5_dout.inc to tell it to call this lookup table conversion?

i have placed the code in various files and locations within the files.  likewise with the data lookup table.. which

i have modified for my particular data needs, and then rebuilt all.  the new main.syx file does not crash mios.  just depending

on where i put the code/data the output is not correct.. sometimes it continues to work in the normal J5_DOUT config..

sometimes the leds don’t light.

any ideas?

thanks in advance !

gb

Hi gb,

  1. in main.asm

  2. in main.asm (outside a subroutine)

  3. forwarding the value in WREG to J5_DOUT_Set is ok

Did you call “J5_DOUT_Init” in the USER_Init hook? This is important to initialize the digital outputs

Best Regards, Thorsten.

Thanks TK !

I will play with this tonight ! 

gb