Jump to content

mess

Programmer
  • Posts

    141
  • Joined

  • Last visited

Everything posted by mess

  1. Is the refreshrate of the max525 high enough for video? the versions I've seen use a discrete R-2R resistor ladder...
  2. If I understand correctly TK's solution delays the stream by sending sysex messages inbetween that aren't supported by most synths so the actual time between two sysex messages is increased... Yet another suggestion: have you tried adjusting the deadband setting? MIOS_AIN_DeadbandSet C_DECLARATION void MIOS_AIN_DeadbandSet(unsigned char deadband) DESCRIPTION sets the difference between last and current pot value which has to be achieved to trigger the "NotifyChange" function C_IN deadband value in <deadband> C_OUT larger values should generate less sysex messages... Michael
  3. Small update on the example code: I forgot to initialise the DIN/DOUT chain so nothing happened at all... you can find the working code here: http://webs.hogent.be/~032573mh/lcd_standby.zip the display switches of after 10 seconds so next problem: switching the backlight I'm going to use a MOSFET to controll the backlight according to the datasheet my backlight draws 240mA now I need to find the right mosfet for this job... would a BS170 do the job?
  4. Damn, I couldn't test this on my own hardware I will post the working code tomorrow after testing the code this time ::) the idle time is configured for 5seconds (see main.h) thanks for testing the code...
  5. I've made a simple example, you can find it here http://webs.hogent.be/~032573mh/lcd_standby.zip comments/suggestions are appreciated... Michaël *edit: if forgot to initialise the SRIO chain, this version actually works :)
  6. Interesting thread, I've been thinking about some battery-powered MIOS_applications and turning off the display seems a step in the right direction I'm also thinking of using a mosfet to turn backlight on/off since this consumes a lot of power ...back to the subject: *implementing the switch off if idle seems feasible: -implement an idle flag in app_flags -clear the flag in DIN_NotifyToggle, AIN_NotifyChange and ENC_NotifyChange (something has changed, not idle) -implement 16bit (int) counter in SR_Service_Finish, wich by default is called every mS clear the counter the counter if idle flag is 0, set flag again, turn on display if display was off if flag is set and the counter reached it's max value, turn off display, reset counter the max counter value depends on the idle time before turning off the display, for idle time of 5 seconds: MAX_COUNTER_VAL = 5*1000 = 5000 it's harder to describe this than to put into code, I will try to make a template application I think that the overhead for the counter will be OK, I can't test this right now though... * to turn on/off the display: -turn display on with cursorline: MIOS_LCD_Cmd(0x0E); -turn display on without cursorline: MIOS_LCD_Cmd(0x0C); -turn display off: MIOS_LCD_Cmd(0x08); Michaël
  7. Hi Ixox, good job on the cs :) I'm going to build this version as it seems to fit quite well with my micromodular (form factor) do you have a diagram with the measurements included? I want to make a shaeffer layout for your frontpanel... Michaël
  8. That's strange, maybe you could mail me your code it's not easy to find errors with some small code snippets
  9. I'm sure that I are all those variables unsigned chars? maybe you could you try this: unsigned char stored_pin[13]; stored_pin[0] = pedal_group_stored_pin; stored_pin[1] = tremelo_strength_button_state; stored_pin[2] = swell_princ_group_stored_pin; stored_pin[3] = swell_mixt_group_stored_pin; stored_pin[4] = swell_reed_group_stored_pin; stored_pin[5] = great_princ_group_stored_pin; stored_pin[6] = great_mixt_group_stored_pin; stored_pin[7] = great_reed_group_stored_pin; stored_pin[8] = pedal_couplers_group_stored_pin; stored_pin[9] = sub_oct_coupler_button_state; stored_pin[10] = swell_tremelo_select_button_state; stored_pin[11] = great_swell_coupler_button_state; stored_pin[12] = great_tremelo_select_button_state;
  10. You're trying to pass a array pointer to a function who expects a unsigned char when you put the 13 between the brackets the value of the 13th element in the array is written the code below makes sure that all array elements are written to the eeprom starting from start_addr (I've removed finish_addr since this addres is determined by the array size) about the outside of array bound warning: you've declared an array with 13 elements and because in C you allways count from 0 the last element in you array has index 12
  11. Ok great news :-) could you tell me how you simulated your bitbanging routine to determinate the required delay cycles? is it possible to simulate mixed C/ASM in MLAB?
  12. Hello, my opl board is almost ready, I just need a oscillator module to get some sound since I got all the other parts the minimumorder of reicheld (150 EUR) is too much... is there anybody who has a spare module (or knows some other place to order them)? Michaël
  13. Hello, I need a additional serial (rs232) out for my midibox project would it be possible to use a J5 pin for this like the midi outs of clockbox v1.1? specifications: 4800baud start and stop bit, no parity Michaël
  14. Wow very nice project :-) your panel looks really great, especially with those square leds I can give you C code for the note seq part (I have implemented this yesterday for my own project) if it's useful for you... Michaël
  15. Ik heb het daarjuist gezien met mijn bestelling in te geven... momenteel kom ik aan 20euro maar ik zal maandag op school eens vragen of er nog iemand componenten nodig heeft
  16. Heeft er iemand al onderdelen bij Reicheld besteld vanuit België/Nederland? Is er een minimumorder en hoeveel bedragen de vaste kosten? Mijn OPL-module is klaar op de oscillatormodule na :( Michaël
  17. Your version seems a lot more elegant then mine so I have removed my version, thx for sending your app, I'm going to try this one as soon as possible.. Michaël
  18. I've made a first attempt to integrate aout_lc this version supports only one aout_lc module in 12 bit mode but it shouldn't be to difficult to add more channels or to use the module in 2x8 mode... I don't have acces to my hardware so the code I can't test the code.. *edit: I have removed the link to my code because moxi's version was better then my own solution
  19. I think such a fader would be a great feature ;D really nice idea :)
  20. Hi Andrew, I was hoping that you were still working on this :-) are you going to code this in C or asm? what kind of algo are you going to use for the waveform synthesis? if you need any help, just tell me :D
  21. I will have to resolder my connections with the matrix when the case is finished, so that seems like a good moment to do so :) I couldn't help trying to code the function in ASM (based on the original off coarse) it seems to work fine... unsigned char step; unsigned char DSEQ_HLP_GetStepORMask(unsigned char step_pos) __wparam { step = step_pos; __asm; btfsc _step, 2 bra DSEQ_HLP_GetStepORMask_4567 DSEQ_HLP_GetStepORMask_0123: btfsc _step, 1 bra DSEQ_HLP_GetStepORMask_23 DSEQ_HLP_GetStepORMask_01: btfss _step, 0 retlw b'10000000' retlw b'01000000' DSEQ_HLP_GetStepORMask_23: btfss _step, 0 retlw b'00100000' retlw b'00010000' DSEQ_HLP_GetStepORMask_4567: btfsc _step, 1 bra DSEQ_HLP_GetStepORMask_67 DSEQ_HLP_GetStepORMask_45: btfss _step, 0 retlw b'00001000' retlw b'00000100' DSEQ_HLP_GetStepORMask_67: btfss _step, 0 retlw b'00000010' retlw b'00000001' __endasm; }
  22. Hi Thorsten, thank you for the fast response the reason why I organised the bits this way is to make the displaying of the steps easier (and hopefully faster): cs handler snippet: switch (cs_layer) { case CS_LAYER_NRM: //display steps, green leds = norm vel green+red leds = accent ledmatrix[0] = buffer[DSEQ_TRIG_OFFSET + trk_offset + 0]; ledmatrix[1] = buffer[DSEQ_TRIG_OFFSET + trk_offset + 1]; ledmatrix[2] = buffer[DSEQ_TRIG_OFFSET + trk_offset + 2]; ledmatrix[3] = buffer[DSEQ_TRIG_OFFSET + trk_offset + 3]; ledmatrix[4] = buffer[DSEQ_ACC_OFFSET + trk_offset + 0]; ledmatrix[5] = buffer[DSEQ_ACC_OFFSET + trk_offset + 1]; ledmatrix[6] = buffer[DSEQ_ACC_OFFSET + trk_offset + 2]; ledmatrix[7] = buffer[DSEQ_ACC_OFFSET + trk_offset + 3]; break; so it seems that I have two options: * reverse the matrix wiring so that the first step led is the LSB and use the MIOS bitmasks * use a ASM function with a reversed table so that DSEQ_GetStepORMask(0) selects the MSB instead of MIOS_HLP_GetBitORMask(pos[trk]&0x07); I'm going to try the second one first because I don't have to change any hardware for that...
  23. Can somebody help me optimising this function in assembler? I don't have enough experience with ASM to do this myself right now C code: void DSEQ_PlayStep(unsigned char trk) { unsigned char mask_current_step, step_byte_pos, mask_current_trk; // set trk bit mask to track mask_current_trk = 0x80 >> trk; // calculate step bit (current pos modulo 8) mask_current_step = MIOS_HLP_GetBitORMask(0x07 - (pos[trk]&0x07)); // calculate step byte (current pos /8 + tracknr * 4) step_byte_pos = (pos[trk] >> 3) + (trk << 2); //handle note off from previous step if (trk_last_trig&mask_current_trk) { //set last trig to false trk_last_trig &= (~mask_current_trk); //send midi note (midi channel one is hardcoded) MIOS_MIDI_TxBufferPut(0x90); MIOS_MIDI_TxBufferPut(buffer[DSEQ_NOTENR_OFFSET+trk]); MIOS_MIDI_TxBufferPut(0x00); } //handle note on from current step if ((buffer[step_byte_pos]&mask_current_step) &&(mute_trk&mask_current_trk)) { //set last trig to true trk_last_trig |= mask_current_trk; // Note Event at channel #1 note nr in trk_note_nr[trk] MIOS_MIDI_TxBufferPut(0x90); MIOS_MIDI_TxBufferPut(buffer[DSEQ_NOTENR_OFFSET+trk]); if (buffer[step_byte_pos+DSEQ_ACC_OFFSET]&mask_current_step) { MIOS_MIDI_TxBufferPut(buffer[DSEQ_ACCVEL_OFFSET]); } else { MIOS_MIDI_TxBufferPut(buffer[DSEQ_NRMVEL_OFFSET]); } } } sdcc assembler output: ; ; Starting pCode block S_dseq__DSEQ_PlayStep code _DSEQ_PlayStep: ; .line 99; dseq.c void DSEQ_PlayStep(unsigned char trk) MOVFF FSR2L, POSTDEC1 MOVFF FSR1L, FSR2L MOVFF r0x00, POSTDEC1 MOVFF r0x01, POSTDEC1 MOVFF r0x02, POSTDEC1 MOVFF r0x03, POSTDEC1 MOVFF r0x04, POSTDEC1 MOVFF r0x05, POSTDEC1 MOVFF r0x06, POSTDEC1 MOVFF r0x07, POSTDEC1 MOVFF r0x08, POSTDEC1 MOVLW 0x02 MOVFF PLUSW2, r0x00 ; .line 103; dseq.c mask_current_trk = 0x80 >> trk; MOVLW 0x80 MOVWF r0x01 MOVF r0x00, W BZ _00135_DS_ NEGF WREG BCF STATUS, 0 _00136_DS_: RRCF r0x01, F ADDLW 0x01 BNC _00136_DS_ _00135_DS_: ; .line 105; dseq.c mask_current_step = MIOS_HLP_GetBitORMask(0x07 - (pos[trk]&0x07)); MOVLW LOW(_pos) ADDWF r0x00, W MOVWF r0x02 CLRF r0x03 MOVLW HIGH(_pos) ADDWFC r0x03, F MOVFF r0x02, FSR0L MOVFF r0x03, FSR0H MOVFF INDF0, r0x02 MOVLW 0x07 ANDWF r0x02, F MOVF r0x02, W SUBLW 0x07 MOVWF r0x02 MOVF r0x02, W CALL _MIOS_HLP_GetBitORMask MOVWF r0x02 ; .line 107; dseq.c step_byte_pos = (pos[trk] >> 3) + (trk << 2); MOVLW LOW(_pos) ADDWF r0x00, W MOVWF r0x04 CLRF r0x05 MOVLW HIGH(_pos) ADDWFC r0x05, F MOVFF r0x04, FSR0L MOVFF r0x05, FSR0H MOVFF INDF0, r0x04 SWAPF r0x04, W MOVWF r0x04 RLNCF r0x04, W ANDLW 0x1f MOVWF r0x04 RLCF r0x00, W ANDLW 0x7e MOVWF r0x06 ADDWF r0x06, F MOVF r0x06, W ADDWF r0x04, F ; .line 110; dseq.c if (trk_last_trig&mask_current_trk) { MOVF r0x01, W BANKSEL _trk_last_trig ANDWF _trk_last_trig, W, B MOVWF r0x06 MOVF r0x06, W BZ _00122_DS_ ; .line 112; dseq.c trk_last_trig &= (~mask_current_trk); COMF r0x01, W MOVWF r0x06 MOVF r0x06, W ; removed redundant BANKSEL ANDWF _trk_last_trig, F, B ; .line 114; dseq.c MIOS_MIDI_TxBufferPut(0x90); MOVLW 0x90 CALL _MIOS_MIDI_TxBufferPut ; .line 115; dseq.c MIOS_MIDI_TxBufferPut(buffer[DSEQ_NOTENR_OFFSET+trk]); MOVLW 0x60 ADDWF r0x00, W MOVWF r0x06 MOVLW LOW(_buffer) ADDWF r0x06, F MOVLW HIGH(_buffer) CLRF r0x07 ADDWFC r0x07, F MOVFF r0x06, FSR0L MOVFF r0x07, FSR0H MOVFF INDF0, r0x06 MOVF r0x06, W CALL _MIOS_MIDI_TxBufferPut ; .line 116; dseq.c MIOS_MIDI_TxBufferPut(0x00); MOVLW 0x00 CALL _MIOS_MIDI_TxBufferPut _00122_DS_: ; .line 119; dseq.c if ((buffer[step_byte_pos]&mask_current_step) MOVLW LOW(_buffer) ADDWF r0x04, W MOVWF r0x06 CLRF r0x08 MOVLW HIGH(_buffer) ADDWFC r0x08, F MOVFF r0x06, FSR0L MOVFF r0x08, FSR0H MOVFF INDF0, r0x06 MOVF r0x02, W ANDWF r0x06, F MOVF r0x06, W BZ _00129_DS_ ; .line 120; dseq.c &&(mute_trk&mask_current_trk)) { MOVF r0x01, W BANKSEL _mute_trk ANDWF _mute_trk, W, B MOVWF r0x06 MOVF r0x06, W BZ _00129_DS_ ; .line 123; dseq.c trk_last_trig |= mask_current_trk; MOVF r0x01, W BANKSEL _trk_last_trig IORWF _trk_last_trig, F, B ; .line 125; dseq.c MIOS_MIDI_TxBufferPut(0x90); MOVLW 0x90 CALL _MIOS_MIDI_TxBufferPut ; .line 126; dseq.c MIOS_MIDI_TxBufferPut(buffer[DSEQ_NOTENR_OFFSET+trk]); MOVLW 0x60 ADDWF r0x00, F MOVLW LOW(_buffer) ADDWF r0x00, F MOVLW HIGH(_buffer) CLRF r0x01 ADDWFC r0x01, F MOVFF r0x00, FSR0L MOVFF r0x01, FSR0H MOVFF INDF0, r0x00 MOVF r0x00, W CALL _MIOS_MIDI_TxBufferPut ; .line 127; dseq.c if (buffer[step_byte_pos+DSEQ_ACC_OFFSET]&mask_current_step) { MOVLW 0x20 ADDWF r0x04, F MOVLW LOW(_buffer) ADDWF r0x04, F MOVLW HIGH(_buffer) CLRF r0x00 ADDWFC r0x00, F MOVFF r0x04, FSR0L MOVFF r0x00, FSR0H MOVFF INDF0, r0x04 MOVF r0x04, W ANDWF r0x02, F MOVF r0x02, W BZ _00124_DS_ BANKSEL (_buffer + 122) ; .line 128; dseq.c MIOS_MIDI_TxBufferPut(buffer[DSEQ_ACCVEL_OFFSET]); MOVF (_buffer + 122), W, B CALL _MIOS_MIDI_TxBufferPut BRA _00129_DS_ _00124_DS_: BANKSEL (_buffer + 121) ; .line 130; dseq.c MIOS_MIDI_TxBufferPut(buffer[DSEQ_NRMVEL_OFFSET]); MOVF (_buffer + 121), W, B CALL _MIOS_MIDI_TxBufferPut _00129_DS_: MOVFF PREINC1, r0x08 MOVFF PREINC1, r0x07 MOVFF PREINC1, r0x06 MOVFF PREINC1, r0x05 MOVFF PREINC1, r0x04 MOVFF PREINC1, r0x03 MOVFF PREINC1, r0x02 MOVFF PREINC1, r0x01 MOVFF PREINC1, r0x00 MOVFF PREINC1, FSR2L RETURN Thank you, Michaël
  24. does this script only apply to MIOS? I tried it on a .inc from the mb_fm package with no succes... I agree with audiocommander about the concepts being more important maybe a lot of C examples made by the MB community (with the help of Thorsten) could fill this void?
×
×
  • Create New...