Jump to content

romsom

Programmer
  • Posts

    8
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

romsom's Achievements

MIDIbox Newbie

MIDIbox Newbie (1/4)

0

Reputation

  1. Hi Phatline, This may be a bit late, but what you are trying to do shouldn't be that much of a problem :) I refactored your code a little to understand better what it should do: int32_t value; uint8_t note_vel = Velo_From_Note[port]; uint8_t morph_vel = beat[port].Velo_Morph[x]; uint8_t morph_offset = beat[port].Velo_Morph_Offset; int32_t morph = ( ((vel / 127.0) * (morph_vel - 64.0)) / 64.0 ) * morph_offset; If all input values are ints then the only operations we should worry about are divisions. If we modify the formula so that there are no divisions anymore and we can verify that our data fits into a 32bit value we are fine. Note that divisions by constants get optimized by more recent compilers, so unless you want to emphasize the use of a shift operation you can simply use normal * and / operators and avoid feeling like driving your brain through a meat grinder ;) Because multiplications are associative and commutative we can write the formula like this: int32_t morph = vel * (morph_vel - 64) * morph_offset / (127 * 64); /* Now we multiply by 127 * 64 = 8128 and everything is integer */ int32_t morph_8128 = vel * (morph_vel - 64) * morph_offset; let's check if that fits into our 32bit value by adding the size of every factor variable. This works because a product of two variables with x bits fits into a variable with x+x bits The signed int can only represent a positive 31 bit value as the MSB is used for negative values. 31 >= 8 + 8 + 8 That is valid and therefore if the variables all have 8 bits they fit into 31 (or even 24) bits. When you add it to value, we have to have one bit in reserve because e.g. if they are both ((1<<24) - 1) we need 25 bits for that value value = morph + value Your code that checks the value needs to be adjusted, too: if (value < 0) value = 0; else if (value > 127 * 8128) value = 127 * 8128; return value / 8128; You can reduce the time those multiplications drastically if you stick to powers of 2 but you might get away with this here ;) Cheers, Roman
  2. Still there? :) In that case I'd like to take them.
  3. The advantages I can see are: - (as you mentioned) smaller footprint - OpenHardware (i.e. layout data is available) Especially the OH aspect can be important to some people (including me) for idiological and practical reasons. And while the board surely has its limitations it may be suitable for smaller, more specialized applications (e.g. SoftSynths, SamplePlayers etc. ; MidiboxKB-powered devices) I "recommended" this purely as a hardware component, and am familiar with Midibox/MIOS btw.
  4. You are probably well aware of the Cerb40, but I wanted to post it anyway, since it's pretty cheap, available (GHI, Watterott) and OpenHardware (CC-BY-SA) and has been used already e.g. with the PreenFM2: https://www.ghielectronics.com/catalog/product/450 Greetings, Roman
  5. Dann scheint mit meinem (relativ) frisch aufgesetzten System etwas nicht zu stimmen. Mit filezilla konnte ich in knapp 6 Stunden das Archiv endlich herunterladen (ca. 1 Reconnect pro Minute), nachdem bei meinem build ld noch Probleme macht. Es scheint jetzt alles zu funktionieren. :) Danke nochmal!
  6. Danke! Leider half auch der FTP-Client nicht weiter (weder ncftp noch filezilla, wie von Phil empfohlen). Die Downloadrate lag im Bereich von 1-5kB/s und nach ca. 500kB wurde die Verbindung zurückgesetzt. Ich habe die toolchain jetzt doch selbst gebaut, habe aber jetzt das Problem, dass mein System zu aktuell ist und einige Bibliotheken nicht mehr kompatibel sind. Ich werde es also nochmal in der virtuellen Maschine versuchen. EDIT: Die libgmp.so.3 musste noch nach /usr/lib/ kopiert werden! Ansonsten lief alles aber recht problemlos durch. Die einzige Änderung, die ich vorgenommen habe war, der Configure Zeile in 09-build-gdb.sh ein "--disable-werror" hinzuzufügen.
  7. Have you checked the size of the zip file? - It should be around 20MB. If the file is significantly smaller, your problem may be similar to mine: (Sorry for the German, it basically says that the download stops every time after about 500kB.) Regards, Roman
  8. Hallo! Gibt es eine alternative Quelle für die Toolchain? Im Wiki wird der folgende Link angegeben: ftp://ftp.lansystems.co.uk/pub/midibox/ Hier bricht der Download jedoch konsequent nach ca. 500kB ab. Wenn es eine Anleitung zum "Selberbauen" gibt, bin ich damit auch zufrieden. ;) Gruß und Danke, Roman EDIT: Gerade erst gesehen, steht vermutlich in Zusammenhang:
×
×
  • Create New...