Project log

Sat Sep 28 18:42:10 CEST 2019
- trying to get together info about how to enable pitch knob when recording 
  on PMD221 
	- https://www.diystompboxes.com/smfforum/index.php?topic=107627.0
		- seems like everyone is experiencing the high-pitched hiss
	- https://www.gearslutz.com/board/geekslutz-forum/926423-small-mod-tape-echo-speed-control.html
		- describes the motor pitch mod
	- http://proto-schlock.blogspot.com/2015/04/echo-matic-diy-tape-delay.html
		- post from which I learned about echomatic
- took tape player apart, measured resistance, there really is a another fixed
  tap. deciding what's the best way to bridge it.
- marantz pmd221 requires 4.5V power supply with center-negative barrel connector
- decide whether to ask someone else for help to determine if my unit is
  faulty
- I cleaned tape heads with IPA
- I tried to drive speed of walkman motor with pwm + lowpass + opamp +
  transistor, but same as the last time, I get high pitch noise an dunreliable
  drive (motor stops and doesn't want to run) + the transistor overheats.
  maybe I'm missing shottky diode in the reverse direction, but I have no idea
  what's wrong. maybe I should ask someone.
- TODO:
	. Schottkyho dioda 1N5819
	. small dc motor

Sun Sep 29 11:07:52 CEST 2019
- trying to create MiST hd image with cracked Cubase on it
	- https://github.com/mist-devel/mist-board/wiki/AtariMassStorage
		- the article goes in great lengths about how to create
		  harddisk image, then it just off-handedly mentiones there's
		  a prepared one...
	- works now
- a lot of key shortcuts in cubase are on numerical keypad which I don't have.
  also the key-mapping is kinda off (where's undo key? where's help key?). and
  I need to find a proper manual.
- TOD0:
	* get a proper usb keyboard with numpad (borrow from work?)
- still can't mute tracks
	- http://www.atari-forum.com/viewtopic.php?t=29656

Wednesday
- Atari keeps crashing when in use it for sequencing, maybe I would have to
  get a real atari

Thu Oct  3 11:20:57 CEST 2019
- old notes about ADC input signal filtering:
	- http://tinyurl.com/y88vumjb (inverting amp solution)
	- http://tinyurl.com/y8khkhno (cheap solution)
- another piece of knowledge: electret microphone requires power supply to
  work (there's a JFET inside!)
~~~
- got alesis sr-16 through mail. it doesn't have that weird midi bug.
- zebrak doesn't want to work over midi, I don't feel like debugging it now
- cubase 3.01 works better (no crash yet)


Fri Oct  4 19:53:58 CEST 2019
- making attiny13a lfo for echo
	- it has clock input and works as a clock divider
- made a CV mixing circuit with non-inverting amp. I need to figure out why is
  cv mixing module from doepfer doing it completely different way:
	http://www.doepfer.de/DIY/a100_diy.htm
	- the curve of cv mixer looks like: `a/(1 + 2*a - 2*a^2)`


Sat Oct  5 11:32:08 CEST 2019
- free day, need to start cracking on projects
- TODO
	. buy digital a pot (from mcp) for pt2399 or to replace pots
- I breadboarded pt2399 echo. It isn't as impressive as it was the last time
  (I struggled to get that radiophonic sound out of it). It sounds kinda off.
  I had some troubles to get it even running (btw: if oscillator pins (7, 8)
  are not connected to ground via caps, the chip starts consuming high current
  - 150mA or so, where as normally it would eat 17-30mA). But LFO works nice.
- What I need to do:
	* Calculate how I moved the filter cutoff frequency by using very
	  approximate cap/resistor values
		=> I did that. The cutoff is a bit lower, but so is the Q of the filter
	* Add a pre-amp that ups the gain a bit (line is +-0.7V? The delay
	  circuit can do +-2.5V so the resonance is much stronger than input
	  signal)
		=> oh yeah! that was the missing ingredient
	* Do a perfboard of the echo circuit, so that I wouldn't have to debug
	  the whole circuit every time it stops working
		=> done
- The new strategy is interesting... Doing what I feel like doing...
- I need to find a box for this project


Sun Oct  6 10:24:41 CEST 2019
- I have a slight obsession with PT2399
- this is how erebus does variable resistor on pin 6:
	http://tinyurl.com/y6zzvk8x
  It's that weird reverse-biased bjt transistor that I do not understand much
- I built a pt2399 circuit on perfboard (without the lfo part). wheew, that
  took me almost all day! I had to resolder one jack connector because it had
  bad contact, but otherwise it worked ok.
- the clock divider settings on lfo are useless (I did it all wrong)
- maybe if I had ordered
	https://www.aliexpress.com/item/32907057952.html [TODO]
	"diymore PT2399 Digital Microphone Amplifier Board Karaoke Reverberation Board Karaoke OK Amplifier Module Dual AC 12V"
  I could have saved myself a day of work
	
Mon Oct  7 13:03:21 CEST 2019
- looking for ways to modulate the CV on pin6. so far I've got
	- erebus method (pnp bjt)
	- this method: http://sdiy.org/destrukto/vc-echo.html
		- weird things: diode in op-amp feedback, op-amp controlling bjt
	- vactrol
- Bought an e-mu e4xt for more money that I should have. And I for some reason
  thought it has RFX32, which it doesn't - it has just the crappy EMU8000 effects
  chip.

Tue Oct  8 16:16:00 CEST 2019
- nothing. the pads on mpc500 suck

Thu Oct 10 21:05:18 CEST 2019
- reading this: https://www.residentadvisor.net/features/3526


Sun Oct 13 22:55:32 CEST 2019
- I've read parts of this: Composing with Tape Recorders: Musique Concrete for
  Beginners. It seems like a really good book. I'll try to follow the
  excersises using my E4XT as "tape recorder".  I was thinking about how to
  avoid having to use sequencer: using just sampler and keystep and recording
  everything live (or resampling and gluing everything together later) seems
  like an interesting way to avoid having to run sequencer.
- I'm thinking about building a simple modular with M4 screws and crocodiles
  and modules on perfboard.

Monday
- added support for UC-33e to zebrak
- fantasizing about building a modular from LMNC
- did some collages, but in Audacity

Tue Oct 15 14:17:26 CEST 2019
- diode equation `I=Is*(exp(Vd/(n*Vt)) - 1)`
	n = 2 (diode specific)
	Vt = 25.8563 mV
	Is = 1.7143e-7
- some javascript:
	function fd(V) { return 1.7143e-7*(Math.exp(V/(2*25.8563e-3)) - 1); }
- IDEA: make a site similar to weekly beats but for tape music?


Sat Oct 26 17:23:10 CEST 2019
- weird how the time shifted ten days forward, but I was in Budapest and then
  working/recovering from being drunk
- playing around with solving equations using recurrence relations (ie.
  quadratic equation)


Sun Oct 27 21:45:27 CET 2019
- solving transistor circuits
- TODO: buy hp-39gs or hp-35gs
- steal electret mic circuit from this:
  atmel-42777-digital-sound-recorder-using-dac-with-attiny817_applicationnote_avr42777.pdf


Mon Oct 28 11:17:47 CET 2019
- there's a fine balance between wanting to understand something and getting
  stuff done (ie. no point in trying to understand transistors when in reality
  I have rarely the opportunity to design something with them)
- some "transistor" links:
	https://hackaday.com/2018/05/04/biasing-that-transistor-part-1-the-common-emitter-amplifier/
	https://hackaday.com/2016/12/07/you-can-have-my-lm386s-when-you-pry-them-from-my-cold-dead-hands/
	https://hackaday.com/2018/08/10/circuit-vr-starting-an-amplifier-design/
	https://hackaday.com/2018/08/17/circuit-vr-a-tale-of-two-transistors/
	https://wiki.analog.com/university/courses/electronics/text/chapter-9
	https://en.wikipedia.org/wiki/Load_line_(electronics)


Wed Oct 30 16:03:55 CET 2019
- TODO: there's bunch of various cheap STM32F* boards on aliexpress
	- ie. STM32F030...
- Today (and yesterday night) I put together 23LC1024 RAM (1024), Arduino,
  mic preamp and made a playback recorder (with reverse play function). The
  quality of atmega ADC is attrocious, I'm thinking of using stm32f103
  instead.


Thu Oct 31 19:16:37 CET 2019
- I have to get the stm32f103 board working...
- attempt #1: programming it via serial
	- https://maker.pro/arduino/tutorial/how-to-program-the-stm32-blue-pill-with-arduino-ide
	- vcc, gnd, rx to A9, tx to A10
	- boot0:1, boot1:0
	- this works (and now I remember I used to do it that way previously)
- attempt #2: flashing bootloarder via serial, then using the bootloader
	- https://www.onetransistor.eu/2017/11/stm32-bluepill-arduino-ide.html
	- ~/.arduino15/./packages/stm32duino/tools/stm32tools/2019.6.29/linux/stm32flash/stm32flash -w ~/D/generic_boot20_pc13.bin -v -g 0 /dev/ttyUSB0
	- this really did flash the bootloader. when I did put the jumpers
	  back, it flashes diode in weird way signalizing (probably) presence
          of the bootloader
	- no luck uploading sketches via arduino ide (as stm32duino loader)
	- [NOT TRUE] USB id is in fact: ID 1eaf:0004
		- [NOT TRUE] may need to be changed in ".arduino15/packages/stm32duino/hardware/STM32F1/2019.6.29/boards.txt"
	- arduino builds are in /tmp/arduino_build_*
	- it seems that `dfu-util` couldn't open USB device, adding a proper udev file helped
	- the command that arduino runs (and is unsuccessful)
		/home/thement/.arduino15/packages/stm32duino/tools/stm32tools/2019.6.29/linux/maple_upload ttyACM0 2 1EAF:0004 /tmp/arduino_build_820636/stm32_blink.ino.bin
		/home/thement/.arduino15/packages/stm32duino/tools/stm32tools/2019.6.29/linux/dfu-util/dfu-util -d 1EAF:0004 -a 2 -D /tmp/arduino_build_820636/stm32_blink.ino.bin -R
	- my command:
		~/.arduino15/./packages/stm32duino/tools/stm32tools/2019.6.29/linux/dfu-util/dfu-util --alt 2 -D stm32_blink.ino.bin 
	- oh fuck, so the `1eaf:0003` was correct, only the permissions (udev) were missing
	- also another thing: the reseter didn't work. I removed it. I would have to press reset manually but that's ok
- tried electret microphone, cannot get it working... and I'm not in mood to investigate
- now, I did the arduino sound playback parrot, I have to port it for
  stm32f103. this is how to proceed:
	- get audio output (pwm) working
	- get audio input (adc) working
	- get SPI RAM working
	- try to find SD card library
	- put it together with button reader etc.
- some inspiration on how to setup timers etc.:
	https://github.com/Dustify/Tuneolator/blob/master/src/main.cpp
	https://github.com/tkleisas/digeonsynth


Fri Nov  1 20:22:24 CET 2019
- trying to get PWM working (via libmaple) to find out the range of pwm and
  stuff. the plan is to check it works correctly, then go and fix mozzi
  library to play stuff correctly.
- mozzi reference points:
	audio_update_timer
		HardwareTimer audio_update_timer(AUDIO_UPDATE_TIMER);
			audio_update_timer.pause();
			audio_update_timer.setPeriod(1000000UL/AUDIO_RATE);
			audio_update_timer.setChannel1Mode(TIMER_OUTPUT_COMPARE);
			audio_update_timer.setCompare(TIMER_CH1, 1);  // Interrupt 1 count after each update
			audio_update_timer.attachCompare1Interrupt(pwmAudioOutput);
			audio_update_timer.refresh();
			audio_update_timer.resume();
  		HardwareTimer audio_pwm_timer(AUDIO_PWM_TIMER=4);
			audio_pwm_timer.setPrescaleFactor(1);
			audio_pwm_timer.setOverflow(1 << AUDIO_BITS_PER_CHANNEL);
	pwmAudioOutput()
		- irq handler
		pwmWrite(AUDIO_CHANNEL_1_PIN, (int)output_buffer.read());
	startSecondAudioADC
		- adc conversion
		- uses
			STM32ADC adc(ADC1);

Sat Nov  2 09:51:22 CET 2019
- continuing to making audio on stm32 work
	- pwm sort of works, need to get audio generation interrupt working
	- also: need to somehow set adc to lower speed to improve precision at least somehow
- audio generation (440Hz saw) works, the filtering could be better though
- adc entry points:
	init
		setup_adcs
			adc_default_config
				adc_enable_single_swstart
				adc_set_sample_rate
					// input clock divider
					adc_prescaler w_adc_pre = ADC_PRE_PCLK2_DIV_6;
					// how many cycles to spent sampling
					adc_smp_rate w_adc_smp = ADC_SMPR_55_5;
- ADC sample rate can be changed in:
	./packages/stm32duino/hardware/STM32F1/2019.6.29/variants/generic_stm32f103c/wirish/boards_setup.cpp
	(look for ADC_SMPR_55_5, change it to ADC_SMPR_239_5 for the lowest sample rate)
- neither caps nor lowering sample rate lowers the ADC noise much
- ok, audio passthrough works, without the filtering it has that sparkling quality of audio aliasing


Thu Nov  7 12:49:04 CET 2019
- days before: I can't get clean signal out of stm32 to amp - maybe the lm386
  amp board is too high-gain or I don't know
- built an enclosure for FV-1 out of box FV-1 came in. It works very well, I
  even managed to get custom effect from EEPROM running.
- for the next steps I need to the the folowing thins:
	. (optional) find shell for arduino/stm32
		- something like this but for arduino:
		  https://hackaday.com/2018/11/10/arduino-gets-a-command-line-interface/
	* write eeprom loader/dumper for arduino
		- this one shouldn't be hard, I just need a protocol parser
	* make an output connector
	. start collecting fv-1 effects
		- maybe even start FV-1 page
	* fix asfv-1 to assemble negative constants
		- https://pypi.org/project/asfv1/
		=> wrote to the author, turns out I have to use the `-s` compat option


Fri Nov  8 21:37:07 CET 2019
- resoldered headers on my bluepills (high temperature, not like the last
  time)
- made i2c "connector" for fv-1 effect so that I can connect i2c eeprom
  programmer
- trying to make blue-pill act as I2c programmer, but it doesn't work (it's
  stuck, not sure why)
- well, my bad, I forgot that not only SDA, but SCL has to be pulled-up as
  well. This is because OPEN_OPEN_DRAIN mode that doesn't actually source any
  current, it's either high-impedance (1) or sinks current (0).
- trying to sort the printf situation absence once and for all

Sat Nov  9 11:50:09 CET 2019
- finished EEPROM loader/dumper, now trying fv-1 EEPROM in-system-programming
- what's in eeprom now:
	0. echo
	1. dance_ir_fla_l.spn
	2. dance_ir_h_l.spn
	3. dance_ir_ptz_l.spn
	4. greenwood
	5-7. plate echos
- OK, I can do ISP well. However, it would be nice to have a connector with
  integrated pull-up resistors so I would have to breadboard it every time
  manually. Welp...
- also: SpinCAD designer works surprisingly well, but the blocks (filters for
  instance) sound like mid-90's Rolandish hardware...

Sun 23 May 2021 10:04:16 AM CEST

It's just 10am and I have most work on minty synth for today done. So far I've
done:

- implemented variant 1 of the autolooping sequencer: you play whatever you
  want, but make sure you end with the first beat of the following bar - the
  sequencer will loop it automatically
- tried lgt8f328p inside minty box instead of Arduino UNO - the ADC on the
  WAVGAT is much noisier than the one on UNO, I can get any reasonable knob
  reading, so I'll have to investigate this
- I didn't try the filter, the WAVGAT output was also somehow distorted, I'll
  have to investigate this


Sun 23 May 2021 10:48:26 PM CEST

- It's weird, the previous entry feels like it was written on another day
- I did manage to implement the filter. So far the only option is to set fixed
  cutoff and resonance per instrument which is updated real-time. It sounds
  OK, no weird integer wraparounds or anything, but I have to recheck how loud
  it's going in and where to clip it (because the output volume is supposed to
  be 2x the range so there's option to clip the sound if desired).
- I put together lm13700 variable frequency one-pole filter. All my
  calculations were OK this time. Needs an exponential converter though.


Mon 24 May 2021
- I managed to get whole 5V late Korg MS-20 filter working. It has a weird
  resonance crackle, but only when it saturates the output. I think that the
  problem is that it doesn't have enough headroom for the resonance whistle to
  get through.

Tue 25 May 2021 12:35:26 PM CEST
- Today I'll design PCBs for the filter and for envelope and get it
  manufactured.

  ...

- I designed one sided PCB for the envelope (without any wire jumpers!). The
  MS-20 filter will be a little tougher to make, because there are three
  voltage levels (Gnd, Vcc and Vref) and generally has a lot more cycles. My
  idea is to step-up the technology game with each board, and do two sided
  board for the filter. I also got idea to get some PCBs made in JLPCB - the
  only problems the minimum quantity is five, so maybe design a
  quasi-poly-synth and use the extra boards as voice-cards.
- The other idea I had was to use arduino-like stackable pinhaders for the
  cards and run power through them, which would solve some problems with
  wiring (and power distribution), but I would have to redesign the board to
  take advantage of it. Hmm I'll have a think about it.

Tue 01 Jun 2021 09:52:14 AM CEST
- Over the weekend I went to see my parents and I had some time on the train
  so I did layout for the 5V MS-20 filter on a grid paper. It was a bit more
  convoluted than the env/lfo, so I had to do it double-sided (unfortunately
  the PCB fab I'm using can't do plated through holes, so I would have to
  solder some components from both sides).
- I have to do list of all projects that need to be done so I could rest in
  peace and do something other for a change. The idea is to somehow use all
  the garbage I've bought on internet over the years. So the projects to be
  done are:

  * MS-20 filter with LM13700
  . figure out ADC readings
  . clock for Barb. with bubble LED display (possibly written in Rust for AVR)
  . tape echo
  * TI-55 calculator cleanup and restoration
  . autolooping sequencer
  / 3d printed CF floppy for E-mu (can get more RAM after that)
  . finish Herbs and Stones
  . infinite acid banger sequencer (I can get an extra mono if I finish this)
  ...
  . upload firmware to hp calculator (once I get overlays)
  . simple mixer based on 4069 (in croc clips format), laser-cut box
  . solar sounders
  . PT2399 echo with exponentiator
  . wash the Sharp calculator
  . lgt8f328p synth with filter


Wed 02 Jun 2021 10:38:24 PM CEST
- the PCBs are in

Fri 04 Jun 2021 12:13:36 AM CEST
- stayed home sick today, drilled new holes into the effect box

Sat 05 Jun 2021 04:29:47 PM CEST
- I completed the effect box.

Sun 06 Jun 2021 02:12:41 PM CEST
- I finished restoring the calculators, now I'm making clock for Barb.