Jump to content

audiocommander

Frequent Writer
  • Posts

    1,358
  • Joined

  • Last visited

Everything posted by audiocommander

  1. I linearized the measured result in my host application with a log calculation. It decreased the resolution by a (for me) unacceptible amount. I have no problem with the default behavior: the nearer you get to the sensor, the higher the resolution; in a way this behavior seems quite natural to me. Well, that depends on the type of sensor. Maybe I wasn't clear enough: If you have any other AIN-devices connected besides the GP-Distance Sensor and "normal" 10k-Pots, you should check if their wiring is ok; I talked about correct use of pull-up/pull-down resistors, but that really depends on if and what else you have connected to the AIN module; normally you need pull-up/-down resistors if using resistor-based sensors, eg. pressure- or position-sensors. This was meant just as an hint, that maybe something else than the GPs could be the reason for extraordinary unpredictable signals. Via AIN module. But I think it makes no big difference besides some code-adjustments. Again: I'm using two GPs very successfully with the above mentioned C-Code. No Jittering. I really suggest you take a look at the code. It simply reduces the number of readings without affecting the overall resolution and interpolates the min/max values to 0..127. It also provides a gate for filtering out too low signals.
  2. Well, regarding the date of posting, the missing answers and despite that my name is not Thorsten: Maybe I am not the only one who has no clue what you want to know and what your program does? Do you want to control LED's, send and/or receive SYSEX-Messages or get read/write access to the EEPROMS? I have to admit that I'm also quite helpless with the code you posted? What's it for? What should it do? What's it doing not? Generally it's no good idea to pack everything in one function. Split your needs into different pieces, so if there are any errors you might be able to find them! Maybe you could become a bit more precise, then it's more likely someone might answer your question...
  3. Hi, just wanted to drop in a few comments: I'm using two GPs with absolutely no problems. I'm using a pure software based filter/amount reducer/gate/scaler combination also posted in the thread goule mentioned without reducing the overall resolution: http://www.midibox.org/forum/index.php?topic=5270.15 I have to mention, that there's a lot more jittering if there's any other sensor not properly connected; so if you have more than the GPs connected, I'd check also the other AINs. In my case I had some linear soft pots and I've went through signal hell before I realized I have to add another tiny resitor here and there... if there's something wrong on line #2, it might easily disturb lines #1 and #3 (my experice, don't know why...) I cannot recommend linearizing: it really reduces the resolution of the sensor dramatically. While on the other hand, I can really live with the response time... Waving your hands in the air isn't that precise anyway, for weeping some sounds away it's perfect! :) regards, Michael
  4. Hi Sleepwalker, It's not so difficult at all. You can download a C-based ready-to-start Project. If you have some experience in any programming whatsoever, you might learn some C basics in one or two days. The ability to store (and fire) PRG-CH isn't a very complicated thing to implement in code. Yes and no. The easiest would be to (internally) connect the MIDI-OUT of the bcr to the MIDI-IN of your DIY-MB. Easy solution, isn't it? A "melting" of the two devices into one is not possible, except you only use the Interface Elements. But I'd really check if buying pots and faders as parts isn't the preferable solution instead of ripping apart a functioning Midi Controller Device... 10k pots are not so expensive! Regards, Michael
  5. heya, have you seen these links on cynthia's page? http://www.cyndustries.com/woman.cfm :o edit: the top pic is a random pic, do some refreshes ;)
  6. Sounds like you're searching for this one: http://www.ucapps.de/mios_download.html --> http://www.ucapps.de/mios/clockbox_v1_0.zip "Outputs MIDI clock and 24ppqn signal (see also this forum article: http://www.midibox.org/forum/index.php?topic=5691.0 )" Should be easy to hook a LCD and crunch some numbers :) Regards, Michael
  7. zweifarbige LEDs gibts bei Reichelt, schöne Taster hätt' ich selber gerne :) es gab hier im Forum mal eine 'Midibox-of-the-Week', da hat sich jemand mit Silkon selbst beleuchtete Taster gebaut, die haben ganz schneckig ausgesehen... 120h (= 5 Tage) klingen aber ganz schön knapp für das was du vorhast ;) mit oder ohne Schlaf? ;D
  8. yipee ;D
  9. Ich habe den Sensor MPXV510 (Datenblatt s. weiter oben) mal getestet: Mit einem Strohhalm draufgepustet bekomme ich eigentlich sehr brauchbare 0.3 V bis ungefähr 3 V; demnach scheint mir der MPX in jedem Fall die bessere Wahl als der 12V SDX zu sein... Die Interpolation auf 0 V - 5 V am AIN hatten wir schon mal hier: http://www.midibox.org/forum/index.php?topic=5270.msg36622#msg36622 Grüße, Michael
  10. I see! ...this is tricky :o Thanks for the explanation, Thorsten! (Now I can put back my soldering iron and spare some pins for my 4 LED-levelMeters... ;D) @Goule: I wouldn't be astonished at all if our MidiBoxes would look exactly the same once they're finished... over and over the same problems :P ;D
  11. naja, im prinzip ist es das worum es geht ;) am besten, du suchst dir ein projekt aus (z.b. die MIDIBOX64) und fängst einfach mal das lesen an... im walkthrough für die MB64 ist eigentlich alles ziemlich gut und genau beschrieben; das sollte man auch auf englisch hinkriegen... du musst halt mal die verschiedenen projekte anschauen und entscheiden welches davon für dich das passende ist; wenn du dich besser auskennst kannst du auch sachen weglassen, die du nicht brauchst und eine klitzekleine box mit 16 fadern bauen; aber dafür braucht es schon ein wenig einarbeitung ins thema... (oder tatsächlich eine frage mit fragezeichen hintendran stellen ;) )
  12. also, ich schätze mal, der Hauptunterschied liegt einfach in dem Bereich der Druckmessung: SDX01G2: 0 - 1 psig/d norm bis 20 psi max MPXV5010: 0 - 10 kPa lt. Wikipedia ist ein psi (Pfund pro Quadradzoll... was es nicht alles gibt...) ~6894,757 Pa, d.h. wenn der SDX01G2 von 0 - 7 kPa misst, misst der MPXV5010 ca. 0 - 10 kPa... richtig? ich denke, das sollte kompatibel sein; allerdings weiß ich nicht, mit wieviel kPa man so typischerweise mit dem Mund bläst ??? Grüße, Michael
  13. b4ce1: scanmatrix 4x8x8, 256 contacts hwce: 4 scanmatrices, each 64 scanpoints = 256 die MIDIIO128 hat (wie der Name schon sagt 128 Inputs); ich weiß nicht genau ob man 8 DIN-Module an 1 Core reihen könnte, aber im Zweifelsfall kann man 2 Core-Module mit je 4 DINs betreiben und die zu sendenden MIDI-Befehle konfigurieren. siehe: http://www.ucapps.de/ => MIDI IO 128 und CORE + DIN (Digital In)
  14. Yes, but this wasn't really a problem. It has been more complex to drill a hole in the clip and mount a socket in there and to leave enough space that it doesn't get teared off once the clip will be opened... but anyway, I think these wobbly parts are the first ones I'll substitute... ...ah and the front glass has also been problematic, but one can fix everything with a "klebepistole" (soldering with melted plastic sticks, don't know the word??) But these goosenecks with clock have been much cheaper (~4 EUR if I remember right) than single goosenecks ;) (although I'm not sure, they're selling it anymore, this has been over a year ago...) Regards, Michael
  15. *schauder*, Oktaviren, das klingt für 8-bit Anwendungen ziemlich gefährlich ;D (sorry, den konnte ich mir nicht verkneifen...) nein, mal im Ernst: eine Midibox zu bauen macht sehr viel Spaß und wenn man es einmal heraus hat, ist auch das Programmieren ganz einfach, aber wie TK schon sagte, muss man sich am Anfang ganz viele Puzzleteilchen zusammensuchen und braucht schon ein wenig Ehrgeiz dafür :) Vielleicht wäre es für deine Oktavierung (wenn du sowieso schon alles am "Rechner" hast) für den drängenden Anfang ganz gut, einfach ein Midi-Programm zwischenzuschalten, bis die Midibox läuft... ich glaube mit Midi-Ox oder sowas kann man das bestimmt recht einfach hinkriegen (am Mac macht das z.B. MidiPipe, sowas gibt's bestimmt auch für'n PC)... da bekommt man auch gleich einiges über die MIDI-Zahlen mit, das schadet auch nicht... Grüße, Michael
  16. Thank you all for cheering me up :-* Won't take it so seriously anymore! (Just couldn't stop thinking about, because as an bloody autodidact in all excercises I never know if I'm missing sth very basic...)  ;D Best regards, Michael
  17. puhh :D thanks Thorsten, I thought, I did something wrong and just couldn't imagine how I could have offended anyone... don't want to cause you any work... I can live with a +/- Karma 8) best regards, Michael
  18. Just curios: 1. Why don't I see any applaud or smite items that I could click? Nor with Safari, Firefox or IE... there is nothing to click ??? 2. I'd really like to know why I got these ratings... I mean, perhaps I said something wrong, but if noone (incl. me) knows what was wrong, this feature is quite useless, isn't it? (I feel it's rather frustrating than motivating...) Am I missing something ???
  19. well, actually, this is not mine, but Thorsten showed me how to multiplicate two 8-bit values: http://www.midibox.org/forum/index.php?topic=5944.msg36574#msg36574 Thank you for the hint with the timer, you're right; this caused definitely an overflow :-[ Cheers, Michael
  20. Hi Goule, TK showed me (in the arithmetic thread ;) ); it's really simple, just put __asm and __endasm; around the assembler code: unsigned char Scale_8bit(unsigned char value, unsigned char min, unsigned char max) {  // scaled value is (<8-bit random> * <range>) >> 8  PRODL = value;   // 8bit value  PRODH = max-min+1; // range __asm   movf _PRODL, W   mulwf _PRODH, 0 __endasm;  return min + PRODH; } The expander/gate combo now works really great for me; but to make it work good one has to measure the values with a multimeter and calculate a bit... otherwise one might get lost in trial & error nirwana ::) This share of infos is really refreshing, btw :) Bye, Michael ps: I configured the expValues as const unsigned char[] = {...}, this might improve things, 'cause once the hard-wired sensors are calibrated, there's no need to change values by knobs (jeez, you surely know all this)...
  21. ...and here is my code for a "gate" (threshold and peak, values are filtered simply by being triggered very slowly) and an expander (expands values based on the 10-bit value); also an inverter to invert signals (127 - 0 => 0 - 127); the offset/peak values can be calculated/measured as followed: 10bit resolution: 0..1023 sensor range (measured): 0.4V - 3.1V => as 10bit value: 81..635 expOffset would be 81 to get the factor: 635 - 81 = 554 / 127 = 4,4 => rounded: 5 expFactor is 5 if we have a max value of 635, the expander does this calc: 635 / 5 = 127 tadaaa... 8) in the header: #define BUTTON_AIN_PEDAL 5 unsigned char sevenBitValue; unsigned int tenBitValue; unsigned char i; unsigned int k; unsigned char inverter[8]; signed char invertedValue; unsigned char gateEnabled[8]; unsigned char gateThreshold[8]; unsigned char gatePeak[8]; unsigned int gateCounter[8]; unsigned int gateTimeout; unsigned char expEnabled[8]; unsigned char expOffset[8]; unsigned char expFactor[8]; and this into main.c void Init(void) __wparam { /* -------- main Config --------- */ for(i=0; i<numAin; i++) { inverter[i] = 0; gateEnabled[i] = 0; gateThreshold[i] = 0; gatePeak[i] = 127; gateCounter[i] = 0; expEnabled[i] = 0; expOffset[i] = 100; expFactor[i] = 5; } // GATE ---------------------------------------------------------------- gateEnabled[0] = 1; // Distance Sensor gateThreshold[0] = 20; gatePeak[0] = 120; gateEnabled[1] = 1; // Distance Sensor gateThreshold[1] = 20; gatePeak[1] = 120; gateEnabled[2] = 1; // Pressure Sensor gateThreshold[2] = 0; gatePeak[2] = 120; gateTimeout = 40; // EXPANDER ------------------------------------------------------------ expEnabled[0] = 1; // Distance Sensor expOffset[0] = 81; // offset = minimum value (10-bit) expFactor[0] = 5; // factor = (max(635) - offset) / 127 expEnabled[1] = 1; // Distance Sensor expOffset[1] = 81; expFactor[1] = 5; // 635 - 81 = 554 / 127 expEnabled[2] = 1; // Pressure Sensor expOffset[2] = 255; expFactor[2] = 6; // 1024 - 270 = 754 / 127 // INVERTER ------------------------------------------------------------ inverter[2] = 1; } void Timer(void) __wparam { for(i=0; i<numAin; i++) { if(gateEnabled[i]) { // see posting below; this has been edited and corrected! if(gateCounter[i] >= 127) { gateCounter[i] = 0; } else { gateCounter[i]++; } } } } void AIN_NotifyChange(unsigned char pin, unsigned int pin_value) __wparam { if(gateEnabled[pin]) { // *** process GATE *** if(gateCounter[pin] >= gateTimeout) { // if it's time gateCounter[pin] = 0; // get + check 7bit value sevenBitValue = MIOS_AIN_Pin7bitGet(pin); if(sevenBitValue <= gateThreshold[pin]) { return; } if(sevenBitValue >= gatePeak[pin]) { return; } if(sevenBitValue == lastAinValue[pin]) { return; } } else { return; // not the time yet } } else { // no gate // get 7-bit value sevenBitValue = MIOS_AIN_Pin7bitGet(pin); } if(expEnabled[pin]) { // *** process EXPANDER *** tenBitValue = MIOS_AIN_PinGet(pin); if(tenBitValue <= expOffset[pin]) { sevenBitValue = 0; } else { tenBitValue = tenBitValue - expOffset[pin]; k = ADK_DIV(tenBitValue, expFactor[pin]); sevenBitValue = k; if(sevenBitValue > 127) { sevenBitValue = 127; } } } if(inverter[pin]) { // *** process INVERTER *** invertedValue = sevenBitValue - sevenBitValue - sevenBitValue; sevenBitValue = invertedValue + 127; } // last check to avoid sending duplicates: if(sevenBitValue == lastAinValue[pin]) { return; } // send MIDI data MIOS_MIDI_BeginStream(); MIOS_MIDI_TxBufferPut(0xB0 + pin); // CH 1 + pin MIOS_MIDI_TxBufferPut(0x14); // CC 20 MIOS_MIDI_TxBufferPut(sevenBitValue); // value MIOS_MIDI_EndStream(); // store input lastAinPin = pin; lastAinValue[lastAinPin] = sevenBitValue; } please note that this code is not yet optimized! the division ADK_DIV() comes from goule: http://www.midibox.org/forum/index.php?topic=5944.0 I also shortened to the essential, so don't wonder if there's someting missing... best regards, Michael
  22. ..so as promised, here are some pics of my sensors; these are from the previous prototype; I think, I'll remove the clips and mount them on a case once the MB is ready to be "packed"... as previously mentioned, I ripped some very cheap battery-powered clocks from IKEA® apart; the only thing remaining inside were the two SMD-LEDs; the buttons are currently unconnected, but it may be interesting connecting one of these buttons to the DIN and using them as an ON/OFF switch... ;)
  23. :D wonderful! this is working great! I'll send my source in the distance-sensor thread :) Michael
  24. I find this table very useful: http://www.midi.org/about-midi/table1.shtml => check all three tables! ;)
  25. well after thinking about a division of 2, I realized, that bit-operator can be really helpful. (the curse of autodidacts) maybe there are other newbies wondering how to divide / 2:  ;D 1023 >> 1 = 255 255 >> 1 = 127 and vice versa: 1 << 1 = 2 10 << 1 = 20 10 << 2 = 40 so easy ::) btw: I've just found "ch", a tool for the shell (all major os) to evaluate c-syntax: http://www.softintegration.com the standard edition comes for free ;D a lot easier than compiling (or even worser: compiling and sending to the PIC to evaluate)... cheers, Michael
×
×
  • Create New...