Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. import React from 'react';
  2. import ReactDOM from 'react-dom';
  3. import { Song, Sequencer, Sampler, Synth } from '../src';
  4.  
  5. ReactDOM.render(
  6. <Song tempo={100}>
  7.  
  8. {/* this sample will loop every 2 bars (32 steps) */}
  9. <Sequencer resolution={16} bars={2}>
  10. <Sampler
  11. sample="samples/snare.wav"
  12. steps={[4, 12, 20, 28]}
  13. />
  14. </Sequencer>
  15.  
  16. {/* this one lasts 4 bars (64 steps) */}
  17. <Sequencer bars={4}>
  18. <Sampler
  19. sample="samples/kick.wav"
  20. steps={[
  21. 0, 8, 16, 23.25, 24, 26,
  22. 32, 40, 48, 56, 58
  23. ]}
  24. />
  25. </Sequencer>
  26.  
  27. <Sequencer bars={1}>
  28. <Sampler
  29. sample="samples/hihat.wav"
  30. steps={[0, 2, 4, 6, 8, 10, 12, 14]}
  31. />
  32. </Sequencer>
  33.  
  34.  
  35. <Sequencer resolution={16} bars={2}>
  36. <Synth
  37. type="sawtooth"
  38. volume={15}
  39. envelope={{
  40. attack: 0.01,
  41. sustain: 0.2,
  42. decay: 0,
  43. release: 0.1,
  44. }}
  45. steps={[
  46. [0, .75, 'd#2'],
  47. [1, 1, 'd#2'],
  48. [3, .75, 'd#2'],
  49. [4, 1, 'f#3'],
  50. [6, 1, 'f3'],
  51.  
  52. [8, 1, 'a#2'],
  53. [11, .75, 'a#2'],
  54. [12, 1, 'c#3'],
  55. [14, 1, 'f3'],
  56.  
  57. [16, 1, 'a#2'],
  58. [19, .75, 'a#2'],
  59. [20, 1, 'c#3'],
  60. [22, 1, 'f3'],
  61.  
  62. [24, 1, 'f#3'],
  63. [26, .75, 'f#3'],
  64. [28, 1, 'f#3'],
  65.  
  66. [26, 4, 'd#1'],
  67. ]}
  68. />
  69. </Sequencer>
  70. </Song>,
  71. document.getElementById('root')
  72. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement